|
@@ -43,7 +43,7 @@
|
|
|
</el-form-item>
|
|
|
</el-row>
|
|
|
|
|
|
- <el-row style="margin-left: 14px">
|
|
|
+ <el-row style="margin-left: 30px">
|
|
|
<el-form-item label="变量Id" prop="variableId">
|
|
|
<el-input v-model="formData.variableId"></el-input>
|
|
|
</el-form-item>
|
|
@@ -53,6 +53,41 @@
|
|
|
</el-row>
|
|
|
</el-form>
|
|
|
|
|
|
+ <el-row>
|
|
|
+ <el-form-item label="运营商编号" prop="operatorNumber">
|
|
|
+ <el-select v-model="formData.operatorNumber" placeholder="运营商编号" style="width: 202px"
|
|
|
+ clearable>
|
|
|
+ <el-option :value="i.number" v-for="(i,index) in operators" :key="index"
|
|
|
+ :label="i.number"></el-option>
|
|
|
+ </el-select>
|
|
|
+ </el-form-item>
|
|
|
+
|
|
|
+ <el-form-item label="项目编号" prop="projectNumber">
|
|
|
+ <el-select v-model="formData.projectNumber" placeholder="项目编号" style="width: 202px"
|
|
|
+ :disabled="!formData.operatorNumber" clearable>
|
|
|
+ <el-option :value="i.number" v-for="(i,index) in projects" :key="index"
|
|
|
+ :label="i.number"></el-option>
|
|
|
+ </el-select>
|
|
|
+ </el-form-item>
|
|
|
+ </el-row>
|
|
|
+
|
|
|
+ <el-row style="margin-left: 14px">
|
|
|
+ <el-form-item label="网关编号" prop="gatewayNumber" style="margin-right: 22px">
|
|
|
+ <el-select v-model="formData.gatewayNumber" placeholder="网关编号" style="width: 202px"
|
|
|
+ :disabled="!formData.projectNumber" clearable>
|
|
|
+ <el-option :value="i.number" v-for="(i,index) in gateways" :key="index"
|
|
|
+ :label="i.number"></el-option>
|
|
|
+ </el-select>
|
|
|
+ </el-form-item>
|
|
|
+ <el-form-item label="设备sn" prop="sn">
|
|
|
+ <el-select v-model="formData.sn" placeholder="设备sn" style="width: 202px"
|
|
|
+ :disabled="!formData.gatewayNumber" clearable>
|
|
|
+ <el-option :value="i.sn" v-for="(i,index) in devices" :key="index"
|
|
|
+ :label="i.sn"></el-option>
|
|
|
+ </el-select>
|
|
|
+ </el-form-item>
|
|
|
+ </el-row>
|
|
|
+
|
|
|
<div slot="footer" class="dialog-footer" style="text-align: center">
|
|
|
<el-button @click="cancel()">取 消</el-button>
|
|
|
<el-button type="primary" @click="addOrEditMehtond()">确 定</el-button>
|
|
@@ -64,6 +99,7 @@
|
|
|
|
|
|
<el-table :data="tableData">
|
|
|
<el-table-column type="selection"></el-table-column>
|
|
|
+ <el-table-column prop="sn" label="设备sn"></el-table-column>
|
|
|
<el-table-column prop="alarmName" label="报警名称"></el-table-column>
|
|
|
<el-table-column prop="alarmType" label="报警类型"></el-table-column>
|
|
|
<el-table-column prop="variableId" label="变量Id"></el-table-column>
|
|
@@ -103,6 +139,10 @@ export default {
|
|
|
name: 'deviceAlarmConfig',
|
|
|
data() {
|
|
|
return {
|
|
|
+ gateways: [],
|
|
|
+ projects: [],
|
|
|
+ operators: [],
|
|
|
+ devices: [],
|
|
|
|
|
|
api: {
|
|
|
list: this.$api.deviceAlarmConfig.list,
|
|
@@ -128,14 +168,20 @@ export default {
|
|
|
alarmName: '',
|
|
|
alarmType: '',
|
|
|
condition: '',
|
|
|
- variableId: ''
|
|
|
+ variableId: '',
|
|
|
+ sn: '',
|
|
|
}],
|
|
|
|
|
|
formData: {
|
|
|
alarmName: '',
|
|
|
alarmType: '',
|
|
|
condition: '',
|
|
|
- variableId: ''
|
|
|
+ variableId: '',
|
|
|
+
|
|
|
+ sn: '',
|
|
|
+ operatorNumber: '',
|
|
|
+ projectNumber: '',
|
|
|
+ gatewayNumber: ''
|
|
|
},
|
|
|
|
|
|
searchFormData:
|
|
@@ -150,8 +196,106 @@ export default {
|
|
|
|
|
|
created: function () {
|
|
|
this.loadData();
|
|
|
+ this.getOperator();
|
|
|
},
|
|
|
|
|
|
+ watch: {
|
|
|
+
|
|
|
+ 'searchFormData.operatorNumber'(oldValue, newValue) {
|
|
|
+
|
|
|
+ console.log(oldValue)
|
|
|
+ console.log(newValue)
|
|
|
+
|
|
|
+ this.searchFormData.projectNumber = ''
|
|
|
+
|
|
|
+ this.operatorProject = oldValue;
|
|
|
+
|
|
|
+ console.log(this.operatorProject)
|
|
|
+
|
|
|
+ this.getProjectNumber();
|
|
|
+ },
|
|
|
+
|
|
|
+ 'searchFormData.projectNumber'(oldValue, newValue) {
|
|
|
+
|
|
|
+ console.log(oldValue)
|
|
|
+ console.log(newValue)
|
|
|
+
|
|
|
+ this.searchFormData.gatewayNumber = ''
|
|
|
+
|
|
|
+ this.projectGateway = oldValue;
|
|
|
+
|
|
|
+ console.log(this.projectGateway)
|
|
|
+
|
|
|
+ this.getGateway();
|
|
|
+ },
|
|
|
+ 'searchFormData.gatewayNumber'(oldValue, newValue) {
|
|
|
+
|
|
|
+ console.log(oldValue)
|
|
|
+ console.log(newValue)
|
|
|
+
|
|
|
+ this.searchFormData.sn = ''
|
|
|
+
|
|
|
+ this.gatewayDevice = oldValue;
|
|
|
+
|
|
|
+ console.log(this.gatewayDevice)
|
|
|
+
|
|
|
+ this.getDevice();
|
|
|
+ },
|
|
|
+
|
|
|
+
|
|
|
+ 'formData.operatorNumber'(oldValue, newValue) {
|
|
|
+
|
|
|
+ console.log(oldValue)
|
|
|
+ console.log(newValue)
|
|
|
+
|
|
|
+
|
|
|
+ if (newValue == '') {
|
|
|
+ this.operatorProject = oldValue;
|
|
|
+ } else {
|
|
|
+ this.operatorProject = oldValue;
|
|
|
+ this.formData.projectNumber = ''
|
|
|
+ }
|
|
|
+
|
|
|
+ console.log(this.operatorProject)
|
|
|
+
|
|
|
+ this.getProjectNumber();
|
|
|
+ },
|
|
|
+
|
|
|
+ 'formData.projectNumber'(oldValue, newValue) {
|
|
|
+
|
|
|
+ console.log(oldValue)
|
|
|
+ console.log(newValue)
|
|
|
+
|
|
|
+
|
|
|
+ if (newValue == '') {
|
|
|
+ this.projectGateway = oldValue;
|
|
|
+ } else {
|
|
|
+ this.projectGateway = oldValue;
|
|
|
+ this.formData.gatewayNumber = ''
|
|
|
+ }
|
|
|
+
|
|
|
+ console.log(this.projectGateway)
|
|
|
+
|
|
|
+ this.getGateway();
|
|
|
+ },
|
|
|
+
|
|
|
+ 'formData.gatewayNumber'(oldValue, newValue) {
|
|
|
+
|
|
|
+ console.log(oldValue)
|
|
|
+ console.log(newValue)
|
|
|
+
|
|
|
+ if (newValue == '') {
|
|
|
+ this.gatewayDevice = oldValue;
|
|
|
+ } else {
|
|
|
+ this.gatewayDevice = oldValue;
|
|
|
+ this.formData.sn = ''
|
|
|
+ }
|
|
|
+
|
|
|
+ console.log(this.gatewayDevice)
|
|
|
+
|
|
|
+ this.getDevice();
|
|
|
+ }
|
|
|
+ },
|
|
|
|
|
|
methods: {
|
|
|
//切换页码
|
|
@@ -159,6 +303,49 @@ export default {
|
|
|
this.loadData(index)
|
|
|
},
|
|
|
|
|
|
+ getOperator() {
|
|
|
+ const vm = this;
|
|
|
+ vm.$http.get(vm.$api.operator.list).then((resp) => {
|
|
|
+ vm.operators = resp.data.data.operators
|
|
|
+ })
|
|
|
+ },
|
|
|
+
|
|
|
+ getProjectNumber() {
|
|
|
+ const vm = this;
|
|
|
+ vm.$http.get(vm.$api.project.list, {
|
|
|
+ params: {
|
|
|
+ operatorNumber: this.operatorProject,
|
|
|
+ }
|
|
|
+ }).then((resp) => {
|
|
|
+ console.log(resp.data.data.projects)
|
|
|
+ vm.projects = resp.data.data.projects
|
|
|
+ })
|
|
|
+ },
|
|
|
+
|
|
|
+ getGateway() {
|
|
|
+ const vm = this;
|
|
|
+ vm.$http.get(vm.$api.gateway.list, {
|
|
|
+ params: {
|
|
|
+ projectNumber: this.projectGateway,
|
|
|
+ }
|
|
|
+ }).then((resp) => {
|
|
|
+ console.log(resp.data.data.gateways)
|
|
|
+ vm.gateways = resp.data.data.gateways
|
|
|
+ })
|
|
|
+ },
|
|
|
+
|
|
|
+ getDevice() {
|
|
|
+ const vm = this;
|
|
|
+ vm.$http.get(vm.$api.device.list, {
|
|
|
+ params: {
|
|
|
+ gatewayNumber: this.gatewayDevice,
|
|
|
+ }
|
|
|
+ }).then((resp) => {
|
|
|
+ console.log(resp.data.data.devices)
|
|
|
+ vm.devices = resp.data.data.devices
|
|
|
+ })
|
|
|
+ },
|
|
|
+
|
|
|
loadData(index) {
|
|
|
const vm = this;
|
|
|
vm.$http.get(vm.api.list, {
|
|
@@ -191,8 +378,11 @@ export default {
|
|
|
this.formData.alarmName = '',
|
|
|
this.formData.alarmType = '',
|
|
|
this.formData.variableId = '',
|
|
|
- this.formData.condition = ''
|
|
|
-
|
|
|
+ this.formData.condition = '',
|
|
|
+ this.formData.operatorNumber = '',
|
|
|
+ this.formData.projectNumber = '',
|
|
|
+ this.formData.gatewayNumber = '',
|
|
|
+ this.formData.sn = ''
|
|
|
},
|
|
|
|
|
|
showEdit(row) {
|
|
@@ -214,10 +404,21 @@ export default {
|
|
|
vm.$http.get(vm.api.update, {
|
|
|
params: {
|
|
|
code: this.editRow.code,
|
|
|
+
|
|
|
alarmName: this.formData.alarmName,
|
|
|
alarmType: this.formData.alarmType,
|
|
|
variableId: this.formData.variableId,
|
|
|
configCondition: this.formData.condition,
|
|
|
+ sn: this.formData.sn,
|
|
|
+
|
|
|
+ operatorNumber: this.formData.operatorNumber,
|
|
|
+ projectNumber: this.formData.projectNumber ,
|
|
|
+ gatewayNumber: this.formData.gatewayNumber,
|
|
|
+
|
|
|
+ deviceCode: this.editRow.deviceCode,
|
|
|
+ operatorCode: this.editRow.operatorCode,
|
|
|
+ projectCode: this.editRow.projectCode,
|
|
|
+ gatewayCode: this.editRow.gatewayCode,
|
|
|
}
|
|
|
})
|
|
|
.then((response) => {
|
|
@@ -248,6 +449,10 @@ export default {
|
|
|
alarmType: this.formData.alarmType,
|
|
|
variableId: this.formData.variableId,
|
|
|
configCondition: this.formData.condition,
|
|
|
+ operatorNumber: this.formData.operatorNumber,
|
|
|
+ projectNumber: this.formData.projectNumber,
|
|
|
+ gatewayNumber: this.formData.gatewayNumber,
|
|
|
+ sn: this.formData.sn,
|
|
|
}
|
|
|
})
|
|
|
.then((response) => {
|
|
@@ -305,6 +510,10 @@ export default {
|
|
|
showClose: true,
|
|
|
type: 'info'
|
|
|
});
|
|
|
+ this.formData.operatorNumber = '';
|
|
|
+ this.formData.projectNumber = '';
|
|
|
+ this.formData.gatewayNumber = '';
|
|
|
+ this.formData.sn = '';
|
|
|
|
|
|
this.dialogFormVisible = false;
|
|
|
},
|