Commit e5799bfa by 416409548@qq.com

视频安防/一卡通打卡设置优化

parent 4c42b487
...@@ -78,15 +78,15 @@ ...@@ -78,15 +78,15 @@
</a-col> </a-col>
<a-col :span="12"> <a-col :span="12">
<a-form-model-item label="状态" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="status"> <a-form-model-item label="状态" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="status">
<a-select v-model="model.type" placeholder="请选择状态" disabled> <a-select v-model="model.status" placeholder="请选择状态">
<a-select-option :value="1"> <a-select-option :value=1>
正常 正常
</a-select-option> </a-select-option>
<a-select-option :value="2"> <a-select-option :value=2>
离线 离线
</a-select-option> </a-select-option>
<a-select-option :value="3"> <a-select-option :value=3>
自动访客机 维修
</a-select-option> </a-select-option>
</a-select> </a-select>
</a-form-model-item> </a-form-model-item>
...@@ -251,7 +251,8 @@ export default { ...@@ -251,7 +251,8 @@ export default {
statusList: [ statusList: [
{name: '正常', value: 1, imgPath: require('@/assets/door-close.png')}, {name: '正常', value: 1, imgPath: require('@/assets/door-close.png')},
{name: '离线', value: 2, imgPath: require('@/assets/door-offline.png')}, {name: '离线', value: 2, imgPath: require('@/assets/door-offline.png')},
{name: '损坏', value: 3, imgPath: require('@/assets/door-warning.png')}], {name: '损坏', value: 3, imgPath: require('@/assets/door-warning.png')}
],
doorIconStyle: { doorIconStyle: {
position: 'absolute', position: 'absolute',
top: '0px', top: '0px',
...@@ -346,18 +347,6 @@ export default { ...@@ -346,18 +347,6 @@ export default {
this.model.coordinateTmp = x + "," + y; this.model.coordinateTmp = x + "," + y;
this.$refs.form.validateField('coordinateTmp'); this.$refs.form.validateField('coordinateTmp');
}, },
statusChange(value) {
let targetList = this.statusList.filter(status => status.value === value);
this.doorIconPath = targetList.length > 0 ? targetList[0].imgPath : null;
},
buildingChange(value) {
let targetList = this.buildingInfos.filter(buildingInfo => buildingInfo.name === value);
if (targetList != null && targetList.length > 0) {
this.targetFloorList = targetList[0].floorList;
} else {
this.targetFloorList = [];
}
},
floorImgLoadComplete(e) { floorImgLoadComplete(e) {
if (this.model.coordinate) { if (this.model.coordinate) {
this.model.coordinateTmp = this.model.coordinate.x + ',' + this.model.coordinate.y; this.model.coordinateTmp = this.model.coordinate.x + ',' + this.model.coordinate.y;
...@@ -371,6 +360,10 @@ export default { ...@@ -371,6 +360,10 @@ export default {
this.doorIconStyle.left = this.model.coordinate.x * offsetWidth - fixX + 'px'; this.doorIconStyle.left = this.model.coordinate.x * offsetWidth - fixX + 'px';
} }
}, },
statusChange(value) {
let targetList = this.statusList.filter(status => status.value === value);
this.doorIconPath = targetList.length > 0 ? targetList[0].imgPath : null;
},
} }
} }
</script> </script>
\ No newline at end of file
...@@ -6,7 +6,8 @@ ...@@ -6,7 +6,8 @@
<a-row :gutter="24"> <a-row :gutter="24">
<a-col :xl="4" :lg="4" :md="5" :sm="24"> <a-col :xl="4" :lg="4" :md="5" :sm="24">
<a-form-item label="选择区域"> <a-form-item label="选择区域">
<a-select placeholder="选择区域" v-model="queryParam.districtName"> <a-select v-model="queryParam.districtName">
<a-select-option :value="undefined">请选择</a-select-option>
<a-select-option v-for="va in buildingInfos" :key="va"> <a-select-option v-for="va in buildingInfos" :key="va">
{{ va }} {{ va }}
</a-select-option> </a-select-option>
...@@ -16,7 +17,6 @@ ...@@ -16,7 +17,6 @@
<a-col :xl="4" :lg="4" :md="5" :sm="24"> <a-col :xl="4" :lg="4" :md="5" :sm="24">
<a-space style="float: left"> <a-space style="float: left">
<a-button type="primary" @click="searchQuery">查询</a-button> <a-button type="primary" @click="searchQuery">查询</a-button>
<a-button type="default" @click="searchReset">重置</a-button>
</a-space> </a-space>
</a-col> </a-col>
</a-row> </a-row>
...@@ -55,11 +55,11 @@ ...@@ -55,11 +55,11 @@
<div style="position: relative"> <div style="position: relative">
<img ref="floorImg" src="@/assets/floor.png" alt="floor" width="100%" height="100%" <img ref="floorImg" src="@/assets/floor.png" alt="floor" width="100%" height="100%"
@load="floorImgLoadComplete()"/> @load="floorImgLoadComplete()"/>
<img v-for="(item, index) in list" <img v-for="item in list"
:key="item.id"
ref="icon" ref="icon"
:src="item.status === 'NORMAL' :src="item.status === 1? statusList[0].imgPath
? statusList[0].imgPath :(item.status === 2 ? statusList[1].imgPath : statusList[2].imgPath)"
: (item.status === 'OFFLINE' ? statusList[1].imgPath : statusList[2].imgPath)"
:alt="item.name + ':' + item.ip"/> :alt="item.name + ':' + item.ip"/>
</div> </div>
</a-col> </a-col>
...@@ -137,9 +137,6 @@ export default { ...@@ -137,9 +137,6 @@ export default {
}) })
}); });
}, },
searchReset() {
this.searchQuery();
},
floorImgLoadComplete() { floorImgLoadComplete() {
this.searchQuery(); this.searchQuery();
} }
......
...@@ -43,13 +43,13 @@ ...@@ -43,13 +43,13 @@
<a-col :span="12"> <a-col :span="12">
<a-form-model-item label="设备状态" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="status"> <a-form-model-item label="设备状态" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="status">
<a-select placeholder="设备状态" v-model="model.status"> <a-select placeholder="设备状态" v-model="model.status">
<a-select-option value="1"> <a-select-option :value=1>
正常 正常
</a-select-option> </a-select-option>
<a-select-option value="2"> <a-select-option :value=2>
离线 离线
</a-select-option> </a-select-option>
<a-select-option value="3"> <a-select-option :value=3>
维修 维修
</a-select-option> </a-select-option>
</a-select> </a-select>
......
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