|
@@ -6,7 +6,7 @@
|
|
<el-input
|
|
<el-input
|
|
maxLength="30"
|
|
maxLength="30"
|
|
v-model="queryParamsData.searchValue"
|
|
v-model="queryParamsData.searchValue"
|
|
- placeholder="设备编号/实验室"
|
|
|
|
|
|
+ placeholder="门禁锁编号/实验室"
|
|
clearable
|
|
clearable
|
|
size="small"
|
|
size="small"
|
|
style="width: 240px"
|
|
style="width: 240px"
|
|
@@ -43,29 +43,16 @@
|
|
><i class="el-icon-plus"></i>新增</p>
|
|
><i class="el-icon-plus"></i>新增</p>
|
|
</el-col>
|
|
</el-col>
|
|
</el-form-item>
|
|
</el-form-item>
|
|
- <el-form-item style="float: right;">
|
|
|
|
- <el-dropdown @command="importButton" v-hasPermi="['laboratory:hardware6:import']">
|
|
|
|
- <div class="form-dropdown-box">
|
|
|
|
- <img src="@/assets/ZDimages/personnelManagement/icon_jzgxx_dr.png">
|
|
|
|
- <p>导入</p>
|
|
|
|
- <img src="@/assets/ZDimages/personnelManagement/icon_jzggl_xljt.png">
|
|
|
|
- </div>
|
|
|
|
- <el-dropdown-menu slot="dropdown">
|
|
|
|
- <el-dropdown-item style="border-bottom:1px solid #E0E0E0;margin:0 10px;color:#333;" :command="{command:1}">下载模板</el-dropdown-item>
|
|
|
|
- <el-dropdown-item style="margin:0 10px;color:#666;" :command="{command:2}">导入数据</el-dropdown-item>
|
|
|
|
- </el-dropdown-menu>
|
|
|
|
- </el-dropdown>
|
|
|
|
- </el-form-item>
|
|
|
|
</el-form>
|
|
</el-form>
|
|
<el-table border :data="tableList" ref="multipleTable">
|
|
<el-table border :data="tableList" ref="multipleTable">
|
|
<el-table-column label="门禁锁编号" align="center" prop="hardwareNum"/>
|
|
<el-table-column label="门禁锁编号" align="center" prop="hardwareNum"/>
|
|
<el-table-column label="学院" align="center" prop="deptName" width="250"/>
|
|
<el-table-column label="学院" align="center" prop="deptName" width="250"/>
|
|
- <el-table-column label="位置" align="center" prop="posi" width="250" show-overflow-tooltip/>
|
|
|
|
|
|
+ <el-table-column label="实验室" align="center" prop="posi" width="250" show-overflow-tooltip/>
|
|
<el-table-column label="设备状态" align="center" prop="status" width="100">
|
|
<el-table-column label="设备状态" align="center" prop="status" width="100">
|
|
<template slot-scope="scope">{{scope.row.operate.name}}</template>
|
|
<template slot-scope="scope">{{scope.row.operate.name}}</template>
|
|
</el-table-column>
|
|
</el-table-column>
|
|
- <el-table-column label="创建时间" align="center" prop="createTime" width="250"/>
|
|
|
|
<el-table-column label="创建人" align="center" prop="createBy" width="150"/>
|
|
<el-table-column label="创建人" align="center" prop="createBy" width="150"/>
|
|
|
|
+ <el-table-column label="创建时间" align="center" prop="createTime" width="250"/>
|
|
<el-table-column label="操作" align="center" width="140" class-name="small-padding fixed-width" v-if="tableButtonType">
|
|
<el-table-column label="操作" align="center" width="140" class-name="small-padding fixed-width" v-if="tableButtonType">
|
|
<template slot-scope="scope">
|
|
<template slot-scope="scope">
|
|
<div class="button-box">
|
|
<div class="button-box">
|
|
@@ -76,53 +63,16 @@
|
|
</el-table-column>
|
|
</el-table-column>
|
|
</el-table>
|
|
</el-table>
|
|
<pagination :page-sizes="[20, 30, 40, 50]"
|
|
<pagination :page-sizes="[20, 30, 40, 50]"
|
|
- v-show="total>0"
|
|
|
|
- :total="total"
|
|
|
|
- :page.sync="queryParams.pageNum"
|
|
|
|
- :limit.sync="queryParams.pageSize"
|
|
|
|
- @pagination="getList"
|
|
|
|
|
|
+ v-show="total>0"
|
|
|
|
+ :total="total"
|
|
|
|
+ :page.sync="queryParamsData.pageNum"
|
|
|
|
+ :limit.sync="queryParamsData.pageSize"
|
|
|
|
+ @pagination="getList"
|
|
/>
|
|
/>
|
|
- <!--导入窗口-->
|
|
|
|
- <el-dialog title="导入数据" :visible.sync="importOpen" @close="importOpenOff" width="600px" append-to-body class="import-dialog-box">
|
|
|
|
- <div class="el-upload__text" style="margin:0 0 20px 58px;">提示:导入后的数据将覆盖原有数据</div>
|
|
|
|
- <el-upload
|
|
|
|
- class="import-dialog-upLoad-box"
|
|
|
|
- :drag="true"
|
|
|
|
- :data="upImportData"
|
|
|
|
- :action="uploadImgUrl"
|
|
|
|
- :show-file-list="false"
|
|
|
|
- :on-success="handleAvatarSuccess"
|
|
|
|
- :headers="headers"
|
|
|
|
- :before-upload="beforeAvatarUpload">
|
|
|
|
- <i class="el-icon-upload"></i>
|
|
|
|
- <div class="el-upload__text">将文件拖到此处,或<em>点击上传</em></div>
|
|
|
|
- <!--<div class="el-upload__tip" slot="tip">-->
|
|
|
|
- <!--<el-checkbox v-model="upImportData.upDate">是否更新已经存在的数据</el-checkbox>-->
|
|
|
|
- <!--</div>-->
|
|
|
|
- <div class="el-upload__tip" slot="tip">数据导入模板.xlsx<span style="color:#0183FA;cursor: pointer" @click="importTemplate">下载</span></div>
|
|
|
|
- <div class="el-upload-text-box" slot="tip" v-if="getImportData.downFile">
|
|
|
|
- <div class="img-text-box">
|
|
|
|
- <img src="@/assets/ZDimages/personnelManagement/icon_dr_wj.png">
|
|
|
|
- <p>{{getImportData.textName}}</p>
|
|
|
|
- </div>
|
|
|
|
- <p class="text-p">数据导入成功 <span style="color:#0183FA;">{{getImportData.successNum}}</span> 条,失败 <span style="color:#FF6464 ;">{{getImportData.failureNum}}</span> 条</p>
|
|
|
|
- <div class="img-text-box">
|
|
|
|
- <img src="@/assets/ZDimages/personnelManagement/icon_dr_sj.png">
|
|
|
|
- <p style="color:#0183FA;cursor: pointer;" @click="failureExcel">点击下载失败数据报表</p>
|
|
|
|
- </div>
|
|
|
|
- </div>
|
|
|
|
- </el-upload>
|
|
|
|
- <div slot="footer" class="teacher-import-dialog-button-box">
|
|
|
|
- <p class="inquire-button-one" @click="importOpenOff">确定</p>
|
|
|
|
- </div>
|
|
|
|
- <div class="teacher-import-dialog-position-box" v-if="loading"></div>
|
|
|
|
- </el-dialog>
|
|
|
|
|
|
+
|
|
<!--新增/编辑-->
|
|
<!--新增/编辑-->
|
|
<el-dialog :title="dialogTitle" :visible.sync="addDialogType" v-if="addDialogType" width="520px" append-to-body class="add-dialog-box">
|
|
<el-dialog :title="dialogTitle" :visible.sync="addDialogType" v-if="addDialogType" width="520px" append-to-body class="add-dialog-box">
|
|
<el-form ref="form" :model="form" :rules="rules" label-width="110px">
|
|
<el-form ref="form" :model="form" :rules="rules" label-width="110px">
|
|
- <el-form-item label="门禁锁编号:" prop="hardwareNum">
|
|
|
|
- <el-input v-model="form.hardwareNum" placeholder="最大20个字符,包含大小写字母、数字" onkeyup="value=value.replace(/[^\w\.\/]/ig,'')" maxlength="20" style="width:360px;"/>
|
|
|
|
- </el-form-item>
|
|
|
|
<el-form-item label="实验室:" prop="subjectId">
|
|
<el-form-item label="实验室:" prop="subjectId">
|
|
<el-select
|
|
<el-select
|
|
style="width:360px;"
|
|
style="width:360px;"
|
|
@@ -144,6 +94,66 @@
|
|
</el-option>
|
|
</el-option>
|
|
</el-select>
|
|
</el-select>
|
|
</el-form-item>
|
|
</el-form-item>
|
|
|
|
+ <el-form-item label="门禁编号" prop="hardwareNum">
|
|
|
|
+ <el-input
|
|
|
|
+ style="width:320px;"
|
|
|
|
+ v-model="form.hardwareNum"
|
|
|
|
+ placeholder="请输入门禁编号"
|
|
|
|
+ maxlength="20"
|
|
|
|
+ size="small"
|
|
|
|
+ />
|
|
|
|
+ </el-form-item>
|
|
|
|
+ <el-form-item label="门禁名称" prop="name" >
|
|
|
|
+ <el-input
|
|
|
|
+ style="width:320px;"
|
|
|
|
+ v-model="form.name"
|
|
|
|
+ placeholder="请输入门禁名称"
|
|
|
|
+ maxlength="8"
|
|
|
|
+ size="small"
|
|
|
|
+ />
|
|
|
|
+ </el-form-item>
|
|
|
|
+ <el-form-item label="IP" prop="ipAddress" >
|
|
|
|
+ <el-input
|
|
|
|
+ style="width:320px;"
|
|
|
|
+ v-model="form.ipAddress"
|
|
|
|
+ placeholder="请输入IP"
|
|
|
|
+ maxlength="15"
|
|
|
|
+ size="small"
|
|
|
|
+ />
|
|
|
|
+ </el-form-item>
|
|
|
|
+ <el-form-item label="端口" prop="port" >
|
|
|
|
+ <el-input
|
|
|
|
+ style="width:320px;"
|
|
|
|
+ v-model="form.port"
|
|
|
|
+ placeholder="请输入端口"
|
|
|
|
+ maxlength="6"
|
|
|
|
+ size="small"
|
|
|
|
+ />
|
|
|
|
+ </el-form-item>
|
|
|
|
+ <el-form-item label="设备管理证号" prop="harUser" >
|
|
|
|
+ <el-input
|
|
|
|
+ style="width:320px;"
|
|
|
|
+ v-model="form.harUser"
|
|
|
|
+ placeholder="请输入设备管理证号"
|
|
|
|
+ maxlength="30"
|
|
|
|
+ size="small"
|
|
|
|
+ />
|
|
|
|
+ </el-form-item>
|
|
|
|
+ <el-form-item label="设备管理密码" prop="harPsw" >
|
|
|
|
+ <el-input
|
|
|
|
+ style="width:320px;"
|
|
|
|
+ v-model="form.harPsw"
|
|
|
|
+ placeholder="请输入设备管理密码"
|
|
|
|
+ maxlength="30"
|
|
|
|
+ size="small"
|
|
|
|
+ />
|
|
|
|
+ </el-form-item>
|
|
|
|
+ <el-form-item label="门禁权限" style="margin-bottom: 0">
|
|
|
|
+ <el-checkbox-group v-model="form.controlScope">
|
|
|
|
+ <el-checkbox label="1" >关联安全准入</el-checkbox>
|
|
|
|
+ <el-checkbox label="2">关联白名单</el-checkbox>
|
|
|
|
+ </el-checkbox-group>
|
|
|
|
+ </el-form-item>
|
|
</el-form>
|
|
</el-form>
|
|
<div slot="footer" class="dialog-footer">
|
|
<div slot="footer" class="dialog-footer">
|
|
<el-button type="primary" @click="submitForm">确 定</el-button>
|
|
<el-button type="primary" @click="submitForm">确 定</el-button>
|
|
@@ -154,174 +164,191 @@
|
|
</template>
|
|
</template>
|
|
|
|
|
|
<script>
|
|
<script>
|
|
- import { hxpSmartTerminal,filterDept,getSubList,addHxpSmartTerminal,putHxpSmartTerminal,getHxpSmartTerminal,delHxpSmartTerminal } from "@/api/medicUniversity-3_1/index";
|
|
|
|
- import { listHardware, delHardware, addHardware, updateHardware } from "@/api/medicUniversity-3_1/index";
|
|
|
|
- import { listDepartments } from "@/api/system/dept";
|
|
|
|
- import { getToken } from "@/utils/auth";
|
|
|
|
- export default {
|
|
|
|
- name: "SmartAccessControl",
|
|
|
|
- data() {
|
|
|
|
- return {
|
|
|
|
- // table操作按钮校验
|
|
|
|
- tableButtonType:this.hasPermiDom(['laboratory:hardware6:edit','laboratory:hardware6:remove']),
|
|
|
|
- //上传相关配置
|
|
|
|
- uploadImgUrl: window.location.href.split('://')[0]+'://' + process.env.VUE_APP_BASE_API + "/laboratory/hardware/importData", // 上传地址
|
|
|
|
- headers: {
|
|
|
|
- Authorization: "Bearer " + getToken(),
|
|
|
|
- },
|
|
|
|
- // 遮罩层
|
|
|
|
- loading:false,
|
|
|
|
- //页面状态
|
|
|
|
- pageType:1,
|
|
|
|
- // 搜索数据
|
|
|
|
- queryParamsData:{
|
|
|
|
- pageNum:1,
|
|
|
|
- pageSize:20,
|
|
|
|
- },
|
|
|
|
- // 搜索实际发送数据
|
|
|
|
- queryParams:{
|
|
|
|
- pageNum:1,
|
|
|
|
- pageSize:20,
|
|
|
|
- },
|
|
|
|
- //数据数量
|
|
|
|
- total:0,
|
|
|
|
- //数据数组
|
|
|
|
- tableList:[],
|
|
|
|
- //学院列表
|
|
|
|
- optionsListOne:[],
|
|
|
|
- //状态列表
|
|
|
|
- optionsListTwo:[{id:"ONLINE",name:"在线"},{id:"OFFLINE",name:"离线"}],
|
|
|
|
- //导入弹层开关
|
|
|
|
- importOpen:false,
|
|
|
|
- //导入数据
|
|
|
|
- upImportData:{
|
|
|
|
- sysUserEnable:true,
|
|
|
|
- upDate:false,
|
|
|
|
- terminalType:'AI_DOORLOCK',
|
|
|
|
- },
|
|
|
|
- getImportData:{
|
|
|
|
- downFile:false,
|
|
|
|
- successNum:0,
|
|
|
|
- failureNum:0,
|
|
|
|
- textName:"",
|
|
|
|
- },
|
|
|
|
- //编辑新增相关
|
|
|
|
- dialogTitle:"",
|
|
|
|
- addDialogType:false,
|
|
|
|
- form:{},
|
|
|
|
- selectList:[],
|
|
|
|
- selectListData:[],
|
|
|
|
- rules:{
|
|
|
|
- hardwareNum: [
|
|
|
|
- { required: true, trigger: "blur", message: "最大20个字符,包含大小写字母、数字" },
|
|
|
|
- { required: true, message: "最大20个字符,包含大小写字母、数字", validator: this.spaceJudgment, trigger: "blur" }
|
|
|
|
- ],
|
|
|
|
- subjectId: [
|
|
|
|
- { required: true, trigger: "blur", message: "搜索选择实验室" },
|
|
|
|
- ],
|
|
|
|
- },
|
|
|
|
- };
|
|
|
|
- },
|
|
|
|
- created() {
|
|
|
|
|
|
+import { hxpSmartTerminal,filterDept,getSubList,addHxpSmartTerminal,putHxpSmartTerminal,getHxpSmartTerminal,delHxpSmartTerminal } from "@/api/medicUniversity-3_1/index";
|
|
|
|
+import { listHardware, delHardware, addHardware, updateHardware } from "@/api/medicUniversity-3_1/index";
|
|
|
|
+import { listDepartments } from "@/api/system/dept";
|
|
|
|
+import { getToken } from "@/utils/auth";
|
|
|
|
+export default {
|
|
|
|
+ name: "SmartAccessControl-jinan",
|
|
|
|
+ data() {
|
|
|
|
+ return {
|
|
|
|
+ // table操作按钮校验
|
|
|
|
+ tableButtonType:this.hasPermiDom(['laboratory:hardware6:edit','laboratory:hardware6:remove']),
|
|
|
|
+ //上传相关配置
|
|
|
|
+ uploadImgUrl: window.location.href.split('://')[0]+'://' + process.env.VUE_APP_BASE_API + "/laboratory/hardware/importData", // 上传地址
|
|
|
|
+ headers: {
|
|
|
|
+ Authorization: "Bearer " + getToken(),
|
|
|
|
+ },
|
|
|
|
+ // 遮罩层
|
|
|
|
+ loading:false,
|
|
|
|
+ //页面状态
|
|
|
|
+ pageType:1,
|
|
|
|
+ // 搜索数据
|
|
|
|
+ queryParamsData:{
|
|
|
|
+ pageNum:1,
|
|
|
|
+ pageSize:20,
|
|
|
|
+ },
|
|
|
|
+ //数据数量
|
|
|
|
+ total:0,
|
|
|
|
+ //数据数组
|
|
|
|
+ tableList:[],
|
|
|
|
+ //学院列表
|
|
|
|
+ optionsListOne:[],
|
|
|
|
+ //状态列表
|
|
|
|
+ optionsListTwo:[{id:"ONLINE",name:"在线"},{id:"OFFLINE",name:"离线"}],
|
|
|
|
+ //编辑新增相关
|
|
|
|
+ dialogTitle:"",
|
|
|
|
+ addDialogType:false,
|
|
|
|
+ form:{},
|
|
|
|
+ selectList:[],
|
|
|
|
+ selectListData:[],
|
|
|
|
+ rules:{
|
|
|
|
+ name: [
|
|
|
|
+ { required: true, trigger: "blur", message: "请输入门禁名称" },
|
|
|
|
+ ],
|
|
|
|
+ hardwareNum: [
|
|
|
|
+ { required: true, trigger: "blur", message: "最大20个字符,包含大小写字母、数字" },
|
|
|
|
+ { required: true, message: "最大20个字符,包含大小写字母、数字", validator: this.spaceJudgment, trigger: "blur" }
|
|
|
|
+ ],
|
|
|
|
+ subjectId: [
|
|
|
|
+ { required: true, trigger: "blur", message: "搜索选择实验室" },
|
|
|
|
+ ],
|
|
|
|
+ relayCode: [
|
|
|
|
+ { required: true, message: "请输入设备编号", trigger: "blur" },
|
|
|
|
+ { required: true, message: "请输入设备编号", validator: this.spaceJudgment, trigger: "blur" }
|
|
|
|
+ ],
|
|
|
|
+ bit: [
|
|
|
|
+ { required: true, message: "请输入路由", trigger: "blur" },
|
|
|
|
+ { required: true, message: "请输入路由", validator: this.spaceJudgment, trigger: "blur" }
|
|
|
|
+ ],
|
|
|
|
+ ipAddress: [
|
|
|
|
+ { required: true, message: "请输入IP", trigger: "blur" },
|
|
|
|
+ { required: true, message: "请输入IP", validator: this.spaceJudgment, trigger: "blur" }
|
|
|
|
+ ],
|
|
|
|
+ port: [
|
|
|
|
+ { required: true, message: "请输入端口", trigger: "blur" },
|
|
|
|
+ { required: true, message: "请输入端口", validator: this.spaceJudgment, trigger: "blur" }
|
|
|
|
+ ],
|
|
|
|
+
|
|
|
|
+ harUser: [
|
|
|
|
+ { required: true, message: "请输入设备管理证号", trigger: "blur" },
|
|
|
|
+ { required: true, message: "请输入设备管理证号", validator: this.spaceJudgment, trigger: "blur" }
|
|
|
|
+ ],
|
|
|
|
+ harPsw: [
|
|
|
|
+ { required: true, message: "请输入设备管理密码", trigger: "blur" },
|
|
|
|
+ { required: true, message: "请输入设备管理密码", validator: this.spaceJudgment, trigger: "blur" }
|
|
|
|
+ ],
|
|
|
|
+
|
|
|
|
+ },
|
|
|
|
+ };
|
|
|
|
+ },
|
|
|
|
+ created() {
|
|
|
|
|
|
|
|
+ },
|
|
|
|
+ mounted(){
|
|
|
|
+ this.filterDept();
|
|
|
|
+ this.listDepartments();
|
|
|
|
+ this.getList();
|
|
|
|
+ },
|
|
|
|
+ methods: {
|
|
|
|
+ selectFocus(){
|
|
|
|
+ if(!this.selectList[0]){
|
|
|
|
+ this.filterDept();
|
|
|
|
+ }
|
|
},
|
|
},
|
|
- mounted(){
|
|
|
|
- this.filterDept();
|
|
|
|
- this.listDepartments();
|
|
|
|
- this.getList();
|
|
|
|
|
|
+ //获取学院列表
|
|
|
|
+ listDepartments(){
|
|
|
|
+ listDepartments().then(response => {
|
|
|
|
+ this.optionsListOne = response.data;
|
|
|
|
+ });
|
|
},
|
|
},
|
|
- methods: {
|
|
|
|
- selectFocus(){
|
|
|
|
- if(!this.selectList[0]){
|
|
|
|
- this.filterDept();
|
|
|
|
- }
|
|
|
|
- },
|
|
|
|
- //获取学院列表
|
|
|
|
- listDepartments(){
|
|
|
|
- listDepartments().then(response => {
|
|
|
|
- this.optionsListOne = response.data;
|
|
|
|
|
|
+ pageToggle(type,row){
|
|
|
|
+ let self = this;
|
|
|
|
+ if(type == 1){
|
|
|
|
+ //新增
|
|
|
|
+ this.dialogTitle = '新增';
|
|
|
|
+ this.$set(this,'form',{
|
|
|
|
+ subjectId:"",
|
|
|
|
+ hardwareNum:"",
|
|
|
|
+ name:"",
|
|
|
|
+ ipAddress:"",
|
|
|
|
+ port:"",
|
|
|
|
+ harUser:"",
|
|
|
|
+ harPsw:"",
|
|
|
|
+ controlScope:[],
|
|
});
|
|
});
|
|
- },
|
|
|
|
- pageToggle(type,item){
|
|
|
|
- let self = this;
|
|
|
|
- if(type == 1){
|
|
|
|
- //新增
|
|
|
|
- this.dialogTitle = '新增';
|
|
|
|
- this.$set(this,'form',{
|
|
|
|
- hardwareNum:"",
|
|
|
|
- subjectId:""
|
|
|
|
- });
|
|
|
|
- this.clearClick();
|
|
|
|
- this.addDialogType = true;
|
|
|
|
- }else if(type == 2){
|
|
|
|
- // 编辑
|
|
|
|
- this.dialogTitle = '编辑';
|
|
|
|
- let obj = {
|
|
|
|
- id:item.id,
|
|
|
|
- subjectId:item.subjectId,
|
|
|
|
- hardwareNum:item.hardwareNum,
|
|
|
|
- };
|
|
|
|
- this.$set(this,'form',obj);
|
|
|
|
- this.clearClick();
|
|
|
|
- this.addDialogType = true;
|
|
|
|
- }else if(type == 3){
|
|
|
|
- // 删除
|
|
|
|
- this.$confirm('确认要删除吗?', "警告", {
|
|
|
|
- confirmButtonText: "确定",
|
|
|
|
- cancelButtonText: "取消",
|
|
|
|
- type: "warning"
|
|
|
|
- }).then(function() {
|
|
|
|
- delHardware(item.id).then(response => {
|
|
|
|
- if (response.code == 200){
|
|
|
|
- self.msgSuccess(response.msg);
|
|
|
|
- self.getList();
|
|
|
|
- }
|
|
|
|
- });
|
|
|
|
- }).then(() => {
|
|
|
|
- }).catch(() => {});
|
|
|
|
|
|
+ this.clearClick();
|
|
|
|
+ this.addDialogType = true;
|
|
|
|
+ }else if(type == 2){
|
|
|
|
+ // 编辑
|
|
|
|
+ this.dialogTitle = '编辑';
|
|
|
|
+ this.$set(this,'form',JSON.parse(JSON.stringify(row)));
|
|
|
|
+ if(row.controlScope){
|
|
|
|
+ this.form.controlScope=row.controlScope.split(',')
|
|
|
|
+ }else{
|
|
|
|
+ this.form.controlScope=[]
|
|
}
|
|
}
|
|
- },
|
|
|
|
- //查询当前院系
|
|
|
|
- filterDept(){
|
|
|
|
- filterDept().then(response => {
|
|
|
|
- let idText = "";
|
|
|
|
- for(let i=0;i<response.data.length;i++){
|
|
|
|
- if(i==0){
|
|
|
|
- idText = idText + response.data[i].deptId;
|
|
|
|
- }else{
|
|
|
|
- idText = idText +','+ response.data[i].deptId;
|
|
|
|
|
|
+ this.clearClick();
|
|
|
|
+ this.addDialogType = true;
|
|
|
|
+ }else if(type == 3){
|
|
|
|
+ // 删除
|
|
|
|
+ this.$confirm('确认要删除吗?', "警告", {
|
|
|
|
+ confirmButtonText: "确定",
|
|
|
|
+ cancelButtonText: "取消",
|
|
|
|
+ type: "warning"
|
|
|
|
+ }).then(function() {
|
|
|
|
+ delHardware(row.id).then(response => {
|
|
|
|
+ if (response.code == 200){
|
|
|
|
+ self.msgSuccess(response.msg);
|
|
|
|
+ self.getList();
|
|
}
|
|
}
|
|
- }
|
|
|
|
- //查询院系下实验室
|
|
|
|
- getSubList(idText).then(response => {
|
|
|
|
- //当前列表
|
|
|
|
- this.selectList = JSON.parse(JSON.stringify(response.data));
|
|
|
|
- //原始列表数据
|
|
|
|
- this.selectListData = JSON.parse(JSON.stringify(response.data));
|
|
|
|
});
|
|
});
|
|
- });
|
|
|
|
- },
|
|
|
|
- /** 实验室-本地懒加载 */
|
|
|
|
- getSelectList(val) {
|
|
|
|
- let self = this;
|
|
|
|
- let list = [];
|
|
|
|
- for(let i=0;i<self.selectListData.length;i++){
|
|
|
|
- if(self.selectListData[i].name.indexOf(val) != -1){
|
|
|
|
- list.push(self.selectListData[i]);
|
|
|
|
|
|
+ }).then(() => {
|
|
|
|
+ }).catch(() => {});
|
|
|
|
+ }
|
|
|
|
+ },
|
|
|
|
+ //查询当前院系
|
|
|
|
+ filterDept(){
|
|
|
|
+ filterDept().then(response => {
|
|
|
|
+ let idText = "";
|
|
|
|
+ for(let i=0;i<response.data.length;i++){
|
|
|
|
+ if(i==0){
|
|
|
|
+ idText = idText + response.data[i].deptId;
|
|
|
|
+ }else{
|
|
|
|
+ idText = idText +','+ response.data[i].deptId;
|
|
}
|
|
}
|
|
}
|
|
}
|
|
- this.selectList = JSON.parse(JSON.stringify(list))
|
|
|
|
- },
|
|
|
|
- //实验室选中清除
|
|
|
|
- clearClick(){
|
|
|
|
- this.selectList = JSON.parse(JSON.stringify(this.selectListData))
|
|
|
|
- },
|
|
|
|
- submitForm(){
|
|
|
|
- this.$refs["form"].validate((valid) => {
|
|
|
|
- if (valid) {
|
|
|
|
- if(this.form.id){
|
|
|
|
- //编辑
|
|
|
|
- this.form.type = "AI_DOORLOCK";
|
|
|
|
|
|
+ //查询院系下实验室
|
|
|
|
+ getSubList(idText).then(response => {
|
|
|
|
+ //当前列表
|
|
|
|
+ this.selectList = JSON.parse(JSON.stringify(response.data));
|
|
|
|
+ //原始列表数据
|
|
|
|
+ this.selectListData = JSON.parse(JSON.stringify(response.data));
|
|
|
|
+ });
|
|
|
|
+ });
|
|
|
|
+ },
|
|
|
|
+ /** 实验室-本地懒加载 */
|
|
|
|
+ getSelectList(val) {
|
|
|
|
+ let self = this;
|
|
|
|
+ let list = [];
|
|
|
|
+ for(let i=0;i<self.selectListData.length;i++){
|
|
|
|
+ if(self.selectListData[i].name.indexOf(val) != -1){
|
|
|
|
+ list.push(self.selectListData[i]);
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ this.selectList = JSON.parse(JSON.stringify(list))
|
|
|
|
+ },
|
|
|
|
+ //实验室选中清除
|
|
|
|
+ clearClick(){
|
|
|
|
+ this.selectList = JSON.parse(JSON.stringify(this.selectListData))
|
|
|
|
+ },
|
|
|
|
+ submitForm(){
|
|
|
|
+ this.$refs["form"].validate((valid) => {
|
|
|
|
+ if (valid) {
|
|
|
|
+ if(this.form.id){
|
|
|
|
+ //编辑
|
|
|
|
+ this.form.type = 11;
|
|
|
|
+ this.form.controlScope=this.form.controlScope.join(','),
|
|
updateHardware(this.form).then(response => {
|
|
updateHardware(this.form).then(response => {
|
|
if (response.code == 200){
|
|
if (response.code == 200){
|
|
this.addDialogType = false;
|
|
this.addDialogType = false;
|
|
@@ -329,228 +356,185 @@
|
|
this.getList();
|
|
this.getList();
|
|
}
|
|
}
|
|
});
|
|
});
|
|
- }else{
|
|
|
|
- //新增
|
|
|
|
- this.form.type = "AI_DOORLOCK";
|
|
|
|
- addHardware(this.form).then(response => {
|
|
|
|
- if (response.code == 200){
|
|
|
|
- this.addDialogType = false;
|
|
|
|
- this.msgSuccess(response.msg);
|
|
|
|
- this.resetQuery();
|
|
|
|
- }
|
|
|
|
- });
|
|
|
|
- }
|
|
|
|
- }
|
|
|
|
- })
|
|
|
|
- },
|
|
|
|
- cancel(){
|
|
|
|
- this.addDialogType = false;
|
|
|
|
- },
|
|
|
|
- //获取数据列表
|
|
|
|
- getList(){
|
|
|
|
- this.queryParamsData = JSON.parse(JSON.stringify(this.queryParams));
|
|
|
|
- this.queryParamsData.type = 'AI_DOORLOCK';
|
|
|
|
- listHardware(this.queryParamsData).then(response => {
|
|
|
|
- this.total = response.total;
|
|
|
|
- this.tableList = response.rows;
|
|
|
|
- });
|
|
|
|
- },
|
|
|
|
- /** 搜索按钮操作 */
|
|
|
|
- handleQuery() {
|
|
|
|
- this.queryParamsData.pageNum = 1;
|
|
|
|
- this.queryParamsData.pageSize = 20;
|
|
|
|
- this.queryParams = JSON.parse(JSON.stringify(this.queryParamsData));
|
|
|
|
- this.getList();
|
|
|
|
- },
|
|
|
|
- /** 重置按钮操作 */
|
|
|
|
- resetQuery() {
|
|
|
|
- this.$set(this,'queryParamsData',{});
|
|
|
|
- this.$set(this,'queryParams',{});
|
|
|
|
- this.handleQuery();
|
|
|
|
- },
|
|
|
|
- //导入页面关闭
|
|
|
|
- importOpenOff(){
|
|
|
|
- this.importOpen = false;
|
|
|
|
- this.getImportData.downFile = false;
|
|
|
|
- this.getImportData.successNum = 0;
|
|
|
|
- this.getImportData.failureNum = 0;
|
|
|
|
- this.getImportData.textName = "";
|
|
|
|
- },
|
|
|
|
- /** 导入按钮操作 */
|
|
|
|
- importButton(item){
|
|
|
|
- if(item.command == 1){
|
|
|
|
- // 下载模板
|
|
|
|
- this.download('/laboratory/hardware/importTemplate', {}, `导入模板.xlsx`)
|
|
|
|
- }else if(item.command == 2){
|
|
|
|
- // 导入数据
|
|
|
|
- console.log('导入数据');
|
|
|
|
- this.importOpen = true;
|
|
|
|
- }
|
|
|
|
- },
|
|
|
|
- /** 下载模板操作 */
|
|
|
|
- importTemplate() {
|
|
|
|
- this.download('/laboratory/hardware/importTemplate', {}, `导入模板.xlsx`)
|
|
|
|
- },
|
|
|
|
- /*下载失败列表*/
|
|
|
|
- failureExcel(){
|
|
|
|
- this.download('/laboratory/hardware/importErrorData', {}, `失败报表.xlsx`)
|
|
|
|
- },
|
|
|
|
- //****************************************导入功能**************************************
|
|
|
|
- handleAvatarSuccess(res, file) {
|
|
|
|
- if(res.code == 200){
|
|
|
|
- if(res.data.downFile){
|
|
|
|
- this.getImportData.downFile = res.data.downFile
|
|
|
|
- this.getImportData.successNum = res.data.successNum
|
|
|
|
- this.getImportData.failureNum = res.data.failureNum
|
|
|
|
}else{
|
|
}else{
|
|
- this.msgSuccess(res.msg);
|
|
|
|
- this.importOpen = false;
|
|
|
|
- this.resetQuery();
|
|
|
|
|
|
+ //新增
|
|
|
|
+ let obj = {
|
|
|
|
+ type:11,
|
|
|
|
+ subjectId:this.form.subjectId,
|
|
|
|
+ hardwareNum:this.form.hardwareNum,
|
|
|
|
+ name:this.form.name,
|
|
|
|
+ ipAddress:this.form.ipAddress,
|
|
|
|
+ port:this.form.port,
|
|
|
|
+ harUser:this.form.harUser,
|
|
|
|
+ harPsw:this.form.harPsw,
|
|
|
|
+ controlScope:this.form.controlScope.join(','),
|
|
|
|
+ }
|
|
|
|
+ addHardware(obj).then(response => {
|
|
|
|
+ if (response.code == 200){
|
|
|
|
+ this.addDialogType = false;
|
|
|
|
+ this.msgSuccess(response.msg);
|
|
|
|
+ this.resetQuery();
|
|
|
|
+ }else if(response.code == 205){
|
|
|
|
+ this.$confirm(response.msg, "警告", {
|
|
|
|
+ confirmButtonText: "确定",
|
|
|
|
+ cancelButtonText: "取消",
|
|
|
|
+ type: "warning"
|
|
|
|
+ }).then(() => {
|
|
|
|
+ // 确定
|
|
|
|
+ this.$router.push({ path: '/comprehensive/laboratoryManagement/accessAuthorization-KDNH' });
|
|
|
|
+ }).catch(function() {
|
|
|
|
+ // 取消
|
|
|
|
+ });
|
|
|
|
+ }
|
|
|
|
+ });
|
|
}
|
|
}
|
|
- // this.getImportData.downFile = res.data.downFile
|
|
|
|
- // this.getImportData.successNum = res.data.successNum
|
|
|
|
- // this.getImportData.failureNum = res.data.failureNum
|
|
|
|
- // this.importOpen = false;
|
|
|
|
- // this.getList();
|
|
|
|
- }else{
|
|
|
|
- this.msgError(res.msg);
|
|
|
|
}
|
|
}
|
|
- this.loading = false;
|
|
|
|
- },
|
|
|
|
- beforeAvatarUpload(file) {
|
|
|
|
- let type = false;
|
|
|
|
- console.log('file',file);
|
|
|
|
- if (file.type == 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet' || file.type == 'application/vnd.ms-excel') {
|
|
|
|
- this.getImportData.textName = file.name;
|
|
|
|
- type = true;
|
|
|
|
- this.loading = true;
|
|
|
|
- }else{
|
|
|
|
- this.msgError('只能上传xls/xlsx格式文件')
|
|
|
|
- type = false;
|
|
|
|
- }
|
|
|
|
- return type;
|
|
|
|
- },
|
|
|
|
|
|
+ })
|
|
},
|
|
},
|
|
- }
|
|
|
|
|
|
+ cancel(){
|
|
|
|
+ this.addDialogType = false;
|
|
|
|
+ },
|
|
|
|
+ //获取数据列表
|
|
|
|
+ getList(){
|
|
|
|
+ this.queryParamsData.type = 'HK_DOOR';
|
|
|
|
+ listHardware(this.queryParamsData).then(response => {
|
|
|
|
+ this.total = response.total;
|
|
|
|
+ this.tableList = response.rows;
|
|
|
|
+ });
|
|
|
|
+ },
|
|
|
|
+ /** 搜索按钮操作 */
|
|
|
|
+ handleQuery() {
|
|
|
|
+ this.queryParamsData.pageNum = 1;
|
|
|
|
+ this.queryParamsData.pageSize = 20;
|
|
|
|
+ this.getList();
|
|
|
|
+ },
|
|
|
|
+ /** 重置按钮操作 */
|
|
|
|
+ resetQuery() {
|
|
|
|
+ this.$set(this,'queryParamsData',{});
|
|
|
|
+ this.handleQuery();
|
|
|
|
+ },
|
|
|
|
+
|
|
|
|
+ },
|
|
|
|
+}
|
|
</script>
|
|
</script>
|
|
|
|
|
|
<style scoped lang="scss">
|
|
<style scoped lang="scss">
|
|
- .SmartAccessControl{
|
|
|
|
- flex:1;
|
|
|
|
- display: flex;
|
|
|
|
- flex-direction: column;
|
|
|
|
- overflow: hidden!important;
|
|
|
|
- padding:20px !important;
|
|
|
|
- p{
|
|
|
|
|
|
+.SmartAccessControl{
|
|
|
|
+ flex:1;
|
|
|
|
+ display: flex;
|
|
|
|
+ flex-direction: column;
|
|
|
|
+ overflow: hidden!important;
|
|
|
|
+ padding:20px !important;
|
|
|
|
+ p{
|
|
|
|
+ margin:0;
|
|
|
|
+ padding:0;
|
|
|
|
+ }
|
|
|
|
+ .form-box{
|
|
|
|
+ .form-dropdown-box{
|
|
|
|
+ display: flex;
|
|
margin:0;
|
|
margin:0;
|
|
- padding:0;
|
|
|
|
- }
|
|
|
|
- .form-box{
|
|
|
|
- .form-dropdown-box{
|
|
|
|
- display: flex;
|
|
|
|
|
|
+ padding:0 10px;
|
|
|
|
+ cursor: pointer;
|
|
|
|
+ height:40px;
|
|
|
|
+ img:nth-child(1){
|
|
|
|
+ width:16px;
|
|
|
|
+ height:16px;
|
|
|
|
+ margin-top:12px;
|
|
|
|
+ }
|
|
|
|
+ p{
|
|
|
|
+ width:47px;
|
|
|
|
+ text-align: center;
|
|
|
|
+ font-size:14px;
|
|
margin:0;
|
|
margin:0;
|
|
- padding:0 10px;
|
|
|
|
- cursor: pointer;
|
|
|
|
- height:40px;
|
|
|
|
- img:nth-child(1){
|
|
|
|
- width:16px;
|
|
|
|
- height:16px;
|
|
|
|
- margin-top:12px;
|
|
|
|
- }
|
|
|
|
- p{
|
|
|
|
- width:47px;
|
|
|
|
- text-align: center;
|
|
|
|
- font-size:14px;
|
|
|
|
- margin:0;
|
|
|
|
- line-height:40px;
|
|
|
|
- }
|
|
|
|
- img:nth-child(3){
|
|
|
|
- width:10px;
|
|
|
|
- height:6px;
|
|
|
|
- margin-top:17px;
|
|
|
|
- }
|
|
|
|
|
|
+ line-height:40px;
|
|
|
|
+ }
|
|
|
|
+ img:nth-child(3){
|
|
|
|
+ width:10px;
|
|
|
|
+ height:6px;
|
|
|
|
+ margin-top:17px;
|
|
}
|
|
}
|
|
}
|
|
}
|
|
- .button-box{
|
|
|
|
- display: flex;
|
|
|
|
- }
|
|
|
|
}
|
|
}
|
|
|
|
+ .button-box{
|
|
|
|
+ display: flex;
|
|
|
|
+ }
|
|
|
|
+}
|
|
</style>
|
|
</style>
|
|
<style lang="scss">
|
|
<style lang="scss">
|
|
- .import-dialog-box{
|
|
|
|
- .import-dialog-upLoad-box{
|
|
|
|
- .el-upload{
|
|
|
|
|
|
+.import-dialog-box{
|
|
|
|
+ .import-dialog-upLoad-box{
|
|
|
|
+ .el-upload{
|
|
|
|
+ width:450px;
|
|
|
|
+ margin:0 55px;
|
|
|
|
+ .el-upload-dragger{
|
|
width:450px;
|
|
width:450px;
|
|
- margin:0 55px;
|
|
|
|
- .el-upload-dragger{
|
|
|
|
- width:450px;
|
|
|
|
- .el-icon-upload{
|
|
|
|
- font-size:100px;
|
|
|
|
- color:#CBE6FE;
|
|
|
|
- }
|
|
|
|
- .el-upload__text{
|
|
|
|
- margin-top:20px;
|
|
|
|
- }
|
|
|
|
|
|
+ .el-icon-upload{
|
|
|
|
+ font-size:100px;
|
|
|
|
+ color:#CBE6FE;
|
|
|
|
+ }
|
|
|
|
+ .el-upload__text{
|
|
|
|
+ margin-top:20px;
|
|
}
|
|
}
|
|
}
|
|
}
|
|
- .el-upload__tip{
|
|
|
|
- margin-left:60px;
|
|
|
|
- font-size:14px;
|
|
|
|
- margin-top:10px;
|
|
|
|
|
|
+ }
|
|
|
|
+ .el-upload__tip{
|
|
|
|
+ margin-left:60px;
|
|
|
|
+ font-size:14px;
|
|
|
|
+ margin-top:10px;
|
|
|
|
+ }
|
|
|
|
+ .el-upload-text-box{
|
|
|
|
+ background: #F5F5F5;
|
|
|
|
+ border-radius: 10px;
|
|
|
|
+ margin:15px 30px 0;
|
|
|
|
+ padding:0 20px 15px;
|
|
|
|
+ overflow: hidden;
|
|
|
|
+ *{
|
|
|
|
+ margin:0;
|
|
}
|
|
}
|
|
- .el-upload-text-box{
|
|
|
|
- background: #F5F5F5;
|
|
|
|
- border-radius: 10px;
|
|
|
|
- margin:15px 30px 0;
|
|
|
|
- padding:0 20px 15px;
|
|
|
|
- overflow: hidden;
|
|
|
|
- *{
|
|
|
|
- margin:0;
|
|
|
|
- }
|
|
|
|
- .img-text-box{
|
|
|
|
- display: flex;
|
|
|
|
- margin-top:15px;
|
|
|
|
- img{
|
|
|
|
- width:16px;
|
|
|
|
- height:16px;
|
|
|
|
- margin-right:13px;
|
|
|
|
- }
|
|
|
|
- p{
|
|
|
|
- height:16px;
|
|
|
|
- line-height:16px;
|
|
|
|
- font-size:12px;
|
|
|
|
- }
|
|
|
|
|
|
+ .img-text-box{
|
|
|
|
+ display: flex;
|
|
|
|
+ margin-top:15px;
|
|
|
|
+ img{
|
|
|
|
+ width:16px;
|
|
|
|
+ height:16px;
|
|
|
|
+ margin-right:13px;
|
|
}
|
|
}
|
|
- .text-p{
|
|
|
|
- margin-top:15px;
|
|
|
|
- margin-left:29px;
|
|
|
|
|
|
+ p{
|
|
height:16px;
|
|
height:16px;
|
|
line-height:16px;
|
|
line-height:16px;
|
|
font-size:12px;
|
|
font-size:12px;
|
|
}
|
|
}
|
|
}
|
|
}
|
|
- }
|
|
|
|
- .teacher-import-dialog-button-box{
|
|
|
|
- display: flex;
|
|
|
|
- width:190px;
|
|
|
|
- margin:0 auto;
|
|
|
|
- p{
|
|
|
|
- width:70px;
|
|
|
|
- height:30px;
|
|
|
|
- line-height:30px;
|
|
|
|
- font-size:14px;
|
|
|
|
- margin:0 auto;
|
|
|
|
|
|
+ .text-p{
|
|
|
|
+ margin-top:15px;
|
|
|
|
+ margin-left:29px;
|
|
|
|
+ height:16px;
|
|
|
|
+ line-height:16px;
|
|
|
|
+ font-size:12px;
|
|
}
|
|
}
|
|
}
|
|
}
|
|
- .teacher-import-dialog-position-box{
|
|
|
|
- width:100%;
|
|
|
|
- height:100%;
|
|
|
|
- position: absolute;
|
|
|
|
- top:0;
|
|
|
|
- left:0;
|
|
|
|
- z-index: 999;
|
|
|
|
- background: rgba(255,255,255,0.4);
|
|
|
|
- border-radius:20px;
|
|
|
|
|
|
+ }
|
|
|
|
+ .teacher-import-dialog-button-box{
|
|
|
|
+ display: flex;
|
|
|
|
+ width:190px;
|
|
|
|
+ margin:0 auto;
|
|
|
|
+ p{
|
|
|
|
+ width:70px;
|
|
|
|
+ height:30px;
|
|
|
|
+ line-height:30px;
|
|
|
|
+ font-size:14px;
|
|
|
|
+ margin:0 auto;
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
+ .teacher-import-dialog-position-box{
|
|
|
|
+ width:100%;
|
|
|
|
+ height:100%;
|
|
|
|
+ position: absolute;
|
|
|
|
+ top:0;
|
|
|
|
+ left:0;
|
|
|
|
+ z-index: 999;
|
|
|
|
+ background: rgba(255,255,255,0.4);
|
|
|
|
+ border-radius:20px;
|
|
|
|
+ }
|
|
|
|
+}
|
|
</style>
|
|
</style>
|