|
@@ -4,7 +4,7 @@
|
|
|
|
|
|
<el-main>
|
|
<el-main>
|
|
<div style="margin-bottom: 10px">
|
|
<div style="margin-bottom: 10px">
|
|
- <el-button size="medium" icon="el-icon-back" type="text">返回</el-button>
|
|
|
|
|
|
+ <el-button size="medium" icon="el-icon-back" type="text" @click="back">返回</el-button>
|
|
<span style="margin-left: 20px; font-size: 18px">报警记录列表</span>
|
|
<span style="margin-left: 20px; font-size: 18px">报警记录列表</span>
|
|
</div>
|
|
</div>
|
|
|
|
|
|
@@ -22,66 +22,113 @@
|
|
<el-form-item label="报警类型">
|
|
<el-form-item label="报警类型">
|
|
<el-input placeholder="设备类型" size="mini" v-model="searchFormData.alarmType"></el-input>
|
|
<el-input placeholder="设备类型" size="mini" v-model="searchFormData.alarmType"></el-input>
|
|
</el-form-item>
|
|
</el-form-item>
|
|
- <el-form-item label="设备SN">
|
|
|
|
- <el-input placeholder="设备SN" size="mini" v-model="searchFormData.sn"></el-input>
|
|
|
|
- </el-form-item>
|
|
|
|
- <el-form-item label="运营商编号">
|
|
|
|
- <el-input placeholder="运营商编号" size="mini" v-model="searchFormData.operatorNumber"></el-input>
|
|
|
|
- </el-form-item>
|
|
|
|
- <el-form-item label="项目编号">
|
|
|
|
- <el-input placeholder="项目编号" size="mini" v-model="searchFormData.projectNumber"></el-input>
|
|
|
|
- </el-form-item>
|
|
|
|
- <el-form-item label="网关编号">
|
|
|
|
- <el-input placeholder="网关编号" size="mini" v-model="searchFormData.gatewayNumber"></el-input>
|
|
|
|
- </el-form-item>
|
|
|
|
- <el-form-item label="变量id">
|
|
|
|
- <el-input placeholder="变量id" size="mini" v-model="searchFormData.variableId"></el-input>
|
|
|
|
|
|
+
|
|
|
|
+ <el-form-item label="变量id" style="margin-top: 6px" size="mini">
|
|
|
|
+ <el-select v-model="searchFormData.variableId" placeholder="变量id" style="width: 180px"
|
|
|
|
+ clearable>
|
|
|
|
+ <el-option :value="i.variableId" v-for="(i,index) in deviceAlarmConfigs" :key="index"
|
|
|
|
+ :label="i.variableId"></el-option>
|
|
|
|
+ </el-select>
|
|
</el-form-item>
|
|
</el-form-item>
|
|
|
|
|
|
<el-form-item label="开始时间" size="mini" style="margin-top: 6px;margin-right: 0px">
|
|
<el-form-item label="开始时间" size="mini" style="margin-top: 6px;margin-right: 0px">
|
|
- <el-date-picker type="datetime" placeholder="开始时间" v-model="searchFormData.startTime" style="width: 85%;"></el-date-picker>
|
|
|
|
|
|
+ <el-date-picker type="datetime" placeholder="开始时间" v-model="searchFormData.startTime"
|
|
|
|
+ style="width: 85%;"></el-date-picker>
|
|
</el-form-item>
|
|
</el-form-item>
|
|
<el-form-item label="结束时间" size="mini" style="margin-top: 7px ;margin-left: 0px">
|
|
<el-form-item label="结束时间" size="mini" style="margin-top: 7px ;margin-left: 0px">
|
|
- <el-date-picker type="datetime" placeholder="结束时间" v-model="searchFormData.endTime" style="width: 85%;"></el-date-picker>
|
|
|
|
|
|
+ <el-date-picker type="datetime" placeholder="结束时间" v-model="searchFormData.endTime"
|
|
|
|
+ style="width: 85%;"></el-date-picker>
|
|
</el-form-item>
|
|
</el-form-item>
|
|
|
|
|
|
-
|
|
|
|
- <el-dialog title="报警" :visible.sync="dialogFormVisible">
|
|
|
|
- <el-form label-position="left" :model="formData">
|
|
|
|
- <el-form-item label="报警名称">
|
|
|
|
- <el-input v-model="formData.alarmName"></el-input>
|
|
|
|
- </el-form-item>
|
|
|
|
- <el-form-item label="报警类型">
|
|
|
|
- <el-input v-model="formData.alarmType"></el-input>
|
|
|
|
- </el-form-item>
|
|
|
|
- <el-form-item label="告警内容">
|
|
|
|
- <el-input v-model="formData.content"></el-input>
|
|
|
|
- </el-form-item>
|
|
|
|
-
|
|
|
|
-
|
|
|
|
-
|
|
|
|
- <el-form-item label="设备sn">
|
|
|
|
- <el-input v-model="formData.sn"></el-input>
|
|
|
|
- </el-form-item>
|
|
|
|
- <el-form-item label="变量id">
|
|
|
|
- <el-input v-model="formData.variableId"></el-input>
|
|
|
|
- </el-form-item>
|
|
|
|
-
|
|
|
|
- <el-form-item label="运营商编号">
|
|
|
|
- <el-input placeholder="运营商编号" size="small" v-model="searchFormData.operatorNumber"></el-input>
|
|
|
|
- </el-form-item>
|
|
|
|
- <el-form-item label="项目编号">
|
|
|
|
- <el-input placeholder="项目编号" size="small" v-model="searchFormData.projectNumber"></el-input>
|
|
|
|
- </el-form-item>
|
|
|
|
- <el-form-item label="网关编号">
|
|
|
|
- <el-input placeholder="网关编号" size="small" v-model="searchFormData.gatewayNumber"></el-input>
|
|
|
|
- </el-form-item>
|
|
|
|
|
|
+ <el-row style="margin-top: 0px">
|
|
|
|
+ <el-form-item label="运营商编号" style="margin-top: 6px" size="mini">
|
|
|
|
+ <el-select v-model="searchFormData.operatorNumber" placeholder="运营商编号" style="width: 180px"
|
|
|
|
+ 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="项目编号" style="margin-top: 6px" size="mini">
|
|
|
|
+ <el-select v-model="searchFormData.projectNumber" placeholder="项目编号" style="width: 180px;" clearable
|
|
|
|
+ :disabled="!searchFormData.operatorNumber">
|
|
|
|
+ <el-option v-for="(item) in projects" :key="item.number" :label="item.number"
|
|
|
|
+ :value="item.number"></el-option>
|
|
|
|
+ </el-select>
|
|
|
|
+ </el-form-item>
|
|
|
|
+ <el-form-item label="网关编号" style="margin-top: 6px" size="mini">
|
|
|
|
+ <el-select v-model="searchFormData.gatewayNumber" placeholder="网关编号" style="width: 180px;" clearable
|
|
|
|
+ :disabled="!searchFormData.projectNumber">
|
|
|
|
+ <el-option v-for="(item) in gateways" :key="item.number" :label="item.number"
|
|
|
|
+ :value="item.number"></el-option>
|
|
|
|
+ </el-select>
|
|
|
|
+ </el-form-item>
|
|
|
|
+ <el-form-item label="设备SN" style="margin-top: 6px" size="mini">
|
|
|
|
+ <el-select v-model="searchFormData.sn" placeholder="设备SN" style="width: 180px"
|
|
|
|
+ clearable :disabled="!searchFormData.gatewayNumber">
|
|
|
|
+ <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>
|
|
|
|
+
|
|
|
|
+
|
|
|
|
+
|
|
|
|
+
|
|
|
|
+ <el-dialog title="报警记录" :visible.sync="dialogFormVisible" style="width: 70% ; margin-left: 300px ;">
|
|
|
|
+ <el-form label-position="left" :model="formData" :rules="rules" ref="formData">
|
|
|
|
+ <el-row style="margin-left: 30px">
|
|
|
|
+ <el-form-item label="变量Id" prop="operatorNumber">
|
|
|
|
+ <el-select v-model="formData.variableId" placeholder="变量Id" style="width: 202px"
|
|
|
|
+ clearable>
|
|
|
|
+ <el-option :value="i.variableId" v-for="(i,index) in deviceAlarmConfigs" :key="index"
|
|
|
|
+ :label="i.variableId"></el-option>
|
|
|
|
+ </el-select>
|
|
|
|
+ </el-form-item>
|
|
|
|
+
|
|
|
|
+ <el-form-item label="告警内容" prop="content">
|
|
|
|
+ <el-input v-model="formData.content"></el-input>
|
|
|
|
+ </el-form-item>
|
|
|
|
+ </el-row>
|
|
|
|
+
|
|
|
|
+ <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>
|
|
|
|
|
|
</el-form>
|
|
</el-form>
|
|
|
|
|
|
<div slot="footer" class="dialog-footer">
|
|
<div slot="footer" class="dialog-footer">
|
|
<el-button @click="cancel()">取 消</el-button>
|
|
<el-button @click="cancel()">取 消</el-button>
|
|
- <el-button type="primary" @click="addOrEditMehtond()">确 定</el-button>
|
|
|
|
|
|
+ <el-button type="primary" @click="addOrEditMehtond('formData')">确 定</el-button>
|
|
</div>
|
|
</div>
|
|
</el-dialog>
|
|
</el-dialog>
|
|
|
|
|
|
@@ -90,6 +137,7 @@
|
|
|
|
|
|
<el-table :data="tableData">
|
|
<el-table :data="tableData">
|
|
<el-table-column type="selection"></el-table-column>
|
|
<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="alarmName" label="报警名称"></el-table-column>
|
|
<el-table-column prop="alarmType" label="报警类型"></el-table-column>
|
|
<el-table-column prop="alarmType" label="报警类型"></el-table-column>
|
|
<el-table-column prop="content" label="告警内容"></el-table-column>
|
|
<el-table-column prop="content" label="告警内容"></el-table-column>
|
|
@@ -105,7 +153,7 @@
|
|
class="delBut non"
|
|
class="delBut non"
|
|
@click="statusHandle(scope.row)"
|
|
@click="statusHandle(scope.row)"
|
|
>
|
|
>
|
|
- {{ scope.row.status == '未处理' ? '已处理' : '未处理' }}
|
|
|
|
|
|
+ {{ scope.row.status == '已处理' ? '已处理' : '未处理' }}
|
|
</el-button>
|
|
</el-button>
|
|
</template>
|
|
</template>
|
|
</el-table-column>
|
|
</el-table-column>
|
|
@@ -146,6 +194,40 @@ export default {
|
|
name: 'deviceAlarmRecord',
|
|
name: 'deviceAlarmRecord',
|
|
data() {
|
|
data() {
|
|
return {
|
|
return {
|
|
|
|
+ rules: {
|
|
|
|
+ operatorNumber: [
|
|
|
|
+ {required: true, message: '请输入运营商编号', trigger: 'change'}
|
|
|
|
+ ],
|
|
|
|
+ projectNumber: [
|
|
|
|
+ {required: true, message: '请输入项目编号', trigger: 'change'}
|
|
|
|
+ ],
|
|
|
|
+ gatewayNumber: [
|
|
|
|
+ {required: true, message: '请输入网关编号', trigger: 'change'}
|
|
|
|
+ ],
|
|
|
|
+ sn: [
|
|
|
|
+ {required: true, message: '请输入设备sn', trigger: 'change'}
|
|
|
|
+ ],
|
|
|
|
+
|
|
|
|
+ variableId: [
|
|
|
|
+ {required: true, message: '请输入变量Id', trigger: 'blur'}
|
|
|
|
+ ],
|
|
|
|
+ content: [
|
|
|
|
+ {required: true, message: '请输入报警内容', trigger: 'blur'}
|
|
|
|
+ ],
|
|
|
|
+
|
|
|
|
+ },
|
|
|
|
+
|
|
|
|
+ gateways: [],
|
|
|
|
+ projects: [],
|
|
|
|
+ operators: [],
|
|
|
|
+ devices: [],
|
|
|
|
+ deviceAlarmConfigs: [],
|
|
|
|
+
|
|
|
|
+ operatorProject: '',
|
|
|
|
+ projectGateway: '',
|
|
|
|
+ gatewayDevice: '',
|
|
|
|
+
|
|
|
|
+
|
|
api: {
|
|
api: {
|
|
list: this.$api.deviceAlarmRecord.list,
|
|
list: this.$api.deviceAlarmRecord.list,
|
|
delete: this.$api.deviceAlarmRecord.delete,
|
|
delete: this.$api.deviceAlarmRecord.delete,
|
|
@@ -205,6 +287,92 @@ export default {
|
|
|
|
|
|
created: function () {
|
|
created: function () {
|
|
this.loadData();
|
|
this.loadData();
|
|
|
|
+ this.getOperator();
|
|
|
|
+ this.getVariableId();
|
|
|
|
+ },
|
|
|
|
+
|
|
|
|
+ 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)
|
|
|
|
+
|
|
|
|
+
|
|
|
|
+ this.operatorProject = oldValue;
|
|
|
|
+
|
|
|
|
+ console.log(this.operatorProject)
|
|
|
|
+
|
|
|
|
+ this.getProjectNumber();
|
|
|
|
+ },
|
|
|
|
+
|
|
|
|
+ 'formData.projectNumber'(oldValue, newValue) {
|
|
|
|
+
|
|
|
|
+ console.log(oldValue)
|
|
|
|
+ console.log(newValue)
|
|
|
|
+
|
|
|
|
+
|
|
|
|
+ this.projectGateway = oldValue;
|
|
|
|
+
|
|
|
|
+ console.log(this.projectGateway)
|
|
|
|
+
|
|
|
|
+ this.getGateway();
|
|
|
|
+ },
|
|
|
|
+
|
|
|
|
+ 'formData.gatewayNumber'(oldValue, newValue) {
|
|
|
|
+
|
|
|
|
+ console.log(oldValue)
|
|
|
|
+ console.log(newValue)
|
|
|
|
+
|
|
|
|
+
|
|
|
|
+ this.gatewayDevice = oldValue;
|
|
|
|
+
|
|
|
|
+ console.log(this.gatewayDevice)
|
|
|
|
+
|
|
|
|
+ this.getDevice();
|
|
|
|
+ }
|
|
},
|
|
},
|
|
|
|
|
|
methods: {
|
|
methods: {
|
|
@@ -213,6 +381,57 @@ export default {
|
|
this.loadData(index)
|
|
this.loadData(index)
|
|
},
|
|
},
|
|
|
|
|
|
|
|
+ getVariableId() {
|
|
|
|
+ const vm = this;
|
|
|
|
+ vm.$http.get(vm.$api.deviceAlarmConfig.list).then((resp) => {
|
|
|
|
+ vm.deviceAlarmConfigs = resp.data.data.deviceAlarmConfigs
|
|
|
|
+ })
|
|
|
|
+ },
|
|
|
|
+
|
|
|
|
+
|
|
|
|
+ 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) {
|
|
loadData(index) {
|
|
const vm = this;
|
|
const vm = this;
|
|
vm.$http.get(vm.api.list, {
|
|
vm.$http.get(vm.api.list, {
|
|
@@ -262,96 +481,108 @@ export default {
|
|
},
|
|
},
|
|
|
|
|
|
showEdit(row) {
|
|
showEdit(row) {
|
|
-
|
|
|
|
console.log(row)
|
|
console.log(row)
|
|
|
|
|
|
this.dialogFormVisible = true;
|
|
this.dialogFormVisible = true;
|
|
|
|
|
|
- this.formData = row
|
|
|
|
|
|
+ this.editRow = JSON.parse(JSON.stringify(row));
|
|
|
|
+ this.formData = this.editRow
|
|
|
|
+
|
|
|
|
|
|
this.addOrEdit = 2
|
|
this.addOrEdit = 2
|
|
},
|
|
},
|
|
|
|
|
|
|
|
|
|
- addOrEditMehtond() {
|
|
|
|
- const vm = this;
|
|
|
|
- if (this.addOrEdit == 2) {
|
|
|
|
- vm.$http.get(vm.api.update, {
|
|
|
|
- params: {
|
|
|
|
- alarmName: this.formData.alarmName,
|
|
|
|
- alarmType: this.formData.alarmType,
|
|
|
|
- content: this.formData.content,
|
|
|
|
- startTime: this.formData.startTime,
|
|
|
|
- endTime: this.formData.endTime,
|
|
|
|
-
|
|
|
|
- operatorNumber: this.formData.operatorNumber,
|
|
|
|
- projectNumber: this.formData.projectNumber,
|
|
|
|
- gatewayNumber: this.formData.gatewayNumber,
|
|
|
|
- sn: this.formData.sn,
|
|
|
|
- variableId: this.formData.variableId,
|
|
|
|
-
|
|
|
|
- operatorCode: this.formData.operatorCode,
|
|
|
|
- projectCode: this.formData.projectCode,
|
|
|
|
- gatewayCode: this.formData.gatewayCode,
|
|
|
|
- }
|
|
|
|
- })
|
|
|
|
- .then((response) => {
|
|
|
|
- console.log(response)
|
|
|
|
-
|
|
|
|
- if (response.data.status == 200) {
|
|
|
|
|
|
|
|
- this.$message({
|
|
|
|
- type: 'success',
|
|
|
|
- showClose: true,
|
|
|
|
- message: response.data.desc
|
|
|
|
- })
|
|
|
|
- }
|
|
|
|
-
|
|
|
|
- this.dialogFormVisible = false;
|
|
|
|
-
|
|
|
|
- this.loadData();
|
|
|
|
-
|
|
|
|
- })
|
|
|
|
- .catch(() => {
|
|
|
|
- });
|
|
|
|
- }
|
|
|
|
-
|
|
|
|
- if (this.addOrEdit == 1) {
|
|
|
|
- vm.$http.get(vm.api.add, {
|
|
|
|
- params: {
|
|
|
|
- alarmName: this.formData.alarmName,
|
|
|
|
- alarmType: this.formData.alarmType,
|
|
|
|
- content: this.formData.content,
|
|
|
|
- startTime: this.formData.startTime,
|
|
|
|
- endTime: this.formData.endTime,
|
|
|
|
-
|
|
|
|
- operatorNumber: this.formData.operatorNumber,
|
|
|
|
- projectNumber: this.formData.projectNumber,
|
|
|
|
- gatewayNumber: this.formData.gatewayNumber,
|
|
|
|
- sn: this.formData.sn,
|
|
|
|
- variableId: this.formData.variableId,
|
|
|
|
-
|
|
|
|
- operatorCode: this.formData.operatorCode,
|
|
|
|
- projectCode: this.formData.projectCode,
|
|
|
|
- gatewayCode: this.formData.gatewayCode,
|
|
|
|
|
|
+ addOrEditMehtond(formName) {
|
|
|
|
+ this.$refs[formName].validate((valid) => {
|
|
|
|
+ if (valid) {
|
|
|
|
+ const vm = this;
|
|
|
|
+ if (this.addOrEdit == 2) {
|
|
|
|
+ vm.$http.get(vm.api.update, {
|
|
|
|
+ params: {
|
|
|
|
+ alarmName: this.formData.alarmName,
|
|
|
|
+ alarmType: this.formData.alarmType,
|
|
|
|
+ content: this.formData.content,
|
|
|
|
+ startTime: this.formData.startTime,
|
|
|
|
+ endTime: this.formData.endTime,
|
|
|
|
+
|
|
|
|
+ status: '1',
|
|
|
|
+
|
|
|
|
+ operatorNumber: this.formData.operatorNumber,
|
|
|
|
+ projectNumber: this.formData.projectNumber,
|
|
|
|
+ gatewayNumber: this.formData.gatewayNumber,
|
|
|
|
+ sn: this.formData.sn,
|
|
|
|
+ variableId: this.formData.variableId,
|
|
|
|
+
|
|
|
|
+ operatorCode: this.formData.operatorCode,
|
|
|
|
+ projectCode: this.formData.projectCode,
|
|
|
|
+ gatewayCode: this.formData.gatewayCode,
|
|
|
|
+ }
|
|
|
|
+ })
|
|
|
|
+ .then((response) => {
|
|
|
|
+ console.log(response)
|
|
|
|
+
|
|
|
|
+ if (response.data.status == 200) {
|
|
|
|
+
|
|
|
|
+ this.$message({
|
|
|
|
+ type: 'success',
|
|
|
|
+ showClose: true,
|
|
|
|
+ message: response.data.desc
|
|
|
|
+ })
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ this.dialogFormVisible = false;
|
|
|
|
+
|
|
|
|
+ this.loadData();
|
|
|
|
+
|
|
|
|
+ })
|
|
|
|
+ .catch(() => {
|
|
|
|
+ });
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ if (this.addOrEdit == 1) {
|
|
|
|
+ vm.$http.get(vm.api.add, {
|
|
|
|
+ params: {
|
|
|
|
+ alarmName: this.formData.alarmName,
|
|
|
|
+ alarmType: this.formData.alarmType,
|
|
|
|
+ content: this.formData.content,
|
|
|
|
+ startTime: this.formData.startTime,
|
|
|
|
+ endTime: this.formData.endTime,
|
|
|
|
+
|
|
|
|
+ operatorNumber: this.formData.operatorNumber,
|
|
|
|
+ projectNumber: this.formData.projectNumber,
|
|
|
|
+ gatewayNumber: this.formData.gatewayNumber,
|
|
|
|
+ sn: this.formData.sn,
|
|
|
|
+ variableId: this.formData.variableId,
|
|
|
|
+
|
|
|
|
+ operatorCode: this.formData.operatorCode,
|
|
|
|
+ projectCode: this.formData.projectCode,
|
|
|
|
+ gatewayCode: this.formData.gatewayCode,
|
|
|
|
+ }
|
|
|
|
+ })
|
|
|
|
+ .then((response) => {
|
|
|
|
+ if (response.data.status == 200) {
|
|
|
|
+
|
|
|
|
+ this.dialogFormVisible = false;
|
|
|
|
+
|
|
|
|
+ this.$message({
|
|
|
|
+ type: 'success',
|
|
|
|
+ showClose: true,
|
|
|
|
+ message: response.data.desc
|
|
|
|
+ })
|
|
|
|
+
|
|
|
|
+ this.loadData();
|
|
|
|
+ }
|
|
|
|
+ })
|
|
|
|
+ }
|
|
|
|
+ } else {
|
|
|
|
+ console.log('error submit!!');
|
|
|
|
+ return false;
|
|
}
|
|
}
|
|
- })
|
|
|
|
- .then((response) => {
|
|
|
|
- if (response.data.status == 200) {
|
|
|
|
-
|
|
|
|
- this.dialogFormVisible = false;
|
|
|
|
-
|
|
|
|
- this.$message({
|
|
|
|
- type: 'success',
|
|
|
|
- showClose: true,
|
|
|
|
- message: response.data.desc
|
|
|
|
- })
|
|
|
|
|
|
+ });
|
|
|
|
+ },
|
|
|
|
|
|
- this.loadData();
|
|
|
|
- }
|
|
|
|
- })
|
|
|
|
- }
|
|
|
|
- },
|
|
|
|
|
|
|
|
del(row) {
|
|
del(row) {
|
|
const vm = this;
|
|
const vm = this;
|
|
@@ -391,12 +622,13 @@ export default {
|
|
showClose: true,
|
|
showClose: true,
|
|
type: 'info'
|
|
type: 'info'
|
|
});
|
|
});
|
|
-
|
|
|
|
|
|
+ this.$refs.formData.clearValidate();
|
|
this.dialogFormVisible = false;
|
|
this.dialogFormVisible = false;
|
|
},
|
|
},
|
|
|
|
|
|
- //启用/停用设备
|
|
|
|
|
|
+
|
|
statusHandle(row) {
|
|
statusHandle(row) {
|
|
|
|
+ console.log(row)
|
|
const vm = this;
|
|
const vm = this;
|
|
this.$confirm('是否进行此操作', '提示', {
|
|
this.$confirm('是否进行此操作', '提示', {
|
|
type: 'warning'
|
|
type: 'warning'
|
|
@@ -410,7 +642,8 @@ export default {
|
|
endTime: row.endTime,
|
|
endTime: row.endTime,
|
|
|
|
|
|
sn: row.sn,
|
|
sn: row.sn,
|
|
- variableId: row.variable,
|
|
|
|
|
|
+ variableId: row.variableId,
|
|
|
|
+ recordCondition: row.condition,
|
|
operatorNumber: row.operatorNumber,
|
|
operatorNumber: row.operatorNumber,
|
|
projectNumber: row.projectNumber,
|
|
projectNumber: row.projectNumber,
|
|
gatewayNumber: row.gatewayNumber,
|
|
gatewayNumber: row.gatewayNumber,
|
|
@@ -418,6 +651,9 @@ export default {
|
|
operatorCode: row.operatorCode,
|
|
operatorCode: row.operatorCode,
|
|
projectCode: row.projectCode,
|
|
projectCode: row.projectCode,
|
|
gatewayCode: row.gatewayCode,
|
|
gatewayCode: row.gatewayCode,
|
|
|
|
+ deviceCode: row.deviceCode,
|
|
|
|
+ alarmConfigCode: row.alarmConfigCode,
|
|
|
|
+
|
|
|
|
|
|
code: row.code,
|
|
code: row.code,
|
|
valid: row.valid,
|
|
valid: row.valid,
|
|
@@ -451,7 +687,11 @@ export default {
|
|
manage() {
|
|
manage() {
|
|
let vm = this;
|
|
let vm = this;
|
|
vm.$router.push('/deviceAlarmRecordDetail')
|
|
vm.$router.push('/deviceAlarmRecordDetail')
|
|
- }
|
|
|
|
|
|
+ },
|
|
|
|
+ back() {
|
|
|
|
+ let vm = this;
|
|
|
|
+ vm.$router.back()
|
|
|
|
+ },
|
|
|
|
|
|
}
|
|
}
|
|
}
|
|
}
|
|
@@ -465,5 +705,9 @@ export default {
|
|
margin-top: 0px;
|
|
margin-top: 0px;
|
|
}
|
|
}
|
|
|
|
|
|
|
|
+.el-row {
|
|
|
|
+ margin-top: 20px;
|
|
|
|
+}
|
|
|
|
+
|
|
|
|
|
|
</style>
|
|
</style>
|