Commit eda076c9 authored by zhangjianqian's avatar zhangjianqian

Merge remote-tracking branch 'origin/master'

parents 29d7926b 2c4baccf
<!--
* @Author: your name
* @Date: 2022-01-26 20:07:52
* @LastEditTime: 2022-02-25 18:34:00
* @LastEditTime: 2022-02-26 14:16:23
* @LastEditors: Please set LastEditors
* @Description: 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
......@@ -63,19 +63,19 @@
<div class="tbody flex">
<div class="first zzz">{{ "流量计与压力表" }}</div>
<div class="">{{ deviceData.pressureFlows.length }}</div>
<div class="">
<div v-unValue class="">
{{ (Math.random() * deviceData.pressureFlows.length) >> 1 }}
</div>
<div class="">
<div v-unValue class="">
{{ (Math.random() * deviceData.pressureFlows.length) >> 1 }}
</div>
<div class="">
<div v-unValue class="">
{{ (Math.random() * deviceData.pressureFlows.length) >> 1 }}
</div>
<div class="">
<div v-unValue class="">
{{ (Math.random() * deviceData.pressureFlows.length) >> 1 }}
</div>
<div class="last zzz">
<div v-unValue class="last zzz">
{{
deviceData.pressureFlows.filter((item) => {
return item.deviceState == 2;
......@@ -118,6 +118,8 @@ export default {
this.companyType[item.conpanyId] = item.companyName;
});
}
console.log(this.deviceData)
},
methods: {
close() {
......
<!--
* @Author: your name
* @Date: 2022-01-27 14:25:45
* @LastEditTime: 2022-02-17 10:12:02
* @LastEditTime: 2022-02-26 14:16:16
* @LastEditors: Please set LastEditors
* @Description: 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
* @FilePath: /hello-world/src/views/components/User.vue
......@@ -22,7 +22,7 @@
<div class="group flex">
<div class="left">联系方式:</div>
<div class="right">{{ deviceData.phone }}</div>
<div v-unValue class="right">{{ deviceData.phone }}</div>
</div>
<div class="group flex">
......@@ -32,16 +32,15 @@
</div>
</div>
<div class="group flex">
<!-- <div class="group flex">
<div class="left">所属公司:</div>
<div class="right">{{ companyType[deviceData.companyType] }}</div>
</div>
</div> -->
</div>
</template>
<script>
import { companyType } from "@/utils/mapClass/config.js";
import { mapGetters } from "vuex";
export default {
data() {
......
This diff is collapsed.
/*
* @Author: your name
* @Date: 2022-01-11 13:45:12
* @LastEditTime: 2022-02-26 09:55:44
* @LastEditTime: 2022-02-26 13:59:03
* @LastEditors: Please set LastEditors
* @Description: 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
* @FilePath: /test/hello-world/src/utils/mapClass.js
......@@ -444,19 +444,38 @@ export class EditorMap {
if (!this.infowindow) return;
this.infowindow.close();
}
allilter(companyArr, typeArr) {
for (let pipeItem in this.pipeArr) {
this.pipeArr[pipeItem].forEach((pipe) => {
const data = pipe.getExtData();
if (companyArr.indexOf(data.companyType + "") >= 0) {
pipe.show();
} else {
pipe.hide();
}
});
}
for (let deviceItem in this.allDevice) {
this.allDevice[deviceItem].forEach((device) => {
const data = device.getExtData();
// 设备过滤受到bigwindow页面的的两种制约,companyArr, typeArr 两个数组制约显示隐藏
// 燃气没有公司,所以没有device.companyType不收到公司的控制
const companyHas = companyArr.indexOf(data.companyType + "") >= 0;
// 设备存在
const deviceHas = typeArr.indexOf(data.iconType + "") >= 0;
// 必须设备存在数组里,才会显示设备 !data.companyType代表用户不受公司制约
if (deviceHas && (companyHas || !data.companyType)) {
device.show();
} else {
device.hide();
}
});
}
}
// 根据公司过滤是否显示 公司由一个数组传过来
companyFilter(companyArr) {
for (let pipeItem in this.pipeArr) {
// 如果item属于数组说明要显示,凑则就是隐藏
// if (companyArr.indexOf(+pipeItem+'') >= 0) {
// this.pipeArr[pipeItem].forEach((pipe) => {
// pipe.show();
// });
// } else {
// this.pipeArr[pipeItem].forEach((pipe) => {
// pipe.hide();
// });
// }
this.pipeArr[pipeItem].forEach((pipe) => {
const data = pipe.getExtData();
if (companyArr.indexOf(data.companyType + "") >= 0) {
......@@ -467,25 +486,14 @@ export class EditorMap {
});
}
for (let deviceItem in this.allDevice) {
// if (companyArr.indexOf(+deviceItem+'') >= 0) {
// this.allDevice[deviceItem].forEach((device) => {
// device.show();
// });
// } else {
// this.allDevice[deviceItem].forEach((device) => {
// device.hide();
// });
// }
console.log(this.allDevice);
this.allDevice[deviceItem].forEach((device) => {
const data = device.getExtData();
// 燃气没有公司,所以没有device.companyType不收到公司的控制
const companyHas = companyArr.indexOf(data.companyType + "") >= 0;
if (
companyArr.indexOf(data.companyType + "") >= 0 ||
!data.companyType
) {
// 必须设备存在数组里,才会显示设备 !data.companyType代表用户不受公司制约
if (companyHas || !data.companyType) {
device.show();
} else {
device.hide();
......@@ -493,10 +501,33 @@ export class EditorMap {
});
}
}
// 根据设备类型隐藏展示
iconTypeFilter(typeArr) {
for (let deviceItem in this.allDevice) {
this.allDevice[deviceItem].forEach((device) => {
if (typeArr.indexOf(deviceItem + "") >= 0) {
device.show();
} else {
device.hide();
}
});
}
}
// 公司改变,先调用设备方法,在调用公司方法
companyChange(companyArr, typeArr) {
this.iconTypeFilter(typeArr);
this.companyFilter(companyArr);
}
// 设备选择,先调用公司方法,在调用设备方法覆盖
deviceChange(companyArr, typeArr) {
this.companyFilter(companyArr);
this.iconTypeFilter(typeArr);
}
// 卫星图切换
satellite = null;
changeMap(bool) {
// 卫星
// 卫星,
if (!bool) {
if (this.satellite) return;
this.satellite = new AMap.TileLayer.Satellite();
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment