优化所有弹窗、导出和提交等待的用户体验
修复第二页只有一条数据如果删除页面显示无数据,分页那里显示选中的第一页的bug
This commit is contained in:
parent
94521189cb
commit
1c2134bf27
|
|
@ -72,7 +72,7 @@ export default {
|
|||
|
||||
<style lang="scss" scoped>
|
||||
.panel-group {
|
||||
margin-top: 18px;
|
||||
//margin-top: 18px;
|
||||
|
||||
.card-panel-col {
|
||||
margin-bottom: 32px;
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
<template>
|
||||
<div class="app-container">
|
||||
<el-form :model="queryParams" ref="queryForm" :inline="true" v-show="showSearch" label-width="68px">
|
||||
<el-form :model="queryParams" ref="queryForm" :inline="true" v-show="showSearch" label-width="70px">
|
||||
<el-form-item label="任务名称" prop="jobName">
|
||||
<el-input
|
||||
v-model="queryParams.jobName"
|
||||
|
|
@ -334,6 +334,10 @@ export default {
|
|||
getList() {
|
||||
this.loading = true;
|
||||
listJob(this.queryParams).then(response => {
|
||||
let currentPageNum = response.total / this.queryParams.pageSize;
|
||||
if(this.queryParams.pageNum > currentPageNum){
|
||||
this.queryParams.pageNum = currentPageNum;
|
||||
}
|
||||
this.jobList = response.rows;
|
||||
this.total = response.total;
|
||||
this.loading = false;
|
||||
|
|
@ -393,7 +397,7 @@ export default {
|
|||
return changeJobStatus(row.jobId, row.status);
|
||||
}).then(() => {
|
||||
this.msgSuccess(text + "成功");
|
||||
}).catch(function() {
|
||||
}).catch(()=>{
|
||||
row.status = row.status === "0" ? "1" : "0";
|
||||
});
|
||||
},
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
<template>
|
||||
<div class="app-container">
|
||||
<el-form :model="queryParams" ref="queryForm" :inline="true" v-show="showSearch" label-width="68px">
|
||||
<el-form :model="queryParams" ref="queryForm" :inline="true" v-show="showSearch" label-width="70px">
|
||||
<el-form-item label="任务名称" prop="jobName">
|
||||
<el-input
|
||||
v-model="queryParams.jobName"
|
||||
|
|
@ -219,11 +219,14 @@ export default {
|
|||
getList() {
|
||||
this.loading = true;
|
||||
listJobLog(this.addDateRange(this.queryParams, this.dateRange)).then(response => {
|
||||
this.jobLogList = response.rows;
|
||||
this.total = response.total;
|
||||
this.loading = false;
|
||||
let currentPageNum = response.total / this.queryParams.pageSize;
|
||||
if(this.queryParams.pageNum > currentPageNum){
|
||||
this.queryParams.pageNum = currentPageNum;
|
||||
}
|
||||
);
|
||||
this.jobLogList = response.rows;
|
||||
this.total = response.total;
|
||||
this.loading = false;
|
||||
});
|
||||
},
|
||||
// 执行状态字典翻译
|
||||
statusFormat(row, column) {
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
<template>
|
||||
<div class="app-container">
|
||||
<el-form :model="queryParams" ref="queryForm" :inline="true" label-width="68px">
|
||||
<el-form :model="queryParams" ref="queryForm" :inline="true" label-width="70px">
|
||||
<el-form-item label="登录地址" prop="ipaddr">
|
||||
<el-input
|
||||
v-model="queryParams.ipaddr"
|
||||
|
|
@ -90,6 +90,10 @@ export default {
|
|||
getList() {
|
||||
this.loading = true;
|
||||
list(this.queryParams).then(response => {
|
||||
let currentPageNum = response.total / this.queryParams.pageSize;
|
||||
if(this.queryParams.pageNum > currentPageNum){
|
||||
this.queryParams.pageNum = currentPageNum;
|
||||
}
|
||||
this.list = response.rows;
|
||||
this.total = response.total;
|
||||
this.loading = false;
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
<template>
|
||||
<div class="app-container">
|
||||
<el-form :model="queryParams" ref="queryForm" :inline="true" v-show="showSearch" label-width="68px">
|
||||
<el-form :model="queryParams" ref="queryForm" :inline="true" v-show="showSearch" label-width="70px">
|
||||
<el-form-item label="参数名称" prop="configName">
|
||||
<el-input
|
||||
v-model="queryParams.configName"
|
||||
|
|
@ -89,6 +89,7 @@
|
|||
icon="el-icon-download"
|
||||
size="mini"
|
||||
@click="handleExport"
|
||||
:loading="exportLoading"
|
||||
v-hasPermi="['system:config:export']"
|
||||
>导出</el-button>
|
||||
</el-col>
|
||||
|
|
@ -99,6 +100,7 @@
|
|||
icon="el-icon-refresh"
|
||||
size="mini"
|
||||
@click="handleRefreshCache"
|
||||
:loading="refreshLoading"
|
||||
v-hasPermi="['system:config:remove']"
|
||||
>刷新缓存</el-button>
|
||||
</el-col>
|
||||
|
|
@ -148,7 +150,7 @@
|
|||
|
||||
<!-- 添加或修改参数配置对话框 -->
|
||||
<el-dialog :title="title" :visible.sync="open" width="500px" append-to-body>
|
||||
<el-form ref="form" :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-input v-model="form.configName" placeholder="请输入参数名称" />
|
||||
</el-form-item>
|
||||
|
|
@ -172,7 +174,7 @@
|
|||
</el-form-item>
|
||||
</el-form>
|
||||
<div slot="footer" class="dialog-footer">
|
||||
<el-button type="primary" @click="submitForm">确 定</el-button>
|
||||
<el-button type="primary" @click="submitForm" :loading="submitLoading">确 定</el-button>
|
||||
<el-button @click="cancel">取 消</el-button>
|
||||
</div>
|
||||
</el-dialog>
|
||||
|
|
@ -181,6 +183,7 @@
|
|||
|
||||
<script>
|
||||
import { listConfig, getConfig, delConfig, addConfig, updateConfig, refreshCache } from "@/api/system/config";
|
||||
import {delType} from "@/api/system/dict/type";
|
||||
|
||||
export default {
|
||||
name: "Config",
|
||||
|
|
@ -229,7 +232,15 @@ export default {
|
|||
configValue: [
|
||||
{ required: true, message: "参数键值不能为空", trigger: "blur" }
|
||||
]
|
||||
}
|
||||
},
|
||||
//添加修改弹框加载中
|
||||
dialogLoading: false,
|
||||
//提交表单加载中
|
||||
submitLoading: false,
|
||||
//导出按钮加载中
|
||||
exportLoading: false,
|
||||
//清除缓存加载中
|
||||
refreshLoading: false
|
||||
};
|
||||
},
|
||||
created() {
|
||||
|
|
@ -243,11 +254,14 @@ export default {
|
|||
getList() {
|
||||
this.loading = true;
|
||||
listConfig(this.addDateRange(this.queryParams, this.dateRange)).then(response => {
|
||||
this.configList = response.rows;
|
||||
this.total = response.total;
|
||||
this.loading = false;
|
||||
let currentPageNum = response.total / this.queryParams.pageSize;
|
||||
if(this.queryParams.pageNum > currentPageNum){
|
||||
this.queryParams.pageNum = currentPageNum;
|
||||
}
|
||||
);
|
||||
this.configList = response.rows;
|
||||
this.total = response.total;
|
||||
this.loading = false;
|
||||
});
|
||||
},
|
||||
// 参数系统内置字典翻译
|
||||
typeFormat(row, column) {
|
||||
|
|
@ -284,8 +298,8 @@ export default {
|
|||
/** 新增按钮操作 */
|
||||
handleAdd() {
|
||||
this.reset();
|
||||
this.open = true;
|
||||
this.title = "添加参数";
|
||||
this.open = true;
|
||||
},
|
||||
// 多选框选中数据
|
||||
handleSelectionChange(selection) {
|
||||
|
|
@ -297,27 +311,37 @@ export default {
|
|||
handleUpdate(row) {
|
||||
this.reset();
|
||||
const configId = row.configId || this.ids
|
||||
this.title = "修改参数";
|
||||
this.open = true;
|
||||
this.dialogLoading = true;
|
||||
this.submitLoading = true;
|
||||
getConfig(configId).then(response => {
|
||||
this.form = response.data;
|
||||
this.open = true;
|
||||
this.title = "修改参数";
|
||||
}).finally(()=>{
|
||||
this.dialogLoading = false;
|
||||
this.submitLoading = false;
|
||||
});
|
||||
},
|
||||
/** 提交按钮 */
|
||||
submitForm: function() {
|
||||
this.$refs["form"].validate(valid => {
|
||||
if (valid) {
|
||||
this.submitLoading = true;
|
||||
if (this.form.configId != undefined) {
|
||||
updateConfig(this.form).then(response => {
|
||||
this.msgSuccess("修改成功");
|
||||
this.open = false;
|
||||
this.getList();
|
||||
}).finally(()=>{
|
||||
this.submitLoading = false;
|
||||
});
|
||||
} else {
|
||||
addConfig(this.form).then(response => {
|
||||
this.msgSuccess("新增成功");
|
||||
this.open = false;
|
||||
this.getList();
|
||||
}).finally(()=>{
|
||||
this.submitLoading = false;
|
||||
});
|
||||
}
|
||||
}
|
||||
|
|
@ -326,27 +350,48 @@ export default {
|
|||
/** 删除按钮操作 */
|
||||
handleDelete(row) {
|
||||
const configIds = row.configId || this.ids;
|
||||
this.$confirm('是否确认删除参数编号为"' + configIds + '"的数据项?', "警告", {
|
||||
confirmButtonText: "确定",
|
||||
cancelButtonText: "取消",
|
||||
type: "warning"
|
||||
}).then(function() {
|
||||
return delConfig(configIds);
|
||||
}).then(() => {
|
||||
this.getList();
|
||||
this.msgSuccess("删除成功");
|
||||
}).catch(() => {});
|
||||
this.$msgbox({
|
||||
title: '警告',
|
||||
message: '是否确认删除参数编号为"' + configIds + '"的数据项?',
|
||||
type: "warning",
|
||||
showCancelButton: true,
|
||||
confirmButtonText: '确定',
|
||||
cancelButtonText: '取消',
|
||||
beforeClose: (action, instance, done) => {
|
||||
if (action === 'confirm') {
|
||||
instance.confirmButtonLoading = true;
|
||||
instance.confirmButtonText = '删除中...';
|
||||
delConfig(configIds).then(() => {
|
||||
this.getList();
|
||||
this.msgSuccess("删除成功");
|
||||
}).catch(()=>{}).finally(()=>{
|
||||
done();
|
||||
instance.confirmButtonLoading = false;
|
||||
});
|
||||
} else {
|
||||
done();
|
||||
}
|
||||
}
|
||||
});
|
||||
},
|
||||
/** 导出按钮操作 */
|
||||
handleExport() {
|
||||
this.exportLoading = true;
|
||||
this.download('system/config/export', {
|
||||
...this.queryParams
|
||||
}, `config_${new Date().getTime()}.xlsx`)
|
||||
}, `config_${new Date().getTime()}.xlsx`).then(()=>{
|
||||
|
||||
}).finally(()=>{
|
||||
this.exportLoading = false;
|
||||
});
|
||||
},
|
||||
/** 刷新缓存按钮操作 */
|
||||
handleRefreshCache() {
|
||||
this.refreshLoading = true;
|
||||
refreshCache().then(() => {
|
||||
this.msgSuccess("刷新成功");
|
||||
}).finally(()=>{
|
||||
this.refreshLoading = false;
|
||||
});
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -85,7 +85,7 @@
|
|||
|
||||
<!-- 添加或修改部门对话框 -->
|
||||
<el-dialog :title="title" :visible.sync="open" width="600px" append-to-body>
|
||||
<el-form ref="form" :model="form" :rules="rules" label-width="80px">
|
||||
<el-form ref="form" v-loading="dialogLoading" :model="form" :rules="rules" label-width="80px">
|
||||
<el-row>
|
||||
<el-col :span="24" v-if="form.parentId !== 0">
|
||||
<el-form-item label="上级部门" prop="parentId">
|
||||
|
|
@ -131,7 +131,7 @@
|
|||
</el-row>
|
||||
</el-form>
|
||||
<div slot="footer" class="dialog-footer">
|
||||
<el-button type="primary" @click="submitForm">确 定</el-button>
|
||||
<el-button type="primary" @click="submitForm" :loading="submitLoading">确 定</el-button>
|
||||
<el-button @click="cancel">取 消</el-button>
|
||||
</div>
|
||||
</el-dialog>
|
||||
|
|
@ -142,6 +142,7 @@
|
|||
import { listDept, getDept, delDept, addDept, updateDept, listDeptExcludeChild } from "@/api/system/dept";
|
||||
import Treeselect from "@riophae/vue-treeselect";
|
||||
import "@riophae/vue-treeselect/dist/vue-treeselect.css";
|
||||
import {changeUserStatus} from "@/api/system/user";
|
||||
|
||||
export default {
|
||||
name: "Dept",
|
||||
|
|
@ -194,7 +195,11 @@ export default {
|
|||
trigger: "blur"
|
||||
}
|
||||
]
|
||||
}
|
||||
},
|
||||
//添加修改弹框加载中
|
||||
dialogLoading: false,
|
||||
//提交表单加载中
|
||||
submitLoading: false,
|
||||
};
|
||||
},
|
||||
created() {
|
||||
|
|
@ -261,8 +266,8 @@ export default {
|
|||
if (row != undefined) {
|
||||
this.form.parentId = row.deptId;
|
||||
}
|
||||
this.open = true;
|
||||
this.title = "添加部门";
|
||||
this.open = true;
|
||||
listDept().then(response => {
|
||||
this.deptOptions = this.handleTree(response.data, "deptId");
|
||||
});
|
||||
|
|
@ -270,30 +275,40 @@ export default {
|
|||
/** 修改按钮操作 */
|
||||
handleUpdate(row) {
|
||||
this.reset();
|
||||
this.title = "修改部门";
|
||||
this.open = true;
|
||||
this.dialogLoading = true;
|
||||
this.submitLoading = true;
|
||||
listDeptExcludeChild(row.deptId).then(response => {
|
||||
this.deptOptions = this.handleTree(response.data, "deptId");
|
||||
});
|
||||
getDept(row.deptId).then(response => {
|
||||
this.form = response.data;
|
||||
this.open = true;
|
||||
this.title = "修改部门";
|
||||
});
|
||||
listDeptExcludeChild(row.deptId).then(response => {
|
||||
this.deptOptions = this.handleTree(response.data, "deptId");
|
||||
}).finally(()=>{
|
||||
this.dialogLoading = false;
|
||||
this.submitLoading = false;
|
||||
});
|
||||
},
|
||||
/** 提交按钮 */
|
||||
submitForm: function() {
|
||||
this.$refs["form"].validate(valid => {
|
||||
if (valid) {
|
||||
this.submitLoading = true;
|
||||
if (this.form.deptId != undefined) {
|
||||
updateDept(this.form).then(response => {
|
||||
this.msgSuccess("修改成功");
|
||||
this.open = false;
|
||||
this.getList();
|
||||
}).finally(()=>{
|
||||
this.submitLoading = false;
|
||||
});
|
||||
} else {
|
||||
addDept(this.form).then(response => {
|
||||
this.msgSuccess("新增成功");
|
||||
this.open = false;
|
||||
this.getList();
|
||||
}).finally(()=>{
|
||||
this.submitLoading = false;
|
||||
});
|
||||
}
|
||||
}
|
||||
|
|
@ -301,16 +316,29 @@ export default {
|
|||
},
|
||||
/** 删除按钮操作 */
|
||||
handleDelete(row) {
|
||||
this.$confirm('是否确认删除名称为"' + row.deptName + '"的数据项?', "警告", {
|
||||
confirmButtonText: "确定",
|
||||
cancelButtonText: "取消",
|
||||
type: "warning"
|
||||
}).then(function() {
|
||||
return delDept(row.deptId);
|
||||
}).then(() => {
|
||||
this.getList();
|
||||
this.msgSuccess("删除成功");
|
||||
}).catch(() => {});
|
||||
this.$msgbox({
|
||||
title: '警告',
|
||||
message: '是否确认删除名称为"' + row.deptName + '"的数据项?',
|
||||
type: "warning",
|
||||
showCancelButton: true,
|
||||
confirmButtonText: '确定',
|
||||
cancelButtonText: '取消',
|
||||
beforeClose: (action, instance, done) => {
|
||||
if (action === 'confirm') {
|
||||
instance.confirmButtonLoading = true;
|
||||
instance.confirmButtonText = '删除中...';
|
||||
delDept(row.deptId).then(() => {
|
||||
this.getList();
|
||||
this.msgSuccess("删除成功");
|
||||
}).catch(()=>{}).finally(()=>{
|
||||
done();
|
||||
instance.confirmButtonLoading = false;
|
||||
});
|
||||
} else {
|
||||
done();
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
};
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
<template>
|
||||
<div class="app-container">
|
||||
<el-form :model="queryParams" ref="queryForm" :inline="true" v-show="showSearch" label-width="68px">
|
||||
<el-form :model="queryParams" ref="queryForm" :inline="true" v-show="showSearch" label-width="70px">
|
||||
<el-form-item label="字典名称" prop="dictType">
|
||||
<el-select v-model="queryParams.dictType" size="small">
|
||||
<el-option
|
||||
|
|
@ -291,6 +291,10 @@ export default {
|
|||
getList() {
|
||||
this.loading = true;
|
||||
listData(this.queryParams).then(response => {
|
||||
let currentPageNum = response.total / this.queryParams.pageSize;
|
||||
if(this.queryParams.pageNum > currentPageNum){
|
||||
this.queryParams.pageNum = currentPageNum;
|
||||
}
|
||||
this.dataList = response.rows;
|
||||
this.total = response.total;
|
||||
this.loading = false;
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
<template>
|
||||
<div class="app-container">
|
||||
<el-form :model="queryParams" ref="queryForm" :inline="true" v-show="showSearch" label-width="68px">
|
||||
<el-form :model="queryParams" ref="queryForm" :inline="true" v-show="showSearch" label-width="70px">
|
||||
<el-form-item label="字典名称" prop="dictName">
|
||||
<el-input
|
||||
v-model="queryParams.dictName"
|
||||
|
|
@ -95,6 +95,7 @@
|
|||
icon="el-icon-download"
|
||||
size="mini"
|
||||
@click="handleExport"
|
||||
:loading="exportLoading"
|
||||
v-hasPermi="['system:dict:export']"
|
||||
>导出</el-button>
|
||||
</el-col>
|
||||
|
|
@ -105,6 +106,7 @@
|
|||
icon="el-icon-refresh"
|
||||
size="mini"
|
||||
@click="handleRefreshCache"
|
||||
:loading="refreshLoading"
|
||||
v-hasPermi="['system:dict:remove']"
|
||||
>刷新缓存</el-button>
|
||||
</el-col>
|
||||
|
|
@ -163,7 +165,7 @@
|
|||
|
||||
<!-- 添加或修改参数配置对话框 -->
|
||||
<el-dialog :title="title" :visible.sync="open" width="500px" append-to-body>
|
||||
<el-form ref="form" :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-input v-model="form.dictName" placeholder="请输入字典名称" />
|
||||
</el-form-item>
|
||||
|
|
@ -184,7 +186,7 @@
|
|||
</el-form-item>
|
||||
</el-form>
|
||||
<div slot="footer" class="dialog-footer">
|
||||
<el-button type="primary" @click="submitForm">确 定</el-button>
|
||||
<el-button type="primary" @click="submitForm" :loading="submitLoading">确 定</el-button>
|
||||
<el-button @click="cancel">取 消</el-button>
|
||||
</div>
|
||||
</el-dialog>
|
||||
|
|
@ -193,6 +195,7 @@
|
|||
|
||||
<script>
|
||||
import { listType, getType, delType, addType, updateType, refreshCache } from "@/api/system/dict/type";
|
||||
import {delPost} from "@/api/system/post";
|
||||
|
||||
export default {
|
||||
name: "Dict",
|
||||
|
|
@ -238,7 +241,15 @@ export default {
|
|||
dictType: [
|
||||
{ required: true, message: "字典类型不能为空", trigger: "blur" }
|
||||
]
|
||||
}
|
||||
},
|
||||
//添加修改弹框加载中
|
||||
dialogLoading: false,
|
||||
//提交表单加载中
|
||||
submitLoading: false,
|
||||
//导出按钮加载中
|
||||
exportLoading: false,
|
||||
//清除缓存加载中
|
||||
refreshLoading: false
|
||||
};
|
||||
},
|
||||
created() {
|
||||
|
|
@ -252,11 +263,14 @@ export default {
|
|||
getList() {
|
||||
this.loading = true;
|
||||
listType(this.addDateRange(this.queryParams, this.dateRange)).then(response => {
|
||||
this.typeList = response.rows;
|
||||
this.total = response.total;
|
||||
this.loading = false;
|
||||
let currentPageNum = response.total / this.queryParams.pageSize;
|
||||
if(this.queryParams.pageNum > currentPageNum){
|
||||
this.queryParams.pageNum = currentPageNum;
|
||||
}
|
||||
);
|
||||
this.typeList = response.rows;
|
||||
this.total = response.total;
|
||||
this.loading = false;
|
||||
});
|
||||
},
|
||||
// 取消按钮
|
||||
cancel() {
|
||||
|
|
@ -288,8 +302,8 @@ export default {
|
|||
/** 新增按钮操作 */
|
||||
handleAdd() {
|
||||
this.reset();
|
||||
this.open = true;
|
||||
this.title = "添加字典类型";
|
||||
this.open = true;
|
||||
},
|
||||
// 多选框选中数据
|
||||
handleSelectionChange(selection) {
|
||||
|
|
@ -301,27 +315,37 @@ export default {
|
|||
handleUpdate(row) {
|
||||
this.reset();
|
||||
const dictId = row.dictId || this.ids
|
||||
this.title = "修改字典类型";
|
||||
this.open = true;
|
||||
this.dialogLoading = true;
|
||||
this.submitLoading = true;
|
||||
getType(dictId).then(response => {
|
||||
this.form = response.data;
|
||||
this.open = true;
|
||||
this.title = "修改字典类型";
|
||||
}).finally(()=>{
|
||||
this.dialogLoading = false;
|
||||
this.submitLoading = false;
|
||||
});
|
||||
},
|
||||
/** 提交按钮 */
|
||||
submitForm: function() {
|
||||
this.$refs["form"].validate(valid => {
|
||||
if (valid) {
|
||||
this.submitLoading = true;
|
||||
if (this.form.dictId != undefined) {
|
||||
updateType(this.form).then(response => {
|
||||
this.msgSuccess("修改成功");
|
||||
this.open = false;
|
||||
this.getList();
|
||||
}).finally(()=>{
|
||||
this.submitLoading = false;
|
||||
});
|
||||
} else {
|
||||
addType(this.form).then(response => {
|
||||
this.msgSuccess("新增成功");
|
||||
this.open = false;
|
||||
this.getList();
|
||||
}).finally(()=>{
|
||||
this.submitLoading = false;
|
||||
});
|
||||
}
|
||||
}
|
||||
|
|
@ -330,27 +354,48 @@ export default {
|
|||
/** 删除按钮操作 */
|
||||
handleDelete(row) {
|
||||
const dictIds = row.dictId || this.ids;
|
||||
this.$confirm('是否确认删除字典编号为"' + dictIds + '"的数据项?', "警告", {
|
||||
confirmButtonText: "确定",
|
||||
cancelButtonText: "取消",
|
||||
type: "warning"
|
||||
}).then(function() {
|
||||
return delType(dictIds);
|
||||
}).then(() => {
|
||||
this.getList();
|
||||
this.msgSuccess("删除成功");
|
||||
}).catch(() => {});
|
||||
this.$msgbox({
|
||||
title: '警告',
|
||||
message: '是否确认删除字典编号为"' + dictIds + '"的数据项?',
|
||||
type: "warning",
|
||||
showCancelButton: true,
|
||||
confirmButtonText: '确定',
|
||||
cancelButtonText: '取消',
|
||||
beforeClose: (action, instance, done) => {
|
||||
if (action === 'confirm') {
|
||||
instance.confirmButtonLoading = true;
|
||||
instance.confirmButtonText = '删除中...';
|
||||
delType(dictIds).then(() => {
|
||||
this.getList();
|
||||
this.msgSuccess("删除成功");
|
||||
}).catch(()=>{}).finally(()=>{
|
||||
done();
|
||||
instance.confirmButtonLoading = false;
|
||||
});
|
||||
} else {
|
||||
done();
|
||||
}
|
||||
}
|
||||
});
|
||||
},
|
||||
/** 导出按钮操作 */
|
||||
handleExport() {
|
||||
this.exportLoading = true;
|
||||
this.download('system/dict/type/export', {
|
||||
...this.queryParams
|
||||
}, `type_${new Date().getTime()}.xlsx`)
|
||||
}, `type_${new Date().getTime()}.xlsx`).then(()=>{
|
||||
|
||||
}).finally(()=>{
|
||||
this.exportLoading = false;
|
||||
});
|
||||
},
|
||||
/** 刷新缓存按钮操作 */
|
||||
handleRefreshCache() {
|
||||
this.refreshLoading = true;
|
||||
refreshCache().then(() => {
|
||||
this.msgSuccess("刷新成功");
|
||||
}).finally(()=>{
|
||||
this.refreshLoading = false;
|
||||
});
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
<template>
|
||||
<div class="app-container">
|
||||
<el-form :model="queryParams" ref="queryForm" :inline="true" v-show="showSearch" label-width="68px">
|
||||
<el-form :model="queryParams" ref="queryForm" :inline="true" v-show="showSearch" label-width="70px">
|
||||
<el-form-item label="登录地址" prop="ipaddr">
|
||||
<el-input
|
||||
v-model="queryParams.ipaddr"
|
||||
|
|
@ -160,11 +160,14 @@ export default {
|
|||
getList() {
|
||||
this.loading = true;
|
||||
list(this.addDateRange(this.queryParams, this.dateRange)).then(response => {
|
||||
this.list = response.rows;
|
||||
this.total = response.total;
|
||||
this.loading = false;
|
||||
let currentPageNum = response.total / this.queryParams.pageSize;
|
||||
if(this.queryParams.pageNum > currentPageNum){
|
||||
this.queryParams.pageNum = currentPageNum;
|
||||
}
|
||||
);
|
||||
this.list = response.rows;
|
||||
this.total = response.total;
|
||||
this.loading = false;
|
||||
});
|
||||
},
|
||||
// 登录状态字典翻译
|
||||
statusFormat(row, column) {
|
||||
|
|
|
|||
|
|
@ -89,7 +89,7 @@
|
|||
|
||||
<!-- 添加或修改菜单对话框 -->
|
||||
<el-dialog :title="title" :visible.sync="open" width="600px" append-to-body>
|
||||
<el-form ref="form" :model="form" :rules="rules" label-width="80px">
|
||||
<el-form ref="form" v-loading="dialogLoading" :model="form" :rules="rules" label-width="80px">
|
||||
<el-row>
|
||||
<el-col :span="24">
|
||||
<el-form-item label="上级菜单">
|
||||
|
|
@ -199,7 +199,7 @@
|
|||
</el-row>
|
||||
</el-form>
|
||||
<div slot="footer" class="dialog-footer">
|
||||
<el-button type="primary" @click="submitForm">确 定</el-button>
|
||||
<el-button type="primary" @click="submitForm" :loading="submitLoading">确 定</el-button>
|
||||
<el-button @click="cancel">取 消</el-button>
|
||||
</div>
|
||||
</el-dialog>
|
||||
|
|
@ -211,6 +211,7 @@ import { listMenu, getMenu, delMenu, addMenu, updateMenu } from "@/api/system/me
|
|||
import Treeselect from "@riophae/vue-treeselect";
|
||||
import "@riophae/vue-treeselect/dist/vue-treeselect.css";
|
||||
import IconSelect from "@/components/IconSelect";
|
||||
import {authUserCancelAll} from "@/api/system/role";
|
||||
|
||||
export default {
|
||||
name: "Menu",
|
||||
|
|
@ -251,7 +252,11 @@ export default {
|
|||
path: [
|
||||
{ required: true, message: "路由地址不能为空", trigger: "blur" }
|
||||
]
|
||||
}
|
||||
},
|
||||
//添加修改弹框加载中
|
||||
dialogLoading: false,
|
||||
//提交表单加载中
|
||||
submitLoading: false,
|
||||
};
|
||||
},
|
||||
created() {
|
||||
|
|
@ -356,27 +361,37 @@ export default {
|
|||
handleUpdate(row) {
|
||||
this.reset();
|
||||
this.getTreeselect();
|
||||
this.title = "修改菜单";
|
||||
this.open = true;
|
||||
this.dialogLoading = true;
|
||||
this.submitLoading = true;
|
||||
getMenu(row.menuId).then(response => {
|
||||
this.form = response.data;
|
||||
this.open = true;
|
||||
this.title = "修改菜单";
|
||||
}).finally(()=>{
|
||||
this.dialogLoading = false;
|
||||
this.submitLoading = false;
|
||||
});
|
||||
},
|
||||
/** 提交按钮 */
|
||||
submitForm: function() {
|
||||
this.$refs["form"].validate(valid => {
|
||||
if (valid) {
|
||||
this.submitLoading = true;
|
||||
if (this.form.menuId != undefined) {
|
||||
updateMenu(this.form).then(response => {
|
||||
this.msgSuccess("修改成功");
|
||||
this.open = false;
|
||||
this.getList();
|
||||
}).finally(()=>{
|
||||
this.submitLoading = false;
|
||||
});
|
||||
} else {
|
||||
addMenu(this.form).then(response => {
|
||||
this.msgSuccess("新增成功");
|
||||
this.open = false;
|
||||
this.getList();
|
||||
}).finally(()=>{
|
||||
this.submitLoading = false;
|
||||
});
|
||||
}
|
||||
}
|
||||
|
|
@ -384,16 +399,29 @@ export default {
|
|||
},
|
||||
/** 删除按钮操作 */
|
||||
handleDelete(row) {
|
||||
this.$confirm('是否确认删除名称为"' + row.menuName + '"的数据项?', "警告", {
|
||||
confirmButtonText: "确定",
|
||||
cancelButtonText: "取消",
|
||||
type: "warning"
|
||||
}).then(function() {
|
||||
return delMenu(row.menuId);
|
||||
}).then(() => {
|
||||
this.getList();
|
||||
this.msgSuccess("删除成功");
|
||||
}).catch(() => {});
|
||||
this.$msgbox({
|
||||
title: '警告',
|
||||
message: '是否确认删除名称为"' + row.menuName + '"的数据项?',
|
||||
type: "warning",
|
||||
showCancelButton: true,
|
||||
confirmButtonText: '确定',
|
||||
cancelButtonText: '取消',
|
||||
beforeClose: (action, instance, done) => {
|
||||
if (action === 'confirm') {
|
||||
instance.confirmButtonLoading = true;
|
||||
instance.confirmButtonText = '删除中...';
|
||||
delMenu(row.menuId).then(() => {
|
||||
this.getList();
|
||||
this.msgSuccess("删除成功");
|
||||
}).catch(()=>{}).finally(()=>{
|
||||
done();
|
||||
instance.confirmButtonLoading = false;
|
||||
});
|
||||
} else {
|
||||
done();
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
};
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
<template>
|
||||
<div class="app-container">
|
||||
<el-form :model="queryParams" ref="queryForm" :inline="true" v-show="showSearch" label-width="68px">
|
||||
<el-form :model="queryParams" ref="queryForm" :inline="true" v-show="showSearch" label-width="70px">
|
||||
<el-form-item label="公告标题" prop="noticeTitle">
|
||||
<el-input
|
||||
v-model="queryParams.noticeTitle"
|
||||
|
|
@ -130,7 +130,7 @@
|
|||
|
||||
<!-- 添加或修改公告对话框 -->
|
||||
<el-dialog :title="title" :visible.sync="open" width="780px" append-to-body>
|
||||
<el-form ref="form" :model="form" :rules="rules" label-width="80px">
|
||||
<el-form ref="form" v-loading="dialogLoading" :model="form" :rules="rules" label-width="80px">
|
||||
<el-row>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="公告标题" prop="noticeTitle">
|
||||
|
|
@ -168,7 +168,7 @@
|
|||
</el-row>
|
||||
</el-form>
|
||||
<div slot="footer" class="dialog-footer">
|
||||
<el-button type="primary" @click="submitForm">确 定</el-button>
|
||||
<el-button type="primary" @click="submitForm" :loading="submitLoading">确 定</el-button>
|
||||
<el-button @click="cancel">取 消</el-button>
|
||||
</div>
|
||||
</el-dialog>
|
||||
|
|
@ -178,6 +178,7 @@
|
|||
<script>
|
||||
import { listNotice, getNotice, delNotice, addNotice, updateNotice, exportNotice } from "@/api/system/notice";
|
||||
import Editor from '@/components/Editor';
|
||||
import {delConfig} from "@/api/system/config";
|
||||
|
||||
export default {
|
||||
name: "Notice",
|
||||
|
|
@ -226,7 +227,11 @@ export default {
|
|||
noticeType: [
|
||||
{ required: true, message: "公告类型不能为空", trigger: "change" }
|
||||
]
|
||||
}
|
||||
},
|
||||
//添加修改弹框加载中
|
||||
dialogLoading: false,
|
||||
//提交表单加载中
|
||||
submitLoading: false,
|
||||
};
|
||||
},
|
||||
created() {
|
||||
|
|
@ -243,6 +248,10 @@ export default {
|
|||
getList() {
|
||||
this.loading = true;
|
||||
listNotice(this.queryParams).then(response => {
|
||||
let currentPageNum = response.total / this.queryParams.pageSize;
|
||||
if(this.queryParams.pageNum > currentPageNum){
|
||||
this.queryParams.pageNum = currentPageNum;
|
||||
}
|
||||
this.noticeList = response.rows;
|
||||
this.total = response.total;
|
||||
this.loading = false;
|
||||
|
|
@ -291,34 +300,44 @@ export default {
|
|||
/** 新增按钮操作 */
|
||||
handleAdd() {
|
||||
this.reset();
|
||||
this.open = true;
|
||||
this.title = "添加公告";
|
||||
this.open = true;
|
||||
},
|
||||
/** 修改按钮操作 */
|
||||
handleUpdate(row) {
|
||||
this.reset();
|
||||
const noticeId = row.noticeId || this.ids
|
||||
this.title = "修改公告";
|
||||
this.open = true;
|
||||
this.dialogLoading = true;
|
||||
this.submitLoading = true;
|
||||
getNotice(noticeId).then(response => {
|
||||
this.form = response.data;
|
||||
this.open = true;
|
||||
this.title = "修改公告";
|
||||
}).finally(()=>{
|
||||
this.dialogLoading = false;
|
||||
this.submitLoading = false;
|
||||
});
|
||||
},
|
||||
/** 提交按钮 */
|
||||
submitForm: function() {
|
||||
this.$refs["form"].validate(valid => {
|
||||
if (valid) {
|
||||
this.submitLoading = true;
|
||||
if (this.form.noticeId != undefined) {
|
||||
updateNotice(this.form).then(response => {
|
||||
this.msgSuccess("修改成功");
|
||||
this.open = false;
|
||||
this.getList();
|
||||
}).finally(()=>{
|
||||
this.submitLoading = false;
|
||||
});
|
||||
} else {
|
||||
addNotice(this.form).then(response => {
|
||||
this.msgSuccess("新增成功");
|
||||
this.open = false;
|
||||
this.getList();
|
||||
}).finally(()=>{
|
||||
this.submitLoading = false;
|
||||
});
|
||||
}
|
||||
}
|
||||
|
|
@ -327,16 +346,29 @@ export default {
|
|||
/** 删除按钮操作 */
|
||||
handleDelete(row) {
|
||||
const noticeIds = row.noticeId || this.ids
|
||||
this.$confirm('是否确认删除公告编号为"' + noticeIds + '"的数据项?', "警告", {
|
||||
confirmButtonText: "确定",
|
||||
cancelButtonText: "取消",
|
||||
type: "warning"
|
||||
}).then(function() {
|
||||
return delNotice(noticeIds);
|
||||
}).then(() => {
|
||||
this.getList();
|
||||
this.msgSuccess("删除成功");
|
||||
}).catch(() => {});
|
||||
this.$msgbox({
|
||||
title: '警告',
|
||||
message: '是否确认删除公告编号为"' + noticeIds + '"的数据项?',
|
||||
type: "warning",
|
||||
showCancelButton: true,
|
||||
confirmButtonText: '确定',
|
||||
cancelButtonText: '取消',
|
||||
beforeClose: (action, instance, done) => {
|
||||
if (action === 'confirm') {
|
||||
instance.confirmButtonLoading = true;
|
||||
instance.confirmButtonText = '删除中...';
|
||||
delNotice(noticeIds).then(() => {
|
||||
this.getList();
|
||||
this.msgSuccess("删除成功");
|
||||
}).catch(()=>{}).finally(()=>{
|
||||
done();
|
||||
instance.confirmButtonLoading = false;
|
||||
});
|
||||
} else {
|
||||
done();
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
};
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
<template>
|
||||
<div class="app-container">
|
||||
<el-form :model="queryParams" ref="queryForm" :inline="true" v-show="showSearch" label-width="68px">
|
||||
<el-form :model="queryParams" ref="queryForm" :inline="true" v-show="showSearch" label-width="70px">
|
||||
<el-form-item label="系统模块" prop="title">
|
||||
<el-input
|
||||
v-model="queryParams.title"
|
||||
|
|
@ -241,11 +241,14 @@ export default {
|
|||
getList() {
|
||||
this.loading = true;
|
||||
list(this.addDateRange(this.queryParams, this.dateRange)).then( response => {
|
||||
this.list = response.rows;
|
||||
this.total = response.total;
|
||||
this.loading = false;
|
||||
let currentPageNum = response.total / this.queryParams.pageSize;
|
||||
if(this.queryParams.pageNum > currentPageNum){
|
||||
this.queryParams.pageNum = currentPageNum;
|
||||
}
|
||||
);
|
||||
this.list = response.rows;
|
||||
this.total = response.total;
|
||||
this.loading = false;
|
||||
});
|
||||
},
|
||||
// 操作日志状态字典翻译
|
||||
statusFormat(row, column) {
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
<template>
|
||||
<div class="app-container">
|
||||
<el-form :model="queryParams" ref="queryForm" :inline="true" v-show="showSearch" label-width="68px">
|
||||
<el-form :model="queryParams" ref="queryForm" :inline="true" v-show="showSearch" label-width="70px">
|
||||
<el-form-item label="岗位编码" prop="postCode">
|
||||
<el-input
|
||||
v-model="queryParams.postCode"
|
||||
|
|
@ -75,6 +75,7 @@
|
|||
icon="el-icon-download"
|
||||
size="mini"
|
||||
@click="handleExport"
|
||||
:loading="exportLoading"
|
||||
v-hasPermi="['system:post:export']"
|
||||
>导出</el-button>
|
||||
</el-col>
|
||||
|
|
@ -123,7 +124,7 @@
|
|||
|
||||
<!-- 添加或修改岗位对话框 -->
|
||||
<el-dialog :title="title" :visible.sync="open" width="500px" append-to-body>
|
||||
<el-form ref="form" :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-input v-model="form.postName" placeholder="请输入岗位名称" />
|
||||
</el-form-item>
|
||||
|
|
@ -147,7 +148,7 @@
|
|||
</el-form-item>
|
||||
</el-form>
|
||||
<div slot="footer" class="dialog-footer">
|
||||
<el-button type="primary" @click="submitForm">确 定</el-button>
|
||||
<el-button type="primary" @click="submitForm" :loading="submitLoading">确 定</el-button>
|
||||
<el-button @click="cancel">取 消</el-button>
|
||||
</div>
|
||||
</el-dialog>
|
||||
|
|
@ -156,6 +157,7 @@
|
|||
|
||||
<script>
|
||||
import { listPost, getPost, delPost, addPost, updatePost } from "@/api/system/post";
|
||||
import {delDept} from "@/api/system/dept";
|
||||
|
||||
export default {
|
||||
name: "Post",
|
||||
|
|
@ -202,7 +204,13 @@ export default {
|
|||
postSort: [
|
||||
{ required: true, message: "岗位顺序不能为空", trigger: "blur" }
|
||||
]
|
||||
}
|
||||
},
|
||||
//添加修改弹框加载中
|
||||
dialogLoading: false,
|
||||
//提交表单加载中
|
||||
submitLoading: false,
|
||||
//导出按钮加载中
|
||||
exportLoading: false
|
||||
};
|
||||
},
|
||||
created() {
|
||||
|
|
@ -216,6 +224,10 @@ export default {
|
|||
getList() {
|
||||
this.loading = true;
|
||||
listPost(this.queryParams).then(response => {
|
||||
let currentPageNum = response.total / this.queryParams.pageSize;
|
||||
if(this.queryParams.pageNum > currentPageNum){
|
||||
this.queryParams.pageNum = currentPageNum;
|
||||
}
|
||||
this.postList = response.rows;
|
||||
this.total = response.total;
|
||||
this.loading = false;
|
||||
|
|
@ -261,34 +273,44 @@ export default {
|
|||
/** 新增按钮操作 */
|
||||
handleAdd() {
|
||||
this.reset();
|
||||
this.open = true;
|
||||
this.title = "添加岗位";
|
||||
this.open = true;
|
||||
},
|
||||
/** 修改按钮操作 */
|
||||
handleUpdate(row) {
|
||||
this.reset();
|
||||
const postId = row.postId || this.ids
|
||||
this.title = "修改岗位";
|
||||
this.open = true;
|
||||
this.dialogLoading = true;
|
||||
this.submitLoading = true;
|
||||
getPost(postId).then(response => {
|
||||
this.form = response.data;
|
||||
this.open = true;
|
||||
this.title = "修改岗位";
|
||||
}).finally(()=>{
|
||||
this.dialogLoading = false;
|
||||
this.submitLoading = false;
|
||||
});
|
||||
},
|
||||
/** 提交按钮 */
|
||||
submitForm: function() {
|
||||
this.$refs["form"].validate(valid => {
|
||||
if (valid) {
|
||||
this.submitLoading = true;
|
||||
if (this.form.postId != undefined) {
|
||||
updatePost(this.form).then(response => {
|
||||
this.msgSuccess("修改成功");
|
||||
this.open = false;
|
||||
this.getList();
|
||||
}).finally(()=>{
|
||||
this.submitLoading = false;
|
||||
});
|
||||
} else {
|
||||
addPost(this.form).then(response => {
|
||||
this.msgSuccess("新增成功");
|
||||
this.open = false;
|
||||
this.getList();
|
||||
}).finally(()=>{
|
||||
this.submitLoading = false;
|
||||
});
|
||||
}
|
||||
}
|
||||
|
|
@ -297,22 +319,40 @@ export default {
|
|||
/** 删除按钮操作 */
|
||||
handleDelete(row) {
|
||||
const postIds = row.postId || this.ids;
|
||||
this.$confirm('是否确认删除岗位编号为"' + postIds + '"的数据项?', "警告", {
|
||||
confirmButtonText: "确定",
|
||||
cancelButtonText: "取消",
|
||||
type: "warning"
|
||||
}).then(function() {
|
||||
return delPost(postIds);
|
||||
}).then(() => {
|
||||
this.getList();
|
||||
this.msgSuccess("删除成功");
|
||||
}).catch(() => {});
|
||||
this.$msgbox({
|
||||
title: '警告',
|
||||
message: '是否确认删除岗位编号为"' + postIds + '"的数据项?',
|
||||
type: "warning",
|
||||
showCancelButton: true,
|
||||
confirmButtonText: '确定',
|
||||
cancelButtonText: '取消',
|
||||
beforeClose: (action, instance, done) => {
|
||||
if (action === 'confirm') {
|
||||
instance.confirmButtonLoading = true;
|
||||
instance.confirmButtonText = '删除中...';
|
||||
delPost(postIds).then(() => {
|
||||
this.getList();
|
||||
this.msgSuccess("删除成功");
|
||||
}).catch(()=>{}).finally(()=>{
|
||||
done();
|
||||
instance.confirmButtonLoading = false;
|
||||
});
|
||||
} else {
|
||||
done();
|
||||
}
|
||||
}
|
||||
});
|
||||
},
|
||||
/** 导出按钮操作 */
|
||||
handleExport() {
|
||||
this.exportLoading = true;
|
||||
this.download('system/post/export', {
|
||||
...this.queryParams
|
||||
}, `post_${new Date().getTime()}.xlsx`)
|
||||
}, `post_${new Date().getTime()}.xlsx`).then(()=>{
|
||||
|
||||
}).finally(()=>{
|
||||
this.exportLoading = false;
|
||||
});
|
||||
}
|
||||
}
|
||||
};
|
||||
|
|
|
|||
|
|
@ -102,7 +102,7 @@
|
|||
</template>
|
||||
|
||||
<script>
|
||||
import { allocatedUserList, authUserCancel, authUserCancelAll } from "@/api/system/role";
|
||||
import {allocatedUserList, authUserCancel, authUserCancelAll, changeRoleStatus} from "@/api/system/role";
|
||||
import selectUser from "./selectUser";
|
||||
|
||||
export default {
|
||||
|
|
@ -149,11 +149,14 @@ export default {
|
|||
getList() {
|
||||
this.loading = true;
|
||||
allocatedUserList(this.queryParams).then(response => {
|
||||
this.userList = response.rows;
|
||||
this.total = response.total;
|
||||
this.loading = false;
|
||||
let currentPageNum = response.total / this.queryParams.pageSize;
|
||||
if(this.queryParams.pageNum > currentPageNum){
|
||||
this.queryParams.pageNum = currentPageNum;
|
||||
}
|
||||
);
|
||||
this.userList = response.rows;
|
||||
this.total = response.total;
|
||||
this.loading = false;
|
||||
});
|
||||
},
|
||||
// 返回按钮
|
||||
handleClose() {
|
||||
|
|
@ -182,31 +185,56 @@ export default {
|
|||
/** 取消授权按钮操作 */
|
||||
cancelAuthUser(row) {
|
||||
const roleId = this.queryParams.roleId;
|
||||
this.$confirm('确认要取消该用户"' + row.userName + '"角色吗?', "警告", {
|
||||
confirmButtonText: "确定",
|
||||
cancelButtonText: "取消",
|
||||
type: "warning"
|
||||
}).then(function() {
|
||||
return authUserCancel({ userId: row.userId, roleId: roleId });
|
||||
}).then(() => {
|
||||
this.getList();
|
||||
this.msgSuccess("取消授权成功");
|
||||
}).catch(() => {});
|
||||
this.$msgbox({
|
||||
title: '警告',
|
||||
message: '确认要取消该用户"' + row.userName + '"角色吗?',
|
||||
type: "warning",
|
||||
showCancelButton: true,
|
||||
confirmButtonText: '确定',
|
||||
cancelButtonText: '取消',
|
||||
beforeClose: (action, instance, done) => {
|
||||
if (action === 'confirm') {
|
||||
instance.confirmButtonLoading = true;
|
||||
instance.confirmButtonText = '取消中...';
|
||||
authUserCancel({ userId: row.userId, roleId: roleId }).then(() => {
|
||||
this.getList();
|
||||
this.msgSuccess("取消授权成功");
|
||||
}).catch(()=>{}).finally(()=>{
|
||||
done();
|
||||
instance.confirmButtonLoading = false;
|
||||
});
|
||||
} else {
|
||||
done();
|
||||
}
|
||||
}
|
||||
});
|
||||
},
|
||||
/** 批量取消授权按钮操作 */
|
||||
cancelAuthUserAll(row) {
|
||||
const roleId = this.queryParams.roleId;
|
||||
const userIds = this.userIds.join(",");
|
||||
this.$confirm('是否取消选中用户授权数据项?', "警告", {
|
||||
confirmButtonText: "确定",
|
||||
cancelButtonText: "取消",
|
||||
type: "warning"
|
||||
}).then(() => {
|
||||
return authUserCancelAll({ roleId: roleId, userIds: userIds });
|
||||
}).then(() => {
|
||||
this.getList();
|
||||
this.msgSuccess("取消授权成功");
|
||||
}).catch(() => {});
|
||||
this.$msgbox({
|
||||
title: '警告',
|
||||
message: '是否取消选中用户授权数据项?',
|
||||
type: "warning",
|
||||
showCancelButton: true,
|
||||
confirmButtonText: '确定',
|
||||
cancelButtonText: '取消',
|
||||
beforeClose: (action, instance, done) => {
|
||||
if (action === 'confirm') {
|
||||
instance.confirmButtonLoading = true;
|
||||
instance.confirmButtonText = '取消中...';
|
||||
authUserCancelAll({ roleId: roleId, userIds: userIds }).then(() => {
|
||||
instance.confirmButtonLoading = false;
|
||||
done();
|
||||
this.getList();
|
||||
this.msgSuccess("取消授权成功");
|
||||
}).catch(()=>{})
|
||||
} else {
|
||||
done();
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
};
|
||||
|
|
|
|||
|
|
@ -95,6 +95,7 @@
|
|||
icon="el-icon-download"
|
||||
size="mini"
|
||||
@click="handleExport"
|
||||
:loading="exportLoading"
|
||||
v-hasPermi="['system:role:export']"
|
||||
>导出</el-button>
|
||||
</el-col>
|
||||
|
|
@ -163,7 +164,7 @@
|
|||
|
||||
<!-- 添加或修改角色配置对话框 -->
|
||||
<el-dialog :title="title" :visible.sync="open" width="500px" append-to-body>
|
||||
<el-form ref="form" :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-input v-model="form.roleName" placeholder="请输入角色名称" />
|
||||
</el-form-item>
|
||||
|
|
@ -202,14 +203,14 @@
|
|||
</el-form-item>
|
||||
</el-form>
|
||||
<div slot="footer" class="dialog-footer">
|
||||
<el-button type="primary" @click="submitForm">确 定</el-button>
|
||||
<el-button type="primary" @click="submitForm" :loading="submitLoading">确 定</el-button>
|
||||
<el-button @click="cancel">取 消</el-button>
|
||||
</div>
|
||||
</el-dialog>
|
||||
|
||||
<!-- 分配角色数据权限对话框 -->
|
||||
<el-dialog :title="title" :visible.sync="openDataScope" width="500px" append-to-body>
|
||||
<el-form :model="form" label-width="80px">
|
||||
<el-form v-loading="dialogLoading" :model="form" label-width="80px">
|
||||
<el-form-item label="角色名称">
|
||||
<el-input v-model="form.roleName" :disabled="true" />
|
||||
</el-form-item>
|
||||
|
|
@ -244,7 +245,7 @@
|
|||
</el-form-item>
|
||||
</el-form>
|
||||
<div slot="footer" class="dialog-footer">
|
||||
<el-button type="primary" @click="submitDataScope">确 定</el-button>
|
||||
<el-button type="primary" @click="submitDataScope" :loading="submitLoading">确 定</el-button>
|
||||
<el-button @click="cancelDataScope">取 消</el-button>
|
||||
</div>
|
||||
</el-dialog>
|
||||
|
|
@ -340,7 +341,13 @@ export default {
|
|||
roleSort: [
|
||||
{ required: true, message: "角色顺序不能为空", trigger: "blur" }
|
||||
]
|
||||
}
|
||||
},
|
||||
//添加修改弹框加载中
|
||||
dialogLoading: false,
|
||||
//提交表单加载中
|
||||
submitLoading: false,
|
||||
//导出表单加载中
|
||||
exportLoading: false,
|
||||
};
|
||||
},
|
||||
created() {
|
||||
|
|
@ -355,6 +362,10 @@ export default {
|
|||
this.loading = true;
|
||||
listRole(this.addDateRange(this.queryParams, this.dateRange)).then(
|
||||
response => {
|
||||
let currentPageNum = response.total / this.queryParams.pageSize;
|
||||
if(this.queryParams.pageNum > currentPageNum){
|
||||
this.queryParams.pageNum = currentPageNum;
|
||||
}
|
||||
this.roleList = response.rows;
|
||||
this.total = response.total;
|
||||
this.loading = false;
|
||||
|
|
@ -408,17 +419,29 @@ export default {
|
|||
// 角色状态修改
|
||||
handleStatusChange(row) {
|
||||
let text = row.status === "0" ? "启用" : "停用";
|
||||
this.$confirm('确认要"' + text + '""' + row.roleName + '"角色吗?', "警告", {
|
||||
confirmButtonText: "确定",
|
||||
cancelButtonText: "取消",
|
||||
type: "warning"
|
||||
}).then(function() {
|
||||
return changeRoleStatus(row.roleId, row.status);
|
||||
}).then(() => {
|
||||
this.msgSuccess(text + "成功");
|
||||
}).catch(function() {
|
||||
row.status = row.status === "0" ? "1" : "0";
|
||||
});
|
||||
this.$msgbox({
|
||||
title: '警告',
|
||||
message: '确认要"' + text + '""' + row.roleName + '"角色吗?',
|
||||
type: "warning",
|
||||
showCancelButton: true,
|
||||
confirmButtonText: '确定',
|
||||
cancelButtonText: '取消',
|
||||
beforeClose: (action, instance, done) => {
|
||||
if (action === 'confirm') {
|
||||
instance.confirmButtonLoading = true;
|
||||
instance.confirmButtonText = text + '中...';
|
||||
changeRoleStatus(row.roleId, row.status).then(() => {
|
||||
this.msgSuccess(text + "成功");
|
||||
}).catch(()=>{}).finally(()=>{
|
||||
done();
|
||||
instance.confirmButtonLoading = false;
|
||||
});
|
||||
} else {
|
||||
row.status = row.status === "0" ? "1" : "0";
|
||||
done();
|
||||
}
|
||||
}
|
||||
});
|
||||
},
|
||||
// 取消按钮
|
||||
cancel() {
|
||||
|
|
@ -523,11 +546,14 @@ export default {
|
|||
/** 修改按钮操作 */
|
||||
handleUpdate(row) {
|
||||
this.reset();
|
||||
this.title = "修改角色";
|
||||
this.open = true;
|
||||
this.submitLoading = true;
|
||||
this.dialogLoading = true;
|
||||
const roleId = row.roleId || this.ids
|
||||
const roleMenu = this.getRoleMenuTreeselect(roleId);
|
||||
getRole(roleId).then(response => {
|
||||
this.form = response.data;
|
||||
this.open = true;
|
||||
this.$nextTick(() => {
|
||||
roleMenu.then(res => {
|
||||
let checkedKeys = res.checkedKeys
|
||||
|
|
@ -538,7 +564,9 @@ export default {
|
|||
})
|
||||
});
|
||||
});
|
||||
this.title = "修改角色";
|
||||
}).finally(()=>{
|
||||
this.submitLoading = false;
|
||||
this.dialogLoading = false;
|
||||
});
|
||||
},
|
||||
/** 选择角色权限范围触发 */
|
||||
|
|
@ -550,16 +578,21 @@ export default {
|
|||
/** 分配数据权限操作 */
|
||||
handleDataScope(row) {
|
||||
this.reset();
|
||||
this.title = "分配数据权限";
|
||||
this.openDataScope = true;
|
||||
this.submitLoading = true;
|
||||
this.dialogLoading = true;
|
||||
const roleDeptTreeselect = this.getRoleDeptTreeselect(row.roleId);
|
||||
getRole(row.roleId).then(response => {
|
||||
this.form = response.data;
|
||||
this.openDataScope = true;
|
||||
this.$nextTick(() => {
|
||||
roleDeptTreeselect.then(res => {
|
||||
this.$refs.dept.setCheckedKeys(res.checkedKeys);
|
||||
});
|
||||
});
|
||||
this.title = "分配数据权限";
|
||||
}).finally(()=>{
|
||||
this.submitLoading = false;
|
||||
this.dialogLoading = false;
|
||||
});
|
||||
},
|
||||
/** 分配用户操作 */
|
||||
|
|
@ -571,12 +604,15 @@ export default {
|
|||
submitForm: function() {
|
||||
this.$refs["form"].validate(valid => {
|
||||
if (valid) {
|
||||
this.submitLoading = true;
|
||||
if (this.form.roleId != undefined) {
|
||||
this.form.menuIds = this.getMenuAllCheckedKeys();
|
||||
updateRole(this.form).then(response => {
|
||||
this.msgSuccess("修改成功");
|
||||
this.open = false;
|
||||
this.getList();
|
||||
}).finally(() => {
|
||||
this.submitLoading = false;
|
||||
});
|
||||
} else {
|
||||
this.form.menuIds = this.getMenuAllCheckedKeys();
|
||||
|
|
@ -584,6 +620,8 @@ export default {
|
|||
this.msgSuccess("新增成功");
|
||||
this.open = false;
|
||||
this.getList();
|
||||
}).finally(() => {
|
||||
this.submitLoading = false;
|
||||
});
|
||||
}
|
||||
}
|
||||
|
|
@ -592,33 +630,54 @@ export default {
|
|||
/** 提交按钮(数据权限) */
|
||||
submitDataScope: function() {
|
||||
if (this.form.roleId != undefined) {
|
||||
this.submitLoading = true;
|
||||
this.form.deptIds = this.getDeptAllCheckedKeys();
|
||||
dataScope(this.form).then(response => {
|
||||
this.msgSuccess("修改成功");
|
||||
this.openDataScope = false;
|
||||
this.getList();
|
||||
}).finally(() => {
|
||||
this.submitLoading = false;
|
||||
});
|
||||
}
|
||||
},
|
||||
/** 删除按钮操作 */
|
||||
handleDelete(row) {
|
||||
const roleIds = row.roleId || this.ids;
|
||||
this.$confirm('是否确认删除角色编号为"' + roleIds + '"的数据项?', "警告", {
|
||||
confirmButtonText: "确定",
|
||||
cancelButtonText: "取消",
|
||||
type: "warning"
|
||||
}).then(function() {
|
||||
return delRole(roleIds);
|
||||
}).then(() => {
|
||||
this.getList();
|
||||
this.msgSuccess("删除成功");
|
||||
}).catch(() => {});
|
||||
this.$msgbox({
|
||||
title: '警告',
|
||||
message: '是否确认删除角色编号为"' + roleIds + '"的数据项?',
|
||||
type: "warning",
|
||||
showCancelButton: true,
|
||||
confirmButtonText: '确定',
|
||||
cancelButtonText: '取消',
|
||||
beforeClose: (action, instance, done) => {
|
||||
if (action === 'confirm') {
|
||||
instance.confirmButtonLoading = true;
|
||||
instance.confirmButtonText = '删除中...';
|
||||
delRole(roleIds).then(() => {
|
||||
this.getList();
|
||||
this.msgSuccess("删除成功");
|
||||
}).catch(()=>{}).finally(()=>{
|
||||
done();
|
||||
instance.confirmButtonLoading = false;
|
||||
});
|
||||
} else {
|
||||
done();
|
||||
}
|
||||
}
|
||||
});
|
||||
},
|
||||
/** 导出按钮操作 */
|
||||
handleExport() {
|
||||
this.exportLoading = true;
|
||||
this.download('system/role/export', {
|
||||
...this.queryParams
|
||||
}, `role_${new Date().getTime()}.xlsx`)
|
||||
}, `role_${new Date().getTime()}.xlsx`).then(()=>{
|
||||
|
||||
}).finally(()=>{
|
||||
this.exportLoading = false;
|
||||
});
|
||||
}
|
||||
}
|
||||
};
|
||||
|
|
|
|||
|
|
@ -1,7 +1,7 @@
|
|||
<template>
|
||||
<!-- 授权用户 -->
|
||||
<el-dialog title="选择用户" :visible.sync="visible" width="800px" top="5vh" append-to-body>
|
||||
<el-form :model="queryParams" ref="queryForm" :inline="true">
|
||||
<el-form :model="queryParams" v-loading="dialogLoading" ref="queryForm" :inline="true">
|
||||
<el-form-item label="用户名称" prop="userName">
|
||||
<el-input
|
||||
v-model="queryParams.userName"
|
||||
|
|
@ -52,7 +52,7 @@
|
|||
/>
|
||||
</el-row>
|
||||
<div slot="footer" class="dialog-footer">
|
||||
<el-button type="primary" @click="handleSelectUser">确 定</el-button>
|
||||
<el-button type="primary" @click="handleSelectUser" :loading="submitLoading">确 定</el-button>
|
||||
<el-button @click="visible = false">取 消</el-button>
|
||||
</div>
|
||||
</el-dialog>
|
||||
|
|
@ -86,7 +86,11 @@ export default {
|
|||
roleId: undefined,
|
||||
userName: undefined,
|
||||
phonenumber: undefined
|
||||
}
|
||||
},
|
||||
//添加修改弹框加载中
|
||||
dialogLoading: false,
|
||||
//提交表单加载中
|
||||
submitLoading: false,
|
||||
};
|
||||
},
|
||||
created() {
|
||||
|
|
@ -111,6 +115,10 @@ export default {
|
|||
// 查询表数据
|
||||
getList() {
|
||||
unallocatedUserList(this.queryParams).then(res => {
|
||||
let currentPageNum = response.total / this.queryParams.pageSize;
|
||||
if(this.queryParams.pageNum > currentPageNum){
|
||||
this.queryParams.pageNum = currentPageNum;
|
||||
}
|
||||
this.userList = res.rows;
|
||||
this.total = res.total;
|
||||
});
|
||||
|
|
@ -127,6 +135,7 @@ export default {
|
|||
},
|
||||
/** 选择授权用户操作 */
|
||||
handleSelectUser() {
|
||||
this.submitLoading = true;
|
||||
const roleId = this.queryParams.roleId;
|
||||
const userIds = this.userIds.join(",");
|
||||
authUserSelectAll({ roleId: roleId, userIds: userIds }).then(res => {
|
||||
|
|
@ -135,6 +144,8 @@ export default {
|
|||
this.visible = false;
|
||||
this.$emit("ok");
|
||||
}
|
||||
}).finally(()=>{
|
||||
this.submitLoading = false;
|
||||
});
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -38,7 +38,7 @@
|
|||
|
||||
<el-form label-width="100px">
|
||||
<el-form-item style="text-align: center;margin-left:-120px;margin-top:30px;">
|
||||
<el-button type="primary" @click="submitForm()">提交</el-button>
|
||||
<el-button type="primary" @click="submitForm()" :loading="submitLoading">提交</el-button>
|
||||
<el-button @click="close()">返回</el-button>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
|
|
@ -63,7 +63,9 @@ export default {
|
|||
// 角色信息
|
||||
roles: [],
|
||||
// 用户信息
|
||||
form: {}
|
||||
form: {},
|
||||
//提交表单加载中
|
||||
submitLoading: false
|
||||
};
|
||||
},
|
||||
created() {
|
||||
|
|
@ -102,9 +104,12 @@ export default {
|
|||
submitForm() {
|
||||
const userId = this.form.userId;
|
||||
const roleIds = this.roleIds.join(",");
|
||||
this.submitLoading = true;
|
||||
updateAuthRole({ userId: userId, roleIds: roleIds }).then((response) => {
|
||||
this.msgSuccess("授权成功");
|
||||
this.close();
|
||||
}).finally(()=>{
|
||||
this.submitLoading = false;
|
||||
});
|
||||
},
|
||||
/** 关闭按钮 */
|
||||
|
|
|
|||
|
|
@ -27,7 +27,7 @@
|
|||
</el-col>
|
||||
<!--用户数据-->
|
||||
<el-col :span="20" :xs="24">
|
||||
<el-form :model="queryParams" ref="queryForm" :inline="true" v-show="showSearch" label-width="68px">
|
||||
<el-form :model="queryParams" ref="queryForm" :inline="true" v-show="showSearch" label-width="70px">
|
||||
<el-form-item label="用户名称" prop="userName">
|
||||
<el-input
|
||||
v-model="queryParams.userName"
|
||||
|
|
@ -132,6 +132,7 @@
|
|||
icon="el-icon-download"
|
||||
size="mini"
|
||||
@click="handleExport"
|
||||
:loading="exportLoading"
|
||||
v-hasPermi="['system:user:export']"
|
||||
>导出</el-button>
|
||||
</el-col>
|
||||
|
|
@ -208,7 +209,7 @@
|
|||
|
||||
<!-- 添加或修改参数配置对话框 -->
|
||||
<el-dialog :title="title" :visible.sync="open" width="600px" append-to-body>
|
||||
<el-form ref="form" :model="form" :rules="rules" label-width="80px">
|
||||
<el-form ref="form" v-loading="dialogLoading" :model="form" :rules="rules" label-width="80px">
|
||||
<el-row>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="用户昵称" prop="nickName">
|
||||
|
|
@ -307,7 +308,7 @@
|
|||
</el-row>
|
||||
</el-form>
|
||||
<div slot="footer" class="dialog-footer">
|
||||
<el-button type="primary" @click="submitForm">确 定</el-button>
|
||||
<el-button type="primary" @click="submitForm" :loading="submitLoading">确 定</el-button>
|
||||
<el-button @click="cancel">取 消</el-button>
|
||||
</div>
|
||||
</el-dialog>
|
||||
|
|
@ -323,6 +324,7 @@
|
|||
:disabled="upload.isUploading"
|
||||
:on-progress="handleFileUploadProgress"
|
||||
:on-success="handleFileSuccess"
|
||||
:on-error="handleFileError"
|
||||
:auto-upload="false"
|
||||
drag
|
||||
>
|
||||
|
|
@ -338,7 +340,7 @@
|
|||
<div class="el-upload__tip" style="color:red" slot="tip">提示:仅允许导入“xls”或“xlsx”格式文件!</div>
|
||||
</el-upload>
|
||||
<div slot="footer" class="dialog-footer">
|
||||
<el-button type="primary" @click="submitFileForm">确 定</el-button>
|
||||
<el-button type="primary" @click="submitFileForm" :loading="importLoading">确 定</el-button>
|
||||
<el-button @click="upload.open = false">取 消</el-button>
|
||||
</div>
|
||||
</el-dialog>
|
||||
|
|
@ -351,6 +353,7 @@ import { getToken } from "@/utils/auth";
|
|||
import { treeselect } from "@/api/system/dept";
|
||||
import Treeselect from "@riophae/vue-treeselect";
|
||||
import "@riophae/vue-treeselect/dist/vue-treeselect.css";
|
||||
import {authUserCancelAll} from "@/api/system/role";
|
||||
|
||||
export default {
|
||||
name: "User",
|
||||
|
|
@ -457,7 +460,15 @@ export default {
|
|||
trigger: "blur"
|
||||
}
|
||||
]
|
||||
}
|
||||
},
|
||||
//添加修改弹框加载中
|
||||
dialogLoading: false,
|
||||
//提交表单加载中
|
||||
submitLoading: false,
|
||||
//导出表单加载中
|
||||
exportLoading: false,
|
||||
//导入表单加载中
|
||||
importLoading: false
|
||||
};
|
||||
},
|
||||
watch: {
|
||||
|
|
@ -484,11 +495,14 @@ export default {
|
|||
getList() {
|
||||
this.loading = true;
|
||||
listUser(this.addDateRange(this.queryParams, this.dateRange)).then(response => {
|
||||
this.userList = response.rows;
|
||||
this.total = response.total;
|
||||
this.loading = false;
|
||||
let currentPageNum = response.total / this.queryParams.pageSize;
|
||||
if(this.queryParams.pageNum > currentPageNum){
|
||||
this.queryParams.pageNum = currentPageNum;
|
||||
}
|
||||
);
|
||||
this.userList = response.rows;
|
||||
this.total = response.total;
|
||||
this.loading = false;
|
||||
});
|
||||
},
|
||||
/** 查询部门下拉树结构 */
|
||||
getTreeselect() {
|
||||
|
|
@ -509,17 +523,29 @@ export default {
|
|||
// 用户状态修改
|
||||
handleStatusChange(row) {
|
||||
let text = row.status === "0" ? "启用" : "停用";
|
||||
this.$confirm('确认要"' + text + '""' + row.userName + '"用户吗?', "警告", {
|
||||
confirmButtonText: "确定",
|
||||
cancelButtonText: "取消",
|
||||
type: "warning"
|
||||
}).then(function() {
|
||||
return changeUserStatus(row.userId, row.status);
|
||||
}).then(() => {
|
||||
this.msgSuccess(text + "成功");
|
||||
}).catch(function() {
|
||||
row.status = row.status === "0" ? "1" : "0";
|
||||
});
|
||||
this.$msgbox({
|
||||
title: '警告',
|
||||
message: '确认要"' + text + '""' + row.userName + '"用户吗?',
|
||||
type: "warning",
|
||||
showCancelButton: true,
|
||||
confirmButtonText: '确定',
|
||||
cancelButtonText: '取消',
|
||||
beforeClose: (action, instance, done) => {
|
||||
if (action === 'confirm') {
|
||||
instance.confirmButtonLoading = true;
|
||||
instance.confirmButtonText = text + '中...';
|
||||
changeUserStatus(row.userId, row.status).then(() => {
|
||||
this.msgSuccess(text + "成功");
|
||||
}).catch(()=>{}).finally(()=>{
|
||||
done();
|
||||
instance.confirmButtonLoading = false;
|
||||
});
|
||||
} else {
|
||||
row.status = row.status === "0" ? "1" : "0";
|
||||
done();
|
||||
}
|
||||
}
|
||||
});
|
||||
},
|
||||
// 取消按钮
|
||||
cancel() {
|
||||
|
|
@ -578,12 +604,17 @@ export default {
|
|||
handleAdd() {
|
||||
this.reset();
|
||||
this.getTreeselect();
|
||||
this.title = "添加用户";
|
||||
this.open = true;
|
||||
this.submitLoading = true;
|
||||
this.dialogLoading = true;
|
||||
getUser().then(response => {
|
||||
this.postOptions = response.posts;
|
||||
this.roleOptions = response.roles;
|
||||
this.open = true;
|
||||
this.title = "添加用户";
|
||||
this.form.password = this.initPassword;
|
||||
}).finally(()=>{
|
||||
this.dialogLoading = false;
|
||||
this.submitLoading = false;
|
||||
});
|
||||
},
|
||||
/** 修改按钮操作 */
|
||||
|
|
@ -591,15 +622,20 @@ export default {
|
|||
this.reset();
|
||||
this.getTreeselect();
|
||||
const userId = row.userId || this.ids;
|
||||
this.title = "修改用户";
|
||||
this.open = true;
|
||||
this.submitLoading = true;
|
||||
this.dialogLoading = true;
|
||||
getUser(userId).then(response => {
|
||||
this.form = response.data;
|
||||
this.postOptions = response.posts;
|
||||
this.roleOptions = response.roles;
|
||||
this.form.postIds = response.postIds;
|
||||
this.form.roleIds = response.roleIds;
|
||||
this.open = true;
|
||||
this.title = "修改用户";
|
||||
this.form.password = "";
|
||||
}).finally(()=>{
|
||||
this.dialogLoading = false;
|
||||
this.submitLoading = false;
|
||||
});
|
||||
},
|
||||
/** 重置密码按钮操作 */
|
||||
|
|
@ -625,17 +661,22 @@ export default {
|
|||
submitForm: function() {
|
||||
this.$refs["form"].validate(valid => {
|
||||
if (valid) {
|
||||
if (this.form.userId != undefined) {
|
||||
this.submitLoading = true;
|
||||
if (this.form.userId !== undefined) {
|
||||
updateUser(this.form).then(response => {
|
||||
this.msgSuccess("修改成功");
|
||||
this.open = false;
|
||||
this.getList();
|
||||
}).finally(() => {
|
||||
this.submitLoading = false;
|
||||
});
|
||||
} else {
|
||||
addUser(this.form).then(response => {
|
||||
this.msgSuccess("新增成功");
|
||||
this.open = false;
|
||||
this.getList();
|
||||
}).finally(() => {
|
||||
this.submitLoading = false;
|
||||
});
|
||||
}
|
||||
}
|
||||
|
|
@ -657,9 +698,14 @@ export default {
|
|||
},
|
||||
/** 导出按钮操作 */
|
||||
handleExport() {
|
||||
this.exportLoading = true;
|
||||
this.download('system/user/export', {
|
||||
...this.queryParams
|
||||
}, `user_${new Date().getTime()}.xlsx`)
|
||||
}, `user_${new Date().getTime()}.xlsx`).then(()=>{
|
||||
|
||||
}).finally(()=>{
|
||||
this.exportLoading = false;
|
||||
});
|
||||
},
|
||||
/** 导入按钮操作 */
|
||||
handleImport() {
|
||||
|
|
@ -680,12 +726,19 @@ export default {
|
|||
handleFileSuccess(response, file, fileList) {
|
||||
this.upload.open = false;
|
||||
this.upload.isUploading = false;
|
||||
this.importLoading = false;
|
||||
this.$refs.upload.clearFiles();
|
||||
this.$alert(response.msg, "导入结果", { dangerouslyUseHTMLString: true });
|
||||
this.getList();
|
||||
},
|
||||
// 文件上传错误处理
|
||||
handleFileError(err, file, fileList) {
|
||||
this.upload.isUploading = false;
|
||||
this.importLoading = false;
|
||||
},
|
||||
// 提交上传文件
|
||||
submitFileForm() {
|
||||
this.importLoading = true;
|
||||
this.$refs.upload.submit();
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -10,7 +10,7 @@
|
|||
<el-input v-model="user.confirmPassword" placeholder="请确认密码" type="password" />
|
||||
</el-form-item>
|
||||
<el-form-item>
|
||||
<el-button type="primary" size="mini" @click="submit">保存</el-button>
|
||||
<el-button type="primary" size="mini" @click="submit" :loading="resetPwdLoading">保存</el-button>
|
||||
<el-button type="danger" size="mini" @click="close">关闭</el-button>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
|
|
@ -48,18 +48,30 @@ export default {
|
|||
{ required: true, message: "确认密码不能为空", trigger: "blur" },
|
||||
{ required: true, validator: equalToPassword, trigger: "blur" }
|
||||
]
|
||||
}
|
||||
},
|
||||
resetPwdLoading: false
|
||||
};
|
||||
},
|
||||
methods: {
|
||||
reset() {
|
||||
this.user = {
|
||||
oldPassword: undefined,
|
||||
newPassword: undefined,
|
||||
confirmPassword: undefined
|
||||
}
|
||||
},
|
||||
submit() {
|
||||
this.$refs["form"].validate(valid => {
|
||||
if (valid) {
|
||||
this.resetPwdLoading = true;
|
||||
updateUserPwd(this.user.oldPassword, this.user.newPassword).then(
|
||||
response => {
|
||||
this.msgSuccess("修改成功");
|
||||
this.reset();
|
||||
}
|
||||
);
|
||||
).finally(() => {
|
||||
this.resetPwdLoading = false;
|
||||
});
|
||||
}
|
||||
});
|
||||
},
|
||||
|
|
|
|||
|
|
@ -16,7 +16,7 @@
|
|||
</el-radio-group>
|
||||
</el-form-item>
|
||||
<el-form-item>
|
||||
<el-button type="primary" size="mini" @click="submit">保存</el-button>
|
||||
<el-button type="primary" size="mini" @click="submit" :loading="updateInfoLoading">保存</el-button>
|
||||
<el-button type="danger" size="mini" @click="close">关闭</el-button>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
|
|
@ -54,15 +54,19 @@ export default {
|
|||
trigger: "blur"
|
||||
}
|
||||
]
|
||||
}
|
||||
},
|
||||
updateInfoLoading: false
|
||||
};
|
||||
},
|
||||
methods: {
|
||||
submit() {
|
||||
this.$refs["form"].validate(valid => {
|
||||
if (valid) {
|
||||
this.updateInfoLoading = true;
|
||||
updateUserProfile(this.user).then(response => {
|
||||
this.msgSuccess("修改成功");
|
||||
}).finally(() => {
|
||||
this.updateInfoLoading = false;
|
||||
});
|
||||
}
|
||||
});
|
||||
|
|
|
|||
|
|
@ -87,6 +87,10 @@ export default {
|
|||
getList() {
|
||||
listDbTable(this.queryParams).then(res => {
|
||||
if (res.code === 200) {
|
||||
let currentPageNum = response.total / this.queryParams.pageSize;
|
||||
if(this.queryParams.pageNum > currentPageNum){
|
||||
this.queryParams.pageNum = currentPageNum;
|
||||
}
|
||||
this.dbTableList = res.rows;
|
||||
this.total = res.total;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
<template>
|
||||
<div class="app-container">
|
||||
<el-form :model="queryParams" ref="queryForm" :inline="true" v-show="showSearch" label-width="68px">
|
||||
<el-form :model="queryParams" ref="queryForm" :inline="true" v-show="showSearch" label-width="70px">
|
||||
<el-form-item label="表名称" prop="tableName">
|
||||
<el-input
|
||||
v-model="queryParams.tableName"
|
||||
|
|
@ -246,11 +246,14 @@ export default {
|
|||
getList() {
|
||||
this.loading = true;
|
||||
listTable(this.addDateRange(this.queryParams, this.dateRange)).then(response => {
|
||||
this.tableList = response.rows;
|
||||
this.total = response.total;
|
||||
this.loading = false;
|
||||
let currentPageNum = response.total / this.queryParams.pageSize;
|
||||
if(this.queryParams.pageNum > currentPageNum){
|
||||
this.queryParams.pageNum = currentPageNum;
|
||||
}
|
||||
);
|
||||
this.tableList = response.rows;
|
||||
this.total = response.total;
|
||||
this.loading = false;
|
||||
});
|
||||
},
|
||||
/** 搜索按钮操作 */
|
||||
handleQuery() {
|
||||
|
|
|
|||
Loading…
Reference in New Issue