liuyuhang 4 тижнів тому
батько
коміт
47df7af13b
2 змінених файлів з 62 додано та 5 видалено
  1. 5 2
      config/index.js
  2. 57 3
      src/master/views/vip/vip-table.vue

+ 5 - 2
config/index.js

@@ -1,11 +1,14 @@
 const config = {
   system: "智医科技", // 系统名称,网页title
-  systemId: "", // 系统ID
+  systemId: "KASITE_MEMBERSHIP", // 系统ID
   slogan: "专注于医疗场景中每一个细微而温暖的改变",
   loginBackground: "images/login_background.png",
   logo: "images/logo.png",
   illustration: "images/login_illustration.png",
-  baseURL: "https://cs001.kasitesoft.com/",
+  // baseURL: "https://cs001.kasitesoft.com/",
+  // baseURL: "http://localhost:8670/",
+  // baseURL: "http://127.0.0.1:8080/",
+  baseURL: "https://pkusrv.pkuih.edu.cn/",
   title: "页面规范", // 登录后的菜单name
   index: "/layout/specification", // 登录后的首页
   showBreadcrumb: true, // 展示面包屑

+ 57 - 3
src/master/views/vip/vip-table.vue

@@ -108,7 +108,7 @@
 </template>
 
 <script setup lang="ts">
-import { getCurrentInstance, reactive, onMounted } from "vue";
+import { getCurrentInstance, reactive, ref, onMounted } from "vue";
 import { useStore } from "vuex";
 import { useRoute, useRouter } from "vue-router";
 
@@ -139,6 +139,58 @@ const table = reactive({
   },
 });
 
+const defaultThemeOptions = [
+  { label: "金色", value: "gold" },
+  { label: "银色", value: "silver" },
+  { label: "蓝色", value: "blue" },
+];
+const themeOptions = ref<Array<{ label: string; value: string }>>([...defaultThemeOptions]);
+const themeMap = ref<Record<string, string>>(
+  defaultThemeOptions.reduce((acc, cur) => {
+    acc[cur.value] = cur.label;
+    return acc;
+  }, {} as Record<string, string>)
+);
+
+const fillThemeMap = (options: Array<{ label: string; value: string }>) => {
+  themeMap.value = options.reduce((acc, cur) => {
+    if (cur?.value) {
+      acc[cur.value] = cur.label;
+    }
+    return acc;
+  }, {} as Record<string, string>);
+};
+
+const queryTheme = async () => {
+  try {
+    const { res } = await proxy.$interfaceEntry.vip.QueryDictList({
+      dictType: "VipColor",
+    });
+    const data = res.data || {};
+    const list =
+      data.Data ||
+      data.data ||
+      data.result ||
+      data.list ||
+      [];
+
+    if (Array.isArray(list) && list.length) {
+      const parsed = list.map((item: any) => ({
+        label: item.dictLabel,
+        value: item.dictValue,
+      }));
+      themeOptions.value = parsed;
+      fillThemeMap(parsed);
+    } else {
+      themeOptions.value = [...defaultThemeOptions];
+      fillThemeMap(defaultThemeOptions);
+    }
+  } catch (e) {
+    themeOptions.value = [...defaultThemeOptions];
+    fillThemeMap(defaultThemeOptions);
+  }
+};
+
 /* 获取表格数据 */
 const getTableData = async (e: any = undefined) => {
   !e && (table.page.PIndex = 1);
@@ -173,12 +225,13 @@ const getTableData = async (e: any = undefined) => {
     table.data = list.map((item: any) => {
       // 后端返回的字段可能是 IdLevelIcon(大写)或 idLevelIcon(小写)
       const iconPath = item.IdLevelIcon || item.idLevelIcon || "";
+      const themeValue = item.Theme || item.theme;
 
       return {
         levelCode: item.IdLevelCode || item.idLevelCode,
         levelIconLabel: iconPath,
         levelName: item.IdLevelName || item.idLevelName,
-        theme: item.Theme || item.theme,
+        theme: themeMap.value[themeValue] || themeValue || "-",
         statusLabel: (item.Status || item.status) === 1 ? "上架" : "下架",
         // 保存原始数据,编辑时可能需要
         rawData: item,
@@ -234,7 +287,8 @@ const handleEdit = (row: any) => {
   });
 };
 
-onMounted(() => {
+onMounted(async () => {
+  await queryTheme();
   getTableData();
 });
 </script>