Browse Source

堤防与水闸基本完成

master_tdsql
xzt 1 year ago
parent
commit
d225a9e8a4
  1. BIN
      src/assets/image/map.jpg
  2. 104
      src/views/dyke/engineeringCondition/dykeBaseInfo/index.vue
  3. 58
      src/views/dyke/engineeringCondition/dykeBaseInfo/options/basePage.vue
  4. 28
      src/views/dyke/engineeringCondition/dykeCompare/components/basePage.vue
  5. 11
      src/views/dyke/engineeringCondition/identificationPlate/components/markForm.vue
  6. 111
      src/views/dyke/engineeringCondition/identificationPlate/index.vue
  7. 37
      src/views/sluice/engineeringCondition/identificationPlate/index.vue

BIN
src/assets/image/map.jpg

Binary file not shown.

After

Width:  |  Height:  |  Size: 97 KiB

104
src/views/dyke/engineeringCondition/dykeBaseInfo/index.vue

@ -34,12 +34,25 @@
></el-button>
</el-input>
</el-form-item>
<el-form-item label="行政区划" prop="adcd">
<el-cascader
:options="areasOptions"
v-model="queryParams.data.adcd"
:props="areasOptionProps"
placeholder="请选择行政区划"
clearable
size="small"
@change="handleQuery"
>
</el-cascader>
</el-form-item>
<el-form-item label="堤防类型" prop="embankmentType">
<el-select
v-model="queryParams.data.embankmentType"
placeholder="请选择堤防类型"
clearable
size="small"
@change="handleQuery"
>
<el-option
v-for="dict in embankmentTypeOptions"
@ -116,6 +129,13 @@
prop="embankmentName"
min-width="120"
/>
<el-table-column
label="行政区划"
align="center"
prop="adcd"
:formatter="formatAdcd"
min-width="120"
/>
<el-table-column
label="起点行政区划"
align="center"
@ -383,6 +403,21 @@
/>
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="行政区划" prop="adcd">
<el-cascader
:options="areasOptions"
v-model="form.adcd"
:props="areasOptionProps"
placeholder="请选择行政区划"
clearable
size="small"
style="width: 100%"
@change="handleChange"
>
</el-cascader>
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="起点行政区划" prop="adcdStart">
<el-input
@ -754,11 +789,18 @@ import {
updateDikeInfo,
exportDikeInfo,
} from "@/api/yg/dikeInfo";
import { getAreasData } from "@/api/areas/index";
import { regionData, codeToText, TextToCode } from "element-china-area-data";
export default {
name: "DikeInfo",
data() {
return {
areasOptionProps: {
emitPath: false,
checkStrictly: true, //
},
areasOptions: [],
//
loading: true,
//
@ -818,6 +860,9 @@ export default {
embankmentName: [
{ required: true, message: "堤防名称不能为空", trigger: "blur" },
],
embankmentCode: [
{ required: true, message: "请输入堤防编码", trigger: "blur" },
],
},
//
routeList: [
@ -829,6 +874,7 @@ export default {
};
},
created() {
this.getTreeData();
this.getList();
this.getDicts("embankment_type").then((response) => {
this.embankmentTypeOptions = response.data;
@ -856,6 +902,64 @@ export default {
});
},
methods: {
formatAdcd(row) {
if (row.adcd) {
let provinceCode = row.adcd.slice(0, 2);
let cityCode = row.adcd.slice(2, 4);
let areaCode = row.adcd.slice(4, 6);
if (areaCode != "00") {
return (
codeToText[provinceCode] +
"-" +
codeToText[provinceCode + cityCode] +
"-" +
codeToText[provinceCode + cityCode + areaCode]
);
} else if (cityCode != "00") {
return (
codeToText[provinceCode] + "-" + codeToText[provinceCode + cityCode]
);
} else {
return codeToText[provinceCode];
}
}
},
getTreeData() {
getAreasData().then((items) => {
// console.log("getAreasData", items.data);
let res = [];
let getChildren = (res, pid) => {
for (const i of items.data) {
if (i.parentid === pid) {
const newItem = {
label: i.name,
value: i.id,
};
if (i.layer != 3) newItem.children = [];
res.push(newItem);
getChildren(newItem.children, newItem.value);
}
}
};
getChildren(res, items.data[0].parentid);
console.log(66666666666, res);
this.areasOptions = res;
// return res;
});
},
handleChange(value) {
//valuecode
if (value) {
console.log("value", value);
var provinceCode = codeToText[value[0]]; //code
var cityCode = codeToText[value[1]]; //
var orgion = codeToText[value[2]]; //
console.log(44444444, provinceCode, cityCode, orgion);
// this.baseMsg.adcd = value[value.length - 1];
console.log("this.form.adcd", this.form.adcd);
}
},
/** 查询水闸工程基础信息列表 */
getList() {
this.loading = true;

58
src/views/dyke/engineeringCondition/dykeBaseInfo/options/basePage.vue

@ -16,6 +16,21 @@
/>
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="行政区划" prop="adcd">
<el-cascader
:options="areasOptions"
v-model="form.adcd"
:props="areasOptionProps"
placeholder="请选择行政区划"
clearable
size="small"
style="width: 100%"
@change="handleChange"
>
</el-cascader>
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="起点行政区划" prop="adcdStart">
<el-input
@ -374,11 +389,18 @@ import {
updateDikeInfo,
exportDikeInfo,
} from "@/api/yg/dikeInfo";
import { getAreasData } from "@/api/areas/index";
import { regionData, codeToText, TextToCode } from "element-china-area-data";
export default {
name: "dikeInfo",
data() {
return {
areasOptionProps: {
emitPath: false,
checkStrictly: true, //
},
areasOptions: [],
//
loading: true,
//
@ -447,6 +469,7 @@ export default {
},
created() {
this.reset();
this.getTreeData();
this.getList();
this.getDicts("embankment_type").then((response) => {
this.embankmentTypeOptions = response.data;
@ -474,6 +497,41 @@ export default {
});
},
methods: {
getTreeData() {
getAreasData().then((items) => {
// console.log("getAreasData", items.data);
let res = [];
let getChildren = (res, pid) => {
for (const i of items.data) {
if (i.parentid === pid) {
const newItem = {
label: i.name,
value: i.id,
};
if (i.layer != 3) newItem.children = [];
res.push(newItem);
getChildren(newItem.children, newItem.value);
}
}
};
getChildren(res, items.data[0].parentid);
console.log(66666666666, res);
this.areasOptions = res;
// return res;
});
},
handleChange(value) {
//valuecode
if (value) {
console.log("value", value);
var provinceCode = codeToText[value[0]]; //code
var cityCode = codeToText[value[1]]; //
var orgion = codeToText[value[2]]; //
console.log(44444444, provinceCode, cityCode, orgion);
// this.baseMsg.adcd = value[value.length - 1];
console.log("this.form.adcd", this.form.adcd);
}
},
/** 查询水闸工程基础信息列表 */
getList() {
const id = this.$route.query.baseDataId;

28
src/views/dyke/engineeringCondition/dykeCompare/components/basePage.vue

@ -33,6 +33,10 @@
<template slot="label"> 堤防名称 </template>
{{ this.form.embankmentName }}
</el-descriptions-item>
<el-descriptions-item :contentClassName="isDiff('adcd')">
<template slot="label"> 行政区划 </template>
{{ formatAdcd(this.form) }}
</el-descriptions-item>
<el-descriptions-item :contentClassName="isDiff('adcdStart')">
<template slot="label"> 起点行政区划 </template>
{{ this.form.adcdStart }}
@ -187,6 +191,8 @@
</template>
<script>
import { getDikeCompare } from "@/api/yg/dikeCompare";
import { regionData, codeToText, TextToCode } from "element-china-area-data";
export default {
props: ["baseData"],
inject: ["getDiff", "granParentEle"],
@ -296,6 +302,28 @@ export default {
},
},
methods: {
formatAdcd(row) {
if (row.adcd) {
let provinceCode = row.adcd.slice(0, 2);
let cityCode = row.adcd.slice(2, 4);
let areaCode = row.adcd.slice(4, 6);
if (areaCode != "00") {
return (
codeToText[provinceCode] +
"-" +
codeToText[provinceCode + cityCode] +
"-" +
codeToText[provinceCode + cityCode + areaCode]
);
} else if (cityCode != "00") {
return (
codeToText[provinceCode] + "-" + codeToText[provinceCode + cityCode]
);
} else {
return codeToText[provinceCode];
}
}
},
isDiff(name) {
return this.diffPart.some((item) => item === name) ? "diffEle" : "";
},

11
src/views/dyke/engineeringCondition/identificationPlate/components/markForm.vue

@ -133,6 +133,7 @@ export default {
this.form.type = this.type;
this.form.embankmentName = this.comForm.embankmentName;
this.form.embankmentCode = this.comForm.embankmentCode;
this.form.adcd = this.comForm.adcd;
if (this.form.photo) {
this.fileList = JSON.parse(this.form.photo);
}
@ -161,6 +162,7 @@ export default {
// console.log(7777777777, this.comForm);
this.form.embankmentName = this.comForm.embankmentName;
this.form.embankmentCode = this.comForm.embankmentCode;
this.form.adcd = this.comForm.adcd;
}
console.log("this.form in components", this.form);
// form
@ -198,6 +200,15 @@ export default {
this.form.embankmentCode = newVal;
},
},
"comForm.adcd": {
// deep: true, // true
handler(newVal, oldVal) {
// console.log("code", newVal);
// console.log("code", oldVal);
// this.form.sluiceName = newVal;
this.form.adcd = newVal;
},
},
// status: function (n, o) {
// if (!n) {
// this.form = {

111
src/views/dyke/engineeringCondition/identificationPlate/index.vue

@ -1,6 +1,8 @@
<template>
<div class="app-container">
<div class="map">地图</div>
<div class="map">
<img style="width: 100%" src="@/assets/image/map.jpg" alt="" />
</div>
<div class="list">
<el-form
:model="queryParams"
@ -26,12 +28,13 @@
></el-button>
</el-input>
</el-form-item>
<el-form-item label="标牌类型" prop="type">
<!-- <el-form-item label="标牌类型" prop="type">
<el-select
v-model="queryParams.data.type"
placeholder="请选择标牌类型"
clearable
size="small"
@change="handleQuery"
>
<el-option
v-for="dict in typeOptions"
@ -40,6 +43,18 @@
:value="dict.dictValue"
/>
</el-select>
</el-form-item> -->
<el-form-item label="行政区划" prop="adcd">
<el-cascader
:options="areasOptions"
v-model="queryParams.data.adcd"
:props="areasOptionProps"
placeholder="请选择行政区划"
clearable
size="small"
@change="handleQuery"
>
</el-cascader>
</el-form-item>
<!-- <el-form-item label="标识类型" prop="markType">
<el-select
@ -139,6 +154,7 @@
label="行政区划"
align="center"
prop="adcd"
:formatter="formatAdcd"
min-width="120"
/>
<el-table-column
@ -517,6 +533,9 @@ import {
} from "@/api/yg/dikeMark";
import { listDikeInfo } from "@/api/yg/dikeInfo";
import markForm from "./components/markForm.vue";
import { getAreasData } from "@/api/areas/index";
import { regionData, codeToText, TextToCode } from "element-china-area-data";
// import Vue from "vue";
export default {
@ -526,6 +545,11 @@ export default {
},
data() {
return {
areasOptionProps: {
emitPath: false,
checkStrictly: true, //
},
areasOptions: [],
isFirst: true,
//
loading: true,
@ -575,6 +599,7 @@ export default {
comForm: {
embankmentName: null,
embankmentCode: null,
adcd: null,
},
noticeForm: {},
warnForm: {},
@ -589,7 +614,7 @@ export default {
},
rules: {
markName: [
// { required: true, message: "", trigger: "blur" },
{ required: true, message: "请输入标志名称", trigger: "blur" },
],
},
embankmentNameOptions: [],
@ -603,6 +628,7 @@ export default {
},
created() {
this.getList();
this.getTreeData();
this.getDicts("breastplate_type").then((response) => {
this.typeOptions = response.data;
});
@ -629,6 +655,51 @@ export default {
// this.counter1[0] = this.noticeForm;
// },
methods: {
formatAdcd(row) {
if (row.adcd) {
let provinceCode = row.adcd.slice(0, 2);
let cityCode = row.adcd.slice(2, 4);
let areaCode = row.adcd.slice(4, 6);
if (areaCode != "00") {
return (
codeToText[provinceCode] +
"-" +
codeToText[provinceCode + cityCode] +
"-" +
codeToText[provinceCode + cityCode + areaCode]
);
} else if (cityCode != "00") {
return (
codeToText[provinceCode] + "-" + codeToText[provinceCode + cityCode]
);
} else {
return codeToText[provinceCode];
}
}
},
getTreeData() {
getAreasData().then((items) => {
// console.log("getAreasData", items.data);
let res = [];
let getChildren = (res, pid) => {
for (const i of items.data) {
if (i.parentid === pid) {
const newItem = {
label: i.name,
value: i.id,
};
if (i.layer != 3) newItem.children = [];
res.push(newItem);
getChildren(newItem.children, newItem.value);
}
}
};
getChildren(res, items.data[0].parentid);
console.log(66666666666, res);
this.areasOptions = res;
// return res;
});
},
addForm(index, type, formName) {
console.log("index和type", index, type);
const counterType = "counter" + type;
@ -708,6 +779,7 @@ export default {
chooseEmbankmenName(data) {
// embankmentCode
this.comForm.embankmentCode = data.embankmentCode;
this.comForm.adcd = data.adcd;
// console.log(33333, this.comForm);
// //
// this.$refs["noticeForm0"][0].form.embankmentName = data.embankmentName;
@ -759,6 +831,7 @@ export default {
this.comForm = {
embankmentName: null,
embankmentCode: null,
adcd: null,
};
this.noticeForm = {
id: null,
@ -905,11 +978,16 @@ export default {
console.log("回显的数据", response);
this.comForm.embankmentName = response.data[0].embankmentName;
this.comForm.embankmentCode = response.data[0].embankmentCode;
this.comForm.adcd = response.data[0].adcd;
console.log("this.comForm", this.comForm);
this.counter0 = response.data.filter((item) => item.type == 0);
if (this.counter0.length == 0) this.counter0 = [{}];
this.counter1 = response.data.filter((item) => item.type == 1);
if (this.counter1.length == 0) this.counter1 = [{}];
this.counter2 = response.data.filter((item) => item.type == 2);
if (this.counter2.length == 0) this.counter2 = [{}];
this.counter3 = response.data.filter((item) => item.type == 3);
if (this.counter3.length == 0) this.counter3 = [{}];
console.log("回显的数据时的counter0", this.counter0);
console.log("回显的数据时的counter1", this.counter1);
console.log("回显的数据时的counter2", this.counter2);
@ -922,7 +1000,10 @@ export default {
submitForm() {
// console.log(1111111111, this.$refs.noticeForm0[0].$refs.form);
//
//
let isAllTrue = true;
//
// let isAllTrue = false;
this.counter0.forEach((item, index) => {
this.counter0[index].photo = JSON.stringify(
this.$refs["noticeForm" + index][0].fileList
@ -963,19 +1044,27 @@ export default {
const C0 =
this.counter0.length > 1
? this.counter0
: [this.$refs["noticeForm0"][0].form];
: this.$refs["noticeForm0"][0].form.markName
? [this.$refs["noticeForm0"][0].form]
: [];
const C1 =
this.counter1.length > 1
? this.counter1
: [this.$refs["warnForm0"][0].form];
: this.$refs["warnForm0"][0].form.markName
? [this.$refs["warnForm0"][0].form]
: [];
const C2 =
this.counter2.length > 1
? this.counter2
: [this.$refs["guideForm0"][0].form];
: this.$refs["guideForm0"][0].form.markName
? [this.$refs["guideForm0"][0].form]
: [];
const C3 =
this.counter3.length > 1
? this.counter3
: [this.$refs["nameForm0"][0].form];
: this.$refs["nameForm0"][0].form.markName
? [this.$refs["nameForm0"][0].form]
: [];
// console.log("C0C0", C0, C1);
if (this.isEdit) {
@ -1066,14 +1155,14 @@ export default {
.map {
min-width: 400px;
height: 500px;
border: 1px solid skyblue;
background: skyblue;
// border: 1px solid skyblue;
// background: skyblue;
margin-right: 20px;
// flex: 1;
flex: 1;
}
.list {
min-width: 800px;
flex: 1;
flex: 2;
}
}
.listTitle {

37
src/views/sluice/engineeringCondition/identificationPlate/index.vue

@ -1,6 +1,8 @@
<template>
<div class="app-container">
<div class="map">地图</div>
<div class="map">
<img style="width: 100%" src="@/assets/image/map.jpg" alt="" />
</div>
<div class="list">
<el-form
:model="queryParams"
@ -26,7 +28,7 @@
></el-button>
</el-input>
</el-form-item>
<el-form-item label="标牌类型" prop="type">
<!-- <el-form-item label="标牌类型" prop="type">
<el-select
v-model="queryParams.data.type"
placeholder="请选择标牌类型"
@ -41,7 +43,7 @@
:value="dict.dictValue"
/>
</el-select>
</el-form-item>
</el-form-item> -->
<el-form-item label="行政区划" prop="adcd">
<el-cascader
:options="areasOptions"
@ -612,7 +614,7 @@ export default {
},
rules: {
markName: [
// { required: true, message: "", trigger: "change" },
{ required: true, message: "至少有一个标志名称", trigger: "change" },
],
},
sluiceNameOptions: [],
@ -998,8 +1000,10 @@ export default {
submitForm() {
// console.log(1111111111, this.$refs.noticeForm0[0].$refs.form);
//
// let isAllTrue = true;
let isAllTrue = false;
//
let isAllTrue = true;
//
// let isAllTrue = false;
this.counter0.forEach((item, index) => {
// console.log(111111, item["markName"]);
// for (sub of Object.values(item)) {
@ -1009,29 +1013,32 @@ export default {
this.$refs["noticeForm" + index][0].fileList
);
this.$refs["noticeForm" + index][0].validateForm();
// isAllTrue = isAllTrue && this.$refs["noticeForm" + index][0].valid;
isAllTrue = isAllTrue || this.$refs["noticeForm" + index][0].valid;
isAllTrue = isAllTrue && this.$refs["noticeForm" + index][0].valid;
// isAllTrue = isAllTrue || this.$refs["noticeForm" + index][0].valid;
});
this.counter1.forEach((item, index) => {
this.counter1[index].photo = JSON.stringify(
this.$refs["warnForm" + index][0].fileList
);
this.$refs["warnForm" + index][0].validateForm();
isAllTrue = isAllTrue || this.$refs["warnForm" + index][0].valid;
isAllTrue = isAllTrue && this.$refs["warnForm" + index][0].valid;
// isAllTrue = isAllTrue || this.$refs["warnForm" + index][0].valid;
});
this.counter2.forEach((item, index) => {
this.counter2[index].photo = JSON.stringify(
this.$refs["guideForm" + index][0].fileList
);
this.$refs["guideForm" + index][0].validateForm();
isAllTrue = isAllTrue || this.$refs["guideForm" + index][0].valid;
isAllTrue = isAllTrue && this.$refs["guideForm" + index][0].valid;
// isAllTrue = isAllTrue || this.$refs["guideForm" + index][0].valid;
});
this.counter3.forEach((item, index) => {
this.counter3[index].photo = JSON.stringify(
this.$refs["nameForm" + index][0].fileList
);
this.$refs["nameForm" + index][0].validateForm();
isAllTrue = isAllTrue || this.$refs["nameForm" + index][0].valid;
isAllTrue = isAllTrue && this.$refs["nameForm" + index][0].valid;
// isAllTrue = isAllTrue || this.$refs["nameForm" + index][0].valid;
});
console.log("全部表单是否通过校验", isAllTrue);
this.$refs["comForm"].validate((valid0) => {
@ -1157,14 +1164,14 @@ export default {
.map {
min-width: 400px;
height: 500px;
border: 1px solid skyblue;
background: skyblue;
// border: 1px solid skyblue;
// background: skyblue;
margin-right: 20px;
// flex: 1;
flex: 1;
}
.list {
min-width: 800px;
flex: 1;
flex: 2;
}
}
.listTitle {

Loading…
Cancel
Save