三合一

This commit is contained in:
2026-02-05 20:57:28 +08:00
parent fce706198a
commit 0615b032ff

View File

@@ -196,6 +196,9 @@
<el-dialog v-model="streamdialogVisible" :title="$t('hostsList.specifyRooms') || '指定直播间'" width="600px">
<el-input v-model="textarea" :rows="10" type="textarea"
:placeholder="$t('hostsList.enterRoomIds') || '请输入房间ID每行一个'" @input="handleInput" />
<div class="mt-2 text-sm text-slate-500">
{{ currentLineCount }} / {{ maxSpecifyLines }}
</div>
<template #footer>
<div class="flex justify-end gap-2">
<el-button @click="specifyCancel">{{ $t('hostsList.cancelSpecify') || '取消指定' }}</el-button>
@@ -209,7 +212,7 @@
</template>
<script setup>
import { ref, reactive, onMounted, onBeforeUnmount } from "vue";
import { ref, reactive, onMounted, onBeforeUnmount, computed } from "vue";
import { usePythonBridge } from "@/utils/pythonBridge";
import { getUser } from "@/utils/storage";
import { getCountryName } from "@/utils/countryUtil";
@@ -434,13 +437,24 @@ function stopTimerfun() {
}
// Specify Room Logic
const MAX_SPECIFY_LINES = 50;
// 动态计算最大行数限制tenantId=12741 为 5000 条,其他为 50 条
const maxSpecifyLines = computed(() => {
return userInfo.value.tenantId == 12741 ? 5000 : 50;
});
// 当前行数
const currentLineCount = computed(() => {
if (!textarea.value || textarea.value.trim() === "") {
return 0;
}
return textarea.value.split("\n").filter(line => line.trim() !== "").length;
});
function handleInput(value) {
if (typeof value !== "string") return;
const lines = value.split("\n");
if (lines.length > MAX_SPECIFY_LINES) {
textarea.value = lines.slice(0, MAX_SPECIFY_LINES).join("\n");
if (lines.length > maxSpecifyLines.value) {
textarea.value = lines.slice(0, maxSpecifyLines.value).join("\n");
}
}