askin 2 年之前
父节点
当前提交
8ab9f9e404

+ 14 - 0
sources/client/vrv-platform/src/router/index.js

@@ -25,6 +25,20 @@ export default new Router({
                     meta: {title: '运营商指定项目', tab: true, keepAlive: true},
                     component: () => import(/* webpackChunkName: "views" */ '../views/project/operatorList'),
 
+                },
+                {
+                    path: '/projectList',
+                    name: 'projectList',
+                    meta: {title: '项目指定网关', tab: true, keepAlive: true},
+                    component: () => import(/* webpackChunkName: "views" */ '../views/gateway/projectList'),
+
+                },
+                {
+                    path: '/gatewayList',
+                    name: 'gatewayList',
+                    meta: {title: '网关指定设备', tab: true, keepAlive: true},
+                    component: () => import(/* webpackChunkName: "views" */ '../views/device/gatewayList'),
+
                 },
 
                 {

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

@@ -0,0 +1,599 @@
+<template>
+  <div id="project">
+    <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>
+
+        <div style="margin-bottom: 12px">
+          <span style="margin-left: 3px; font-size: 16px; color: #545c64">网关编号:{{gatewayData.number}}</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.name"></el-input>
+            </el-form-item>
+            <el-form-item label="设备ip">
+              <el-input placeholder="设备ip" size="mini" v-model="searchFormData.ip"></el-input>
+            </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.type"></el-input>
+            </el-form-item>
+
+
+            <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: 15px">
+                  <el-form-item label="设备名称" style="margin-left: 16px" prop="name">
+                    <el-input v-model="formData.name"></el-input>
+                  </el-form-item>
+                  <el-form-item label="设备ip" style="margin-left: 26px" prop="ip">
+                    <el-input v-model="formData.ip"></el-input>
+                  </el-form-item>
+                </el-row>
+
+                <el-row style="margin-left: 15px ; margin-top: 20px;margin-bottom: 20px">
+                  <el-form-item label="设备sn" style="margin-left: 28px" prop="sn">
+                    <el-input v-model="formData.sn"></el-input>
+                  </el-form-item>
+                  <el-form-item label="设备类型" prop="type">
+                    <el-input v-model="formData.type"></el-input>
+                  </el-form-item>
+                </el-row>
+
+                <el-row style="margin-left: 15px ;margin-bottom: 20px">
+                  <el-form-item label="运营商编号" style="margin-left: 0px" 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-form-item label="网关编号" style="margin-left: 30px" prop="gatewayNumber">
+                  <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>
+
+              <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="name" label="设备名称"></el-table-column>
+            <el-table-column prop="ip" label="设备ip"></el-table-column>
+            <el-table-column prop="sn" label="设备sn"></el-table-column>
+            <el-table-column prop="type" label="设备类型"></el-table-column>
+
+            <el-table-column label="设备状态">
+              <template slot-scope="scope">
+                {{ String(scope.row.deviceStatus) === '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="manage(scope.row)">管理</el-button>
+                <el-button type="text" size="medium" @click="del(scope.row)" style="color: #c01920">删除</el-button>
+
+                <el-button
+                    style="color: #c01920"
+                    type="text"
+                    size="medium"
+                    class="delBut non"
+                    @click="statusHandle(scope.row)"
+                >
+                  {{ scope.row.deviceStatus == '1' ? '禁用' : '启用' }}
+                </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: 'project',
+  data() {
+    return {
+      gatewayData:{
+        number:'',
+        code:'',
+      },
+
+      rules: {
+        operatorNumber: [
+          {required: true, message: '请输入运营商编号', trigger: 'change'}
+        ],
+        projectNumber: [
+          {required: true, message: '请输入项目编号', trigger: 'change'}
+        ],
+        gatewayNumber: [
+          {required: true, message: '请输入网关编号', trigger: 'change'}
+        ],
+        name: [
+          {required: true, message: '请输入设备名称', trigger: 'blur'}
+        ],
+        ip: [
+          {required: true, message: '请输入网关ip', trigger: 'blur'}
+        ],
+        sn: [
+          {required: true, message: '请输入设备sn', trigger: 'blur'}
+        ],
+        type: [
+          {required: true, message: '请输入设备类型', trigger: 'blur'}
+        ],
+      },
+
+      gateways: [],
+      projects: [],
+      operators: [],
+      operatorProject: '',
+      projectGateway: '',
+
+      api: {
+        list: this.$api.device.list,
+        delete: this.$api.device.delete,
+        add: this.$api.device.add,
+        update: this.$api.device.update,
+      },
+
+      value: true,
+
+      addOrEdit: 1,
+
+      dialogFormVisible: false,
+
+      pager: {
+        pageSize: 2,
+        pageIndex: 1,
+        itemCount: 0,
+      },
+
+      tableData:
+          [{
+            name: '',
+            ip: '',
+            sn: '',
+            type: '',
+            deviceStatus: '1'
+          }],
+      formData: {
+        name: '',
+        ip: '',
+        sn: '',
+        type: '',
+        deviceStatus: '1',
+        operatorNumber: '',
+        projectNumber: '',
+        gatewayNumber: ''
+      },
+      searchFormData:
+          {
+            name: '',
+            ip: '',
+            sn: '',
+            type: '',
+            deviceStatus: '1',
+            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();
+    },
+    '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();
+    }
+  },
+
+  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
+      })
+    },
+
+    loadData(index) {
+      var row = this.$route.query.row;
+
+      console.log(row)
+
+      this.gatewayData = row
+
+      console.log(this.gatewayData.number)
+
+      const vm = this;
+      vm.$http.get(vm.api.list, {
+        params: {
+          pageSize: 5,
+          pageIndex: index ? index : 1,
+
+          name: this.searchFormData.name,
+          ip: this.searchFormData.ip,
+          sn: this.searchFormData.sn,
+          type: this.searchFormData.type,
+
+          // operatorNumber: this.searchFormData.operatorNumber,
+          // projectNumber: this.searchFormData.projectNumber,
+          gatewayNumber: this.gatewayData.number,
+        }
+      })
+          .then((response) => {
+            // vm.paper = response.data.data.paper;
+            console.log(response.data.data);
+
+            vm.pager = response.data.data.pager
+
+            vm.tableData = response.data.data.devices;
+          })
+    },
+    search() {
+      //console.log(this.searchFormData)
+      this.loadData();
+    },
+    showAdd() {
+      this.dialogFormVisible = true;
+
+      this.formData.name = '',
+          this.formData.ip = '',
+          this.formData.sn = '',
+          this.formData.type = '',
+
+          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,
+                name: this.formData.name,
+                ip: this.formData.ip,
+                sn: this.formData.sn,
+                type: this.formData.type,
+
+                operatorNumber: this.formData.operatorNumber,
+                projectNumber: this.formData.projectNumber,
+                gatewayNumber: this.formData.gatewayNumber,
+                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: {
+                name: this.formData.name,
+                ip: this.formData.ip,
+                sn: this.formData.sn,
+                type: this.formData.type,
+                deviceStatus: 1,
+
+                operatorNumber: this.formData.operatorNumber,
+                projectNumber: this.formData.projectNumber,
+                gatewayNumber: this.formData.gatewayNumber,
+                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) {
+      const vm = this;
+      this.$confirm('是否进行此操作', '提示', {
+        type: 'warning'
+      }).then(() => {
+        vm.$http.get(vm.api.update, {
+          params: {
+            name: row.name,
+            sn: row.sn,
+            type: row.type,
+            ip: row.ip,
+
+            operatorNumber: row.operatorNumber,
+            projectNumber: row.projectNumber,
+            operatorCode: row.operatorCode,
+            projectCode: row.projectCode,
+            gatewayCode: row.gatewayCode,
+            gatewayNumber: row.gatewayNumber,
+
+            code: row.code,
+            valid: row.valid,
+            deviceStatus: row.deviceStatus == 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;
+}
+</style>

+ 350 - 174
sources/client/vrv-platform/src/views/device/list.vue

@@ -4,122 +4,160 @@
 
       <el-main>
         <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>
         </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>
 
         <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.name"></el-input>
-          </el-form-item>
-          <el-form-item label="设备ip">
-            <el-input placeholder="设备ip" size="mini" v-model="searchFormData.ip"></el-input>
-          </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.type"></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-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="设备ip">
-                <el-input v-model="formData.ip"></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="设备类型">
-                <el-input v-model="formData.type"></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-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="ip" label="设备ip"></el-table-column>
-          <el-table-column prop="sn" label="设备sn"></el-table-column>
-          <el-table-column prop="type" label="设备类型"></el-table-column>
-
-          <el-table-column label="设备状态">
-            <template slot-scope="scope">
-              {{ String(scope.row.deviceStatus) === '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="manage(scope.row)">管理</el-button>
-              <el-button type="text" size="medium" @click="del(scope.row)" style="color: #c01920">删除</el-button>
-
-              <el-button
-                  style="color: #c01920"
-                  type="text"
-                  size="medium"
-                  class="delBut non"
-                  @click="statusHandle(scope.row)"
-              >
-                {{ scope.row.deviceStatus == '1' ? '禁用' : '启用' }}
-              </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="设备ip">
+              <el-input placeholder="设备ip" size="mini" v-model="searchFormData.ip"></el-input>
+            </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.type"></el-input>
+            </el-form-item>
+
+            <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-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: 15px">
+                  <el-form-item label="设备名称" style="margin-left: 16px" prop="name">
+                    <el-input v-model="formData.name"></el-input>
+                  </el-form-item>
+                  <el-form-item label="设备ip" style="margin-left: 26px" prop="ip">
+                    <el-input v-model="formData.ip"></el-input>
+                  </el-form-item>
+                </el-row>
+
+                <el-row style="margin-left: 15px ; margin-top: 20px;margin-bottom: 20px">
+                  <el-form-item label="设备sn" style="margin-left: 28px" prop="sn">
+                    <el-input v-model="formData.sn"></el-input>
+                  </el-form-item>
+                  <el-form-item label="设备类型" prop="type">
+                    <el-input v-model="formData.type"></el-input>
+                  </el-form-item>
+                </el-row>
+
+                <el-row style="margin-left: 15px ;margin-bottom: 20px">
+                  <el-form-item label="运营商编号" style="margin-left: 0px" 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-form-item label="网关编号" style="margin-left: 30px" prop="gatewayNumber">
+                  <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>
+
+              <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="name" label="设备名称"></el-table-column>
+            <el-table-column prop="ip" label="设备ip"></el-table-column>
+            <el-table-column prop="sn" label="设备sn"></el-table-column>
+            <el-table-column prop="type" label="设备类型"></el-table-column>
+
+            <el-table-column label="设备状态">
+              <template slot-scope="scope">
+                {{ String(scope.row.deviceStatus) === '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="manage(scope.row)">管理</el-button>
+                <el-button type="text" size="medium" @click="del(scope.row)" style="color: #c01920">删除</el-button>
+
+                <el-button
+                    style="color: #c01920"
+                    type="text"
+                    size="medium"
+                    class="delBut non"
+                    @click="statusHandle(scope.row)"
+                >
+                  {{ scope.row.deviceStatus == '1' ? '禁用' : '启用' }}
+                </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>
 
@@ -134,6 +172,37 @@ export default {
   name: 'project',
   data() {
     return {
+
+      rules: {
+        operatorNumber: [
+          {required: true, message: '请输入运营商编号', trigger: 'change'}
+        ],
+        projectNumber: [
+          {required: true, message: '请输入项目编号', trigger: 'change'}
+        ],
+        gatewayNumber: [
+          {required: true, message: '请输入网关编号', trigger: 'change'}
+        ],
+        name: [
+          {required: true, message: '请输入设备名称', trigger: 'blur'}
+        ],
+        ip: [
+          {required: true, message: '请输入网关ip', trigger: 'blur'}
+        ],
+        sn: [
+          {required: true, message: '请输入设备sn', trigger: 'blur'}
+        ],
+        type: [
+          {required: true, message: '请输入设备类型', trigger: 'blur'}
+        ],
+      },
+
+      gateways: [],
+      projects: [],
+      operators: [],
+      operatorProject: '',
+      projectGateway: '',
+
       api: {
         list: this.$api.device.list,
         delete: this.$api.device.delete,
@@ -187,6 +256,62 @@ export default {
 
   created: function () {
     this.loadData();
+    this.getOperator();
+  },
+
+  watch: {
+    'searchFormData.operatorNumber'(oldValue, newValue) {
+
+      console.log(oldValue)
+      console.log(newValue)
+
+      this.searchFormData.projectNumber = ''
+
+      this.operatorProject = oldValue;
+
+      console.log(this.operatorProject)
+
+      this.getProjectNumber();
+    },
+
+    'searchFormData.projectNumber'(oldValue, newValue) {
+
+      console.log(oldValue)
+      console.log(newValue)
+
+      this.searchFormData.gatewayNumber = ''
+
+      this.projectGateway = oldValue;
+
+      console.log(this.projectGateway)
+
+      this.getGateway();
+    },
+    '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();
+    }
   },
 
   methods: {
@@ -195,6 +320,38 @@ export default {
       this.loadData(index)
     },
 
+
+    getOperator() {
+      const vm = this;
+      vm.$http.get(vm.$api.operator.list).then((resp) => {
+        vm.operators = resp.data.data.operators
+      })
+    },
+
+    getProjectNumber() {
+      const vm = this;
+      vm.$http.get(vm.$api.project.list, {
+        params: {
+          operatorNumber: this.operatorProject,
+        }
+      }).then((resp) => {
+        console.log(resp.data.data.projects)
+        vm.projects = resp.data.data.projects
+      })
+    },
+
+    getGateway() {
+      const vm = this;
+      vm.$http.get(vm.$api.gateway.list, {
+        params: {
+          projectNumber: this.projectGateway,
+        }
+      }).then((resp) => {
+        console.log(resp.data.data.gateways)
+        vm.gateways = resp.data.data.gateways
+      })
+    },
+
     loadData(index) {
       const vm = this;
       vm.$http.get(vm.api.list, {
@@ -236,90 +393,103 @@ export default {
           this.formData.operatorNumber = '',
           this.formData.projectNumber = '',
           this.formData.gatewayNumber = ''
+      this.addOrEdit = 1
     },
 
     showEdit(row) {
-
       console.log(row)
 
       this.dialogFormVisible = true;
 
-      this.formData = row
+      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: {
-            name: this.formData.name,
-            ip: this.formData.ip,
-            sn: this.formData.sn,
-            type: this.formData.type,
-
-            operatorNumber: this.formData.operatorNumber,
-            projectNumber: this.formData.projectNumber,
-            gatewayNumber: this.formData.gatewayNumber,
-            operatorCode: this.formData.operatorCode,
-            projectCode: this.formData.projectCode,
-            gatewayCode: this.formData.gatewayCode,
-          }
-        })
-            .then((response) => {
-              console.log(response)
+    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,
+                name: this.formData.name,
+                ip: this.formData.ip,
+                sn: this.formData.sn,
+                type: this.formData.type,
+
+                operatorNumber: this.formData.operatorNumber,
+                projectNumber: this.formData.projectNumber,
+                gatewayNumber: this.formData.gatewayNumber,
+                operatorCode: this.formData.operatorCode,
+                projectCode: this.formData.projectCode,
+                gatewayCode: this.formData.gatewayCode,
+              }
+            })
+                .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(() => {
+                });
+          }
 
+          if (this.addOrEdit == 1) {
+            vm.$http.get(vm.api.add, {
+              params: {
+                name: this.formData.name,
+                ip: this.formData.ip,
+                sn: this.formData.sn,
+                type: this.formData.type,
+                deviceStatus: 1,
+
+                operatorNumber: this.formData.operatorNumber,
+                projectNumber: this.formData.projectNumber,
+                gatewayNumber: this.formData.gatewayNumber,
+                operatorCode: this.formData.operatorCode,
+                projectCode: this.formData.projectCode,
+                gatewayCode: this.formData.gatewayCode,
+              }
             })
-            .catch(() => {
-            });
-      }
+                .then((response) => {
+                  if (response.data.status == 200) {
 
-      if (this.addOrEdit == 1) {
-        vm.$http.get(vm.api.add, {
-          params: {
-            name: this.formData.name,
-            ip: this.formData.ip,
-            sn: this.formData.sn,
-            type: this.formData.type,
-
-            operatorNumber: this.formData.operatorNumber,
-            projectNumber: this.formData.projectNumber,
-            gatewayNumber: this.formData.gatewayNumber,
-            operatorCode: this.formData.operatorCode,
-            projectCode: this.formData.projectCode,
-            gatewayCode: this.formData.gatewayCode,
-          }
-        })
-            .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();
+                  }
                 })
+          }
+        } else {
+          console.log('error submit!!');
+          return false;
+        }
+      });
+
 
-                this.loadData();
-              }
-            })
-      }
     },
 
     del(row) {
@@ -360,6 +530,7 @@ export default {
         type: 'info'
       });
 
+      this.$refs.formData.clearValidate();
       this.dialogFormVisible = false;
     },
 
@@ -413,15 +584,20 @@ export default {
 
     manage() {
       let vm = this;
-      vm.$router.push('/runningState')
-    }
+      vm.$router.push('/')
+    },
+
+    back() {
+      let vm = this;
+      vm.$router.back()
+    },
 
   }
 }
 </script>
 
 <style scoped>
-.el-form-item{
+.el-form-item {
   margin-right: 10px;
   margin-left: 10px;
   margin-bottom: 10px;

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

@@ -37,11 +37,12 @@
             <el-form-item label="变量id">
               <el-input placeholder="变量id" size="mini" v-model="searchFormData.variableId"></el-input>
             </el-form-item>
-            <el-form-item label="开始时间">
-              <el-input placeholder="开始时间" size="mini" v-model="searchFormData.startTime"></el-input>
+
+            <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="结束时间">
-              <el-input placeholder="结束时间" size="mini" v-model="searchFormData.endTime"></el-input>
+            <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>
 
 
@@ -56,12 +57,8 @@
                 <el-form-item label="告警内容">
                   <el-input v-model="formData.content"></el-input>
                 </el-form-item>
-                <el-form-item label="开始时间">
-                  <el-input v-model="formData.startTime"></el-input>
-                </el-form-item>
-                <el-form-item label="结束时间">
-                  <el-input v-model="formData.endTime"></el-input>
-                </el-form-item>
+
+
 
                 <el-form-item label="设备sn">
                   <el-input v-model="formData.sn"></el-input>
@@ -102,6 +99,7 @@
             <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"
@@ -124,16 +122,16 @@
           </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-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>
 
@@ -460,10 +458,12 @@ export default {
 </script>
 
 <style scoped>
-.el-form-item{
+.el-form-item {
   margin-right: 10px;
   margin-left: 10px;
   margin-bottom: 10px;
   margin-top: 0px;
 }
+
+
 </style>

+ 352 - 228
sources/client/vrv-platform/src/views/gateway/list.vue

@@ -4,107 +4,134 @@
 
       <el-main>
         <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>
         </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>
 
         <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.number"></el-input>
-          </el-form-item>
-          <el-form-item label="网关ip">
-            <el-input placeholder="网关ip" size="mini" v-model="searchFormData.ip"></el-input>
-          </el-form-item>
-          <el-form-item label="定位">
-            <el-input placeholder="定位" size="mini" v-model="searchFormData.location"></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-dialog title="网关" :visible.sync="dialogFormVisible">
-            <el-form label-position="left" :model="formData">
-              <el-form-item label="编号">
-                <el-input v-model="formData.number"></el-input>
-              </el-form-item>
-              <el-form-item label="网关ip">
-                <el-input v-model="formData.ip"></el-input>
-              </el-form-item>
-              <el-form-item label="定位">
-                <el-input v-model="formData.location"></el-input>
-              </el-form-item>
-              <el-form-item label="运营商编号">
-                <el-input v-model="formData.operatorNumber"></el-input>
-              </el-form-item>
-              <el-form-item label="项目编号">
-                <el-input v-model="formData.projectNumber"></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="number" label="编号"></el-table-column>
-          <el-table-column prop="ip" label="网关ip"></el-table-column>
-          <el-table-column prop="location" label="定位"></el-table-column>
-
-          <el-table-column label="网关状态">
-            <template slot-scope="scope">
-              {{ String(scope.row.useStatus) === '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="device">设备</el-button>
-              <el-button type="text" size="medium" @click="del(scope.row)" style="color: #c01920">删除</el-button>
-
-              <el-button
-                  style="color: #c01920"
-                type="text"
-                size="medium"
-                class="delBut non"
-                @click="statusHandle(scope.row)"
-              >
-                {{ scope.row.useStatus == '1' ? '禁用' : '启用' }}
-              </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.number"></el-input>
+            </el-form-item>
+            <el-form-item label="网关ip">
+              <el-input placeholder="网关ip" size="mini" v-model="searchFormData.ip"></el-input>
+            </el-form-item>
+            <el-form-item label="定位">
+              <el-input placeholder="定位" size="mini" v-model="searchFormData.location"></el-input>
+            </el-form-item>
+
+            <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-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: 15px">
+                  <el-form-item label="编号" style="margin-right: 50px;margin-left: 22px" prop="number">
+                    <el-input v-model="formData.number"></el-input>
+                  </el-form-item>
+                  <el-form-item label="网关ip" prop="ip">
+                    <el-input v-model="formData.ip"></el-input>
+                  </el-form-item>
+                </el-row>
+
+                <el-row style="margin-left: 15px ; margin-top: 20px ; margin-bottom: 20px">
+                  <el-form-item label="定位" style="margin-right: 20px;margin-left: 22px" prop="location">
+                    <el-input v-model="formData.location"></el-input>
+                  </el-form-item>
+
+
+                  <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-row>
+
+                <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-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="number" label="编号"></el-table-column>
+            <el-table-column prop="ip" label="网关ip"></el-table-column>
+            <el-table-column prop="location" label="定位"></el-table-column>
+
+            <el-table-column label="网关状态">
+              <template slot-scope="scope">
+                {{ String(scope.row.useStatus) === '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="gatewayList(scope.row)">设备</el-button>
+                <el-button type="text" size="medium" @click="del(scope.row)" style="color: #c01920">删除</el-button>
+
+                <el-button
+                    style="color: #c01920"
+                    type="text"
+                    size="medium"
+                    class="delBut non"
+                    @click="statusHandle(scope.row)"
+                >
+                  {{ scope.row.useStatus == '1' ? '禁用' : '启用' }}
+                </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>
 
@@ -115,12 +142,33 @@
 
 <script>
 
-
 export default {
   name: 'project',
   data() {
     return {
 
+      rules: {
+        operatorNumber: [
+          {required: true, message: '请输入运营商编号', trigger: 'change'}
+        ],
+        projectNumber: [
+          {required: true, message: '请输入项目编号', trigger: 'change'}
+        ],
+        number: [
+          {required: true, message: '请输入网关编号', trigger: 'blur'}
+        ],
+        ip: [
+          {required: true, message: '请输入网关ip', trigger: 'blur'}
+        ],
+        location: [
+          {required: true, message: '请输入定位', trigger: 'blur'}
+        ],
+      },
+
+      operators: [],
+      projects: [],
+      operatorProject: '',
+
       api: {
         list: this.$api.gateway.list,
         delete: this.$api.gateway.delete,
@@ -141,12 +189,12 @@ export default {
       },
 
       tableData:
-        [{
-          number: '',
-          ip: '',
-          location: '',
-          useStatus: '1'
-        }],
+          [{
+            number: '',
+            ip: '',
+            location: '',
+            useStatus: '1'
+          }],
       formData: {
         number: '',
         ip: '',
@@ -156,21 +204,54 @@ export default {
         projectNumber: ''
       },
       searchFormData:
-        {
-          number: '',
-          ip: '',
-          location: '',
-          useStatus: '1',
-          operatorNumber: '',
-          projectNumber: ''
-        }
+          {
+            number: '',
+            ip: '',
+            location: '',
+            useStatus: '1',
+            operatorNumber: '',
+            projectNumber: ''
+          }
     }
   },
 
   created: function () {
+    this.getOperatorNumber();
     this.loadData();
   },
 
+  watch: {
+    'searchFormData.operatorNumber'(oldValue, newValue) {
+
+      console.log(oldValue)
+      console.log(newValue)
+
+      this.searchFormData.projectNumber = ''
+
+      this.operatorProject = oldValue;
+
+      console.log(this.operatorProject)
+
+      this.getProjectNumber();
+
+    },
+
+    'formData.operatorNumber'(oldValue, newValue) {
+
+      console.log(oldValue)
+      console.log(newValue)
+
+      this.operatorProject = oldValue;
+
+      console.log(this.operatorProject)
+
+      this.getProjectNumber();
+
+    },
+
+    deep: true  // 深度监听
+  },
+
   methods: {
     //切换页码
     handleCurrentChange(index) {
@@ -191,15 +272,36 @@ export default {
           projectNumber: this.searchFormData.projectNumber,
         }
       })
-        .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.gateways;
-        })
+            vm.tableData = response.data.data.gateways;
+          })
+    },
+
+    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
+      })
     },
+
+    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
+      })
+    },
+
     search() {
       //console.log(this.searchFormData)
       this.loadData();
@@ -208,88 +310,101 @@ export default {
       this.dialogFormVisible = true;
 
       this.formData.number = '',
-        this.formData.ip = '',
-        this.formData.location = '',
-        this.formData.operatorNumber = '',
-        this.formData.projectNumber = ''
+          this.formData.ip = '',
+          this.formData.location = '',
+          this.formData.operatorNumber = '',
+          this.formData.projectNumber = ''
+      this.addOrEdit = 1
     },
 
     showEdit(row) {
+      this.dialogFormVisible = true;
 
       console.log(row)
 
-      this.dialogFormVisible = true;
-
-      this.formData = row
+      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: {
-            number: this.formData.number,
-            ip: this.formData.ip,
-            location: this.formData.location,
-            useStatus: this.formData.useStatus,
-            operatorNumber: this.formData.operatorNumber,
-            projectNumber: this.formData.projectNumber,
-            operatorCode: this.formData.operatorCode,
-            projectCode: this.formData.projectCode,
+    }
+    ,
+
+
+    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,
+                number: this.formData.number,
+                ip: this.formData.ip,
+                location: this.formData.location,
+                useStatus: this.formData.useStatus,
+                operatorNumber: this.formData.operatorNumber,
+                projectNumber: this.formData.projectNumber,
+                operatorCode: this.formData.operatorCode,
+                projectCode: this.formData.projectCode,
+              }
+            })
+                .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(() => {
+                });
           }
-        })
-          .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: {
-            number: this.formData.number,
-            ip: this.formData.ip,
-            location: this.formData.location,
-            useStatus: this.formData.useStatus,
-            operatorNumber: this.formData.operatorNumber,
-            projectNumber: this.formData.projectNumber,
-            operatorCode: this.formData.operatorCode,
-            projectCode: this.formData.projectCode,
+          if (this.addOrEdit == 1) {
+            vm.$http.get(vm.api.add, {
+              params: {
+                number: this.formData.number,
+                ip: this.formData.ip,
+                location: this.formData.location,
+                useStatus: this.formData.useStatus,
+                operatorNumber: this.formData.operatorNumber,
+                projectNumber: this.formData.projectNumber,
+                operatorCode: this.formData.operatorCode,
+                projectCode: this.formData.projectCode,
+              }
+            })
+                .then((response) => {
+                  if (response.data.status == 200) {
+
+                    this.dialogFormVisible = false;
+
+                    this.$message({
+                      type: 'success',
+                      showClose: true,
+                      message: response.data.desc
+                    })
+
+                    this.loadData();
+                  }
+                })
           }
-        })
-          .then((response) => {
-            if (response.data.status == 200) {
-
-              this.dialogFormVisible = false;
+        } else {
+          console.log('error submit!!');
+          return false;
+        }
+      });
 
