askin 2 years ago
parent
commit
bec1fe2b02
26 changed files with 3121 additions and 337 deletions
  1. 7 0
      sources/client/vrv-platform/src/config/api.js
  2. 37 1
      sources/client/vrv-platform/src/router/index.js
  3. 1 0
      sources/client/vrv-platform/src/views/device/gatewayList.vue
  4. 1 2
      sources/client/vrv-platform/src/views/device/list.vue
  5. 334 0
      sources/client/vrv-platform/src/views/deviceAlarmConfig/list.vue
  6. 713 0
      sources/client/vrv-platform/src/views/deviceAlarmRecord/detail.vue
  7. 376 132
      sources/client/vrv-platform/src/views/deviceAlarmRecord/list.vue
  8. 674 0
      sources/client/vrv-platform/src/views/deviceAlarmRepairRecord/list.vue
  9. 90 7
      sources/client/vrv-platform/src/views/menu/menu.vue
  10. 0 1
      sources/client/vrv-platform/src/views/operator/list.vue
  11. 29 11
      sources/client/vrv-platform/src/views/operatorLog/list.vue
  12. 147 139
      sources/client/vrv-platform/src/views/power/list.vue
  13. 2 2
      sources/client/vrv-platform/src/views/project/list.vue
  14. 10 11
      sources/client/vrv-platform/src/views/role/list.vue
  15. 315 0
      sources/client/vrv-platform/src/views/rolePower/list.vue
  16. 70 20
      sources/client/vrv-platform/src/views/user/list.vue
  17. 151 0
      sources/client/vrv-platform/src/views/user/userInfo.vue
  18. 1 1
      sources/server/vrv/run/application.pid
  19. 2 0
      sources/server/vrv/vrv-core-service/src/main/java/com/kuyuntech/vrv/coreservice/dao/core/UserDao.java
  20. 1 0
      sources/server/vrv/vrv-core-service/src/main/java/com/kuyuntech/vrv/coreservice/service/core/impl/DeviceAlarmRecordServiceImpl.java
  21. 30 3
      sources/server/vrv/vrv-core-service/src/main/java/com/kuyuntech/vrv/coreservice/service/core/impl/DeviceAlarmRepairRecordServiceImpl.java
  22. 38 0
      sources/server/vrv/vrv-core-service/src/main/java/com/kuyuntech/vrv/coreservice/service/core/impl/DeviceServiceImpl.java
  23. 26 0
      sources/server/vrv/vrv-core-service/src/main/java/com/kuyuntech/vrv/coreservice/service/core/impl/GatewayServiceImpl.java
  24. 43 6
      sources/server/vrv/vrv-core-service/src/main/java/com/kuyuntech/vrv/coreservice/service/core/impl/OperatorLogServiceImpl.java
  25. 16 0
      sources/server/vrv/vrv-core-service/src/main/java/com/kuyuntech/vrv/coreservice/service/core/impl/ProjectServiceImpl.java
  26. 7 1
      sources/server/vrv/vrv-core-service/src/main/java/com/kuyuntech/vrv/coreservice/service/core/impl/UserServiceImpl.java

+ 7 - 0
sources/client/vrv-platform/src/config/api.js

@@ -108,6 +108,13 @@ const api = {
             detail: `${root}/power/detail`,
             detail: `${root}/power/detail`,
             delete: `${root}/power/delete`,
             delete: `${root}/power/delete`,
         },
         },
+        rolePower: {
+            list: `${root}/rolePower/list`,
+            add: `${root}/rolePower/add`,
+            update: `${root}/rolePower/update`,
+            detail: `${root}/rolePower/detail`,
+            delete: `${root}/rolePower/delete`,
+        },
         menu: {}
         menu: {}
     }
     }
 ;
 ;

+ 37 - 1
sources/client/vrv-platform/src/router/index.js

@@ -12,12 +12,48 @@ export default new Router({
             name: 'menu',
             name: 'menu',
             component: () => import(/* webpackChunkName: "views" */ '../views/menu/menu'),
             component: () => import(/* webpackChunkName: "views" */ '../views/menu/menu'),
             children: [
             children: [
+                {
+                    path: '/userInfo',
+                    name: 'userInfo',
+                    meta: {title: '个人中心', tab: true, keepAlive: true},
+                    component: () => import(/* webpackChunkName: "views" */ '../views/user/userInfo'),
+
+                },
+
                 {
                 {
                     path: '/project',
                     path: '/project',
                     name: 'project',
                     name: 'project',
                     meta: {title: '项目管理', tab: true, keepAlive: true},
                     meta: {title: '项目管理', tab: true, keepAlive: true},
                     component: () => import(/* webpackChunkName: "views" */ '../views/project/list'),
                     component: () => import(/* webpackChunkName: "views" */ '../views/project/list'),
 
 
+                },
+                {
+                    path: '/rolePower',
+                    name: 'rolePower',
+                    meta: {title: '关联角色权限', tab: true, keepAlive: true},
+                    component: () => import(/* webpackChunkName: "views" */ '../views/rolePower/list'),
+
+                },
+                {
+                    path: '/deviceAlarmRepairRecord',
+                    name: 'deviceAlarmRepairRecord',
+                    meta: {title: '维保记录', tab: true, keepAlive: true},
+                    component: () => import(/* webpackChunkName: "views" */ '../views/deviceAlarmRepairRecord/list'),
+
+                },
+                {
+                    path: '/detail',
+                    name: 'detail',
+                    meta: {title: '报警记录明细', tab: true, keepAlive: true},
+                    component: () => import(/* webpackChunkName: "views" */ '../views/deviceAlarmRecord/detail'),
+
+                },
+                {
+                    path: '/deviceAlarmConfig',
+                    name: 'deviceAlarmConfig',
+                    meta: {title: '报警配置', tab: true, keepAlive: true},
+                    component: () => import(/* webpackChunkName: "views" */ '../views/deviceAlarmConfig/list'),
+
                 },
                 },
                 {
                 {
                     path: '/operatorList',
                     path: '/operatorList',
@@ -79,7 +115,7 @@ export default new Router({
                 {
                 {
                     path: '/deviceAlarmRecord',
                     path: '/deviceAlarmRecord',
                     name: 'deviceAlarmRecord',
                     name: 'deviceAlarmRecord',
-                    meta: {title: '报警管理', tab: true, keepAlive: true},
+                    meta: {title: '报警记录', tab: true, keepAlive: true},
                     component: () => import(/* webpackChunkName: "views" */ '../views/deviceAlarmRecord/list'),
                     component: () => import(/* webpackChunkName: "views" */ '../views/deviceAlarmRecord/list'),
                 }
                 }
                 ,
                 ,

+ 1 - 0
sources/client/vrv-platform/src/views/device/gatewayList.vue

@@ -414,6 +414,7 @@ export default {
                 ip: this.formData.ip,
                 ip: this.formData.ip,
                 sn: this.formData.sn,
                 sn: this.formData.sn,
                 type: this.formData.type,
                 type: this.formData.type,
+                deviceStatus:1,
 
 
                 operatorNumber: this.formData.operatorNumber,
                 operatorNumber: this.formData.operatorNumber,
                 projectNumber: this.formData.projectNumber,
                 projectNumber: this.formData.projectNumber,

+ 1 - 2
sources/client/vrv-platform/src/views/device/list.vue

@@ -421,6 +421,7 @@ export default {
                 ip: this.formData.ip,
                 ip: this.formData.ip,
                 sn: this.formData.sn,
                 sn: this.formData.sn,
                 type: this.formData.type,
                 type: this.formData.type,
+                deviceStatus:1,
 
 
                 operatorNumber: this.formData.operatorNumber,
                 operatorNumber: this.formData.operatorNumber,
                 projectNumber: this.formData.projectNumber,
                 projectNumber: this.formData.projectNumber,
@@ -488,8 +489,6 @@ export default {
           return false;
           return false;
         }
         }
       });
       });
-
-
     },
     },
 
 
     del(row) {
     del(row) {

+ 334 - 0
sources/client/vrv-platform/src/views/deviceAlarmConfig/list.vue

@@ -0,0 +1,334 @@
+<template>
+  <div id="deviceAlarmConfig">
+    <el-container>
+
+      <el-main>
+        <div style="margin-bottom: 10px">
+          <el-button size="medium" icon="el-icon-back" type="text" @click="back">返回</el-button>
+          <span style="margin-left: 20px; font-size: 18px">报警配置列表</span>
+        </div>
+
+        <el-button size="medium" icon="el-icon-search" style="margin-bottom: 15px" @click="search(searchFormData)">
+          查询
+        </el-button>
+        <el-button size="medium" icon="el-icon-plus" @click="showAdd" style="margin-left: 0">新增</el-button>
+
+
+        <div style="padding: 10px;background-color: white">
+          <el-form :inline="true" :model="searchFormData" style="background-color: white;">
+            <el-form-item label="报警名称">
+              <el-input placeholder="报警名称" size="mini" v-model="searchFormData.alarmName"></el-input>
+            </el-form-item>
+            <el-form-item label="报警类型">
+              <el-input placeholder="设备类型" size="mini" v-model="searchFormData.alarmType"></el-input>
+            </el-form-item>
+
+            <el-form-item label="变量id" style="margin-top: 6px" size="mini">
+              <el-input placeholder="变量id" size="mini" v-model="searchFormData.variableId"></el-input>
+            </el-form-item>
+            <el-form-item label="判断条件" style="margin-top: 6px" size="mini">
+              <el-input placeholder="判断条件" size="mini" v-model="searchFormData.condition"></el-input>
+            </el-form-item>
+
+
+            <el-dialog title="报警记录" :visible.sync="dialogFormVisible" style="width: 70% ; margin-left: 300px ;">
+              <el-form label-position="left" :model="formData">
+
+                <el-row style="margin-left: 14px">
+                  <el-form-item label="报警名称" prop="alarmName">
+                    <el-input v-model="formData.alarmName"></el-input>
+                  </el-form-item>
+                  <el-form-item label="报警类型" prop="alarmType">
+                    <el-input v-model="formData.alarmType"></el-input>
+                  </el-form-item>
+                </el-row>
+
+                <el-row style="margin-left: 14px">
+                  <el-form-item label="变量Id" prop="variableId">
+                    <el-input v-model="formData.variableId"></el-input>
+                  </el-form-item>
+                  <el-form-item label="判断条件" prop="condition">
+                    <el-input v-model="formData.condition"></el-input>
+                  </el-form-item>
+                </el-row>
+              </el-form>
+
+              <div slot="footer" class="dialog-footer" style="text-align: center">
+                <el-button @click="cancel()">取 消</el-button>
+                <el-button type="primary" @click="addOrEditMehtond()">确 定</el-button>
+              </div>
+            </el-dialog>
+
+          </el-form>
+
+
+          <el-table :data="tableData">
+            <el-table-column type="selection"></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>
+            <el-table-column prop="condition" label="判断条件"></el-table-column>
+
+            <el-table-column label="操作">
+              <template slot-scope="scope">
+                <el-button type="text" size="medium" @click="showEdit(scope.row)">编辑</el-button>
+                <el-button type="text" size="medium" @click="del(scope.row)" style="color: #c01920">删除</el-button>
+              </template>
+            </el-table-column>
+
+          </el-table>
+
+
+          <el-pagination
+              style="margin-top: 15px;text-align: center"
+              background
+              layout="prev, pager, next"
+              :page-size="pager.pageSize"
+              :current-page="pager.pageIndex"
+              :total="pager.itemCount"
+              @current-change="handleCurrentChange"
+          >
+          </el-pagination>
+        </div>
+      </el-main>
+
+    </el-container>
+  </div>
+</template>
+
+
+<script>
+
+export default {
+  name: 'deviceAlarmConfig',
+  data() {
+    return {
+
+      api: {
+        list: this.$api.deviceAlarmConfig.list,
+        delete: this.$api.deviceAlarmConfig.delete,
+        add: this.$api.deviceAlarmConfig.add,
+        update: this.$api.deviceAlarmConfig.update,
+      },
+
+      value: true,
+
+      addOrEdit: 1,
+
+      dialogFormVisible: false,
+
+      pager: {
+        pageSize: 2,
+        pageIndex: 1,
+        itemCount: 0,
+      },
+
+      tableData:
+          [{
+            alarmName: '',
+            alarmType: '',
+            condition: '',
+            variableId: ''
+          }],
+
+      formData: {
+        alarmName: '',
+        alarmType: '',
+        condition: '',
+        variableId: ''
+      },
+
+      searchFormData:
+          {
+            alarmName: '',
+            alarmType: '',
+            condition: '',
+            variableId: ''
+          }
+    }
+  },
+
+  created: function () {
+    this.loadData();
+  },
+
+
+  methods: {
+    //切换页码
+    handleCurrentChange(index) {
+      this.loadData(index)
+    },
+
+    loadData(index) {
+      const vm = this;
+      vm.$http.get(vm.api.list, {
+        params: {
+          pageSize: 5,
+          pageIndex: index ? index : 1,
+
+          alarmName: this.searchFormData.alarmName,
+          alarmType: this.searchFormData.alarmType,
+          condition: this.searchFormData.condition,
+          variableId: this.searchFormData.variableId,
+        }
+      })
+          .then((response) => {
+            console.log(response.data.data);
+
+            vm.pager = response.data.data.pager
+
+            vm.tableData = response.data.data.deviceAlarmConfigs;
+          })
+    },
+
+    search() {
+      this.loadData();
+    },
+
+    showAdd() {
+      this.dialogFormVisible = true;
+
+      this.formData.alarmName = '',
+          this.formData.alarmType = '',
+          this.formData.variableId = '',
+          this.formData.condition = ''
+
+    },
+
+    showEdit(row) {
+      console.log(row)
+
+      this.dialogFormVisible = true;
+
+      this.editRow = JSON.parse(JSON.stringify(row));
+      this.formData = this.editRow
+
+
+      this.addOrEdit = 2
+    },
+
+
+    addOrEditMehtond() {
+      const vm = this;
+      if (this.addOrEdit == 2) {
+        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,
+          }
+        })
+            .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,
+            variableId: this.formData.variableId,
+            configCondition: this.formData.condition,
+          }
+        })
+            .then((response) => {
+              if (response.data.status == 200) {
+
+                this.dialogFormVisible = false;
+
+                this.$message({
+                  type: 'success',
+                  showClose: true,
+                  message: response.data.desc
+                })
+
+                this.loadData();
+              }
+            })
+      }
+    },
+
+    del(row) {
+      const vm = this;
+      this.$confirm('确认删除', '提示', {
+        type: 'warning'
+      }).then(() => {
+        vm.$http.get(vm.api.delete, {
+          params: {
+            code: row.code,
+          }
+        })
+            .then((response) => {
+              console.log(response)
+              if (response.data.status == 200) {
+                this.$message({
+                  type: 'success',
+                  showClose: true,
+                  message: response.data.desc
+                })
+
+
+              }
+              this.loadData();
+            })
+      })
+          .catch(() => {
+            this.$message({
+              type: 'info',
+              showClose: true,
+              message: '取消删除'
+            })
+          });
+    },
+    cancel() {
+      this.$message({
+        message: '操作取消',
+        showClose: true,
+        type: 'info'
+      });
+
+      this.dialogFormVisible = false;
+    },
+
+    back() {
+      let vm = this;
+      vm.$router.back()
+    },
+
+  }
+}
+</script>
+
+<style scoped>
+.el-form-item {
+  margin-right: 10px;
+  margin-left: 10px;
+  margin-bottom: 10px;
+  margin-top: 0px;
+}
+
+.el-row {
+  margin-top: 15px;
+}
+
+
+</style>

