import { defineComponent, ref, reactive, computed, useSSRContext } from 'vue'; import { ssrRenderAttrs, ssrRenderStyle, ssrRenderList, ssrInterpolate, ssrRenderAttr, ssrIncludeBooleanAttr, ssrLooseContain, ssrLooseEqual, ssrRenderClass } from 'vue/server-renderer'; import { u as useApi } from './useApi-B-E5eLsI.mjs'; import { u as useToast } from './useToast-CS21XT61.mjs'; import './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'; import './useLoading-D4zrSa2m.mjs'; const _sfc_main = /* @__PURE__ */ defineComponent({ __name: "product", __ssrInlineRender: true, setup(__props) { useApi(); useToast(); const deviceTypes = { 0: "未知", 1: "经典蓝牙", 2: "BLE双端", 3: "BLE单端", 4: "录音笔", 5: "智能眼镜", 6: "激活码卡片" }; const deviceTypeOptions = { 0: "未知", 1: "经典蓝牙耳机", 2: "BLE双端", 3: "BLE单端", 4: "智能录音笔", 5: "智能眼镜", 6: "激活码卡片" }; const toggleFields = [ { key: "iscanbindagain", label: "可重复绑定奖励" }, { key: "iscontinuouschat", label: "连续对话" }, { key: "eqenable", label: "EQ 均衡器" }, { key: "keyenable", label: "按键控制" }, { key: "workmodeenable", label: "工作模式" }, { key: "callmodeenable", label: "通话模式" }, { key: "ledenable", label: "LED 灯" }, { key: "finddeviceenable", label: "查找设备" }, { key: "noisereductionenable", label: "降噪" }, { key: "shutdownenable", label: "定时关机" }, { key: "showcasebattery", label: "充电盒电量" }, { key: "wakeupenable", label: "唤醒控制" }, { key: "broadcastpeertranslate", label: "播报对方翻译" }, { key: "hideaiassistant", label: "隐藏AI助手" } ]; const view = ref("list"); const rows = ref([]); const brands = ref({}); const brandOptions = ref([]); const loading = ref(false); const submitting = ref(false); const isEditing = ref(false); function emptyToggles() { const o = {}; toggleFields.forEach((t) => { o[t.key] = false; }); return o; } const form = reactive({ id: 0, devicename: "", brandid: 0, devicetype: 0, scanuuid: "", devicecodecount: 1, productimage: "", channel: "official", bindrewardvpitime: 0, bindrewardtranslate: 0, bindrewardmeeting: 0, toggles: emptyToggles() }); const mobileExtra = reactive({ platform_id: "", platform_key: "", tui: "" }); function hexId(id) { return id ? Number(id).toString(16).toUpperCase() : ""; } function featureCount(p) { return toggleFields.filter((t) => !!p[t.key]).length; } ref(null); const imgUploading = ref(false); const currentProduct = ref(null); const versions = ref([]); const versionSubmitting = ref(false); const ver = reactive({ version: "", desc: "", isuse: false }); const otaFile = ref(null); const canAddVersion = computed(() => !!ver.version.trim() && !!otaFile.value); function isCurrentVer(v) { return !!currentProduct.value?.versionid && v.id === currentProduct.value.versionid; } return (_ctx, _push, _parent, _attrs) => { _push(`

产品列表

`); if (loading.value) { _push(``); } else if (!rows.value.length) { _push(``); } else { _push(``); } _push(``); ssrRenderList(rows.value, (p) => { _push(``); }); _push(`
ID图片名称品牌商类型版本功能操作
暂无数据
${ssrInterpolate(hexId(p.id))}`); if (p.productimage) { _push(``); } else { _push(`
`); } _push(`
${ssrInterpolate(p.devicename)}${ssrInterpolate(brands.value[p.brandid] || "")}${ssrInterpolate(deviceTypes[p.devicetype] || p.devicetype)}`); if (p.version) { _push(`${ssrInterpolate(p.version)}`); } else { _push(`-`); } _push(`${ssrInterpolate(featureCount(p))}/14

${ssrInterpolate(isEditing.value ? "编辑产品" : "新增产品")}

基本信息

`); if (form.productimage) { _push(`
`); } else { _push(``); } _push(`
绑定奖励设置
功能开关
`); ssrRenderList(toggleFields, (t) => { _push(``); }); _push(`

版本管理 - ${ssrInterpolate(currentProduct.value?.devicename || "")}

`); if (currentProduct.value) { _push(`
产品ID:${ssrInterpolate(hexId(currentProduct.value.id))}当前版本:${ssrInterpolate(currentProduct.value.version || "无")}版本ID:${ssrInterpolate(currentProduct.value.versionid || "无")}更新包:${ssrInterpolate(currentProduct.value.updatepackageaddress || "无")}
`); } else { _push(``); } _push(`

添加新版本

`); if (!versions.value.length) { _push(``); } else { _push(``); } _push(``); ssrRenderList(versions.value, (v) => { _push(``); }); _push(`
ID版本号描述更新包地址操作
暂无版本
${ssrInterpolate(v.id)}${ssrInterpolate(v.version)}`); if (isCurrentVer(v)) { _push(`当前`); } else { _push(``); } _push(`${ssrInterpolate(v.description || "")}${ssrInterpolate(v.updatepackageaddress || "")}
`); if (isCurrentVer(v)) { _push(`使用中`); } else { _push(``); } _push(`
`); }; } }); const _sfc_setup = _sfc_main.setup; _sfc_main.setup = (props, ctx) => { const ssrContext = useSSRContext(); (ssrContext.modules || (ssrContext.modules = /* @__PURE__ */ new Set())).add("pages/product.vue"); return _sfc_setup ? _sfc_setup(props, ctx) : void 0; }; export { _sfc_main as default }; //# sourceMappingURL=product-ZlfAs6Rj.mjs.map