import { defineComponent, ref, reactive, computed, unref, useSSRContext } from 'vue'; import { ssrRenderAttrs, ssrInterpolate, ssrIncludeBooleanAttr, ssrLooseContain, ssrLooseEqual, ssrRenderList, ssrRenderAttr, ssrRenderClass } from 'vue/server-renderer'; import { u as useApi } from './useApi-BNSkSrat.mjs'; import { u as useToast } from './useToast-MBvLaNjH.mjs'; import { A as ALL_LANG_OPTIONS, l as langName } from './useLangOptions-CXXbv5NM.mjs'; import { _ as _export_sfc } from './server.mjs'; import '../nitro/nitro.mjs'; import 'node:http'; import 'node:https'; import 'node:events'; import 'node:buffer'; import 'node:fs'; import 'node:path'; import 'node:crypto'; import 'node:url'; import '../routes/renderer.mjs'; import 'vue-bundle-renderer/runtime'; import 'unhead/server'; import 'devalue'; import 'unhead/utils'; import 'pinia'; import 'perfect-debounce'; const PRIMARY_LANG = "zh-CN"; const _sfc_main = /* @__PURE__ */ defineComponent({ __name: "meettemplates", __ssrInlineRender: true, setup(__props) { const SYNC_FIELDS = [ { key: "ttype", label: "类型 ttype" }, { key: "tags", label: "标签 tags" }, { key: "icon", label: "图标 icon" }, { key: "title", label: "标题 title", translated: true }, { key: "description", label: "描述 description", translated: true }, { key: "outline", label: "大纲 outline", translated: true }, { key: "template", label: "模板内容 template", translated: true } ]; useApi(); useToast(); const view = ref("list"); const rows = ref([]); const loading = ref(false); const detailLoading = ref(false); const submitting = ref(false); const catFilter = ref(""); const typeFilter = ref(""); const kwFilter = ref(""); const current = ref(null); const curLang = ref(""); const form = reactive({ id: 0, title: "", tid: "", language: "", ttype: "", tags: "", icon: "", description: "", outline: "", template: "" }); const syncOpen = ref(false); const syncFields = ref([]); const syncLangs = ref([]); const addLangOpen = ref(false); const newLang = ref(""); const newLangErr = ref(""); const createOpen = ref(false); const createTid = ref(""); const createTitle = ref(""); const createLang = ref(PRIMARY_LANG); const createErr = ref(""); function tagList(s) { return (s || "").split(",").map((x) => x.trim()).filter(Boolean); } function isImg(s) { return /^https?:\/\//i.test(s || ""); } function isPrimary(lang) { return lang === PRIMARY_LANG; } function catOf(tid) { const i = (tid || "").indexOf("-"); return i > 0 ? tid.slice(0, i) : "其他"; } function initials(c) { const t = (c.primary.title || c.tid || "?").trim(); return t.slice(0, 1).toUpperCase(); } const cards = computed(() => { const byTid = /* @__PURE__ */ new Map(); rows.value.forEach((t) => { const k = t.tid || ""; if (!byTid.has(k)) byTid.set(k, []); byTid.get(k).push(t); }); const out = []; byTid.forEach((items, tid) => { const langs = items.slice().sort((a, b) => { if (isPrimary(a.language) !== isPrimary(b.language)) return isPrimary(a.language) ? -1 : 1; return (a.language || "") < (b.language || "") ? -1 : 1; }); const zh = langs.find((t) => isPrimary(t.language)); out.push({ tid, primary: zh || langs[0], hasPrimary: !!zh, langs }); }); return out.sort((a, b) => a.tid < b.tid ? -1 : 1); }); const catOptions = computed( () => Array.from(new Set(cards.value.map((c) => catOf(c.tid)))).sort() ); const typeOptions = computed( () => Array.from(new Set(rows.value.map((t) => t.ttype).filter(Boolean))).sort() ); const filteredCards = computed(() => { const kw = kwFilter.value.trim().toLowerCase(); return cards.value.filter((c) => { if (catFilter.value && catOf(c.tid) !== catFilter.value) return false; if (typeFilter.value && c.primary.ttype !== typeFilter.value) return false; if (!kw) return true; return `${c.tid} ${c.primary.title} ${c.primary.description}`.toLowerCase().includes(kw); }); }); const otherLangs = computed( () => (current.value?.langs ?? []).map((t) => t.language).filter((l) => l && l !== curLang.value) ); const addableLangs = computed(() => { const has = new Set((current.value?.langs ?? []).map((t) => t.language)); return ALL_LANG_OPTIONS.filter((o) => !has.has(o.code)); }); return (_ctx, _push, _parent, _attrs) => { _push(`
会议纪要公共模板(source=public),所有应用共享。同一 tid 下每种语言一份,卡面展示 ${ssrInterpolate(PRIMARY_LANG)} 版本。修改后各服务约 10 分钟内自动同步。
以 ${ssrInterpolate(curLang.value)} 版本为源,把勾选字段覆盖写入所选语言版本。 标题/描述/大纲/模板属译文,覆盖后目标语言的译文会丢失,请谨慎勾选。
新版本以当前 ${ssrInterpolate(curLang.value)} 版本的内容为初稿,创建后再逐项译成目标语言。
先建出主语言版本,创建后在详情页补齐内容,再用「添加语言」扩展其他语言。
`); if (createErr.value) { _push(`${ssrInterpolate(createErr.value)}`); } else { _push(``); } _push(`