|
|
@@ -21,7 +21,7 @@
|
|
|
<el-option
|
|
|
v-for="item in panel.regionidOptions"
|
|
|
:key="item.Id"
|
|
|
- :label="item.Name"
|
|
|
+ :label="item.DisplayName"
|
|
|
:value="item.Id">
|
|
|
</el-option>
|
|
|
</el-select>
|
|
|
@@ -52,6 +52,13 @@
|
|
|
type="selection"
|
|
|
width="55">
|
|
|
</el-table-column>
|
|
|
+ <el-table-column
|
|
|
+ type="index"
|
|
|
+ label="序号"
|
|
|
+ width="60"
|
|
|
+ sortable
|
|
|
+ >
|
|
|
+ </el-table-column>
|
|
|
<el-table-column
|
|
|
prop="Mac"
|
|
|
label="Mac"
|
|
|
@@ -65,11 +72,12 @@
|
|
|
<el-table-column
|
|
|
prop="Location"
|
|
|
label="位置"
|
|
|
+ width="260"
|
|
|
>
|
|
|
<template slot-scope="scope">
|
|
|
<el-tooltip class="item" effect="dark" :content="scope.row.Location" placement="top-start">
|
|
|
<span>
|
|
|
- {{ scope.row.Location.length > 12 ? scope.row.Location.substr(0,12)+'...' : scope.row.Location }}
|
|
|
+ {{ scope.row.Location.length > 22 ? scope.row.Location.substr(0,22)+'...' : scope.row.Location }}
|
|
|
</span>
|
|
|
</el-tooltip>
|
|
|
</template>
|
|
|
@@ -107,6 +115,8 @@
|
|
|
<span v-if="scope.row.Status == 0">已禁用</span>
|
|
|
<span v-if="scope.row.Status == 1">已启用</span>
|
|
|
<span v-if="scope.row.Status == 2">已离线</span>
|
|
|
+ <span v-if="scope.row.Status == 3">已返厂</span>
|
|
|
+ <span v-if="scope.row.Status == 4">已离线</span>
|
|
|
</template>
|
|
|
</el-table-column>
|
|
|
<el-table-column
|
|
|
@@ -147,38 +157,39 @@
|
|
|
<label>
|
|
|
MAC地址*
|
|
|
</label>
|
|
|
- <el-input v-model="dialog.mac" @keyup.native="autoCompleteMac"></el-input>
|
|
|
+ <el-input v-model="dialog.mac" @keyup.native="autoCompleteMac"
|
|
|
+ :disabled="dialog_type == 2"></el-input>
|
|
|
</el-col>
|
|
|
<el-col :span="12">
|
|
|
<label>
|
|
|
标签名*
|
|
|
</label>
|
|
|
- <el-input v-model="dialog.tagname "></el-input>
|
|
|
- </el-col>
|
|
|
- <el-col :span="12">
|
|
|
- <label>
|
|
|
- 硬件版本
|
|
|
- </label>
|
|
|
- <el-input v-model="dialog.HardwareVersion "></el-input>
|
|
|
- </el-col>
|
|
|
- <el-col :span="12">
|
|
|
- <label>
|
|
|
- esp固件版本
|
|
|
- </label>
|
|
|
- <el-input v-model="dialog.FirmwareVersion "></el-input>
|
|
|
- </el-col>
|
|
|
- <el-col :span="12">
|
|
|
- <label>
|
|
|
- M4固件版本
|
|
|
- </label>
|
|
|
- <el-input v-model="dialog.FirmwareScanM4Version "></el-input>
|
|
|
- </el-col>
|
|
|
- <el-col :span="12">
|
|
|
- <label>
|
|
|
- M0固件版本
|
|
|
- </label>
|
|
|
- <el-input v-model="dialog.FirmwareScanM0Version "></el-input>
|
|
|
+ <el-input v-model="dialog.tagname"></el-input>
|
|
|
</el-col>
|
|
|
+ <!--<el-col :span="12">-->
|
|
|
+ <!--<label>-->
|
|
|
+ <!--硬件版本-->
|
|
|
+ <!--</label>-->
|
|
|
+ <!--<el-input v-model="dialog.HardwareVersion"></el-input>-->
|
|
|
+ <!--</el-col>-->
|
|
|
+ <!--<el-col :span="12">-->
|
|
|
+ <!--<label>-->
|
|
|
+ <!--esp固件版本-->
|
|
|
+ <!--</label>-->
|
|
|
+ <!--<el-input v-model="dialog.FirmwareVersion"></el-input>-->
|
|
|
+ <!--</el-col>-->
|
|
|
+ <!--<el-col :span="12">-->
|
|
|
+ <!--<label>-->
|
|
|
+ <!--M4固件版本-->
|
|
|
+ <!--</label>-->
|
|
|
+ <!--<el-input v-model="dialog.FirmwareScanM4Version"></el-input>-->
|
|
|
+ <!--</el-col>-->
|
|
|
+ <!--<el-col :span="12">-->
|
|
|
+ <!--<label>-->
|
|
|
+ <!--M0固件版本-->
|
|
|
+ <!--</label>-->
|
|
|
+ <!--<el-input v-model="dialog.FirmwareScanM0Version"></el-input>-->
|
|
|
+ <!--</el-col>-->
|
|
|
<el-col :span="12">
|
|
|
<label>
|
|
|
购买来源
|
|
|
@@ -189,7 +200,7 @@
|
|
|
<label>
|
|
|
设备所属区域
|
|
|
</label>
|
|
|
- <el-select class="selectStyle" ref="regionlevelOne" v-model="dialog.regionlevelOneId"
|
|
|
+ <el-select class="selectStyle" ref="regionlevelOne" v-model="dialog.regionId"
|
|
|
placeholder="请选择所属区域">
|
|
|
<el-option
|
|
|
v-for="item in dialog.regionlevelOneIdOptions"
|
|
|
@@ -200,20 +211,6 @@
|
|
|
</el-option>
|
|
|
</el-select>
|
|
|
</el-col>
|
|
|
- <el-col :span="12">
|
|
|
- <label>
|
|
|
- 设备所属房间
|
|
|
- </label>
|
|
|
- <el-select class="selectStyle" v-model="dialog.regionId" placeholder="请选择所属房间">
|
|
|
- <el-option
|
|
|
- v-for="item in dialog.regionIdRoomOptions"
|
|
|
- :key="item.Id"
|
|
|
- :label="item.Name"
|
|
|
- :value="item.Id"
|
|
|
- >
|
|
|
- </el-option>
|
|
|
- </el-select>
|
|
|
- </el-col>
|
|
|
<el-col :span="12">
|
|
|
<label>
|
|
|
坐标说明
|
|
|
@@ -224,7 +221,7 @@
|
|
|
<label>
|
|
|
备注
|
|
|
</label>
|
|
|
- <el-input type="textarea" v-model="dialog.memo"></el-input>
|
|
|
+ <el-input v-model="dialog.memo"></el-input>
|
|
|
</el-col>
|
|
|
<el-col :span="24">
|
|
|
<label>
|
|
|
@@ -255,6 +252,7 @@
|
|
|
DetectorAdd,
|
|
|
DetectorEdit,
|
|
|
GetDetectorCoords,
|
|
|
+ GeFullRegionSelect,
|
|
|
} from '../api/getApiRes.js'
|
|
|
|
|
|
let qs = require('qs');
|
|
|
@@ -277,6 +275,7 @@
|
|
|
FirmwareVersion: '',
|
|
|
FirmwareScanM4Version: '',
|
|
|
FirmwareScanM0Version: '',
|
|
|
+ purchasesrc: '',
|
|
|
location: '',
|
|
|
coords_memo: '',
|
|
|
memo: '',
|
|
|
@@ -329,19 +328,19 @@
|
|
|
}
|
|
|
},
|
|
|
mounted() {
|
|
|
- if(this.$route.query.RegionId){
|
|
|
+ if (this.$route.query.RegionId) {
|
|
|
this.panel.regionid = this.$route.query.RegionId;
|
|
|
this.panel.tagname = this.$route.query.TagName;
|
|
|
}
|
|
|
|
|
|
-
|
|
|
this.getTableQuery();
|
|
|
},
|
|
|
methods: {
|
|
|
// 页面数据查询
|
|
|
getTableQuery() {
|
|
|
let that = this;
|
|
|
- this.getGetChildRegionSelect(0, 1);
|
|
|
+ // this.getGetChildRegionSelect(0, 1);
|
|
|
+ this.getGeFullRegionSelect();
|
|
|
that.loading = true;
|
|
|
// 查询检测设备。上级区域id,区域id必传。regionid传0,查询supregionid对应所有子区域的检测设备。 如果supregionid,regionid都传0,默认查询企业ID下所有检测设备
|
|
|
let param = {
|
|
|
@@ -351,7 +350,7 @@
|
|
|
comid: 1,//
|
|
|
tagname: that.panel.tagname,//标签名
|
|
|
start: 1,//
|
|
|
- tableMax: 300,//
|
|
|
+ tableMax: 9999,//
|
|
|
};
|
|
|
let postdata = qs.stringify(param);
|
|
|
DetectorQuery(postdata).then(res => {
|
|
|
@@ -374,29 +373,38 @@
|
|
|
})
|
|
|
},
|
|
|
// 获取下级列表
|
|
|
- getGetChildRegionSelect(regionId, level) {
|
|
|
+ getGeFullRegionSelect() {
|
|
|
let that = this;
|
|
|
let param = {
|
|
|
token: localStorage.token,
|
|
|
- regionId: regionId,
|
|
|
};
|
|
|
let postdata = qs.stringify(param);
|
|
|
- GetChildRegionSelect(postdata).then(res => {
|
|
|
+ GeFullRegionSelect(postdata).then(res => {
|
|
|
let json = res;
|
|
|
if (json.Code == 0) {
|
|
|
- if (level == 1) {
|
|
|
- that.panel.regionidOptions = json.Rs;
|
|
|
- that.panel.regionidOptions.unshift({Id: 0, Name: "全部"});
|
|
|
- } else {
|
|
|
- if (json.Rs) {
|
|
|
- that.panel.regionidOptions2 = json.Rs;
|
|
|
- that.panel.regionid2 = json.Rs[0].Id;
|
|
|
- } else {
|
|
|
- that.panel.regionidOptions2 = [];
|
|
|
- that.panel.regionid2 = '';
|
|
|
- }
|
|
|
-
|
|
|
+ if (!json.Rs) {
|
|
|
+ that.$message.error('区域列表为空,请先添加有效区域');
|
|
|
+ return false
|
|
|
}
|
|
|
+ that.panel.regionidOptions = json.Rs;
|
|
|
+ that.panel.regionidOptions.unshift({Id: 0, Name: "全部", DisplayName: "全部"});
|
|
|
+ } else {
|
|
|
+ that.$message.error(json.Memo);
|
|
|
+ }
|
|
|
+ })
|
|
|
+ },
|
|
|
+ // dialog获取下级列表
|
|
|
+ dialoggetGeFullRegionSelect() {
|
|
|
+ let that = this;
|
|
|
+ let param = {
|
|
|
+ token: localStorage.token,
|
|
|
+ };
|
|
|
+ let postdata = qs.stringify(param);
|
|
|
+ GeFullRegionSelect(postdata).then(res => {
|
|
|
+ let json = res;
|
|
|
+ if (json.Code == 0) {
|
|
|
+ that.dialog.regionlevelOneIdOptions = json.Rs;
|
|
|
+ that.dialog.regionId = json.Rs[0].Id;
|
|
|
} else {
|
|
|
that.$message.error(json.Memo);
|
|
|
}
|
|
|
@@ -493,6 +501,10 @@
|
|
|
this.dialog_state = true;
|
|
|
this.dialog_title = '添加设备';
|
|
|
this.dialog_type = 1;
|
|
|
+
|
|
|
+ // 重载地区列表
|
|
|
+ this.getGeFullRegionSelect();
|
|
|
+
|
|
|
// clear dialog
|
|
|
this.dialog.mac = '';
|
|
|
this.dialog.regionId = '';
|
|
|
@@ -508,7 +520,8 @@
|
|
|
this.dialog.points = [{}];
|
|
|
|
|
|
// 加载默认的平面图
|
|
|
- this.dialogGetGetChildRegionSelect(0, 1);
|
|
|
+ // this.dialogGetGetChildRegionSelect(0, 1);
|
|
|
+ this.dialoggetGeFullRegionSelect()
|
|
|
},
|
|
|
delList() {
|
|
|
let that = this;
|
|
|
@@ -590,11 +603,13 @@
|
|
|
this.dialog.FirmwareVersion = row.FirmwareVersion;
|
|
|
this.dialog.FirmwareScanM4Version = row.FirmwareScanM4Version;
|
|
|
this.dialog.FirmwareScanM0Version = row.FirmwareScanM0Version;
|
|
|
- this.dialog.location = row.location;
|
|
|
- this.dialog.purchasesrc = row.purchasesrc;
|
|
|
- this.dialog.memo = row.memo;
|
|
|
- this.dialog.coords_memo = row.coords_memo;
|
|
|
+ this.dialog.location = row.Location;
|
|
|
+ this.dialog.purchasesrc = row.PurchaseSrc;
|
|
|
+ this.dialog.memo = row.Memo;
|
|
|
+ // this.dialog.coords_memo = row.coords_memo;
|
|
|
|
|
|
+ // 重载地区列表
|
|
|
+ this.getGeFullRegionSelect();
|
|
|
let param = {
|
|
|
token: localStorage.token,
|
|
|
detectorId: row.Id,
|
|
|
@@ -603,11 +618,12 @@
|
|
|
GetDetectorCoords(postdata).then(res => {
|
|
|
let json = res;
|
|
|
if (json.Code == 0) {
|
|
|
- if(json.Rs.length != 0){
|
|
|
- console.log(json.Rs);
|
|
|
+ if (json.Rs.length != 0) {
|
|
|
+ console.log(json.Rs[0]);
|
|
|
that.dialog.points = [{x: json.Rs[0].Width, y: json.Rs[0].Height}];
|
|
|
that.dialog.CoordsId = json.Rs[0].CoordsId;
|
|
|
- }else{
|
|
|
+ that.dialog.coords_memo = json.Rs[0].Memo;
|
|
|
+ } else {
|
|
|
that.dialog.points = [{x: 0, y: 0}];
|
|
|
that.dialog.CoordsId = 0;
|
|
|
}
|
|
|
@@ -622,6 +638,9 @@
|
|
|
if (text.length == 2 || text.length == 5 || text.length == 8 || text.length == 11 || text.length == 14) {
|
|
|
this.dialog.mac = this.dialog.mac.toUpperCase() + ":"
|
|
|
}
|
|
|
+ if (text.length > 14) {
|
|
|
+ this.dialog.mac = this.dialog.mac.toUpperCase()
|
|
|
+ }
|
|
|
},
|
|
|
// 探测记录
|
|
|
goPhoneRecord(row) {
|
|
|
@@ -730,6 +749,7 @@
|
|
|
this.$message.error('错了哦,mac格式不正确');
|
|
|
return false
|
|
|
}
|
|
|
+
|
|
|
if (!that.dialog.regionId) {
|
|
|
this.$message.error('错了哦,所属区域不能为空');
|
|
|
return false
|
|
|
@@ -827,6 +847,7 @@
|
|
|
let param = {
|
|
|
token: localStorage.token,
|
|
|
regionID: regionID,
|
|
|
+ regionId: regionID,
|
|
|
};
|
|
|
let postdata = qs.stringify(param);
|
|
|
RegionPictureGetByRegionId(postdata).then(res => {
|
|
|
@@ -874,12 +895,13 @@
|
|
|
}
|
|
|
},
|
|
|
watch: {
|
|
|
- 'dialog.regionlevelOneId': function (val) {
|
|
|
- this.dialogGetGetChildRegionSelect(val, 2)
|
|
|
- },
|
|
|
+ // 'dialog.regionlevelOneId': function (val) {
|
|
|
+ // this.dialogGetGetChildRegionSelect(val, 2)
|
|
|
+ // },
|
|
|
'dialog.regionId': function (val) {
|
|
|
- this.getRegionPictureGetByRegionId(val);
|
|
|
-
|
|
|
+ if (val) {
|
|
|
+ this.getRegionPictureGetByRegionId(val);
|
|
|
+ }
|
|
|
},
|
|
|
},
|
|
|
components: {
|
|
|
@@ -905,7 +927,11 @@
|
|
|
}
|
|
|
|
|
|
.content {
|
|
|
- padding-left: 10px;
|
|
|
+ width: 98%;
|
|
|
+ overflow: hidden;
|
|
|
+ display: block;
|
|
|
+ margin: 0 auto;
|
|
|
+ padding-left: 20px;
|
|
|
}
|
|
|
|
|
|
.selectStyle {
|
|
|
@@ -958,11 +984,19 @@
|
|
|
}
|
|
|
|
|
|
/deep/ .modal-dialog {
|
|
|
- height: 880px;
|
|
|
- margin-top: 0;
|
|
|
+ height: 680px;
|
|
|
+ margin-top: 20px;
|
|
|
}
|
|
|
|
|
|
/deep/ textarea {
|
|
|
color: #6DC1FF;
|
|
|
}
|
|
|
+
|
|
|
+ /deep/ .el-table__empty-text {
|
|
|
+ color: #015B9E;
|
|
|
+ }
|
|
|
+
|
|
|
+ /deep/ .el-input.is-disabled .el-input__inner {
|
|
|
+ background-color: #015B9E;
|
|
|
+ }
|
|
|
</style>
|