Ver código fonte

feat: 人员管理联调

wyf 7 meses atrás
pai
commit
33bf925e00

+ 28 - 4
src/views/security-confidentiality/person-management/inner-person/InnerPerson.vue

@@ -70,6 +70,24 @@
           @update:pageSize="handleSizeChange"
           @update:pageNumber="handleCurrentChange"
         >
+          <template #employeeName="scope">
+            <span>{{ scope.row.employeeName || '-' }}</span>
+          </template>
+          <template #staffNo="scope">
+            <span>{{ scope.row.staffNo || '-' }}</span>
+          </template>
+          <template #deptName="scope">
+            <span>{{ scope.row.deptName || '-' }}</span>
+          </template>
+          <template #eventType="scope">
+            <span>{{ OCCURRENCE_TYPE_LABEL[scope.row.eventType] || '-' }}</span>
+          </template>
+          <template #location="scope">
+            <span>{{ scope.row.location || '-' }}</span>
+          </template>
+          <template #entryTime="scope">
+            <span>{{ scope.row.entryTime || '-' }}</span>
+          </template>
         </BasicTable>
       </div>
     </main>
@@ -84,7 +102,7 @@
   import { onMounted, reactive, ref } from 'vue';
   import { QueryPageRequest, QueryPageResponse } from '@/types/basic-query';
   import type { InnerPersonTableData, InnerPersonTableQuery } from './types';
-  import { INNER_PERSON_TABLE_SEARCH_OPTIONS, OCCURRENCE_TYPE_OPTIONS } from './constants';
+  import { INNER_PERSON_TABLE_SEARCH_OPTIONS, OCCURRENCE_TYPE_OPTIONS, OCCURRENCE_TYPE_LABEL } from './constants';
   import {
     exportInnerPersonRecordList,
     getDeptNameList,
@@ -95,7 +113,10 @@
   import { downloadFile } from '@/views/disaster/utils';
 
   const searchData = reactive<InnerPersonTableQuery>({});
-  const searchTime = ref<string[]>([]);
+  const searchTime = ref<string[]>([
+    dayjs().startOf('day').format('YYYY-MM-DD HH:mm:ss'),
+    dayjs().endOf('day').format('YYYY-MM-DD HH:mm:ss'),
+  ]);
   const selectableInputRef = ref<InstanceType<typeof SelectableInput>>();
 
   function getQuery() {
@@ -157,7 +178,10 @@
         searchData[key] = undefined;
       }
     }
-    searchTime.value = [];
+    searchTime.value = [
+      dayjs().startOf('day').format('YYYY-MM-DD HH:mm:ss'),
+      dayjs().endOf('day').format('YYYY-MM-DD HH:mm:ss'),
+    ];
     handleSearch();
   }
 
@@ -190,7 +214,7 @@
 
   onMounted(() => {
     loadDeptNameData();
-    getTableData();
+    handleSearch();
   });
 </script>
 

+ 6 - 1
src/views/security-confidentiality/person-management/inner-person/configs/table.ts