+ 713 - 0
sources/client/vrv-platform/src/views/deviceAlarmRecord/detail.vue

@@ -0,0 +1,713 @@
+<template>
+  <div id="deviceAlarmRecord">
+    <el-container>
+
+      <el-main>
+        <div style="margin-bottom: 10px">
+          <el-button size="medium" icon="el-icon-back" type="text" @click="back">返回</el-button>
+          <span style="margin-left: 20px; font-size: 18px">报警记录列表</span>
+        </div>
+
+        <el-button size="medium" icon="el-icon-search" style="margin-bottom: 15px" @click="search(searchFormData)">
+          查询
+        </el-button>
+        <el-button size="medium" icon="el-icon-plus" @click="showAdd" style="margin-left: 0">新增</el-button>
+
+
+        <div style="padding: 10px;background-color: white">
+          <el-form :inline="true" :model="searchFormData" style="background-color: white;">
+            <el-form-item label="报警名称">
+              <el-input placeholder="报警名称" size="mini" v-model="searchFormData.alarmName"></el-input>
+            </el-form-item>
+            <el-form-item label="报警类型">
+              <el-input placeholder="设备类型" size="mini" v-model="searchFormData.alarmType"></el-input>
+            </el-form-item>
+
+            <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 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-form-item>
+            <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-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>
+
+              <div slot="footer" class="dialog-footer">
+                <el-button @click="cancel()">取 消</el-button>
+                <el-button type="primary" @click="addOrEditMehtond('formData')">确 定</el-button>
+              </div>
+            </el-dialog>
+
+          </el-form>
+
+
+          <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="content" label="告警内容"></el-table-column>
+            <el-table-column prop="startTime" label="开始时间"></el-table-column>
+            <el-table-column prop="endTime" label="结束时间"></el-table-column>
+
+            <el-table-column label="状态">
+              <template slot-scope="scope">
+                <el-button
+                    style="color:white;background-color: rgb(128,138,135);border: 0px"
+                    type="primary"
+                    size="small"
+                    class="delBut non"
+                    @click="statusHandle(scope.row)"
+                >
+                  {{ scope.row.status == '已处理' ? '已处理' : '未处理' }}
+                </el-button>
+              </template>
+            </el-table-column>
+
+
+            <el-table-column label="操作">
+              <template slot-scope="scope">
+                <el-button type="text" size="medium" @click="showEdit(scope.row)">编辑</el-button>
+                <el-button type="text" size="medium" @click="manage(scope.row)">查看</el-button>
+                <el-button type="text" size="medium" @click="del(scope.row)" style="color: #c01920">删除</el-button>
+              </template>
+            </el-table-column>
+
+          </el-table>
+
+
+          <el-pagination
+              style="margin-top: 15px;text-align: center"
+              background
+              layout="prev, pager, next"
+              :page-size="pager.pageSize"
+              :current-page="pager.pageIndex"
+              :total="pager.itemCount"
+              @current-change="handleCurrentChange"
+          >
+          </el-pagination>
+        </div>
+      </el-main>
+
+    </el-container>
+  </div>
+</template>
+
+
+<script>
+
+export default {
+  name: 'deviceAlarmRecord',
+  data() {
+    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: {
+        list: this.$api.deviceAlarmRecord.list,
+        delete: this.$api.deviceAlarmRecord.delete,
+        add: this.$api.deviceAlarmRecord.add,
+        update: this.$api.deviceAlarmRecord.update,
+      },
+
+      value: true,
+
+      addOrEdit: 1,
+
+      dialogFormVisible: false,
+
+      pager: {
+        pageSize: 2,
+        pageIndex: 1,
+        itemCount: 0,
+      },
+
+      tableData:
+          [{
+            alarmName: '',
+            alarmType: '',
+            content: '',
+            startTime: '',
+            endTime: '',
+          }],
+      formData: {
+        alarmName: '',
+        alarmType: '',
+        content: '',
+        startTime: '',
+        endTime: '',
+
+        sn: '',
+        variableId: '',
+        operatorNumber: '',
+        projectNumber: '',
+        gatewayNumber: ''
+      },
+      searchFormData:
+          {
+            alarmName: '',
+            alarmType: '',
+            content: '',
+            startTime: '',
+            endTime: '',
+
+            sn: '',
+            variableId: '',
+            operatorNumber: '',
+            projectNumber: '',
+            gatewayNumber: ''
+          }
+    }
+  },
+
+  created: function () {
+    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: {
+    //切换页码
+    handleCurrentChange(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) {
+      const vm = this;
+      vm.$http.get(vm.api.list, {
+        params: {
+          pageSize: 5,
+          pageIndex: index ? index : 1,
+
+          alarmName: this.searchFormData.alarmName,
+          alarmType: this.searchFormData.alarmType,
+          startTime: this.searchFormData.startTime,
+          endTime: this.searchFormData.endTime,
+
+          operatorNumber: this.searchFormData.operatorNumber,
+          projectNumber: this.searchFormData.projectNumber,
+          gatewayNumber: this.searchFormData.gatewayNumber,
+          sn: this.searchFormData.sn,
+          variableId: this.searchFormData.variableId,
+        }
+      })
+          .then((response) => {
+            // vm.paper = response.data.data.paper;
+            console.log(response.data.data);
+
+            vm.pager = response.data.data.pager
+
+            vm.tableData = response.data.data.deviceAlarmRecords;
+          })
+    },
+    search() {
+      //console.log(this.searchFormData)
+      this.loadData();
+    },
+    showAdd() {
+      this.dialogFormVisible = true;
+
+      this.formData.alarmName = '',
+          this.formData.alarmType = '',
+          this.formData.content = '',
+          this.formData.startTime = '',
+          this.formData.endTime = '',
+
+          this.formData.operatorNumber = '',
+          this.formData.projectNumber = '',
+          this.formData.gatewayNumber = ''
+      this.formData.sn = ''
+      this.formData.variableId = ''
+    },
+
+    showEdit(row) {
+      console.log(row)
+
+      this.dialogFormVisible = true;
+
+      this.editRow = JSON.parse(JSON.stringify(row));
+      this.formData = this.editRow
+
+
+      this.addOrEdit = 2
+    },
+
+
+
+    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;
+        }
+      });
+    },
+
+
+    del(row) {
+      const vm = this;
+      this.$confirm('确认删除', '提示', {
+        type: 'warning'
+      }).then(() => {
+        vm.$http.get(vm.api.delete, {
+          params: {
+            code: row.code,
+          }
+        })
+            .then((response) => {
+              console.log(response)
+              if (response.data.status == 200) {
+                this.$message({
+                  type: 'success',
+                  showClose: true,
+                  message: response.data.desc
+                })
+
+
+              }
+              this.loadData();
+            })
+      })
+          .catch(() => {
+            this.$message({
+              type: 'info',
+              showClose: true,
+              message: '取消删除'
+            })
+          });
+    },
+    cancel() {
+      this.$message({
+        message: '操作取消',
+        showClose: true,
+        type: 'info'
+      });
+      this.$refs.formData.clearValidate();
+      this.dialogFormVisible = false;
+    },
+
+
+    statusHandle(row) {
+      console.log(row)
+      const vm = this;
+      this.$confirm('是否进行此操作', '提示', {
+        type: 'warning'
+      }).then(() => {
+        vm.$http.get(vm.api.update, {
+          params: {
+            alarmName: row.alarmName,
+            alarmType: row.alarmType,
+            content: row.content,
+            startTime: row.startTime,
+            endTime: row.endTime,
+
+            sn: row.sn,
+            variableId: row.variableId,
+            recordCondition: row.condition,
+            operatorNumber: row.operatorNumber,
+            projectNumber: row.projectNumber,
+            gatewayNumber: row.gatewayNumber,
+
+            operatorCode: row.operatorCode,
+            projectCode: row.projectCode,
+            gatewayCode: row.gatewayCode,
+            deviceCode: row.deviceCode,
+            alarmConfigCode: row.alarmConfigCode,
+
+
+            code: row.code,
+            valid: row.valid,
+            status: row.status == '未处理' ? '已处理' : '未处理',
+          }
+        })
+            .then((response) => {
+              console.log(row)
+              // console.log(response)
+              if (response.data.status == 200) {
+                this.$message({
+                  type: 'success',
+                  showClose: true,
+                  message: response.data.desc
+                })
+
+              }
+              this.loadData();
+            })
+      })
+          .catch(() => {
+            this.$message({
+              type: 'info',
+              showClose: true,
+              message: '操作取消'
+            })
+          });
+
+    },
+
+    manage() {
+      let vm = this;
+      vm.$router.push('/deviceAlarmRecordDetail')
+    },
+    back() {
+      let vm = this;
+      vm.$router.back()
+    },
+
+  }
+}
+</script>
+
+<style scoped>
+.el-form-item {
+  margin-right: 10px;
+  margin-left: 10px;
+  margin-bottom: 10px;
+  margin-top: 0px;
+}
+
+.el-row {
+  margin-top: 20px;
+}
+
+
+</style>

