system config
This commit is contained in:
@ -1,60 +1,60 @@
|
||||
import request from '@/utils/request'
|
||||
import request from "@/utils/request";
|
||||
|
||||
// 查询参数列表
|
||||
export function listConfig(query) {
|
||||
return request({
|
||||
url: '/system/config/list',
|
||||
method: 'get',
|
||||
params: query
|
||||
})
|
||||
url: "/system/config/list",
|
||||
method: "get",
|
||||
params: query,
|
||||
});
|
||||
}
|
||||
|
||||
// 查询参数详细
|
||||
export function getConfig(configId) {
|
||||
return request({
|
||||
url: '/system/config/' + configId,
|
||||
method: 'get'
|
||||
})
|
||||
url: "/system/config/" + configId,
|
||||
method: "get",
|
||||
});
|
||||
}
|
||||
|
||||
// 根据参数键名查询参数值
|
||||
export function getConfigKey(configKey) {
|
||||
return request({
|
||||
url: '/system/config/configKey/' + configKey,
|
||||
method: 'get'
|
||||
})
|
||||
url: "/system/config/configKey/" + configKey,
|
||||
method: "get",
|
||||
});
|
||||
}
|
||||
|
||||
// 新增参数配置
|
||||
export function addConfig(data) {
|
||||
return request({
|
||||
url: '/system/config',
|
||||
method: 'post',
|
||||
data: data
|
||||
})
|
||||
url: "/system/config",
|
||||
method: "post",
|
||||
data: data,
|
||||
});
|
||||
}
|
||||
|
||||
// 修改参数配置
|
||||
export function updateConfig(data) {
|
||||
return request({
|
||||
url: '/system/config',
|
||||
method: 'put',
|
||||
data: data
|
||||
})
|
||||
url: "/system/config",
|
||||
method: "put",
|
||||
data: data,
|
||||
});
|
||||
}
|
||||
|
||||
// 删除参数配置
|
||||
export function delConfig(configId) {
|
||||
return request({
|
||||
url: '/system/config/' + configId,
|
||||
method: 'delete'
|
||||
})
|
||||
url: "/system/config/" + configId,
|
||||
method: "delete",
|
||||
});
|
||||
}
|
||||
|
||||
// 刷新参数缓存
|
||||
export function refreshCache() {
|
||||
return request({
|
||||
url: '/system/config/refreshCache',
|
||||
method: 'delete'
|
||||
})
|
||||
url: "/system/config/refreshCache",
|
||||
method: "delete",
|
||||
});
|
||||
}
|
||||
|
@ -14,15 +14,15 @@ export const sys_normal_disable = [
|
||||
export const sys_user_gender = [
|
||||
{
|
||||
label: "男",
|
||||
value: "0"
|
||||
value: "0",
|
||||
},
|
||||
{
|
||||
label: "女",
|
||||
value: "1"
|
||||
value: "1",
|
||||
},
|
||||
{
|
||||
label: "未知",
|
||||
value: "2"
|
||||
value: "2",
|
||||
},
|
||||
];
|
||||
|
||||
@ -42,7 +42,7 @@ export const menu_show_hide = [
|
||||
export const sys_yes_no = [
|
||||
{
|
||||
label: "否",
|
||||
value: "N"
|
||||
value: "N",
|
||||
},
|
||||
{
|
||||
label: "是",
|
||||
|
@ -85,7 +85,7 @@ const useUserStore = defineStore("user", {
|
||||
});
|
||||
},
|
||||
},
|
||||
persist: [{ paths: ["tenant", /*"userInfoRes"*/], storage: localStorage }],
|
||||
persist: [{ paths: ["tenant" /*"userInfoRes"*/], storage: localStorage }],
|
||||
});
|
||||
|
||||
export default useUserStore;
|
||||
|
@ -1,11 +1,17 @@
|
||||
<template>
|
||||
<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-input
|
||||
v-model="queryParams.configName"
|
||||
placeholder="请输入参数名称"
|
||||
clearable
|
||||
placeholder="请输入参数名称"
|
||||
style="width: 240px"
|
||||
@keyup.enter="handleQuery"
|
||||
/>
|
||||
@ -13,14 +19,18 @@
|
||||
<el-form-item label="参数键名" prop="configKey">
|
||||
<el-input
|
||||
v-model="queryParams.configKey"
|
||||
placeholder="请输入参数键名"
|
||||
clearable
|
||||
placeholder="请输入参数键名"
|
||||
style="width: 240px"
|
||||
@keyup.enter="handleQuery"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item label="系统内置" prop="configType">
|
||||
<el-select v-model="queryParams.configType" placeholder="系统内置" clearable>
|
||||
<el-select
|
||||
v-model="queryParams.configType"
|
||||
clearable
|
||||
placeholder="系统内置"
|
||||
>
|
||||
<el-option
|
||||
v-for="dict in sys_yes_no"
|
||||
:key="dict.value"
|
||||
@ -30,7 +40,9 @@
|
||||
</el-select>
|
||||
</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-form-item>
|
||||
</el-form>
|
||||
@ -38,89 +50,153 @@
|
||||
<el-row :gutter="10" class="mb8">
|
||||
<el-col :span="1.5">
|
||||
<el-button
|
||||
type="primary"
|
||||
plain
|
||||
icon="Plus"
|
||||
@click="handleAdd"
|
||||
v-hasPermi="['system:config:add']"
|
||||
>新增</el-button>
|
||||
icon="Plus"
|
||||
plain
|
||||
type="primary"
|
||||
@click="handleAdd"
|
||||
>新增
|
||||
</el-button>
|
||||
</el-col>
|
||||
<el-col :span="1.5">
|
||||
<el-button
|
||||
type="success"
|
||||
plain
|
||||
icon="Edit"
|
||||
:disabled="single"
|
||||
@click="handleUpdate"
|
||||
v-hasPermi="['system:config:edit']"
|
||||
>修改</el-button>
|
||||
:disabled="single"
|
||||
icon="Edit"
|
||||
plain
|
||||
type="success"
|
||||
@click="handleUpdate"
|
||||
>修改
|
||||
</el-button>
|
||||
</el-col>
|
||||
<el-col :span="1.5">
|
||||
<el-button
|
||||
type="danger"
|
||||
plain
|
||||
v-hasPermi="['system:config:remove']"
|
||||
:disabled="
|
||||
multiple ||
|
||||
ids.some((id) =>
|
||||
configList.find(
|
||||
(el) => el.configId === id && el.configType === 'Y'
|
||||
)
|
||||
)
|
||||
"
|
||||
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
|
||||
icon="Download"
|
||||
@click="handleExport"
|
||||
v-hasPermi="['system:config:export']"
|
||||
>导出</el-button>
|
||||
</el-col>
|
||||
<el-col :span="1.5">
|
||||
<el-button
|
||||
type="danger"
|
||||
plain
|
||||
icon="Refresh"
|
||||
@click="handleRefreshCache"
|
||||
v-hasPermi="['system:config:remove']"
|
||||
>刷新缓存</el-button>
|
||||
@click="handleDelete"
|
||||
>删除
|
||||
</el-button>
|
||||
</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-table v-loading="loading" :data="configList" @selection-change="handleSelectionChange">
|
||||
<el-table-column type="selection" width="55" align="center" />
|
||||
<el-table-column label="参数主键" align="center" prop="configId" />
|
||||
<el-table-column label="参数名称" align="center" prop="configName" :show-overflow-tooltip="true" />
|
||||
<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 label="系统内置" align="center" prop="configType">
|
||||
<el-table
|
||||
v-loading="loading"
|
||||
:data="configList"
|
||||
@selection-change="handleSelectionChange"
|
||||
>
|
||||
<el-table-column align="center" type="selection" width="55" />
|
||||
<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">
|
||||
<dict-tag :options="sys_yes_no" :value="scope.row.configType" />
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="备注" align="center" prop="remark" :show-overflow-tooltip="true" />
|
||||
<el-table-column label="创建时间" align="center" prop="createTime" width="180">
|
||||
<el-table-column
|
||||
:show-overflow-tooltip="true"
|
||||
align="center"
|
||||
label="备注"
|
||||
prop="remark"
|
||||
/>
|
||||
<el-table-column
|
||||
align="center"
|
||||
label="创建时间"
|
||||
prop="createTime"
|
||||
width="180"
|
||||
>
|
||||
<template #default="scope">
|
||||
<span>{{ parseTime(scope.row.createTime) }}</span>
|
||||
</template>
|
||||
</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">
|
||||
<el-button link type="primary" icon="Edit" @click="handleUpdate(scope.row)" v-hasPermi="['system:config:edit']" >修改</el-button>
|
||||
<el-button link type="primary" icon="Delete" @click="handleDelete(scope.row)" v-hasPermi="['system:config:remove']">删除</el-button>
|
||||
<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>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
|
||||
<pagination
|
||||
v-show="total > 0"
|
||||
:total="total"
|
||||
v-model:page="queryParams.pageNum"
|
||||
v-model:limit="queryParams.pageSize"
|
||||
v-model:page="queryParams.pageNum"
|
||||
:total="total"
|
||||
@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-item label="参数名称" prop="configName">
|
||||
<el-input v-model="form.configName" placeholder="请输入参数名称" />
|
||||
@ -137,11 +213,16 @@
|
||||
v-for="dict in sys_yes_no"
|
||||
:key="dict.value"
|
||||
:label="dict.value"
|
||||
>{{ dict.label }}</el-radio>
|
||||
>{{ dict.label }}
|
||||
</el-radio>
|
||||
</el-radio-group>
|
||||
</el-form-item>
|
||||
<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>
|
||||
<template #footer>
|
||||
@ -154,9 +235,18 @@
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script setup name="Config">
|
||||
import { listConfig, getConfig, delConfig, addConfig, updateConfig, refreshCache } from "@/api/system/config";
|
||||
<script lang="jsx" name="Config" setup>
|
||||
import {
|
||||
addConfig,
|
||||
delConfig,
|
||||
getConfig,
|
||||
listConfig,
|
||||
refreshCache,
|
||||
updateConfig,
|
||||
} from "@/api/system/config";
|
||||
import { sys_yes_no } from "@/constant/dict";
|
||||
import { ElMessageBox } from "element-plus";
|
||||
|
||||
const { proxy } = getCurrentInstance();
|
||||
|
||||
const configList = ref([]);
|
||||
@ -177,13 +267,19 @@ const data = reactive({
|
||||
pageSize: 10,
|
||||
configName: undefined,
|
||||
configKey: undefined,
|
||||
configType: undefined
|
||||
configType: undefined,
|
||||
},
|
||||
rules: {
|
||||
configName: [{ required: true, message: "参数名称不能为空", trigger: "blur" }],
|
||||
configKey: [{ required: true, message: "参数键名不能为空", trigger: "blur" }],
|
||||
configValue: [{ required: true, message: "参数键值不能为空", trigger: "blur" }]
|
||||
}
|
||||
configName: [
|
||||
{ required: true, message: "参数名称不能为空", trigger: "blur" },
|
||||
],
|
||||
configKey: [
|
||||
{ required: true, message: "参数键名不能为空", trigger: "blur" },
|
||||
],
|
||||
configValue: [
|
||||
{ required: true, message: "参数键值不能为空", trigger: "blur" },
|
||||
],
|
||||
},
|
||||
});
|
||||
|
||||
const { queryParams, form, rules } = toRefs(data);
|
||||
@ -191,17 +287,21 @@ const { queryParams, form, rules } = toRefs(data);
|
||||
/** 查询参数列表 */
|
||||
function getList() {
|
||||
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;
|
||||
total.value = response.total;
|
||||
loading.value = false;
|
||||
});
|
||||
}
|
||||
);
|
||||
}
|
||||
|
||||
/** 取消按钮 */
|
||||
function cancel() {
|
||||
open.value = false;
|
||||
reset();
|
||||
}
|
||||
|
||||
/** 表单重置 */
|
||||
function reset() {
|
||||
form.value = {
|
||||
@ -210,55 +310,61 @@ function reset() {
|
||||
configKey: undefined,
|
||||
configValue: undefined,
|
||||
configType: "Y",
|
||||
remark: undefined
|
||||
remark: undefined,
|
||||
};
|
||||
proxy.resetForm("configRef");
|
||||
}
|
||||
|
||||
/** 搜索按钮操作 */
|
||||
function handleQuery() {
|
||||
queryParams.value.pageNum = 1;
|
||||
getList();
|
||||
}
|
||||
|
||||
/** 重置按钮操作 */
|
||||
function resetQuery() {
|
||||
dateRange.value = [];
|
||||
proxy.resetForm("queryRef");
|
||||
handleQuery();
|
||||
}
|
||||
|
||||
/** 多选框选中数据 */
|
||||
function handleSelectionChange(selection) {
|
||||
ids.value = selection.map(item => item.configId);
|
||||
ids.value = selection.map((item) => item.configId);
|
||||
single.value = selection.length != 1;
|
||||
multiple.value = !selection.length;
|
||||
}
|
||||
|
||||
/** 新增按钮操作 */
|
||||
function handleAdd() {
|
||||
reset();
|
||||
open.value = true;
|
||||
title.value = "添加参数";
|
||||
}
|
||||
|
||||
/** 修改按钮操作 */
|
||||
function handleUpdate(row) {
|
||||
reset();
|
||||
const configId = row.configId || ids.value;
|
||||
getConfig(configId).then(response => {
|
||||
getConfig(configId).then((response) => {
|
||||
form.value = response.data;
|
||||
open.value = true;
|
||||
title.value = "修改参数";
|
||||
});
|
||||
}
|
||||
|
||||
/** 提交按钮 */
|
||||
function submitForm() {
|
||||
proxy.$refs["configRef"].validate(valid => {
|
||||
proxy.$refs["configRef"].validate((valid) => {
|
||||
if (valid) {
|
||||
if (form.value.configId != undefined) {
|
||||
updateConfig(form.value).then(response => {
|
||||
updateConfig(form.value).then((response) => {
|
||||
proxy.$modal.msgSuccess("修改成功");
|
||||
open.value = false;
|
||||
getList();
|
||||
});
|
||||
} else {
|
||||
addConfig(form.value).then(response => {
|
||||
addConfig(form.value).then((response) => {
|
||||
proxy.$modal.msgSuccess("新增成功");
|
||||
open.value = false;
|
||||
getList();
|
||||
@ -267,22 +373,52 @@ function submitForm() {
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
/** 删除按钮操作 */
|
||||
function handleDelete(row) {
|
||||
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);
|
||||
}).then(() => {
|
||||
})
|
||||
.then(() => {
|
||||
getList();
|
||||
proxy.$modal.msgSuccess("删除成功");
|
||||
}).catch(() => {});
|
||||
})
|
||||
.catch(() => {});
|
||||
}
|
||||
|
||||
/** 导出按钮操作 */
|
||||
function handleExport() {
|
||||
proxy.download("system/config/export", {
|
||||
...queryParams.value
|
||||
}, `config_${new Date().getTime()}.xlsx`);
|
||||
proxy.download(
|
||||
"system/config/export",
|
||||
{
|
||||
...queryParams.value,
|
||||
},
|
||||
`config_${new Date().getTime()}.xlsx`
|
||||
);
|
||||
}
|
||||
|
||||
/** 刷新缓存按钮操作 */
|
||||
function handleRefreshCache() {
|
||||
refreshCache().then(() => {
|
||||
|
@ -113,7 +113,12 @@
|
||||
@selection-change="handleSelectionChange"
|
||||
>
|
||||
<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
|
||||
label="角色名称"
|
||||
prop="roleName"
|
||||
@ -128,12 +133,22 @@
|
||||
width="150"
|
||||
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 }">
|
||||
{{ dataScopeOptions.find((el) => el.value === row.dataScope)?.label }}
|
||||
</template>
|
||||
</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">
|
||||
<template #default="scope">
|
||||
<el-switch
|
||||
|
@ -81,8 +81,7 @@
|
||||
<el-form-item>
|
||||
<el-button icon="Search" type="primary" @click="handleQuery"
|
||||
>搜索
|
||||
</el-button
|
||||
>
|
||||
</el-button>
|
||||
<el-button icon="Refresh" @click="resetQuery">重置</el-button>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
@ -152,7 +151,7 @@
|
||||
:data="userList"
|
||||
@selection-change="handleSelectionChange"
|
||||
>
|
||||
<el-table-column align="center" type="selection" width="50"/>
|
||||
<el-table-column align="center" type="selection" width="50" />
|
||||
<el-table-column
|
||||
v-if="columns[0].visible"
|
||||
key="userId"
|
||||
@ -460,18 +459,21 @@
|
||||
drag
|
||||
>
|
||||
<el-icon class="el-icon--upload">
|
||||
<upload-filled/>
|
||||
<upload-filled />
|
||||
</el-icon>
|
||||
<div class="el-upload__text">将文件拖到此处,或<em>点击上传</em></div>
|
||||
<template #tip>
|
||||
<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 style="color:#F00;font-size:13px;">请手动更改单元格格式为文本格式</li>
|
||||
<li><span>仅允许导入xls、xlsx格式文件。</span>
|
||||
<li style="color: #f00; font-size: 13px">
|
||||
请手动更改单元格格式为文本格式
|
||||
</li>
|
||||
<li>
|
||||
<span>仅允许导入xls、xlsx格式文件。</span>
|
||||
<el-link
|
||||
:underline="false"
|
||||
style="font-size: 12px; vertical-align: baseline"
|
||||
@ -481,7 +483,6 @@
|
||||
</el-link>
|
||||
</li>
|
||||
</ol>
|
||||
|
||||
</div>
|
||||
</template>
|
||||
</el-upload>
|
||||
@ -496,7 +497,7 @@
|
||||
</template>
|
||||
|
||||
<script lang="jsx" name="User" setup>
|
||||
import {getToken} from "@/utils/auth";
|
||||
import { getToken } from "@/utils/auth";
|
||||
import {
|
||||
addUser,
|
||||
changeUserStatus,
|
||||
@ -507,11 +508,11 @@ import {
|
||||
resetUserPwd,
|
||||
updateUser,
|
||||
} from "@/api/system/user";
|
||||
import {sys_normal_disable, sys_user_gender} from "@/constant/dict";
|
||||
import {ElMessageBox} from "element-plus";
|
||||
import { sys_normal_disable, sys_user_gender } from "@/constant/dict";
|
||||
import { ElMessageBox } from "element-plus";
|
||||
|
||||
const router = useRouter();
|
||||
const {proxy} = getCurrentInstance();
|
||||
const { proxy } = getCurrentInstance();
|
||||
|
||||
const userList = ref([]);
|
||||
const open = ref(false);
|
||||
@ -539,19 +540,19 @@ const upload = reactive({
|
||||
// 是否更新已经存在的用户数据
|
||||
updateSupport: 0,
|
||||
// 设置上传的请求头部
|
||||
headers: {Authorization: "Bearer " + getToken()},
|
||||
headers: { Authorization: "Bearer " + getToken() },
|
||||
// 上传的地址
|
||||
url: import.meta.env.VITE_APP_BASE_API + "/system/user/importData",
|
||||
});
|
||||
// 列显隐信息
|
||||
const columns = ref([
|
||||
{key: 0, label: `用户编号`, visible: true},
|
||||
{key: 1, label: `登录账号`, visible: true},
|
||||
{key: 2, label: `姓名`, visible: true},
|
||||
{key: 3, label: `部门`, visible: true},
|
||||
{key: 4, label: `手机号码`, visible: true},
|
||||
{key: 5, label: `状态`, visible: true},
|
||||
{key: 6, label: `创建时间`, visible: true},
|
||||
{ key: 0, label: `用户编号`, visible: true },
|
||||
{ key: 1, label: `登录账号`, visible: true },
|
||||
{ key: 2, label: `姓名`, visible: true },
|
||||
{ key: 3, label: `部门`, visible: true },
|
||||
{ key: 4, label: `手机号码`, visible: true },
|
||||
{ key: 5, label: `状态`, visible: true },
|
||||
{ key: 6, label: `创建时间`, visible: true },
|
||||
]);
|
||||
|
||||
const data = reactive({
|
||||
@ -566,7 +567,7 @@ const data = reactive({
|
||||
},
|
||||
rules: {
|
||||
userName: [
|
||||
{required: true, message: "登录账号不能为空", trigger: "blur"},
|
||||
{ required: true, message: "登录账号不能为空", trigger: "blur" },
|
||||
{
|
||||
min: 2,
|
||||
max: 20,
|
||||
@ -574,9 +575,9 @@ const data = reactive({
|
||||
trigger: "blur",
|
||||
},
|
||||
],
|
||||
nickName: [{required: true, message: "姓名不能为空", trigger: "blur"}],
|
||||
nickName: [{ required: true, message: "姓名不能为空", trigger: "blur" }],
|
||||
password: [
|
||||
{required: true, message: "登录密码不能为空", trigger: "blur"},
|
||||
{ required: true, message: "登录密码不能为空", trigger: "blur" },
|
||||
{
|
||||
min: 5,
|
||||
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) => {
|
||||
@ -688,8 +689,7 @@ function handleDelete(row) {
|
||||
getList();
|
||||
proxy.$modal.msgSuccess("删除成功");
|
||||
})
|
||||
.catch(() => {
|
||||
});
|
||||
.catch(() => {});
|
||||
}
|
||||
|
||||
/** 导出按钮操作 */
|
||||
@ -749,13 +749,12 @@ function handleResetPwd(row) {
|
||||
inputPattern: /^.{5,20}$/,
|
||||
inputErrorMessage: "登录密码长度必须介于 5 和 20 之间",
|
||||
})
|
||||
.then(({value}) => {
|
||||
.then(({ value }) => {
|
||||
resetUserPwd(row.userId, value).then((response) => {
|
||||
proxy.$modal.msgSuccess("修改成功,新密码是:" + value);
|
||||
});
|
||||
})
|
||||
.catch(() => {
|
||||
});
|
||||
.catch(() => {});
|
||||
}
|
||||
|
||||
/** 选择条数 */
|
||||
@ -794,7 +793,7 @@ const handleFileSuccess = (response, file, fileList) => {
|
||||
response.msg +
|
||||
"</div>",
|
||||
"导入结果",
|
||||
{dangerouslyUseHTMLString: true}
|
||||
{ dangerouslyUseHTMLString: true }
|
||||
);
|
||||
getList();
|
||||
};
|
||||
|
@ -27,7 +27,7 @@
|
||||
</li>
|
||||
<li class="list-group-item">
|
||||
<svg-icon icon-class="tree" />所在岗位
|
||||
<div class="pull-right" >
|
||||
<div class="pull-right">
|
||||
{{ state.postGroup }}
|
||||
</div>
|
||||
</li>
|
||||
|
Reference in New Issue
Block a user