Prechádzať zdrojové kódy

Merge branch 'dev-wyf' into 'dev'

fix: bug修复

See merge request product-group-fe/sfy-safety-group/sfy-safety!202
ai0197 7 mesiacov pred
rodič
commit
4b1b9b413c

+ 11 - 11
src/views/emergency/emergency-drill/PageDrillPlanList.vue

@@ -89,21 +89,21 @@
 
   function handleDeleteDrillPlan(id: number) {
     deleteEmergencyDrillPlan(id).then(() => {
-      getTabelData();
+      getTableData();
     });
   }
 
   // 搜索栏
   const searchData = reactive<DrillPlanListSearch>({});
   function handleSearch() {
-    tabelQuery.value.queryParam = searchData;
-    getTabelData();
+    tableQuery.value.queryParam = searchData;
+    getTableData();
   }
 
   // 表格
   const { tableConfig, pagination } = useTableConfig(DRILL_PLAN_LIST_TABLE_COLUMNS, TABLE_OPTIONS);
 
-  const tabelQuery = ref({
+  const tableQuery = ref({
     pageNumber: pagination.pageNumber,
     pageSize: pagination.pageSize,
     queryParam: {},
@@ -113,13 +113,13 @@
 
   const handleSizeChange = (value: number) => {
     pagination.pageSize = value;
-    tabelQuery.value.pageSize = value;
-    getTabelData();
+    tableQuery.value.pageSize = value;
+    getTableData();
   };
   const handleCurrentChange = (value: number) => {
     pagination.pageNumber = value;
-    tabelQuery.value.pageSize = value;
-    getTabelData();
+    tableQuery.value.pageSize = value;
+    getTableData();
   };
 
   // 解析演练规模字典
@@ -132,9 +132,9 @@
     return EMERGENCY_DRILL_STATUS_DICT[status];
   }
 
-  async function getTabelData() {
+  async function getTableData() {
     tableConfig.loading = true;
-    const res = await queryEnergencyDrillPlanList(tabelQuery.value);
+    const res = await queryEnergencyDrillPlanList(tableQuery.value);
     res.records.forEach((item) => {
       item.responsibleDeptNameList = item.responsibleDeptNameList.replace(/^\[|\]$/g, '');
       item.coordinateDeptNameList = item.coordinateDeptNameList?.replace(/^\[|\]$/g, '');
@@ -147,7 +147,7 @@
   // 初始化
   onMounted(async () => {
     await getDrillScopeDict();
-    getTabelData();
+    getTableData();
   });
 
   // 按钮操作

+ 10 - 10
src/views/system/approval/PageApproval.vue

@@ -28,7 +28,7 @@
       </div>
     </main>
   </div>
-  <ApprovalCreateDialog ref="approvalCreateDialogRef" @success="getTabelData" />
+  <ApprovalCreateDialog ref="approvalCreateDialogRef" @success="getTableData" />
 </template>
 
 <script setup lang="ts">
@@ -48,7 +48,7 @@
 
   const { tableConfig, pagination } = useTableConfig(APPROVAL_TABLE_COLUMNS, TABLE_OPTIONS);
 
-  const tabelQuery = ref({
+  const tableQuery = ref({
     pageNumber: pagination.pageNumber,
     pageSize: pagination.pageSize,
     queryParam: undefined,
@@ -57,26 +57,26 @@
   const tableData = ref<ApprovalInstanceType[]>([]);
   const handleSizeChange = (value: number) => {
     pagination.pageSize = value;
-    tabelQuery.value.pageSize = value;
-    getTabelData();
+    tableQuery.value.pageSize = value;
+    getTableData();
   };
   const handleCurrentChange = (value: number) => {
     pagination.pageNumber = value;
-    tabelQuery.value.pageNumber = value;
-    getTabelData();
+    tableQuery.value.pageNumber = value;
+    getTableData();
   };
 
-  async function getTabelData() {
+  async function getTableData() {
     tableConfig.loading = true;
 
-    const res = await getApprovalInstanceList(tabelQuery.value);
+    const res = await getApprovalInstanceList(tableQuery.value);
     tableData.value = res.records;
     pagination.total = res.totalRow;
     tableConfig.loading = false;
   }
 
   onMounted(() => {
-    getTabelData();
+    getTableData();
   });
 
   const approvalCreateDialogRef = ref<InstanceType<typeof ApprovalCreateDialog>>();
@@ -100,7 +100,7 @@
     try {
       tableConfig.loading = true;
       await delApprovalInstance(row.id);
-      getTabelData();
+      getTableData();
     } catch (e) {
       console.log(e);
     }

+ 5 - 5
src/views/system/approval/PageApprovalNode.vue

@@ -56,7 +56,7 @@
       :is-create="isCreatForm"
       :init-data="initFormData"
       :order-list="approvalOrderList"
-      @success="getTabelData"
+      @success="getTableData"
     />
   </div>
 </template>
@@ -113,7 +113,7 @@
   const { tableConfig } = useTableConfig(APPROVAL_NODE_TABLE_COLUMNS, NODE_TABLE_OPTIONS, false);
   const tableData = ref<ApprovalNodeInstanceType[]>([]);
 
-  async function getTabelData() {
+  async function getTableData() {
     tableConfig.loading = true;
     approvalInstance.value = await getApprovalNodeInstanceList(Number(id));
     tableData.value = approvalInstance.value.approvalNodeInfoList!;
@@ -124,7 +124,7 @@
   }
 
   onMounted(async () => {
-    await getTabelData();
+    await getTableData();
     initForm(approvalInstance.value!);
     cloneRuleFormData();
     beforeRouteLeave();
@@ -200,7 +200,7 @@
         approverList: '[' + list.map((item) => item.id).join(',') + ']',
       });
       approverSelectDialogRef.value.closeDialog();
-      getTabelData();
+      getTableData();
       curNodeId.value = undefined;
     } catch (e) {
       console.log(e);
@@ -215,7 +215,7 @@
     try {
       tableConfig.loading = true;
       await delApprovalNodeInstance(id);
-      getTabelData();
+      getTableData();
     } catch (e) {
       console.log(e);
     }

+ 12 - 12
src/views/traffic/regulation/components/NoticeTable.vue

@@ -154,8 +154,8 @@
     managementType: 2, // 1-管理规定,2-管理通知
   });
   function handleSearch() {
-    tabelQuery.value.queryParam = searchData;
-    getTabelData();
+    tableQuery.value.queryParam = searchData;
+    getTableData();
   }
 
   // 表格
@@ -166,7 +166,7 @@
 
   const tableData = ref<RegulationDetailResponse[]>([]);
 
-  const tabelQuery = ref<QueryPageRequest<TableSearchQuery>>({
+  const tableQuery = ref<QueryPageRequest<TableSearchQuery>>({
     pageNumber: pagination.pageNumber,
     pageSize: pagination.pageSize,
     queryParam: searchData,
@@ -174,17 +174,17 @@
 
   const handleSizeChange = (value: number) => {
     pagination.pageSize = value;
-    tabelQuery.value.pageSize = value;
-    getTabelData();
+    tableQuery.value.pageSize = value;
+    getTableData();
   };
   const handleCurrentChange = (value: number) => {
     pagination.pageNumber = value;
-    tabelQuery.value.pageSize = value;
-    getTabelData();
+    tableQuery.value.pageSize = value;
+    getTableData();
   };
 
-  async function getTabelData() {
-    const res = await getNoticeList(tabelQuery.value);
+  async function getTableData() {
+    const res = await getNoticeList(tableQuery.value);
     tableData.value = res.records;
     tableData.value = res.records;
     pagination.total = res.totalRow;
@@ -200,7 +200,7 @@
   };
 
   onMounted(async () => {
-    getTabelData();
+    getTableData();
   });
 
   function handleCreateNotice() {
@@ -240,7 +240,7 @@
     } finally {
       tableConfig.loading = false;
     }
-    getTabelData();
+    getTableData();
   }
   async function handleDelete(id: number) {
     tableConfig.loading = true;
@@ -252,7 +252,7 @@
     } finally {
       tableConfig.loading = false;
     }
-    getTabelData();
+    getTableData();
   }
 </script>
 

+ 12 - 12
src/views/traffic/regulation/components/RegulationTable.vue

@@ -146,8 +146,8 @@
     managementType: 1,
   });
   function handleSearch() {
-    tabelQuery.value.queryParam = searchData;
-    getTabelData();
+    tableQuery.value.queryParam = searchData;
+    getTableData();
   }
 
   // 表格
@@ -158,7 +158,7 @@
 
   const tableData = ref<RegulationDetailResponse[]>([]);
 
-  const tabelQuery = ref<QueryPageRequest<TableSearchQuery>>({
+  const tableQuery = ref<QueryPageRequest<TableSearchQuery>>({
     pageNumber: pagination.pageNumber,
     pageSize: pagination.pageSize,
     queryParam: searchData,
@@ -166,18 +166,18 @@
 
   const handleSizeChange = (value: number) => {
     pagination.pageSize = value;
-    tabelQuery.value.pageSize = value;
-    getTabelData();
+    tableQuery.value.pageSize = value;
+    getTableData();
   };
   const handleCurrentChange = (value: number) => {
     pagination.pageNumber = value;
-    tabelQuery.value.pageNumber = value;
-    getTabelData();
+    tableQuery.value.pageNumber = value;
+    getTableData();
   };
 
-  async function getTabelData() {
+  async function getTableData() {
     tableConfig.loading = true;
-    const res = await getRegulationList(tabelQuery.value);
+    const res = await getRegulationList(tableQuery.value);
     tableData.value = res.records;
     pagination.total = res.totalRow;
     tableConfig.loading = false;
@@ -191,7 +191,7 @@
   };
 
   onMounted(async () => {
-    getTabelData();
+    getTableData();
   });
 
   function handleCreateRegulation() {
@@ -221,7 +221,7 @@
     } finally {
       tableConfig.loading = false;
     }
-    getTabelData();
+    getTableData();
   }
   async function handleDelete(id: number) {
     tableConfig.loading = true;
@@ -233,7 +233,7 @@
     } finally {
       tableConfig.loading = false;
     }
-    getTabelData();
+    getTableData();
   }
 </script>
 

+ 39 - 24
src/views/traffic/violation/act/Act.vue

@@ -84,6 +84,7 @@
             </div>
           </div>
           <BasicTable
+            ref="basicTableRef"
             :tableData="tableData"
             :tableConfig="tableConfig"
             @update:pageSize="handleSizeChange"
@@ -91,7 +92,7 @@
             @update:selection="handleSelectionChange"
           >
             <template #violateName="scope">
-              <span>{{ scope.row.violateName || '-' }}</span>
+              <span>{{ scope.row.violateName ? scope.row.violateName + '(' + scope.row.staffNo + ')' : '-' }}</span>
             </template>
             <template #deptName="scope">
               <span>{{ scope.row.deptName || '-' }}</span>
@@ -167,7 +168,7 @@
   import RealtimeNotice from './components/RealtimeNotice.vue';
   import dayjs from 'dayjs';
   import { ElMessage } from 'element-plus';
-  import { TABLE_OPTIONS, VIOLATION_ACT_TABLE_COLUMNS, VIOLATION_NOTICE_TABLE_COLUMNS } from './configs/tables';
+  import { TABLE_OPTIONS, VIOLATION_ACT_TABLE_COLUMNS, VIOLATION_ACT_TABLE_COLUMNS_CHECKONLY } from './configs/tables';
   import {
     ACT_NOTICE_DATA_SOURCE_LABEL,
     ACT_VIOLATION_TYPE,
@@ -181,7 +182,7 @@
     ACT_MANAGEMENT_PROMISSION_CODE,
   } from './constants';
   import { ref, reactive, onMounted } from 'vue';
-  import { Search, Plus } from '@element-plus/icons-vue';
+  import { Close, Plus } from '@element-plus/icons-vue';
   import { useRouter } from 'vue-router';
   import { openMessageBox } from '@/utils/element-plus/messageBox';
   import type { QueryPageRequest } from '@/types/basic-query';
@@ -212,22 +213,22 @@
 
   function getQuery() {
     if (!selectableInputRef.value) return;
-    tabelQuery.queryParam = {
+    tableQuery.queryParam = {
       pageType: 1,
     };
     const selectableSearch = selectableInputRef.value.getValue();
     if (selectableSearch) {
-      tabelQuery.queryParam[selectableSearch.key as string] = selectableSearch.value;
+      tableQuery.queryParam[selectableSearch.key as string] = selectableSearch.value;
     }
-    if (searchData.isNotice) {
-      tabelQuery.queryParam.isNotice = searchData.isNotice;
+    if (searchData.isNotice != null) {
+      tableQuery.queryParam.isNotice = searchData.isNotice;
     }
-    if (searchData.violateType) {
-      tabelQuery.queryParam.violateType = searchData.violateType;
+    if (searchData.violateType != null) {
+      tableQuery.queryParam.violateType = searchData.violateType;
     }
     if (searchData.searchTime) {
-      tabelQuery.queryParam.startTime = dayjs(searchData.searchTime[0]).format('YYYY-MM-DD HH:MM:ss');
-      tabelQuery.queryParam.endTime = dayjs(searchData.searchTime[1]).format('YYYY-MM-DD HH:MM:ss');
+      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');
     }
   }
 
@@ -241,6 +242,7 @@
     searchData.carNumber = undefined;
     searchData.violateName = undefined;
     searchData.deptName = undefined;
+    searchData.isNotice = undefined;
     searchData.violateType = undefined;
     searchData.searchTime = undefined;
   }
@@ -248,7 +250,7 @@
   async function handleDownload() {
     getQuery();
     try {
-      const res = await exportActViolation(tabelQuery.queryParam);
+      const res = await exportActViolation(tableQuery.queryParam);
       if (res.size === 0) return;
       const blob = new Blob([res], { type: 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet' });
       const url = window.URL.createObjectURL(blob);
@@ -263,13 +265,13 @@
   const basicTableRef = ref<InstanceType<typeof BasicTable>>();
 
   const { tableConfig, pagination } = useTableConfig(
-    actManagementPermission ? VIOLATION_ACT_TABLE_COLUMNS : VIOLATION_NOTICE_TABLE_COLUMNS,
+    actManagementPermission ? VIOLATION_ACT_TABLE_COLUMNS : VIOLATION_ACT_TABLE_COLUMNS_CHECKONLY,
     TABLE_OPTIONS,
   );
 
   const tableData = ref<ActTableData[]>([]);
 
-  const tabelQuery = reactive<QueryPageRequest<ActTableQuery>>({
+  const tableQuery = reactive<QueryPageRequest<ActTableQuery>>({
     pageNumber: pagination.pageNumber,
     pageSize: pagination.pageSize,
     queryParam: {
@@ -278,13 +280,13 @@
   });
 
   const handleSizeChange = (value: number) => {
-    pagination.pageNumber = value;
-    tabelQuery.pageSize = value;
+    pagination.pageSize = value;
+    tableQuery.pageSize = value;
     getTableData();
   };
   const handleCurrentChange = (value: number) => {
     pagination.pageNumber = value;
-    tabelQuery.pageSize = value;
+    tableQuery.pageNumber = value;
     getTableData();
   };
 
@@ -302,23 +304,36 @@
   const handleBatchNotice = async () => {
     const confirmed = await openMessageBox('', '确认通知任务吗?', 'warning');
     if (!confirmed) return;
-    const noticeIds = selectionItems.value.map((item) => item.id);
-    await noticeActData(noticeIds);
-    ElMessage.success('批量通知成功');
-    getTableData();
+    const unNoticeItem = selectionItems.value.filter((item) => item.isNotice === ACT_NOTICE_STATE.INACTIVE);
+    if (!unNoticeItem.length) {
+      ElMessage.warning('通知成功!共通知0条记录');
+    } else {
+      const noticeIds = unNoticeItem.map((item) => item.id);
+      try {
+        await noticeActData(noticeIds);
+        ElMessage.success(`通知成功!共通知${noticeIds.length}条记录`);
+      } catch (e) {
+        ElMessage.error('批量通知失败');
+      }
+      getTableData();
+    }
   };
   const handleBatchDelete = async () => {
     const confirmed = await openMessageBox('', '删除后任务不可恢复,确认删除吗?', 'warning');
     if (!confirmed) return;
     const deleteIds = selectionItems.value.map((item) => item.id);
-    await deleteActData(deleteIds);
-    ElMessage.success('批量删除成功');
+    try {
+      await deleteActData(deleteIds);
+      ElMessage.success('批量删除成功');
+    } catch (e) {
+      ElMessage.error('批量删除失败');
+    }
     getTableData();
   };
 
   async function getTableData() {
     tableConfig.loading = true;
-    const res = await getActTableList(tabelQuery);
+    const res = await getActTableList(tableQuery);
     tableData.value = res.records;
     pagination.total = res.totalRow;
     tableConfig.loading = false;

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

@@ -19,7 +19,8 @@
               {
                 required: true,
                 validator: (_rule, value, callback) => {
-                  if (!value) return callback(new Error('请输入车速'));
+                  if (value == null) return callback(new Error('请输入车速'));
+                  if (!(Number.isInteger(value) && value > 0)) return callback(new Error('车速格式错误'));
                   if (value > 999) {
                     callback(new Error('超过车速时速上限'));
                   } else {
@@ -30,7 +31,14 @@
               },
             ]"
           >
-            <el-input v-model.number="ruleFormData.speed" placeholder="请输入车速" type="number" min="0">
+            <el-input
+              v-model.number="ruleFormData.speed"
+              placeholder="请输入车速"
+              type="number"
+              min="0"
+              max="999"
+              step="1"
+            >
               <template #suffix>km/h</template>
             </el-input>
           </el-form-item>
@@ -87,7 +95,6 @@
       violateType: ruleFormData.violateType!,
       capturePhotos: JSON.stringify(await formatImageList(ruleFormData.capturePhotos)),
     };
-
     return res;
   };
 

+ 11 - 3
src/views/traffic/violation/act/components/ActEdit.vue

@@ -19,8 +19,8 @@
               {
                 required: true,
                 validator: (_rule, value, callback) => {
-                  console.log(value);
-                  if (!value) return callback(new Error('请输入车速'));
+                  if (value == null) return callback(new Error('请输入车速'));
+                  if (!(Number.isInteger(value) && value > 0)) return callback(new Error('车速格式错误'));
                   if (value > 999) {
                     callback(new Error('超过车速时速上限'));
                   } else {
@@ -31,7 +31,14 @@
               },
             ]"
           >
-            <el-input v-model.number="ruleFormData.speed" placeholder="请输入车速" type="number" min="0">
+            <el-input
+              v-model.number="ruleFormData.speed"
+              placeholder="请输入车速"
+              type="number"
+              min="0"
+              max="999"
+              step="1"
+            >
               <template #suffix>km/h</template>
             </el-input>
           </el-form-item>
@@ -97,6 +104,7 @@
     ruleFormData.capturePhotos = unformatImage(actDetail.value.capturePhotos)?.map((x) => {
       return { url: x };
     });
+    ruleFormData.remark = actDetail.value.remark;
     ruleFormData.creatName = actDetail.value.creatName;
 
     imageList.value = unformatImage(actDetail.value.capturePhotos)!;

+ 91 - 29
src/views/traffic/violation/act/components/RealtimeNotice.vue

@@ -5,55 +5,106 @@
     </el-tooltip>
     <span class="label">实时通知</span>
     <el-switch v-model="switchVal" class="switch" @change="handleRealtimeNoticeChange" />
-    <span class="condition" v-if="switchVal">条件:车速≥{{ speed }}km/h</span>
-    <el-popconfirm
+    <span class="condition" v-if="switchVal">条件:车速≥{{ showSpeed }}km/h</span>
+    <el-popover
+      v-if="switchVal"
+      v-model:visible="formVisible"
+      trigger="click"
       width="300"
-      hide-icon
       placement="bottom-end"
       title="设置通知条件"
-      @confirm="handleRealtimeNoticeChange(true)"
+      append-to=".realtime-notice"
     >
       <template #reference>
         <img style="margin: 0 10px; cursor: pointer" src="@/assets/icons/edit_2.png" alt="" />
       </template>
-      <template #actions="{ confirm, cancel }">
-        <div class="popconfirm-container"></div>
-        <el-form label-width="50px">
-          <el-form-item label="车速">
-            <el-input v-model="speedEdit" type="number" min="0">
-              <template #suffix>km/h</template>
-            </el-input>
-          </el-form-item>
-        </el-form>
-        <el-button @click="cancel">取消</el-button>
-        <el-button type="primary" @click="confirm">确定</el-button>
+      <template #default>
+        <div class="config-form-container">
+          <el-form ref="ruleFormRef" :model="ruleFormData" label-width="60px">
+            <el-form-item
+              prop="speedLimit"
+              label="车速:"
+              :rules="[
+                {
+                  validator: (_rule, value, callback) => {
+                    console.log(typeof value);
+                    if (value == null) return callback(new Error('请输入车速'));
+                    if (!(Number.isInteger(value) && value > 0)) return callback(new Error('车速格式错误'));
+                    if (value > 999) {
+                      callback(new Error('超过车速时速上限'));
+                    } else {
+                      callback();
+                    }
+                  },
+                  trigger: 'blur',
+                },
+              ]"
+            >
+              <el-input
+                v-model.number="ruleFormData.speedLimit"
+                placeholder="请输入车速"
+                type="number"
+                min="0"
+                max="999"
+                step="1"
+              >
+                <template #suffix>km/h</template>
+              </el-input>
+            </el-form-item>
+          </el-form>
+        </div>
+        <div class="config-form-btn">
+          <el-button @click="formVisible = false">取消</el-button>
+          <el-button type="primary" @click="handleRealtimeNoticeChange(true)">确定</el-button>
+        </div>
       </template>
-    </el-popconfirm>
+    </el-popover>
   </div>
 </template>
 
 <script setup lang="ts">
-  import { onMounted, ref } from 'vue';
-
+  import { onMounted, ref, reactive } from 'vue';
   import { updateRealtimeNotice, getRealtimeNoticeConfig } from '@/api/traffic-violation/traffic-act';
+  import { ElMessage } from 'element-plus';
 
   const switchVal = ref(false);
-  const speed = ref(45);
-  const speedEdit = ref(45);
+  const showSpeed = ref(45);
 
-  async function handleRealtimeNoticeChange(val: boolean) {
-    await updateRealtimeNotice({ realtimeNotice: val, speedLimit: speedEdit.value });
-    getRealtimeNoticeConfig().then((res) => {
+  const formVisible = ref(false);
+  const ruleFormRef = ref();
+  const ruleFormData = reactive<{
+    speedLimit: number | null;
+  }>({
+    speedLimit: null,
+  });
+
+  async function getNoticeConfig() {
+    try {
+      const res = await getRealtimeNoticeConfig();
       switchVal.value = res.realtimeNotice;
-      speed.value = res.speedLimit ? res.speedLimit : 45;
-    });
+      showSpeed.value = res.speedLimit || 45;
+      ruleFormData.speedLimit = res.speedLimit || 45;
+    } catch (error) {
+      ElMessage.error('获取实时通知配置失败');
+    }
+  }
+
+  async function handleRealtimeNoticeChange(val: boolean) {
+    if (formVisible.value) {
+      const res = await ruleFormRef.value.validate();
+      if (!res) return false;
+    }
+    try {
+      await updateRealtimeNotice({ realtimeNotice: val, speedLimit: val ? ruleFormData.speedLimit! : 45 });
+    } catch (error) {
+      ElMessage.error('更新实时通知配置失败');
+    }
+    if (formVisible.value) formVisible.value = false;
+    getNoticeConfig();
   }
 
   onMounted(() => {
-    getRealtimeNoticeConfig().then((res) => {
-      switchVal.value = res.realtimeNotice;
-      speed.value = res.speedLimit ? res.speedLimit : 45;
-    });
+    getNoticeConfig();
   });
 </script>
 
@@ -77,4 +128,15 @@
     color: rgba(0, 0, 0, 0.7);
     font-size: 14px;
   }
+  .config-form-container {
+    margin: 5px 0;
+  }
+  .config-form-btn {
+    text-align: end;
+  }
+
+  :deep(.el-popover__title) {
+    color: rgba(0, 0, 0, 0.85);
+    font-size: 14px;
+  }
 </style>

+ 3 - 3
src/views/traffic/violation/act/configs/form.ts

@@ -31,10 +31,10 @@ export const ACT_FORM_CONFIG: FormConfig[] = [
     componentProps: {
       placeholder: '请选择抓拍时间',
       type: 'datetime',
-      format: 'YYYY-MM-DD HH:mm',
+      format: 'YYYY-MM-DD HH:mm:ss',
       dateFormat: 'MMM DD, YYYY',
-      timeFormat: 'HH:mm',
-      valueFormat: 'YYYY-MM-DD HH:mm',
+      timeFormat: 'HH:mm:ss',
+      valueFormat: 'YYYY-MM-DD HH:mm:ss',
       disabledDate: (time) => time.getTime() > Date.now(),
     },
   },

+ 123 - 1
src/views/traffic/violation/act/configs/tables.ts

@@ -100,7 +100,7 @@ export const VIOLATION_ACT_TABLE_COLUMNS: TableColumnProps[] = [
   },
 ];
 
-export const VIOLATION_NOTICE_TABLE_COLUMNS: TableColumnProps[] = [
+export const VIOLATION_ACT_TABLE_COLUMNS_CHECKONLY: TableColumnProps[] = [
   {
     label: '序号',
     align: 'center',
@@ -177,3 +177,125 @@ export const VIOLATION_NOTICE_TABLE_COLUMNS: TableColumnProps[] = [
     width: '200px',
   },
 ];
+
+export const VIOLATION_NOTICE_TABLE_COLUMNS: TableColumnProps[] = [
+  {
+    label: '序号',
+    align: 'center',
+    width: '80px',
+    type: 'index',
+  },
+  {
+    label: '车牌号',
+    prop: 'carNumber',
+    align: 'center',
+    minWidth: '120px',
+  },
+  {
+    label: '车主',
+    prop: 'violateName',
+    slot: 'violateName',
+    align: 'center',
+    minWidth: '120px',
+  },
+  {
+    label: '所属部门',
+    prop: 'deptName',
+    slot: 'deptName',
+    align: 'center',
+    minWidth: '120px',
+  },
+  {
+    label: '违规类型',
+    prop: 'violateType',
+    slot: 'violateType',
+    align: 'center',
+    minWidth: '120px',
+  },
+  {
+    label: '车速',
+    prop: 'speed',
+    slot: 'speed',
+    align: 'center',
+    minWidth: '120px',
+  },
+
+  {
+    label: '抓拍图片',
+    prop: 'capturePhotos',
+    slot: 'capturePhotos',
+    align: 'center',
+    minWidth: '180px',
+  },
+  {
+    label: '违规地点',
+    prop: 'violateLocation',
+    slot: 'violateLocation',
+    align: 'center',
+    minWidth: '120px',
+  },
+  {
+    label: '时间',
+    prop: 'captureTime',
+    align: 'center',
+    width: '200px',
+  },
+  {
+    label: '数据来源',
+    prop: 'createSource',
+    slot: 'createSource',
+    align: 'center',
+    width: '200px',
+  },
+];
+
+export const VIOLATION_NOTICE_TABLE_COLUMNS_CHECKONLY: TableColumnProps[] = [
+  {
+    label: '序号',
+    align: 'center',
+    width: '80px',
+    type: 'index',
+  },
+  {
+    label: '车牌号',
+    prop: 'carNumber',
+    align: 'center',
+    minWidth: '120px',
+  },
+
+  {
+    label: '违规类型',
+    prop: 'violateType',
+    slot: 'violateType',
+    align: 'center',
+    minWidth: '120px',
+  },
+  {
+    label: '车速',
+    prop: 'speed',
+    slot: 'speed',
+    align: 'center',
+    minWidth: '120px',
+  },
+
+  {
+    label: '抓拍图片',
+    prop: 'capturePhotos',
+    slot: 'capturePhotos',
+    align: 'center',
+    minWidth: '180px',
+  },
+  {
+    label: '违规地点',
+    prop: 'violateLocation',
+    slot: 'violateLocation',
+    align: 'center',
+    minWidth: '120px',
+  },
+  {
+    label: '时间',
+    prop: 'captureTime',
+    align: 'center',
+    width: '200px',
+  },
+];

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

@@ -80,8 +80,8 @@ export enum ACT_NOTICE_DATA_SOURCE {
 }
 
 export const ACT_NOTICE_DATA_SOURCE_LABEL = {
-  [ACT_NOTICE_DATA_SOURCE.ARTIFICAL]: '人工上报',
-  [ACT_NOTICE_DATA_SOURCE.OUTSIDE]: '外部创建',
+  [ACT_NOTICE_DATA_SOURCE.ARTIFICAL]: '手动录入',
+  [ACT_NOTICE_DATA_SOURCE.OUTSIDE]: '车辆管理平台',
 };
 
 export const ACT_MANAGEMENT_PROMISSION_CODE = 'traffic_business_module:violation_record';

+ 26 - 17
src/views/traffic/violation/notice/Notice.vue

@@ -63,13 +63,14 @@
         </header>
         <!-- 表格 -->
         <BasicTable
+          ref="basicTableRef"
           :tableData="tableData"
           :tableConfig="tableConfig"
           @update:pageSize="handleSizeChange"
           @update:pageNumber="handleCurrentChange"
         >
           <template #violateName="scope">
-            <span>{{ scope.row.violateName || '-' }}</span>
+            <span>{{ scope.row.violateName ? scope.row.violateName + '(' + scope.row.staffNo + ')' : '-' }}</span>
           </template>
           <template #deptName="scope">
             <span>{{ scope.row.deptName || '-' }}</span>
@@ -115,7 +116,11 @@
   import SelectableInput from '@/components/formItems/selectableInput/SelectableInput.vue';
   import dayjs from 'dayjs';
   import { ElMessage } from 'element-plus';
-  import { TABLE_OPTIONS, VIOLATION_NOTICE_TABLE_COLUMNS } from '../act/configs/tables';
+  import {
+    TABLE_OPTIONS,
+    VIOLATION_NOTICE_TABLE_COLUMNS,
+    VIOLATION_NOTICE_TABLE_COLUMNS_CHECKONLY,
+  } from '../act/configs/tables';
   import {
     ACT_NOTICE_DATA_SOURCE_LABEL,
     ACT_VIOLATION_TYPE,
@@ -148,22 +153,22 @@
 
   function getQuery() {
     if (!selectableInputRef.value) return;
-    tabelQuery.queryParam = {
+    tableQuery.queryParam = {
       pageType: 2,
     };
     const selectableSearch = selectableInputRef.value.getValue();
     if (selectableSearch) {
-      tabelQuery.queryParam[selectableSearch.key as string] = selectableSearch.value;
+      tableQuery.queryParam[selectableSearch.key as string] = selectableSearch.value;
     }
-    if (searchData.isNotice) {
-      tabelQuery.queryParam.isNotice = searchData.isNotice;
+    if (searchData.isNotice != null) {
+      tableQuery.queryParam.isNotice = searchData.isNotice;
     }
-    if (searchData.violateType) {
-      tabelQuery.queryParam.violateType = searchData.violateType;
+    if (searchData.violateType != null) {
+      tableQuery.queryParam.violateType = searchData.violateType;
     }
     if (searchData.searchTime) {
-      tabelQuery.queryParam.startTime = dayjs(searchData.searchTime[0]).format('YYYY-MM-DD HH:MM:ss');
-      tabelQuery.queryParam.endTime = dayjs(searchData.searchTime[1]).format('YYYY-MM-DD HH:MM:ss');
+      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');
     }
   }
 
@@ -177,6 +182,7 @@
     searchData.carNumber = undefined;
     searchData.violateName = undefined;
     searchData.deptName = undefined;
+    searchData.isNotice = undefined;
     searchData.violateType = undefined;
     searchData.searchTime = undefined;
   }
@@ -184,7 +190,7 @@
   async function handleDownload() {
     getQuery();
     try {
-      const res = await exportActViolation(tabelQuery.queryParam);
+      const res = await exportActViolation(tableQuery.queryParam);
       if (res.size === 0) return;
       const blob = new Blob([res], { type: 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet' });
       const url = window.URL.createObjectURL(blob);
@@ -198,11 +204,14 @@
   // 表格
   const basicTableRef = ref<InstanceType<typeof BasicTable>>();
 
-  const { tableConfig, pagination } = useTableConfig(VIOLATION_NOTICE_TABLE_COLUMNS, TABLE_OPTIONS);
+  const { tableConfig, pagination } = useTableConfig(
+    noticeManagementPermission.value ? VIOLATION_NOTICE_TABLE_COLUMNS : VIOLATION_NOTICE_TABLE_COLUMNS_CHECKONLY,
+    TABLE_OPTIONS,
+  );
 
   const tableData = ref<ActTableData[]>([]);
 
-  const tabelQuery = reactive<QueryPageRequest<ActTableQuery>>({
+  const tableQuery = reactive<QueryPageRequest<ActTableQuery>>({
     pageNumber: pagination.pageNumber,
     pageSize: pagination.pageSize,
     queryParam: {
@@ -211,19 +220,19 @@
   });
 
   const handleSizeChange = (value: number) => {
-    pagination.pageNumber = value;
-    tabelQuery.pageSize = value;
+    pagination.pageSize = value;
+    tableQuery.pageSize = value;
     getTableData();
   };
   const handleCurrentChange = (value: number) => {
     pagination.pageNumber = value;
-    tabelQuery.pageSize = value;
+    tableQuery.pageNumber = value;
     getTableData();
   };
 
   async function getTableData() {
     tableConfig.loading = true;
-    const res = await getActTableList(tabelQuery);
+    const res = await getActTableList(tableQuery);
     tableData.value = res.records;
     pagination.total = res.totalRow;
     tableConfig.loading = false;