|
@@ -41,38 +41,39 @@
|
|
</div>
|
|
</div>
|
|
<div class="bottom"></div>
|
|
<div class="bottom"></div>
|
|
</div>
|
|
</div>
|
|
- <WindturbineDetailPages v-model="dialogVisible" :windturbineId="currentWindturbineId"></WindturbineDetailPages>
|
|
|
|
|
|
+ <WindturbineDetailPages
|
|
|
|
+ v-model="dialogVisible"
|
|
|
|
+ :windturbineId="currentWindturbineId"
|
|
|
|
+ :stationId="currentStationId"
|
|
|
|
+ ></WindturbineDetailPages>
|
|
</template>
|
|
</template>
|
|
|
|
|
|
<script>
|
|
<script>
|
|
-/* import wtbdp from "../../wtbDetailPages" */
|
|
|
|
-import WindturbineDetailPages from "../WindturbineDetailPages.vue"
|
|
|
|
|
|
+import WindturbineDetailPages from "../WindturbineDetailPages.vue";
|
|
export default {
|
|
export default {
|
|
name: "ControlMatrixCard",
|
|
name: "ControlMatrixCard",
|
|
props: { title: String, type: Number, datas: Object },
|
|
props: { title: String, type: Number, datas: Object },
|
|
data() {
|
|
data() {
|
|
return {
|
|
return {
|
|
values: [],
|
|
values: [],
|
|
- dialogVisible:false,
|
|
|
|
- currentWindturbineId:"",
|
|
|
|
|
|
+ dialogVisible: false,
|
|
|
|
+ currentWindturbineId: "",
|
|
|
|
+ currentStationId: "",
|
|
};
|
|
};
|
|
},
|
|
},
|
|
- created() {},
|
|
|
|
- components:{
|
|
|
|
- WindturbineDetailPages
|
|
|
|
|
|
+ components: {
|
|
|
|
+ WindturbineDetailPages,
|
|
},
|
|
},
|
|
methods: {
|
|
methods: {
|
|
// 点击卡片事件
|
|
// 点击卡片事件
|
|
onSelectHandler(item) {
|
|
onSelectHandler(item) {
|
|
item.active = !item.active;
|
|
item.active = !item.active;
|
|
},
|
|
},
|
|
- sendMsg:function(itm){
|
|
|
|
- this.dialogVisible=true;
|
|
|
|
|
|
+ sendMsg: function (itm) {
|
|
|
|
+ this.dialogVisible = true;
|
|
this.currentWindturbineId = itm.windturbineId;
|
|
this.currentWindturbineId = itm.windturbineId;
|
|
|
|
+ this.currentStationId = itm.stationId;
|
|
},
|
|
},
|
|
- /* sendMsg:function(){
|
|
|
|
- wtbdp.$emit("event","first");
|
|
|
|
- }, */
|
|
|
|
filter(value, windturbineId) {
|
|
filter(value, windturbineId) {
|
|
var array = [];
|
|
var array = [];
|
|
var flag = false;
|
|
var flag = false;
|
|
@@ -112,7 +113,7 @@ export default {
|
|
/* 将选中的项目填充到数组中 */
|
|
/* 将选中的项目填充到数组中 */
|
|
outputSelectedItems(ls) {
|
|
outputSelectedItems(ls) {
|
|
this.values.forEach((item) => {
|
|
this.values.forEach((item) => {
|
|
- if (item.active&&!this.isHas(item,ls)) {
|
|
|
|
|
|
+ if (item.active && !this.isHas(item, ls)) {
|
|
ls.push(item);
|
|
ls.push(item);
|
|
}
|
|
}
|
|
});
|
|
});
|
|
@@ -123,29 +124,29 @@ export default {
|
|
this.values.forEach((item) => (item.active = false));
|
|
this.values.forEach((item) => (item.active = false));
|
|
},
|
|
},
|
|
|
|
|
|
- isHas(item,ls){
|
|
|
|
- for(var id in ls){
|
|
|
|
- if(ls[id].windturbineId==item.windturbineId){
|
|
|
|
|
|
+ isHas(item, ls) {
|
|
|
|
+ for (var id in ls) {
|
|
|
|
+ if (ls[id].windturbineId == item.windturbineId) {
|
|
return true;
|
|
return true;
|
|
}
|
|
}
|
|
}
|
|
}
|
|
return false;
|
|
return false;
|
|
},
|
|
},
|
|
|
|
|
|
- clear(vs){
|
|
|
|
|
|
+ clear(vs) {
|
|
var ll = new Array();
|
|
var ll = new Array();
|
|
- this.values.forEach((item)=>{
|
|
|
|
|
|
+ this.values.forEach((item) => {
|
|
var it = vs[item.windturbineId];
|
|
var it = vs[item.windturbineId];
|
|
- if(typeof(it)==="undefined"){
|
|
|
|
|
|
+ if (typeof it === "undefined") {
|
|
ll.push(item);
|
|
ll.push(item);
|
|
}
|
|
}
|
|
});
|
|
});
|
|
- for(var v1 in ll){
|
|
|
|
|
|
+ for (var v1 in ll) {
|
|
var ind = this.values.indexOf(ll[v1]);
|
|
var ind = this.values.indexOf(ll[v1]);
|
|
- if(ind<0)continue;
|
|
|
|
- this.values.splice(ind,1);
|
|
|
|
|
|
+ if (ind < 0) continue;
|
|
|
|
+ this.values.splice(ind, 1);
|
|
}
|
|
}
|
|
- }
|
|
|
|
|
|
+ },
|
|
},
|
|
},
|
|
watch: {
|
|
watch: {
|
|
"$store.getters.windturbinelist": {
|
|
"$store.getters.windturbinelist": {
|
|
@@ -156,11 +157,11 @@ export default {
|
|
var val = json[id];
|
|
var val = json[id];
|
|
if (val.status == this.type) {
|
|
if (val.status == this.type) {
|
|
this.addCard(val);
|
|
this.addCard(val);
|
|
- vs[val.windturbineId]=0;
|
|
|
|
|
|
+ vs[val.windturbineId] = 0;
|
|
}
|
|
}
|
|
if (this.type < 0 && val.lockValue) {
|
|
if (this.type < 0 && val.lockValue) {
|
|
this.addCard(val);
|
|
this.addCard(val);
|
|
- vs[val.windturbineId]=0;
|
|
|
|
|
|
+ vs[val.windturbineId] = 0;
|
|
}
|
|
}
|
|
}
|
|
}
|
|
this.clear(vs);
|
|
this.clear(vs);
|