Commit eda076c9 authored by zhangjianqian's avatar zhangjianqian

Merge remote-tracking branch 'origin/master'

parents 29d7926b 2c4baccf
<!-- <!--
* @Author: your name * @Author: your name
* @Date: 2022-01-26 20:07:52 * @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 * @LastEditors: Please set LastEditors
* @Description: 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE * @Description: 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
...@@ -63,19 +63,19 @@ ...@@ -63,19 +63,19 @@
<div class="tbody flex"> <div class="tbody flex">
<div class="first zzz">{{ "流量计与压力表" }}</div> <div class="first zzz">{{ "流量计与压力表" }}</div>
<div class="">{{ deviceData.pressureFlows.length }}</div> <div class="">{{ deviceData.pressureFlows.length }}</div>
<div class=""> <div v-unValue class="">
{{ (Math.random() * deviceData.pressureFlows.length) >> 1 }} {{ (Math.random() * deviceData.pressureFlows.length) >> 1 }}
</div> </div>
<div class=""> <div v-unValue class="">
{{ (Math.random() * deviceData.pressureFlows.length) >> 1 }} {{ (Math.random() * deviceData.pressureFlows.length) >> 1 }}
</div> </div>
<div class=""> <div v-unValue class="">
{{ (Math.random() * deviceData.pressureFlows.length) >> 1 }} {{ (Math.random() * deviceData.pressureFlows.length) >> 1 }}
</div> </div>
<div class=""> <div v-unValue class="">
{{ (Math.random() * deviceData.pressureFlows.length) >> 1 }} {{ (Math.random() * deviceData.pressureFlows.length) >> 1 }}
</div> </div>
<div class="last zzz"> <div v-unValue class="last zzz">
{{ {{
deviceData.pressureFlows.filter((item) => { deviceData.pressureFlows.filter((item) => {
return item.deviceState == 2; return item.deviceState == 2;
...@@ -118,6 +118,8 @@ export default { ...@@ -118,6 +118,8 @@ export default {
this.companyType[item.conpanyId] = item.companyName; this.companyType[item.conpanyId] = item.companyName;
}); });
} }
console.log(this.deviceData)
}, },
methods: { methods: {
close() { close() {
......
<!-- <!--
* @Author: your name * @Author: your name
* @Date: 2022-01-27 14:25:45 * @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 * @LastEditors: Please set LastEditors
* @Description: 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE * @Description: 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
* @FilePath: /hello-world/src/views/components/User.vue * @FilePath: /hello-world/src/views/components/User.vue
...@@ -22,7 +22,7 @@ ...@@ -22,7 +22,7 @@
<div class="group flex"> <div class="group flex">
<div class="left">联系方式:</div> <div class="left">联系方式:</div>
<div class="right">{{ deviceData.phone }}</div> <div v-unValue class="right">{{ deviceData.phone }}</div>
</div> </div>
<div class="group flex"> <div class="group flex">
...@@ -32,16 +32,15 @@ ...@@ -32,16 +32,15 @@
</div> </div>
</div> </div>
<div class="group flex"> <!-- <div class="group flex">
<div class="left">所属公司:</div> <div class="left">所属公司:</div>
<div class="right">{{ companyType[deviceData.companyType] }}</div> <div class="right">{{ companyType[deviceData.companyType] }}</div>
</div> </div> -->
</div> </div>
</template> </template>
<script> <script>
import { companyType } from "@/utils/mapClass/config.js"; import { companyType } from "@/utils/mapClass/config.js";
import { mapGetters } from "vuex";
export default { export default {
data() { data() {
......
This diff is collapsed.
/* /*
* @Author: your name * @Author: your name
* @Date: 2022-01-11 13:45:12 * @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 * @LastEditors: Please set LastEditors
* @Description: 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE * @Description: 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
* @FilePath: /test/hello-world/src/utils/mapClass.js * @FilePath: /test/hello-world/src/utils/mapClass.js
...@@ -444,19 +444,38 @@ export class EditorMap { ...@@ -444,19 +444,38 @@ export class EditorMap {
if (!this.infowindow) return; if (!this.infowindow) return;
this.infowindow.close(); 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) { companyFilter(companyArr) {
for (let pipeItem in this.pipeArr) { 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) => { this.pipeArr[pipeItem].forEach((pipe) => {
const data = pipe.getExtData(); const data = pipe.getExtData();
if (companyArr.indexOf(data.companyType + "") >= 0) { if (companyArr.indexOf(data.companyType + "") >= 0) {
...@@ -467,25 +486,14 @@ export class EditorMap { ...@@ -467,25 +486,14 @@ export class EditorMap {
}); });
} }
for (let deviceItem in this.allDevice) { 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) => { this.allDevice[deviceItem].forEach((device) => {
const data = device.getExtData(); const data = device.getExtData();
// 燃气没有公司,所以没有device.companyType不收到公司的控制 // 燃气没有公司,所以没有device.companyType不收到公司的控制
const companyHas = companyArr.indexOf(data.companyType + "") >= 0;
if ( // 必须设备存在数组里,才会显示设备 !data.companyType代表用户不受公司制约
companyArr.indexOf(data.companyType + "") >= 0 || if (companyHas || !data.companyType) {
!data.companyType
) {
device.show(); device.show();
} else { } else {
device.hide(); device.hide();
...@@ -493,10 +501,33 @@ export class EditorMap { ...@@ -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; satellite = null;
changeMap(bool) { changeMap(bool) {
// 卫星 // 卫星,
if (!bool) { if (!bool) {
if (this.satellite) return; if (this.satellite) return;
this.satellite = new AMap.TileLayer.Satellite(); 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