Browse Source

fix: 修改记录

sy-water-data-board-ui
panyuyi 1 month ago
parent
commit
546289b6ef
  1. 193
      src/views/dike/runManage/patrolMaintenance/componentsDetails/inspectionRecordDetails.vue
  2. 4
      src/views/dike/runManage/patrolMaintenance/overviewAnalysis/index.vue
  3. 2
      src/views/dike/runManage/patrolMaintenance/patrolItemsManage/index.vue
  4. 187
      src/views/dike/runManage/patrolMaintenance/statisticsAnalysis/index.vue
  5. 4
      vue.config.js

193
src/views/dike/runManage/patrolMaintenance/componentsDetails/inspectionRecordDetails.vue

@ -4,7 +4,13 @@
<div class="table-box"> <div class="table-box">
<div class="form-row-title">巡查路线</div> <div class="form-row-title">巡查路线</div>
<div class="patrol-box"> <div class="patrol-box">
<el-form ref="form" :model="form" :rules="rules" label-width="120px" label-position="right"> <el-form
ref="form"
:model="form"
:rules="rules"
label-width="120px"
label-position="right"
>
<el-form-item label="巡查人:" prop="createName"> <el-form-item label="巡查人:" prop="createName">
{{ form.createName }} {{ form.createName }}
</el-form-item> </el-form-item>
@ -40,7 +46,8 @@
maxlength="200" maxlength="200"
show-word-limit show-word-limit
resize="none" resize="none"
v-model="form.scope"> v-model="form.scope"
>
</el-input> </el-input>
</el-form-item> </el-form-item>
</el-form> </el-form>
@ -58,14 +65,17 @@
<el-table <el-table
:height="tableHeight" :height="tableHeight"
:data="tableData" :data="tableData"
style="margin-bottom: 16px;" style="margin-bottom: 16px"
border border
> >
<el-table-column prop="name" align="center" label="巡查部位" /> <el-table-column prop="name" align="center" label="巡查部位" />
<el-table-column prop="content" align="center" label="检查内容" /> <el-table-column prop="content" align="center" label="检查内容" />
</el-table> </el-table>
<div class="form-row-title">缺陷问题列表</div> <div class="form-row-title">缺陷问题列表</div>
<div class="flex-1 flex justify-end search-item" style="margin-bottom: 16px;"> <div
class="flex-1 flex justify-end search-item"
style="margin-bottom: 16px"
>
<el-button <el-button
size="small" size="small"
:disabled="$route.query.mode === 'check'" :disabled="$route.query.mode === 'check'"
@ -90,22 +100,23 @@
border border
> >
<el-table-column type="selection" width="55"></el-table-column> <el-table-column type="selection" width="55"></el-table-column>
<el-table-column prop="parts" label="巡查部位"> <el-table-column prop="itemId" label="巡查部位">
<template slot-scope="scope"> <template slot-scope="scope">
<el-select <el-select
clearable clearable
size="small" size="small"
class="w-202 ml-10" class="w-202 ml-10"
:disabled="$route.query.mode === 'check'" :disabled="$route.query.mode === 'check'"
v-model="scope.row.parts" v-model="scope.row.itemId"
filterable filterable
@change="handleChangeSelectParts(scope.row)"
placeholder="请选择" placeholder="请选择"
> >
<el-option <el-option
v-for="item in tableData" v-for="item in tableData"
:key="item.id" :key="item.id"
:label="item.name" :label="item.name"
:value="item.parts" :value="item.id"
> >
</el-option> </el-option>
</el-select> </el-select>
@ -153,16 +164,18 @@
<el-table-column align="center" label="缺陷照片"> <el-table-column align="center" label="缺陷照片">
<template slot-scope="scope"> <template slot-scope="scope">
<div class="imgBox"> <div class="imgBox">
<div <div class="imgList" v-for="item in scope.row.problemImages">
class="imgList"
v-for="item in scope.row.problemImages"
>
<el-image <el-image
style="width: 40px; height: 40px;" style="width: 40px; height: 40px"
:src="item" :src="item"
:preview-src-list="scope.row.problemImages"> :preview-src-list="scope.row.problemImages"
>
</el-image> </el-image>
<div class="delImg" v-if="$route.query.mode !== 'check'" @click="delImage(item, scope.row.problemImages)"> <div
class="delImg"
v-if="$route.query.mode !== 'check'"
@click="delImage(item, scope.row.problemImages)"
>
× ×
</div> </div>
</div> </div>
@ -184,16 +197,30 @@
width="168" width="168"
> >
<template slot-scope="scope"> <template slot-scope="scope">
<div style="display:flex;"> <div style="display: flex">
<el-upload <el-upload
class="" class=""
action="#" action="#"
:http-request="(e) => {handleUploadProject(e, scope.row)}" :http-request="
:before-upload="(e) => {beforeUploadProject(e, scope.row)}" (e) => {
handleUploadProject(e, scope.row);
}
"
:before-upload="
(e) => {
beforeUploadProject(e, scope.row);
}
"
:show-file-list="false" :show-file-list="false"
accept=".png,.jpg,.jpeg" accept=".png,.jpg,.jpeg"
> >
<el-button :disabled="$route.query.mode === 'check'" size="small" style="margin-right: 10px;" type="text">上传图片</el-button> <el-button
:disabled="$route.query.mode === 'check'"
size="small"
style="margin-right: 10px"
type="text"
>上传图片</el-button
>
</el-upload> </el-upload>
<el-popconfirm <el-popconfirm
confirm-button-text="确定" confirm-button-text="确定"
@ -219,12 +246,8 @@
</el-table> </el-table>
</div> </div>
<div class="bottom-btns" v-if="$route.query.mode !== 'check'"> <div class="bottom-btns" v-if="$route.query.mode !== 'check'">
<el-button type="primary" @click="handleSave(true)" <el-button type="primary" @click="handleSave(true)">保存并提交</el-button>
>保存并提交</el-button <el-button type="primary" @click="handleSave(false)">保存</el-button>
>
<el-button type="primary" @click="handleSave(false)"
>保存</el-button
>
<el-button @click="$router.go(-1)">返回</el-button> <el-button @click="$router.go(-1)">返回</el-button>
</div> </div>
</div> </div>
@ -236,7 +259,7 @@ import SyMixMap from "@/views/components/SyMixMap.vue";
import { import {
getRecordDetails, getRecordDetails,
getRecordTraceList, getRecordTraceList,
getV2PatrolChecking getV2PatrolChecking,
} from "@/api/dike"; } from "@/api/dike";
import { gettV2Record, postV2Record } from "@/api/dike/patrolMaintenance"; import { gettV2Record, postV2Record } from "@/api/dike/patrolMaintenance";
import { uploadFileData } from "@/api/system/upload"; import { uploadFileData } from "@/api/system/upload";
@ -259,16 +282,16 @@ export default {
problemsData: [], problemsData: [],
tableData: [], tableData: [],
form: { form: {
createName: '', createName: "",
name: '', name: "",
dikeName: '', dikeName: "",
category: '', category: "",
createUid: '', createUid: "",
dikeCode: '', dikeCode: "",
dikeType: '', dikeType: "",
type: '', type: "",
time: [], time: [],
scope: '', scope: "",
}, },
rules: { rules: {
createName: [{ required: true }], createName: [{ required: true }],
@ -277,7 +300,7 @@ export default {
category: [{ required: true }], category: [{ required: true }],
time: [{ required: true }], time: [{ required: true }],
scope: [{ required: true }], scope: [{ required: true }],
} },
}; };
}, },
created() { created() {
@ -292,45 +315,45 @@ export default {
}); });
}, },
mounted() { mounted() {
this.initData() this.initData();
}, },
methods: { methods: {
async initData() { async initData() {
this.getDetail() this.getDetail();
this.getMapData() this.getMapData();
}, },
async getDetail() { async getDetail() {
if (this.$route.query.id) { if (this.$route.query.id) {
const details = await gettV2Record(this.$route.query.id); const details = await gettV2Record(this.$route.query.id);
this.form.time[0] = details.data.startDate this.form.time[0] = details.data.startDate;
this.form.time[1] = details.data.endDate this.form.time[1] = details.data.endDate;
this.form.scope = details.data.scope this.form.scope = details.data.scope;
this.problemsData = details.data.problems this.problemsData = details.data.problems;
this.form.time = [...this.form.time] this.form.time = [...this.form.time];
} }
const checking = await getV2PatrolChecking(this.$route.query.checkingId); const checking = await getV2PatrolChecking(this.$route.query.checkingId);
this.form.createName = checking.data.createName this.form.createName = checking.data.createName;
this.form.name = checking.data.name this.form.name = checking.data.name;
this.form.dikeName = checking.data.dikeName this.form.dikeName = checking.data.dikeName;
this.form.category = checking.data.category this.form.category = checking.data.category;
this.form.createUid = checking.data.createUid this.form.createUid = checking.data.createUid;
this.form.dikeCode = checking.data.dikeCode this.form.dikeCode = checking.data.dikeCode;
this.form.dikeType = checking.data.dikeType this.form.dikeType = checking.data.dikeType;
this.form.type = checking.data.type this.form.type = checking.data.type;
const items = checking.data.items const items = checking.data.items;
getDictMapData("df_xs_c_classfy").then((res) => { getDictMapData("df_xs_c_classfy").then((res) => {
items.forEach(item => { items.forEach((item) => {
let parts = '' let parts = "";
item.parts.forEach((part) => { item.parts.forEach((part) => {
if (parts) { if (parts) {
parts = parts + ':' + part parts = parts + ":" + part;
} else { } else {
parts = part parts = part;
} }
}) });
item.name = res.data[parts] item.name = res.data[parts];
}) });
this.tableData = items this.tableData = items;
}); });
}, },
async getMapData() { async getMapData() {
@ -356,6 +379,10 @@ export default {
?.reverse() || []; ?.reverse() || [];
}); });
}, },
handleChangeSelectParts(row) {
row.parts = this.tableData.find((v) => v.id === row.itemId)?.parts;
},
// //
handleUploadProject(e, row) { handleUploadProject(e, row) {
const { file } = e; const { file } = e;
@ -386,19 +413,19 @@ export default {
return true; return true;
}, },
delImage(img, problemImages) { delImage(img, problemImages) {
const index = problemImages.indexOf(img) const index = problemImages.indexOf(img);
problemImages.splice(index, 1) problemImages.splice(index, 1);
problemImages problemImages;
}, },
addProblems() { addProblems() {
this.problemsData.push({ this.problemsData.push({
problemLevel: '1', problemLevel: "1",
partsId: this.tableData[0].parts, partsId: this.tableData[0].parts,
poistion: '', poistion: "",
content: '', content: "",
problemImages: [], problemImages: [],
status: '4', status: "4",
}) });
}, },
getDictLabelName(type, dictListName) { getDictLabelName(type, dictListName) {
if (!this[dictListName]) return ""; if (!this[dictListName]) return "";
@ -418,17 +445,17 @@ export default {
}) })
.then(() => { .then(() => {
this.problemsCheckData.forEach((Check) => { this.problemsCheckData.forEach((Check) => {
const index = this.problemsData.indexOf(Check) const index = this.problemsData.indexOf(Check);
this.problemsData.splice(index, 1) this.problemsData.splice(index, 1);
}) });
}) })
.catch(() => { .catch(() => {
console.log("取消删除"); console.log("取消删除");
}); });
}, },
deleteTableItem(row) { deleteTableItem(row) {
const index = this.problemsData.indexOf(row) const index = this.problemsData.indexOf(row);
this.problemsData.splice(index, 1) this.problemsData.splice(index, 1);
}, },
handleSave(commit) { handleSave(commit) {
const data = { const data = {
@ -442,19 +469,21 @@ export default {
dikeType: this.form.dikeType, dikeType: this.form.dikeType,
scope: this.form.scope, scope: this.form.scope,
problems: this.problemsData, problems: this.problemsData,
startDate: this.form.time && this.form.time.length > 1 ? this.form.time[0] : '', startDate:
endDate: this.form.time && this.form.time.length > 1 ? this.form.time[1] : '', this.form.time && this.form.time.length > 1 ? this.form.time[0] : "",
endDate:
this.form.time && this.form.time.length > 1 ? this.form.time[1] : "",
type: this.form.type, type: this.form.type,
} };
if (this.$route.query.id) { if (this.$route.query.id) {
data.id = this.$route.query.id data.id = this.$route.query.id;
} }
console.log(data); console.log(data);
postV2Record(data,commit).then(res => { postV2Record(data, commit).then((res) => {
this.$message.success('保存成功') this.$message.success("保存成功");
this.$router.go(-1) this.$router.go(-1);
}) });
} },
}, },
}; };
</script> </script>

