Kaynağa Gözat

fix: bug修复

wyf 6 ay önce
ebeveyn
işleme
2150342bb4

+ 1 - 1
src/api/security-confidentiality-person/outer-person.ts

@@ -42,7 +42,7 @@ export function getVisitorList(data: QueryPageRequest<VisitorTableQuery>) {
 export function exportVisitorList(data: VisitorTableQuery) {
   return http.request(
     {
-      url: '/personnelManagement/queryVisitorAccessRecordPage',
+      url: '/personnelManagement/exportVisitorAccessRecordList',
       method: 'post',
       data,
       responseType: 'blob',

+ 7 - 3
src/views/security-confidentiality/access-control/AccessControl.vue

@@ -27,6 +27,7 @@
                   range-separator="至"
                   start-placeholder="开始时间"
                   end-placeholder="结束时间"
+                  value-format="YYYY-MM-DD HH:mm:ss"
                 />
               </div>
             </section>
@@ -85,6 +86,7 @@
   import { TABLE_OPTIONS, ACCESS_TABEL_COLUMNS, ACCESS_TABEL_COLUMNS_CHECKONLY } from './configs/tables';
   import type { AccessDetailResponse, AccessTableQuery } from './types';
   import type { QueryPageRequest } from '@/types/basic-query';
+  import dayjs from 'dayjs';
 
   const { permissions } = useUserInfoHook();
   const managementPermission = ref<Boolean>(
@@ -101,16 +103,18 @@
     });
   };
 
-  const searchTime = ref<string[]>([]);
+  const searchTime = ref<string[]>();
   const selectableInputRef = ref<InstanceType<typeof SelectableInput>>();
   function getQuery() {
     const selectableSearch = selectableInputRef.value?.getValue();
     tableQuery.queryParam = {
       fieldType: selectableSearch?.key as number | null,
       fieldContent: selectableSearch?.value,
-      startTime: searchTime.value ? searchTime.value[0] : undefined,
-      endTime: searchTime.value ? searchTime.value[1] : undefined,
     };
+    if (searchTime.value) {
+      tableQuery.queryParam.startTime = searchTime.value[0];
+      tableQuery.queryParam.endTime = searchTime.value[1];
+    }
   }
   async function getTableData() {
     tableConfig.loading = true;

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

@@ -52,6 +52,7 @@
                   range-separator="至"
                   start-placeholder="开始时间"
                   end-placeholder="结束时间"
+                  value-format="YYYY-MM-DD HH:mm:ss"
                 />
               </div>
             </section>
@@ -132,9 +133,9 @@
     if (searchData.eventType != null) {
       tableQuery.queryParam.eventType = searchData.eventType;
     }
-    if (searchTime) {
-      tableQuery.queryParam.startTime = dayjs(searchTime[0]).format('YYYY-MM-DD HH:MM:ss');
-      tableQuery.queryParam.endTime = dayjs(searchTime[1]).format('YYYY-MM-DD HH:MM:ss');
+    if (searchTime.value) {
+      tableQuery.queryParam.startTime = searchTime.value[0];
+      tableQuery.queryParam.endTime = searchTime.value[1];
     }
   }
   async function getTableData() {

+ 20 - 8
src/views/security-confidentiality/person-management/outer-person/components/BreakInto.vue

@@ -1,7 +1,7 @@
 <template>
   <div class="search-table-container">
     <header>
-      <RealtimePush />
+      <RealtimePush v-if="managementPermission" />
       <div class="table-search">
         <section class="select-box">
           <div class="select-box--item">
@@ -17,6 +17,7 @@
               range-separator="至"
               start-placeholder="开始时间"
               end-placeholder="结束时间"
+              value-format="YYYY-MM-DD HH:mm:ss"
             />
           </div>
         </section>
@@ -60,16 +61,24 @@
   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 { ALARM_PUSH_PROMISSION_CODE, 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';
+  import dayjs from 'dayjs';
+
+  import { useUserInfoHook } from '@/hooks/useUserInfoHook';
+
+  const { permissions } = useUserInfoHook();
+  const managementPermission = ref<Boolean>(
+    Boolean(permissions.find((item: { code: string }) => item.code === ALARM_PUSH_PROMISSION_CODE)),
+  );
 
   const searchData = reactive<BreakTableQuery>({});
-  const searchTime = ref<string[]>([]);
+  const searchTime = ref<string[]>();
 
   const { tableConfig, pagination } = useTableConfig(OUTER_PERSON_BREAK_TABEL_COLUMNS, TABLE_OPTIONS);
 
@@ -81,11 +90,14 @@
     queryParam: {},
   });
   function getQuery() {
-    tableQuery.queryParam = {
-      ...searchData,
-      startTime: searchTime.value[0],
-      endTime: searchTime.value[1],
-    };
+    tableQuery.queryParam = {};
+    if (searchData.captureLocation != null) {
+      tableQuery.queryParam.captureLocation = searchData.captureLocation;
+    }
+    if (searchTime.value) {
+      tableQuery.queryParam.startTime = searchTime.value[0];
+      tableQuery.queryParam.endTime = searchTime.value[1];
+    }
   }
   async function getTableData() {
     tableConfig.loading = true;

+ 58 - 10
src/views/security-confidentiality/person-management/outer-person/components/Visitor.vue

@@ -16,7 +16,7 @@
               <el-option
                 v-for="item in IS_FOREIGNER_TYPE_OPTIONS"
                 :key="item.value"
-                :value="item.label"
+                :value="item.value"
                 :label="item.label"
                 :disabled="item.disabled"
               />
@@ -41,12 +41,26 @@
             </el-select>
           </div>
           <div class="select-box--item">
-            <span>到达时间:</span>
-            <el-date-picker v-model="searchData.startTime" type="datetime" />
+            <span>到访时间:</span>
+            <el-date-picker
+              v-model="visitTime"
+              type="datetimerange"
+              range-separator="至"
+              start-placeholder="开始时间"
+              end-placeholder="结束时间"
+              value-format="YYYY-MM-DD HH:mm:ss"
+            />
           </div>
           <div class="select-box--item">
             <span>离开时间:</span>
-            <el-date-picker v-model="searchData.endTime" type="datetime" />
+            <el-date-picker
+              v-model="leaveTime"
+              type="datetimerange"
+              range-separator="至"
+              start-placeholder="开始时间"
+              end-placeholder="结束时间"
+              value-format="YYYY-MM-DD HH:mm:ss"
+            />
           </div>
         </section>
         <section class="search-btn">
@@ -84,7 +98,11 @@
         <span>{{ scope.row.visitReason || '--' }}</span>
       </template>
       <template #respondentName="scope">
-        <span>{{ scope.row.respondentName || '--' }}</span>
+        <span>{{
+          scope.row.respondentName && scope.row.respondentNo
+            ? scope.row.respondentName + '+' + scope.row.respondentNo
+            : '--'
+        }}</span>
       </template>
       <template #visitState="scope">
         <span>{{ VISIT_STATE_TYPE_LABEL[scope.row.visitState] || '--' }}</span>
@@ -115,10 +133,10 @@
     VISIT_STATE_TYPE_LABEL,
     VISITOR_MANAGEMENT_PROMISSION_CODE,
   } from '../constants';
+  import dayjs from 'dayjs';
   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();
@@ -128,6 +146,12 @@
 
   const searchData = reactive<VisitorTableQuery>({});
 
+  const visitTime = ref<string[]>([
+    dayjs().startOf('day').format('YYYY-MM-DD HH:mm:ss'),
+    dayjs().endOf('day').format('YYYY-MM-DD HH:mm:ss'),
+  ]);
+  const leaveTime = ref<string[]>();
+
   const { tableConfig, pagination } = useTableConfig(OUTER_PERSON_VISITOR_TABEL_COLUMNS, TABLE_OPTIONS);
 
   const tableData = ref<VisitorTableData[]>([]);
@@ -137,10 +161,28 @@
     pageSize: pagination.pageSize,
     queryParam: {},
   });
+  const selectableInputRef = ref<InstanceType<typeof SelectableInput>>();
   function getQuery() {
-    tableQuery.queryParam = {
-      ...searchData,
-    };
+    if (!selectableInputRef.value) return;
+    tableQuery.queryParam = {};
+    const selectableSearch = selectableInputRef.value.getValue();
+    if (selectableSearch) {
+      tableQuery.queryParam[selectableSearch.key as string] = selectableSearch.value;
+    }
+    if (searchData.isForeigner != null) {
+      tableQuery.queryParam.isForeigner = searchData.isForeigner;
+    }
+    if (searchData.visitState != null) {
+      tableQuery.queryParam.visitState = searchData.visitState;
+    }
+    if (visitTime.value) {
+      tableQuery.queryParam.visitStartTime = visitTime.value[0];
+      tableQuery.queryParam.visitEndTime = visitTime.value[1];
+    }
+    if (leaveTime.value) {
+      tableQuery.queryParam.leaveStartTime = leaveTime.value[0];
+      tableQuery.queryParam.leaveEndTime = leaveTime.value[1];
+    }
   }
   async function getTableData() {
     tableConfig.loading = true;
@@ -167,11 +209,17 @@
   }
 
   function handleReset() {
+    selectableInputRef.value?.clearValue();
     for (const key in searchData) {
       if (searchData.hasOwnProperty(key)) {
         searchData[key] = undefined;
       }
     }
+    visitTime.value = [
+      dayjs().startOf('day').format('YYYY-MM-DD HH:mm:ss'),
+      dayjs().endOf('day').format('YYYY-MM-DD HH:mm:ss'),
+    ];
+    leaveTime.value = [];
     handleSearch();
   }
 
@@ -189,7 +237,7 @@
     }
   }
   onMounted(() => {
-    getTableData();
+    handleSearch();
   });
 </script>
 

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

