fix:新增病害和路产导出

This commit is contained in:
SunTao 2025-01-15 17:01:25 +08:00
parent c661674306
commit 43c36aef02
6 changed files with 112 additions and 35 deletions

View File

@ -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,
});
}
}
// 病害导出功能
export function exportDefectData(data) {
return request({
url: "/xj/defect/export",
responseType: "blob",
method: "post",
data,
});
}

View File

@ -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,
});
}

View File

@ -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 @@
<el-card shadow="never">
<div slot="header" class="clearfix">
<span>选择病害</span>
<!-- <el-button style="float: right; padding: 3px 0" type="text"
>操作按钮</el-button
> -->
<el-button style="float: right; padding: 3px 0" type="text"
>查看已选数据</el-button
>
</div>
<!-- 列表查询条件 -->
<el-form

View File

@ -2,7 +2,7 @@
* @Author: SunTao 328867980@qq.com
* @Date: 2024-01-08 11:56:02
* @LastEditors: SunTao 328867980@qq.com
* @LastEditTime: 2025-01-15 15:06:33
* @LastEditTime: 2025-01-15 15:28:26
* @FilePath: \znxjxt-ui\src\views\xj\inspection-warn\warning-setup\index.vue
* @Description: 预警中心-预警设置
-->
@ -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']"
>新增
</el-button>
</el-col>
@ -155,6 +155,7 @@
type="text"
icon="el-icon-edit"
@click="handleUpdate(scope.row)"
v-hasPermi="['xj:inspection-warn:warning-setup:add']"
>编辑
</el-button>
<el-button
@ -162,6 +163,7 @@
type="text"
icon="el-icon-delete"
@click="handleDelete(scope.row)"
v-hasPermi="['xj:inspection-warn:warning-setup:add']"
>删除
</el-button>
</template>

View File

@ -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"
>
<el-form-item label="道路名称" prop="segmentName">
<el-form-item label="道路名称" prop="segmentId">
<el-select
v-model="queryParams.segmentName"
v-model="queryParams.segmentId"
placeholder="请选择路段"
filterable
clearable
@ -194,6 +194,7 @@
icon="el-icon-plus"
size="mini"
@click="handleAdd"
v-hasPermi="['xj:defect:add']"
>新增
</el-button>
</el-col>
@ -205,6 +206,7 @@
size="mini"
:disabled="multiple"
@click="handleDelete('')"
v-hasPermi="['xj:defect:remove']"
>删除
</el-button>
</el-col>
@ -296,6 +298,7 @@
type="text"
icon="el-icon-edit"
@click="handleUpdate(scope.row)"
v-hasPermi="['xj:defect:edit']"
>修改
</el-button>
<el-button
@ -303,6 +306,7 @@
type="text"
icon="el-icon-delete"
@click="handleDelete(scope.row)"
v-hasPermi="['xj:defect:remove']"
>删除
</el-button>
<el-button
@ -310,6 +314,7 @@
type="text"
icon="el-icon-bangzhu"
@click="mergeDefect(scope.row)"
v-hasPermi="['xj:defect:edit']"
>合并
</el-button>
<el-button
@ -318,6 +323,7 @@
icon="el-icon-copy-document"
v-if="scope.row.id !== scope.row.snapshotId"
@click="splitDefect(scope.row)"
v-hasPermi="['xj:defect:edit']"
>拆分
</el-button>
</template>
@ -328,8 +334,8 @@
<pagination
v-show="total > 0"
:total="total"
:page.sync="queryParams.page"
:limit.sync="queryParams.size"
:page.sync="pagination.page"
:limit.sync="pagination.size"
@pagination="getList"
/>
@ -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();
});
},

View File

@ -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']"
>新增
</el-button>
</el-col>
@ -173,9 +174,20 @@
size="mini"
:disabled="multiple"
@click="handleDelete(null)"
v-hasPermi="['xj_equipment_edit']"
>删除
</el-button>
</el-col>
<el-col :span="1.5">
<el-button
type="success"
plain
icon="el-icon-top-right"
size="mini"
@click="handleExport"
>导出
</el-button>
</el-col>
</el-row>
<!-- 列表 -->
<el-table
@ -256,6 +268,7 @@
type="text"
icon="el-icon-edit"
@click="handleUpdate(scope.row)"
v-hasPermi="['xj_equipment_edit']"
>修改
</el-button>
<el-button
@ -263,6 +276,7 @@
type="text"
icon="el-icon-delete"
@click="handleDelete(scope.row)"
v-hasPermi="['xj_equipment_edit']"
>删除
</el-button>
</template>
@ -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: 批量确认事件