zhangjie 1 gadu atpakaļ
vecāks
revīzija
b685e85208

+ 21 - 2
src/App.vue

@@ -1,5 +1,10 @@
 <template>
-  <a-config-provider :theme="theme" :locale="zhCN">
+  <a-config-provider
+    :theme="theme"
+    :locale="zhCN"
+    :autoInsertSpaceInButton="false"
+    :renderEmpty="emptyTextHandle"
+  >
     <router-view> </router-view>
     <a-spin
       v-if="spinning"
@@ -14,7 +19,7 @@
 
 <script setup lang="ts">
 import zhCN from "ant-design-vue/es/locale/zh_CN";
-import { watch, watchEffect } from "vue";
+import { watch, watchEffect, h } from "vue";
 import { useMainStore } from "@/store";
 import { useTimers } from "./setups/useTimers";
 import { getToken } from "./auth/auth";
@@ -31,6 +36,20 @@ addInterval(() => {
 let spinning = $ref(false);
 const mainStore = useMainStore();
 
+const emptyTextHandle = (componentName: string) => {
+  if (componentName === "Table") {
+    return h(
+      "div",
+      {
+        class: "table-empty",
+      },
+      [h("div", { class: "table-empty-bg" }), h("p", "暂无数据")]
+    );
+  } else {
+    return h("div", { class: "app-empty" }, "暂无数据");
+  }
+};
+
 watch(
   () => mainStore.globalMask,
   () => (spinning = mainStore.globalMask)

BIN
src/assets/bg-empty.png


+ 0 - 2
src/components/Layout.vue

@@ -75,8 +75,6 @@ type MenuKey = keyof typeof menuRelative;
 watch(
   () => route.name,
   (val) => {
-    console.log(val);
-
     if (!val) return;
     const routeName = val.toString();
     const keys: MenuKey[] = Object.keys(menuRelative) as MenuKey[];

+ 1 - 0
src/features/report/ReportCompare.vue

@@ -399,6 +399,7 @@ function scoreChartOption() {
       lineStyle: {
         opacity: 0,
       },
+      borderColor: "transparent",
     },
     grid: {
       show: true,

+ 2 - 14
src/features/report/ReportMain.vue

@@ -118,13 +118,7 @@ let partNos = $shallowRef({
 });
 
 const hasCompareProject = computed(() => {
-  const pCount = compareProjectId?.length + 1;
-
-  return (
-    !!compareProjectId?.length &&
-    comparePapers.length === pCount &&
-    compareCourses.length === pCount
-  );
+  return !!compareProjectId?.length;
 });
 
 onMounted(async () => {
@@ -232,13 +226,7 @@ async function fetchData() {
     await fetchCompareCourseData();
   }
 
-  const pCount = compareProjectId.length + 1;
-
-  if (
-    !compareProjectId.length ||
-    comparePapers.length !== pCount ||
-    compareCourses.length !== pCount
-  ) {
+  if (!compareProjectId.length) {
     partNos = {
       summary: "一",
       score: "二",

+ 1 - 1
src/filters/index.ts

@@ -15,7 +15,7 @@ const $filters = {
     return { true: "是", false: "否" }[val + ""];
   },
   courseTypeFilter(val: string) {
-    if (typeof val !== "string") return "";
+    if (typeof val !== "string") return "#";
     return { PUBLIC: "公共科目", MAJOR: "专业科目" }[val + ""];
   },
   projectStatusFilter(val: string) {

+ 0 - 2
src/hooks/auth.ts

@@ -8,8 +8,6 @@ export default function useAuth(role) {
   const store = useMainStore();
   const menus = ref<MenuItem[]>([]);
 
-  console.log(role);
-
   const updateMenus = () => {
     menus.value = menuList
       .filter((item) => item.privileges.includes(role))

+ 34 - 0
src/styles/base.less

@@ -4,6 +4,34 @@
   justify-content: space-between;
 }
 
+.table-empty {
+  text-align: center;
+  padding: 54px 0;
+  &-bg {
+    width: 98px;
+    height: 74px;
+    background-image: url(../assets/bg-empty.png);
+    background-size: 100% 100%;
+    margin: 0 auto;
+  }
+  p {
+    height: 22px;
+    font-weight: 400;
+    font-size: 14px;
+    color: var(--app-mid-text-color);
+    line-height: 22px;
+    margin-top: 8px;
+  }
+}
+.app-empty {
+  height: 22px;
+  font-weight: 400;
+  font-size: 14px;
+  color: #bfbfbf;
+  line-height: 22px;
+  text-align: center;
+}
+
 /* part */
 .part-box {
   margin-bottom: 20px;
@@ -119,12 +147,18 @@
     .ant-table-cell {
       color: var(--app-secondary-text-color);
       font-weight: 400;
+      background-color: #f7f7f7;
+      border-color: var(--color-border);
 
       &::before {
         display: none;
       }
     }
   }
+  .ant-table-tbody > tr > td {
+    border-color: var(--color-border) !important;
+  }
+
   .action-cell {
     margin: -5px -10px;
     .ant-btn-text {