-              this.$message({
-                type: 'success',
-                showClose: true,
-                message: response.data.desc
-              })
 
-              this.loadData();
-            }
-          })
-      }
     },
 
     del(row) {
@@ -297,32 +412,32 @@ export default {
       this.$confirm('确认删除', '提示', {
         type: 'warning'
       }).then(() => {
-        vm.$http.get(vm.api.delete,  {
+        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
-              })
+            .then((response) => {
+              console.log(response)
+              if (response.data.status == 200) {
+                this.$message({
+                  type: 'success',
+                  showClose: true,
+                  message: response.data.desc
+                })
 
 
-            }
-            this.loadData();
-          })
+              }
+              this.loadData();
+            })
       })
-        .catch(() => {
-          this.$message({
-            type: 'info',
-            showClose: true,
-            message: '取消删除'
-          })
-        });
+          .catch(() => {
+            this.$message({
+              type: 'info',
+              showClose: true,
+              message: '取消删除'
+            })
+          });
     },
     cancel() {
       this.$message({
@@ -331,6 +446,7 @@ export default {
         type: 'info'
       });
 
+      this.$refs.formData.clearValidate();
       this.dialogFormVisible = false;
     },
 
@@ -340,7 +456,7 @@ export default {
       this.$confirm('是否进行此操作', '提示', {
         type: 'warning'
       }).then(() => {
-        vm.$http.get(vm.api.update,  {
+        vm.$http.get(vm.api.update, {
           params: {
             number: row.number,
             ip: row.ip,
@@ -355,40 +471,48 @@ export default {
             useStatus: row.useStatus == 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();
-          })
+            .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: '操作取消'
-          })
-        });
+          .catch(() => {
+            this.$message({
+              type: 'info',
+              showClose: true,
+              message: '操作取消'
+            })
+          });
+
+    },
 
+    gatewayList(row) {
+      let vm = this;
+      vm.$router.push({
+        path: '/gatewayList',
+        query: {row: row}
+      })
     },
 
-    device() {
+    back() {
       let vm = this;
-      vm.$router.push('/device')
+      vm.$router.back()
     }
   }
 }
 </script>
 
 <style scoped>
-.el-form-item{
+.el-form-item {
   margin-right: 10px;
   margin-left: 10px;
   margin-bottom: 10px;

+ 472 - 0
sources/client/vrv-platform/src/views/gateway/projectList.vue

@@ -0,0 +1,472 @@
+<template>
+  <div id="project">
+    <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>
+
+        <div style="margin-bottom: 12px">
+          <span style="margin-left: 3px; font-size: 16px; color: #545c64">项目编号:{{projectData.number}}</span>
+          <span style="margin-left: 20px; font-size: 16px;color: #545c64">项目名称:{{projectData.name}}</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.number"></el-input>
+            </el-form-item>
+            <el-form-item label="网关ip">
+              <el-input placeholder="网关ip" size="mini" v-model="searchFormData.ip"></el-input>
+            </el-form-item>
+            <el-form-item label="定位">
+              <el-input placeholder="定位" size="mini" v-model="searchFormData.location"></el-input>
+            </el-form-item>
+
+            <!--            <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-dialog title="网关" :visible.sync="dialogFormVisible" style="width: 70% ; margin-left: 300px ;">
+              <el-form label-position="left" :model="formData">
+                <el-row style="margin-left: 15px">
+                  <el-form-item label="编号" style="margin-right: 50px;margin-left: 22px">
+                    <el-input v-model="formData.number"></el-input>
+                  </el-form-item>
+                  <el-form-item label="网关ip">
+                    <el-input v-model="formData.ip"></el-input>
+                  </el-form-item>
+                </el-row>
+
+                <el-row style="margin-left: 15px">
+                  <el-form-item label="定位" style="margin-right: 20px;margin-left: 22px">
+                    <el-input v-model="formData.location"></el-input>
+                  </el-form-item>
+
+
+                  <el-form-item label="运营商编号">
+                    <el-select v-model="formData.operatorNumber" placeholder="运营商编号" style="width: 202px">
+
+                      <el-option :value="i.number" v-for="(i,index) in operators" :key="index"
+                                 :label="i.number"></el-option>
+                    </el-select>
+                  </el-form-item>
+                </el-row>
+
+                <el-form-item label="项目编号">
+                  <el-select v-model="formData.projectNumber" placeholder="项目编号" style="width: 202px">
+
+                    <el-option :value="i.number" v-for="(i,index) in projects" :key="index"
+                               :label="i.number"></el-option>
+                  </el-select>
+                </el-form-item>
+
+
+              </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="number" label="编号"></el-table-column>
+            <el-table-column prop="ip" label="网关ip"></el-table-column>
+            <el-table-column prop="location" label="定位"></el-table-column>
+
+            <el-table-column label="网关状态">
+              <template slot-scope="scope">
+                {{ String(scope.row.useStatus) === '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="gatewayList(scope.row)">设备</el-button>
+                <el-button type="text" size="medium" @click="del(scope.row)" style="color: #c01920">删除</el-button>
+
+                <el-button
+                    style="color: #c01920"
+                    type="text"
+                    size="medium"
+                    class="delBut non"
+                    @click="statusHandle(scope.row)"
+                >
+                  {{ scope.row.useStatus == '1' ? '禁用' : '启用' }}
+                </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: 'project',
+  data() {
+    return {
+      operators: [],
+      projects: [],
+
+      api: {
+        list: this.$api.gateway.list,
+        delete: this.$api.gateway.delete,
+        add: this.$api.gateway.add,
+        update: this.$api.gateway.update,
+      },
+
+      projectData:{
+        name:'',
+        number:'',
+        code:'',
+      },
+
+
+      value: true,
+
+      addOrEdit: 1,
+
+      dialogFormVisible: false,
+
+      pager: {
+        pageSize: 2,
+        pageIndex: 1,
+        itemCount: 0,
+      },
+
+      tableData:
+          [{
+            number: '',
+            ip: '',
+            location: '',
+            useStatus: '1'
+          }],
+      formData: {
+        number: '',
+        ip: '',
+        location: '',
+        useStatus: '1',
+        operatorNumber: '',
+        projectNumber: ''
+      },
+      searchFormData:
+          {
+            number: '',
+            ip: '',
+            location: '',
+            useStatus: '1',
+            operatorNumber: '',
+            projectNumber: ''
+          }
+    }
+  },
+
+  created: function () {
+    this.getOperatorNumber();
+    this.getProjectNumber();
+    this.loadData();
+  },
+
+  methods: {
+    //切换页码
+    handleCurrentChange(index) {
+      this.loadData(index)
+    },
+
+    loadData(index) {
+      var row = this.$route.query.row;
+
+      console.log(row)
+
+      this.projectData = row
+
+      console.log(this.projectData.name)
+
+      const vm = this;
+      vm.$http.get(vm.api.list, {
+        params: {
+          pageSize: 5,
+          pageIndex: index ? index : 1,
+
+          number: this.searchFormData.number,
+          ip: this.searchFormData.ip,
+          location: this.searchFormData.location,
+          projectNumber: this.projectData.number,
+        }
+      })
+          .then((response) => {
+            // vm.paper = response.data.data.paper;
+            console.log(response.data.data);
+
+            vm.pager = response.data.data.pager
+
+            vm.tableData = response.data.data.gateways;
+          })
+    },
+
+    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
+      })
+    },
+
+    getProjectNumber() {
+      const vm = this;
+      vm.$http.get(vm.$api.project.list, {
+        params: {
+          number: this.searchFormData.projectNumber,
+        }
+      }).then((resp) => {
+        console.log(resp.data.data.projects)
+        vm.projects = resp.data.data.projects
+      })
+    },
+
+    search() {
+      //console.log(this.searchFormData)
+      this.loadData();
+    },
+    showAdd() {
+      this.dialogFormVisible = true;
+
+      this.formData.number = '',
+          this.formData.ip = '',
+          this.formData.location = '',
+          this.formData.operatorNumber = '',
+          this.formData.projectNumber = ''
+    },
+
+    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: {
+            number: this.formData.number,
+            ip: this.formData.ip,
+            location: this.formData.location,
+            useStatus: this.formData.useStatus,
+            operatorNumber: this.formData.operatorNumber,
+            projectNumber: this.formData.projectNumber,
+            operatorCode: this.formData.operatorCode,
+            projectCode: this.formData.projectCode,
+          }
+        })
+            .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: {
+            number: this.formData.number,
+            ip: this.formData.ip,
+            location: this.formData.location,
+            useStatus: this.formData.useStatus,
+            operatorNumber: this.formData.operatorNumber,
+            projectNumber: this.formData.projectNumber,
+            operatorCode: this.formData.operatorCode,
+            projectCode: this.formData.projectCode,
+          }
+        })
+            .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;
+    },
+
+    //启用/停用网关
+    statusHandle(row) {
+      const vm = this;
+      this.$confirm('是否进行此操作', '提示', {
+        type: 'warning'
+      }).then(() => {
+        vm.$http.get(vm.api.update, {
+          params: {
+            number: row.number,
+            ip: row.ip,
+            location: row.location,
+            operatorNumber: row.operatorNumber,
+            projectNumber: row.projectNumber,
+            operatorCode: row.operatorCode,
+            projectCode: row.projectCode,
+
+            code: row.code,
+            valid: row.valid,
+            useStatus: row.useStatus == 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: '操作取消'
+            })
+          });
+
+    },
+
+
+    gatewayList(row) {
+      let vm = this;
+      vm.$router.push({
+        path: '/gatewayList',
+        query: {row: row}
+      })
+    },
+
+     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;
+}
+</style>