4
src/views/dike/runManage/patrolMaintenance/overviewAnalysis/index.vue

@ -7,6 +7,7 @@
<span class="ml-10">巡查周期</span> <span class="ml-10">巡查周期</span>
<el-date-picker <el-date-picker
v-model="paramsData.timeRange" v-model="paramsData.timeRange"
size="small"
type="daterange" type="daterange"
range-separator="至" range-separator="至"
start-placeholder="开始日期" start-placeholder="开始日期"
@ -24,11 +25,12 @@
</el-cascader> </el-cascader>
<el-button <el-button
class="search-btn !ml-16" class="search-btn !ml-16"
size="small"
type="success" type="success"
@click="handleSearch()" @click="handleSearch()"
>查询</el-button >查询</el-button
> >
<el-button @click="resetSearch()">重置</el-button> <el-button @click="resetSearch()" size="small">重置</el-button>
</div> </div>
<div class="content-box"> <div class="content-box">

2
src/views/dike/runManage/patrolMaintenance/patrolItemsManage/index.vue

@ -222,7 +222,7 @@ export default {
align="center" align="center"
label="操作" label="操作"
fixed="right" fixed="right"
width="100" width="200"
> >
<template slot-scope="scope"> <template slot-scope="scope">
<el-button <el-button

187
src/views/dike/runManage/patrolMaintenance/statisticsAnalysis/index.vue

@ -7,6 +7,7 @@
<span class="ml-10">巡查周期</span> <span class="ml-10">巡查周期</span>
<el-date-picker <el-date-picker
v-model="paramsData.timeRange" v-model="paramsData.timeRange"
size="small"
type="daterange" type="daterange"
range-separator="至" range-separator="至"
start-placeholder="开始日期" start-placeholder="开始日期"
@ -36,10 +37,11 @@
<el-button <el-button
class="search-btn !ml-16" class="search-btn !ml-16"
type="success" type="success"
size="small"
@click="handleSearch()" @click="handleSearch()"
>查询</el-button >查询</el-button
> >
<el-button @click="resetSearch()">重置</el-button> <el-button @click="resetSearch()" size="small">重置</el-button>
</div> </div>
<div class="content-box"> <div class="content-box">
@ -267,7 +269,7 @@ export default {
// //
getTableData() { getTableData() {
// //
this.requestFunc({ group: "C_1" }).then((res) => { this.requestFunc({ group: "C_14" }).then((res) => {
if (res.data) { if (res.data) {
// //
if (res.data?.yaxis?.length) { if (res.data?.yaxis?.length) {
@ -291,9 +293,6 @@ export default {
data: res.data || {}, data: res.data || {},
type: "bar", type: "bar",
seriesOptions: { seriesOptions: {
itemStyle: {
color: "#36B29E",
},
stack: "one", stack: "one",
barWidth: 20, barWidth: 20,
}, },
@ -308,6 +307,44 @@ export default {
); );
this.patrolRecordRefPieInstance.setOption( this.patrolRecordRefPieInstance.setOption(
initCommonPieRingOptions({ initCommonPieRingOptions({
colors: [
{
type: "linear",
x: 0,
y: 0,
x2: 0,
y2: 1,
colorStops: [
{
offset: 0,
color: "rgba(54, 163, 217, 0.1)", // 0%
},
{
offset: 1,
color: "rgba(54, 163, 217, 1)", // 100%
},
],
global: false, // false
},
{
type: "linear",
x: 0,
y: 0,
x2: 0,
y2: 1,
colorStops: [
{
offset: 0,
color: "rgba(54, 178, 158, 1)", // 0%
},
{
offset: 1,
color: "rgba(54, 178, 158, 0.1)", // 100%
},
],
global: false, // false
},
],
data: res.data || {}, data: res.data || {},
seriesOptions: {}, seriesOptions: {},
}) })
@ -316,12 +353,15 @@ export default {
} }
}); });
// //
this.requestFunc({ group: "C_2" }).then((res) => { this.requestFunc({ group: "C_15" }).then((res) => {
if (res.data) { if (res.data) {
if (res.data?.yaxis?.length) { if (res.data?.yaxis?.length) {
let newArr = res.data.yaxis.flatMap((v) => v.series); let newArr = res.data.yaxis.flatMap((v) => v.series);
this.projectSum = Number( this.flawSum = Number(
newArr.find((v) => v.code === "DF_PROJECT_ADCD_SUM")?.sum ?? null newArr.find((v) => v.code === "DF_QX_SUM")?.sum ?? null
);
this.yhSum = Number(
newArr.find((v) => v.code === "DF_YH_SUM")?.sum ?? null
); );
} }
this.$nextTick(() => { this.$nextTick(() => {
@ -351,7 +391,44 @@ export default {
); );
this.patrolFlawRefPieInstance.setOption( this.patrolFlawRefPieInstance.setOption(
initCommonPieRingOptions({ initCommonPieRingOptions({
colors: ["#29CCCC", "#0099DF"], colors: [
{
type: "linear",
x: 0,
y: 0,
x2: 0,
y2: 1,
colorStops: [
{
offset: 0,
color: "rgba(54, 163, 217, 0.1)", // 0%
},
{
offset: 1,
color: "rgba(54, 163, 217, 1)", // 100%
},
],
global: false, // false
},
{
type: "linear",
x: 0,
y: 0,
x2: 0,
y2: 1,
colorStops: [
{
offset: 0,
color: "rgba(54, 178, 158, 1)", // 0%
},
{
offset: 1,
color: "rgba(54, 178, 158, 0.1)", // 100%
},
],
global: false, // false
},
],
data: res.data || {}, data: res.data || {},
seriesOptions: {}, seriesOptions: {},
}) })
@ -360,7 +437,7 @@ export default {
} }
}); });
// //
this.requestFunc({ group: "C_3" }).then((res) => { this.requestFunc({ group: "C_16" }).then((res) => {
if (res.data) { if (res.data) {
this.$nextTick(() => { this.$nextTick(() => {
// //
@ -390,7 +467,80 @@ export default {
this.flawProblemRefPieInstance.setOption( this.flawProblemRefPieInstance.setOption(
initCommonPieRingOptions({ initCommonPieRingOptions({
data: res.data || {}, data: res.data || {},
colors: ["#0099DF", "#36B29E", "#F29130", "#F45555"], colors: [
{
type: "linear",
x: 0,
y: 0,
x2: 0,
y2: 1,
colorStops: [
{
offset: 0,
color: "rgba(54, 163, 217, 0.1)", // 0%
},
{
offset: 1,
color: "rgba(54, 163, 217, 1)", // 100%
},
],
global: false, // false
},
{
type: "linear",
x: 0,
y: 0,
x2: 0,
y2: 1,
colorStops: [
{
offset: 0,
color: "rgba(54, 178, 158, 0.1)", // 0%
},
{
offset: 1,
color: "rgba(54, 178, 158, 1)", // 100%
},
],
global: false, // false
},
{
type: "linear",
x: 0,
y: 0,
x2: 0,
y2: 1,
colorStops: [
{
offset: 0,
color: "rgba(242, 145, 48, 0.1)", // 0%
},
{
offset: 1,
color: "rgba(242, 145, 48, 1)", // 100%
},
],
global: false, // false
},
{
type: "linear",
x: 0,
y: 0,
x2: 0,
y2: 1,
colorStops: [
{
offset: 0,
color: "rgba(244, 85, 85, 0.1)", // 0%
},
{
offset: 1,
color: "rgba(244, 85, 85, 1)", // 100%
},
],
global: false, // false
},
],
seriesOptions: {}, seriesOptions: {},
}) })
); );
@ -398,7 +548,7 @@ export default {
} }
}); });
// //
this.requestFunc({ group: "C_3" }).then((res) => { this.requestFunc({ group: "C_17" }).then((res) => {
if (res.data) { if (res.data) {
this.$nextTick(() => { this.$nextTick(() => {
// //
@ -435,6 +585,19 @@ export default {
}); });
} }
}); });
//
this.requestFunc({ group: "C_18" }).then((res) => {
if (res.data) {
if (res.data?.yaxis?.length) {
let newArr = res.data.yaxis.flatMap((v) => v.series);
this.projectSum = newArr
.map((v) => Number(v.sum ?? null))
.reduce((acc, cur) => {
return acc + cur;
}, 0);
}
}
});
}, },
handleSearch() { handleSearch() {
this.getTableData(); this.getTableData();

4
vue.config.js

@ -80,8 +80,8 @@ module.exports = {
changeOrigin: true, changeOrigin: true,
}, },
[process.env.VUE_APP_BASE_API]: { [process.env.VUE_APP_BASE_API]: {
target: "http://shuili.product.dev.com:30115/", // target: "http://shuili.product.dev.com:30115/",
// target: 'http://172.16.34.80:18082/', target: "http://172.16.34.80:18082/",
// target: 'http://172.16.32.62:18888/', // target: 'http://172.16.32.62:18888/',
// target: "http://172.16.34.27:18082", // target: "http://172.16.34.27:18082",
changeOrigin: true, changeOrigin: true,

Loading…
Cancel
Save