dedsudiyu 3 周之前
父节点
当前提交
36a17160fc
共有 4 个文件被更改,包括 309 次插入2 次删除
  1. 7 0
      .env.production
  2. 34 0
      src/api/secureAccess/index.js
  3. 2 2
      src/utils/index.js
  4. 266 0
      src/views/secureAccess/globalWhitelistConfiguration/index.vue

+ 7 - 0
.env.production

@@ -59,3 +59,10 @@ VUE_APP_LOGIN_TYPE = 'account'
 
 VUE_APP_OUT_URL = 'http://lab.zjznai.com/labapp/auth/cas/logout'
 
+# #################### 校级管理员身份ID ####################
+
+VUE_APP_SCHOOL_ID = '1815293314666532865'
+
+# #################### 院级管理员身份ID ####################
+
+VUE_APP_COLLEGE_ID = '1815336278075838465'

+ 34 - 0
src/api/secureAccess/index.js

@@ -156,3 +156,37 @@ export function laboratoryWhiteSubList(query) {
     params: query
   })
 }
+
+/************ 全局白名单配置 ************/
+//白名单列表
+export function labAllWhiteList(data) {
+  return request({
+    url: '/laboratory/labAllWhite/list',
+    method: 'post',
+    data: data
+  })
+}
+//新增全局白名单
+export function laboratoryLabAllWhiteAdd(data) {
+  return request({
+    url: '/laboratory/labAllWhite/add',
+    method: 'post',
+    data: data
+  })
+}
+//删除全局白名单
+export function laboratoryLabAllWhiteDelete(data) {
+  return request({
+    url: '/laboratory/labAllWhite/delete',
+    method: 'post',
+    data: data
+  })
+}
+//根据用户名查询不在全局白名单的用户
+export function laboratoryLabAllWhiteSelectUserNotAllWhite(data) {
+  return request({
+    url: '/laboratory/labAllWhite/selectUserNotAllWhite',
+    method: 'post',
+    data: data
+  })
+}

+ 2 - 2
src/utils/index.js

