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-DMQewX5_.mjs'; import { u as useToast } from './useToast-CS21XT61.mjs'; import './auth-QFkCoU1C.mjs'; import 'pinia'; 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 '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 currentFactoryId = ref(0); const filterStatus = ref(-1); const codes = ref([]); const factories = ref([]); const allProducts = ref([]); const factoryMap = 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 factoryMap[c.factoryid] || (c.factoryid ? "厂家#" + c.factoryid : "-"); } 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(`
| 公码 | 厂家 | 关联产品 | 备注 | VIP天/翻译分/会议分 | 核销/上限 | 失效时间 | 状态 | 操作 |
|---|---|---|---|---|---|---|---|---|
| 加载中… | ||||||||
| ${ssrInterpolate(currentFactoryId.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(` | |