+ 67 - 40
sources/client/vrv-platform/src/views/login/login.vue

@@ -1,38 +1,48 @@
 <template>
-  <div id="login">
-
-    <el-form :model="form" :rules="formRules">
-      <el-form-item prop="account">
-        <el-input v-model="form.account"
-                  placeholder="请输入账号"
-                  prefix-icon="el-icon-user"></el-input>
-      </el-form-item>
-
-      <el-form-item prop="password">
-        <el-input v-model="form.password"
-                  prefix-icon="el-icon-lock"
-                  placeholder="请输入密码"
-                  type="password"></el-input>
-      </el-form-item>
-
-      <el-form-item prop="verifyCode">
-        <div>
-          <el-input v-model="form.verifyCode"
-                    prefix-icon="el-icon-circle-check"
-                    placeholder="请输入图形验证码"></el-input>
+  <div id="login" class="loginForm">
+
+      <el-form :model="form" :rules="formRules">
+        <el-form-item prop="account">
+          <el-input v-model="form.account"
+                    placeholder="请输入账号"
+                    prefix-icon="el-icon-user"
+                    style="width: 280px"></el-input>
+        </el-form-item>
+
+        <el-form-item prop="password">
+          <el-input v-model="form.password"
+                    prefix-icon="el-icon-lock"
+                    placeholder="请输入密码"
+                    type="password"
+                    style="width: 280px"></el-input>
+        </el-form-item>
+
+        <el-form-item prop="verifyCode">
+          <div>
+
+            <el-input v-model="form.verifyCode"
+                      prefix-icon="el-icon-circle-check"
+                      placeholder="请输入图形验证码"
+                      style="width: 140px;
+                      float: left;
+                      margin-right: 10px"
+            ></el-input>
+
+            <img @click="handleRefreshVerifyCode" class="verify-img" :src="verifyCodeUrl" style="cursor: pointer"
+                 alt="">
+
+          </div>
+
+        </el-form-item>
 
