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(`
| ID | 图片 | 名称 | 品牌商 | 类型 | 版本 | 功能 | 操作 |
|---|---|---|---|---|---|---|---|
| 暂无数据 | |||||||
| ${ssrInterpolate(hexId(p.id))} | `);
if (p.productimage) {
_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 | |
| 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(` |