Ver Fonte

调整和页面开发

刘洋 há 9 meses atrás
pai
commit
b2e5e3efb2

+ 2 - 1
builder.json

@@ -7,7 +7,8 @@
     "asar": true,
     "files": [
         "build/**/*",
-        "dist/**/*"
+        "dist/**/*",
+        "static/**/*"
     ],
     "nsis": {
         "oneClick": false,

+ 1 - 7
src/render/App.vue

@@ -4,7 +4,7 @@
       :tip="appStore.loadingStatus.tip"
       :spinning="appStore.loadingStatus.spinning"
     >
-      <div class="app-in" @dblclick="devReload">
+      <div class="app-in">
         <router-view />
       </div>
     </a-spin>
@@ -14,12 +14,6 @@
 <script lang="ts" name="App" setup>
 import { useAppStore } from "./store";
 const appStore = useAppStore();
-const devReload = () => {
-  //暗功能:electron环境下,如果dev环境下想刷新页面的话,双击页面闲置区域
-  if (window.electronApi && import.meta.env?.DEV) {
-    location.reload();
-  }
-};
 </script>
 <style lang="less">
 .app-in {

+ 3 - 0
src/render/components.d.ts

@@ -9,9 +9,12 @@ declare module 'vue' {
   export interface GlobalComponents {
     AInput: typeof import('@qmth/ui')['Input']
     AInputNumber: typeof import('@qmth/ui')['InputNumber']
+    AInputPassword: typeof import('@qmth/ui')['InputPassword']
     ARadio: typeof import('@qmth/ui')['Radio']
     ARadioGroup: typeof import('@qmth/ui')['RadioGroup']
+    ASelect: typeof import('@qmth/ui')['Select']
     ASpin: typeof import('@qmth/ui')['Spin']
+    ATable: typeof import('@qmth/ui')['Table']
     ATabPane: typeof import('@qmth/ui')['TabPane']
     ATabs: typeof import('@qmth/ui')['Tabs']
     ATag: typeof import('@qmth/ui')['Tag']

+ 2 - 0
src/render/components/MyModal/index.vue

@@ -83,6 +83,8 @@ const props = withDefaults(
     fullscreen: false,
     canDrag: false,
     showFullScreen: false,
+    mask: true,
+    closable: true,
   }
 );
 

+ 4 - 4
src/render/store/modules/user/index.ts

@@ -1,6 +1,4 @@
-import { ref } from "vue";
 import { defineStore } from "pinia";
-import { clearStorage } from "@/utils/tool";
 import router from "@/router";
 
 export const useUserStore = defineStore<"user", any, any, any>("user", {
@@ -19,6 +17,9 @@ export const useUserStore = defineStore<"user", any, any, any>("user", {
     curExam: null,
   }),
   actions: {
+    setUserInfo(info: any) {
+      this.userInfo = info;
+    },
     setCurExam(exam: Exam) {
       this.curExam = exam;
     },
@@ -31,8 +32,7 @@ export const useUserStore = defineStore<"user", any, any, any>("user", {
     async logout() {
       //todo 退出登录接口
       // await logout();
-      clearStorage();
-      this.resetUserInfo();
+      this.setUserInfo(null);
       router.push({ name: "Login" });
       window.electronApi?.changeWinSize("small");
     },

+ 42 - 0
src/render/views/BaseDataConfig/AddUserDialog.vue

@@ -0,0 +1,42 @@
+<template>
+  <my-modal v-model:open="visible" title="新增用户">
+    <qm-low-form :params="params" :fields="fields" :label-width="80">
+    </qm-low-form>
+  </my-modal>
+</template>
+<script name="AddUserDialog" lang="ts" setup>
+import { ref } from "vue";
+const visible = defineModel();
+
+//todo 入参名
+const params = ref({
+  a: "1",
+  b: "",
+  c: "",
+});
+const fields = ref([
+  {
+    prop: "a",
+    label: "角色",
+    colSpan: 24,
+    type: "radio",
+    attrs: {
+      options: [
+        { label: "管理员", value: "1" },
+        { label: "审核员", value: "2" },
+      ],
+    },
+  },
+  {
+    prop: "b",
+    label: "账号",
+    colSpan: 24,
+  },
+  {
+    prop: "c",
+    label: "初始密码",
+    colSpan: 24,
+  },
+]);
+</script>
+<style lang="less" scoped></style>

+ 63 - 5
src/render/views/BaseDataConfig/ScanParams.vue

@@ -9,7 +9,7 @@
       >
         <template #a>
           <div class="flex items-center">
-            <a-input class="w-150px" v-model:value="params.a" />
+            <a-input style="width: 200px" v-model:value="params.a" />
             <qm-button class="m-l-8px" :icon="h(PlusCircleOutlined)"
               >新增</qm-button
             >
@@ -29,14 +29,39 @@
 
         <template #b>
           <div class="flex items-center">
-            <div class="flex items-center m-r-50px">
+            <div class="flex items-center m-r-50px ccbl">
               <span>抽查比例:</span>
               <a-input-number v-model:value="params.b" :max="100" :min="0" />
+              <span>%</span>
+            </div>
+            <div class="flex items-center jcsx">
+              <span>检查顺序:</span>
+              <a-select v-mode:value="params.c" style="width: 200px"></a-select>
+            </div>
+          </div>
+        </template>
+        <template #e>
+          <div class="flex items-center">
+            <div class="flex items-center m-r-50px ccbl">
+              <span>锁屏数量:</span>
+              <a-input-number v-model:value="params.e" :max="100" :min="0" />
+              <span>张</span>
+            </div>
+            <div class="flex items-center jcsx">
+              <span>解锁密码:</span>
+              <a-input-password
+                v-mode:value="params.f"
+                style="width: 200px"
+              ></a-input-password>
             </div>
-            <div class="flex items-center"></div>
           </div>
         </template>
       </qm-low-form>
+
+      <div class="btns">
+        <!-- <qm-button :icon="h(EditOutlined)">编辑</qm-button> -->
+        <qm-button type="primary">保存</qm-button>
+      </div>
     </div>
   </div>
 </template>
@@ -44,13 +69,14 @@
 import { ref, h } from "vue";
 import { PlusCircleOutlined } from "@ant-design/icons-vue";
 import useToken from "@/hooks/useToken";
+import { EditOutlined } from "@ant-design/icons-vue";
 const { token } = useToken();
 //todo 入参名
 const params = ref({
   a: "",
   b: "",
   c: "",
-  d: "",
+  d: "1",
   e: "",
   f: "",
 });
@@ -65,6 +91,23 @@ const fields = ref([
     label: "图片检查",
     colSpan: 24,
   },
+  {
+    prop: "d",
+    label: "实时审核",
+    colSpan: 24,
+    type: "radio",
+    attrs: {
+      options: [
+        { label: "是", value: "1" },
+        { label: "否", value: "0" },
+      ],
+    },
+  },
+  {
+    cell: "e",
+    label: "人工绑定锁屏控制",
+    colSpan: 24,
+  },
 ]);
 const tagList = ref(["666666", "888888", "999999"]);
 const delTag = (index: number) => {
@@ -74,9 +117,24 @@ const delTag = (index: number) => {
 <style lang="less" scoped>
 .scan-params {
   .center {
-    width: 1100px;
+    width: 900px;
     max-height: 100%;
     overflow: auto;
+    .btns {
+      padding-top: 60px;
+      padding-left: 150px;
+    }
+    .ccbl {
+      color: @text-color1;
+      width: 50%;
+      span:last-child {
+        color: @text-color3;
+        margin-left: 4px;
+      }
+    }
+    .jcsx {
+      width: 50%;
+    }
     .tag {
       height: 32px;
       padding: 0 10px;

+ 83 - 3
src/render/views/BaseDataConfig/UserManage.vue

@@ -1,5 +1,85 @@
 <template>
-  <div class="user-manage">用户管理</div>
+  <div class="user-manage">
+    <qm-low-form :params="searchParams" :fields="searchFields"></qm-low-form>
+    <a-table :data-source="tableData" :columns="columns" size="middle" bordered>
+      <template #bodyCell="{ column }">
+        <template v-if="column.key === 'operation'">
+          <qm-button type="link">启用</qm-button>
+          <qm-button type="link">禁用</qm-button>
+          <qm-button type="link">重置密码</qm-button>
+        </template>
+      </template>
+    </a-table>
+    <AddUserDialog v-model="showAddDialog" v-if="showAddDialog"></AddUserDialog>
+  </div>
 </template>
-<script name="UserManage" lang="ts" setup></script>
-<style lang="less" scoped></style>
+<script name="UserManage" lang="ts" setup>
+import { ref } from "vue";
+import AddUserDialog from "./AddUserDialog.vue";
+import type { TableColumnsType } from "@qmth/ui";
+//todo 入参名
+const searchParams = ref({
+  a: "",
+});
+const searchFields = ref([
+  {
+    prop: "a",
+    type: "select",
+    colSpan: 3,
+    label: "角色",
+  },
+  {
+    type: "buttons",
+    colSpan: 5,
+    children: [
+      {
+        attrs: {
+          type: "default",
+        },
+        text: "查询",
+      },
+      {
+        text: "新增用户",
+        onClick: () => {
+          showAddDialog.value = true;
+        },
+      },
+    ],
+  },
+]);
+
+const tableData = ref([{ a: 1, b: 2, c: 3 }]);
+const columns: TableColumnsType = [
+  {
+    title: "序号",
+    dataIndex: "index",
+    key: "index",
+    width: 100,
+    customRender: ({ index }) => `${index + 1}`,
+  },
+  {
+    title: "角色",
+    dataIndex: "a",
+  },
+  {
+    title: "账号",
+    dataIndex: "b",
+  },
+  {
+    title: "状态",
+    dataIndex: "c",
+  },
+  {
+    title: "操作",
+    key: "operation",
+    width: 300,
+  },
+];
+
+const showAddDialog = ref(false);
+</script>
+<style lang="less" scoped>
+.user-manage {
+  padding: 0 20px 20px 20px;
+}
+</style>