|
@@ -73,6 +73,7 @@ export default {
|
|
|
},
|
|
|
onLoad(options) {
|
|
|
this.getlist();
|
|
|
+ this.$Http.updateFacilityList = this.getlist.bind(this);
|
|
|
setTimeout(() => this.loadElement(), 100)
|
|
|
},
|
|
|
methods: {
|
|
@@ -95,38 +96,42 @@ export default {
|
|
|
if (page.uninitialized || forcedUpdating) page.init();
|
|
|
},
|
|
|
getlist() {
|
|
|
- this.$Http.basic({
|
|
|
- "id": 20230711144102,
|
|
|
- "content": {
|
|
|
- "pageNumber": 1,
|
|
|
- "pageSize": 99999,
|
|
|
- where: this.where
|
|
|
- }
|
|
|
- }).then(res => {
|
|
|
- console.log("设备列表", res)
|
|
|
- if (this.cutoff(res.msg)) return;
|
|
|
- this.empty = res.data.length == 0;
|
|
|
- this.$refs.Search.onFinish();
|
|
|
- this.markers = res.data.filter(v => v.latitude).map(v => {
|
|
|
- v.id = v.w_deviceid - 0;
|
|
|
- v.title = v.devicename;
|
|
|
- if (this.usePort == 'h5') v.iconPath = require("../../static/img/location.png");
|
|
|
- v.customCallout = { display: 'BYCLICK', anchorY: -10 }
|
|
|
- return v
|
|
|
- });
|
|
|
- this.list = res.data.map(v => {
|
|
|
- switch (v.status) {
|
|
|
- case '在线':
|
|
|
- v.bgColor = "#3C9CFF";
|
|
|
- break;
|
|
|
- case '禁用':
|
|
|
- v.bgColor = "#F56C6C";
|
|
|
- break;
|
|
|
- default:
|
|
|
- v.bgColor = "#F9AE3D";
|
|
|
- break;
|
|
|
+ return new Promise((resolve) => {
|
|
|
+ this.$Http.basic({
|
|
|
+ "id": 20230711144102,
|
|
|
+ "content": {
|
|
|
+ nocache: true,
|
|
|
+ "pageNumber": 1,
|
|
|
+ "pageSize": 99999,
|
|
|
+ where: this.where
|
|
|
}
|
|
|
- return v
|
|
|
+ }).then(res => {
|
|
|
+ console.log("11设备列表", res)
|
|
|
+ if (this.cutoff(res.msg)) return;
|
|
|
+ resolve(res.msg == '成功')
|
|
|
+ this.empty = res.data.length == 0;
|
|
|
+ this.$refs.Search.onFinish();
|
|
|
+ this.markers = res.data.filter(v => v.latitude).map(v => {
|
|
|
+ v.id = v.w_deviceid - 0;
|
|
|
+ v.title = v.devicename;
|
|
|
+ if (this.usePort == 'h5') v.iconPath = require("../../static/img/location.png");
|
|
|
+ v.customCallout = { display: 'BYCLICK', anchorY: -10 }
|
|
|
+ return v
|
|
|
+ });
|
|
|
+ this.list = res.data.map(v => {
|
|
|
+ switch (v.status) {
|
|
|
+ case '在线':
|
|
|
+ v.bgColor = "#3C9CFF";
|
|
|
+ break;
|
|
|
+ case '禁用':
|
|
|
+ v.bgColor = "#F56C6C";
|
|
|
+ break;
|
|
|
+ default:
|
|
|
+ v.bgColor = "#F9AE3D";
|
|
|
+ break;
|
|
|
+ }
|
|
|
+ return v
|
|
|
+ })
|
|
|
})
|
|
|
})
|
|
|
},
|