Kaynağa Gözat

feat: 审核框架

zhangjie 9 ay önce
ebeveyn
işleme
bf0df44f4d

+ 27 - 0
src/render/router/routes.ts

@@ -110,6 +110,33 @@ const routes: RouteRecordRaw[] = [
           title: "审核",
         },
       },
+      // 实时审核
+      {
+        path: "in-time-audit",
+        name: "InTimeAudit",
+        component: () => import("@/views/Audit/InTime/index.vue"),
+        meta: {
+          title: "实时审核",
+        },
+      },
+      // 审核员复核校验
+      {
+        path: "review-audit",
+        name: "ReviewAudit",
+        component: () => import("@/views/Audit/Review/index.vue"),
+        meta: {
+          title: "审核员复核校验",
+        },
+      },
+      // 审核员图片检查
+      {
+        path: "review-audit",
+        name: "ImageCheckAudit",
+        component: () => import("@/views/Audit/ImageCheck/index.vue"),
+        meta: {
+          title: "图片检查",
+        },
+      },
     ],
   },
 ];

+ 45 - 39
src/render/store/modules/user/index.ts

@@ -1,43 +1,49 @@
 import { defineStore } from "pinia";
 import router from "@/router";
 
-export const useUserStore = defineStore<"user", { curExam: Exam }, any, any>(
+export const useUserStore = defineStore<
   "user",
-  {
-    persist: [
-      {
-        storage: sessionStorage,
-        paths: ["userInfo"],
-      },
-      {
-        storage: localStorage,
-        paths: ["curExam"],
-      },
-    ],
-    state: () => ({
-      userInfo: null,
-      curExam: null,
-    }),
-    actions: {
-      setUserInfo(info: any) {
-        this.userInfo = info;
-      },
-      setCurExam(exam: Exam) {
-        this.curExam = exam;
-      },
-      setState(data: any) {
-        this.$patch(data);
-      },
-      resetUserInfo() {
-        this.$reset();
-      },
-      async logout() {
-        //todo 退出登录接口
-        // await logout();
-        this.setUserInfo(null);
-        router.push({ name: "Login" });
-        window.electronApi?.changeWinSize("small");
-      },
-    },
-  }
-);
+  { curExam: Exam; imageCheckLoopTime: number },
+  any,
+  any
+>("user", {
+  persist: [
+    {
+      storage: sessionStorage,
+      paths: ["userInfo"],
+    },
+    {
+      storage: localStorage,
+      paths: ["curExam"],
+    },
+  ],
+  state: () => ({
+    userInfo: null,
+    curExam: null,
+    imageCheckLoopTime: 0,
+  }),
+  actions: {
+    setUserInfo(info: any) {
+      this.userInfo = info;
+    },
+    setCurExam(exam: Exam) {
+      this.curExam = exam;
+    },
+    setImageCheckLoopTime(imageCheckLoopTime: number) {
+      this.imageCheckLoopTime = imageCheckLoopTime;
+    },
+    setState(data: any) {
+      this.$patch(data);
+    },
+    resetUserInfo() {
+      this.$reset();
+    },
+    async logout() {
+      //todo 退出登录接口
+      // await logout();
+      this.setUserInfo(null);
+      router.push({ name: "Login" });
+      window.electronApi?.changeWinSize("small");
+    },
+  },
+});

+ 4 - 2
src/render/styles/pages.less

@@ -102,8 +102,10 @@
         .audit-box-foot {
           color: @text-color2;
           border-top: 1px solid @border-color1;
-          .ant-input {
-            width: 40px;
+          .ant-input-number {
+            width: 50px;
+          }
+          .ant-input-number-input {
             background: #f3f4f6;
             padding-left: 5px;
             padding-right: 5px;

+ 9 - 0
src/render/views/Audit/ImageCheck/index.vue

@@ -0,0 +1,9 @@
+<template>
+  <div>ImageCheckAudit</div>
+</template>
+
+<script setup lang="ts">
+defineOptions({
+  name: "ImageCheckAudit",
+});
+</script>

+ 2 - 2
src/render/views/Audit/InTime/index.vue

@@ -1,9 +1,9 @@
 <template>
-  <div></div>
+  <div>InTimeAudit</div>
 </template>
 
 <script setup lang="ts">
 defineOptions({
-  name: "InTime",
+  name: "InTimeAudit",
 });
 </script>

+ 29 - 5
src/render/views/Audit/Main/index.vue

@@ -28,7 +28,9 @@
               <p>待审核</p>
               <p>1</p>
             </div>
-            <div class="audit-card-action">进入 <RightOutlined /></div>
+            <div class="audit-card-action" @click="toPage('InTimeAudit')">
+              进入 <RightOutlined />
+            </div>
           </div>
         </div>
       </div>
@@ -44,7 +46,9 @@
               <p>待审核</p>
               <p>1</p>
             </div>
-            <div class="audit-card-action">进入 <RightOutlined /></div>
+            <div class="audit-card-action" @click="toPage('ReviewAudit')">
+              进入 <RightOutlined />
+            </div>
           </div>
         </div>
       </div>
@@ -68,7 +72,9 @@
               <p>待审核</p>
               <p>1</p>
             </div>
-            <div class="audit-card-action">进入 <RightOutlined /></div>
+            <div class="audit-card-action" @click="toPage('ImageCheckAudit')">
+              进入 <RightOutlined />
+            </div>
           </div>
         </div>
         <div class="audit-box-foot">
@@ -77,9 +83,15 @@
           </a-tag>
           <a-space :size="8">
             <span>轮播时间配置:</span>
-            <a-input></a-input>
+            <a-input-number
+              v-model:value="imageCheckLoopTime"
+              :min="0"
+              :max="9999"
+              :precision="0"
+              :controls="false"
+            ></a-input-number>
             <span>秒/张</span>
-            <a-button type="primary">设置</a-button>
+            <a-button type="primary" @click="onSetLoopTime">设置</a-button>
           </a-space>
         </div>
       </div>
@@ -97,6 +109,8 @@ import {
   RightOutlined,
   PieChartFilled,
 } from "@ant-design/icons-vue";
+import { message } from "ant-design-vue";
+
 import { useRouter } from "vue-router";
 import { useUserStore } from "@/store";
 import SelectExamDialog from "./SelectExamDialog.vue";
@@ -116,4 +130,14 @@ const selectExamDialogRef = ref();
 function onSwitchExam() {
   selectExamDialogRef.value?.open();
 }
+
+const imageCheckLoopTime = ref(userStore.imageCheckLoopTime);
+function onSetLoopTime() {
+  if (!imageCheckLoopTime.value && imageCheckLoopTime.value !== 0) {
+    message.error("请输入轮播时间");
+    return;
+  }
+
+  userStore.setImageCheckLoopTime(imageCheckLoopTime.value);
+}
 </script>

+ 9 - 0
src/render/views/Audit/Review/index.vue

@@ -0,0 +1,9 @@
+<template>
+  <div>ReviewAudit</div>
+</template>
+
+<script setup lang="ts">
+defineOptions({
+  name: "ReviewAudit",
+});
+</script>