+ 376 - 132
sources/client/vrv-platform/src/views/deviceAlarmRecord/list.vue

@@ -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>

+ 674 - 0
sources/client/vrv-platform/src/views/deviceAlarmRepairRecord/list.vue

@@ -0,0 +1,674 @@
+<template>
+  <div id="repairRecord">
+    <el-container>
+
+      <el-main>
+        <div style="margin-bottom: 10px">
+          <el-button size="medium" icon="el-icon-back" type="text" @click="back">返回</el-button>
+          <span style="margin-left: 20px; font-size: 18px">维保记录列表</span>
+        </div>
+
+        <el-button size="medium" icon="el-icon-search" style="margin-bottom: 15px" @click="search(searchFormData)">
+          查询
+        </el-button>
+        <el-button size="medium" icon="el-icon-plus" @click="showAdd" style="margin-left: 0">新增</el-button>
+
+        <div style="padding: 10px;background-color: white">
+          <el-form :inline="true" :model="searchFormData" style="background-color: white;">
+
+            <el-form-item label="维保名称">
+              <el-input placeholder="维保名称" size="mini" v-model="searchFormData.repairName"></el-input>
+            </el-form-item>
+            <el-form-item label="维保类型">
+              <el-input placeholder="维保类型" size="mini" v-model="searchFormData.repairType"></el-input>
+            </el-form-item>
+            <el-form-item label="变量名称">
+              <el-input placeholder="变量名称" size="mini" v-model="searchFormData.variableId"></el-input>
+            </el-form-item>
+            <el-form-item label="提醒周期">
+              <el-input placeholder="提醒周期" size="mini" v-model="searchFormData.promptInterval"></el-input>
+            </el-form-item>
+
+            <el-row>
+              <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: 14px">
+                <el-form-item label="维保名称" prop="repairName">
+                  <el-input placeholder="维保名称" v-model="formData.repairName"></el-input>
+                </el-form-item>
+                <el-form-item label="维保类型" prop="repairType">
+                  <el-input placeholder="维保类型" v-model="formData.repairType"></el-input>
+                </el-form-item>
+                </el-row>
+
+                <el-row style="margin-left: 14px">
+                <el-form-item label="变量名称" prop="variableId">
+                  <el-input placeholder="变量名称" v-model="formData.variableId"></el-input>
+                </el-form-item>
+                <el-form-item label="提醒周期" prop="promptInterval">
+                  <el-input placeholder="提醒周期" v-model="formData.promptInterval"></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>
+
+              <div slot="footer" class="dialog-footer" style="text-align: center">
+                <el-button @click="cancel()">取 消</el-button>
+                <el-button type="primary" @click="addOrEditMehtond('formData')">确 定</el-button>
+              </div>
+            </el-dialog>
+
+          </el-form>
+
+
+          <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="repairName" label="维保名称"></el-table-column>
+            <el-table-column prop="repairType" label="维保类型"></el-table-column>
+            <el-table-column prop="variableId" label="变量名称"></el-table-column>
+            <el-table-column prop="promptInterval" label="提醒周期"></el-table-column>
+            <el-table-column prop="lastCreateTime" label="上一次维保时间"></el-table-column>
+
+
+            <el-table-column label="状态">
+              <template slot-scope="scope">
+                {{ String(scope.row.status) === '0' ? '已禁用' : '正常' }}
+              </template>
+            </el-table-column>
+
+
+            <el-table-column label="操作">
+              <template slot-scope="scope">
+                <el-button type="text" size="medium" @click="showEdit(scope.row)">编辑</el-button>
+                <el-button type="text" size="medium" @click="del(scope.row)" style="color: #c01920">删除</el-button>
+              </template>
+            </el-table-column>
+
+          </el-table>
+
+
+          <el-pagination
+              style="margin-top: 15px;text-align: center"
+              background
+              layout="prev, pager, next"
+              :page-size="pager.pageSize"
+              :current-page="pager.pageIndex"
+              :total="pager.itemCount"
+              @current-change="handleCurrentChange"
+          >
+          </el-pagination>
+        </div>
+      </el-main>
+
+    </el-container>
+  </div>
+</template>
+
+
+<script>
+
+export default {
+  name: 'repairRecord',
+  data() {
+    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'}
+        ],
+        repairName: [
+          {required: true, message: '请输入维保名称', trigger: 'blur'}
+        ],
+        repairType: [
+          {required: true, message: '请输入维保类型', trigger: 'blur'}
+        ],
+        variableId: [
+          {required: true, message: '请输入变量Id', trigger: 'blur'}
+        ],
+        promptInterval: [
+          {required: true, message: '请输入提醒周期', trigger: 'blur'}
+        ],
+
+      },
+
+      gateways: [],
+      projects: [],
+      operators: [],
+      devices: [],
+
+      operatorProject: '',
+      projectGateway: '',
+      gatewayDevice: '',
+
+      api: {
+        list: this.$api.deviceAlarmRepairRecord.list,
+        delete: this.$api.deviceAlarmRepairRecord.delete,
+        add: this.$api.deviceAlarmRepairRecord.add,
+        update: this.$api.deviceAlarmRepairRecord.update,
+      },
+
+      value: true,
+
+      addOrEdit: 1,
+
+      dialogFormVisible: false,
+
+      pager: {
+        pageSize: 2,
+        pageIndex: 1,
+        itemCount: 0,
+      },
+
+      tableData:
+          [{
+            sn: '',
+            repairName: '',
+            repairType: '',
+            variableId: '',
+            promptInterval: '',
+            status: '1',
+            lastCreatTime: ''
+          }],
+      formData: {
+        sn: '',
+        repairName: '',
+        repairType: '',
+        variableId: '',
+        promptInterval: '',
+        status: '1',
+        lastCreatTime: '',
+        operatorNumber: '',
+        projectNumber: '',
+        gatewayNumber: '',
+      },
+      searchFormData:
+          {
+            sn: '',
+            repairName: '',
+            repairType: '',
+            variableId: '',
+            promptInterval: '',
+            status: '1',
+            lastCreatTime: '',
+            operatorNumber: '',
+            projectNumber: '',
+            gatewayNumber: '',
+          }
+    }
+  },
+
+  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)
+
+
+      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: {
+    //切换页码
+    handleCurrentChange(index) {
+      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, {
+        params: {
+          pageSize: 5,
+          pageIndex: index ? index : 1,
+
+          sn: this.searchFormData.sn,
+          repairName: this.searchFormData.repairName,
+          repairType: this.searchFormData.repairType,
+          variableId: this.searchFormData.variableId,
+          promptInterval: this.searchFormData.promptInterval,
+          lastCreatTime: this.searchFormData.lastCreatTime,
+
+          operatorNumber: this.searchFormData.operatorNumber,
+          projectNumber: this.searchFormData.projectNumber,
+          gatewayNumber: this.searchFormData.gatewayNumber,
+        }
+      })
+          .then((response) => {
+            // vm.paper = response.data.data.paper;
+            console.log(response.data.data);
+
+            vm.pager = response.data.data.pager
+
+            vm.tableData = response.data.data.deviceAlarmRepairRecords;
+          })
+    },
+    search() {
+      //console.log(this.searchFormData)
+      this.loadData();
+    },
+    showAdd() {
+      this.dialogFormVisible = true;
+
+      this.formData.sn = '',
+          this.formData.repairName = '',
+          this.formData.repairType = '',
+          this.formData.variableId = '',
+          this.formData.promptInterval = '',
+          this.formData.lastCreatTime = '',
+
+          this.formData.operatorNumber = '',
+          this.formData.projectNumber = '',
+          this.formData.gatewayNumber = ''
+      this.addOrEdit = 1
+    },
+
+    showEdit(row) {
+      console.log(row)
+
+      this.dialogFormVisible = true;
+
+      this.editRow = JSON.parse(JSON.stringify(row));
+      this.formData = this.editRow
+
+
+      this.addOrEdit = 2
+    },
+
+    addOrEditMehtond(formName) {
+      this.$refs[formName].validate((valid) => {
+        if (valid) {
+          const vm = this;
+          if (this.addOrEdit == 2) {
+            vm.$http.get(vm.api.update, {
+              params: {
+                code: this.editRow.code,
+
+                repairName: this.formData.repairName,
+                repairType: this.formData.repairType,
+                sn: this.formData.sn,
+                variableId: this.formData.variableId,
+                promptInterval: this.formData.promptInterval,
+                lastCreatTime: this.formData.lastCreatTime,
+                status: 1,
+
+                operatorNumber: this.formData.operatorNumber,
+                projectNumber: this.formData.projectNumber,
+                gatewayNumber: this.formData.gatewayNumber,
+
+              }
+            })
+                .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: {
+                repairName: this.formData.repairName,
+                repairType: this.formData.repairType,
+                sn: this.formData.sn,
+                variableId: this.formData.variableId,
+                promptInterval: this.formData.promptInterval,
+                lastCreatTime: this.formData.lastCreatTime,
+                status: 1,
+
+                operatorNumber: this.formData.operatorNumber,
+                projectNumber: this.formData.projectNumber,
+                gatewayNumber: this.formData.gatewayNumber,
+              }
+            })
+                .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;
+        }
+      });
+    },
+
+
+    del(row) {
+      const vm = this;
+      this.$confirm('确认删除', '提示', {
+        type: 'warning'
+      }).then(() => {
+        vm.$http.get(vm.api.delete, {
+          params: {
+            code: row.code,
+          }
+        })
+            .then((response) => {
+              console.log(response)
+              if (response.data.status == 200) {
+                this.$message({
+                  type: 'success',
+                  showClose: true,
+                  message: response.data.desc
+                })
+              }
+
+              this.loadData();
+            })
+      })
+          .catch(() => {
+            this.$message({
+              type: 'info',
+              showClose: true,
+              message: '取消删除'
+            })
+          });
+    },
+    cancel() {
+      this.$message({
+        message: '操作取消',
+        showClose: true,
+        type: 'info'
+      });
+
+      this.$refs.formData.clearValidate();
+      this.dialogFormVisible = false;
+    },
+
+    //启用/停用设备
+    statusHandle(row) {
+      const vm = this;
+      this.$confirm('是否进行此操作', '提示', {
+        type: 'warning'
+      }).then(() => {
+        vm.$http.get(vm.api.update, {
+          params: {
+            sn: row.sn,
+            repairType: row.repairType,
+            repairName: row.repairName,
+            variableId: row.variableId,
+            promptInterval: row.promptInterval,
+            lastCreatTime: row.lastCreatTime,
+
+            operatorNumber: row.operatorNumber,
+            projectNumber: row.projectNumber,
+            gatewayNumber: row.gatewayNumber,
+            operatorCode: row.operatorCode,
+            projectCode: row.projectCode,
+            gatewayCode: row.gatewayCode,
+
+            code: row.code,
+            valid: row.valid,
+            status: row.status == 1 ? 0 : 1,
+          }
+        })
+            .then((response) => {
+              console.log(row)
+              // console.log(response)
+              if (response.data.status == 200) {
+                this.$message({
+                  type: 'success',
+                  showClose: true,
+                  message: response.data.desc
+                })
+              }
+              this.loadData();
+            })
+      })
+          .catch(() => {
+            this.$message({
+              type: 'info',
+              showClose: true,
+              message: '操作取消'
+            })
+          });
+
+    },
+
+    manage() {
+      let vm = this;
+      vm.$router.push('/')
+    },
+
+    back() {
+      let vm = this;
+      vm.$router.back()
+    },
+
+  }
+}
+</script>
+
+<style scoped>
+.el-form-item {
+  margin-right: 10px;
+  margin-left: 10px;
+  margin-bottom: 10px;
+  margin-top: 0px;
+}
+
+.el-row{
+  margin-top: 20px;
+}
+
+</style>

+ 90 - 7
sources/client/vrv-platform/src/views/menu/menu.vue

@@ -53,9 +53,9 @@
               <el-menu-item index="/">数据曲线</el-menu-item>
               <el-menu-item index="/">数据曲线</el-menu-item>
               <el-menu-item index="/">参数设定</el-menu-item>
               <el-menu-item index="/">参数设定</el-menu-item>
               <el-menu-item index="/">系统参数</el-menu-item>
               <el-menu-item index="/">系统参数</el-menu-item>
