Parcourir la source

feat:教师人脸删除

DESKTOP-USV654P\pc il y a 4 mois
Parent
commit
7e690253de

+ 40 - 2
src/views/attendance/face/teacher/index.vue

@@ -7,6 +7,17 @@
           <a-button block type="primary"> 导入 </a-button>
         </Upload>
       </template>
+      <template #action="{ record }">
+        <TableAction
+          :actions="[
+            {
+              label: '删除',
+              color: 'error',
+              onClick: handleDelete.bind(null, record),
+            },
+          ]"
+        />
+      </template>
       <template #facePhotoUrl="{ text }">
         <TableImg :size="40" :simpleShow="true" :showBadge="false" :imgList="[text]" />
       </template>
@@ -17,9 +28,10 @@
 <script setup lang="ts">
   import { reactive } from 'vue';
   import { PageWrapper } from '/@/components/Page';
-  import { BasicTable, useTable, TableImg } from '/@/components/Table';
+  import { BasicTable, useTable, TableImg, TableAction } from '/@/components/Table';
   import DeptTree from '/@/views/system/user/components/DeptTree.vue';
   import {
+    deletePersonnelTeacherFaceProcess,
     getTeacherFaceProcessPage,
     postTeacherFaceProcessBatchImport,
   } from '/@/services/apis/TeacherFaceProcessController';
@@ -27,7 +39,8 @@
   import { useMessage } from '/@/hooks/web/useMessage';
   import { Upload } from 'ant-design-vue';
 
-  const { createMessage } = useMessage();
+  const { createConfirm, createMessage } = useMessage();
+
   const [openFullLoading, closeFullLoading] = useLoading({
     tip: '处理中...',
   });
@@ -95,6 +108,12 @@
     bordered: true,
     immediate: false,
     canResize: true,
+    actionColumn: {
+      width: 100,
+      title: '操作',
+      dataIndex: 'action',
+      slots: { customRender: 'action' },
+    },
   });
 
   const searchInfo = reactive<Recordable>({});
@@ -116,6 +135,25 @@
     }
     return false;
   };
+
+  const handleDelete = (record: any) => {
+    createConfirm({
+      iconType: 'warning',
+      title: '温馨提醒',
+      content: '是否删除该记录?',
+      onOk: async () => {
+        try {
+          await deletePersonnelTeacherFaceProcess([record.id]);
+          createMessage.success('删除成功');
+          await reload();
+        } catch (e) {
+          createMessage.error('删除失败');
+        }
+      },
+      okText: '确认',
+      cancelText: '取消',
+    });
+  };
 </script>
 
 <style scoped lang="less"></style>

+ 28 - 4
src/views/educational/whiteList/index.vue

@@ -3,9 +3,24 @@
     <ClassTree class="w-1/3 xl:w-1/4" @select="handleSelect" />
     <BasicTable @register="registerTable" class="w-2/3 xl:w-3/4" :searchInfo="searchInfo">
       <template #toolbar>
-        <Upload :showUploadList="false" :before-upload="beforeUpload" accept=".xlsx,.xls">
-          <a-button block type="primary"> 导入 </a-button>
-        </Upload>
+        <Dropdown.Button>
+          数据导入
+          <template #icon>
+            <Icon icon="carbon:document-import" :size="16" />
+          </template>
+          <template #overlay>
+            <Menu>
+              <Menu.Item>
+                <a-button block type="link" @click="handelDownloadTemplate"> 下载模板 </a-button>
+              </Menu.Item>
+              <Menu.Item>
+                <Upload :showUploadList="false" :before-upload="beforeUpload" accept=".xlsx,.xls">
+                  <a-button block type="link"> 导入 </a-button>
+                </Upload>
+              </Menu.Item>
+            </Menu>
+          </template>
+        </Dropdown.Button>
       </template>
       <template #action="{ record }">
         <TableAction
@@ -23,11 +38,12 @@
 
 <script setup lang="ts">
   import { reactive } from 'vue';
-  import { Upload } from 'ant-design-vue';
+  import { Upload, Dropdown, Menu } from 'ant-design-vue';
   import { getDataOption } from '/@/api/system/dic';
   import { PageWrapper } from '/@/components/Page';
   import { BasicTable, useTable, TableAction } from '/@/components/Table';
   import ClassTree from '/@/views/educational/class/components/ClassTree.vue';
+  import Icon from '/@/components/Icon/index';
 
   import { useMessage } from '/@/hooks/web/useMessage';
 
@@ -37,6 +53,7 @@
     getWhitelistManagementPage,
     postWhitelistManagementImport,
   } from '/@/services/apis/WhitelistManagementController';
+  import { downloadByUrl } from '/@/utils/file/download';
 
   const { createConfirm, createMessage } = useMessage();
 
@@ -177,6 +194,13 @@
       cancelText: '取消',
     });
   };
+
+  function handelDownloadTemplate() {
+    downloadByUrl({
+      url: 'https://zhxy.cqtlzjzx.com/minio/static/resources/%E7%99%BD%E5%90%8D%E5%8D%95%E5%AF%BC%E5%85%A5%E6%A8%A1%E6%9D%BF.xlsx',
+      fileName: '白名单模板',
+    });
+  }
 </script>
 
 <style scoped lang="less"></style>