优化所有弹窗、导出和提交等待的用户体验
修复第二页只有一条数据如果删除页面显示无数据,分页那里显示选中的第一页的bug 修复分页页数成小数的bug 优化所有添加删除dialog点击model不会关闭
This commit is contained in:
parent
1c2134bf27
commit
9005eb74ab
File diff suppressed because it is too large
Load Diff
|
|
@ -334,8 +334,8 @@ export default {
|
||||||
getList() {
|
getList() {
|
||||||
this.loading = true;
|
this.loading = true;
|
||||||
listJob(this.queryParams).then(response => {
|
listJob(this.queryParams).then(response => {
|
||||||
let currentPageNum = response.total / this.queryParams.pageSize;
|
let currentPageNum = response.total % this.queryParams.pageSize > 0 ? parseInt(response.total / this.queryParams.pageSize) + 1 : (response.total / this.queryParams.pageSize);
|
||||||
if(this.queryParams.pageNum > currentPageNum){
|
if(currentPageNum !== 0 && currentPageNum !== 0 && this.queryParams.pageNum > currentPageNum){
|
||||||
this.queryParams.pageNum = currentPageNum;
|
this.queryParams.pageNum = currentPageNum;
|
||||||
}
|
}
|
||||||
this.jobList = response.rows;
|
this.jobList = response.rows;
|
||||||
|
|
|
||||||
|
|
@ -219,8 +219,8 @@ export default {
|
||||||
getList() {
|
getList() {
|
||||||
this.loading = true;
|
this.loading = true;
|
||||||
listJobLog(this.addDateRange(this.queryParams, this.dateRange)).then(response => {
|
listJobLog(this.addDateRange(this.queryParams, this.dateRange)).then(response => {
|
||||||
let currentPageNum = response.total / this.queryParams.pageSize;
|
let currentPageNum = response.total % this.queryParams.pageSize > 0 ? parseInt(response.total / this.queryParams.pageSize) + 1 : (response.total / this.queryParams.pageSize);
|
||||||
if(this.queryParams.pageNum > currentPageNum){
|
if(currentPageNum !== 0 && currentPageNum !== 0 && this.queryParams.pageNum > currentPageNum){
|
||||||
this.queryParams.pageNum = currentPageNum;
|
this.queryParams.pageNum = currentPageNum;
|
||||||
}
|
}
|
||||||
this.jobLogList = response.rows;
|
this.jobLogList = response.rows;
|
||||||
|
|
|
||||||
|
|
@ -90,8 +90,8 @@ export default {
|
||||||
getList() {
|
getList() {
|
||||||
this.loading = true;
|
this.loading = true;
|
||||||
list(this.queryParams).then(response => {
|
list(this.queryParams).then(response => {
|
||||||
let currentPageNum = response.total / this.queryParams.pageSize;
|
let currentPageNum = response.total % this.queryParams.pageSize > 0 ? parseInt(response.total / this.queryParams.pageSize) + 1 : (response.total / this.queryParams.pageSize);
|
||||||
if(this.queryParams.pageNum > currentPageNum){
|
if(currentPageNum !== 0 && currentPageNum !== 0 && this.queryParams.pageNum > currentPageNum){
|
||||||
this.queryParams.pageNum = currentPageNum;
|
this.queryParams.pageNum = currentPageNum;
|
||||||
}
|
}
|
||||||
this.list = response.rows;
|
this.list = response.rows;
|
||||||
|
|
|
||||||
|
|
@ -149,7 +149,7 @@
|
||||||
/>
|
/>
|
||||||
|
|
||||||
<!-- 添加或修改参数配置对话框 -->
|
<!-- 添加或修改参数配置对话框 -->
|
||||||
<el-dialog :title="title" :visible.sync="open" width="500px" append-to-body>
|
<el-dialog :title="title" :close-on-click-modal="false" :visible.sync="open" width="500px" append-to-body>
|
||||||
<el-form ref="form" v-loading="dialogLoading" :model="form" :rules="rules" label-width="80px">
|
<el-form ref="form" v-loading="dialogLoading" :model="form" :rules="rules" label-width="80px">
|
||||||
<el-form-item label="参数名称" prop="configName">
|
<el-form-item label="参数名称" prop="configName">
|
||||||
<el-input v-model="form.configName" placeholder="请输入参数名称" />
|
<el-input v-model="form.configName" placeholder="请输入参数名称" />
|
||||||
|
|
@ -254,8 +254,8 @@ export default {
|
||||||
getList() {
|
getList() {
|
||||||
this.loading = true;
|
this.loading = true;
|
||||||
listConfig(this.addDateRange(this.queryParams, this.dateRange)).then(response => {
|
listConfig(this.addDateRange(this.queryParams, this.dateRange)).then(response => {
|
||||||
let currentPageNum = response.total / this.queryParams.pageSize;
|
let currentPageNum = response.total % this.queryParams.pageSize > 0 ? parseInt(response.total / this.queryParams.pageSize) + 1 : (response.total / this.queryParams.pageSize);
|
||||||
if(this.queryParams.pageNum > currentPageNum){
|
if(currentPageNum !== 0 && currentPageNum !== 0 && this.queryParams.pageNum > currentPageNum){
|
||||||
this.queryParams.pageNum = currentPageNum;
|
this.queryParams.pageNum = currentPageNum;
|
||||||
}
|
}
|
||||||
this.configList = response.rows;
|
this.configList = response.rows;
|
||||||
|
|
|
||||||
|
|
@ -84,7 +84,7 @@
|
||||||
</el-table>
|
</el-table>
|
||||||
|
|
||||||
<!-- 添加或修改部门对话框 -->
|
<!-- 添加或修改部门对话框 -->
|
||||||
<el-dialog :title="title" :visible.sync="open" width="600px" append-to-body>
|
<el-dialog :title="title" :close-on-click-modal="false" :visible.sync="open" width="600px" append-to-body>
|
||||||
<el-form ref="form" v-loading="dialogLoading" :model="form" :rules="rules" label-width="80px">
|
<el-form ref="form" v-loading="dialogLoading" :model="form" :rules="rules" label-width="80px">
|
||||||
<el-row>
|
<el-row>
|
||||||
<el-col :span="24" v-if="form.parentId !== 0">
|
<el-col :span="24" v-if="form.parentId !== 0">
|
||||||
|
|
|
||||||
|
|
@ -133,7 +133,7 @@
|
||||||
/>
|
/>
|
||||||
|
|
||||||
<!-- 添加或修改参数配置对话框 -->
|
<!-- 添加或修改参数配置对话框 -->
|
||||||
<el-dialog :title="title" :visible.sync="open" width="500px" append-to-body>
|
<el-dialog :title="title" :close-on-click-modal="false" :visible.sync="open" width="500px" append-to-body>
|
||||||
<el-form ref="form" :model="form" :rules="rules" label-width="80px">
|
<el-form ref="form" :model="form" :rules="rules" label-width="80px">
|
||||||
<el-form-item label="字典类型">
|
<el-form-item label="字典类型">
|
||||||
<el-input v-model="form.dictType" :disabled="true" />
|
<el-input v-model="form.dictType" :disabled="true" />
|
||||||
|
|
@ -291,8 +291,8 @@ export default {
|
||||||
getList() {
|
getList() {
|
||||||
this.loading = true;
|
this.loading = true;
|
||||||
listData(this.queryParams).then(response => {
|
listData(this.queryParams).then(response => {
|
||||||
let currentPageNum = response.total / this.queryParams.pageSize;
|
let currentPageNum = response.total % this.queryParams.pageSize > 0 ? parseInt(response.total / this.queryParams.pageSize) + 1 : (response.total / this.queryParams.pageSize);
|
||||||
if(this.queryParams.pageNum > currentPageNum){
|
if(currentPageNum !== 0 && currentPageNum !== 0 && this.queryParams.pageNum > currentPageNum){
|
||||||
this.queryParams.pageNum = currentPageNum;
|
this.queryParams.pageNum = currentPageNum;
|
||||||
}
|
}
|
||||||
this.dataList = response.rows;
|
this.dataList = response.rows;
|
||||||
|
|
|
||||||
|
|
@ -164,7 +164,7 @@
|
||||||
/>
|
/>
|
||||||
|
|
||||||
<!-- 添加或修改参数配置对话框 -->
|
<!-- 添加或修改参数配置对话框 -->
|
||||||
<el-dialog :title="title" :visible.sync="open" width="500px" append-to-body>
|
<el-dialog :title="title" :close-on-click-modal="false" :visible.sync="open" width="500px" append-to-body>
|
||||||
<el-form ref="form" v-loading="dialogLoading" :model="form" :rules="rules" label-width="80px">
|
<el-form ref="form" v-loading="dialogLoading" :model="form" :rules="rules" label-width="80px">
|
||||||
<el-form-item label="字典名称" prop="dictName">
|
<el-form-item label="字典名称" prop="dictName">
|
||||||
<el-input v-model="form.dictName" placeholder="请输入字典名称" />
|
<el-input v-model="form.dictName" placeholder="请输入字典名称" />
|
||||||
|
|
@ -263,8 +263,8 @@ export default {
|
||||||
getList() {
|
getList() {
|
||||||
this.loading = true;
|
this.loading = true;
|
||||||
listType(this.addDateRange(this.queryParams, this.dateRange)).then(response => {
|
listType(this.addDateRange(this.queryParams, this.dateRange)).then(response => {
|
||||||
let currentPageNum = response.total / this.queryParams.pageSize;
|
let currentPageNum = response.total % this.queryParams.pageSize > 0 ? parseInt(response.total / this.queryParams.pageSize) + 1 : (response.total / this.queryParams.pageSize);
|
||||||
if(this.queryParams.pageNum > currentPageNum){
|
if(currentPageNum !== 0 && currentPageNum !== 0 && this.queryParams.pageNum > currentPageNum){
|
||||||
this.queryParams.pageNum = currentPageNum;
|
this.queryParams.pageNum = currentPageNum;
|
||||||
}
|
}
|
||||||
this.typeList = response.rows;
|
this.typeList = response.rows;
|
||||||
|
|
|
||||||
|
|
@ -160,8 +160,8 @@ export default {
|
||||||
getList() {
|
getList() {
|
||||||
this.loading = true;
|
this.loading = true;
|
||||||
list(this.addDateRange(this.queryParams, this.dateRange)).then(response => {
|
list(this.addDateRange(this.queryParams, this.dateRange)).then(response => {
|
||||||
let currentPageNum = response.total / this.queryParams.pageSize;
|
let currentPageNum = response.total % this.queryParams.pageSize > 0 ? parseInt(response.total / this.queryParams.pageSize) + 1 : (response.total / this.queryParams.pageSize);
|
||||||
if(this.queryParams.pageNum > currentPageNum){
|
if(currentPageNum !== 0 && currentPageNum !== 0 && this.queryParams.pageNum > currentPageNum){
|
||||||
this.queryParams.pageNum = currentPageNum;
|
this.queryParams.pageNum = currentPageNum;
|
||||||
}
|
}
|
||||||
this.list = response.rows;
|
this.list = response.rows;
|
||||||
|
|
|
||||||
|
|
@ -88,7 +88,7 @@
|
||||||
</el-table>
|
</el-table>
|
||||||
|
|
||||||
<!-- 添加或修改菜单对话框 -->
|
<!-- 添加或修改菜单对话框 -->
|
||||||
<el-dialog :title="title" :visible.sync="open" width="600px" append-to-body>
|
<el-dialog :title="title" :close-on-click-modal="false" :visible.sync="open" width="600px" append-to-body>
|
||||||
<el-form ref="form" v-loading="dialogLoading" :model="form" :rules="rules" label-width="80px">
|
<el-form ref="form" v-loading="dialogLoading" :model="form" :rules="rules" label-width="80px">
|
||||||
<el-row>
|
<el-row>
|
||||||
<el-col :span="24">
|
<el-col :span="24">
|
||||||
|
|
|
||||||
|
|
@ -129,7 +129,7 @@
|
||||||
/>
|
/>
|
||||||
|
|
||||||
<!-- 添加或修改公告对话框 -->
|
<!-- 添加或修改公告对话框 -->
|
||||||
<el-dialog :title="title" :visible.sync="open" width="780px" append-to-body>
|
<el-dialog :title="title" :close-on-click-modal="false" :visible.sync="open" width="780px" append-to-body>
|
||||||
<el-form ref="form" v-loading="dialogLoading" :model="form" :rules="rules" label-width="80px">
|
<el-form ref="form" v-loading="dialogLoading" :model="form" :rules="rules" label-width="80px">
|
||||||
<el-row>
|
<el-row>
|
||||||
<el-col :span="12">
|
<el-col :span="12">
|
||||||
|
|
@ -248,8 +248,8 @@ export default {
|
||||||
getList() {
|
getList() {
|
||||||
this.loading = true;
|
this.loading = true;
|
||||||
listNotice(this.queryParams).then(response => {
|
listNotice(this.queryParams).then(response => {
|
||||||
let currentPageNum = response.total / this.queryParams.pageSize;
|
let currentPageNum = response.total % this.queryParams.pageSize > 0 ? parseInt(response.total / this.queryParams.pageSize) + 1 : (response.total / this.queryParams.pageSize);
|
||||||
if(this.queryParams.pageNum > currentPageNum){
|
if(currentPageNum !== 0 && currentPageNum !== 0 && this.queryParams.pageNum > currentPageNum){
|
||||||
this.queryParams.pageNum = currentPageNum;
|
this.queryParams.pageNum = currentPageNum;
|
||||||
}
|
}
|
||||||
this.noticeList = response.rows;
|
this.noticeList = response.rows;
|
||||||
|
|
|
||||||
|
|
@ -241,8 +241,8 @@ export default {
|
||||||
getList() {
|
getList() {
|
||||||
this.loading = true;
|
this.loading = true;
|
||||||
list(this.addDateRange(this.queryParams, this.dateRange)).then( response => {
|
list(this.addDateRange(this.queryParams, this.dateRange)).then( response => {
|
||||||
let currentPageNum = response.total / this.queryParams.pageSize;
|
let currentPageNum = response.total % this.queryParams.pageSize > 0 ? parseInt(response.total / this.queryParams.pageSize) + 1 : (response.total / this.queryParams.pageSize);
|
||||||
if(this.queryParams.pageNum > currentPageNum){
|
if(currentPageNum !== 0 && currentPageNum !== 0 && this.queryParams.pageNum > currentPageNum){
|
||||||
this.queryParams.pageNum = currentPageNum;
|
this.queryParams.pageNum = currentPageNum;
|
||||||
}
|
}
|
||||||
this.list = response.rows;
|
this.list = response.rows;
|
||||||
|
|
|
||||||
|
|
@ -123,7 +123,7 @@
|
||||||
/>
|
/>
|
||||||
|
|
||||||
<!-- 添加或修改岗位对话框 -->
|
<!-- 添加或修改岗位对话框 -->
|
||||||
<el-dialog :title="title" :visible.sync="open" width="500px" append-to-body>
|
<el-dialog :title="title" :close-on-click-modal="false" :visible.sync="open" width="500px" append-to-body>
|
||||||
<el-form ref="form" v-loading="dialogLoading" :model="form" :rules="rules" label-width="80px">
|
<el-form ref="form" v-loading="dialogLoading" :model="form" :rules="rules" label-width="80px">
|
||||||
<el-form-item label="岗位名称" prop="postName">
|
<el-form-item label="岗位名称" prop="postName">
|
||||||
<el-input v-model="form.postName" placeholder="请输入岗位名称" />
|
<el-input v-model="form.postName" placeholder="请输入岗位名称" />
|
||||||
|
|
@ -224,8 +224,8 @@ export default {
|
||||||
getList() {
|
getList() {
|
||||||
this.loading = true;
|
this.loading = true;
|
||||||
listPost(this.queryParams).then(response => {
|
listPost(this.queryParams).then(response => {
|
||||||
let currentPageNum = response.total / this.queryParams.pageSize;
|
let currentPageNum = response.total % this.queryParams.pageSize > 0 ? parseInt(response.total / this.queryParams.pageSize) + 1 : (response.total / this.queryParams.pageSize);
|
||||||
if(this.queryParams.pageNum > currentPageNum){
|
if(currentPageNum !== 0 && currentPageNum !== 0 && this.queryParams.pageNum > currentPageNum){
|
||||||
this.queryParams.pageNum = currentPageNum;
|
this.queryParams.pageNum = currentPageNum;
|
||||||
}
|
}
|
||||||
this.postList = response.rows;
|
this.postList = response.rows;
|
||||||
|
|
|
||||||
|
|
@ -149,8 +149,8 @@ export default {
|
||||||
getList() {
|
getList() {
|
||||||
this.loading = true;
|
this.loading = true;
|
||||||
allocatedUserList(this.queryParams).then(response => {
|
allocatedUserList(this.queryParams).then(response => {
|
||||||
let currentPageNum = response.total / this.queryParams.pageSize;
|
let currentPageNum = response.total % this.queryParams.pageSize > 0 ? parseInt(response.total / this.queryParams.pageSize) + 1 : (response.total / this.queryParams.pageSize);
|
||||||
if(this.queryParams.pageNum > currentPageNum){
|
if(currentPageNum !== 0 && currentPageNum !== 0 && this.queryParams.pageNum > currentPageNum){
|
||||||
this.queryParams.pageNum = currentPageNum;
|
this.queryParams.pageNum = currentPageNum;
|
||||||
}
|
}
|
||||||
this.userList = response.rows;
|
this.userList = response.rows;
|
||||||
|
|
|
||||||
|
|
@ -163,7 +163,7 @@
|
||||||
/>
|
/>
|
||||||
|
|
||||||
<!-- 添加或修改角色配置对话框 -->
|
<!-- 添加或修改角色配置对话框 -->
|
||||||
<el-dialog :title="title" :visible.sync="open" width="500px" append-to-body>
|
<el-dialog :title="title" :close-on-click-modal="false" :visible.sync="open" width="500px" append-to-body>
|
||||||
<el-form ref="form" v-loading="dialogLoading" :model="form" :rules="rules" label-width="80px">
|
<el-form ref="form" v-loading="dialogLoading" :model="form" :rules="rules" label-width="80px">
|
||||||
<el-form-item label="角色名称" prop="roleName">
|
<el-form-item label="角色名称" prop="roleName">
|
||||||
<el-input v-model="form.roleName" placeholder="请输入角色名称" />
|
<el-input v-model="form.roleName" placeholder="请输入角色名称" />
|
||||||
|
|
@ -209,7 +209,7 @@
|
||||||
</el-dialog>
|
</el-dialog>
|
||||||
|
|
||||||
<!-- 分配角色数据权限对话框 -->
|
<!-- 分配角色数据权限对话框 -->
|
||||||
<el-dialog :title="title" :visible.sync="openDataScope" width="500px" append-to-body>
|
<el-dialog :title="title" :close-on-click-modal="false" :visible.sync="openDataScope" width="500px" append-to-body>
|
||||||
<el-form v-loading="dialogLoading" :model="form" label-width="80px">
|
<el-form v-loading="dialogLoading" :model="form" label-width="80px">
|
||||||
<el-form-item label="角色名称">
|
<el-form-item label="角色名称">
|
||||||
<el-input v-model="form.roleName" :disabled="true" />
|
<el-input v-model="form.roleName" :disabled="true" />
|
||||||
|
|
|
||||||
|
|
@ -1,6 +1,6 @@
|
||||||
<template>
|
<template>
|
||||||
<!-- 授权用户 -->
|
<!-- 授权用户 -->
|
||||||
<el-dialog title="选择用户" :visible.sync="visible" width="800px" top="5vh" append-to-body>
|
<el-dialog title="选择用户" :close-on-click-modal="false" :close-on-click-modal="false" :visible.sync="visible" width="800px" top="5vh" append-to-body>
|
||||||
<el-form :model="queryParams" v-loading="dialogLoading" ref="queryForm" :inline="true">
|
<el-form :model="queryParams" v-loading="dialogLoading" ref="queryForm" :inline="true">
|
||||||
<el-form-item label="用户名称" prop="userName">
|
<el-form-item label="用户名称" prop="userName">
|
||||||
<el-input
|
<el-input
|
||||||
|
|
@ -115,8 +115,8 @@ export default {
|
||||||
// 查询表数据
|
// 查询表数据
|
||||||
getList() {
|
getList() {
|
||||||
unallocatedUserList(this.queryParams).then(res => {
|
unallocatedUserList(this.queryParams).then(res => {
|
||||||
let currentPageNum = response.total / this.queryParams.pageSize;
|
let currentPageNum = response.total % this.queryParams.pageSize > 0 ? parseInt(response.total / this.queryParams.pageSize) + 1 : (response.total / this.queryParams.pageSize);
|
||||||
if(this.queryParams.pageNum > currentPageNum){
|
if(currentPageNum !== 0 && currentPageNum !== 0 && this.queryParams.pageNum > currentPageNum){
|
||||||
this.queryParams.pageNum = currentPageNum;
|
this.queryParams.pageNum = currentPageNum;
|
||||||
}
|
}
|
||||||
this.userList = res.rows;
|
this.userList = res.rows;
|
||||||
|
|
|
||||||
|
|
@ -208,7 +208,7 @@
|
||||||
</el-row>
|
</el-row>
|
||||||
|
|
||||||
<!-- 添加或修改参数配置对话框 -->
|
<!-- 添加或修改参数配置对话框 -->
|
||||||
<el-dialog :title="title" :visible.sync="open" width="600px" append-to-body>
|
<el-dialog :title="title" :close-on-click-modal="false" :visible.sync="open" width="600px" append-to-body>
|
||||||
<el-form ref="form" v-loading="dialogLoading" :model="form" :rules="rules" label-width="80px">
|
<el-form ref="form" v-loading="dialogLoading" :model="form" :rules="rules" label-width="80px">
|
||||||
<el-row>
|
<el-row>
|
||||||
<el-col :span="12">
|
<el-col :span="12">
|
||||||
|
|
@ -495,8 +495,8 @@ export default {
|
||||||
getList() {
|
getList() {
|
||||||
this.loading = true;
|
this.loading = true;
|
||||||
listUser(this.addDateRange(this.queryParams, this.dateRange)).then(response => {
|
listUser(this.addDateRange(this.queryParams, this.dateRange)).then(response => {
|
||||||
let currentPageNum = response.total / this.queryParams.pageSize;
|
let currentPageNum = response.total % this.queryParams.pageSize > 0 ? parseInt(response.total / this.queryParams.pageSize) + 1 : (response.total / this.queryParams.pageSize);
|
||||||
if(this.queryParams.pageNum > currentPageNum){
|
if(currentPageNum !== 0 && currentPageNum !== 0 && this.queryParams.pageNum > currentPageNum){
|
||||||
this.queryParams.pageNum = currentPageNum;
|
this.queryParams.pageNum = currentPageNum;
|
||||||
}
|
}
|
||||||
this.userList = response.rows;
|
this.userList = response.rows;
|
||||||
|
|
|
||||||
|
|
@ -1,172 +1,172 @@
|
||||||
<template>
|
<template>
|
||||||
<div>
|
<div>
|
||||||
<div class="user-info-head" @click="editCropper()"><img v-bind:src="options.img" title="点击上传头像" class="img-circle img-lg" /></div>
|
<div class="user-info-head" @click="editCropper()"><img v-bind:src="options.img" title="点击上传头像" class="img-circle img-lg" /></div>
|
||||||
<el-dialog :title="title" :visible.sync="open" width="800px" append-to-body @opened="modalOpened" @close="closeDialog()">
|
<el-dialog :title="title" :close-on-click-modal="false" :visible.sync="open" width="800px" append-to-body @opened="modalOpened" @close="closeDialog()">
|
||||||
<el-row>
|
<el-row>
|
||||||
<el-col :xs="24" :md="12" :style="{height: '350px'}">
|
<el-col :xs="24" :md="12" :style="{height: '350px'}">
|
||||||
<vue-cropper
|
<vue-cropper
|
||||||
ref="cropper"
|
ref="cropper"
|
||||||
:img="options.img"
|
:img="options.img"
|
||||||
:info="true"
|
:info="true"
|
||||||
:autoCrop="options.autoCrop"
|
:autoCrop="options.autoCrop"
|
||||||
:autoCropWidth="options.autoCropWidth"
|
:autoCropWidth="options.autoCropWidth"
|
||||||
:autoCropHeight="options.autoCropHeight"
|
:autoCropHeight="options.autoCropHeight"
|
||||||
:fixedBox="options.fixedBox"
|
:fixedBox="options.fixedBox"
|
||||||
@realTime="realTime"
|
@realTime="realTime"
|
||||||
v-if="visible"
|
v-if="visible"
|
||||||
/>
|
/>
|
||||||
</el-col>
|
</el-col>
|
||||||
<el-col :xs="24" :md="12" :style="{height: '350px'}">
|
<el-col :xs="24" :md="12" :style="{height: '350px'}">
|
||||||
<div class="avatar-upload-preview">
|
<div class="avatar-upload-preview">
|
||||||
<img :src="previews.url" :style="previews.img" />
|
<img :src="previews.url" :style="previews.img" />
|
||||||
</div>
|
</div>
|
||||||
</el-col>
|
</el-col>
|
||||||
</el-row>
|
</el-row>
|
||||||
<br />
|
<br />
|
||||||
<el-row>
|
<el-row>
|
||||||
<el-col :lg="2" :md="2">
|
<el-col :lg="2" :md="2">
|
||||||
<el-upload action="#" :http-request="requestUpload" :show-file-list="false" :before-upload="beforeUpload">
|
<el-upload action="#" :http-request="requestUpload" :show-file-list="false" :before-upload="beforeUpload">
|
||||||
<el-button size="small">
|
<el-button size="small">
|
||||||
选择
|
选择
|
||||||
<i class="el-icon-upload el-icon--right"></i>
|
<i class="el-icon-upload el-icon--right"></i>
|
||||||
</el-button>
|
</el-button>
|
||||||
</el-upload>
|
</el-upload>
|
||||||
</el-col>
|
</el-col>
|
||||||
<el-col :lg="{span: 1, offset: 2}" :md="2">
|
<el-col :lg="{span: 1, offset: 2}" :md="2">
|
||||||
<el-button icon="el-icon-plus" size="small" @click="changeScale(1)"></el-button>
|
<el-button icon="el-icon-plus" size="small" @click="changeScale(1)"></el-button>
|
||||||
</el-col>
|
</el-col>
|
||||||
<el-col :lg="{span: 1, offset: 1}" :md="2">
|
<el-col :lg="{span: 1, offset: 1}" :md="2">
|
||||||
<el-button icon="el-icon-minus" size="small" @click="changeScale(-1)"></el-button>
|
<el-button icon="el-icon-minus" size="small" @click="changeScale(-1)"></el-button>
|
||||||
</el-col>
|
</el-col>
|
||||||
<el-col :lg="{span: 1, offset: 1}" :md="2">
|
<el-col :lg="{span: 1, offset: 1}" :md="2">
|
||||||
<el-button icon="el-icon-refresh-left" size="small" @click="rotateLeft()"></el-button>
|
<el-button icon="el-icon-refresh-left" size="small" @click="rotateLeft()"></el-button>
|
||||||
</el-col>
|
</el-col>
|
||||||
<el-col :lg="{span: 1, offset: 1}" :md="2">
|
<el-col :lg="{span: 1, offset: 1}" :md="2">
|
||||||
<el-button icon="el-icon-refresh-right" size="small" @click="rotateRight()"></el-button>
|
<el-button icon="el-icon-refresh-right" size="small" @click="rotateRight()"></el-button>
|
||||||
</el-col>
|
</el-col>
|
||||||
<el-col :lg="{span: 2, offset: 6}" :md="2">
|
<el-col :lg="{span: 2, offset: 6}" :md="2">
|
||||||
<el-button type="primary" size="small" @click="uploadImg()">提 交</el-button>
|
<el-button type="primary" size="small" @click="uploadImg()">提 交</el-button>
|
||||||
</el-col>
|
</el-col>
|
||||||
</el-row>
|
</el-row>
|
||||||
</el-dialog>
|
</el-dialog>
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
import store from "@/store";
|
import store from "@/store";
|
||||||
import { VueCropper } from "vue-cropper";
|
import { VueCropper } from "vue-cropper";
|
||||||
import { uploadAvatar } from "@/api/system/user";
|
import { uploadAvatar } from "@/api/system/user";
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
components: { VueCropper },
|
components: { VueCropper },
|
||||||
props: {
|
props: {
|
||||||
user: {
|
user: {
|
||||||
type: Object
|
type: Object
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
// 是否显示弹出层
|
// 是否显示弹出层
|
||||||
open: false,
|
open: false,
|
||||||
// 是否显示cropper
|
// 是否显示cropper
|
||||||
visible: false,
|
visible: false,
|
||||||
// 弹出层标题
|
// 弹出层标题
|
||||||
title: "修改头像",
|
title: "修改头像",
|
||||||
options: {
|
options: {
|
||||||
img: store.getters.avatar, //裁剪图片的地址
|
img: store.getters.avatar, //裁剪图片的地址
|
||||||
autoCrop: true, // 是否默认生成截图框
|
autoCrop: true, // 是否默认生成截图框
|
||||||
autoCropWidth: 200, // 默认生成截图框宽度
|
autoCropWidth: 200, // 默认生成截图框宽度
|
||||||
autoCropHeight: 200, // 默认生成截图框高度
|
autoCropHeight: 200, // 默认生成截图框高度
|
||||||
fixedBox: true // 固定截图框大小 不允许改变
|
fixedBox: true // 固定截图框大小 不允许改变
|
||||||
},
|
},
|
||||||
previews: {}
|
previews: {}
|
||||||
};
|
};
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
// 编辑头像
|
// 编辑头像
|
||||||
editCropper() {
|
editCropper() {
|
||||||
this.open = true;
|
this.open = true;
|
||||||
},
|
},
|
||||||
// 打开弹出层结束时的回调
|
// 打开弹出层结束时的回调
|
||||||
modalOpened() {
|
modalOpened() {
|
||||||
this.visible = true;
|
this.visible = true;
|
||||||
},
|
},
|
||||||
// 覆盖默认的上传行为
|
// 覆盖默认的上传行为
|
||||||
requestUpload() {
|
requestUpload() {
|
||||||
},
|
},
|
||||||
// 向左旋转
|
// 向左旋转
|
||||||
rotateLeft() {
|
rotateLeft() {
|
||||||
this.$refs.cropper.rotateLeft();
|
this.$refs.cropper.rotateLeft();
|
||||||
},
|
},
|
||||||
// 向右旋转
|
// 向右旋转
|
||||||
rotateRight() {
|
rotateRight() {
|
||||||
this.$refs.cropper.rotateRight();
|
this.$refs.cropper.rotateRight();
|
||||||
},
|
},
|
||||||
// 图片缩放
|
// 图片缩放
|
||||||
changeScale(num) {
|
changeScale(num) {
|
||||||
num = num || 1;
|
num = num || 1;
|
||||||
this.$refs.cropper.changeScale(num);
|
this.$refs.cropper.changeScale(num);
|
||||||
},
|
},
|
||||||
// 上传预处理
|
// 上传预处理
|
||||||
beforeUpload(file) {
|
beforeUpload(file) {
|
||||||
if (file.type.indexOf("image/") == -1) {
|
if (file.type.indexOf("image/") == -1) {
|
||||||
this.msgError("文件格式错误,请上传图片类型,如:JPG,PNG后缀的文件。");
|
this.msgError("文件格式错误,请上传图片类型,如:JPG,PNG后缀的文件。");
|
||||||
} else {
|
} else {
|
||||||
const reader = new FileReader();
|
const reader = new FileReader();
|
||||||
reader.readAsDataURL(file);
|
reader.readAsDataURL(file);
|
||||||
reader.onload = () => {
|
reader.onload = () => {
|
||||||
this.options.img = reader.result;
|
this.options.img = reader.result;
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
// 上传图片
|
// 上传图片
|
||||||
uploadImg() {
|
uploadImg() {
|
||||||
this.$refs.cropper.getCropBlob(data => {
|
this.$refs.cropper.getCropBlob(data => {
|
||||||
let formData = new FormData();
|
let formData = new FormData();
|
||||||
formData.append("avatarfile", data);
|
formData.append("avatarfile", data);
|
||||||
uploadAvatar(formData).then(response => {
|
uploadAvatar(formData).then(response => {
|
||||||
this.open = false;
|
this.open = false;
|
||||||
this.options.img = response.imgUrl;
|
this.options.img = response.imgUrl;
|
||||||
store.commit('SET_AVATAR', this.options.img);
|
store.commit('SET_AVATAR', this.options.img);
|
||||||
this.msgSuccess("修改成功");
|
this.msgSuccess("修改成功");
|
||||||
this.visible = false;
|
this.visible = false;
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
// 实时预览
|
// 实时预览
|
||||||
realTime(data) {
|
realTime(data) {
|
||||||
this.previews = data;
|
this.previews = data;
|
||||||
},
|
},
|
||||||
// 关闭窗口
|
// 关闭窗口
|
||||||
closeDialog() {
|
closeDialog() {
|
||||||
this.options.img = store.getters.avatar
|
this.options.img = store.getters.avatar
|
||||||
this.visible = false;
|
this.visible = false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
</script>
|
</script>
|
||||||
<style scoped lang="scss">
|
<style scoped lang="scss">
|
||||||
.user-info-head {
|
.user-info-head {
|
||||||
position: relative;
|
position: relative;
|
||||||
display: inline-block;
|
display: inline-block;
|
||||||
height: 120px;
|
height: 120px;
|
||||||
}
|
}
|
||||||
|
|
||||||
.user-info-head:hover:after {
|
.user-info-head:hover:after {
|
||||||
content: '+';
|
content: '+';
|
||||||
position: absolute;
|
position: absolute;
|
||||||
left: 0;
|
left: 0;
|
||||||
right: 0;
|
right: 0;
|
||||||
top: 0;
|
top: 0;
|
||||||
bottom: 0;
|
bottom: 0;
|
||||||
color: #eee;
|
color: #eee;
|
||||||
background: rgba(0, 0, 0, 0.5);
|
background: rgba(0, 0, 0, 0.5);
|
||||||
font-size: 24px;
|
font-size: 24px;
|
||||||
font-style: normal;
|
font-style: normal;
|
||||||
-webkit-font-smoothing: antialiased;
|
-webkit-font-smoothing: antialiased;
|
||||||
-moz-osx-font-smoothing: grayscale;
|
-moz-osx-font-smoothing: grayscale;
|
||||||
cursor: pointer;
|
cursor: pointer;
|
||||||
line-height: 110px;
|
line-height: 110px;
|
||||||
border-radius: 50%;
|
border-radius: 50%;
|
||||||
}
|
}
|
||||||
</style>
|
</style>
|
||||||
|
|
|
||||||
|
|
@ -246,8 +246,8 @@ export default {
|
||||||
getList() {
|
getList() {
|
||||||
this.loading = true;
|
this.loading = true;
|
||||||
listTable(this.addDateRange(this.queryParams, this.dateRange)).then(response => {
|
listTable(this.addDateRange(this.queryParams, this.dateRange)).then(response => {
|
||||||
let currentPageNum = response.total / this.queryParams.pageSize;
|
let currentPageNum = response.total % this.queryParams.pageSize > 0 ? parseInt(response.total / this.queryParams.pageSize) + 1 : (response.total / this.queryParams.pageSize);
|
||||||
if(this.queryParams.pageNum > currentPageNum){
|
if(currentPageNum !== 0 && currentPageNum !== 0 && this.queryParams.pageNum > currentPageNum){
|
||||||
this.queryParams.pageNum = currentPageNum;
|
this.queryParams.pageNum = currentPageNum;
|
||||||
}
|
}
|
||||||
this.tableList = response.rows;
|
this.tableList = response.rows;
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue