|
@@ -0,0 +1,392 @@
|
|
|
|
+<!-- 人脸库 -->
|
|
|
|
+<template>
|
|
|
|
+ <div class="app-container faceLibrary">
|
|
|
|
+ <div class="page-container faceLibraryPage">
|
|
|
|
+ <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="searchValue">
|
|
|
|
+ <el-input
|
|
|
|
+ maxLength="30"
|
|
|
|
+ v-model="queryParams.searchValue"
|
|
|
|
+ placeholder="请输入"
|
|
|
|
+ style="width: 200px"
|
|
|
|
+ />
|
|
|
|
+ </el-form-item>
|
|
|
|
+ <el-form-item label="" prop="userType">
|
|
|
|
+ <el-select v-model="queryParams.userType" placeholder="请选择类型" style="width: 200px">
|
|
|
|
+ <el-option
|
|
|
|
+ v-for="dict in optionList"
|
|
|
|
+ :key="dict.value"
|
|
|
|
+ :label="dict.label"
|
|
|
|
+ :value="dict.value"
|
|
|
|
+ />
|
|
|
|
+ </el-select>
|
|
|
|
+ </el-form-item>
|
|
|
|
+ <el-form-item label="" prop="deptId">
|
|
|
|
+ <el-select v-model="queryParams.deptId" placeholder="请选择学院" style="width: 200px">
|
|
|
|
+ <el-option
|
|
|
|
+ v-for="dict in deptOptionList"
|
|
|
|
+ :key="dict.deptId"
|
|
|
|
+ :label="dict.deptName"
|
|
|
|
+ :value="dict.deptId"
|
|
|
|
+ />
|
|
|
|
+ </el-select>
|
|
|
|
+ </el-form-item>
|
|
|
|
+ <p class="page-inquire-common-style-button" @click="handleQuery">查询</p>
|
|
|
|
+ <p class="page-reset-common-style-button" @click="resetQuery">重置</p>
|
|
|
|
+ </el-form>
|
|
|
|
+ </div>
|
|
|
|
+ <div class="page-content-box">
|
|
|
|
+ <div class="user-max-big-box scrollbar-box">
|
|
|
|
+ <div class="for-user-max-big-box"
|
|
|
|
+ v-for="(item,index) in dataList">
|
|
|
|
+ <p class="for-user-name-p">{{item.userName}}</p>
|
|
|
|
+ <div class="for-text-box">
|
|
|
|
+ <p>{{item.userType==1?'工号':(item.userType==2?'学号':'')}}:{{item.account}}</p>
|
|
|
|
+ <p v-if="item.userType == 1">{{item.userState?'在职':'离职'}}</p>
|
|
|
|
+ <p v-if="item.userType == 2">{{item.userState?'在读':'离校'}}</p>
|
|
|
|
+ </div>
|
|
|
|
+ <div class="for-user-img-box">
|
|
|
|
+ <img v-if="item.faceImg" :src="item.faceImg">
|
|
|
|
+ <p v-else>未上传</p>
|
|
|
|
+ </div>
|
|
|
|
+ <p class="for-user-time-p">{{parseTime(item.createTime,"{y}-{m}-{d} {h}:{i}")}}</p>
|
|
|
|
+ <div class="for-user-button-box">
|
|
|
|
+ <p @click="tableButton(item,1)">查看</p>
|
|
|
|
+ <p @click="tableButton(item,2)">编辑</p>
|
|
|
|
+ </div>
|
|
|
|
+ </div>
|
|
|
|
+ </div>
|
|
|
|
+ <!--<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="userType" width="200" show-overflow-tooltip>-->
|
|
|
|
+ <!--<template slot-scope="scope">-->
|
|
|
|
+ <!--<span>{{scope.row.userType == 1?'老师':(scope.row.userType == 2?'学生':'')}}</span>-->
|
|
|
|
+ <!--</template>-->
|
|
|
|
+ <!--</el-table-column>-->
|
|
|
|
+ <!--<el-table-column label="人脸照片" prop="faceImg" width="200" show-overflow-tooltip>-->
|
|
|
|
+ <!--<template slot-scope="scope">-->
|
|
|
|
+ <!--<span style="cursor:pointer" :class="scope.row.faceImg?'lockImgSpan':''">{{scope.row.faceImg?'查看':'未上传'}}</span>-->
|
|
|
|
+ <!--</template>-->
|
|
|
|
+ <!--</el-table-column>-->
|
|
|
|
+ <!--<el-table-column label="状态" prop="userState" width="200" show-overflow-tooltip>-->
|
|
|
|
+ <!--<template slot-scope="scope">-->
|
|
|
|
+ <!--<span v-if="scope.row.userType == 1">{{scope.row.userState?'在职':'离职'}}</span>-->
|
|
|
|
+ <!--<span v-if="scope.row.userType == 2">{{scope.row.userState?'在读':'离校'}}</span>-->
|
|
|
|
+ <!--</template>-->
|
|
|
|
+ <!--</el-table-column>-->
|
|
|
|
+ <!--<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="120" 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="tableButton(scope.row)"-->
|
|
|
|
+ <!--v-hasPermiRouter="['system:face:edit']"-->
|
|
|
|
+ <!-->编辑</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>
|
|
|
|
+ <fullScreenView :fullScreenViewProps="fullScreenViewProps" ref="fullScreenView"></fullScreenView>
|
|
|
|
+ <!--上传照片-->
|
|
|
|
+ <el-dialog class="up-img-box" title="上传照片" :visible.sync="upFaceOpen" width="600px" append-to-body :close-on-click-modal="false">
|
|
|
|
+ <div style="height:600px;width:580px;overflow: hidden">
|
|
|
|
+ <el-upload
|
|
|
|
+ ref="faceUpLoad"
|
|
|
|
+ class="position-button"
|
|
|
|
+ :action="uploadImgUrl"
|
|
|
|
+ :data="upImportData"
|
|
|
|
+ :show-file-list="false"
|
|
|
|
+ :auto-upload="false"
|
|
|
|
+ :on-change="faceChange"
|
|
|
|
+ accept="image/jpeg,image/gif,image/png"
|
|
|
|
+ :on-success="(res)=>handleAvatarSuccess(res)"
|
|
|
|
+ :headers="headers"
|
|
|
|
+ :before-upload="beforeAvatarUpload">
|
|
|
|
+ <div v-if="!upFaceUrl" style="width:300px;height:300px;border: 1px dashed #E0E0E0;cursor: pointer;margin:120px 130px 0;">
|
|
|
|
+ <p style="text-align: center;color:#999;font-weight:500;font-size: 20px;line-height:300px;margin:0;">+</p>
|
|
|
|
+ </div>
|
|
|
|
+ <div v-if="upFaceUrl" class="scrollbar-box" style="width:580px;margin:0 auto;max-height:700px;overflow-y: scroll">
|
|
|
|
+ <img :src="upFaceUrl" style="width:540px;border: 1px dashed #E0E0E0;cursor: pointer;margin:0 auto 0;">
|
|
|
|
+ </div>
|
|
|
|
+ </el-upload>
|
|
|
|
+ </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 { getToken } from "@/utils/auth";
|
|
|
|
+ import { getDeptDropList } from "@/api/commonality/permission";
|
|
|
|
+ import { systemUserFaceList,systemUserFaceUpdate } from "@/api/systemManagement/index";
|
|
|
|
+ import fullScreenView from "@/components/fullScreenView/fullScreenView.vue";
|
|
|
|
+ export default {
|
|
|
|
+ name: 'index',
|
|
|
|
+ components: {
|
|
|
|
+ fullScreenView
|
|
|
|
+ },
|
|
|
|
+ data () {
|
|
|
|
+ return {
|
|
|
|
+ uploadImgUrl: window.location.href.split('://')[0]+'://' + process.env.VUE_APP_BASE_API + "/system/user/face/update", // 上传的图片服务器地址
|
|
|
|
+ headers: {
|
|
|
|
+ Authorization: getToken(),
|
|
|
|
+ },
|
|
|
|
+ upImportData:{
|
|
|
|
+ userId:localStorage.getItem('userId'),
|
|
|
|
+ },
|
|
|
|
+ tableButtonType:this.hasPermiDom(['system:face:edit',]),
|
|
|
|
+ //页面遮罩
|
|
|
|
+ loading:false,
|
|
|
|
+ //下拉列表数据
|
|
|
|
+ optionList:[{value:'1',label:'老师'},{value:'2',label:'学生'}],
|
|
|
|
+ deptOptionList:[],
|
|
|
|
+ //查询条件
|
|
|
|
+ queryParams:{
|
|
|
|
+ page:1,
|
|
|
|
+ pageSize:20,
|
|
|
|
+ searchValue:"",
|
|
|
|
+ userType:null,
|
|
|
|
+ },
|
|
|
|
+ //列表数据
|
|
|
|
+ dataList:[
|
|
|
|
+ {userName:'柴云龙',account:'029-8484844',userType:1,userState:true,createTime:'2020-12-31',faceImg:'https://img1.baidu.com/it/u=3317586620,3012704110&fm=253&fmt=auto&app=138&f=JPEG?w=500&h=889'},
|
|
|
|
+ {userName:'韩志伟',account:'029-1111111',userType:2,userState:true,createTime:'2020-12-31',faceImg:'https://img0.baidu.com/it/u=2886746039,2842013621&fm=253&fmt=auto&app=120&f=JPEG?w=500&h=754'},
|
|
|
|
+ {userName:'贺洋洋',account:'029-2222222',userType:1,userState:true,createTime:'2020-12-31',faceImg:''},
|
|
|
|
+ {userName:'徐小飞',account:'029-3333333',userType:2,userState:true,createTime:'2020-12-31',faceImg:''},
|
|
|
|
+ {userName:'柴云龙',account:'029-8484844',userType:1,userState:true,createTime:'2020-12-31',faceImg:'https://img1.baidu.com/it/u=3317586620,3012704110&fm=253&fmt=auto&app=138&f=JPEG?w=500&h=889'},
|
|
|
|
+ {userName:'韩志伟',account:'029-1111111',userType:2,userState:true,createTime:'2020-12-31',faceImg:'https://img0.baidu.com/it/u=2886746039,2842013621&fm=253&fmt=auto&app=120&f=JPEG?w=500&h=754'},
|
|
|
|
+ {userName:'贺洋洋',account:'029-2222222',userType:1,userState:true,createTime:'2020-12-31',faceImg:''},
|
|
|
|
+ {userName:'徐小飞',account:'029-3333333',userType:2,userState:true,createTime:'2020-12-31',faceImg:''},
|
|
|
|
+ {userName:'柴云龙',account:'029-8484844',userType:1,userState:true,createTime:'2020-12-31',faceImg:'https://img1.baidu.com/it/u=3317586620,3012704110&fm=253&fmt=auto&app=138&f=JPEG?w=500&h=889'},
|
|
|
|
+ {userName:'韩志伟',account:'029-1111111',userType:2,userState:true,createTime:'2020-12-31',faceImg:'https://img0.baidu.com/it/u=2886746039,2842013621&fm=253&fmt=auto&app=120&f=JPEG?w=500&h=754'},
|
|
|
|
+ {userName:'贺洋洋',account:'029-2222222',userType:1,userState:true,createTime:'2020-12-31',faceImg:''},
|
|
|
|
+ {userName:'徐小飞',account:'029-3333333',userType:2,userState:true,createTime:'2020-12-31',faceImg:''},
|
|
|
|
+ {userName:'柴云龙',account:'029-8484844',userType:1,userState:true,createTime:'2020-12-31',faceImg:'https://img1.baidu.com/it/u=3317586620,3012704110&fm=253&fmt=auto&app=138&f=JPEG?w=500&h=889'},
|
|
|
|
+ {userName:'韩志伟',account:'029-1111111',userType:2,userState:true,createTime:'2020-12-31',faceImg:'https://img0.baidu.com/it/u=2886746039,2842013621&fm=253&fmt=auto&app=120&f=JPEG?w=500&h=754'},
|
|
|
|
+ {userName:'贺洋洋',account:'029-2222222',userType:1,userState:true,createTime:'2020-12-31',faceImg:''},
|
|
|
|
+ {userName:'徐小飞',account:'029-3333333',userType:2,userState:true,createTime:'2020-12-31',faceImg:''},
|
|
|
|
+ {userName:'柴云龙',account:'029-8484844',userType:1,userState:true,createTime:'2020-12-31',faceImg:'https://img1.baidu.com/it/u=3317586620,3012704110&fm=253&fmt=auto&app=138&f=JPEG?w=500&h=889'},
|
|
|
|
+ {userName:'韩志伟',account:'029-1111111',userType:2,userState:true,createTime:'2020-12-31',faceImg:'https://img0.baidu.com/it/u=2886746039,2842013621&fm=253&fmt=auto&app=120&f=JPEG?w=500&h=754'},
|
|
|
|
+ {userName:'贺洋洋',account:'029-2222222',userType:1,userState:true,createTime:'2020-12-31',faceImg:''},
|
|
|
|
+ {userName:'徐小飞',account:'029-3333333',userType:2,userState:true,createTime:'2020-12-31',faceImg:''},
|
|
|
|
+ ],
|
|
|
|
+ //数据数量
|
|
|
|
+ total:0,
|
|
|
|
+ //组件传参
|
|
|
|
+ propsData:{},
|
|
|
|
+ //图片预览功能
|
|
|
|
+ fullScreenViewProps:[],
|
|
|
|
+ //上传人脸
|
|
|
|
+ upFaceOpen:false,
|
|
|
|
+ upFaceUrl:null,
|
|
|
|
+ upFaceType:false,
|
|
|
|
+ }
|
|
|
|
+ },
|
|
|
|
+ created () {
|
|
|
|
+
|
|
|
|
+ },
|
|
|
|
+ mounted () {
|
|
|
|
+ this.getDeptDropList();
|
|
|
|
+ this.getList();
|
|
|
|
+ },
|
|
|
|
+ methods: {
|
|
|
|
+ //查询按钮
|
|
|
|
+ handleQuery(){
|
|
|
|
+ this.$set(this.queryParams,'page',1);
|
|
|
|
+ this.getList();
|
|
|
|
+ },
|
|
|
|
+ //重置按钮
|
|
|
|
+ resetQuery(){
|
|
|
|
+ this.$set(this,'queryParams',{
|
|
|
|
+ page:1,
|
|
|
|
+ pageSize:20,
|
|
|
|
+ searchValue:"",
|
|
|
|
+ userType :null,
|
|
|
|
+ });
|
|
|
|
+ this.getList();
|
|
|
|
+ },
|
|
|
|
+ //获取数据列表
|
|
|
|
+ getList(){
|
|
|
|
+ this.$set(this,'loading',true);
|
|
|
|
+ let obj = JSON.parse(JSON.stringify(this.queryParams))
|
|
|
|
+ systemUserFaceList(obj).then(response => {
|
|
|
|
+ this.$set(this,'loading',false);
|
|
|
|
+ this.$set(this,'dataList',response.data.records);
|
|
|
|
+ this.$set(this,'total',response.data.total);
|
|
|
|
+ });
|
|
|
|
+ },
|
|
|
|
+ //操作按钮
|
|
|
|
+ tableButton(row,type){
|
|
|
|
+ let self = this;
|
|
|
|
+ if(row.faceImg && type == 1){
|
|
|
|
+ this.$set(this,'fullScreenViewProps',[row.faceImg]);
|
|
|
|
+ this.$refs['fullScreenView'].initialize();
|
|
|
|
+ }else{
|
|
|
|
+ this.$set(this,'upFaceUrl',row.faceImg?row.faceImg:'')
|
|
|
|
+ this.$set(this,'upFaceType',false)
|
|
|
|
+ this.$set(this,'upFaceOpen',true);
|
|
|
|
+ }
|
|
|
|
+ },
|
|
|
|
+ //关闭
|
|
|
|
+ dialogOff(){
|
|
|
|
+ this.$set(this,'upFaceOpen',false);
|
|
|
|
+ },
|
|
|
|
+ //提交
|
|
|
|
+ dialogSubmit(){
|
|
|
|
+ if(!this.upFaceType){
|
|
|
|
+ this.msgError('请上传新的人脸照片')
|
|
|
|
+ return
|
|
|
|
+ }
|
|
|
|
+ this.$refs.faceUpLoad.submit();
|
|
|
|
+ },
|
|
|
|
+ //上传
|
|
|
|
+ handleAvatarSuccess(res, type) {
|
|
|
|
+ if(res.code == 200){
|
|
|
|
+ this.$set(this,'upFaceOpen',false);
|
|
|
|
+ this.$set(this,'upFaceUrl',null);
|
|
|
|
+ this.$set(this,'upFaceType',false);
|
|
|
|
+ this.msgSuccess(res.message)
|
|
|
|
+ this.getList();
|
|
|
|
+ this.$forceUpdate()
|
|
|
|
+ }else{
|
|
|
|
+ this.msgError(res.message)
|
|
|
|
+ }
|
|
|
|
+ },
|
|
|
|
+ beforeAvatarUpload(file) {
|
|
|
|
+ let type = false;
|
|
|
|
+ if (file.type == 'image/png' || file.type == 'image/jpeg' || file.type == 'image/gif') {
|
|
|
|
+ type = true;
|
|
|
|
+ }else{
|
|
|
|
+ this.$message.error('只能上传png/jpeg/gif格式图片');
|
|
|
|
+ type = false;
|
|
|
|
+ }
|
|
|
|
+ return type;
|
|
|
|
+ },
|
|
|
|
+ //照片选择
|
|
|
|
+ faceChange(val){
|
|
|
|
+ const windowURL = window.URL || window.webkitURL;
|
|
|
|
+ this.upFaceUrl = windowURL.createObjectURL(val.raw)
|
|
|
|
+ this.$set(this,'upFaceType',true)
|
|
|
|
+ },
|
|
|
|
+ /** 查询学院列表 */
|
|
|
|
+ getDeptDropList() {
|
|
|
|
+ getDeptDropList({deptName:"",level:2,deptType:1}).then(response => {
|
|
|
|
+ this.$set(this, 'deptOptionList', response.data)
|
|
|
|
+ });
|
|
|
|
+ },
|
|
|
|
+ },
|
|
|
|
+ }
|
|
|
|
+</script>
|
|
|
|
+<style scoped lang="scss">
|
|
|
|
+ .page-content-box{
|
|
|
|
+ padding:20px 0;
|
|
|
|
+ }
|
|
|
|
+ .faceLibrary{
|
|
|
|
+ .faceLibraryPage{
|
|
|
|
+ .user-max-big-box{
|
|
|
|
+ flex:1;
|
|
|
|
+ .for-user-max-big-box{
|
|
|
|
+ display: inline-block;
|
|
|
|
+ overflow: hidden;
|
|
|
|
+ border:1px solid #0183FA;
|
|
|
|
+ border-radius:6px;
|
|
|
|
+ margin:0 0 20px 20px;
|
|
|
|
+ .for-user-name-p{
|
|
|
|
+ background-color: #0183FA;
|
|
|
|
+ color:#fff;
|
|
|
|
+ padding:10px 20px 0;
|
|
|
|
+ line-height:20px;
|
|
|
|
+ font-size:16px;
|
|
|
|
+ text-align: center;
|
|
|
|
+ }
|
|
|
|
+ .for-text-box{
|
|
|
|
+ background-color: #0183FA;
|
|
|
|
+ display: flex;
|
|
|
|
+ margin-bottom:20px;
|
|
|
|
+ padding:6px 0 10px 0;
|
|
|
|
+ p{
|
|
|
|
+ padding:0 20px;
|
|
|
|
+ line-height:20px;
|
|
|
|
+ font-size:14px;
|
|
|
|
+ color:#fff;
|
|
|
|
+ }
|
|
|
|
+ p:nth-child(1){
|
|
|
|
+ flex:1;
|
|
|
|
+ }
|
|
|
|
+ p:nth-child(2){
|
|
|
|
+ text-align: right;
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ .for-user-time-p{
|
|
|
|
+ color:#777;
|
|
|
|
+ padding:0 20px;
|
|
|
|
+ line-height:25px;
|
|
|
|
+ font-size:14px;
|
|
|
|
+ text-align: center;
|
|
|
|
+ /*margin-bottom:4px;*/
|
|
|
|
+ }
|
|
|
|
+ .for-user-img-box{
|
|
|
|
+ margin:0 20px;
|
|
|
|
+ p{
|
|
|
|
+ width:250px;
|
|
|
|
+ line-height:300px;
|
|
|
|
+ text-align: center;
|
|
|
|
+ /*border:1px solid #dedede;*/
|
|
|
|
+ border-radius:4px;
|
|
|
|
+ color:#999;
|
|
|
|
+ }
|
|
|
|
+ img{
|
|
|
|
+ display: block;
|
|
|
|
+ width:250px;
|
|
|
|
+ height:300px;
|
|
|
|
+ /*border:1px solid #dedede;*/
|
|
|
|
+ border-radius:4px;
|
|
|
|
+ overflow: hidden;
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ .for-user-button-box{
|
|
|
|
+ display: flex;
|
|
|
|
+ border-top:1px solid #0183FA;
|
|
|
|
+ p{
|
|
|
|
+ flex:1;
|
|
|
|
+ text-align: center;
|
|
|
|
+ line-height:30px;
|
|
|
|
+ font-size:14px;
|
|
|
|
+ cursor: pointer;
|
|
|
|
+ color: #0183FA;
|
|
|
|
+ }
|
|
|
|
+ p:hover{
|
|
|
|
+ background: #0183FA;
|
|
|
|
+ color: #fff;
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ .lockImgSpan{
|
|
|
|
+ color:#0183FA;
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+</style>
|