wyf 7 месяцев назад
Родитель
Сommit
e125542964

+ 3 - 3
src/views/traffic/regulation/components/NoticeEdit.vue

@@ -64,6 +64,7 @@
     ruleFormData.realname = res.creatName;
     ruleFormData.realname = res.creatName;
     ruleFormData.isPush = res.isPush;
     ruleFormData.isPush = res.isPush;
     ruleFormData.userGroupList = stringToArray(res.userGroupList);
     ruleFormData.userGroupList = stringToArray(res.userGroupList);
+    cloneRuleFormData();
   };
   };
 
 
   const handleUserGroupListChange = (userGroupList: number[]) => {
   const handleUserGroupListChange = (userGroupList: number[]) => {
@@ -122,10 +123,9 @@
     }
     }
   };
   };
 
 
-  onMounted(async () => {
-    await getDetail();
-    cloneRuleFormData();
+  onMounted(() => {
     beforeRouteLeave();
     beforeRouteLeave();
+    getDetail();
   });
   });
 </script>
 </script>
 
 

+ 1 - 1
src/views/traffic/regulation/components/NoticeView.vue

@@ -24,7 +24,7 @@
     <section class="content">
     <section class="content">
       <div v-html="NoticeDetail?.content"></div>
       <div v-html="NoticeDetail?.content"></div>
     </section>
     </section>
-    <section class="file" v-if="NoticeDetail?.attachment.length">
+    <section class="file" v-if="NoticeDetail?.attachment?.length">
       <span class="info-content" style="font-size: 14px">附件({{ NoticeDetail?.attachment.length }})</span>
       <span class="info-content" style="font-size: 14px">附件({{ NoticeDetail?.attachment.length }})</span>
       &nbsp;
       &nbsp;
       <a @click="downloadAll">下载全部</a>
       <a @click="downloadAll">下载全部</a>

+ 3 - 3
src/views/traffic/regulation/components/RegulationEdit.vue

@@ -63,6 +63,7 @@
     ruleFormData.realname = res.creatName;
     ruleFormData.realname = res.creatName;
     ruleFormData.isPush = res.isPush;
     ruleFormData.isPush = res.isPush;
     ruleFormData.userGroupList = stringToArray(res.userGroupList);
     ruleFormData.userGroupList = stringToArray(res.userGroupList);
+    cloneRuleFormData();
   };
   };
   const handleUserGroupListChange = (userGroupList: number[]) => {
   const handleUserGroupListChange = (userGroupList: number[]) => {
     ruleFormData.userGroupList = userGroupList;
     ruleFormData.userGroupList = userGroupList;
@@ -119,10 +120,9 @@
     }
     }
   };
   };
 
 
-  onMounted(async () => {
-    await getDetail();
-    cloneRuleFormData();
+  onMounted(() => {
     beforeRouteLeave();
     beforeRouteLeave();
+    getDetail();
   });
   });
 </script>
 </script>
 
 

+ 1 - 1
src/views/traffic/regulation/utils.ts