@@ -413,8 +413,8 @@ export function controlsRestrictVerify(str) {
 export function itoOrVideoLimits(subAdminId) {
   console.log('subAdminId',subAdminId)
   let userInfo = JSON.parse(localStorage.getItem('user'));
-  let schoolId = '1815293314666532865';
-  let collegeId = '1815336278075838465';
+  let schoolId = process.env.VUE_APP_SCHOOL_ID;
+  let collegeId = process.env.VUE_APP_COLLEGE_ID;
   if(userInfo.position == null){
     //如果是管理员(系统用户)
     return true

+ 266 - 0
src/views/secureAccess/globalWhitelistConfiguration/index.vue

@@ -0,0 +1,266 @@
+<!-- 全局白名单配置 -->
+<template>
+  <div class="app-container globalWhitelistConfiguration">
+    <div class="page-container globalWhitelistConfigurationPage">
+      <div class="page-form-title-box">
+        <el-form :model="queryParams" class="form-box" ref="queryForm"
+                 :inline="true" style="width:100%;">
+          <el-form-item label="" prop="queryParamsData1">
+            <el-input
+              maxLength="30"
+              v-model="queryParams.queryParamsData1"
+              placeholder="姓名/工号/联系方式"
+              style="width: 200px"
+            />
+          </el-form-item>
+          <p class="page-inquire-common-style-button" @click="handleQuery">查询</p>
+          <p class="page-reset-common-style-button" @click="resetQuery">重置</p>
+          <p class="page-submit-common-style-button"
+             style="float: right;"
+             @click="dialogOpen"
+             v-hasPermiRouter="['lab:allWhite:add']"
+          >新增</p>
+        </el-form>
+      </div>
+      <div class="page-content-box">
+        <el-table class="table-box" v-loading="loading" border :data="dataList">
+          <el-table-column label="名称" prop="userName"  show-overflow-tooltip/>
+          <el-table-column label="工号" prop="account" width="200" show-overflow-tooltip/>
+          <el-table-column label="部门" prop="deptName" width="200" show-overflow-tooltip/>
+          <el-table-column label="创建人" prop="createName" width="200" show-overflow-tooltip/>
+          <el-table-column label="创建时间" prop="createTime" width="200" show-overflow-tooltip>
+            <template slot-scope="scope">
+              <span>{{ parseTime(scope.row.createTime,"{y}-{m}-{d} {h}:{i}") }}</span>
+            </template>
+          </el-table-column>
+          <el-table-column label="操作" width="200" show-overflow-tooltip v-if="tableButtonType">
+            <template slot-scope="scope">
+              <div class="table-button-box">
+                <p class="table-button-null"></p>
+                <p class="table-button-p"
+                   @click="delRow(scope.row)"
+                   v-hasPermiRouter="['lab:allWhite:del']"
+                >删除</p>
+                <p class="table-button-null"></p>
+              </div>
+            </template>
+          </el-table-column>
+        </el-table>
+        <pagination :page-sizes="[20, 30, 40, 50]"
+                    v-show="total>0"
+                    :total="total"
+                    :page.sync="queryParams.page"
+                    :limit.sync="queryParams.pageSize"
+                    @pagination="getList"
+        />
+      </div>
+    </div>
+    <!--新增弹窗-->
+    <el-dialog class="globalWhitelistConfiguration-dialog" title='设备地址' width="800px" append-to-body
+               :visible.sync="dialogType" v-if="dialogType" @close="dialogOff()"
+               :close-on-click-modal="false" :close-on-press-escape="false">
+      <el-form :model="dialogForm" ref="dialogForm" class="dialog-top-box" :inline="true" label-width="80px">
+        <el-form-item label="" prop="searchValue">
+          <el-input v-model="dialogForm.searchValue" placeholder="请输入姓名/工号检索人员" style="width:300px;"></el-input>
+        </el-form-item>
+        <p class="page-inquire-common-style-button" @click="dialogHandleQuery">查询</p>
+        <p class="page-reset-common-style-button" @click="dialogResetQuery">重置</p>
+      </el-form>
+      <div class="page-content-box dialog-center-box">
+        <el-table class="table-box table-null-img-20" highlight-current-row v-loading="loading" border :data="dialogDataList"
+                  @current-change="handleCurrentChange">
+          <el-table-column label="名称" prop="userName"  show-overflow-tooltip/>
+          <el-table-column label="工号" prop="account" width="200" show-overflow-tooltip/>
+          <el-table-column label="部门" prop="deptName" width="200" show-overflow-tooltip/>
+        </el-table>
+        <pagination :page-sizes="[20, 30, 40, 50]"
+                    v-show="dialogTotal>0"
+                    :total="dialogTotal"
+                    :page.sync="dialogForm.page"
+                    :limit.sync="dialogForm.pageSize"
+                    @pagination="dialogGetList"
+        />
+      </div>
+      <div slot="footer" class="dialog-footer dialog-footer-box">
+        <p class="dialog-footer-button-null"></p>
+        <p class="dialog-footer-button-info" @click="dialogOff()">取消</p>
+        <p class="dialog-footer-button-primary" @click="dialogSubmit">提交</p>
+        <p class="dialog-footer-button-null"></p>
+      </div>
+    </el-dialog>
+  </div>
+</template>
+<script>
+  import {
+    labAllWhiteList,
+    laboratoryLabAllWhiteAdd,
+    laboratoryLabAllWhiteDelete,
+    laboratoryLabAllWhiteSelectUserNotAllWhite,
+  } from "@/api/secureAccess/index";
+  export default {
+    name: 'index',
+    data () {
+      return {
+        tableButtonType:this.hasPermiDom(['lab:allWhite:del',]),
+        //页面遮罩
+        loading:false,
+        //查询条件
+        queryParams:{
+          page:1,
+          pageSize:20,
+          queryParamsData1:"",
+          queryParamsData2 :null,
+        },
+        //列表数据
+        dataList:[],
+        //数据数量
+        total:0,
+        //弹窗相关
+        dialogDataList:[],
+        dialogTotal:0,
+        dialogType:false,
+        dialogForm:{
+          searchValue:'',
+          page:1,
+          pageSize:20,
+        },
+        currentRow:null,
+      }
+    },
+    created () {
+
+    },
+    mounted () {
+      this.getList();
+    },
+    methods: {
+      //选中
+      handleCurrentChange(val) {
+        this.$set(this,'currentRow',val);
+      },
+      //弹窗查询按钮
+      dialogHandleQuery(){
+        this.$set(this.dialogForm,'page',1);
+        this.$set(this,'currentRow',null);
+        this.dialogGetList();
+      },
+      //弹窗重置按钮
+      dialogResetQuery(){
+        this.$set(this,'dialogForm',{
+          page:1,
+          pageSize:20,
+          searchValue:"",
+        });
+        this.$set(this,'currentRow',null);
+        this.dialogGetList();
+      },
+      //弹层关闭
+      dialogOff(){
+        this.$set(this,'dialogType',false);
+      },
+      //弹层开启
+      dialogOpen(){
+        this.$set(this,'dialogForm',{
+          page:1,
+          pageSize:20,
+          searchValue:"",
+        });
+        this.dialogGetList();
+        this.$set(this,'currentRow',null);
+        this.$set(this,'dialogDataList',[]);
+        this.$set(this,'dialogTotal',0);
+        this.$set(this,'dialogType',true);
+      },
+      //弹层确定
+      dialogSubmit(){
+        if(!this.currentRow){
+          this.msgError('请选择人员')
+          return
+        }
+        let obj ={
+          userId: this.currentRow.userId,
+          userName: this.currentRow.userName,
+          deptId: this.currentRow.deptId,
+          deptName: this.currentRow.deptName,
+          mobile: this.currentRow.mobile,
+          account: this.currentRow.account,
+          userType: this.currentRow.userType,
+        };
+        laboratoryLabAllWhiteAdd(obj).then(response => {
+          this.msgSuccess(response.message)
+          this.resetQuery();
+          this.$set(this,'dialogType',false);
+        });
+      },
+      //弹层数据拉取
+      dialogGetList(){
+        laboratoryLabAllWhiteSelectUserNotAllWhite(this.dialogForm).then(response => {
+          this.$set(this,'dialogDataList',response.data.records);
+          this.$set(this,'dialogTotal',response.data.total);
+        });
+      },
+      //查询按钮
+      handleQuery(){
+        this.$set(this.queryParams,'page',1);
+        this.getList();
+      },
+      //重置按钮
+      resetQuery(){
+        this.$set(this,'queryParams',{
+          page:1,
+          pageSize:20,
+          queryParamsData1:"",
+          queryParamsData2 :null,
+        });
+        this.getList();
+      },
+      //获取数据列表
+      getList(){
+        this.$set(this,'loading',true);
+        let obj = JSON.parse(JSON.stringify(this.queryParams))
+        labAllWhiteList(obj).then(response => {
+          this.$set(this,'loading',false);
+          this.$set(this,'dataList',response.data.records);
+          this.$set(this,'total',response.data.total);
+        });
+      },
+      //操作按钮
+      delRow(row){
+        let self = this;
+        //删除
+        this.$confirm('是否确认删除?', "警告", {
+          confirmButtonText: "确定",
+          cancelButtonText: "取消",
+          type: "warning"
+        }).then(function() {
+        }).then(() => {
+          laboratoryLabAllWhiteDelete({id:row.id}).then(response => {
+            self.msgSuccess(response.message)
+            self.getList();
+          });
+        }).catch(() => {});
+      },
+    },
+  }
+</script>
+<style scoped lang="scss">
+  .globalWhitelistConfiguration{
+    .globalWhitelistConfigurationPage{
+
+    }
+  }
+</style>
+<style lang="scss">
+  .globalWhitelistConfiguration-dialog{
+    .el-dialog__body{
+      padding:20px;
+      .dialog-top-box{
+        padding:0 ;
+      }
+      .dialog-center-box{
+        height:400px;
+        padding:0 ;
+      }
+    }
+  }
+</style>