Browse Source

fix: 修改记录

sy-water-data-board-ui
panyuyi 1 month ago
parent
commit
546289b6ef
  1. 223
      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

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

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

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

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

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

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

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

@ -7,6 +7,7 @@
<span class="ml-10">巡查周期</span>
<el-date-picker
v-model="paramsData.timeRange"
size="small"
type="daterange"
range-separator="至"
start-placeholder="开始日期"
@ -36,10 +37,11 @@
<el-button
class="search-btn !ml-16"
type="success"
size="small"
@click="handleSearch()"
>查询</el-button
>
<el-button @click="resetSearch()">重置</el-button>
<el-button @click="resetSearch()" size="small">重置</el-button>
</div>
<div class="content-box">
@ -267,7 +269,7 @@ export default {
//
getTableData() {
//
this.requestFunc({ group: "C_1" }).then((res) => {
this.requestFunc({ group: "C_14" }).then((res) => {
if (res.data) {
//
if (res.data?.yaxis?.length) {
@ -291,9 +293,6 @@ export default {
data: res.data || {},
type: "bar",
seriesOptions: {
itemStyle: {
color: "#36B29E",
},
stack: "one",
barWidth: 20,
},
@ -308,6 +307,44 @@ export default {
);
this.patrolRecordRefPieInstance.setOption(
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 || {},
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?.yaxis?.length) {
let newArr = res.data.yaxis.flatMap((v) => v.series);
this.projectSum = Number(
newArr.find((v) => v.code === "DF_PROJECT_ADCD_SUM")?.sum ?? null
this.flawSum = Number(
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(() => {
@ -351,7 +391,44 @@ export default {
);
this.patrolFlawRefPieInstance.setOption(
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 || {},
seriesOptions: {},
})
@ -360,7 +437,7 @@ export default {
}
});
//
this.requestFunc({ group: "C_3" }).then((res) => {
this.requestFunc({ group: "C_16" }).then((res) => {
if (res.data) {
this.$nextTick(() => {
//
@ -390,7 +467,80 @@ export default {
this.flawProblemRefPieInstance.setOption(
initCommonPieRingOptions({
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: {},
})
);
@ -398,7 +548,7 @@ export default {
}
});
//
this.requestFunc({ group: "C_3" }).then((res) => {
this.requestFunc({ group: "C_17" }).then((res) => {
if (res.data) {
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() {
this.getTableData();

4
vue.config.js

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

Loading…
Cancel
Save