import { defineComponent, ref, reactive, mergeProps, useSSRContext } from 'vue'; import { ssrRenderAttrs, ssrRenderStyle, ssrRenderAttr, ssrIncludeBooleanAttr, ssrLooseContain, ssrLooseEqual, ssrRenderList, ssrInterpolate } 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: "code", __ssrInlineRender: true, setup(__props) { useApi(); useToast(); const view = ref("list"); const loading = ref(false); const isEditing = ref(false); const currentBrandId = ref(0); const filterStatus = ref(-1); const codes = ref([]); const brands = ref([]); const allProducts = ref([]); const brandMap = reactive({}); const form = reactive({ code: "", productid: 0, remark: "", bindrewardvpitime: 0, bindrewardtranslate: 0, bindrewardmeeting: 0, maxuses: 0, expire: "", disabled: false }); function formatTs(ts) { if (!ts) return "永久"; return new Date(ts * 1e3).toLocaleString(); } function facName(c) { return brandMap[c.brandid] || (c.brandid ? "品牌商#" + c.brandid : "-"); } function prodName(c) { const prod = allProducts.value.find((p) => p.id === c.productid); return prod ? prod.devicename || "#" + c.productid : c.productid ? "#" + c.productid : "-"; } ref(null); ref(null); const currentQrCode = ref(""); return (_ctx, _push, _parent, _attrs) => { _push(`
`); if (loading.value) { _push(``); } else if (!codes.value.length) { _push(``); } else { _push(``); } _push(``); ssrRenderList(codes.value, (c) => { _push(``); }); _push(`
公码品牌商关联产品备注VIP天/翻译分/会议分核销/上限失效时间状态操作
加载中…
${ssrInterpolate(currentBrandId.value ? "暂无公码,点击右上角“新增公码”创建" : "暂无公码")}
${ssrInterpolate(c.code || "")}${ssrInterpolate(facName(c))}${ssrInterpolate(prodName(c))}${ssrInterpolate(c.remark || "-")}${ssrInterpolate(c.bindrewardvpitime || 0)} / ${ssrInterpolate(c.bindrewardtranslate || 0)} / ${ssrInterpolate(c.bindrewardmeeting || 0)}${ssrInterpolate(c.useduses || 0)} / ${ssrInterpolate(c.maxuses ? c.maxuses : "∞")}${ssrInterpolate(formatTs(c.expiretime))}`); if (c.status === 0) { _push(`启用`); } else { _push(`停用`); } _push(`

${ssrInterpolate(isEditing.value ? `编辑公码 ${form.code}` : "新增公码")}

`); }; } }); const _sfc_setup = _sfc_main.setup; _sfc_main.setup = (props, ctx) => { const ssrContext = useSSRContext(); (ssrContext.modules || (ssrContext.modules = /* @__PURE__ */ new Set())).add("pages/code.vue"); return _sfc_setup ? _sfc_setup(props, ctx) : void 0; }; export { _sfc_main as default }; //# sourceMappingURL=code-BZlgiQix.mjs.map