@@ -53,7 +53,7 @@ export const OUTER_PERSON_BREAK_TABEL_COLUMNS: TableColumnProps[] = [
 
 export const OUTER_PERSON_VISITOR_TABEL_COLUMNS: TableColumnProps[] = [
   {
-    label: '姓名',
+    label: '来访者',
     align: 'center',
     minWidth: '120px',
     prop: 'visitorName',

+ 3 - 2
src/views/security-confidentiality/person-management/outer-person/constants.ts

@@ -18,8 +18,8 @@ export const BREAK_EVENT_TYPE_LABEL = {
 };
 
 export enum DATA_SOURCE_TYPE {
-  ZHOUJIE = 2,
-  AI = 1,
+  ZHOUJIE = 1,
+  AI = 2,
 }
 
 export const DATA_SOURCE_TYPE_LABEL = {
@@ -107,3 +107,4 @@ export const VISIT_STATE_TYPE_OPTIONS: SelectOption[] = [
 ];
 
 export const VISITOR_MANAGEMENT_PROMISSION_CODE = 'security_business_module:visitor_manage';
+export const ALARM_PUSH_PROMISSION_CODE = 'security_business_module:alarm_push';

+ 4 - 2
src/views/security-confidentiality/person-management/outer-person/types.ts

@@ -21,8 +21,10 @@ export interface VisitorTableQuery {
   visitReason?: string | null;
   visitState?: number | null;
   respondentName?: string | null;
-  startTime?: string | null;
-  endTime?: string | null;
+  visitStartTime?: string | null;
+  visitEndTime?: string | null;
+  leaveStartTime?: string | null;
+  leaveEndTime?: string | null;
 }
 
 export interface VisitorTableData {

+ 5 - 3
src/views/security-confidentiality/vehicle-management/VehicleManagement.vue

@@ -16,7 +16,7 @@
                   type="datetimerange"
                   range-separator="至"
                   start-placeholder="开始时间"
-                  end-placeholder="结束时间"
+                  value-format="YYYY-MM-DD HH:mm:ss"
                 />
               </div>
             </section>
@@ -87,9 +87,11 @@
     tableQuery.queryParam = {
       fieldType: selectableSearch?.key as number | null,
       fieldContent: selectableSearch?.value,
-      startTime: searchTime.value ? searchTime.value[0] : undefined,
-      endTime: searchTime.value ? searchTime.value[1] : undefined,
     };
+    if (searchTime.value) {
+      tableQuery.queryParam.startTime = searchTime.value[0];
+      tableQuery.queryParam.endTime = searchTime.value[1];
+    }
   }
   async function getTableData() {
     tableConfig.loading = true;

+ 2 - 3
src/views/traffic/violation/act/Act.vue

@@ -168,7 +168,6 @@
   import SelectableInput from '@/components/formItems/selectableInput/SelectableInput.vue';
   import ActionButton from '@/components/ActionButton.vue';
   import RealtimeNotice from './components/RealtimeNotice.vue';
-  import dayjs from 'dayjs';
   import { ElMessage } from 'element-plus';
   import { TABLE_OPTIONS, VIOLATION_ACT_TABLE_COLUMNS, VIOLATION_ACT_TABLE_COLUMNS_CHECKONLY } from './configs/tables';
   import {
@@ -229,8 +228,8 @@
       tableQuery.queryParam.violateType = searchData.violateType;
     }
     if (searchData.searchTime) {
-      tableQuery.queryParam.startTime = dayjs(searchData.searchTime[0]).format('YYYY-MM-DD HH:MM:ss');
-      tableQuery.queryParam.endTime = dayjs(searchData.searchTime[1]).format('YYYY-MM-DD HH:MM:ss');
+      tableQuery.queryParam.startTime = searchData.searchTime[0];
+      tableQuery.queryParam.endTime = searchData.searchTime[1];
     }
   }
 

+ 2 - 3
src/views/traffic/violation/notice/Notice.vue

@@ -114,7 +114,6 @@
   import BasicTable from '@/components/BasicTable.vue';
   import useTableConfig from '@/hooks/useTableConfigHook';
   import SelectableInput from '@/components/formItems/selectableInput/SelectableInput.vue';
-  import dayjs from 'dayjs';
   import { ElMessage } from 'element-plus';
   import {
     TABLE_OPTIONS,
@@ -161,8 +160,8 @@
       tableQuery.queryParam.violateType = searchData.violateType;
     }
     if (searchData.searchTime) {
-      tableQuery.queryParam.startTime = dayjs(searchData.searchTime[0]).format('YYYY-MM-DD HH:MM:ss');
-      tableQuery.queryParam.endTime = dayjs(searchData.searchTime[1]).format('YYYY-MM-DD HH:MM:ss');
+      tableQuery.queryParam.startTime = searchData.searchTime[0];
+      tableQuery.queryParam.endTime = searchData.searchTime[1];
     }
   }