-              <el-menu-item index="/">报警设置</el-menu-item>
-              <el-menu-item index="/">报警记录</el-menu-item>
-              <el-menu-item index="/">维保记录</el-menu-item>
+              <el-menu-item index="/deviceAlarmConfig">报警设置</el-menu-item>
+              <el-menu-item index="/detail">报警记录</el-menu-item>
+              <el-menu-item index="/deviceAlarmRepairRecord">维保记录</el-menu-item>
             </el-menu-item-group>
             </el-menu-item-group>
 
 
           </el-submenu>
           </el-submenu>
@@ -85,6 +85,7 @@
             <el-menu-item-group>
             <el-menu-item-group>
               <el-menu-item index="/role">角色管理</el-menu-item>
               <el-menu-item index="/role">角色管理</el-menu-item>
               <el-menu-item index="/power">权限管理</el-menu-item>
               <el-menu-item index="/power">权限管理</el-menu-item>
+              <el-menu-item index="/rolePower">关联角色权限</el-menu-item>
             </el-menu-item-group>
             </el-menu-item-group>
           </el-submenu>
           </el-submenu>
 
 
@@ -110,12 +111,33 @@
             <i class="el-icon-setting"></i>
             <i class="el-icon-setting"></i>
 
 
             <el-dropdown-menu slot="dropdown">
             <el-dropdown-menu slot="dropdown">
-              <el-dropdown-item>个人中心</el-dropdown-item>
-              <el-dropdown-item>修改密码</el-dropdown-item>
+              <el-dropdown-item @click.native="userInfo">个人中心</el-dropdown-item>
+              <el-dropdown-item @click.native="showUpdatePassword">修改密码</el-dropdown-item>
               <el-dropdown-item @click.native="logout">退出登录</el-dropdown-item>
               <el-dropdown-item @click.native="logout">退出登录</el-dropdown-item>
             </el-dropdown-menu>
             </el-dropdown-menu>
           </el-dropdown>
           </el-dropdown>
 
 
+          <el-dialog title="修改密码" :visible.sync="dialogFormVisible" style="width: 71% ; margin-left: 300px ;">
+
+            <el-form label-position="left" :model="formData" :rules="rules" ref="formData">
+
+              <el-row style="margin-left: 15px">
+                <el-form-item label="原密码" style="margin-left: 0px" prop="oldPassword">
+                  <el-input v-model="formData.oldPassword"></el-input>
+                </el-form-item>
+                <el-form-item label="新密码" style="" prop="newPassword">
+                  <el-input v-model="formData.newPassword"></el-input>
+                </el-form-item>
+              </el-row>
+
+            </el-form>
+
+            <div slot="footer" class="dialog-footer" style="text-align: center">
+              <el-button @click="cancel()">取 消</el-button>
+              <el-button type="primary" @click="updatePassword('formData')">确 定</el-button>
+            </div>
+          </el-dialog>
+
           <span style="float: right; margin-right: 20px; margin-top: 10px">用户名:{{ realname }}</span>
           <span style="float: right; margin-right: 20px; margin-top: 10px">用户名:{{ realname }}</span>
 
 
         </el-header>
         </el-header>
@@ -138,6 +160,7 @@ export default {
   data() {
   data() {
     return {
     return {
       realname: '',
       realname: '',
+      dialogFormVisible: false,
 
 
       index: '1',
       index: '1',
 
 
@@ -145,6 +168,20 @@ export default {
       toggle: false,//第二个图标默认隐藏
       toggle: false,//第二个图标默认隐藏
       block: true,//默认显示第一个图标
       block: true,//默认显示第一个图标
 
 
+      formData: {
+        oldPassword: '',
+        newPassword: ''
+      },
+
+      rules: {
+        oldPassword: [
+          {required: true, message: '请输入原密码', trigger: 'blur'}
+        ],
+        newPassword: [
+          {required: true, message: '请输入新密码', trigger: 'blur'}
+        ],
+      },
+
     }
     }
   },
   },
 
 
@@ -165,7 +202,6 @@ export default {
 
 
   methods: {
   methods: {
 
 
-
     isC() {
     isC() {
       this.isCollapse = !this.isCollapse;
       this.isCollapse = !this.isCollapse;
       this.toggle = !this.toggle;
       this.toggle = !this.toggle;
@@ -199,7 +235,54 @@ export default {
           message: resp.data.desc
           message: resp.data.desc
         })
         })
       })
       })
-    }
+    },
+
+    userInfo() {
+      const vm = this;
+      vm.$http.get(vm.$api.auth.userInfo).then((resp) => {
+
+        vm.$router.push({
+          path: '/userInfo',
+          query: {data: resp.data.data}
+        })
+
+      })
+    },
+
+    showUpdatePassword() {
+      this.dialogFormVisible = true;
+    },
+
+    updatePassword(formName) {
+      this.$refs[formName].validate((valid) => {
+        if (valid) {
+          const vm = this;
+          vm.$http.get(vm.$api.auth.updateUserPassword, {
+            params: {
+              oldPassword: '',
+              newPassword: ''
+            }
+          }).then((resp) => {
+            console.log(resp)
+          })
+        } else {
+          console.log('error submit!!');
+          return false;
+        }
+      });
+    },
+
+
+    cancel() {
+      this.$message({
+        message: '操作取消',
+        showClose: true,
+        type: 'info'
+      });
+
+      this.$refs.formData.clearValidate();
+      this.dialogFormVisible = false;
+    },
   }
   }
 }
 }
 </script>
 </script>

+ 0 - 1
sources/client/vrv-platform/src/views/operator/list.vue

