From 43c36aef027d34daed77660bd06508e6f1faa263 Mon Sep 17 00:00:00 2001 From: SunTao <328867980@qq.com> Date: Wed, 15 Jan 2025 17:01:25 +0800 Subject: [PATCH] =?UTF-8?q?fix=EF=BC=9A=E6=96=B0=E5=A2=9E=E7=97=85?= =?UTF-8?q?=E5=AE=B3=E5=92=8C=E8=B7=AF=E4=BA=A7=E5=AF=BC=E5=87=BA?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/api/xj/disease.js | 19 +++++--- src/api/xj/road.js | 22 ++++++--- .../components/edit-dialog.vue | 8 ++-- .../inspection-warn/warning-setup/index.vue | 6 ++- .../inspection/disease-management/index.vue | 44 +++++++++++------ .../xj/inspection/road-management/index.vue | 48 ++++++++++++++++++- 6 files changed, 112 insertions(+), 35 deletions(-) diff --git a/src/api/xj/disease.js b/src/api/xj/disease.js index ab97e45..63182fe 100644 --- a/src/api/xj/disease.js +++ b/src/api/xj/disease.js @@ -2,7 +2,7 @@ * @Author: error: error: git config user.name & please set dead value or install git && error: git config user.email & please set dead value or install git & please set dead value or install git * @Date: 2024-10-08 09:26:24 * @LastEditors: SunTao 328867980@qq.com - * @LastEditTime: 2024-11-05 13:54:44 + * @LastEditTime: 2025-01-15 16:27:57 * @FilePath: \znxjxt-ui\src\api\xj\disease.js * @Description: 巡检信息-病害管理 */ @@ -48,7 +48,7 @@ export function delDefect(data) { return request({ url: "/xj/defect/", method: "delete", - data + data, }); } @@ -113,7 +113,6 @@ export function mergeDefect(data) { }); } - // 拆分病害接口 export function splitDefect(data) { return request({ @@ -123,7 +122,6 @@ export function splitDefect(data) { }); } - // 根据病害id查询快照id下拉 export function getDefectById(id) { return request({ @@ -133,7 +131,6 @@ export function getDefectById(id) { }); } - // 根据快照id查询查询具体数据 export function getDetailsBySnapShotId(snapShotId) { return request({ @@ -150,4 +147,14 @@ export function getTaskList(params) { method: "get", params, }); -} \ No newline at end of file +} + +// 病害导出功能 +export function exportDefectData(data) { + return request({ + url: "/xj/defect/export", + responseType: "blob", + method: "post", + data, + }); +} diff --git a/src/api/xj/road.js b/src/api/xj/road.js index 61409b2..c84b470 100644 --- a/src/api/xj/road.js +++ b/src/api/xj/road.js @@ -62,12 +62,12 @@ export function deleteRoad(data) { // 批量修改路产接口 export function changeRoad(data) { - return request({ - url: "/xj/equipment/batch", - method: "put", - data, - }); - } + return request({ + url: "/xj/equipment/batch", + method: "put", + data, + }); +} // 路产详情接口 export function detailRoad(id) { @@ -85,3 +85,13 @@ export function getTaskList(params) { params, }); } + +// 病害导出功能 +export function exportRoadData(data) { + return request({ + url: "/xj/equipment/export", + responseType: "blob", + method: "post", + data, + }); +} diff --git a/src/views/xj/document/maintenance-notice/components/edit-dialog.vue b/src/views/xj/document/maintenance-notice/components/edit-dialog.vue index ffcffb1..1d045e1 100644 --- a/src/views/xj/document/maintenance-notice/components/edit-dialog.vue +++ b/src/views/xj/document/maintenance-notice/components/edit-dialog.vue @@ -2,7 +2,7 @@ * @Author: SunTao 328867980@qq.com * @Date: 2024-11-20 11:58:33 * @LastEditors: SunTao 328867980@qq.com - * @LastEditTime: 2025-01-15 11:48:48 + * @LastEditTime: 2025-01-15 16:18:16 * @FilePath: \znxjxt-ui\src\views\xj\document\maintenance-notice\components\edit-dialog.vue * @Description: 养护通知单编辑弹窗 --> @@ -92,9 +92,9 @@
选择病害 - + 查看已选数据
@@ -96,7 +96,7 @@ icon="el-icon-plus" size="mini" @click="handleAdd" - v-hasPermi="['system:defect:add']" + v-hasPermi="['xj:inspection-warn:warning-setup:add']" >新增 @@ -155,6 +155,7 @@ type="text" icon="el-icon-edit" @click="handleUpdate(scope.row)" + v-hasPermi="['xj:inspection-warn:warning-setup:add']" >编辑 删除 diff --git a/src/views/xj/inspection/disease-management/index.vue b/src/views/xj/inspection/disease-management/index.vue index 1e47d14..60c0be0 100644 --- a/src/views/xj/inspection/disease-management/index.vue +++ b/src/views/xj/inspection/disease-management/index.vue @@ -2,7 +2,7 @@ * @Author: error: error: git config user.name & please set dead value or install git && error: git config user.email & please set dead value or install git & please set dead value or install git * @Date: 2024-10-08 10:58:25 * @LastEditors: SunTao 328867980@qq.com - * @LastEditTime: 2025-01-14 11:50:15 + * @LastEditTime: 2025-01-15 15:42:04 * @FilePath: \znxjxt-ui\src\views\xj\inspection\disease-management\index.vue * @Description: 巡检信息管理-病害管理 --> @@ -17,9 +17,9 @@ v-show="showSearch" label-width="100px" > - + 新增 @@ -205,6 +206,7 @@ size="mini" :disabled="multiple" @click="handleDelete('')" + v-hasPermi="['xj:defect:remove']" >删除 @@ -296,6 +298,7 @@ type="text" icon="el-icon-edit" @click="handleUpdate(scope.row)" + v-hasPermi="['xj:defect:edit']" >修改 删除 合并 拆分 @@ -328,8 +334,8 @@ @@ -664,7 +670,9 @@ import { getDefectById, getDetailsBySnapShotId, getTaskList, + exportDefectData, } from "@/api/xj/disease"; +import { Loading } from "element-ui"; import { getToken } from "@/utils/auth"; import MergeDialog from "./components/merge-dialog.vue"; // 地图 @@ -706,9 +714,7 @@ export default { dialogVisible: false, // 查询表单参数 queryParams: { - page: 1, - size: 10, - segmentName: "", + segmentId: "", defectType: "", classType: "", taskId: "", @@ -726,6 +732,11 @@ export default { snapshotId: "", taskId: "", }, + // 分页-页数页码 + pagination: { + page: 1, + size: 10, + }, // 日期范围 dateTime: [], // 巡检任务下拉数据 @@ -935,6 +946,7 @@ export default { this.loading = true; const params = { ...this.queryParams, + ...this.pagination, startTime: this.dateTime ? this.dateTime[0] : "", endTime: this.dateTime ? this.dateTime[1] : "", }; @@ -991,9 +1003,7 @@ export default { resetQuery() { this.resetForm("queryForm"); this.queryParams = { - page: 1, - size: 10, - segmentName: "", + segmentId: "", defectType: "", classType: "", taskId: "", @@ -1011,6 +1021,7 @@ export default { snapshotId: "", taskId: "", }; + this.pagination.page = 1; this.paramsDefectType = []; this.dateTime = []; this.getList(); @@ -1033,7 +1044,7 @@ export default { ? this.paramsDefectType[1] : "" : ""; - this.queryParams.page = 1; + this.pagination.page = 1; this.getList(); } else { this.$modal.msgWarning("请按照格式填写公里桩进行修改"); @@ -1048,7 +1059,7 @@ export default { ? this.paramsDefectType[1] : "" : ""; - this.queryParams.page = 1; + this.pagination.page = 1; this.getList(); } else { this.$modal.msgWarning("请按照格式填写公里桩进行修改"); @@ -1062,7 +1073,7 @@ export default { ? this.paramsDefectType[1] : "" : ""; - this.queryParams.page = 1; + this.pagination.page = 1; this.getList(); } }, @@ -1315,6 +1326,8 @@ export default { * @return {*} */ handleExport() { + Loading.service({ fullscreen: true }); + let loadingInstance = Loading.service({ fullscreen: true }); const params = { ...this.queryParams, startTime: this.dateTime ? this.dateTime[0] : "", @@ -1331,12 +1344,13 @@ export default { link.style.display = "none"; link.href = URL.createObjectURL(blob); // TODO 源文件名问题 - link.download = item.extId; + link.download = "病害导出文档"; document.body.appendChild(link); link.click(); document.body.removeChild(link); }) .finally(() => { + loadingInstance.close(); this.getList(); }); }, diff --git a/src/views/xj/inspection/road-management/index.vue b/src/views/xj/inspection/road-management/index.vue index 93a89a2..1ba3f6f 100644 --- a/src/views/xj/inspection/road-management/index.vue +++ b/src/views/xj/inspection/road-management/index.vue @@ -2,7 +2,7 @@ * @Author: SunTao 328867980@qq.com * @Date: 2024-10-11 15:14:16 * @LastEditors: SunTao 328867980@qq.com - * @LastEditTime: 2025-01-15 15:08:22 + * @LastEditTime: 2025-01-15 16:52:53 * @FilePath: \znxjxt-ui\src\views\xj\inspection\road-management\index.vue * @Description: 巡检信息-路产管理 --> @@ -162,6 +162,7 @@ icon="el-icon-plus" size="mini" @click="handleAdd" + v-hasPermi="['xj_equipment_edit']" >新增 @@ -173,9 +174,20 @@ size="mini" :disabled="multiple" @click="handleDelete(null)" + v-hasPermi="['xj_equipment_edit']" >删除 + + 导出 + + 修改 删除 @@ -363,7 +377,9 @@ import { deleteRoad, changeRoad, getTaskList, + exportRoadData, } from "@/api/xj/road"; +import { Loading } from "element-ui"; import RoadAdd from "./components/road-add.vue"; import RoadView from "./components/road-view.vue"; @@ -645,7 +661,35 @@ export default { * @param {*} * @return {*} */ - handleExport() {}, + handleExport() { + Loading.service({ fullscreen: true }); + let loadingInstance = Loading.service({ fullscreen: true }); + const params = { + ...this.searchForm, + startTime: this.dateTime ? this.dateTime[0] : "", + endTime: this.dateTime ? this.dateTime[1] : "", + }; + exportRoadData(params) + .then((res) => { + const link = document.createElement("a"); + const blob = new Blob([res], { + // type: "application/vnd.openxmlformats-officedocument.wordprocessingml.document", + // type: "application/zip", + type: "application/vnd.ms-excel", + }); + link.style.display = "none"; + link.href = URL.createObjectURL(blob); + // TODO 源文件名问题 + link.download = "路产导出文档"; + document.body.appendChild(link); + link.click(); + document.body.removeChild(link); + }) + .finally(() => { + loadingInstance.close(); + this.getRoadList(); + }); + }, /** * @description: 批量确认事件