|
|
@@ -423,7 +423,7 @@ export default {
|
|
|
this.startTime = "";
|
|
|
this.endTime = "";
|
|
|
this.loading = true;
|
|
|
- this.page = 1
|
|
|
+ this.page = 1;
|
|
|
this.tableList();
|
|
|
},
|
|
|
|
|
|
@@ -599,16 +599,7 @@ export default {
|
|
|
list.push(obj);
|
|
|
}
|
|
|
this.options2 = list;
|
|
|
- console.log(this.fillList, this.options2);
|
|
|
- for (var i = 0; i < this.fillList.length; i++) {
|
|
|
- for (var j = 0; j < this.options2.length; j++) {
|
|
|
- if (this.fillList[i].label == this.options2[j].label) {
|
|
|
- this.options2[j].disabled = true;
|
|
|
- } else {
|
|
|
- this.options2[j].disabled = false;
|
|
|
- }
|
|
|
- }
|
|
|
- }
|
|
|
+ this.indexRedact(); // 有害生物删除添加
|
|
|
}
|
|
|
})
|
|
|
.catch((err) => {
|
|
|
@@ -639,15 +630,16 @@ export default {
|
|
|
item.ind = index;
|
|
|
this.fillList.push(item);
|
|
|
});
|
|
|
- for (var i = 0; i < this.fillList.length; i++) {
|
|
|
- for (var j = 0; j < this.options2.length; j++) {
|
|
|
- if (this.fillList[i].label == this.options2[j].label) {
|
|
|
- this.options2[j].disabled = true;
|
|
|
- } else {
|
|
|
- this.options2[j].disabled = false;
|
|
|
- }
|
|
|
- }
|
|
|
- }
|
|
|
+ // for (var i = 0; i < this.fillList.length; i++) {
|
|
|
+ // for (var j = 0; j < this.options2.length; j++) {
|
|
|
+ // if (this.fillList[i].label == this.options2[j].label) {
|
|
|
+ // this.options2[j].disabled = true;
|
|
|
+ // } else {
|
|
|
+ // this.options2[j].disabled = false;
|
|
|
+ // }
|
|
|
+ // }
|
|
|
+ // }
|
|
|
+ this.indexRedact(); // 有害生物添加
|
|
|
} else {
|
|
|
if (document.getElementsByClassName("el-message").length == 0) {
|
|
|
this.$message({
|
|
|
@@ -670,15 +662,11 @@ export default {
|
|
|
});
|
|
|
this.fillList = [];
|
|
|
this.fillList = list;
|
|
|
- for (var i = 0; i < this.fillList.length; i++) {
|
|
|
- for (var j = 0; j < this.options2.length; j++) {
|
|
|
- if (this.fillList[i].label == this.options2[j].label) {
|
|
|
- this.options2[j].disabled = true;
|
|
|
- } else {
|
|
|
- this.options2[j].disabled = false;
|
|
|
- }
|
|
|
- }
|
|
|
- }
|
|
|
+
|
|
|
+ this.options2.forEach((item) => {
|
|
|
+ item.disabled = false
|
|
|
+ })
|
|
|
+ this.indexRedactA(); // 有害生物删除
|
|
|
},
|
|
|
|
|
|
// 添加、删除确定事件
|
|
|
@@ -774,6 +762,29 @@ export default {
|
|
|
e.target.value = 0;
|
|
|
}
|
|
|
},
|
|
|
+
|
|
|
+ // 有害生物添加
|
|
|
+ indexRedact() {
|
|
|
+ this.fillList.forEach((item) => {
|
|
|
+ this.options2.forEach((e) => {
|
|
|
+ if (item.label == e.label) {
|
|
|
+ e.disabled = true;
|
|
|
+ // console.log(e.label, e.disabled);
|
|
|
+ }
|
|
|
+ });
|
|
|
+ });
|
|
|
+ },
|
|
|
+ // 有害生物删除
|
|
|
+ indexRedactA() {
|
|
|
+ this.fillList.forEach((item) => {
|
|
|
+ this.options2.forEach((e) => {
|
|
|
+ if (item.label == e.label) {
|
|
|
+ // console.log(e.label, e.disabled)
|
|
|
+ e.disabled = true;
|
|
|
+ }
|
|
|
+ });
|
|
|
+ });
|
|
|
+ }
|
|
|
},
|
|
|
//生命周期 - 创建完成(可以访问当前this实例)
|
|
|
created() {},
|