@@ -30,7 +30,7 @@ const formatAttachment = async (data: FileItem) => {
 };
 };
 
 
 export const formatAttachmentList = async (data: FileItem[]) => {
 export const formatAttachmentList = async (data: FileItem[]) => {
-  if (!data || data.length === 0) return null;
+  if (!data || data.length === 0) return data;
   const res = await Promise.all(
   const res = await Promise.all(
     data.map(async (item) => {
     data.map(async (item) => {
       const res = await formatAttachment(item);
       const res = await formatAttachment(item);

+ 17 - 5
src/views/traffic/violation/act/Act.vue

@@ -22,7 +22,7 @@
               <div class="select-box--item">
               <div class="select-box--item">
                 <span>违规类型:</span>
                 <span>违规类型:</span>
                 <el-select
                 <el-select
-                  v-model="searchData.violationType"
+                  v-model="searchData.violateType"
                   placeholder="请选择违规类型"
                   placeholder="请选择违规类型"
                   class="select-box--select"
                   class="select-box--select"
                   clearable
                   clearable
@@ -90,12 +90,24 @@
             @update:pageNumber="handleCurrentChange"
             @update:pageNumber="handleCurrentChange"
             @update:selection="handleSelectionChange"
             @update:selection="handleSelectionChange"
           >
           >
+            <template #violateName="scope">
+              <span>{{ scope.row.violateName || '-' }}</span>
+            </template>
+            <template #deptName="scope">
+              <span>{{ scope.row.deptName || '-' }}</span>
+            </template>
             <template #violateType="scope">
             <template #violateType="scope">
               <span>{{ ACT_VIOLATION_TYPE_LABEL[scope.row.violateType] }}</span>
               <span>{{ ACT_VIOLATION_TYPE_LABEL[scope.row.violateType] }}</span>
             </template>
             </template>
+            <template #speed="scope">
+              <span>{{ scope.row.speed || '-' }}</span>
+            </template>
             <template #capturePhotos="scope">
             <template #capturePhotos="scope">
               <ImageViewer :file-list="scope.row.capturePhotos" />
               <ImageViewer :file-list="scope.row.capturePhotos" />
             </template>
             </template>
+            <template #violateLocation="scope">
+              <span>{{ scope.row.violateLocation || '-' }}</span>
+            </template>
             <template #createSource="scope">
             <template #createSource="scope">
               <span>{{ ACT_NOTICE_DATA_SOURCE_LABEL[scope.row.createSource] }}</span>
               <span>{{ ACT_NOTICE_DATA_SOURCE_LABEL[scope.row.createSource] }}</span>
             </template>
             </template>
@@ -210,8 +222,8 @@
     if (searchData.isNotice) {
     if (searchData.isNotice) {
       tabelQuery.queryParam.isNotice = searchData.isNotice;
       tabelQuery.queryParam.isNotice = searchData.isNotice;
     }
     }
-    if (searchData.violationType) {
-      tabelQuery.queryParam.violationType = searchData.violationType;
+    if (searchData.violateType) {
+      tabelQuery.queryParam.violateType = searchData.violateType;
     }
     }
     if (searchData.searchTime) {
     if (searchData.searchTime) {
       tabelQuery.queryParam.startTime = dayjs(searchData.searchTime[0]).format('YYYY-MM-DD HH:MM:ss');
       tabelQuery.queryParam.startTime = dayjs(searchData.searchTime[0]).format('YYYY-MM-DD HH:MM:ss');
@@ -229,7 +241,7 @@
     searchData.carNumber = undefined;
     searchData.carNumber = undefined;
     searchData.violateName = undefined;
     searchData.violateName = undefined;
     searchData.deptName = undefined;
     searchData.deptName = undefined;
-    searchData.violationType = undefined;
+    searchData.violateType = undefined;
     searchData.searchTime = undefined;
     searchData.searchTime = undefined;
   }
   }
 
 
@@ -316,7 +328,7 @@
   const batchImportVisible = ref(false);
   const batchImportVisible = ref(false);
   const { urlPrefix } = useGlobSetting();
   const { urlPrefix } = useGlobSetting();
   const importApiUrl = ref(urlJoin(urlPrefix, '/trafficViolation/importTrafficViolationList'));
   const importApiUrl = ref(urlJoin(urlPrefix, '/trafficViolation/importTrafficViolationList'));
-  const templateUrl = ref('./skyeye-file-upload/sfysecurity/TEMPLATE/import-vehicle-template.xlsx');
+  const templateUrl = ref('./skyeye-file-upload/sfysecurity/TEMPLATE/import-violation-template.xlsx');
 
 
   const handleUpdate = () => {
   const handleUpdate = () => {
     batchImportVisible.value = false;
     batchImportVisible.value = false;

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

@@ -37,7 +37,7 @@
         </div>
         </div>
       </template>
       </template>
       <template #capturePhotos>
       <template #capturePhotos>
-        <UploadImages :maxCount="9" ref="uploadImagesRef" @upload-success="handleUploadChange" />
+        <UploadImages :maxCount="5" ref="uploadImagesRef" @upload-success="handleUploadChange" />
       </template>
       </template>
     </BasicForm>
     </BasicForm>
   </main>
   </main>

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

@@ -32,6 +32,9 @@
     width: 120px;
     width: 120px;
     height: 90px;
     height: 90px;
     position: relative;
     position: relative;
+    display: flex;
+    justify-content: center;
+    align-items: center;
   }
   }
   .image-viewer__image {
   .image-viewer__image {
     width: 120px;
     width: 120px;

+ 8 - 0
src/views/traffic/violation/act/configs/tables.ts

@@ -30,12 +30,14 @@ export const VIOLATION_ACT_TABLE_COLUMNS: TableColumnProps[] = [
   {
   {
     label: '车主',
     label: '车主',
     prop: 'violateName',
     prop: 'violateName',
+    slot: 'violateName',
     align: 'center',
     align: 'center',
     minWidth: '120px',
     minWidth: '120px',
   },
   },
   {
   {
     label: '所属部门',
     label: '所属部门',
     prop: 'deptName',
     prop: 'deptName',
+    slot: 'deptName',
     align: 'center',
     align: 'center',
     minWidth: '120px',
     minWidth: '120px',
   },
   },
@@ -49,6 +51,7 @@ export const VIOLATION_ACT_TABLE_COLUMNS: TableColumnProps[] = [
   {
   {
     label: '车速',
     label: '车速',
     prop: 'speed',
     prop: 'speed',
+    slot: 'speed',
     align: 'center',
     align: 'center',
     minWidth: '120px',
     minWidth: '120px',
   },
   },
@@ -63,6 +66,7 @@ export const VIOLATION_ACT_TABLE_COLUMNS: TableColumnProps[] = [
   {
   {
     label: '违规地点',
     label: '违规地点',
     prop: 'violateLocation',
     prop: 'violateLocation',
+    slot: 'violateLocation',
     align: 'center',
     align: 'center',
     minWidth: '120px',
     minWidth: '120px',
   },
   },
@@ -112,12 +116,14 @@ export const VIOLATION_NOTICE_TABLE_COLUMNS: TableColumnProps[] = [
   {
   {
     label: '车主',
     label: '车主',
     prop: 'violateName',
     prop: 'violateName',
+    slot: 'violateName',
     align: 'center',
     align: 'center',
     minWidth: '120px',
     minWidth: '120px',
   },
   },
   {
   {
     label: '所属部门',
     label: '所属部门',
     prop: 'deptName',
     prop: 'deptName',
+    slot: 'deptName',
     align: 'center',
     align: 'center',
     minWidth: '120px',
     minWidth: '120px',
   },
   },
@@ -131,6 +137,7 @@ export const VIOLATION_NOTICE_TABLE_COLUMNS: TableColumnProps[] = [
   {
   {
     label: '车速',
     label: '车速',
     prop: 'speed',
     prop: 'speed',
+    slot: 'speed',
     align: 'center',
     align: 'center',
     minWidth: '120px',
     minWidth: '120px',
   },
   },
@@ -145,6 +152,7 @@ export const VIOLATION_NOTICE_TABLE_COLUMNS: TableColumnProps[] = [
   {
   {
     label: '违规地点',
     label: '违规地点',
     prop: 'violateLocation',
     prop: 'violateLocation',
+    slot: 'violateLocation',
     align: 'center',
     align: 'center',
     minWidth: '120px',
     minWidth: '120px',
   },
   },

+ 1 - 1
src/views/traffic/violation/act/constants.ts

@@ -6,7 +6,7 @@ export const ACT_TABLE_SEARCH_OPTIONS: SelectOption[] = [
   },
   },
   {
   {
     label: '车主',
     label: '车主',
-    value: 'driverName',
+    value: 'violateName',
     disabled: false,
     disabled: false,
   },
   },
   {
   {

+ 1 - 1
src/views/traffic/violation/act/types.ts

@@ -9,7 +9,7 @@ export interface ActTableSearch {
   carNumber?: string;
   carNumber?: string;
   violateName?: string;
   violateName?: string;
   deptName?: string;
   deptName?: string;
-  violationType?: number;
+  violateType?: number;
   isNotice?: number;
   isNotice?: number;
   searchTime?: string[];
   searchTime?: string[];
 }
 }

+ 16 - 4
src/views/traffic/violation/notice/Notice.vue

@@ -12,7 +12,7 @@
               <div class="select-box--item">
               <div class="select-box--item">
                 <span>违规类型:</span>
                 <span>违规类型:</span>
                 <el-select
                 <el-select
-                  v-model="searchData.violationType"
+                  v-model="searchData.violateType"
                   placeholder="请选择违规类型"
                   placeholder="请选择违规类型"
                   class="select-box--select"
                   class="select-box--select"
                   clearable
                   clearable
@@ -68,12 +68,24 @@
           @update:pageSize="handleSizeChange"
           @update:pageSize="handleSizeChange"
           @update:pageNumber="handleCurrentChange"
           @update:pageNumber="handleCurrentChange"
         >
         >
+          <template #violateName="scope">
+            <span>{{ scope.row.violateName || '-' }}</span>
+          </template>
+          <template #deptName="scope">
+            <span>{{ scope.row.deptName || '-' }}</span>
+          </template>
           <template #violateType="scope">
           <template #violateType="scope">
             <span>{{ ACT_VIOLATION_TYPE_LABEL[scope.row.violateType] }}</span>
             <span>{{ ACT_VIOLATION_TYPE_LABEL[scope.row.violateType] }}</span>
           </template>
           </template>
+          <template #speed="scope">
+            <span>{{ scope.row.speed || '-' }}</span>
+          </template>
           <template #capturePhotos="scope">
           <template #capturePhotos="scope">
             <ImageViewer :file-list="scope.row.capturePhotos" />
             <ImageViewer :file-list="scope.row.capturePhotos" />
           </template>
           </template>
+          <template #violateLocation="scope">
+            <span>{{ scope.row.violateLocation || '-' }}</span>
+          </template>
           <template #createSource="scope">
           <template #createSource="scope">
             <span>{{ ACT_NOTICE_DATA_SOURCE_LABEL[scope.row.createSource] }}</span>
             <span>{{ ACT_NOTICE_DATA_SOURCE_LABEL[scope.row.createSource] }}</span>
           </template>
           </template>
@@ -146,8 +158,8 @@
     if (searchData.isNotice) {
     if (searchData.isNotice) {
       tabelQuery.queryParam.isNotice = searchData.isNotice;
       tabelQuery.queryParam.isNotice = searchData.isNotice;
     }
     }
-    if (searchData.violationType) {
-      tabelQuery.queryParam.violationType = searchData.violationType;
+    if (searchData.violateType) {
+      tabelQuery.queryParam.violateType = searchData.violateType;
     }
     }
     if (searchData.searchTime) {
     if (searchData.searchTime) {
       tabelQuery.queryParam.startTime = dayjs(searchData.searchTime[0]).format('YYYY-MM-DD HH:MM:ss');
       tabelQuery.queryParam.startTime = dayjs(searchData.searchTime[0]).format('YYYY-MM-DD HH:MM:ss');
@@ -165,7 +177,7 @@
     searchData.carNumber = undefined;
     searchData.carNumber = undefined;
     searchData.violateName = undefined;
     searchData.violateName = undefined;
     searchData.deptName = undefined;
     searchData.deptName = undefined;
-    searchData.violationType = undefined;
+    searchData.violateType = undefined;
     searchData.searchTime = undefined;
     searchData.searchTime = undefined;
   }
   }