@@ -7,37 +7,42 @@ export const TABLE_OPTIONS = {
 export const INNER_PERSON_TABEL_COLUMNS = [
   {
     prop: 'employeeName',
+    slot: 'employeeName',
     label: '姓名',
     align: 'center',
     minWidth: '120px',
   },
   {
     prop: 'staffNo',
+    slot: 'staffNo',
     label: '卡号',
     align: 'center',
     minWidth: '120px',
   },
   {
     prop: 'deptName',
+    slot: 'deptName',
     label: '部门',
     align: 'center',
     minWidth: '120px',
   },
   {
     prop: 'eventType',
-    label: '事件',
     slot: 'eventType',
+    label: '事件',
     align: 'center',
     minWidth: '120px',
   },
   {
     prop: 'location',
+    slot: 'location',
     label: '进出地点',
     align: 'center',
     minWidth: '120px',
   },
   {
     prop: 'entryTime',
+    slot: 'entryTime',
     label: '进门时间',
     align: 'center',
     minWidth: '120px',

+ 17 - 0
src/views/security-confidentiality/person-management/outer-person/components/BreakInto.vue

@@ -35,6 +35,21 @@
       @update:pageSize="handleSizeChange"
       @update:pageNumber="handleCurrentChange"
     >
+      <template #eventType="scope">
+        <span>{{ BREAK_EVENT_TYPE_LABEL[scope.row.eventType] || '-' }}</span>
+      </template>
+      <template #captureLocation="scope">
+        <span>{{ scope.row.captureLocation || '-' }}</span>
+      </template>
+      <template #captureTime="scope">
+        <span>{{ scope.row.captureTime || '-' }}</span>
+      </template>
+      <template #capturePhotos="scope">
+        <ImageViewer :file-list="scope.row.capturePhotos" />
+      </template>
+      <template #dataSource="scope">
+        <span>{{ DATA_SOURCE_TYPE_LABEL[scope.row.dataSource] || '-' }}</span>
+      </template>
     </BasicTable>
   </div>
 </template>
@@ -45,11 +60,13 @@
   import { onMounted, reactive, ref } from 'vue';
   import { QueryPageRequest, QueryPageResponse } from '@/types/basic-query';
   import { BreakTableData, BreakTableQuery } from '../types';
+  import { BREAK_EVENT_TYPE_LABEL, DATA_SOURCE_TYPE_LABEL } from '../constants';
   import { OUTER_PERSON_BREAK_TABEL_COLUMNS, TABLE_OPTIONS } from '../configs/table';
   import { exportBreakTableList, getBreakTableList } from '@/api/security-confidentiality-person/outer-person';
   import { ElMessage } from 'element-plus';
   import { downloadFile } from '@/views/disaster/utils';
   import RealtimePush from './RealtimePush.vue';
+  import ImageViewer from '@/views/traffic/violation/act/components/ImageViewer.vue';
 
   const searchData = reactive<BreakTableQuery>({});
   const searchTime = ref<string[]>([]);

+ 13 - 10
src/views/security-confidentiality/person-management/outer-person/components/RealtimePush.vue

@@ -6,7 +6,7 @@
     <img src="@/assets/icons/help.png" alt="" />
 
     <span class="label">告警推送:</span>
-    <el-switch v-model="switchVal" class="switch" @change="handleSwitchChange" />
+    <el-switch v-model="switchVal" class="switch" :before-change="debouncedhandleSwitchChange" />
     <span class="info-text">推送对象{{ objectNum }}人</span>
     <el-popover :visible="formVisible" width="300" placement="bottom-end" title="推送设置">
       <template #reference>
@@ -35,7 +35,7 @@
         </div>
         <div class="config-form-btn">
           <el-button @click="formVisible = false">取消</el-button>
-          <el-button type="primary" @click="updateConfig">确定</el-button>
+          <el-button type="primary" @click="updateConfig(switchVal)">确定</el-button>
         </div>
       </template>
     </el-popover>
@@ -48,6 +48,7 @@
   import { updateBreakPushConfig, queryBreakPushConfig } from '@/api/security-confidentiality-person/outer-person';
   import GroupSelect from '@/components/PersonGroup/components/GroupSelect.vue';
   import { useGroupInfoHook } from '@/components/PersonGroup/hook/groupInfo';
+  import { debounce } from 'lodash-es';
 
   const switchVal = ref(false);
   const objectNum = ref(0);
@@ -73,13 +74,13 @@
     }
   }
 
-  async function updateConfig() {
+  async function updateConfig(val: boolean) {
     if (formVisible.value) {
       const res = await ruleFormRef.value.validate();
       if (!res) return false;
     }
     try {
-      await updateBreakPushConfig({ alertPush: switchVal.value, pushGroupIdList: ruleFormData.userGroupList! });
+      await updateBreakPushConfig({ alertPush: val, pushGroupIdList: ruleFormData.userGroupList! });
     } catch (error) {
       ElMessage.error('更新闯入告警推送配置失败');
     }
@@ -87,18 +88,20 @@
     getNoticeConfig();
   }
 
-  async function handleSwitchChange(val: boolean) {
-    if (val) {
+  function handleSwitchChange() {
+    // no async
+    if (!switchVal.value) {
       if (objectNum.value > 0) {
-        updateConfig();
+        updateConfig(!switchVal.value);
       } else {
         ElMessage.error('请先完成推送对象设置');
       }
     } else {
-      updateConfig();
+      updateConfig(!switchVal.value);
     }
-    getNoticeConfig();
+    return false;
   }
+  const debouncedhandleSwitchChange = debounce(handleSwitchChange, 1000);
 
   const formValidator = (_rule, value, callback) => {
     if (value == null || !value.length) {
@@ -140,7 +143,7 @@
     margin: 5px 0;
   }
   .config-form-btn {
-    margin-top: 10px;
+    padding-top: 20px;
     text-align: end;
   }
 

+ 46 - 1
src/views/security-confidentiality/person-management/outer-person/components/Visitor.vue

@@ -64,6 +64,37 @@
       @update:pageSize="handleSizeChange"
       @update:pageNumber="handleCurrentChange"
     >
+      <template #visitorName="scope">
+        <span>{{ scope.row.visitorName || '--' }}</span>
+      </template>
+
+      <template #identityInfor="scope">
+        <span>{{ managementPermission ? scope.row.identityInfor || '--' : '******' }}</span>
+      </template>
+      <template #mobile="scope">
+        <span>{{ managementPermission ? scope.row.mobile || '--' : '******' }}</span>
+      </template>
+      <template #isForeigner="scope">
+        <span>{{ IS_FOREIGNER_TYPE_LABEL[scope.row.isForeigner] || '--' }}</span>
+      </template>
+      <template #company="scope">
+        <span>{{ scope.row.company || '--' }}</span>
+      </template>
+      <template #visitReason="scope">
+        <span>{{ scope.row.visitReason || '--' }}</span>
+      </template>
+      <template #respondentName="scope">
+        <span>{{ scope.row.respondentName || '--' }}</span>
+      </template>
+      <template #visitState="scope">
+        <span>{{ VISIT_STATE_TYPE_LABEL[scope.row.visitState] || '--' }}</span>
+      </template>
+      <template #visitTime="scope">
+        <span>{{ scope.row.visitTime || '--' }}</span>
+      </template>
+      <template #leaveTime="scope">
+        <span>{{ scope.row.leaveTime || '--' }}</span>
+      </template>
     </BasicTable>
   </div>
 </template>
@@ -76,11 +107,25 @@
   import { QueryPageRequest, QueryPageResponse } from '@/types/basic-query';
   import { VisitorTableData, VisitorTableQuery } from '../types';
   import { OUTER_PERSON_VISITOR_TABEL_COLUMNS, TABLE_OPTIONS } from '../configs/table';
-  import { VISITOR_TABLE_SEARCH_OPTIONS, IS_FOREIGNER_TYPE_OPTIONS, VISIT_STATE_TYPE_OPTIONS } from '../constants';
+  import {
+    VISITOR_TABLE_SEARCH_OPTIONS,
+    IS_FOREIGNER_TYPE_OPTIONS,
+    IS_FOREIGNER_TYPE_LABEL,
+    VISIT_STATE_TYPE_OPTIONS,
+    VISIT_STATE_TYPE_LABEL,
+    VISITOR_MANAGEMENT_PROMISSION_CODE,
+  } from '../constants';
   import { exportVisitorList, getVisitorList } from '@/api/security-confidentiality-person/outer-person';
   import { ElMessage } from 'element-plus';
   import { downloadFile } from '@/views/disaster/utils';
 
+  import { useUserInfoHook } from '@/hooks/useUserInfoHook';
+
+  const { permissions } = useUserInfoHook();
+  const managementPermission = ref<Boolean>(
+    Boolean(permissions.find((item: { code: string }) => item.code === VISITOR_MANAGEMENT_PROMISSION_CODE)),
+  );
+
   const searchData = reactive<VisitorTableQuery>({});
 
   const { tableConfig, pagination } = useTableConfig(OUTER_PERSON_VISITOR_TABEL_COLUMNS, TABLE_OPTIONS);

+ 13 - 4
src/views/security-confidentiality/person-management/outer-person/configs/table.ts

@@ -16,34 +16,36 @@ export const OUTER_PERSON_BREAK_TABEL_COLUMNS: TableColumnProps[] = [
   },
   {
     prop: 'eventType',
-    label: '事件',
     slot: 'eventType',
+    label: '事件',
     align: 'center',
     minWidth: '120px',
   },
   {
     prop: 'captureLocation',
+    slot: 'captureLocation',
     label: '抓拍地点',
     align: 'center',
     minWidth: '120px',
   },
   {
     prop: 'captureTime',
+    slot: 'captureTime',
     label: '抓拍时间',
     align: 'center',
     minWidth: '120px',
   },
   {
     prop: 'capturePhotos',
-    label: '抓拍图片',
     slot: 'capturePhotos',
+    label: '抓拍图片',
     align: 'center',
     minWidth: '120px',
   },
   {
     prop: 'dataSource',
-    label: '来源',
     slot: 'dataSource',
+    label: '来源',
     align: 'center',
     minWidth: '120px',
   },
@@ -55,18 +57,21 @@ export const OUTER_PERSON_VISITOR_TABEL_COLUMNS: TableColumnProps[] = [
     align: 'center',
     minWidth: '120px',
     prop: 'visitorName',
+    slot: 'visitorName',
   },
   {
     label: '身份信息',
     align: 'center',
     minWidth: '240px',
     prop: 'identityInfor',
+    slot: 'identityInfor',
   },
   {
     label: '手机号码',
     align: 'center',
     minWidth: '240px',
     prop: 'mobile',
+    slot: 'mobile',
   },
   {
     label: '是否外籍',
@@ -80,6 +85,7 @@ export const OUTER_PERSON_VISITOR_TABEL_COLUMNS: TableColumnProps[] = [
     align: 'center',
     minWidth: '360px',
     prop: 'company',
+    slot: 'company',
   },
   {
     label: '来访事由',
@@ -93,6 +99,7 @@ export const OUTER_PERSON_VISITOR_TABEL_COLUMNS: TableColumnProps[] = [
     align: 'center',
     minWidth: '120px',
     prop: 'respondentName',
+    slot: 'respondentName',
   },
   {
     label: '访问状态',
@@ -107,11 +114,13 @@ export const OUTER_PERSON_VISITOR_TABEL_COLUMNS: TableColumnProps[] = [
     align: 'center',
     minWidth: '360px',
     prop: 'visitTime',
+    slot: 'visitTime',
   },
   {
     label: '离开时间',
     align: 'center',
-    minWidth: '120px',
+    minWidth: '360px',
     prop: 'leaveTime',
+    slot: 'leaveTime',
   },
 ];

+ 20 - 0
src/views/security-confidentiality/person-management/outer-person/constants.ts

@@ -9,6 +9,24 @@ export const SUBPAGES = [
   },
 ];
 
+export enum BREAK_EVENT_TYPE {
+  BREAK = 1,
+}
+
+export const BREAK_EVENT_TYPE_LABEL = {
+  [BREAK_EVENT_TYPE.BREAK]: '闯入',
+};
+
+export enum DATA_SOURCE_TYPE {
+  ZHOUJIE = 2,
+  AI = 1,
+}
+
+export const DATA_SOURCE_TYPE_LABEL = {
+  [DATA_SOURCE_TYPE.ZHOUJIE]: '周界相机',
+  [DATA_SOURCE_TYPE.AI]: 'AI检测',
+};
+
 export const VISITOR_TABLE_SEARCH_OPTIONS: SelectOption[] = [
   {
     label: '姓名',
@@ -87,3 +105,5 @@ export const VISIT_STATE_TYPE_OPTIONS: SelectOption[] = [
     disabled: false,
   },
 ];
+
+export const VISITOR_MANAGEMENT_PROMISSION_CODE = 'security_business_module:visitor_manage';

+ 1 - 1
src/views/traffic/violation/act/components/ImageViewer.vue

@@ -10,7 +10,7 @@
       />
       <div class="image-viewer__text">共{{ images.length }}张</div>
     </div>
-    <div v-else> - </div>
+    <div v-else> -- </div>
   </div>
 </template>