From 78c6de04f96cbcb0eb131e2a1de64e0eb85f2e30 Mon Sep 17 00:00:00 2001 From: douyage Date: Tue, 11 Aug 2026 10:24:09 +0800 Subject: [PATCH] =?UTF-8?q?=E5=A2=9E=E5=8A=A0=E5=B7=A1=E8=A7=86=E6=8A=A5?= =?UTF-8?q?=E5=91=8A=E3=80=81=E6=8A=A5=E5=91=8A=E8=AF=A6=E6=83=85=EF=BC=8C?= =?UTF-8?q?=E5=B7=A1=E8=A7=86=E4=BB=BB=E5=8A=A1=E9=87=8C=E9=9D=A2=E8=B7=B3?= =?UTF-8?q?=E8=BD=AC=E6=8A=A5=E5=91=8A=E8=AF=A6=E6=83=85?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../inspectionReporter.js | 8 + src/lang/index.js | 17 +- src/layout/components/Sidebar/Item.vue | 1 + src/router/index.js | 21 + src/store/modules/app.js | 3 +- .../cards/patrolReport/InspectionReporter.vue | 486 ++++++++++++ .../cards/patrolReport/patrolReportDetail.vue | 696 ++++++++++++++++++ .../cards/taskSummary/inspectionTask.vue | 62 +- 8 files changed, 1267 insertions(+), 27 deletions(-) create mode 100644 src/views/cards/patrolReport/InspectionReporter.vue create mode 100644 src/views/cards/patrolReport/patrolReportDetail.vue diff --git a/src/api/inspectionDataManage/inspectionReporter.js b/src/api/inspectionDataManage/inspectionReporter.js index cdad957..b80d1b8 100644 --- a/src/api/inspectionDataManage/inspectionReporter.js +++ b/src/api/inspectionDataManage/inspectionReporter.js @@ -19,3 +19,11 @@ export function getPatrolReport(lineId,filter) { params: {}, }); } + +export function getPatrolReportShaoxing(url, lineId, filter) { + return request({ + url: `/patrol/insreport/shaoxing/${url}/${lineId}/${filter}`, + method: "get", + params: {}, + }); +} diff --git a/src/lang/index.js b/src/lang/index.js index aa775e1..44d3999 100644 --- a/src/lang/index.js +++ b/src/lang/index.js @@ -20,13 +20,24 @@ const messages = { } } +const localeAliases = { + en: 'zh_CN', + zh: 'zh_CN', + 'en-US': 'en_US', + 'zh-CN': 'zh_CN' +} +const savedLocale = localStorage.getItem('language') +const locale = messages[savedLocale] + ? savedLocale + : localeAliases[savedLocale] || 'zh_CN' + const i18n = new VueI18n({ // 设置语言 选项 en | zh // locale: Cookies.get('language') || 'zh_CN', - locale: localStorage.getItem('language') || 'zh_CN', - fallbackLocale: localStorage.getItem('language') || 'zh_CN', // 使用localStorage作为fallbackLocale + locale, + fallbackLocale: 'zh_CN', // 设置文本内容 messages }) -export default i18n \ No newline at end of file +export default i18n diff --git a/src/layout/components/Sidebar/Item.vue b/src/layout/components/Sidebar/Item.vue index 15b7ded..07a72c5 100644 --- a/src/layout/components/Sidebar/Item.vue +++ b/src/layout/components/Sidebar/Item.vue @@ -8,6 +8,7 @@ const navIconMap = { '巡检任务管理': require('@/assets/images/nav/task.png'), '巡检任务': require('@/assets/images/nav/task.png'), '巡视任务': require('@/assets/images/nav/task.png'), + '巡视报告': require('@/assets/images/nav/task.png'), '设备管理': require('@/assets/images/nav/device.png'), '点位管理': require('@/assets/images/nav/point.png'), '点位管理(实施用)': require('@/assets/images/nav/point.png'), diff --git a/src/router/index.js b/src/router/index.js index 7ece22f..d59c72e 100644 --- a/src/router/index.js +++ b/src/router/index.js @@ -133,6 +133,27 @@ export const constantRoutes = [ } } ] + }, + { + path: '/patrol-report', + component: Layout, + redirect: '/patrol-report/index', + meta: { title: '巡视报告', icon: 'task' }, + children: [ + { + path: 'index', + component: () => import('@/views/cards/patrolReport/InspectionReporter'), + name: 'PatrolReport', + meta: { title: '巡视报告', icon: 'task', activeMenu: '/patrol-report' } + }, + { + path: 'detail', + component: () => import('@/views/cards/patrolReport/patrolReportDetail'), + name: 'patrolReportDetail', + hidden: true, + meta: { title: '巡视报告详情', activeMenu: '/patrol-report' } + } + ] } ] diff --git a/src/store/modules/app.js b/src/store/modules/app.js index ecda7c8..d80effa 100644 --- a/src/store/modules/app.js +++ b/src/store/modules/app.js @@ -1,5 +1,6 @@ import Cookies from 'js-cookie' import { getConfigKey, getConfigByKeys } from "@/api/system/config"; +const savedLanguage = Cookies.get('language') const state = { sidebar: { opened: Cookies.get('sidebarStatus') ? !!+Cookies.get('sidebarStatus') : true, @@ -8,7 +9,7 @@ const state = { }, device: 'desktop', size: Cookies.get('size') || 'medium', - language: Cookies.get('language') || 'en' + language: savedLanguage === 'en_US' ? 'en_US' : 'zh_CN' } const mutations = { diff --git a/src/views/cards/patrolReport/InspectionReporter.vue b/src/views/cards/patrolReport/InspectionReporter.vue new file mode 100644 index 0000000..d3752f1 --- /dev/null +++ b/src/views/cards/patrolReport/InspectionReporter.vue @@ -0,0 +1,486 @@ + + + + + diff --git a/src/views/cards/patrolReport/patrolReportDetail.vue b/src/views/cards/patrolReport/patrolReportDetail.vue new file mode 100644 index 0000000..d182831 --- /dev/null +++ b/src/views/cards/patrolReport/patrolReportDetail.vue @@ -0,0 +1,696 @@ + + + + + diff --git a/src/views/cards/taskSummary/inspectionTask.vue b/src/views/cards/taskSummary/inspectionTask.vue index 9bde97a..08ec7a6 100644 --- a/src/views/cards/taskSummary/inspectionTask.vue +++ b/src/views/cards/taskSummary/inspectionTask.vue @@ -468,7 +468,7 @@ import { reportExport, } from "@/api/inspectionDataManage/inspectionArchive"; export default { - name: "inspectionTask", + name: "InspectionTaskSummary", components: { CardPagination, CardBox, @@ -490,6 +490,8 @@ export default { dataList: [], // 选中的行数据 selectedRows: [], + // 页面重新创建时用于恢复勾选状态 + pendingSelectedIds: [], // table 高度 tableHeight: null, pickerOptions: { @@ -621,6 +623,7 @@ export default { } else { this.dateRange = [today, today]; } + this.pendingSelectedIds = state.selectedRows || []; // 清除sessionStorage,避免重复使用旧状态 sessionStorage.removeItem("inspectionTaskState"); } catch (e) { @@ -662,6 +665,19 @@ export default { this.getAreaList(); }, 1000); }, + activated() { + sessionStorage.removeItem("inspectionTaskState"); + if (!this.timer) { + this.timer = setInterval(this.getList, 10000); + } + this.$nextTick(this.setTableHeight); + }, + deactivated() { + if (this.timer) { + clearInterval(this.timer); + this.timer = null; + } + }, destroyed() { this.setTableHeight.cancel(); window.removeEventListener("resize", this.setTableHeight); @@ -687,7 +703,9 @@ export default { }, getList(showLoading = false) { // 保存当前选中的任务ID - const selectedIds = this.selectedRows.map((row) => row.taskPatrolledId); + const selectedIds = this.pendingSelectedIds.length + ? [...this.pendingSelectedIds] + : this.selectedRows.map((row) => row.taskPatrolledId); const params = { ...this.queryParams }; if (this.dateRange && this.dateRange.length > 1) { @@ -713,6 +731,7 @@ export default { } }); } + this.pendingSelectedIds = []; }); }) .catch(() => { @@ -857,12 +876,15 @@ export default { if (process.env.VUE_APP_DIALOG == "true") { this.$router.push( { - path: "/card/patrolReportDetail", + name: "patrolReportDetail", query: { lineId: row.lineId, filter: 0, + reportType: 0, + htmlType: "inspectionTask", + fromPage: "inspectionTask", + fromComponent: "InspectionTask", }, - query: { htmlType: "inspectionTask" }, // 确保这里传递了htmlType参数 } // `/card/patrolReportDetail?lineId=${row.lineId}&filter=${0}` ); @@ -885,9 +907,10 @@ export default { // 确保 lineId 不是 null 或 undefined const lineId = row.lineId; + const reportType = 0; sessionStorage.setItem("reportLineId", JSON.stringify(lineId)); - sessionStorage.setItem("reportType", 0); + sessionStorage.setItem("reportType", reportType); // 保存当前页面的状态,用于返回时恢复 const currentState = { @@ -903,24 +926,17 @@ export default { JSON.stringify(currentState) ); - // 开发 - if (process.env.VUE_APP_DIALOG == "true") { - this.$router.push({ - name: "patrolReportDetail", - query: { - lineId: lineId, - filter: 0, - fromPage: "inspectionTask", - fromComponent: "InspectionTask", - }, - }); - } else { - openDialog({ - sourceCardId: "shaoxing@videoMonitor-card-80", - targetCardId: "shaoxing@videoMonitor-card-38", - dialogTitle: "初筛报告详情", - }); - } + this.$router.push({ + name: "patrolReportDetail", + query: { + lineId, + filter: reportType, + reportType, + htmlType: "inspectionTask", + fromPage: "inspectionTask", + fromComponent: "InspectionTask", + }, + }); }, gotoTask(command, lineId, row) { this.$confirm("确认操作吗?", {