-          <img @click="handleRefreshVerifyCode" class="verify-img" :src="verifyCodeUrl" style="cursor: pointer"
-               alt="">
+        <div>
+          <el-button @click="login" type="primary" style="margin-left: 100px;background-color: lightslategrey;color: black">登录
+          </el-button>
         </div>
 
-      </el-form-item>
+      </el-form>
 
-      <div>
-        <el-button @click="login" type="primary">登录
-        </el-button>
-      </div>
 
-    </el-form>
   </div>
 
 </template>
@@ -84,14 +94,14 @@ export default {
     login() {
       const vm = this;
 
-      vm.$http.get(vm.$api.auth.login,{
-        params:{
-          account:this.form.account,
-          password:this.form.password,
-          verifyCode:this.form.verifyCode,
+      vm.$http.get(vm.$api.auth.login, {
+        params: {
+          account: this.form.account,
+          password: this.form.password,
+          verifyCode: this.form.verifyCode,
         }
       }).then((resp) => {
-        if(resp.data.status === 200){
+        if (resp.data.status === 200) {
           vm.$message({
             type: "success",
             message: resp.data.desc
@@ -100,19 +110,19 @@ export default {
 
           vm.$router.push({
             path: '/',
-            query: {resp: resp}
+            query: {userBean: resp.data.data.userBean}
           });
 
         }
 
-        if(resp.data.status === 400){
+        if (resp.data.status === 400) {
           vm.$message({
             type: "error",
             message: resp.data.data.errorFields[0].message
           });
         }
 
-        if(resp.data.status === 500){
+        if (resp.data.status === 500) {
           vm.$message({
             type: "error",
             message: resp.data.desc
@@ -129,8 +139,25 @@ export default {
 
 <style scoped>
 .el-form {
-  width: 30%;
-  margin: 300px 200px 200px 500px;
+  width: 360px;
+  height: 360px;
+  margin-left: 60px;
+  margin-top: 30px;
+}
+
+.verify-img {
+  width: 130px;
+  height: 40px;
 }
 
+.loginForm{
+  padding: 10px;
+  width: 400px;
+  height: 290px;
+  margin-left: 38%;
+  margin-top: 16%;
+  background-color: whitesmoke;
+}
+
+
 </style>

+ 26 - 8
sources/client/vrv-platform/src/views/menu/menu.vue

@@ -106,15 +106,17 @@
           <!--          </el-radio-group>-->
 
           <el-dropdown style="margin-right: 20px;float: right;margin-top: 10px">
+
             <i class="el-icon-setting"></i>
+
             <el-dropdown-menu slot="dropdown">
               <el-dropdown-item>个人中心</el-dropdown-item>
               <el-dropdown-item>修改密码</el-dropdown-item>
-              <el-dropdown-item>退出登录</el-dropdown-item>
+              <el-dropdown-item @click.native="logout">退出登录</el-dropdown-item>
             </el-dropdown-menu>
           </el-dropdown>
 
-          <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>
 
@@ -135,7 +137,7 @@ export default {
 
   data() {
     return {
-      realname:'',
+      realname: '',
 
       index: '1',
 
@@ -149,13 +151,15 @@ export default {
   created: function () {
     let vm = this;
 
-    var resp = this.$route.query.resp
+    var userBean = this.$route.query.userBean
 
-    this.realname = resp.data.data.user.realname
+    this.realname = userBean.realname
 
-    console.log(resp)
+    console.log(this.realname)
 
-    vm.$router.push('/operator')
+    if (this.realname) {
+      vm.$router.push('/operator')
+    }
 
   },
 
@@ -182,6 +186,20 @@ export default {
       vm.$router.push('/device')
     },
 
+    logout() {
+      const vm = this;
+      vm.$http.get(vm.$api.auth.logout).then((resp) => {
+        console.log(resp)
+
+        vm.$router.push('/login')
+
+        this.$message({
+          type: 'success',
+          showClose: true,
+          message: resp.data.desc
+        })
+      })
+    }
   }
 }
 </script>
@@ -246,7 +264,7 @@ export default {
   height: 20px;
 }
 
-.el-button{
+.el-button {
   color: black;
 }
 </style>

+ 109 - 69
sources/client/vrv-platform/src/views/operator/list.vue

@@ -50,40 +50,47 @@
             </el-form-item>
 
 
-            <el-dialog title="运营商" :visible.sync="dialogFormVisible" style="width: 70% ; margin-left: 300px ;">
+            <el-dialog title="运营商" :visible.sync="dialogFormVisible" style="width: 71% ; margin-left: 300px ;">
 
-              <el-form label-position="left" :model="formData">
-                <el-form-item label="运营商名称" style=" text-align: right;margin-right: 20px">
+              <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="name">
                   <el-input v-model="formData.name"></el-input>
                 </el-form-item>
-                <el-form-item label="运营商编号" style="">
+                <el-form-item label="运营商编号" style="" prop="number">
                   <el-input v-model="formData.number"></el-input>
                 </el-form-item>
-                <el-form-item label="联系人" style=" text-align: right;margin-right: 34px;margin-left: 38px">
+                </el-row>
+
+                <el-row style="margin-left: 15px ;margin-top: 20px">
+                <el-form-item label="联系人" style="margin-left: 28px;margin-right: 24px" prop="contact">
                   <el-input v-model="formData.contact"></el-input>
                 </el-form-item>
-                <el-form-item label="联系电话" style="">
+                <el-form-item label="联系电话" style="" prop="tel">
                   <el-input v-model="formData.tel"></el-input>
                 </el-form-item>
+                </el-row>
 
-
-                <el-form-item label="省份" style=" text-align: right;margin-right: 62px;margin-left: 52px ;">
+                <el-row style="margin-left: 15px;margin-top: 20px;margin-bottom: 20px">
+                <el-form-item label="省份" style="margin-left: 42px;margin-right: 50px" prop="province">
                   <el-select v-model="formData.province" placeholder="省份" style="width: 202px" clearable>
                     <el-option v-for="item in areas" :value="item.label" :label="item.label"
                                :key="item.code"></el-option>
                   </el-select>
                 </el-form-item>
 
-                <el-form-item label="城市">
+                <el-form-item label="城市" prop="city">
                   <el-select v-model="formData.city" placeholder="城市" style="width: 202px"
                              :disabled="!formData.province" clearable>
                     <el-option v-for="item in cityArr" :value="item.label" :label="item.label"
                                :key="item.code"></el-option>
                   </el-select>
                 </el-form-item>
+                </el-row>
 
 
-                <el-form-item label="具体地址" style=" text-align: right;margin-right: 75px;margin-left: 24px">
+                <el-form-item label="具体地址" style="margin-left: 28px " prop="address">
                   <el-input v-model="formData.address"></el-input>
                 </el-form-item>
 
@@ -91,7 +98,7 @@
 
               <div slot="footer" class="dialog-footer" style="text-align: center">
                 <el-button @click="cancel()">取 消</el-button>
-                <el-button type="primary" @click="addOrEditMehtond()">确 定</el-button>
+                <el-button type="primary" @click="addOrEditMehtond('formData')">确 定</el-button>
               </div>
             </el-dialog>
 
@@ -165,6 +172,31 @@ export default {
   data() {
     return {
 
+      rules: {
+        province: [
+          {required: true, message: '请输入省份', trigger: 'change'}
+        ],
+        city: [
+          {required: true, message: '请输入城市', trigger: 'change'}
+        ],
+        address: [
+          {required: true, message: '请输入地区', trigger: 'blur'}
+        ],
+        contact: [
+          {required: true, message: '请输入联系人', trigger: 'blur'}
+        ],
+        tel: [
+          {required: true, message: '请输入联系电话', trigger: 'blur'}
+        ],
+        number: [
+          {required: true, message: '请输入运营商编号', trigger: 'blur'}
+        ],
+        name: [
+          {required: true, message: '请输入运营商名称', trigger: 'blur'}
+        ],
+      },
+
+
       //存放对应的城市数组
       cityArr: [],
       //省份
@@ -253,10 +285,7 @@ export default {
       if (oldValue) {
         this.cityArr = areas.find(item => item.label == oldValue).children
         console.log(this.cityArr)
-        this.formData.city = ''
       }
-
-
     },
     deep: true  // 深度监听
   },
@@ -299,6 +328,7 @@ export default {
       this.loadData();
     },
     showAdd() {
+      this.$refs.formData.clearValidate();
       this.dialogFormVisible = true;
 
       this.formData.name = '';
@@ -321,71 +351,81 @@ export default {
     },
 
 
-    addOrEditMehtond() {
-      const vm = this;
-      if (this.addOrEdit == 2) {
-        vm.$http.get(vm.api.update, {
-          params: {
-            code: this.formData.code,
-            name: this.formData.name,
-            province: this.formData.province,
-            city: this.formData.city,
-            contact: this.formData.contact,
-            tel: this.formData.tel,
-            address: this.formData.address,
-            number: this.formData.number,
-            status: 1,
-          }
-        })
-            .then((response) => {
-              console.log(response)
+    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.formData.code,
+                name: this.formData.name,
+                province: this.formData.province,
+                city: this.formData.city,
+                contact: this.formData.contact,
+                tel: this.formData.tel,
+                address: this.formData.address,
+                number: this.formData.number,
+                status: 1,
+              }
+            })
+                .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(() => {
+                });
+          }
 
+          if (this.addOrEdit == 1) {
+            vm.$http.get(vm.api.add, {
+              params: {
+                name: this.formData.name,
+                contact: this.formData.contact,
+                tel: this.formData.tel,
+                province: this.formData.province,
+                city: this.formData.city,
+                address: this.formData.address,
+                number: this.formData.number,
+                status: 1,
+              }
             })
-            .catch(() => {
-            });
-      }
+                .then((response) => {
+                  if (response.data.status == 200) {
 
-      if (this.addOrEdit == 1) {
-        vm.$http.get(vm.api.add, {
-          params: {
-            name: this.formData.name,
-            contact: this.formData.contact,
-            tel: this.formData.tel,
-            province: this.formData.province,
-            city: this.formData.city,
-            address: this.formData.address,
-            number: this.formData.number,
-            status: 1,
-          }
-        })
-            .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();
+                  }
                 })
+          }
+        } else {
+          console.log('error submit!!');
+          return false;
+        }
+      });
+
+
 
-                this.loadData();
-              }
-            })
-      }
     },
 
     del(row) {
@@ -427,6 +467,7 @@ export default {
         type: 'info'
       });
 
+      this.$refs.formData.clearValidate();
       this.dialogFormVisible = false;
     },
 
@@ -473,7 +514,6 @@ export default {
     },
 
     operatorList(row) {
-
       let vm = this;
       vm.$router.push({
         path: '/operatorList',

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

@@ -48,35 +48,37 @@
             </el-form-item>
 
             <el-form-item label="运营商编号" style="margin-top: 6px" size="mini">
-              <el-select v-model="formData.operatorNumber" placeholder="运营商编号" style="width: 180px">
+              <el-select v-model="searchFormData.operatorNumber" placeholder="运营商编号" style="width: 180px">
 
                 <el-option :value="i.number" v-for="(i,index) in operators" :key="index" :label="i.number"></el-option>
 
               </el-select>
             </el-form-item>
 
+
+
             <!--            编辑弹窗-->
             <el-dialog title="项目" :visible.sync="dialogFormVisible" style="width: 70% ; margin-left: 300px ;">
-              <el-form label-position="left" :model="formData">
+              <el-form label-position="left" :model="formData" :rules="rules" ref="formData">
                 <el-row style="margin-left: 15px">
-                  <el-form-item label="项目名称">
+                  <el-form-item label="项目名称" prop="name">
                     <el-input v-model="formData.name"></el-input>
                   </el-form-item>
-                  <el-form-item label="项目编号">
+                  <el-form-item label="项目编号" prop="number">
                     <el-input v-model="formData.number"></el-input>
                   </el-form-item>
                 </el-row>
-                <el-row style="margin-left: 15px">
-                  <el-form-item label="项目描述">
+                <el-row style="margin-left: 15px ;margin-top: 20px">
+                  <el-form-item label="项目描述" prop="description">
                     <el-input v-model="formData.description"></el-input>
                   </el-form-item>
-                  <el-form-item label="客户名称">
+                  <el-form-item label="客户名称" prop="customer">
                     <el-input v-model="formData.customer"></el-input>
                   </el-form-item>
                 </el-row>
 
-                <el-row style="margin-left: 0px">
-                  <el-form-item label="运营商编号">
+                <el-row style="margin-left: 0px ;margin-top: 20px">
+                  <el-form-item label="运营商编号" prop="operatorNumber">
                     <el-select v-model="formData.operatorNumber" placeholder="运营商编号" style="width: 202px">
 
                       <el-option :value="i.number" v-for="(i,index) in operators" :key="index"
@@ -85,19 +87,19 @@
                     </el-select>
                   </el-form-item>
 
-                  <el-form-item label="客户电话">
+                  <el-form-item label="客户电话" prop="customerTel">
                     <el-input v-model="formData.customerTel"></el-input>
                   </el-form-item>
                 </el-row>
 
-                <el-form-item label="省份" style=" text-align: right;margin-right: 38px;margin-left: 52px ;">
+                <el-form-item label="省份" style="margin-top: 20px; text-align: right;margin-right: 38px;margin-left: 52px ;" prop="province">
                   <el-select v-model="formData.province" placeholder="省份" style="width: 202px" clearable>
                     <el-option v-for="item in areas" :value="item.label" :label="item.label"
                                :key="item.code"></el-option>
                   </el-select>
                 </el-form-item>
 
-                <el-form-item label="城市">
+                <el-form-item label="城市" prop="city" style="margin-top: 20px">
                   <el-select v-model="formData.city" placeholder="城市" style="width: 202px"
                              :disabled="!formData.province" clearable>
                     <el-option v-for="item in cityArr" :value="item.label" :label="item.label"
@@ -106,14 +108,14 @@
                 </el-form-item>
 
 
-                <el-form-item label="具体地址" style="margin-left: 24px">
+                <el-form-item label="具体地址" style="margin-left: 24px;margin-top: 20px" prop="address">
                   <el-input v-model="formData.address"></el-input>
                 </el-form-item>
               </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>
+                <el-button type="primary" @click="addOrEditMehtond('formData')">确 定</el-button>
               </div>
             </el-dialog>
 
@@ -135,7 +137,7 @@
             <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="gateway">网关</el-button>
+                <el-button type="text" size="medium" @click="projectList(scope.row)">网关</el-button>
                 <el-button type="text" size="medium" @click="del(scope.row)" style="color: #c01920">删除</el-button>
               </template>
             </el-table-column>
@@ -168,6 +170,36 @@ export default {
   name: 'project',
   data() {
     return {
+      rules: {
+        operatorNumber: [
+          {required: true, message: '请输入运营商编号', trigger: 'change'}
+        ],
+        province: [
+          {required: true, message: '请输入省份', trigger: 'change'}
+        ],
+        city: [
+          {required: true, message: '请输入城市', trigger: 'change'}
+        ],
+        address: [
+          {required: true, message: '请输入地区', trigger: 'blur'}
+        ],
+        customer: [
+          {required: true, message: '请输入客户名称', trigger: 'blur'}
+        ],
+        customerTel: [
+          {required: true, message: '请输入客户电话', trigger: 'blur'}
+        ],
+        number: [
+          {required: true, message: '请输入项目编号', trigger: 'blur'}
+        ],
+        name: [
+          {required: true, message: '请输入项目名称', trigger: 'blur'}
+        ],
+        description: [
+          {required: true, message: '请输入项目描述', trigger: 'blur'}
+        ],
+      },
+
 
       //存放对应的城市数组
       cityArr: [],
@@ -250,18 +282,16 @@ export default {
 
       this.cityArr = areas.find(item => item.label == oldValue).children
       console.log(this.cityArr)
-
-
     },
 
     'formData.province'(oldValue, newValue) {
       console.log(oldValue)
       console.log(newValue)
 
-      this.formData.city = ''
-
-      this.cityArr = areas.find(item => item.label == oldValue).children
-      console.log(this.cityArr)
+      if (oldValue) {
+        this.cityArr = areas.find(item => item.label == oldValue).children
+        console.log(this.cityArr)
+      }
     },
     deep: true  // 深度监听
   },
@@ -333,109 +363,112 @@ export default {
           this.formData.description = '';
 
       this.addOrEdit = 1
-
-      this.getOperatorNumber()
     }
     ,
 
     showEdit(row) {
 
-      console.log()
-
       this.dialogFormVisible = true;
 
       this.editRow = JSON.parse(JSON.stringify(row));
       this.formData = this.editRow
 
       this.addOrEdit = 2
-
-      this.getOperatorNumber()
     }
     ,
 
+    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.formData.code,
+                name: this.formData.name,
+                number: this.formData.number,
+                description: this.formData.description,
+                province: this.formData.province,
+                city: this.formData.city,
+                address: this.formData.address,
+                operatorNumber: this.formData.operatorNumber,
+                customer: this.formData.customer,
+                customerTel: this.formData.customerTel,
 
-    addOrEditMehtond() {
-      const vm = this;
-      if (this.addOrEdit == 2) {
-        vm.$http.get(vm.api.update, {
-          params: {
-            code: this.formData.code,
-            name: this.formData.name,
-            number: this.formData.number,
-            description: this.formData.description,
-            province: this.formData.province,
-            city: this.formData.city,
-            address: this.formData.address,
-            operatorNumber: this.formData.operatorNumber,
-            customer: this.formData.customer,
-            customerTel: this.formData.customerTel,
+              }
+            })
+                .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(() => {
+                });
+          }
 
+          if (this.addOrEdit == 1) {
+            vm.$http.get(vm.api.add, {
+              params: {
+                name: this.formData.name,
+                number: this.formData.number,
+                description: this.formData.description,
+                province: this.formData.province,
+                city: this.formData.city,
+                operatorNumber: this.formData.operatorNumber,
+                address: this.formData.address,
+                customer: this.formData.customer,
+                customerTel: this.formData.customerTel,
+              }
             })
-            .catch(() => {
-            });
-      }
+                .then((response) => {
 
-      if (this.addOrEdit == 1) {
-        vm.$http.get(vm.api.add, {
-          params: {
-            name: this.formData.name,
-            number: this.formData.number,
-            description: this.formData.description,
-            province: this.formData.province,
-            city: this.formData.city,
-            operatorNumber: this.formData.operatorNumber,
-            address: this.formData.address,
-            customer: this.formData.customer,
-            customerTel: this.formData.customerTel,
-          }
-        })
-            .then((response) => {
+                  if (response.data.status == 200) {
 
-              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();
+                  }
+                  if (response.data.status == 500) {
 
-                this.loadData();
-              }
-              if (response.data.status == 500) {
+                    this.dialogFormVisible = false;
 
-                this.dialogFormVisible = false;
+                    this.$message({
+                      type: 'error',
+                      showClose: true,
+                      message: '未找到运营商'
+                    })
 
-                this.$message({
-                  type: 'error',
-                  showClose: true,
-                  message: '未找到运营商'
+                    this.loadData();
+                  }
                 })
+          }
+        } else {
+          console.log('error submit!!');
+          return false;
+        }
+      });
+
 
-                this.loadData();
-              }
-            })
-      }
     }
     ,
 
@@ -478,6 +511,7 @@ export default {
         type: 'info'
       });
 
+      this.$refs.formData.clearValidate();
       this.dialogFormVisible = false;
     }
     ,
@@ -491,7 +525,15 @@ export default {
     back(){
       let vm = this;
       vm.$router.back()
-    }
+    },
+
+    projectList(row) {
+      let vm = this;
+      vm.$router.push({
+        path: '/projectList',
+        query: {row: row}
+      })
+    },
   }
 }
 

+ 10 - 3
sources/client/vrv-platform/src/views/project/operatorList.vue

@@ -128,7 +128,7 @@
             <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="gateway">网关</el-button>
+                <el-button type="text" size="medium" @click="projectList(scope.row)">网关</el-button>
                 <el-button type="text" size="medium" @click="del(scope.row)" style="color: #c01920">删除</el-button>
               </template>
             </el-table-column>
@@ -262,7 +262,6 @@ export default {
       console.log(oldValue)
       console.log(newValue)
 
-      this.formData.city = ''
 
       this.cityArr = areas.find(item => item.label == oldValue).children
       console.log(this.cityArr)
@@ -498,7 +497,15 @@ export default {
     back(){
       let vm = this;
       vm.$router.back()
-    }
+    },
+
+    projectList(row) {
+      let vm = this;
+      vm.$router.push({
+        path: '/projectList',
+        query: {row: row}
+      })
+    },
 
   }
 }

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

@@ -45,10 +45,10 @@
             <el-form-item label="密码">
               <el-input v-model="formData.password"></el-input>
             </el-form-item>
-            <el-form-item label="角色">
+            <el-form-item label="绑定角色">
               <el-input v-model="formData.roleFlag"></el-input>
             </el-form-item>
-            <el-form-item label="运营商编号">
+            <el-form-item label="绑定运营商">
               <el-input v-model="formData.operatorNumber"></el-input>
             </el-form-item>
           </el-form>
@@ -74,7 +74,7 @@
 
         <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="showEdit(scope.row)">编辑</el-button>
             <el-button type="text" size="medium" @click="del(scope.row)" style="color: #c01920">删除</el-button>
           </template>
         </el-table-column>

+ 2 - 2
sources/client/vrv-platform/yarn.lock

@@ -4021,8 +4021,8 @@
   "resolved" "https://registry.npmmirror.com/fast-levenshtein/-/fast-levenshtein-2.0.6.tgz"
   "version" "2.0.6"
 
-"fastboot-ui@file:D:/IdeaCode/fastboot/ui/fastboot-ui":
-  "resolved" "file:D:/IdeaCode/fastboot/ui/fastboot-ui"
+"fastboot-ui@file:../../../../fastboot/ui/fastboot-ui":
+  "resolved" "file:../../../../fastboot/ui/fastboot-ui"
   "version" "0.1.0"
   dependencies:
     "@fortawesome/fontawesome" "^1.1.8"

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

@@ -1 +1 @@
-7668
+12068

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

@@ -209,6 +209,15 @@ public class DeviceServiceImpl extends AbstractFastbootService<Device, DeviceBea
         DetachedCriteria detachedCriteria = DetachedCriteria.forClass(Device.class);
 
         if (deviceBean != null) {
+            if (StringUtils.isNotBlank(deviceBean.getOperatorNumber())) {
+                detachedCriteria.add(Restrictions.like("operatorNumber", deviceBean.getOperatorNumber(), MatchMode.ANYWHERE));
+            }
+            if (StringUtils.isNotBlank(deviceBean.getProjectNumber())) {
+                detachedCriteria.add(Restrictions.like("projectNumber", deviceBean.getProjectNumber(), MatchMode.ANYWHERE));
+            }
+            if (StringUtils.isNotBlank(deviceBean.getGatewayNumber())) {
+                detachedCriteria.add(Restrictions.like("gatewayNumber", deviceBean.getGatewayNumber(), MatchMode.ANYWHERE));
+            }
             if (StringUtils.isNotBlank(deviceBean.getSn())) {
                 detachedCriteria.add(Restrictions.like("sn", deviceBean.getSn(), MatchMode.ANYWHERE));
             }

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

@@ -202,7 +202,7 @@ public class ProjectServiceImpl extends AbstractFastbootService<Project, Project
 
         if (projectBean != null) {
             if (StringUtils.isNotBlank(projectBean.getOperatorNumber())) {
-                detachedCriteria.add(Restrictions.like("operatorNumber", projectBean.getOperatorNumber(), MatchMode.ANYWHERE));
+                detachedCriteria.add(Restrictions.eq("operatorNumber", projectBean.getOperatorNumber()));
             }
             if (StringUtils.isNotBlank(projectBean.getName())) {
                 detachedCriteria.add(Restrictions.like("name", projectBean.getName(), MatchMode.ANYWHERE));

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

@@ -55,6 +55,7 @@ public class UserServiceImpl extends AbstractFastbootService<User, UserBean> imp
         beanToDomain(userBean, user, "id");
 
         String roleFlag = userBean.getRoleFlag();
+        String operatorNumber = userBean.getOperatorNumber();
 
         if (roleFlag == null || roleFlag == "") {
             userDao.save(user);
@@ -64,11 +65,20 @@ public class UserServiceImpl extends AbstractFastbootService<User, UserBean> imp
             return userBean;
         }
 
+        if (operatorNumber == null || operatorNumber == "") {
+            userDao.save(user);
+
+            domainToBean(user, userBean);
+
+            return userBean;
+        }
+
         //下拉列表直接查数据库已有的角色,不存在角色不匹配的情况
         Role role = roleDao.findByFlagAndValid(roleFlag, VALID);
-
+        Operator operator = operatorDao.findByNumberAndValid(operatorNumber, VALID);
 
         user.setRoleCode(role.getCode());
+        user.setOperatorCode(operator.getCode());
 
         userDao.save(user);
 
@@ -87,6 +97,7 @@ public class UserServiceImpl extends AbstractFastbootService<User, UserBean> imp
 
         User user = userDao.findByAccountAndPasswordAndValid(userBean.getAccount(), userBean.getPassword(), VALID);
 
+
         if (user == null) {
             return null;
         }
@@ -103,7 +114,6 @@ public class UserServiceImpl extends AbstractFastbootService<User, UserBean> imp
             return null;
         }
 
-
         User user = userDao.findByCodeAndValid(userBean.getCode(), VALID);
 
 
@@ -111,8 +121,33 @@ public class UserServiceImpl extends AbstractFastbootService<User, UserBean> imp
             return null;
         }
 
+        String operatorNumber = userBean.getOperatorNumber();
+        String roleFlag = userBean.getRoleFlag();
+        Role role = roleDao.findByFlagAndValid(roleFlag, VALID);
+        Operator operator = operatorDao.findByNumberAndValid(operatorNumber, VALID);
+
+        if (roleFlag == null || roleFlag == "") {
+            userDao.save(user);
+
+            domainToBean(user, userBean);
+
+            return userBean;
+        }
+
+        if (operatorNumber == null || operatorNumber == "") {
+            userDao.save(user);
+
+            domainToBean(user, userBean);
+
+            return userBean;
+        }
+
+
         beanToDomain(userBean, user, "id", "code", "version", "createTime", "updateTime", "valid");
 
+        user.setRoleCode(role.getCode());
+        user.setOperatorCode(operator.getCode());
+
         userDao.save(user);
 
         domainToBean(user, userBean);

+ 7 - 4
sources/server/vrv/vrv-platform/src/main/java/com/kuyuntech/vrv/platform/controller/core/OperatorLogController.java

@@ -12,6 +12,7 @@ import com.wbspool.fastboot.core.web.result.ParamErrorResultBuilder;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.data.redis.core.RedisTemplate;
 import org.springframework.validation.Errors;
 import org.springframework.validation.annotation.Validated;
 import org.springframework.web.bind.annotation.RequestMapping;
@@ -33,6 +34,8 @@ public class OperatorLogController {
 
     @Autowired
     OperatorLogService operatorLogService;
+    @Autowired
+    private RedisTemplate redisTemplate;
 
 
     /**
@@ -46,14 +49,14 @@ public class OperatorLogController {
     @ParamErrorAutoResponse
     public Object add(@Validated(ValidGroup.Add.class) OperatorLogBean operatorLogBean, HttpServletRequest request) {
 
-        UserBean userbean = (UserBean) request.getSession().getAttribute("userBean");
+        UserBean userBean = (UserBean) redisTemplate.opsForValue().get("userBean");
 
-        if (userbean == null) {
+        if (userBean == null) {
             return ResponseBean.unAuthorize("您未登录");
         }
 
-        operatorLogBean.setUserAccount(userbean.getAccount());
-        operatorLogBean.setUserRealname(userbean.getRealname());
+        operatorLogBean.setUserAccount(userBean.getAccount());
+        operatorLogBean.setUserRealname(userBean.getRealname());
 
         operatorLogBean = this.operatorLogService.add(operatorLogBean);