|
@@ -71,29 +71,29 @@
|
|
|
@pagination="getList"
|
|
|
/>
|
|
|
<!-- 添加或修改传感器对话框 -->
|
|
|
- <el-dialog :title="title" :visible.sync="open" width="600px" append-to-body class="recognizer-dialog-box add-hardware-dialog-box">
|
|
|
- <el-form ref="form" :model="form" :rules="rules" >
|
|
|
+ <el-dialog :title="title" :visible.sync="open" width="600px" append-to-body class="recognizer add-hardware-dialog-box">
|
|
|
+ <el-form ref="form" :model="form" :rules="rules" :inline="true">
|
|
|
<el-form-item label="识别器编号" prop="hardwareNum">
|
|
|
- <el-input v-model="form.hardwareNum" placeholder="请输入识别器编号" />
|
|
|
+ <el-input v-model="form.hardwareNum" placeholder="请输入识别器编号" style="width: 400px"/>
|
|
|
</el-form-item>
|
|
|
<el-form-item label="IP地址" >
|
|
|
- <el-input v-model="form.ipAddress" placeholder="请输入IP地址" />
|
|
|
+ <el-input v-model="form.ipAddress" placeholder="请输入IP地址" style="width: 400px"/>
|
|
|
</el-form-item>
|
|
|
<el-form-item label="连接方式">
|
|
|
- <el-select v-model="form.manufacturerType" placeholder="请选择" style="width:320px;">
|
|
|
+ <el-select v-model="form.manufacturerType" placeholder="请选择" style="width:400px;" >
|
|
|
<el-option :label="item.dictLabel" :value="item.dictValue" v-for="(item,index) in materialTypeList" :key="index"></el-option>
|
|
|
</el-select>
|
|
|
</el-form-item>
|
|
|
|
|
|
<el-form-item label="推送频率" >
|
|
|
- <el-select v-model="form.sessionIndex" placeholder="请选择设备推送频率">
|
|
|
+ <el-select v-model="form.sessionIndex" placeholder="请选择设备推送频率" style="width:400px;">
|
|
|
<el-option label="最大" value="0"></el-option>
|
|
|
<el-option label="中等" value="1"></el-option>
|
|
|
<el-option label="最小" value="2"></el-option>
|
|
|
</el-select>
|
|
|
</el-form-item>
|
|
|
<el-form-item label="天线数量" >
|
|
|
- <el-select v-model="form.channels" placeholder="请选择信道数量" @change="antennaNumFun()">
|
|
|
+ <el-select v-model="form.channels" placeholder="请选择信道数量" @change="antennaNumFun()" style="width:400px;">
|
|
|
<el-option label="1" value="1"></el-option>
|
|
|
<el-option label="2" value="2"></el-option>
|
|
|
<el-option label="4" value="4"></el-option>
|
|
@@ -101,9 +101,28 @@
|
|
|
<el-option label="16" value="16"></el-option>
|
|
|
</el-select>
|
|
|
</el-form-item>
|
|
|
- <el-form-item :label="(index+1)+'号天线感应距离'" v-for="(item,index) in antennaNum" :key="index">
|
|
|
- <el-input-number v-model="uniformPower[index]" placeholder="请输入设备输出频率" />
|
|
|
- </el-form-item>
|
|
|
+ <el-row v-for="(item,index) in antennaNum" :key="index">
|
|
|
+ <el-col :span="12">
|
|
|
+ <el-form-item :label="(index+1)+'号天线感应距离'">
|
|
|
+ <el-input-number v-model="uniformPower[index]" placeholder="请输入设备输出频率" style="width:140px;"/>
|
|
|
+ </el-form-item>
|
|
|
+ </el-col>
|
|
|
+ <el-col :span="12">
|
|
|
+ <el-form-item :label="(index+1)+'号天线检测类型'">
|
|
|
+ <el-select v-model="detection[index]" placeholder="请选择检测类型" style="width:140px;">
|
|
|
+ <el-option
|
|
|
+ v-for="item in detectionArr"
|
|
|
+ :key="item.id"
|
|
|
+ :label="item.name"
|
|
|
+ :value="item.id">
|
|
|
+ </el-option>
|
|
|
+ </el-select>
|
|
|
+ </el-form-item>
|
|
|
+ </el-col>
|
|
|
+ </el-row>
|
|
|
+<!-- <el-form-item :label="(index+1)+'号天线感应距离'" v-for="(item,index) in antennaNum" :key="index">-->
|
|
|
+<!-- <el-input-number v-model="uniformPower[index]" placeholder="请输入设备输出频率" />-->
|
|
|
+<!-- </el-form-item>-->
|
|
|
|
|
|
<el-form-item label="所属实验室" prop="subjectId">
|
|
|
<el-select v-model="form.subjectId" placeholder="请选择实验室">
|
|
@@ -134,7 +153,7 @@ import {
|
|
|
recognizerDelete,
|
|
|
recognizerList,
|
|
|
recognizerSwitch,
|
|
|
- supplierStop, RFIDTypeList
|
|
|
+ supplierStop, RFIDTypeList, recognizerNettyFrid
|
|
|
} from '@/api/gasManage3_0/gasManage'
|
|
|
|
|
|
export default {
|
|
@@ -176,6 +195,8 @@ export default {
|
|
|
materialTypeList:[],
|
|
|
uniformPower:[20,20,20,20],
|
|
|
antennaNum:[1,2,3,4],//天线数量
|
|
|
+ detection:['0','0','0','0',],//检测类型选择的值
|
|
|
+ detectionArr:[],//检测类型数组
|
|
|
// 表单校验
|
|
|
rules: {
|
|
|
name:[
|
|
@@ -196,15 +217,18 @@ export default {
|
|
|
this.getList();
|
|
|
this.getSubjectAddDictList();
|
|
|
this.supplierTypeList();
|
|
|
+ this.recognizerNettyFrid();
|
|
|
},
|
|
|
methods: {
|
|
|
+ //根据选择的天线数量循环距离和检测类型
|
|
|
antennaNumFun(){
|
|
|
- console.log(this.uniformPower)
|
|
|
this.uniformPower=[];
|
|
|
this.antennaNum=[];
|
|
|
+ this.detection=[];
|
|
|
for(let i=0;i<this.form.channels;i++){
|
|
|
this.antennaNum.push(i)
|
|
|
this.uniformPower.push(20)
|
|
|
+ this.detection.push('0')
|
|
|
}
|
|
|
},
|
|
|
//供应商类型
|
|
@@ -259,6 +283,19 @@ export default {
|
|
|
this.loading = false;
|
|
|
});
|
|
|
},
|
|
|
+ //检测类型
|
|
|
+ recognizerNettyFrid(){
|
|
|
+ let _this=this;
|
|
|
+ recognizerNettyFrid().then(response => {
|
|
|
+ _this.detectionArr = []
|
|
|
+ response.data.forEach(function(item,index) {
|
|
|
+ for(let i in item){
|
|
|
+ console.log(item[i])
|
|
|
+ _this.detectionArr.push({'id':i,'name':item[i]})
|
|
|
+ }
|
|
|
+ })
|
|
|
+ });
|
|
|
+ },
|
|
|
// 取消按钮
|
|
|
cancel() {
|
|
|
this.open = false;
|
|
@@ -290,6 +327,9 @@ export default {
|
|
|
this.queryParams.searchValue = '';
|
|
|
this.handleQuery();
|
|
|
},
|
|
|
+
|
|
|
+
|
|
|
+ // 20:10,30:20
|
|
|
/** 新增按钮操作 */
|
|
|
handleAdd() {
|
|
|
this.reset();
|
|
@@ -297,7 +337,8 @@ export default {
|
|
|
this.open = true;
|
|
|
this.title = "新增识别器";
|
|
|
this.uniformPower=[20,20,20,20];
|
|
|
- this.antennaNum=[1,2,3,4]//天线数量
|
|
|
+ this.detection=['0','0','0','0']
|
|
|
+ this.antennaNum=[1,2,3,4]//天线数量
|
|
|
},
|
|
|
/** 修改按钮操作 */
|
|
|
handleUpdate(row) {
|
|
@@ -311,20 +352,32 @@ export default {
|
|
|
this.form.ipAddress=row.ipAddress
|
|
|
this.form.channels=row.channels+''
|
|
|
this.form.sessionIndex=row.sessionIndex+''
|
|
|
- this.uniformPower=row.uniformPower.split(',')//天线感应器数量
|
|
|
- this.form.uniformPower=row.uniformPower
|
|
|
this.form.manufacturerType=row.manufacturerType
|
|
|
console.log( this.uniformPower.length)
|
|
|
this.antennaNum=[];
|
|
|
- for(let i=0;i<this.uniformPower.length;i++){
|
|
|
+ //天线感应距离和检测类型编辑
|
|
|
+ let arr=[]
|
|
|
+ this.form.uniformPower=row.uniformPower//天线感应距离和检测类型
|
|
|
+ //this.uniformPower=row.uniformPower.split(',')
|
|
|
+ arr=row.uniformPower.split(',')
|
|
|
+ for(let i in arr){
|
|
|
this.antennaNum.push(i)
|
|
|
+ this.detection.push(arr[i])
|
|
|
}
|
|
|
},
|
|
|
/** 提交按钮 */
|
|
|
submitForm() {
|
|
|
this.$refs["form"].validate(valid => {
|
|
|
if (valid) {
|
|
|
- this.form.uniformPower=this.uniformPower.join(',')
|
|
|
+ //this.form.uniformPower=this.uniformPower.join(',')
|
|
|
+
|
|
|
+ let uniformArr=[]
|
|
|
+ for(let i=0;i<this.uniformPower.length;i++){
|
|
|
+ uniformArr.push(this.uniformPower[i]+':'+this.detection[i])
|
|
|
+ }
|
|
|
+ this.form.uniformPower=uniformArr.join(',')
|
|
|
+ console.log(uniformArr.join(','))
|
|
|
+
|
|
|
this.form.channels=Number(this.form.channels)
|
|
|
this.form.sessionIndex=Number(this.form.sessionIndex)
|
|
|
|
|
@@ -391,5 +444,22 @@ export default {
|
|
|
left: 21%!important;
|
|
|
}
|
|
|
}
|
|
|
+.recognizer{
|
|
|
+ .el-form-item__label{
|
|
|
+ width:130px!important;
|
|
|
+ }
|
|
|
+ //.el-input--suffix{
|
|
|
+ // width:340px!important;
|
|
|
+ //}
|
|
|
+ //.el-input__inner{
|
|
|
+ // width:340px!important;
|
|
|
+ //}
|
|
|
+ //.el-input--medium{
|
|
|
+ // width:340px!important;
|
|
|
+ //}
|
|
|
+ //.el-input-number--medium{
|
|
|
+ // width:240px!important;
|
|
|
+ //}
|
|
|
+}
|
|
|
</style>
|
|
|
|