system config

This commit is contained in:
ailanyin
2023-05-25 13:57:05 +08:00
parent e917582ea7
commit b028c3ae87
7 changed files with 685 additions and 535 deletions

View File

@ -1,60 +1,60 @@
import request from '@/utils/request' import request from "@/utils/request";
// 查询参数列表 // 查询参数列表
export function listConfig(query) { export function listConfig(query) {
return request({ return request({
url: '/system/config/list', url: "/system/config/list",
method: 'get', method: "get",
params: query params: query,
}) });
} }
// 查询参数详细 // 查询参数详细
export function getConfig(configId) { export function getConfig(configId) {
return request({ return request({
url: '/system/config/' + configId, url: "/system/config/" + configId,
method: 'get' method: "get",
}) });
} }
// 根据参数键名查询参数值 // 根据参数键名查询参数值
export function getConfigKey(configKey) { export function getConfigKey(configKey) {
return request({ return request({
url: '/system/config/configKey/' + configKey, url: "/system/config/configKey/" + configKey,
method: 'get' method: "get",
}) });
} }
// 新增参数配置 // 新增参数配置
export function addConfig(data) { export function addConfig(data) {
return request({ return request({
url: '/system/config', url: "/system/config",
method: 'post', method: "post",
data: data data: data,
}) });
} }
// 修改参数配置 // 修改参数配置
export function updateConfig(data) { export function updateConfig(data) {
return request({ return request({
url: '/system/config', url: "/system/config",
method: 'put', method: "put",
data: data data: data,
}) });
} }
// 删除参数配置 // 删除参数配置
export function delConfig(configId) { export function delConfig(configId) {
return request({ return request({
url: '/system/config/' + configId, url: "/system/config/" + configId,
method: 'delete' method: "delete",
}) });
} }
// 刷新参数缓存 // 刷新参数缓存
export function refreshCache() { export function refreshCache() {
return request({ return request({
url: '/system/config/refreshCache', url: "/system/config/refreshCache",
method: 'delete' method: "delete",
}) });
} }

View File

@ -14,15 +14,15 @@ export const sys_normal_disable = [
export const sys_user_gender = [ export const sys_user_gender = [
{ {
label: "男", label: "男",
value: "0" value: "0",
}, },
{ {
label: "女", label: "女",
value: "1" value: "1",
}, },
{ {
label: "未知", label: "未知",
value: "2" value: "2",
}, },
]; ];
@ -42,7 +42,7 @@ export const menu_show_hide = [
export const sys_yes_no = [ export const sys_yes_no = [
{ {
label: "否", label: "否",
value: "N" value: "N",
}, },
{ {
label: "是", label: "是",

View File

@ -85,7 +85,7 @@ const useUserStore = defineStore("user", {
}); });
}, },
}, },
persist: [{ paths: ["tenant", /*"userInfoRes"*/], storage: localStorage }], persist: [{ paths: ["tenant" /*"userInfoRes"*/], storage: localStorage }],
}); });
export default useUserStore; export default useUserStore;

View File

