|
@@ -182,24 +182,24 @@
|
|
/>
|
|
/>
|
|
</el-select>
|
|
</el-select>
|
|
</el-form-item>
|
|
</el-form-item>
|
|
- <el-form-item label="状态" prop="state">
|
|
|
|
- <el-radio-group v-model="dialogForm.state">
|
|
|
|
- <el-radio :label="true" style="margin-left:20px;">启用</el-radio>
|
|
|
|
- <el-radio :label="false">禁用</el-radio>
|
|
|
|
- </el-radio-group>
|
|
|
|
- </el-form-item>
|
|
|
|
- <el-form-item label="参数 A" prop="reservedOne">
|
|
|
|
- <el-input v-model="dialogForm.reservedOne" placeholder="请输入名称"
|
|
|
|
|
|
+ <el-form-item :label="reservedNameOne" prop="reservedOne" v-if="reservedTypeOne">
|
|
|
|
+ <el-input v-model="dialogForm.reservedOne" :placeholder="'请输入'+reservedNameOne"
|
|
maxLength="10" style="width:320px;"/>
|
|
maxLength="10" style="width:320px;"/>
|
|
</el-form-item>
|
|
</el-form-item>
|
|
- <el-form-item label="参数 B" prop="reservedTwo">
|
|
|
|
- <el-input v-model="dialogForm.reservedTwo" placeholder="请输入名称"
|
|
|
|
|
|
+ <el-form-item :label="reservedNameTwo" prop="reservedTwo" v-if="reservedTypeTwo">
|
|
|
|
+ <el-input v-model="dialogForm.reservedTwo" :placeholder="'请输入'+reservedNameTwo"
|
|
maxLength="10" style="width:320px;"/>
|
|
maxLength="10" style="width:320px;"/>
|
|
</el-form-item>
|
|
</el-form-item>
|
|
- <el-form-item label="参数 C" prop="reservedThree">
|
|
|
|
- <el-input v-model="dialogForm.reservedThree" placeholder="请输入名称"
|
|
|
|
|
|
+ <el-form-item :label="reservedNameThree" prop="reservedThree" v-if="reservedTypeThree">
|
|
|
|
+ <el-input v-model="dialogForm.reservedThree" :placeholder="'请输入'+reservedNameThree"
|
|
maxLength="10" style="width:320px;"/>
|
|
maxLength="10" style="width:320px;"/>
|
|
</el-form-item>
|
|
</el-form-item>
|
|
|
|
+ <el-form-item label="状态" prop="state">
|
|
|
|
+ <el-radio-group v-model="dialogForm.state">
|
|
|
|
+ <el-radio :label="true" style="margin-left:20px;">启用</el-radio>
|
|
|
|
+ <el-radio :label="false">禁用</el-radio>
|
|
|
|
+ </el-radio-group>
|
|
|
|
+ </el-form-item>
|
|
</el-form>
|
|
</el-form>
|
|
<div slot="footer" class="dialog-footer dialog-footer-box">
|
|
<div slot="footer" class="dialog-footer dialog-footer-box">
|
|
<p class="dialog-footer-button-null"></p>
|
|
<p class="dialog-footer-button-null"></p>
|
|
@@ -217,7 +217,8 @@
|
|
iotHardwareList,
|
|
iotHardwareList,
|
|
iotHardwareDelete,
|
|
iotHardwareDelete,
|
|
iotHardwareTypeFindHardwareType,
|
|
iotHardwareTypeFindHardwareType,
|
|
- iotDeviceFindByType
|
|
|
|
|
|
+ iotDeviceFindByType,
|
|
|
|
+ iotAttributeDetail
|
|
|
|
|
|
} from '@/api/iotDevice/index'
|
|
} from '@/api/iotDevice/index'
|
|
import { systemBuildingGetTreeList, laboratorySubRelInfoGetListByFloor } from '@/api/commonality/permission'
|
|
import { systemBuildingGetTreeList, laboratorySubRelInfoGetListByFloor } from '@/api/commonality/permission'
|
|
@@ -294,6 +295,18 @@
|
|
state: [
|
|
state: [
|
|
{ required: true, message: '请选择状态', trigger: 'blur' },
|
|
{ required: true, message: '请选择状态', trigger: 'blur' },
|
|
{ required: true, message: '请选择状态', validator: this.spaceJudgment, trigger: 'blur' }
|
|
{ required: true, message: '请选择状态', validator: this.spaceJudgment, trigger: 'blur' }
|
|
|
|
+ ],
|
|
|
|
+ reservedOne: [
|
|
|
|
+ { required: true, message: '请输入参数', trigger: 'blur' },
|
|
|
|
+ { required: true, message: '请输入参数', validator: this.spaceJudgment, trigger: 'blur' }
|
|
|
|
+ ],
|
|
|
|
+ reservedTwo: [
|
|
|
|
+ { required: true, message: '请输入参数', trigger: 'blur' },
|
|
|
|
+ { required: true, message: '请输入参数', validator: this.spaceJudgment, trigger: 'blur' }
|
|
|
|
+ ],
|
|
|
|
+ reservedThree: [
|
|
|
|
+ { required: true, message: '请输入参数', trigger: 'blur' },
|
|
|
|
+ { required: true, message: '请输入参数', validator: this.spaceJudgment, trigger: 'blur' }
|
|
]
|
|
]
|
|
},
|
|
},
|
|
//校区楼栋原始数据
|
|
//校区楼栋原始数据
|
|
@@ -306,6 +319,13 @@
|
|
subjectOption: [],
|
|
subjectOption: [],
|
|
//物联分类下拉列表
|
|
//物联分类下拉列表
|
|
iotTypeOptions:[],
|
|
iotTypeOptions:[],
|
|
|
|
+ //硬件参数数据
|
|
|
|
+ reservedNameOne:'',
|
|
|
|
+ reservedTypeOne:false,
|
|
|
|
+ reservedNameTwo:'',
|
|
|
|
+ reservedTypeTwo:false,
|
|
|
|
+ reservedNameThree:'',
|
|
|
|
+ reservedTypeThree:false,
|
|
}
|
|
}
|
|
},
|
|
},
|
|
created() {
|
|
created() {
|
|
@@ -368,9 +388,44 @@
|
|
this.relayList.forEach((item) => {
|
|
this.relayList.forEach((item) => {
|
|
if(val == item.id){
|
|
if(val == item.id){
|
|
self.$set(self.dialogForm, 'deviceNo', item.deviceNo)
|
|
self.$set(self.dialogForm, 'deviceNo', item.deviceNo)
|
|
|
|
+ self.$set(self.dialogForm, 'attributeId', item.attributeId)
|
|
|
|
+ this.iotAttributeDetail(item.attributeId);
|
|
}
|
|
}
|
|
});
|
|
});
|
|
},
|
|
},
|
|
|
|
+ //查询物联分类属性详情
|
|
|
|
+ iotAttributeDetail(attributeId){
|
|
|
|
+ iotAttributeDetail({id:attributeId}).then(response => {
|
|
|
|
+ let list = response.data.relateField?JSON.parse(response.data.relateField):[];
|
|
|
|
+ list.forEach((item,index)=>{
|
|
|
|
+ if(index == 0){
|
|
|
|
+ if(item.state){
|
|
|
|
+ this.$set(this, 'reservedNameOne', item.relateFieldName)
|
|
|
|
+ this.$set(this, 'reservedTypeOne', true)
|
|
|
|
+ }else{
|
|
|
|
+ this.$set(this, 'reservedNameOne', '')
|
|
|
|
+ this.$set(this, 'reservedTypeOne', false)
|
|
|
|
+ }
|
|
|
|
+ }else if(index == 1){
|
|
|
|
+ if(item.state){
|
|
|
|
+ this.$set(this, 'reservedNameTwo', item.relateFieldName)
|
|
|
|
+ this.$set(this, 'reservedTypeTwo', true)
|
|
|
|
+ }else{
|
|
|
|
+ this.$set(this, 'reservedNameTwo', '')
|
|
|
|
+ this.$set(this, 'reservedTypeTwo', false)
|
|
|
|
+ }
|
|
|
|
+ }else if(index == 2){
|
|
|
|
+ if(item.state){
|
|
|
|
+ this.$set(this, 'reservedNameThree', item.relateFieldName)
|
|
|
|
+ this.$set(this, 'reservedTypeThree', true)
|
|
|
|
+ }else{
|
|
|
|
+ this.$set(this, 'reservedNameThree', '')
|
|
|
|
+ this.$set(this, 'reservedTypeThree', false)
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ })
|
|
|
|
+ })
|
|
|
|
+ },
|
|
//根据类型查询物联设备
|
|
//根据类型查询物联设备
|
|
iotDeviceFindByType(val) {
|
|
iotDeviceFindByType(val) {
|
|
let obj = {
|
|
let obj = {
|
|
@@ -400,6 +455,7 @@
|
|
//编辑
|
|
//编辑
|
|
let obj = JSON.parse(JSON.stringify(row))
|
|
let obj = JSON.parse(JSON.stringify(row))
|
|
this.iotDeviceFindByType(row.deviceTypeKey)
|
|
this.iotDeviceFindByType(row.deviceTypeKey)
|
|
|
|
+ this.iotAttributeDetail(row.attributeId);
|
|
this.$set(this, 'dialogForm', obj)
|
|
this.$set(this, 'dialogForm', obj)
|
|
this.$set(this, 'dialogType', true)
|
|
this.$set(this, 'dialogType', true)
|
|
} else if (type == 4) {
|
|
} else if (type == 4) {
|
|
@@ -454,11 +510,18 @@
|
|
deviceTypeKey: '',
|
|
deviceTypeKey: '',
|
|
deviceId: '',
|
|
deviceId: '',
|
|
deviceNo: '',
|
|
deviceNo: '',
|
|
|
|
+ attributeId:'',
|
|
state: true,
|
|
state: true,
|
|
reservedOne:'',
|
|
reservedOne:'',
|
|
reservedTwo:'',
|
|
reservedTwo:'',
|
|
reservedThree:'',
|
|
reservedThree:'',
|
|
})
|
|
})
|
|
|
|
+ this.$set(this, 'reservedNameOne', '')
|
|
|
|
+ this.$set(this, 'reservedTypeOne', false)
|
|
|
|
+ this.$set(this, 'reservedNameTwo', '')
|
|
|
|
+ this.$set(this, 'reservedTypeTwo', false)
|
|
|
|
+ this.$set(this, 'reservedNameThree', '')
|
|
|
|
+ this.$set(this, 'reservedTypeThree', false)
|
|
this.$set(this, 'relayList', [])
|
|
this.$set(this, 'relayList', [])
|
|
this.$set(this, 'dialogType', true)
|
|
this.$set(this, 'dialogType', true)
|
|
},
|
|
},
|
|
@@ -476,10 +539,11 @@
|
|
deviceTypeKey: this.dialogForm.deviceTypeKey,
|
|
deviceTypeKey: this.dialogForm.deviceTypeKey,
|
|
deviceId: this.dialogForm.deviceId,
|
|
deviceId: this.dialogForm.deviceId,
|
|
deviceNo: this.dialogForm.deviceNo,
|
|
deviceNo: this.dialogForm.deviceNo,
|
|
|
|
+ attributeId: this.dialogForm.attributeId,
|
|
state: this.dialogForm.state,
|
|
state: this.dialogForm.state,
|
|
- reservedOne:this.dialogForm.reservedOne,
|
|
|
|
- reservedTwo:this.dialogForm.reservedTwo,
|
|
|
|
- reservedThree:this.dialogForm.reservedThree,
|
|
|
|
|
|
+ reservedOne:this.reservedTypeOne?this.dialogForm.reservedOne:'',
|
|
|
|
+ reservedTwo:this.reservedTypeTwo?this.dialogForm.reservedTwo:'',
|
|
|
|
+ reservedThree:this.reservedTypeThree?this.dialogForm.reservedThree:'',
|
|
}
|
|
}
|
|
if (this.dialogForm.id) {
|
|
if (this.dialogForm.id) {
|
|
iotHardwareUpdate(obj).then(response => {
|
|
iotHardwareUpdate(obj).then(response => {
|