@@ -328,7 +328,6 @@ export default {
       this.loadData();
       this.loadData();
     },
     },
     showAdd() {
     showAdd() {
-      this.$refs.formData.clearValidate();
       this.dialogFormVisible = true;
       this.dialogFormVisible = true;
 
 
       this.formData.name = '';
       this.formData.name = '';

+ 29 - 11
sources/client/vrv-platform/src/views/operatorLog/list.vue

@@ -22,29 +22,31 @@
             <el-form-item label="用户账号">
             <el-form-item label="用户账号">
               <el-input placeholder="用户账号" size="mini" v-model="searchFormData.userAccount"></el-input>
               <el-input placeholder="用户账号" size="mini" v-model="searchFormData.userAccount"></el-input>
             </el-form-item>
             </el-form-item>
-            <el-form-item label="运营商编号">
-              <el-input placeholder="运营商编号" size="mini" v-model="searchFormData.operatorNumber"></el-input>
+
+            <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>
 
 
 
 
-            <el-dialog title="日志" :visible.sync="dialogFormVisible">
+            <el-dialog title="项目" :visible.sync="dialogFormVisible" style="width: 70% ; margin-left: 300px ;margin-top: 140px">
               <el-form label-position="left" :model="formData">
               <el-form label-position="left" :model="formData">
 
 
-                <el-form-item label="用户姓名">
-                  <el-input v-model="formData.userRealname"></el-input>
-                </el-form-item>
-                <el-form-item label="用户账号">
-                  <el-input v-model="formData.userAccount"></el-input>
-                </el-form-item>
+                <el-row style="margin-left: 10px">
                 <el-form-item label="操作内容">
                 <el-form-item label="操作内容">
                   <el-input v-model="formData.content"></el-input>
                   <el-input v-model="formData.content"></el-input>
                 </el-form-item>
                 </el-form-item>
                 <el-form-item label="运营商编号">
                 <el-form-item label="运营商编号">
-                  <el-input v-model="formData.operatorNumber"></el-input>
+                  <el-select v-model="formData.operatorNumber" placeholder="运营商编号" style="width: 200px" 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>
+                </el-row>
+
               </el-form>
               </el-form>
 
 
-              <div slot="footer" class="dialog-footer">
+              <div slot="footer" class="dialog-footer" style="text-align: center">
                 <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">确 定</el-button>
               </div>
               </div>
@@ -94,6 +96,8 @@ export default {
   name: 'operatorLog',
   name: 'operatorLog',
   data() {
   data() {
     return {
     return {
+      operators:[],
+
       api: {
       api: {
         list: this.$api.operatorLog.list,
         list: this.$api.operatorLog.list,
         delete: this.$api.operatorLog.delete,
         delete: this.$api.operatorLog.delete,
@@ -136,9 +140,23 @@ export default {
 
 
   created: function () {
   created: function () {
     this.loadData();
     this.loadData();
+    this.getOperatorNumber()
   },
   },
 
 
   methods: {
   methods: {
+    getOperatorNumber() {
+      const vm = this;
+      vm.$http.get(vm.$api.operator.list, {
+        params: {
+          number: this.searchFormData.operatorNumber,
+        }
+      }).then((resp) => {
+        console.log(resp.data.data.operators)
+
+        vm.operators = resp.data.data.operators
+      })
+    },
+
     //切换页码
     //切换页码
     handleCurrentChange(index) {
     handleCurrentChange(index) {
       this.loadData(index)
       this.loadData(index)

+ 147 - 139
sources/client/vrv-platform/src/views/power/list.vue

@@ -6,78 +6,83 @@
         <span style="margin-left: 20px; font-size: 18px">权限列表</span>
         <span style="margin-left: 20px; font-size: 18px">权限列表</span>
       </div>
       </div>
 
 
-      <el-button size="medium"  icon="el-icon-search" style="margin-bottom: 15px" @click="search(searchFormData)">查询</el-button>
+      <el-button size="medium" icon="el-icon-search" style="margin-bottom: 15px" @click="search(searchFormData)">查询
+      </el-button>
       <el-button size="medium" icon="el-icon-plus" @click="showAdd" style="margin-left: 0">新增</el-button>
       <el-button size="medium" icon="el-icon-plus" @click="showAdd" style="margin-left: 0">新增</el-button>
 
 
       <div style="padding: 10px;background-color: white">
       <div style="padding: 10px;background-color: white">
-      <el-form :inline="true" :model="searchFormData" style="background-color: white;">
-        <el-form-item label="权限名称">
-          <el-input placeholder="权限名称" size="small" v-model="searchFormData.name"></el-input>
-        </el-form-item>
-        <el-form-item label="权限标识">
-          <el-input placeholder="权限标识" size="small" v-model="searchFormData.flag"></el-input>
-        </el-form-item>
-        <el-form-item label="权限类型">
-          <el-input placeholder="权限类型" size="small" v-model="searchFormData.type"></el-input>
-        </el-form-item>
-        <el-form-item label="描述">
-          <el-input placeholder="描述" size="small" v-model="searchFormData.description"></el-input>
-        </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.name"></el-input>
-            </el-form-item>
-            <el-form-item label="权限标识">
-              <el-input v-model="formData.flag"></el-input>
-            </el-form-item>
-            <el-form-item label="权限类型">
-              <el-input v-model="formData.type"></el-input>
-            </el-form-item>
-            <el-form-item label="描述">
-              <el-input v-model="formData.description"></el-input>
-            </el-form-item>
-          </el-form>
-
-          <div slot="footer" class="dialog-footer">
-            <el-button @click="cancel()">取 消</el-button>
-            <el-button type="primary" @click="addOrEditMehtond()">确 定</el-button>
-          </div>
-        </el-dialog>
-
-      </el-form>
-
-
-      <el-table :data="tableData">
-        <el-table-column  type="selection"></el-table-column>
-        <el-table-column prop="name" label="权限名称"></el-table-column>
-        <el-table-column prop="flag" label="权限标识"></el-table-column>
-        <el-table-column prop="type" label="权限类型"></el-table-column>
-        <el-table-column prop="description" label="描述"></el-table-column>
-
-
-        <el-table-column label="操作">
-          <template slot-scope="scope">
-            <el-button type="text" size="medium" @click="showEdit(scope.row)">修改</el-button>
-            <el-button type="text" size="medium" @click="del(scope.row)" style="color: #c01920">删除</el-button>
-          </template>
-        </el-table-column>
-
-      </el-table>
-
-
-      <el-pagination
-          style="margin-top: 15px;text-align: center"
-        background
-        layout="prev, pager, next"
-        :page-size="pager.pageSize"
-        :current-page="pager.pageIndex"
-        :total="pager.itemCount"
-        @current-change="handleCurrentChange"
-      >
-      </el-pagination>
+        <el-form :inline="true" :model="searchFormData" style="background-color: white;">
+          <el-form-item label="权限名称">
+            <el-input placeholder="权限名称" size="mini" v-model="searchFormData.name"></el-input>
+          </el-form-item>
+          <el-form-item label="权限标识">
+            <el-input placeholder="权限标识" size="mini" v-model="searchFormData.flag"></el-input>
+          </el-form-item>
+          <el-form-item label="权限类型">
+            <el-input placeholder="权限类型" size="mini" v-model="searchFormData.type"></el-input>
+          </el-form-item>
+
+
+          <el-dialog title="权限" :visible.sync="dialogFormVisible" style="width: 65% ; margin-left: 350px ;">
+            <el-form label-position="left" :model="formData">
+              <el-row>
+                <el-form-item label="权限名称">
+                  <el-input v-model="formData.name"></el-input>
+                </el-form-item>
+                <el-form-item label="权限标识">
+                  <el-input v-model="formData.flag"></el-input>
+                </el-form-item>
+              </el-row>
+
+              <el-row style="margin-top: 15px">
+                <el-form-item label="权限类型">
+                  <el-input v-model="formData.type"></el-input>
+                </el-form-item>
+                <el-form-item label="权限描述">
+                  <el-input v-model="formData.description"></el-input>
+                </el-form-item>
+              </el-row>
+
+
+            </el-form>
+
+            <div slot="footer" class="dialog-footer" style="text-align: center">
+              <el-button @click="cancel()">取 消</el-button>
+              <el-button type="primary" @click="addOrEditMehtond()">确 定</el-button>
+            </div>
+          </el-dialog>
+
+        </el-form>
+
+
+        <el-table :data="tableData">
+          <el-table-column type="selection"></el-table-column>
+          <el-table-column prop="name" label="权限名称"></el-table-column>
+          <el-table-column prop="flag" label="权限标识"></el-table-column>
+          <el-table-column prop="type" label="权限类型"></el-table-column>
+          <el-table-column prop="description" label="描述"></el-table-column>
+
+
+          <el-table-column label="操作">
+            <template slot-scope="scope">
+              <el-button type="text" size="medium" @click="showEdit(scope.row)">修改</el-button>
+              <el-button type="text" size="medium" @click="del(scope.row)" style="color: #c01920">删除</el-button>
+            </template>
+          </el-table-column>
+
+        </el-table>
+
+
+        <el-pagination
+            style="margin-top: 15px;text-align: center"
+            background
+            layout="prev, pager, next"
+            :page-size="pager.pageSize"
+            :current-page="pager.pageIndex"
+            :total="pager.itemCount"
+            @current-change="handleCurrentChange"
+        >
+        </el-pagination>
       </div>
       </div>
 
 
     </el-main>
     </el-main>
@@ -108,12 +113,12 @@ export default {
       },
       },
 
 
       tableData:
       tableData:
-        [{
-          name: '',
-          flag: '',
-          type: '',
-          description: '',
-        }],
+          [{
+            name: '',
+            flag: '',
+            type: '',
+            description: '',
+          }],
       formData: {
       formData: {
         name: '',
         name: '',
         flag: '',
         flag: '',
@@ -121,12 +126,12 @@ export default {
         description: '',
         description: '',
       },
       },
       searchFormData:
       searchFormData:
-        {
-          name: '',
-          flag: '',
-          type: '',
-          description: '',
-        }
+          {
+            name: '',
+            flag: '',
+            type: '',
+            description: '',
+          }
     }
     }
   },
   },
 
 
@@ -142,9 +147,9 @@ export default {
 
 
     loadData(index) {
     loadData(index) {
       const vm = this;
       const vm = this;
-      vm.$http.get(vm.api.list,  {
+      vm.$http.get(vm.api.list, {
         params: {
         params: {
-          pageSize: 3,
+          pageSize: 5,
           pageIndex: index ? index : 1,
           pageIndex: index ? index : 1,
 
 
           name: this.searchFormData.name,
           name: this.searchFormData.name,
@@ -154,14 +159,14 @@ export default {
 
 
         }
         }
       })
       })
-        .then((response) => {
-          // vm.paper = response.data.data.paper;
-          //console.log(response.data.data);
+          .then((response) => {
+            // vm.paper = response.data.data.paper;
+            //console.log(response.data.data);
 
 
-          vm.pager = response.data.data.pager
+            vm.pager = response.data.data.pager
 
 
-          vm.tableData = response.data.data.powers;
-        })
+            vm.tableData = response.data.data.powers;
+          })
     },
     },
     search() {
     search() {
       //console.log(this.searchFormData)
       //console.log(this.searchFormData)
@@ -180,12 +185,13 @@ 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
     },
     },
@@ -194,8 +200,9 @@ export default {
     addOrEditMehtond() {
     addOrEditMehtond() {
       const vm = this;
       const vm = this;
       if (this.addOrEdit == 2) {
       if (this.addOrEdit == 2) {
-        vm.$http.get(vm.api.update,  {
+        vm.$http.get(vm.api.update, {
           params: {
           params: {
+            code: this.editRow.code,
             name: this.formData.name,
             name: this.formData.name,
             flag: this.formData.flag,
             flag: this.formData.flag,
             type: this.formData.type,
             type: this.formData.type,
@@ -203,29 +210,29 @@ export default {
 
 
           }
           }
         })
         })
-          .then((response) => {
-            console.log(response)
+            .then((response) => {
+              console.log(response)
 
 
-            if (response.data.status == 200) {
+              if (response.data.status == 200) {
 
 
-              this.$message({
-                type: 'success',
-                showClose: true,
-                message: response.data.desc
-              })
-            }
+                this.$message({
+                  type: 'success',
+                  showClose: true,
+                  message: response.data.desc
+                })
+              }
 
 
-            this.dialogFormVisible = false;
+              this.dialogFormVisible = false;
 
 
-            this.loadData();
+              this.loadData();
 
 
-          })
-          .catch(() => {
-          });
+            })
+            .catch(() => {
+            });
       }
       }
 
 
       if (this.addOrEdit == 1) {
       if (this.addOrEdit == 1) {
-        vm.$http.get(vm.api.add,  {
+        vm.$http.get(vm.api.add, {
           params: {
           params: {
             name: this.formData.name,
             name: this.formData.name,
             flag: this.formData.flag,
             flag: this.formData.flag,
@@ -233,20 +240,20 @@ export default {
             description: this.formData.description,
             description: this.formData.description,
           }
           }
         })
         })
-          .then((response) => {
-            if (response.data.status == 200) {
+            .then((response) => {
+              if (response.data.status == 200) {
 
 
-              this.dialogFormVisible = false;
+                this.dialogFormVisible = false;
 
 
-              this.$message({
-                type: 'success',
-                showClose: true,
-                message: response.data.desc
-              })
+                this.$message({
+                  type: 'success',
+                  showClose: true,
+                  message: response.data.desc
+                })
 
 
-              this.loadData();
-            }
-          })
+                this.loadData();
+              }
+            })
       }
       }
     },
     },
 
 
@@ -255,31 +262,31 @@ export default {
       this.$confirm('确认删除', '提示', {
       this.$confirm('确认删除', '提示', {
         type: 'warning'
         type: 'warning'
       }).then(() => {
       }).then(() => {
-        vm.$http.get(vm.api.delete,  {
+        vm.$http.get(vm.api.delete, {
           params: {
           params: {
             code: row.code,
             code: row.code,
           }
           }
         })
         })
-          .then((response) => {
-            console.log(response)
-            if (response.data.status == 200) {
-              this.$message({
-                type: 'success',
-                showClose: true,
-                message: response.data.desc
-              })
-
-            }
-            this.loadData();
-          })
+            .then((response) => {
+              console.log(response)
+              if (response.data.status == 200) {
+                this.$message({
+                  type: 'success',
+                  showClose: true,
+                  message: response.data.desc
+                })
+
+              }
+              this.loadData();
+            })
       })
       })
-        .catch(() => {
-          this.$message({
-            type: 'info',
-            showClose: true,
-            message: '取消删除'
-          })
-        });
+          .catch(() => {
+            this.$message({
+              type: 'info',
+              showClose: true,
+              message: '取消删除'
+            })
+          });
     },
     },
     cancel() {
     cancel() {
       this.$message({
       this.$message({
@@ -297,11 +304,12 @@ export default {
 </script>
 </script>
 
 
 <style scoped>
 <style scoped>
-.el-form-item{
+.el-form-item {
   margin-right: 10px;
   margin-right: 10px;
   margin-left: 10px;
   margin-left: 10px;
   margin-bottom: 10px;
   margin-bottom: 10px;
   margin-top: 0px;
   margin-top: 0px;
 }
 }
 
 
+
 </style>
 </style>

+ 2 - 2
sources/client/vrv-platform/src/views/project/list.vue

@@ -48,7 +48,7 @@
             </el-form-item>
             </el-form-item>
 
 
             <el-form-item label="运营商编号" style="margin-top: 6px" size="mini">
             <el-form-item label="运营商编号" style="margin-top: 6px" size="mini">
-              <el-select v-model="searchFormData.operatorNumber" placeholder="运营商编号" style="width: 180px">
+              <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-option :value="i.number" v-for="(i,index) in operators" :key="index" :label="i.number"></el-option>
 
 
@@ -79,7 +79,7 @@
 
 
                 <el-row style="margin-left: 0px ;margin-top: 20px">
                 <el-row style="margin-left: 0px ;margin-top: 20px">
                   <el-form-item label="运营商编号" prop="operatorNumber">
                   <el-form-item label="运营商编号" prop="operatorNumber">
-                    <el-select v-model="formData.operatorNumber" placeholder="运营商编号" style="width: 202px">
+                    <el-select v-model="formData.operatorNumber" placeholder="运营商编号" style="width: 202px" clearable>
 
 
                       <el-option :value="i.number" v-for="(i,index) in operators" :key="index"
                       <el-option :value="i.number" v-for="(i,index) in operators" :key="index"
                                  :label="i.number"></el-option>
                                  :label="i.number"></el-option>

+ 10 - 11
sources/client/vrv-platform/src/views/role/list.vue

@@ -20,26 +20,24 @@
         <el-form-item label="角色标识">
         <el-form-item label="角色标识">
           <el-input placeholder="角色标识" size="mini" v-model="searchFormData.flag"></el-input>
           <el-input placeholder="角色标识" size="mini" v-model="searchFormData.flag"></el-input>
         </el-form-item>
         </el-form-item>
-        <el-form-item label="描述">
-          <el-input placeholder="描述" size="mini" v-model="searchFormData.description"></el-input>
-        </el-form-item>
-
 
 
 
 
-        <el-dialog title="角色" :visible.sync="dialogFormVisible">
+        <el-dialog title="角色" :visible.sync="dialogFormVisible" style="width: 65% ; margin-left: 350px ;">
           <el-form label-position="left" :model="formData">
           <el-form label-position="left" :model="formData">
+            <el-row>
             <el-form-item label="角色名称">
             <el-form-item label="角色名称">
               <el-input v-model="formData.name"></el-input>
               <el-input v-model="formData.name"></el-input>
             </el-form-item>
             </el-form-item>
             <el-form-item label="角色标识">
             <el-form-item label="角色标识">
               <el-input v-model="formData.flag"></el-input>
               <el-input v-model="formData.flag"></el-input>
             </el-form-item>
             </el-form-item>
-            <el-form-item label="描述">
+            </el-row>
+            <el-form-item label="角色描述" style="margin-top: 20px;margin-left: 10px">
               <el-input v-model="formData.description"></el-input>
               <el-input v-model="formData.description"></el-input>
             </el-form-item>
             </el-form-item>
           </el-form>
           </el-form>
 
 
-          <div slot="footer" class="dialog-footer">
+          <div slot="footer" class="dialog-footer" style="text-align: center">
             <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()">确 定</el-button>
           </div>
           </div>
@@ -52,7 +50,7 @@
         <el-table-column  type="selection"></el-table-column>
         <el-table-column  type="selection"></el-table-column>
         <el-table-column prop="name" label="角色名称"></el-table-column>
         <el-table-column prop="name" label="角色名称"></el-table-column>
         <el-table-column prop="flag" label="角色标识"></el-table-column>
         <el-table-column prop="flag" label="角色标识"></el-table-column>
-        <el-table-column prop="description" label="描述"></el-table-column>
+        <el-table-column prop="description" label="角色描述"></el-table-column>
 
 
 
 
         <el-table-column label="操作">
         <el-table-column label="操作">
@@ -138,7 +136,7 @@ export default {
       const vm = this;
       const vm = this;
       vm.$http.get(vm.api.list,  {
       vm.$http.get(vm.api.list,  {
         params: {
         params: {
-          pageSize: 3,
+          pageSize: 5,
           pageIndex: index ? index : 1,
           pageIndex: index ? index : 1,
 
 
           name: this.searchFormData.name,
           name: this.searchFormData.name,
@@ -172,12 +170,12 @@ 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
     },
     },
@@ -188,6 +186,7 @@ export default {
       if (this.addOrEdit == 2) {
       if (this.addOrEdit == 2) {
         vm.$http.get(vm.api.update,  {
         vm.$http.get(vm.api.update,  {
           params: {
           params: {
+            code:this.editRow.code,
             name: this.formData.name,
             name: this.formData.name,
             flag: this.formData.flag,
             flag: this.formData.flag,
             description: this.formData.description,
             description: this.formData.description,

+ 315 - 0
sources/client/vrv-platform/src/views/rolePower/list.vue

@@ -0,0 +1,315 @@
+<template>
+  <div id="rolePower">
+    <el-main>
+
+      <div style="margin-bottom: 10px">
+        <el-button size="medium" icon="el-icon-back" type="text">返回</el-button>
+        <span style="margin-left: 20px; font-size: 18px">角色权限列表</span>
+      </div>
+
+
+      <el-button size="medium" icon="el-icon-search" style="margin-bottom: 15px" @click="search(searchFormData)">查询
+      </el-button>
+      <el-button size="medium" icon="el-icon-plus" @click="showAdd" style="margin-left: 0">新增</el-button>
+
+
+      <div style="padding: 10px;background-color: white">
+        <el-form :inline="true" :model="searchFormData" style="background-color: white;" size="mini">
+          <el-row style="margin-top: 6px">
+            <el-form-item label="角色标识">
+              <el-select v-model="searchFormData.roleFlag" placeholder="角色标识" style="width: 180px" clearable>
+                <el-option :value="item.flag" v-for="item in roles" :label="item.flag" :key="item.flag"></el-option>
+              </el-select>
+            </el-form-item>
+
+            <el-form-item label="权限标识">
+              <el-select v-model="searchFormData.powerFlag" placeholder="权限标识" clearable>
+                <el-option :value="item.flag" v-for="item in powers" :label="item.flag" :key="item.flag"></el-option>
+              </el-select>
+            </el-form-item>
+          </el-row>
+
+
+          <el-dialog title="关联角色权限" :visible.sync="dialogFormVisible" style="width: 65% ; margin-left: 350px ;">
+            <el-form label-position="left" :model="formData">
+              <el-row style="margin-top: 6px">
+                <el-form-item label="角色标识">
+                  <el-select v-model="formData.roleFlag" placeholder="角色标识" style="width: 180px" clearable>
+                    <el-option :value="item.flag" v-for="item in roles" :label="item.flag" :key="item.flag"></el-option>
+                  </el-select>
+                </el-form-item>
+
+                <el-form-item label="权限标识">
+                  <el-select v-model="formData.powerFlag" placeholder="权限标识" clearable>
+                    <el-option :value="item.flag" v-for="item in powers" :label="item.flag" :key="item.flag"></el-option>
+                  </el-select>
+                </el-form-item>
+              </el-row>
+            </el-form>
+
+            <div slot="footer" class="dialog-footer" style="text-align: center">
+              <el-button @click="cancel()">取 消</el-button>
+              <el-button type="primary" @click="addOrEditMehtond()">确 定</el-button>
+            </div>
+          </el-dialog>
+
+        </el-form>
+
+
+        <el-table :data="tableData">
+          <el-table-column type="selection"></el-table-column>
+          <el-table-column prop="roleFlag" label="角色标识"></el-table-column>
+          <el-table-column prop="powerFlag" label="权限标识"></el-table-column>
+
+          <el-table-column label="操作">
+            <template slot-scope="scope">
+              <el-button type="text" size="medium" @click="showEdit(scope.row)">修改</el-button>
+              <el-button type="text" size="medium" @click="del(scope.row)" style="color: #c01920">删除</el-button>
+            </template>
+          </el-table-column>
+
+        </el-table>
+
+
+        <el-pagination
+            style="margin-top: 15px;text-align: center"
+            background
+            layout="prev, pager, next"
+            :page-size="pager.pageSize"
+            :current-page="pager.pageIndex"
+            :total="pager.itemCount"
+            @current-change="handleCurrentChange"
+        >
+        </el-pagination>
+      </div>
+
+    </el-main>
+  </div>
+
+</template>
+
+<script>
+export default {
+  name: 'rolePower',
+  data() {
+    return {
+      roles: [],
+      powers: [],
+
+      api: {
+        list: this.$api.rolePower.list,
+        delete: this.$api.rolePower.delete,
+        add: this.$api.rolePower.add,
+        update: this.$api.rolePower.update,
+      },
+
+      addOrEdit: 1,
+
+      dialogFormVisible: false,
+
+      pager: {
+        pageSize: 2,
+        pageIndex: 1,
+        itemCount: 0,
+      },
+
+      tableData:
+          [{
+            roleFlag: '',
+            powerFlag: '',
+          }],
+
+      formData: {
+        roleFlag: '',
+        powerFlag: '',
+      },
+
+      searchFormData:
+          {
+            roleFlag: '',
+            powerFlag: '',
+          }
+    }
+  },
+
+  created: function () {
+    this.loadData();
+    this.getRole();
+    this.getPower();
+  },
+
+  methods: {
+    getRole() {
+      const vm = this;
+      vm.$http.get(vm.$api.role.list).then((resp) => {
+        vm.roles = resp.data.data.roles
+      })
+    },
+    getPower() {
+      const vm = this;
+      vm.$http.get(vm.$api.power.list).then((resp) => {
+        vm.powers = resp.data.data.powers
+      })
+    },
+
+
+    //切换页码
+    handleCurrentChange(index) {
+      this.loadData(index)
+    },
+
+    loadData(index) {
+      const vm = this;
+      vm.$http.get(vm.api.list, {
+        params: {
+          pageSize: 5,
+          pageIndex: index ? index : 1,
+
+          roleFlag: this.searchFormData.roleFlag,
+          powerFlag: this.searchFormData.powerFlag,
+        }
+      })
+          .then((response) => {
+            // vm.paper = response.data.data.paper;
+            console.log(response.data.data);
+
+            vm.pager = response.data.data.pager
+
+            vm.tableData = response.data.data.rolePowers;
+          })
+    },
+
+    search() {
+      this.loadData();
+    },
+
+    showAdd() {
+      this.dialogFormVisible = true;
+
+      this.formData.roleFlag = '';
+      this.formData.powerFlag = '';
+      this.addOrEdit = 1
+    },
+
+    showEdit(row) {
+      console.log(row)
+
+      this.dialogFormVisible = true;
+
+      this.editRow = JSON.parse(JSON.stringify(row));
+      this.formData = this.editRow
+
+      this.addOrEdit = 2
+    },
+
+
+    addOrEditMehtond() {
+      const vm = this;
+      if (this.addOrEdit == 2) {
+        vm.$http.get(vm.api.update, {
+          params: {
+            code: this.editRow.code,
+            roleFlag: this.formData.roleFlag,
+            powerFlag: this.formData.powerFlag,
+          }
+        })
+            .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: {
+            roleFlag: this.formData.roleFlag,
+            powerFlag: this.formData.powerFlag,
+          }
+        })
+            .then((response) => {
+              if (response.data.status == 200) {
+
+                this.dialogFormVisible = false;
+
+                this.$message({
+                  type: 'success',
+                  showClose: true,
+                  message: response.data.desc
+                })
+
+                this.loadData();
+              }
+            })
+      }
+    },
+
+    del(row) {
+      const vm = this;
+      this.$confirm('确认删除', '提示', {
+        type: 'warning'
+      }).then(() => {
+        vm.$http.get(vm.api.delete, {
+          params: {
+            code: row.code,
+          }
+        })
+            .then((response) => {
+              console.log(response)
+              if (response.data.status == 200) {
+                this.$message({
+                  type: 'success',
+                  showClose: true,
+                  message: response.data.desc
+                })
+
+              }
+              this.loadData();
+            })
+      })
+          .catch(() => {
+            this.$message({
+              type: 'info',
+              showClose: true,
+              message: '取消删除'
+            })
+          });
+    },
+    cancel() {
+      this.$message({
+        message: '操作取消',
+        showClose: true,
+        type: 'info'
+      });
+
+      this.dialogFormVisible = false;
+
+    },
+
+  }
+}
+</script>
+
+<style scoped>
+.el-form-item {
+  margin-right: 10px;
+  margin-left: 10px;
+  margin-bottom: 10px;
+  margin-top: 0px;
+}
+
+</style>

+ 70 - 20
sources/client/vrv-platform/src/views/user/list.vue

@@ -2,7 +2,7 @@
   <div id="user">
   <div id="user">
     <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>
 
 
@@ -23,37 +23,55 @@
         <el-form-item label="手机号">
         <el-form-item label="手机号">
           <el-input placeholder="手机号" size="mini" v-model="searchFormData.phone"></el-input>
           <el-input placeholder="手机号" size="mini" v-model="searchFormData.phone"></el-input>
         </el-form-item>
         </el-form-item>
-        <el-form-item label="角色">
-          <el-input placeholder="角色" size="mini" v-model="searchFormData.roleFlag"></el-input>
+
+        <el-form-item label="角色标识" style="margin-top: 6px" size="mini">
+          <el-select v-model="searchFormData.roleFlag" placeholder="角色标识" style="width: 180px" clearable>
+            <el-option :value="i.flag" v-for="(i,index) in roles" :key="index" :label="i.flag"></el-option>
+          </el-select>
         </el-form-item>
         </el-form-item>
-        <el-form-item label="运营商编号">
-          <el-input placeholder="运营商编号" size="mini" v-model="searchFormData.operatorNumber"></el-input>
+
+        <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>
 
 
 
 
-        <el-dialog title="用户" :visible.sync="dialogFormVisible">
+        <el-dialog title="用户" :visible.sync="dialogFormVisible" style="width: 68% ; margin-left: 320px ;">
           <el-form label-position="left" :model="formData">
           <el-form label-position="left" :model="formData">
-            <el-form-item label="姓名">
+            <el-row style="margin-left: 15px">
+            <el-form-item label="姓名" style="margin-left: 28px;margin-right: 50px">
               <el-input v-model="formData.realname"></el-input>
               <el-input v-model="formData.realname"></el-input>
             </el-form-item>
             </el-form-item>
             <el-form-item label="账号">
             <el-form-item label="账号">
               <el-input v-model="formData.account"></el-input>
               <el-input v-model="formData.account"></el-input>
             </el-form-item>
             </el-form-item>
-            <el-form-item label="手机号">
+            </el-row>
+
+            <el-row style="margin-left: 15px">
+            <el-form-item label="手机号" style="margin-left: 14px;margin-right: 50px">
               <el-input v-model="formData.phone"></el-input>
               <el-input v-model="formData.phone"></el-input>
             </el-form-item>
             </el-form-item>
             <el-form-item label="密码">
             <el-form-item label="密码">
               <el-input v-model="formData.password"></el-input>
               <el-input v-model="formData.password"></el-input>
             </el-form-item>
             </el-form-item>
-            <el-form-item label="绑定角色">
-              <el-input v-model="formData.roleFlag"></el-input>
+            </el-row>
+
+            <el-row style="margin-left: 15px">
+            <el-form-item label="角色标识" style="margin-left: 0px">
+              <el-select v-model="formData.roleFlag" placeholder="角色标识" style="width: 200px" clearable>
+                <el-option :value="i.flag" v-for="(i,index) in roles" :key="index" :label="i.flag"></el-option>
+              </el-select>
             </el-form-item>
             </el-form-item>
-            <el-form-item label="绑定运营商">
-              <el-input v-model="formData.operatorNumber"></el-input>
+            <el-form-item label="运营商编号">
+              <el-select v-model="formData.operatorNumber" placeholder="运营商编号" style="width: 200px" 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>
+            </el-row>
           </el-form>
           </el-form>
 
 
-          <div slot="footer" class="dialog-footer">
+          <div slot="footer" class="dialog-footer" style="text-align: center">
             <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()">确 定</el-button>
           </div>
           </div>
@@ -67,8 +85,8 @@
         <el-table-column prop="realname" label="姓名"></el-table-column>
         <el-table-column prop="realname" label="姓名"></el-table-column>
         <el-table-column prop="account" label="账号"></el-table-column>
         <el-table-column prop="account" label="账号"></el-table-column>
         <el-table-column prop="phone" label="手机号"></el-table-column>
         <el-table-column prop="phone" label="手机号"></el-table-column>
-        <el-table-column prop="password" label="密码"></el-table-column>
-        <el-table-column prop="roleFlag" label="角色"></el-table-column>
+<!--        <el-table-column prop="password" label="密码"></el-table-column>-->
+        <el-table-column prop="roleFlag" label="角色标识"></el-table-column>
         <el-table-column prop="operatorNumber" label="运营商编号"></el-table-column>
         <el-table-column prop="operatorNumber" label="运营商编号"></el-table-column>
 
 
 
 
@@ -104,6 +122,9 @@ export default {
   name: 'user',
   name: 'user',
   data() {
   data() {
     return {
     return {
+      roles:[],
+      operators:[],
+
       api: {
       api: {
         list: this.$api.user.list,
         list: this.$api.user.list,
         delete: this.$api.user.delete,
         delete: this.$api.user.delete,
@@ -154,10 +175,31 @@ export default {
   },
   },
 
 
   created: function () {
   created: function () {
+    this.getOperatorNumber();
+    this.getRoles()
     this.loadData();
     this.loadData();
   },
   },
 
 
   methods: {
   methods: {
+    getOperatorNumber() {
+      const vm = this;
+      vm.$http.get(vm.$api.operator.list).then((resp) => {
+
+        console.log(resp.data.data.operators)
+
+        vm.operators = resp.data.data.operators
+      })
+    },
+    getRoles() {
+      const vm = this;
+      vm.$http.get(vm.$api.role.list).then((resp) => {
+
+        console.log(resp.data.data.roles)
+
+        vm.roles = resp.data.data.roles
+      })
+    },
+
     //切换页码
     //切换页码
     handleCurrentChange(index) {
     handleCurrentChange(index) {
       this.loadData(index)
       this.loadData(index)
@@ -167,7 +209,7 @@ export default {
       const vm = this;
       const vm = this;
       vm.$http.get(vm.api.list,  {
       vm.$http.get(vm.api.list,  {
         params: {
         params: {
-          pageSize: 3,
+          pageSize: 5,
           pageIndex: index ? index : 1,
           pageIndex: index ? index : 1,
 
 
           realname: this.searchFormData.realname,
           realname: this.searchFormData.realname,
@@ -205,14 +247,14 @@ export default {
 
 
     showEdit(row) {
     showEdit(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() {
     addOrEditMehtond() {
@@ -319,6 +361,10 @@ export default {
       this.dialogFormVisible = false;
       this.dialogFormVisible = false;
 
 
     },
     },
+    back() {
+      let vm = this;
+      vm.$router.back()
+    }
 
 
   }
   }
 }
 }
@@ -332,4 +378,8 @@ export default {
   margin-bottom: 10px;
   margin-bottom: 10px;
   margin-top: 0px;
   margin-top: 0px;
 }
 }
+
+.el-row{
+  margin-top: 10px;
+}
 </style>
 </style>

+ 151 - 0
sources/client/vrv-platform/src/views/user/userInfo.vue

@@ -0,0 +1,151 @@
+<template>
+  <div id="userInfo">
+    <el-main>
+      <div style="margin-bottom: 10px">
+        <el-button size="medium" icon="el-icon-back" type="text" @click="back">返回</el-button>
+        <span style="margin-left: 20px; font-size: 18px">个人中心</span>
+      </div>
+
+      <div style="padding: 10px;background-color: white">
+
+        <div>
+
+            姓名:{{ this.realname }}<br>
+            账号:{{this.account}}<br>
+            手机号:{{this.phone}}<br>
+            关联角色:{{this.roleFlag}}<br>
+            关联运营商:{{this.operatorNumber}}<br>
+        </div>
+
+      </div>
+
+    </el-main>
+  </div>
+
+</template>
+
+<script>
+export default {
+  name: 'userInfo',
+  data() {
+    return {
+      realname: '',
+      account: '',
+      phone: '',
+      password: '',
+      roleFlag: '',
+      operatorNumber: '',
+
+      addOrEdit: 1,
+
+      dialogFormVisible: false,
+    }
+  },
+
+  mounted: function () {
+
+    this.loadData();
+  },
+
+  methods: {
+
+    //切换页码
+    handleCurrentChange(index) {
+      this.loadData(index)
+    },
+
+    loadData() {
+      var data = this.$route.query.data;
+
+      console.log(data.user.realname)
+
+      this.realname = data.user.realname
+      this.account = data.user.account
+      this.phone = data.user.phone
+      this.operatorNumber = data.user.operatorNumber
+      this.roleFlag = data.user.roleFlag
+    },
+
+
+    showEdit(row) {
+
+      this.dialogFormVisible = true;
+
+      this.editRow = JSON.parse(JSON.stringify(row));
+      this.formData = this.editRow
+
+      this.addOrEdit = 2
+    }
+    ,
+
+
+    addOrEditMehtond() {
+      const vm = this;
+      if (this.addOrEdit == 2) {
+        vm.$http.get(vm.api.update, {
+          params: {
+            code: this.formData.code,
+            realname: this.formData.realname,
+            account: this.formData.account,
+            roleFlag: this.formData.roleFlag,
+            operatorNumber: this.formData.operatorNumber,
+            phone: this.formData.phone,
+            password: this.formData.password,
+          }
+        })
+            .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(() => {
+            });
+      }
+
+    },
+
+
+    cancel() {
+      this.$message({
+        message: '操作取消',
+        showClose: true,
+        type: 'info'
+      });
+
+      this.dialogFormVisible = false;
+
+    },
+    back() {
+      let vm = this;
+      vm.$router.back()
+    }
+
+  }
+}
+</script>
+
+
+<style scoped>
+.el-form-item {
+  margin-right: 10px;
+  margin-left: 10px;
+  margin-bottom: 10px;
+  margin-top: 0px;
+}
+
+.el-row {
+  margin-top: 10px;
+}
+</style>

+ 1 - 1
sources/server/vrv/run/application.pid

@@ -1 +1 @@
-12068
+12384

+ 2 - 0
sources/server/vrv/vrv-core-service/src/main/java/com/kuyuntech/vrv/coreservice/dao/core/UserDao.java

@@ -16,4 +16,6 @@ public interface UserDao extends FastbootRepository<User, Long> {
     User findByAccountAndPasswordAndValid(String account, String password, Short valid);
     User findByAccountAndPasswordAndValid(String account, String password, Short valid);
 
 
     User findByRoleFlagAndValidAndCode(String roleFlag, short valid, String code);
     User findByRoleFlagAndValidAndCode(String roleFlag, short valid, String code);
+
+    User findByAccountAndValid(String userAccount, short valid);
 }
 }

+ 1 - 0
sources/server/vrv/vrv-core-service/src/main/java/com/kuyuntech/vrv/coreservice/service/core/impl/DeviceAlarmRecordServiceImpl.java

@@ -62,6 +62,7 @@ public class DeviceAlarmRecordServiceImpl extends AbstractFastbootService<Device
         String projectNumber = deviceAlarmRecordBean.getProjectNumber();
         String projectNumber = deviceAlarmRecordBean.getProjectNumber();
         String gatewayNumber = deviceAlarmRecordBean.getGatewayNumber();
         String gatewayNumber = deviceAlarmRecordBean.getGatewayNumber();
         String sn = deviceAlarmRecordBean.getSn();
         String sn = deviceAlarmRecordBean.getSn();
+
         String variableId = deviceAlarmRecordBean.getVariableId();
         String variableId = deviceAlarmRecordBean.getVariableId();
 
 
         if ((operatorNumber == null || operatorNumber == "")
         if ((operatorNumber == null || operatorNumber == "")

+ 30 - 3
sources/server/vrv/vrv-core-service/src/main/java/com/kuyuntech/vrv/coreservice/service/core/impl/DeviceAlarmRepairRecordServiceImpl.java

@@ -57,6 +57,7 @@ public class DeviceAlarmRepairRecordServiceImpl extends AbstractFastbootService<
     public DeviceAlarmRepairRecordBean add(DeviceAlarmRepairRecordBean deviceAlarmRepairRecordBean) {
     public DeviceAlarmRepairRecordBean add(DeviceAlarmRepairRecordBean deviceAlarmRepairRecordBean) {
 
 
         DeviceAlarmRepairRecord deviceAlarmRepairRecord = new DeviceAlarmRepairRecord();
         DeviceAlarmRepairRecord deviceAlarmRepairRecord = new DeviceAlarmRepairRecord();
+
         beanToDomain(deviceAlarmRepairRecordBean,deviceAlarmRepairRecord,"id");
         beanToDomain(deviceAlarmRepairRecordBean,deviceAlarmRepairRecord,"id");
 
 
 
 
@@ -64,13 +65,11 @@ public class DeviceAlarmRepairRecordServiceImpl extends AbstractFastbootService<
         String projectNumber = deviceAlarmRepairRecordBean.getProjectNumber();
         String projectNumber = deviceAlarmRepairRecordBean.getProjectNumber();
         String gatewayNumber = deviceAlarmRepairRecordBean.getGatewayNumber();
         String gatewayNumber = deviceAlarmRepairRecordBean.getGatewayNumber();
         String sn = deviceAlarmRepairRecordBean.getSn();
         String sn = deviceAlarmRepairRecordBean.getSn();
-        String variableId = deviceAlarmRepairRecordBean.getVariableId();
 
 
         if ((operatorNumber == null || operatorNumber == "")
         if ((operatorNumber == null || operatorNumber == "")
                 && (projectNumber == null || projectNumber == "")
                 && (projectNumber == null || projectNumber == "")
                 && (gatewayNumber == null || gatewayNumber == "")
                 && (gatewayNumber == null || gatewayNumber == "")
-                && (sn == null || sn == "")
-                && (variableId == null || variableId == "")) {
+                && (sn == null || sn == "")) {
 
 
             deviceAlarmRepairRecordDao.save(deviceAlarmRepairRecord);
             deviceAlarmRepairRecordDao.save(deviceAlarmRepairRecord);
 
 
@@ -114,6 +113,34 @@ public class DeviceAlarmRepairRecordServiceImpl extends AbstractFastbootService<
 
 
         beanToDomain(deviceAlarmRepairRecordBean,deviceAlarmRepairRecord,"id","code","version","createTime","updateTime","valid");
         beanToDomain(deviceAlarmRepairRecordBean,deviceAlarmRepairRecord,"id","code","version","createTime","updateTime","valid");
 
 
+        String operatorNumber = deviceAlarmRepairRecordBean.getOperatorNumber();
+        String projectNumber = deviceAlarmRepairRecordBean.getProjectNumber();
+        String gatewayNumber = deviceAlarmRepairRecordBean.getGatewayNumber();
+        String sn = deviceAlarmRepairRecordBean.getSn();
+
+        if ((operatorNumber == null || operatorNumber == "")
+                && (projectNumber == null || projectNumber == "")
+                && (gatewayNumber == null || gatewayNumber == "")
+                && (sn == null || sn == "")) {
+
+            deviceAlarmRepairRecordDao.save(deviceAlarmRepairRecord);
+
+            domainToBean(deviceAlarmRepairRecord, deviceAlarmRepairRecordBean);
+
+            return deviceAlarmRepairRecordBean;
+        }
+
+        Operator operator = operatorDao.findByNumberAndValid(operatorNumber, VALID);
+        Project project = projectDao.findByNumberAndValid(projectNumber, VALID);
+        Gateway gateway = gatewayDao.findByNumberAndValid(gatewayNumber, VALID);
+        Device device = deviceDao.findBySnAndValid(sn, VALID);
+
+        deviceAlarmRepairRecord.setOperatorCode(operator.getCode());
+        deviceAlarmRepairRecord.setProjectCode(project.getCode());
+        deviceAlarmRepairRecord.setGatewayCode(gateway.getCode());
+        deviceAlarmRepairRecord.setDeviceCode(device.getCode());
+
+
         deviceAlarmRepairRecordDao.save(deviceAlarmRepairRecord);
         deviceAlarmRepairRecordDao.save(deviceAlarmRepairRecord);
 
 
         domainToBean(deviceAlarmRepairRecord,deviceAlarmRepairRecordBean);
         domainToBean(deviceAlarmRepairRecord,deviceAlarmRepairRecordBean);

+ 38 - 0
sources/server/vrv/vrv-core-service/src/main/java/com/kuyuntech/vrv/coreservice/service/core/impl/DeviceServiceImpl.java

@@ -109,6 +109,44 @@ public class DeviceServiceImpl extends AbstractFastbootService<Device, DeviceBea
 
 
         beanToDomain(deviceBean, device, "id", "code", "version", "createTime", "updateTime", "valid");
         beanToDomain(deviceBean, device, "id", "code", "version", "createTime", "updateTime", "valid");
 
 
+        String operatorNumber = deviceBean.getOperatorNumber();
+        String projectNumber = deviceBean.getProjectNumber();
+        String gatewayNumber = deviceBean.getGatewayNumber();
+
+        Operator operator = operatorDao.findByNumberAndValid(operatorNumber, VALID);
+        Project project = projectDao.findByNumberAndValid(projectNumber, VALID);
+        Gateway gateway = gatewayDao.findByNumberAndValid(gatewayNumber, VALID);
+
+        if (operatorNumber == null || operatorNumber == "") {
+
+            deviceDao.save(device);
+
+            domainToBean(device, deviceBean);
+
+            return deviceBean;
+        }
+        if (projectNumber == null || projectNumber == "") {
+
+            deviceDao.save(device);
+
+            domainToBean(device, deviceBean);
+
+            return deviceBean;
+        }
+        if (gatewayNumber == null || gatewayNumber == "") {
+
+            deviceDao.save(device);
+
+            domainToBean(device, deviceBean);
+
+            return deviceBean;
+        }
+
+
+        device.setOperatorCode(operator.getCode());
+        device.setProjectCode(project.getCode());
+        device.setGatewayCode(gateway.getCode());
+
         deviceDao.save(device);
         deviceDao.save(device);
 
 
         domainToBean(device, deviceBean);
         domainToBean(device, deviceBean);

+ 26 - 0
sources/server/vrv/vrv-core-service/src/main/java/com/kuyuntech/vrv/coreservice/service/core/impl/GatewayServiceImpl.java

@@ -101,6 +101,32 @@ public class GatewayServiceImpl extends AbstractFastbootService<Gateway, Gateway
 
 
         beanToDomain(gatewayBean, gateway, "id", "code", "version", "createTime", "updateTime", "valid");
         beanToDomain(gatewayBean, gateway, "id", "code", "version", "createTime", "updateTime", "valid");
 
 
+        String operatorNumber = gatewayBean.getOperatorNumber();
+        String projectNumber = gatewayBean.getProjectNumber();
+
+        Operator operator = operatorDao.findByNumberAndValid(operatorNumber, VALID);
+        Project project = projectDao.findByNumberAndValid(projectNumber, VALID);
+
+        if (operatorNumber == null || operatorNumber == "") {
+
+            gatewayDao.save(gateway);
+
+            domainToBean(gateway, gatewayBean);
+
+            return gatewayBean;
+        }
+        if (projectNumber == null || projectNumber == "") {
+
+            gatewayDao.save(gateway);
+
+            domainToBean(gateway, gatewayBean);
+
+            return gatewayBean;
+        }
+
+        gateway.setOperatorCode(operator.getCode());
+        gateway.setProjectCode(project.getCode());
+
         gatewayDao.save(gateway);
         gatewayDao.save(gateway);
 
 
         domainToBean(gateway, gatewayBean);
         domainToBean(gateway, gatewayBean);

+ 43 - 6
sources/server/vrv/vrv-core-service/src/main/java/com/kuyuntech/vrv/coreservice/service/core/impl/OperatorLogServiceImpl.java

@@ -48,17 +48,19 @@ public class OperatorLogServiceImpl extends AbstractFastbootService<OperatorLog,
     OperatorLogDao operatorLogDao;
     OperatorLogDao operatorLogDao;
     @Autowired
     @Autowired
     OperatorDao operatorDao;
     OperatorDao operatorDao;
+    @Autowired
+    private UserDao userDao;
 
 
 
 
     @Override
     @Override
     public OperatorLogBean add(OperatorLogBean operatorLogBean) {
     public OperatorLogBean add(OperatorLogBean operatorLogBean) {
 
 
         OperatorLog operatorLog = new OperatorLog();
         OperatorLog operatorLog = new OperatorLog();
-        beanToDomain(operatorLogBean, operatorLog, "id");
 
 
+        beanToDomain(operatorLogBean, operatorLog, "id");
 
 
         String operatorNumber = operatorLogBean.getOperatorNumber();
         String operatorNumber = operatorLogBean.getOperatorNumber();
-
+        String userAccount = operatorLogBean.getUserAccount();
 
 
         if ((operatorNumber == null || operatorNumber == "")) {
         if ((operatorNumber == null || operatorNumber == "")) {
 
 
@@ -68,13 +70,21 @@ public class OperatorLogServiceImpl extends AbstractFastbootService<OperatorLog,
 
 
             return operatorLogBean;
             return operatorLogBean;
         }
         }
+        if ((userAccount == null || userAccount == "")) {
 
 
-        Operator operator = operatorDao.findByNumberAndValid(operatorNumber, VALID);
+            operatorLogDao.save(operatorLog);
 
 
-        operatorLog.setOperatorCode(operator.getCode());
+            domainToBean(operatorLog, operatorLogBean);
 
 
+            return operatorLogBean;
+        }
 
 
 
 
+        Operator operator = operatorDao.findByNumberAndValid(operatorNumber, VALID);
+        User user = userDao.findByAccountAndValid(userAccount, VALID);
+
+        operatorLog.setUserCode(user.getCode());
+        operatorLog.setOperatorCode(operator.getCode());
 
 
         operatorLogDao.save(operatorLog);
         operatorLogDao.save(operatorLog);
 
 
@@ -91,16 +101,40 @@ public class OperatorLogServiceImpl extends AbstractFastbootService<OperatorLog,
             return null;
             return null;
         }
         }
 
 
-
         OperatorLog operatorLog = operatorLogDao.findByCodeAndValid(operatorLogBean.getCode(), VALID);
         OperatorLog operatorLog = operatorLogDao.findByCodeAndValid(operatorLogBean.getCode(), VALID);
 
 
-
         if (operatorLog == null) {
         if (operatorLog == null) {
             return null;
             return null;
         }
         }
 
 
         beanToDomain(operatorLogBean, operatorLog, "id", "code", "version", "createTime", "updateTime", "valid");
         beanToDomain(operatorLogBean, operatorLog, "id", "code", "version", "createTime", "updateTime", "valid");
 
 
+        String operatorNumber = operatorLogBean.getOperatorNumber();
+        String userAccount = operatorLog.getUserAccount();
+
+        if ((operatorNumber == null || operatorNumber == "")) {
+
+            operatorLogDao.save(operatorLog);
+
+            domainToBean(operatorLog, operatorLogBean);
+
+            return operatorLogBean;
+        }
+        if ((userAccount == null || userAccount == "")) {
+
+            operatorLogDao.save(operatorLog);
+
+            domainToBean(operatorLog, operatorLogBean);
+
+            return operatorLogBean;
+        }
+
+        Operator operator = operatorDao.findByNumberAndValid(operatorNumber, VALID);
+        User user = userDao.findByAccountAndValid(userAccount, VALID);
+
+        operatorLog.setUserCode(user.getCode());
+        operatorLog.setOperatorCode(operator.getCode());
+
         operatorLogDao.save(operatorLog);
         operatorLogDao.save(operatorLog);
 
 
         domainToBean(operatorLog, operatorLogBean);
         domainToBean(operatorLog, operatorLogBean);
@@ -207,6 +241,9 @@ public class OperatorLogServiceImpl extends AbstractFastbootService<OperatorLog,
             if (StringUtils.isNotBlank(operatorLogBean.getUserAccount())) {
             if (StringUtils.isNotBlank(operatorLogBean.getUserAccount())) {
                 detachedCriteria.add(Restrictions.like("userAccount", operatorLogBean.getUserAccount(), MatchMode.ANYWHERE));
                 detachedCriteria.add(Restrictions.like("userAccount", operatorLogBean.getUserAccount(), MatchMode.ANYWHERE));
             }
             }
+            if (StringUtils.isNotBlank(operatorLogBean.getOperatorNumber())) {
+                detachedCriteria.add(Restrictions.like("operatorNumber", operatorLogBean.getOperatorNumber(), MatchMode.ANYWHERE));
+            }
         }
         }
 
 
 
 

+ 16 - 0
sources/server/vrv/vrv-core-service/src/main/java/com/kuyuntech/vrv/coreservice/service/core/impl/ProjectServiceImpl.java

@@ -101,6 +101,22 @@ public class ProjectServiceImpl extends AbstractFastbootService<Project, Project
 
 
         beanToDomain(projectBean, project, "id", "code", "version", "createTime", "updateTime", "valid");
         beanToDomain(projectBean, project, "id", "code", "version", "createTime", "updateTime", "valid");
 
 
+        String operatorNumber = projectBean.getOperatorNumber();
+        Operator operator = operatorDao.findByNumberAndValid(operatorNumber, VALID);
+
+        //如果不设置关联运营商
+        if (operatorNumber == null || operatorNumber == "") {
+
+            projectDao.save(project);
+
+            domainToBean(project, projectBean);
+
+            return projectBean;
+        }
+
+        project.setOperatorCode(operator.getCode());
+
+
         projectDao.save(project);
         projectDao.save(project);
 
 
         domainToBean(project, projectBean);
         domainToBean(project, projectBean);

+ 7 - 1
sources/server/vrv/vrv-core-service/src/main/java/com/kuyuntech/vrv/coreservice/service/core/impl/UserServiceImpl.java

@@ -121,11 +121,15 @@ public class UserServiceImpl extends AbstractFastbootService<User, UserBean> imp
             return null;
             return null;
         }
         }
 
 
+
+        beanToDomain(userBean, user, "id", "code", "version", "createTime", "updateTime", "valid");
+
         String operatorNumber = userBean.getOperatorNumber();
         String operatorNumber = userBean.getOperatorNumber();
         String roleFlag = userBean.getRoleFlag();
         String roleFlag = userBean.getRoleFlag();
         Role role = roleDao.findByFlagAndValid(roleFlag, VALID);
         Role role = roleDao.findByFlagAndValid(roleFlag, VALID);
         Operator operator = operatorDao.findByNumberAndValid(operatorNumber, VALID);
         Operator operator = operatorDao.findByNumberAndValid(operatorNumber, VALID);
 
 
+
         if (roleFlag == null || roleFlag == "") {
         if (roleFlag == null || roleFlag == "") {
             userDao.save(user);
             userDao.save(user);
 
 
@@ -143,7 +147,6 @@ public class UserServiceImpl extends AbstractFastbootService<User, UserBean> imp
         }
         }
 
 
 
 
-        beanToDomain(userBean, user, "id", "code", "version", "createTime", "updateTime", "valid");
 
 
         user.setRoleCode(role.getCode());
         user.setRoleCode(role.getCode());
         user.setOperatorCode(operator.getCode());
         user.setOperatorCode(operator.getCode());
@@ -260,6 +263,9 @@ public class UserServiceImpl extends AbstractFastbootService<User, UserBean> imp
             if (StringUtils.isNotBlank(userBean.getPhone())) {
             if (StringUtils.isNotBlank(userBean.getPhone())) {
                 detachedCriteria.add(Restrictions.like("phone", userBean.getPhone(), MatchMode.ANYWHERE));
                 detachedCriteria.add(Restrictions.like("phone", userBean.getPhone(), MatchMode.ANYWHERE));
             }
             }
+            if (StringUtils.isNotBlank(userBean.getOperatorNumber())) {
+                detachedCriteria.add(Restrictions.like("operatorNumber", userBean.getOperatorNumber(), MatchMode.ANYWHERE));
+            }
 
 
         }
         }