@ -1,11 +1,17 @@
<template> <template>
<div class="app-container"> <div class="app-container">
<el-form :model="queryParams" ref="queryRef" :inline="true" v-show="showSearch" label-width="68px"> <el-form
v-show="showSearch"
ref="queryRef"
:inline="true"
:model="queryParams"
label-width="68px"
>
<el-form-item label="参数名称" prop="configName"> <el-form-item label="参数名称" prop="configName">
<el-input <el-input
v-model="queryParams.configName" v-model="queryParams.configName"
placeholder="请输入参数名称"
clearable clearable
placeholder="请输入参数名称"
style="width: 240px" style="width: 240px"
@keyup.enter="handleQuery" @keyup.enter="handleQuery"
/> />
@ -13,14 +19,18 @@
<el-form-item label="参数键名" prop="configKey"> <el-form-item label="参数键名" prop="configKey">
<el-input <el-input
v-model="queryParams.configKey" v-model="queryParams.configKey"
placeholder="请输入参数键名"
clearable clearable
placeholder="请输入参数键名"
style="width: 240px" style="width: 240px"
@keyup.enter="handleQuery" @keyup.enter="handleQuery"
/> />
</el-form-item> </el-form-item>
<el-form-item label="系统内置" prop="configType"> <el-form-item label="系统内置" prop="configType">
<el-select v-model="queryParams.configType" placeholder="系统内置" clearable> <el-select
v-model="queryParams.configType"
clearable
placeholder="系统内置"
>
<el-option <el-option
v-for="dict in sys_yes_no" v-for="dict in sys_yes_no"
:key="dict.value" :key="dict.value"
@ -30,7 +40,9 @@
</el-select> </el-select>
</el-form-item> </el-form-item>
<el-form-item> <el-form-item>
<el-button type="primary" icon="Search" @click="handleQuery">搜索</el-button> <el-button icon="Search" type="primary" @click="handleQuery"
>搜索</el-button
>
<el-button icon="Refresh" @click="resetQuery">重置</el-button> <el-button icon="Refresh" @click="resetQuery">重置</el-button>
</el-form-item> </el-form-item>
</el-form> </el-form>
@ -38,89 +50,153 @@
<el-row :gutter="10" class="mb8"> <el-row :gutter="10" class="mb8">
<el-col :span="1.5"> <el-col :span="1.5">
<el-button <el-button
type="primary"
plain
icon="Plus"
@click="handleAdd"
v-hasPermi="['system:config:add']" v-hasPermi="['system:config:add']"
>新增</el-button> icon="Plus"
plain
type="primary"
@click="handleAdd"
>新增
</el-button>
</el-col> </el-col>
<el-col :span="1.5"> <el-col :span="1.5">
<el-button <el-button
type="success"
plain
icon="Edit"
:disabled="single"
@click="handleUpdate"
v-hasPermi="['system:config:edit']" v-hasPermi="['system:config:edit']"
>修改</el-button> :disabled="single"
icon="Edit"
plain
type="success"
@click="handleUpdate"
>修改
</el-button>
</el-col> </el-col>
<el-col :span="1.5"> <el-col :span="1.5">
<el-button <el-button
type="danger" v-hasPermi="['system:config:remove']"
plain :disabled="
multiple ||
ids.some((id) =>
configList.find(
(el) => el.configId === id && el.configType === 'Y'
)
)
"
icon="Delete" icon="Delete"
:disabled="multiple"
@click="handleDelete"
v-hasPermi="['system:config:remove']"
>删除</el-button>
</el-col>
<el-col :span="1.5">
<el-button
type="warning"
plain plain
icon="Download"
@click="handleExport"
v-hasPermi="['system:config:export']"
>导出</el-button>
</el-col>
<el-col :span="1.5">
<el-button
type="danger" type="danger"
plain @click="handleDelete"
icon="Refresh" >删除
@click="handleRefreshCache" </el-button>
v-hasPermi="['system:config:remove']"
>刷新缓存</el-button>
</el-col> </el-col>
<right-toolbar v-model:showSearch="showSearch" @queryTable="getList"></right-toolbar> <el-col :span="1.5">
<el-button
v-hasPermi="['system:config:export']"
icon="Download"
plain
type="warning"
@click="handleExport"
>导出
</el-button>
</el-col>
<el-col :span="1.5">
<el-button
v-hasPermi="['system:config:remove']"
icon="Refresh"
plain
type="danger"
@click="handleRefreshCache"
>刷新缓存
</el-button>
</el-col>
<right-toolbar
v-model:showSearch="showSearch"
@queryTable="getList"
></right-toolbar>
</el-row> </el-row>
<el-table v-loading="loading" :data="configList" @selection-change="handleSelectionChange"> <el-table
<el-table-column type="selection" width="55" align="center" /> v-loading="loading"
<el-table-column label="参数主键" align="center" prop="configId" /> :data="configList"
<el-table-column label="参数名称" align="center" prop="configName" :show-overflow-tooltip="true" /> @selection-change="handleSelectionChange"
<el-table-column label="参数键名" align="center" prop="configKey" :show-overflow-tooltip="true" /> >
<el-table-column label="参数键值" align="center" prop="configValue" :show-overflow-tooltip="true" /> <el-table-column align="center" type="selection" width="55" />
<el-table-column label="系统内置" align="center" prop="configType"> <el-table-column align="center" label="参数主键" prop="configId" />
<el-table-column
:show-overflow-tooltip="true"
align="center"
label="参数名称"
prop="configName"
/>
<el-table-column
:show-overflow-tooltip="true"
align="center"
label="参数键名"
prop="configKey"
/>
<el-table-column
:show-overflow-tooltip="true"
align="center"
label="参数键值"
prop="configValue"
/>
<el-table-column align="center" label="系统内置" prop="configType">
<template #default="scope"> <template #default="scope">
<dict-tag :options="sys_yes_no" :value="scope.row.configType" /> <dict-tag :options="sys_yes_no" :value="scope.row.configType" />
</template> </template>
</el-table-column> </el-table-column>
<el-table-column label="备注" align="center" prop="remark" :show-overflow-tooltip="true" /> <el-table-column
<el-table-column label="创建时间" align="center" prop="createTime" width="180"> :show-overflow-tooltip="true"
align="center"
label="备注"
prop="remark"
/>
<el-table-column
align="center"
label="创建时间"
prop="createTime"
width="180"
>
<template #default="scope"> <template #default="scope">
<span>{{ parseTime(scope.row.createTime) }}</span> <span>{{ parseTime(scope.row.createTime) }}</span>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column label="操作" align="center" width="150" class-name="small-padding fixed-width"> <el-table-column
align="center"
class-name="small-padding fixed-width"
label="操作"
width="150"
>
<template #default="scope"> <template #default="scope">
<el-button link type="primary" icon="Edit" @click="handleUpdate(scope.row)" v-hasPermi="['system:config:edit']" >修改</el-button> <el-button
<el-button link type="primary" icon="Delete" @click="handleDelete(scope.row)" v-hasPermi="['system:config:remove']">删除</el-button> v-hasPermi="['system:config:edit']"
icon="Edit"
link
type="primary"
@click="handleUpdate(scope.row)"
>修改
</el-button>
<el-button
v-hasPermi="['system:config:remove']"
:disabled="scope.row.configType === 'Y'"
icon="Delete"
link
type="primary"
@click="handleDelete(scope.row)"
>删除
</el-button>
</template> </template>
</el-table-column> </el-table-column>
</el-table> </el-table>
<pagination <pagination
v-show="total > 0" v-show="total > 0"
:total="total"
v-model:page="queryParams.pageNum"
v-model:limit="queryParams.pageSize" v-model:limit="queryParams.pageSize"
v-model:page="queryParams.pageNum"
:total="total"
@pagination="getList" @pagination="getList"
/> />
<!-- 添加或修改参数配置对话框 --> <!-- 添加或修改参数配置对话框 -->
<el-dialog :title="title" v-model="open" width="500px" append-to-body> <el-dialog v-model="open" :title="title" append-to-body width="500px">
<el-form ref="configRef" :model="form" :rules="rules" label-width="80px"> <el-form ref="configRef" :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="请输入参数名称" />
@ -137,11 +213,16 @@
v-for="dict in sys_yes_no" v-for="dict in sys_yes_no"
:key="dict.value" :key="dict.value"
:label="dict.value" :label="dict.value"
>{{ dict.label }}</el-radio> >{{ dict.label }}
</el-radio>
</el-radio-group> </el-radio-group>
</el-form-item> </el-form-item>
<el-form-item label="备注" prop="remark"> <el-form-item label="备注" prop="remark">
<el-input v-model="form.remark" type="textarea" placeholder="请输入内容" /> <el-input
v-model="form.remark"
placeholder="请输入内容"
type="textarea"
/>
</el-form-item> </el-form-item>
</el-form> </el-form>
<template #footer> <template #footer>
@ -154,9 +235,18 @@
</div> </div>
</template> </template>
<script setup name="Config"> <script lang="jsx" name="Config" setup>
import { listConfig, getConfig, delConfig, addConfig, updateConfig, refreshCache } from "@/api/system/config"; import {
addConfig,
delConfig,
getConfig,
listConfig,
refreshCache,
updateConfig,
} from "@/api/system/config";
import { sys_yes_no } from "@/constant/dict"; import { sys_yes_no } from "@/constant/dict";
import { ElMessageBox } from "element-plus";
const { proxy } = getCurrentInstance(); const { proxy } = getCurrentInstance();
const configList = ref([]); const configList = ref([]);
@ -177,13 +267,19 @@ const data = reactive({
pageSize: 10, pageSize: 10,
configName: undefined, configName: undefined,
configKey: undefined, configKey: undefined,
configType: undefined configType: undefined,
}, },
rules: { rules: {
configName: [{ required: true, message: "参数名称不能为空", trigger: "blur" }], configName: [
configKey: [{ required: true, message: "参数名不能为空", trigger: "blur" }], { required: true, message: "参数名不能为空", trigger: "blur" },
configValue: [{ required: true, message: "参数键值不能为空", trigger: "blur" }] ],
} configKey: [
{ required: true, message: "参数键名不能为空", trigger: "blur" },
],
configValue: [
{ required: true, message: "参数键值不能为空", trigger: "blur" },
],
},
}); });
const { queryParams, form, rules } = toRefs(data); const { queryParams, form, rules } = toRefs(data);
@ -191,17 +287,21 @@ const { queryParams, form, rules } = toRefs(data);
/** 查询参数列表 */ /** 查询参数列表 */
function getList() { function getList() {
loading.value = true; loading.value = true;
listConfig(proxy.addDateRange(queryParams.value, dateRange.value)).then(response => { listConfig(proxy.addDateRange(queryParams.value, dateRange.value)).then(
(response) => {
configList.value = response.rows; configList.value = response.rows;
total.value = response.total; total.value = response.total;
loading.value = false; loading.value = false;
}); }
);
} }
/** 取消按钮 */ /** 取消按钮 */
function cancel() { function cancel() {
open.value = false; open.value = false;
reset(); reset();
} }
/** 表单重置 */ /** 表单重置 */
function reset() { function reset() {
form.value = { form.value = {
@ -210,55 +310,61 @@ function reset() {
configKey: undefined, configKey: undefined,
configValue: undefined, configValue: undefined,
configType: "Y", configType: "Y",
remark: undefined remark: undefined,
}; };
proxy.resetForm("configRef"); proxy.resetForm("configRef");
} }
/** 搜索按钮操作 */ /** 搜索按钮操作 */
function handleQuery() { function handleQuery() {
queryParams.value.pageNum = 1; queryParams.value.pageNum = 1;
getList(); getList();
} }
/** 重置按钮操作 */ /** 重置按钮操作 */
function resetQuery() { function resetQuery() {
dateRange.value = []; dateRange.value = [];
proxy.resetForm("queryRef"); proxy.resetForm("queryRef");
handleQuery(); handleQuery();
} }
/** 多选框选中数据 */ /** 多选框选中数据 */
function handleSelectionChange(selection) { function handleSelectionChange(selection) {
ids.value = selection.map(item => item.configId); ids.value = selection.map((item) => item.configId);
single.value = selection.length != 1; single.value = selection.length != 1;
multiple.value = !selection.length; multiple.value = !selection.length;
} }
/** 新增按钮操作 */ /** 新增按钮操作 */
function handleAdd() { function handleAdd() {
reset(); reset();
open.value = true; open.value = true;
title.value = "添加参数"; title.value = "添加参数";
} }
/** 修改按钮操作 */ /** 修改按钮操作 */
function handleUpdate(row) { function handleUpdate(row) {
reset(); reset();
const configId = row.configId || ids.value; const configId = row.configId || ids.value;
getConfig(configId).then(response => { getConfig(configId).then((response) => {
form.value = response.data; form.value = response.data;
open.value = true; open.value = true;
title.value = "修改参数"; title.value = "修改参数";
}); });
} }
/** 提交按钮 */ /** 提交按钮 */
function submitForm() { function submitForm() {
proxy.$refs["configRef"].validate(valid => { proxy.$refs["configRef"].validate((valid) => {
if (valid) { if (valid) {
if (form.value.configId != undefined) { if (form.value.configId != undefined) {
updateConfig(form.value).then(response => { updateConfig(form.value).then((response) => {
proxy.$modal.msgSuccess("修改成功"); proxy.$modal.msgSuccess("修改成功");
open.value = false; open.value = false;
getList(); getList();
}); });
} else { } else {
addConfig(form.value).then(response => { addConfig(form.value).then((response) => {
proxy.$modal.msgSuccess("新增成功"); proxy.$modal.msgSuccess("新增成功");
open.value = false; open.value = false;
getList(); getList();
@ -267,22 +373,52 @@ function submitForm() {
} }
}); });
} }
/** 删除按钮操作 */ /** 删除按钮操作 */
function handleDelete(row) { function handleDelete(row) {
const configIds = row.configId || ids.value; const configIds = row.configId || ids.value;
proxy.$modal.confirm('是否确认删除参数编号为"' + configIds + '"的数据项?').then(function () { const configNames = row.configId
? [row.configName]
: configList.value
.filter((el) => configIds.includes(el.configId))
.map((el) => el.configName);
const messageVnode = () => (
<>
{configNames.map((configName, idx) => (
<el-tag
key={idx}
style={{
marginLeft: idx >= 1 ? "4px" : 0,
}}
type="warning"
>
{configName}
</el-tag>
))}
</>
);
ElMessageBox.confirm(messageVnode, "确认删除")
.then(function () {
return delConfig(configIds); return delConfig(configIds);
}).then(() => { })
.then(() => {
getList(); getList();
proxy.$modal.msgSuccess("删除成功"); proxy.$modal.msgSuccess("删除成功");
}).catch(() => {}); })
.catch(() => {});
} }
/** 导出按钮操作 */ /** 导出按钮操作 */
function handleExport() { function handleExport() {
proxy.download("system/config/export", { proxy.download(
...queryParams.value "system/config/export",
}, `config_${new Date().getTime()}.xlsx`); {
...queryParams.value,
},
`config_${new Date().getTime()}.xlsx`
);
} }
/** 刷新缓存按钮操作 */ /** 刷新缓存按钮操作 */
function handleRefreshCache() { function handleRefreshCache() {
refreshCache().then(() => { refreshCache().then(() => {

View File

@ -113,7 +113,12 @@
@selection-change="handleSelectionChange" @selection-change="handleSelectionChange"
> >
<el-table-column type="selection" width="55" align="center" /> <el-table-column type="selection" width="55" align="center" />
<el-table-column label="角色编号" prop="roleId" width="180" align="center"/> <el-table-column
label="角色编号"
prop="roleId"
width="180"
align="center"
/>
<el-table-column <el-table-column
label="角色名称" label="角色名称"
prop="roleName" prop="roleName"
@ -128,12 +133,22 @@
width="150" width="150"
align="center" align="center"
/> />
<el-table-column align="center" label="权限范围" prop="dataScope" width="140"> <el-table-column
align="center"
label="权限范围"
prop="dataScope"
width="140"
>
<template #default="{ row }"> <template #default="{ row }">
{{ dataScopeOptions.find((el) => el.value === row.dataScope)?.label }} {{ dataScopeOptions.find((el) => el.value === row.dataScope)?.label }}
</template> </template>
</el-table-column> </el-table-column>
<el-table-column align="center" label="显示顺序" prop="roleSort" width="100" /> <el-table-column
align="center"
label="显示顺序"
prop="roleSort"
width="100"
/>
<el-table-column label="状态" align="center" width="100"> <el-table-column label="状态" align="center" width="100">
<template #default="scope"> <template #default="scope">
<el-switch <el-switch

View File

@ -81,8 +81,7 @@
<el-form-item> <el-form-item>
<el-button icon="Search" type="primary" @click="handleQuery" <el-button icon="Search" type="primary" @click="handleQuery"
>搜索 >搜索
</el-button </el-button>
>
<el-button icon="Refresh" @click="resetQuery">重置</el-button> <el-button icon="Refresh" @click="resetQuery">重置</el-button>
</el-form-item> </el-form-item>
</el-form> </el-form>
@ -152,7 +151,7 @@
:data="userList" :data="userList"
@selection-change="handleSelectionChange" @selection-change="handleSelectionChange"
> >
<el-table-column align="center" type="selection" width="50"/> <el-table-column align="center" type="selection" width="50" />
<el-table-column <el-table-column
v-if="columns[0].visible" v-if="columns[0].visible"
key="userId" key="userId"
@ -460,18 +459,21 @@
drag drag
> >
<el-icon class="el-icon--upload"> <el-icon class="el-icon--upload">
<upload-filled/> <upload-filled />
</el-icon> </el-icon>
<div class="el-upload__text">将文件拖到此处<em>点击上传</em></div> <div class="el-upload__text">将文件拖到此处<em>点击上传</em></div>
<template #tip> <template #tip>
<div class="el-upload__tip text-center"> <div class="el-upload__tip text-center">
<ol style="text-align: start;margin-left: 20px;"> <ol style="text-align: start; margin-left: 20px">
<li>(*)为必填项</li> <li>(*)为必填项</li>
<li>部门,角色,岗位请填数字编号</li> <li>部门,角色,岗位请填数字编号</li>
<li>角色,岗位若存在多个,请以英文逗号隔开</li> <li>角色,岗位若存在多个,请以英文逗号隔开</li>
<li>禁止任何的换行或空格</li> <li>禁止任何的换行或空格</li>
<li style="color:#F00;font-size:13px;">请手动更改单元格格式为文本格式</li> <li style="color: #f00; font-size: 13px">
<li><span>仅允许导入xlsxlsx格式文件</span> 请手动更改单元格格式为文本格式
</li>
<li>
<span>仅允许导入xlsxlsx格式文件</span>
<el-link <el-link
:underline="false" :underline="false"
style="font-size: 12px; vertical-align: baseline" style="font-size: 12px; vertical-align: baseline"
@ -481,7 +483,6 @@
</el-link> </el-link>
</li> </li>
</ol> </ol>
</div> </div>
</template> </template>
</el-upload> </el-upload>
@ -496,7 +497,7 @@
</template> </template>
<script lang="jsx" name="User" setup> <script lang="jsx" name="User" setup>
import {getToken} from "@/utils/auth"; import { getToken } from "@/utils/auth";
import { import {
addUser, addUser,
changeUserStatus, changeUserStatus,
@ -507,11 +508,11 @@ import {
resetUserPwd, resetUserPwd,
updateUser, updateUser,
} from "@/api/system/user"; } from "@/api/system/user";
import {sys_normal_disable, sys_user_gender} from "@/constant/dict"; import { sys_normal_disable, sys_user_gender } from "@/constant/dict";
import {ElMessageBox} from "element-plus"; import { ElMessageBox } from "element-plus";
const router = useRouter(); const router = useRouter();
const {proxy} = getCurrentInstance(); const { proxy } = getCurrentInstance();
const userList = ref([]); const userList = ref([]);
const open = ref(false); const open = ref(false);
@ -539,19 +540,19 @@ const upload = reactive({
// 是否更新已经存在的用户数据 // 是否更新已经存在的用户数据
updateSupport: 0, updateSupport: 0,
// 设置上传的请求头部 // 设置上传的请求头部
headers: {Authorization: "Bearer " + getToken()}, headers: { Authorization: "Bearer " + getToken() },
// 上传的地址 // 上传的地址
url: import.meta.env.VITE_APP_BASE_API + "/system/user/importData", url: import.meta.env.VITE_APP_BASE_API + "/system/user/importData",
}); });
// 列显隐信息 // 列显隐信息
const columns = ref([ const columns = ref([
{key: 0, label: `用户编号`, visible: true}, { key: 0, label: `用户编号`, visible: true },
{key: 1, label: `登录账号`, visible: true}, { key: 1, label: `登录账号`, visible: true },
{key: 2, label: `姓名`, visible: true}, { key: 2, label: `姓名`, visible: true },
{key: 3, label: `部门`, visible: true}, { key: 3, label: `部门`, visible: true },
{key: 4, label: `手机号码`, visible: true}, { key: 4, label: `手机号码`, visible: true },
{key: 5, label: `状态`, visible: true}, { key: 5, label: `状态`, visible: true },
{key: 6, label: `创建时间`, visible: true}, { key: 6, label: `创建时间`, visible: true },
]); ]);
const data = reactive({ const data = reactive({
@ -566,7 +567,7 @@ const data = reactive({
}, },
rules: { rules: {
userName: [ userName: [
{required: true, message: "登录账号不能为空", trigger: "blur"}, { required: true, message: "登录账号不能为空", trigger: "blur" },
{ {
min: 2, min: 2,
max: 20, max: 20,
@ -574,9 +575,9 @@ const data = reactive({
trigger: "blur", trigger: "blur",
}, },
], ],
nickName: [{required: true, message: "姓名不能为空", trigger: "blur"}], nickName: [{ required: true, message: "姓名不能为空", trigger: "blur" }],
password: [ password: [
{required: true, message: "登录密码不能为空", trigger: "blur"}, { required: true, message: "登录密码不能为空", trigger: "blur" },
{ {
min: 5, min: 5,
max: 20, max: 20,
@ -601,7 +602,7 @@ const data = reactive({
}, },
}); });
const {queryParams, form, rules} = toRefs(data); const { queryParams, form, rules } = toRefs(data);
/** 通过条件过滤节点 */ /** 通过条件过滤节点 */
const filterNode = (value, data) => { const filterNode = (value, data) => {
@ -688,8 +689,7 @@ function handleDelete(row) {
getList(); getList();
proxy.$modal.msgSuccess("删除成功"); proxy.$modal.msgSuccess("删除成功");
}) })
.catch(() => { .catch(() => {});
});
} }
/** 导出按钮操作 */ /** 导出按钮操作 */
@ -749,13 +749,12 @@ function handleResetPwd(row) {
inputPattern: /^.{5,20}$/, inputPattern: /^.{5,20}$/,
inputErrorMessage: "登录密码长度必须介于 5 和 20 之间", inputErrorMessage: "登录密码长度必须介于 5 和 20 之间",
}) })
.then(({value}) => { .then(({ value }) => {
resetUserPwd(row.userId, value).then((response) => { resetUserPwd(row.userId, value).then((response) => {
proxy.$modal.msgSuccess("修改成功,新密码是:" + value); proxy.$modal.msgSuccess("修改成功,新密码是:" + value);
}); });
}) })
.catch(() => { .catch(() => {});
});
} }
/** 选择条数 */ /** 选择条数 */
@ -794,7 +793,7 @@ const handleFileSuccess = (response, file, fileList) => {
response.msg + response.msg +
"</div>", "</div>",
"导入结果", "导入结果",
{dangerouslyUseHTMLString: true} { dangerouslyUseHTMLString: true }
); );
getList(); getList();
}; };

View File

@ -27,7 +27,7 @@
</li> </li>
<li class="list-group-item"> <li class="list-group-item">
<svg-icon icon-class="tree" />所在岗位 <svg-icon icon-class="tree" />所在岗位
<div class="pull-right" > <div class="pull-right">
{{ state.postGroup }} {{ state.postGroup }}
</div> </div>
</li> </li>