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