@@ -24,7 +24,7 @@
-
+
+
+
+
+
+
+
{
- if (res.data.list.length == 0) {
- this.dyOptions = [];
- this.formdata.dyid = "";
- } else {
- this.dyOptions = res.data.list;
- this.formdata.dyid = res.data.list[0].id;
- }
- // this.dyOptions = res.data.list;
- // this.formdata.dyid = res.data.list == [] ? "" : res.data.list[0].id;
+ // if (res.data.list.length == 0) {
+ // this.dyOptions = [];
+ // this.formdata.dyid = "";
+ // } else {
+ // this.dyOptions = res.data.list;
+ // this.formdata.dyid = res.data.list[0].id;
+ // }
+ this.dyOptions = this.dyOptions.concat(res.data.list);
+ this.formdata.dyid = this.dyOptions[0].id;
this.getSearchxl();
})
.catch((err) => {});
@@ -199,15 +205,8 @@ export default {
getSearchxl() {
getSearchInfo({ type: 2, id: this.formdata.dyid })
.then((res) => {
- if (res.data.list.length == 0) {
- this.xlOptions = [];
- this.formdata.lineid = "";
- } else {
- this.xlOptions = res.data.list;
- this.formdata.lineid = res.data.list[0].id;
- }
- // this.xlOptions = res.data.list;
- // this.formdata.lineid = res.data.list == [] ? "" : res.data.list[0].id;
+ this.xlOptions = this.xlOptions.concat(res.data.list);
+ this.formdata.lineid = this.xlOptions[0].id;
this.getSearchgt();
})
.catch((err) => {});
@@ -216,16 +215,18 @@ export default {
getSearchgt() {
getSearchInfo({ type: 3, id: this.formdata.lineid })
.then((res) => {
- if (res.data.list.length == 0) {
- this.gtOptions = [];
- this.formdata.towerid = "";
- } else {
- this.gtOptions = res.data.list;
- this.formdata.towerid = res.data.list[0].id;
- }
- // this.gtOptions = res.data.list;
- // this.formdata.towerid =
- // res.data.list == [] ? "" : res.data.list[0].id;
+ this.gtOptions = this.gtOptions.concat(res.data.list);
+ this.formdata.towerid = this.gtOptions[0].id;
+ this.getSearchzz()
+ })
+ .catch((err) => {});
+ },
+ //获取装置数据
+ getSearchzz() {
+ getSearchInfo({ type: 4, id: this.formdata.towerid })
+ .then((res) => {
+ this.zzOptions = this.zzOptions.concat(res.data.list);
+ this.formdata.deviceid = this.zzOptions[0].id;
this.getSearchtd();
})
.catch((err) => {});
@@ -234,21 +235,12 @@ export default {
getSearchtd() {
getSearchInfo({ type: 4, id: this.formdata.towerid })
.then((res) => {
- if (res.data.list.length == 0) {
- this.tdOptions = [];
- this.formdata.channelid = "";
- } else {
- this.tdOptions = res.data.list;
- this.formdata.channelid = res.data.list[0].id;
- }
- // this.tdOptions = res.data.list;
- // this.formdata.channelid =
- // res.data.list == [] ? "" : res.data.list[0].id;
+ this.tdOptions = this.tdOptions.concat(res.data.list);
+ this.formdata.channelid = this.tdOptions[0].id;
if (this.signtype == 0) {
this.getPicData();
}
this.signtype = 1;
- this.loadingSearch = false;
})
.catch((err) => {});
},
@@ -266,6 +258,7 @@ export default {
this.loading = false;
})
.catch((err) => {
+ this.loading = false;
console.log(err);
});
},