refactor: ♻️ 通知公告、字典重构
This commit is contained in:
@@ -27,7 +27,8 @@
|
||||
搜索
|
||||
</el-button>
|
||||
<el-button @click="handleResetQuery">
|
||||
<i-ep-refresh />重置
|
||||
<i-ep-refresh />
|
||||
重置
|
||||
</el-button>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
@@ -39,14 +40,18 @@
|
||||
v-hasPerm="['sys:dept:add']"
|
||||
type="success"
|
||||
@click="handleOpenDialog(0, undefined)"
|
||||
><i-ep-plus />新增</el-button
|
||||
>
|
||||
<i-ep-plus />
|
||||
新增
|
||||
</el-button>
|
||||
<el-button
|
||||
v-hasPerm="['sys:dept:delete']"
|
||||
type="danger"
|
||||
:disabled="ids.length === 0"
|
||||
@click="handleDelete()"
|
||||
><i-ep-delete />删除
|
||||
>
|
||||
<i-ep-delete />
|
||||
删除
|
||||
</el-button>
|
||||
</template>
|
||||
|
||||
@@ -78,7 +83,9 @@
|
||||
link
|
||||
size="small"
|
||||
@click.stop="handleOpenDialog(scope.row.id, undefined)"
|
||||
><i-ep-plus />新增
|
||||
>
|
||||
<i-ep-plus />
|
||||
新增
|
||||
</el-button>
|
||||
<el-button
|
||||
v-hasPerm="['sys:dept:edit']"
|
||||
@@ -86,7 +93,9 @@
|
||||
link
|
||||
size="small"
|
||||
@click.stop="handleOpenDialog(scope.row.parentId, scope.row.id)"
|
||||
><i-ep-edit />编辑
|
||||
>
|
||||
<i-ep-edit />
|
||||
编辑
|
||||
</el-button>
|
||||
<el-button
|
||||
v-hasPerm="['sys:dept:delete']"
|
||||
@@ -95,7 +104,8 @@
|
||||
size="small"
|
||||
@click.stop="handleDelete(scope.row.id)"
|
||||
>
|
||||
<i-ep-delete />删除
|
||||
<i-ep-delete />
|
||||
删除
|
||||
</el-button>
|
||||
</template>
|
||||
</el-table-column>
|
||||
@@ -148,8 +158,8 @@
|
||||
|
||||
<template #footer>
|
||||
<div class="dialog-footer">
|
||||
<el-button type="primary" @click="handleSubmit"> 确 定 </el-button>
|
||||
<el-button @click="handleCloseDialog"> 取 消 </el-button>
|
||||
<el-button type="primary" @click="handleSubmit">确 定</el-button>
|
||||
<el-button @click="handleCloseDialog">取 消</el-button>
|
||||
</div>
|
||||
</template>
|
||||
</el-dialog>
|
||||
|
||||
310
src/views/system/dict/data.vue
Normal file
310
src/views/system/dict/data.vue
Normal file
@@ -0,0 +1,310 @@
|
||||
<!-- 字典数据 -->
|
||||
<template>
|
||||
<div class="app-container">
|
||||
<el-alert
|
||||
:title="`字典:${dictName}【${dictCode}】`"
|
||||
type="success"
|
||||
:closable="false"
|
||||
/>
|
||||
|
||||
<div class="search-container mt-5">
|
||||
<el-form ref="queryFormRef" :model="queryParams" :inline="true">
|
||||
<el-form-item label="关键字" prop="keywords">
|
||||
<el-input
|
||||
v-model="queryParams.keywords"
|
||||
placeholder="字典标签/字典值"
|
||||
clearable
|
||||
@keyup.enter="handleQuery"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item>
|
||||
<el-button type="primary" @click="handleQuery()">
|
||||
<i-ep-search />
|
||||
搜索
|
||||
</el-button>
|
||||
<el-button @click="handleResetQuery()">
|
||||
<i-ep-refresh />
|
||||
重置
|
||||
</el-button>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
</div>
|
||||
|
||||
<el-card shadow="never">
|
||||
<div class="mb-[10px]">
|
||||
<el-button type="success" @click="handleOpenDialog()">
|
||||
<i-ep-plus />
|
||||
新增
|
||||
</el-button>
|
||||
<el-button
|
||||
type="danger"
|
||||
:disabled="ids.length === 0"
|
||||
@click="handleDelete()"
|
||||
>
|
||||
<i-ep-delete />
|
||||
删除
|
||||
</el-button>
|
||||
</div>
|
||||
|
||||
<el-table
|
||||
v-loading="loading"
|
||||
highlight-current-row
|
||||
:data="tableData"
|
||||
border
|
||||
@selection-change="handleSelectionChange"
|
||||
>
|
||||
<el-table-column type="selection" width="55" align="center" />
|
||||
<el-table-column label="字典标签" prop="label" />
|
||||
<el-table-column label="字典值" prop="value" />
|
||||
<el-table-column label="排序" prop="sort" />
|
||||
<el-table-column label="状态">
|
||||
<template #default="scope">
|
||||
<el-tag :type="scope.row.status === 1 ? 'success' : 'info'">
|
||||
{{ scope.row.status === 1 ? "启用" : "禁用" }}
|
||||
</el-tag>
|
||||
</template>
|
||||
</el-table-column>
|
||||
|
||||
<el-table-column fixed="right" label="操作" align="center" width="220">
|
||||
<template #default="scope">
|
||||
<el-button
|
||||
type="primary"
|
||||
link
|
||||
size="small"
|
||||
@click.stop="handleOpenDialog(scope.row)"
|
||||
>
|
||||
<i-ep-edit />
|
||||
编辑
|
||||
</el-button>
|
||||
<el-button
|
||||
type="danger"
|
||||
link
|
||||
size="small"
|
||||
@click.stop="handleDelete(scope.row.id)"
|
||||
>
|
||||
<i-ep-delete />
|
||||
删除
|
||||
</el-button>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
|
||||
<pagination
|
||||
v-if="total > 0"
|
||||
v-model:total="total"
|
||||
v-model:page="queryParams.pageNum"
|
||||
v-model:limit="queryParams.pageSize"
|
||||
@pagination="handleQuery"
|
||||
/>
|
||||
</el-card>
|
||||
|
||||
<!--字典弹窗-->
|
||||
<el-dialog
|
||||
v-model="dialog.visible"
|
||||
:title="dialog.title"
|
||||
width="500px"
|
||||
@close="handleCloseDialog"
|
||||
>
|
||||
<el-form
|
||||
ref="dataFormRef"
|
||||
:model="formData"
|
||||
:rules="computedRules"
|
||||
label-width="100px"
|
||||
>
|
||||
<el-card shadow="never">
|
||||
<el-form-item label="字典标签" prop="label">
|
||||
<el-input v-model="formData.label" placeholder="请输入字典标签" />
|
||||
</el-form-item>
|
||||
<el-form-item label="字典值" prop="value">
|
||||
<el-input v-model="formData.value" placeholder="请输入字典值" />
|
||||
</el-form-item>
|
||||
<el-form-item label="状态">
|
||||
<el-radio-group v-model="formData.status">
|
||||
<el-radio :value="1">启用</el-radio>
|
||||
<el-radio :value="0">禁用</el-radio>
|
||||
</el-radio-group>
|
||||
</el-form-item>
|
||||
|
||||
<el-form-item label="排序">
|
||||
<el-input-number
|
||||
v-model="formData.sort"
|
||||
controls-position="right"
|
||||
/>
|
||||
</el-form-item>
|
||||
</el-card>
|
||||
</el-form>
|
||||
|
||||
<template #footer>
|
||||
<div class="dialog-footer">
|
||||
<el-button type="primary" @click="handleSubmitClick">确 定</el-button>
|
||||
<el-button @click="handleCloseDialog">取 消</el-button>
|
||||
</div>
|
||||
</template>
|
||||
</el-dialog>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script setup lang="ts">
|
||||
defineOptions({
|
||||
name: "DictData",
|
||||
inherititems: false,
|
||||
});
|
||||
|
||||
import DictDataAPI, {
|
||||
DictDataPageQuery,
|
||||
DictDataPageVO,
|
||||
DictDataForm,
|
||||
} from "@/api/dict-data";
|
||||
|
||||
const route = useRoute();
|
||||
|
||||
const dictCode = route.query.dictCode as string;
|
||||
const dictName = route.query.dictName as string;
|
||||
|
||||
const queryFormRef = ref(ElForm);
|
||||
const dataFormRef = ref(ElForm);
|
||||
|
||||
const loading = ref(false);
|
||||
const ids = ref<number[]>([]);
|
||||
const total = ref(0);
|
||||
|
||||
const queryParams = reactive<DictDataPageQuery>({
|
||||
pageNum: 1,
|
||||
pageSize: 10,
|
||||
dictCode,
|
||||
});
|
||||
|
||||
const tableData = ref<DictDataPageVO[]>();
|
||||
|
||||
const dialog = reactive({
|
||||
title: "",
|
||||
visible: false,
|
||||
});
|
||||
|
||||
const formData = reactive<DictDataForm>({});
|
||||
|
||||
// 监听路由参数变化,更新字典数据
|
||||
watch(
|
||||
() => route.query.dictCode,
|
||||
(newDictCode) => {
|
||||
if (newDictCode !== queryParams.dictCode) {
|
||||
queryParams.dictCode = newDictCode as string;
|
||||
handleQuery();
|
||||
}
|
||||
}
|
||||
);
|
||||
|
||||
const computedRules = computed(() => {
|
||||
const rules: Partial<Record<string, any>> = {
|
||||
value: [{ required: true, message: "请输入字典值", trigger: "blur" }],
|
||||
label: [{ required: true, message: "请输入字典标签", trigger: "blur" }],
|
||||
};
|
||||
return rules;
|
||||
});
|
||||
|
||||
// 查询
|
||||
function handleQuery() {
|
||||
loading.value = true;
|
||||
DictDataAPI.getPage(queryParams)
|
||||
.then((data) => {
|
||||
tableData.value = data.list;
|
||||
total.value = data.total;
|
||||
})
|
||||
.finally(() => {
|
||||
loading.value = false;
|
||||
});
|
||||
}
|
||||
|
||||
// 重置查询
|
||||
function handleResetQuery() {
|
||||
queryFormRef.value.resetFields();
|
||||
queryParams.pageNum = 1;
|
||||
handleQuery();
|
||||
}
|
||||
|
||||
// 行选择
|
||||
function handleSelectionChange(selection: any) {
|
||||
ids.value = selection.map((item: any) => item.id);
|
||||
}
|
||||
|
||||
// 打开弹窗
|
||||
function handleOpenDialog(row?: DictDataPageVO) {
|
||||
dialog.visible = true;
|
||||
dialog.title = row ? "编辑字典数据" : "新增字典数据";
|
||||
|
||||
if (row?.id) {
|
||||
DictDataAPI.getFormData(row.id).then((data) => {
|
||||
Object.assign(formData, data);
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
// 提交表单
|
||||
function handleSubmitClick() {
|
||||
dataFormRef.value.validate((isValid: boolean) => {
|
||||
if (isValid) {
|
||||
loading.value = true;
|
||||
const id = formData.id;
|
||||
formData.dictCode = dictCode;
|
||||
if (id) {
|
||||
DictDataAPI.update(id, formData)
|
||||
.then(() => {
|
||||
ElMessage.success("修改成功");
|
||||
handleCloseDialog();
|
||||
handleQuery();
|
||||
})
|
||||
.finally(() => (loading.value = false));
|
||||
} else {
|
||||
DictDataAPI.add(formData)
|
||||
.then(() => {
|
||||
ElMessage.success("新增成功");
|
||||
handleCloseDialog();
|
||||
handleQuery();
|
||||
})
|
||||
.finally(() => (loading.value = false));
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
// 关闭弹窗
|
||||
function handleCloseDialog() {
|
||||
dialog.visible = false;
|
||||
|
||||
dataFormRef.value.resetFields();
|
||||
dataFormRef.value.clearValidate();
|
||||
|
||||
formData.id = undefined;
|
||||
}
|
||||
/**
|
||||
* 删除字典
|
||||
*
|
||||
* @param id 字典ID
|
||||
*/
|
||||
function handleDelete(id?: number) {
|
||||
const attrGroupIds = [id || ids.value].join(",");
|
||||
if (!attrGroupIds) {
|
||||
ElMessage.warning("请勾选删除项");
|
||||
return;
|
||||
}
|
||||
ElMessageBox.confirm("确认删除已选中的数据项?", "警告", {
|
||||
confirmButtonText: "确定",
|
||||
cancelButtonText: "取消",
|
||||
type: "warning",
|
||||
}).then(
|
||||
() => {
|
||||
DictDataAPI.deleteByIds(attrGroupIds).then(() => {
|
||||
ElMessage.success("删除成功");
|
||||
handleResetQuery();
|
||||
});
|
||||
},
|
||||
() => {
|
||||
ElMessage.info("已取消删除");
|
||||
}
|
||||
);
|
||||
}
|
||||
|
||||
onMounted(() => {
|
||||
handleQuery();
|
||||
});
|
||||
</script>
|
||||
@@ -1,12 +1,12 @@
|
||||
<!-- 分类字典 -->
|
||||
<!-- 字典 -->
|
||||
<template>
|
||||
<div class="app-container">
|
||||
<div class="search-container">
|
||||
<el-form ref="queryFormRef" :model="queryParams" :inline="true">
|
||||
<el-form-item label="关键字" prop="name">
|
||||
<el-form-item label="关键字" prop="keywords">
|
||||
<el-input
|
||||
v-model="queryParams.keywords"
|
||||
placeholder="字典名称"
|
||||
placeholder="字典名称/编码"
|
||||
clearable
|
||||
@keyup.enter="handleQuery"
|
||||
/>
|
||||
@@ -16,7 +16,7 @@
|
||||
<i-ep-search />
|
||||
搜索
|
||||
</el-button>
|
||||
<el-button @click="handleResetClick()">
|
||||
<el-button @click="handleResetQuery()">
|
||||
<i-ep-refresh />
|
||||
重置
|
||||
</el-button>
|
||||
@@ -48,18 +48,8 @@
|
||||
@selection-change="handleSelectionChange"
|
||||
>
|
||||
<el-table-column type="selection" width="55" align="center" />
|
||||
|
||||
<el-table-column type="expand" label="字典项列表" width="100">
|
||||
<template #default="props">
|
||||
<el-table :data="props.row.dictItems">
|
||||
<el-table-column label="字典项键" prop="name" width="200" />
|
||||
<el-table-column label="字典项值" prop="value" align="center" />
|
||||
<el-table-column label="排序" prop="sort" align="center" />
|
||||
</el-table>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="字典名称" prop="name" />
|
||||
<el-table-column label="字典编码" prop="code" />
|
||||
<el-table-column label="字典编码" prop="dictCode" />
|
||||
<el-table-column label="状态" prop="status">
|
||||
<template #default="scope">
|
||||
<el-tag :type="scope.row.status === 1 ? 'success' : 'info'">
|
||||
@@ -69,6 +59,16 @@
|
||||
</el-table-column>
|
||||
<el-table-column fixed="right" label="操作" align="center" width="220">
|
||||
<template #default="scope">
|
||||
<el-button
|
||||
type="primary"
|
||||
link
|
||||
size="small"
|
||||
@click.stop="handleOpenDictData(scope.row)"
|
||||
>
|
||||
<i-ep-Collection />
|
||||
字典数据
|
||||
</el-button>
|
||||
|
||||
<el-button
|
||||
type="primary"
|
||||
link
|
||||
@@ -101,10 +101,10 @@
|
||||
</el-card>
|
||||
|
||||
<!--字典弹窗-->
|
||||
<el-drawer
|
||||
<el-dialog
|
||||
v-model="dialog.visible"
|
||||
:title="dialog.title"
|
||||
size="70%"
|
||||
width="500px"
|
||||
@close="handleCloseDialog"
|
||||
>
|
||||
<el-form
|
||||
@@ -112,14 +112,17 @@
|
||||
:model="formData"
|
||||
:rules="computedRules"
|
||||
label-width="100px"
|
||||
:inline="true"
|
||||
>
|
||||
<el-card shadow="never">
|
||||
<el-form-item label="字典名称" prop="name">
|
||||
<el-input v-model="formData.name" placeholder="请输入字典名称" />
|
||||
</el-form-item>
|
||||
<el-form-item label="字典编码" prop="code">
|
||||
<el-input v-model="formData.code" placeholder="请输入字典编码" />
|
||||
|
||||
<el-form-item label="字典编码" prop="dictCode">
|
||||
<el-input
|
||||
v-model="formData.dictCode"
|
||||
placeholder="请输入字典编码"
|
||||
/>
|
||||
</el-form-item>
|
||||
|
||||
<el-form-item label="状态">
|
||||
@@ -128,80 +131,14 @@
|
||||
<el-radio :value="0">禁用</el-radio>
|
||||
</el-radio-group>
|
||||
</el-form-item>
|
||||
</el-card>
|
||||
|
||||
<el-card shadow="never" class="mt-5">
|
||||
<template #header>
|
||||
<div class="flex-x-between">
|
||||
<span>字典项</span>
|
||||
<el-button
|
||||
type="primary"
|
||||
size="small"
|
||||
@click.stop="handleAddAttrClick"
|
||||
>
|
||||
<i-ep-plus />
|
||||
新增字典
|
||||
</el-button>
|
||||
</div>
|
||||
</template>
|
||||
<el-table
|
||||
v-loading="loading"
|
||||
highlight--currentrow
|
||||
:data="formData.dictItems"
|
||||
@selection-change="handleSelectionChange"
|
||||
>
|
||||
<el-table-column label="字典项名称" width="200">
|
||||
<template #default="scope">
|
||||
<el-form-item :prop="'dictItems.' + scope.$index + '.name'">
|
||||
<el-input v-model="scope.row.name" />
|
||||
</el-form-item>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="字典项值" width="200">
|
||||
<template #default="scope">
|
||||
<el-form-item :prop="'dictItems.' + scope.$index + '.value'">
|
||||
<el-input v-model="scope.row.value" />
|
||||
</el-form-item>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="排序">
|
||||
<template #default="scope">
|
||||
<el-form-item :prop="'dictItems.' + scope.$index + '.sort'">
|
||||
<el-input v-model="scope.row.sort" />
|
||||
</el-form-item>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="状态" prop="status">
|
||||
<template #default="scope">
|
||||
<el-form-item :prop="'dictItems.' + scope.$index + '.status'">
|
||||
<el-switch
|
||||
v-model="scope.row.status"
|
||||
:active-value="1"
|
||||
:inactive-value="0"
|
||||
/>
|
||||
</el-form-item>
|
||||
</template>
|
||||
</el-table-column>
|
||||
|
||||
<el-table-column
|
||||
fixed="right"
|
||||
label="操作"
|
||||
align="center"
|
||||
width="120"
|
||||
>
|
||||
<template #default="scope">
|
||||
<el-button
|
||||
type="danger"
|
||||
link
|
||||
size="small"
|
||||
@click.stop="handleDeleteAttrClick(scope.$index)"
|
||||
>
|
||||
<i-ep-delete />
|
||||
删除
|
||||
</el-button>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
<el-form-item label="备注">
|
||||
<el-input
|
||||
type="textarea"
|
||||
v-model="formData.remark"
|
||||
placeholder="请输入备注"
|
||||
/>
|
||||
</el-form-item>
|
||||
</el-card>
|
||||
</el-form>
|
||||
|
||||
@@ -211,7 +148,7 @@
|
||||
<el-button @click="handleCloseDialog">取 消</el-button>
|
||||
</div>
|
||||
</template>
|
||||
</el-drawer>
|
||||
</el-dialog>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
@@ -223,6 +160,8 @@ defineOptions({
|
||||
|
||||
import DictAPI, { DictPageQuery, DictPageVO, DictForm } from "@/api/dict";
|
||||
|
||||
import router from "@/router";
|
||||
|
||||
const queryFormRef = ref(ElForm);
|
||||
const dataFormRef = ref(ElForm);
|
||||
|
||||
@@ -237,7 +176,6 @@ const queryParams = reactive<DictPageQuery>({
|
||||
|
||||
const tableData = ref<DictPageVO[]>();
|
||||
|
||||
// 字典弹窗
|
||||
const dialog = reactive({
|
||||
title: "",
|
||||
visible: false,
|
||||
@@ -248,15 +186,8 @@ const formData = reactive<DictForm>({});
|
||||
const computedRules = computed(() => {
|
||||
const rules: Partial<Record<string, any>> = {
|
||||
name: [{ required: true, message: "请输入字典名称", trigger: "blur" }],
|
||||
code: [{ required: true, message: "请输入字典编码", trigger: "blur" }],
|
||||
dictCode: [{ required: true, message: "请输入字典编码", trigger: "blur" }],
|
||||
};
|
||||
if (formData.dictItems) {
|
||||
formData.dictItems.forEach((attr, index) => {
|
||||
rules[`dictItems.${index}.name`] = [
|
||||
{ required: true, message: "请输入字典项名称", trigger: "blur" },
|
||||
];
|
||||
});
|
||||
}
|
||||
return rules;
|
||||
});
|
||||
|
||||
@@ -274,7 +205,7 @@ function handleQuery() {
|
||||
}
|
||||
|
||||
// 重置查询
|
||||
function handleResetClick() {
|
||||
function handleResetQuery() {
|
||||
queryFormRef.value.resetFields();
|
||||
queryParams.pageNum = 1;
|
||||
handleQuery();
|
||||
@@ -298,7 +229,7 @@ function handleAddClick() {
|
||||
*/
|
||||
function handleEditClick(id: number, name: string) {
|
||||
dialog.visible = true;
|
||||
dialog.title = "【" + name + "】字典修改";
|
||||
dialog.title = "修改字典";
|
||||
DictAPI.getFormData(id).then((data) => {
|
||||
Object.assign(formData, data);
|
||||
});
|
||||
@@ -331,7 +262,7 @@ function handleSubmitClick() {
|
||||
});
|
||||
}
|
||||
|
||||
/** 关闭字典弹窗 */
|
||||
// 关闭字典弹窗
|
||||
function handleCloseDialog() {
|
||||
dialog.visible = false;
|
||||
|
||||
@@ -339,7 +270,6 @@ function handleCloseDialog() {
|
||||
dataFormRef.value.clearValidate();
|
||||
|
||||
formData.id = undefined;
|
||||
formData.dictItems = [];
|
||||
}
|
||||
/**
|
||||
* 删除字典
|
||||
@@ -360,7 +290,7 @@ function handleDelete(id?: number) {
|
||||
() => {
|
||||
DictAPI.deleteByIds(attrGroupIds).then(() => {
|
||||
ElMessage.success("删除成功");
|
||||
handleResetClick();
|
||||
handleResetQuery();
|
||||
});
|
||||
},
|
||||
() => {
|
||||
@@ -369,17 +299,12 @@ function handleDelete(id?: number) {
|
||||
);
|
||||
}
|
||||
|
||||
/** 新增字典项 */
|
||||
function handleAddAttrClick() {
|
||||
formData.dictItems = formData.dictItems ?? [];
|
||||
formData.dictItems.push({ sort: 1, status: 1 });
|
||||
}
|
||||
|
||||
/** 删除字典项 */
|
||||
function handleDeleteAttrClick(index: number) {
|
||||
if (formData.dictItems && formData.dictItems.length > 0) {
|
||||
formData.dictItems.splice(index, 1);
|
||||
}
|
||||
// 打开字典数据
|
||||
function handleOpenDictData(row: DictPageVO) {
|
||||
router.push({
|
||||
name: "DictData",
|
||||
query: { dictCode: row.dictCode, dictName: row.name },
|
||||
});
|
||||
}
|
||||
|
||||
onMounted(() => {
|
||||
|
||||
87
src/views/system/notice/components/NoticeDetail.vue
Normal file
87
src/views/system/notice/components/NoticeDetail.vue
Normal file
@@ -0,0 +1,87 @@
|
||||
<template>
|
||||
<el-dialog
|
||||
v-model="visible"
|
||||
:show-close="false"
|
||||
:fullscreen="isFullscreen"
|
||||
width="50%"
|
||||
append-to-body
|
||||
@close="handleClose"
|
||||
>
|
||||
<template #header>
|
||||
<div class="flex-x-between">
|
||||
<span>通知公告详情</span>
|
||||
<div class="dialog-toolbar">
|
||||
<!-- 全屏/退出全屏按钮 -->
|
||||
<el-button @click="toggleFullscreen" circle>
|
||||
<SvgIcon v-if="isFullscreen" icon-class="fullscreen-exit" />
|
||||
<SvgIcon v-else icon-class="fullscreen" />
|
||||
</el-button>
|
||||
<!-- 关闭按钮 -->
|
||||
<el-button @click="handleClose" circle>
|
||||
<i-ep-Close />
|
||||
</el-button>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<el-descriptions :column="1">
|
||||
<el-descriptions-item label="标题:">
|
||||
{{ notice.title }}
|
||||
</el-descriptions-item>
|
||||
<el-descriptions-item label="发布状态:">
|
||||
<el-tag v-if="notice.publishStatus == 0" type="info">未发布</el-tag>
|
||||
<el-tag v-else-if="notice.publishStatus == 1" type="success">
|
||||
已发布
|
||||
</el-tag>
|
||||
<el-tag v-else-if="notice.publishStatus == -1" type="warning">
|
||||
已撤回
|
||||
</el-tag>
|
||||
</el-descriptions-item>
|
||||
<el-descriptions-item label="发布人:">
|
||||
{{ notice.publisherName }}
|
||||
</el-descriptions-item>
|
||||
<el-descriptions-item label="发布时间:">
|
||||
{{ notice.publishTime }}
|
||||
</el-descriptions-item>
|
||||
<el-descriptions-item label="内容:">
|
||||
<el-input
|
||||
v-model="notice.content"
|
||||
type="textarea"
|
||||
style="max-height: 400px"
|
||||
:readonly="true"
|
||||
/>
|
||||
</el-descriptions-item>
|
||||
</el-descriptions>
|
||||
</el-dialog>
|
||||
</template>
|
||||
|
||||
<script setup lang="ts">
|
||||
import NoticeAPI, { NoticeDetailVO } from "@/api/notice";
|
||||
|
||||
const visible = ref(false);
|
||||
const notice = ref<NoticeDetailVO>({});
|
||||
const isFullscreen = ref(false); // 控制全屏状态
|
||||
|
||||
// 切换全屏
|
||||
const toggleFullscreen = () => {
|
||||
isFullscreen.value = !isFullscreen.value;
|
||||
};
|
||||
|
||||
// 关闭弹窗
|
||||
const handleClose = () => {
|
||||
visible.value = false;
|
||||
};
|
||||
|
||||
// 接收公告详情
|
||||
const openNotice = async (id: string) => {
|
||||
visible.value = true;
|
||||
const noticeDetail = await NoticeAPI.getDetail(id);
|
||||
notice.value = noticeDetail;
|
||||
};
|
||||
|
||||
defineExpose({
|
||||
openNotice,
|
||||
});
|
||||
</script>
|
||||
|
||||
<style scoped></style>
|
||||
@@ -15,16 +15,16 @@
|
||||
@keyup.enter="handleQuery()"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item label="发布状态" prop="releaseStatus">
|
||||
<el-form-item label="发布状态" prop="publishStatus">
|
||||
<el-select
|
||||
v-model="queryParams.releaseStatus"
|
||||
v-model="queryParams.publishStatus"
|
||||
class="!w-[100px]"
|
||||
clearable
|
||||
placeholder="全部"
|
||||
>
|
||||
<el-option :value="0" label="未发布" />
|
||||
<el-option :value="1" label="已发布" />
|
||||
<el-option :value="2" label="已撤回" />
|
||||
<el-option :value="-1" label="已撤回" />
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item>
|
||||
@@ -43,7 +43,7 @@
|
||||
<el-card shadow="never" class="table-container">
|
||||
<template #header>
|
||||
<el-button
|
||||
v-hasPerm="['system:notice:add']"
|
||||
v-hasPerm="['sys:notice:add']"
|
||||
type="success"
|
||||
@click="handleOpenDialog()"
|
||||
>
|
||||
@@ -51,7 +51,7 @@
|
||||
新增通知
|
||||
</el-button>
|
||||
<el-button
|
||||
v-hasPerm="['system:notice:delete']"
|
||||
v-hasPerm="['sys:notice:delete']"
|
||||
type="danger"
|
||||
:disabled="ids.length === 0"
|
||||
@click="handleDelete()"
|
||||
@@ -79,108 +79,105 @@
|
||||
/>
|
||||
<el-table-column
|
||||
align="center"
|
||||
key="noticeType"
|
||||
label="通知类型"
|
||||
prop="noticeTypeLabel"
|
||||
prop="typeLabel"
|
||||
min-width="150"
|
||||
>
|
||||
<template #default="scope">
|
||||
<el-tag v-if="scope.row.noticeType == 2" type="warning">
|
||||
系统通知
|
||||
</el-tag>
|
||||
<el-tag v-if="scope.row.noticeType == 1" type="success">
|
||||
通知消息
|
||||
</el-tag>
|
||||
<el-tag v-if="scope.row.type == 2" type="warning">系统通知</el-tag>
|
||||
<el-tag v-if="scope.row.type == 1" type="success">通知消息</el-tag>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column
|
||||
align="center"
|
||||
key="releaseBy"
|
||||
label="发布人"
|
||||
prop="releaseBy"
|
||||
prop="publisherName"
|
||||
min-width="100"
|
||||
/>
|
||||
<el-table-column
|
||||
align="center"
|
||||
key="priority"
|
||||
label="优先级"
|
||||
prop="priority"
|
||||
key="level"
|
||||
label="通知等级"
|
||||
prop="level"
|
||||
min-width="100"
|
||||
>
|
||||
<template #default="scope">
|
||||
<el-tag v-if="scope.row.priority == 0" type="danger">低</el-tag>
|
||||
<el-tag v-if="scope.row.priority == 1" type="success">中</el-tag>
|
||||
<el-tag v-if="scope.row.priority == 2" type="warning">高</el-tag>
|
||||
<el-tag v-if="scope.row.level == 'L'" type="danger">低</el-tag>
|
||||
<el-tag v-if="scope.row.level == 'M'" type="success">中</el-tag>
|
||||
<el-tag v-if="scope.row.level == 'H'" type="warning">高</el-tag>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column
|
||||
align="center"
|
||||
key="tarType"
|
||||
label="通告对象"
|
||||
prop="tarType"
|
||||
label="通告目标类型"
|
||||
prop="targetType"
|
||||
min-width="100"
|
||||
>
|
||||
<template #default="scope">
|
||||
<el-tag v-if="scope.row.tarType == 0" type="warning">全体</el-tag>
|
||||
<el-tag v-if="scope.row.tarType == 1" type="success">指定</el-tag>
|
||||
<el-tag v-if="scope.row.targetType == 1" type="warning">
|
||||
全体
|
||||
</el-tag>
|
||||
<el-tag v-if="scope.row.targetType == 2" type="success">
|
||||
指定
|
||||
</el-tag>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column
|
||||
align="center"
|
||||
key="releaseStatus"
|
||||
label="发布状态"
|
||||
prop="releaseStatus"
|
||||
min-width="100"
|
||||
>
|
||||
<el-table-column align="center" label="发布状态" min-width="100">
|
||||
<template #default="scope">
|
||||
<el-tag v-if="scope.row.releaseStatus == 0" type="warning">
|
||||
<el-tag v-if="scope.row.publishStatus == 0" type="info">
|
||||
未发布
|
||||
</el-tag>
|
||||
<el-tag v-if="scope.row.releaseStatus == 1" type="success">
|
||||
<el-tag v-if="scope.row.publishStatus == 1" type="success">
|
||||
已发布
|
||||
</el-tag>
|
||||
<el-tag v-if="scope.row.releaseStatus == 2" type="primary">
|
||||
<el-tag v-if="scope.row.publishStatus == -1" type="warning">
|
||||
已撤回
|
||||
</el-tag>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column
|
||||
align="center"
|
||||
key="releaseTime"
|
||||
label="发布时间"
|
||||
prop="releaseTime"
|
||||
min-width="100"
|
||||
/>
|
||||
<el-table-column
|
||||
align="center"
|
||||
key="recallTime"
|
||||
label="撤回时间"
|
||||
prop="recallTime"
|
||||
min-width="100"
|
||||
/>
|
||||
<el-table-column align="center" label="操作时间" min-width="220">
|
||||
<template #default="scope">
|
||||
<div class="flex-x-start">
|
||||
<span>创建时间:</span>
|
||||
<span>{{ scope.row.createTime || "-" }}</span>
|
||||
</div>
|
||||
|
||||
<div v-if="scope.row.publishStatus === 1" class="flex-x-start">
|
||||
<span>发布时间:</span>
|
||||
<span>{{ scope.row.publishTime || "-" }}</span>
|
||||
</div>
|
||||
<div
|
||||
v-else-if="scope.row.publishStatus === -1"
|
||||
class="flex-x-start"
|
||||
>
|
||||
<span>撤回时间:</span>
|
||||
<span>{{ scope.row.revokeTime || "-" }}</span>
|
||||
</div>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column align="center" fixed="right" label="操作" width="220">
|
||||
<template #default="scope">
|
||||
<el-button
|
||||
type="primary"
|
||||
size="small"
|
||||
@click="openNoticeDetailDialog(scope.row.id)"
|
||||
link
|
||||
@click="examine(scope.row.id)"
|
||||
>
|
||||
查看
|
||||
</el-button>
|
||||
<el-button
|
||||
v-if="scope.row.releaseStatus != 1"
|
||||
v-hasPerm="['system:notice:release']"
|
||||
v-if="scope.row.publishStatus != 1"
|
||||
v-hasPerm="['sys:notice:publish']"
|
||||
type="primary"
|
||||
size="small"
|
||||
link
|
||||
@click="releaseNotice(scope.row.id)"
|
||||
@click="handlePublishNotice(scope.row.id)"
|
||||
>
|
||||
发布
|
||||
</el-button>
|
||||
<el-button
|
||||
v-if="scope.row.releaseStatus == 1"
|
||||
v-hasPerm="['system:notice:recall']"
|
||||
v-if="scope.row.publishStatus == 1"
|
||||
v-hasPerm="['sys:notice:revoke']"
|
||||
type="primary"
|
||||
size="small"
|
||||
link
|
||||
@@ -189,8 +186,8 @@
|
||||
撤回
|
||||
</el-button>
|
||||
<el-button
|
||||
v-if="scope.row.releaseStatus != 1"
|
||||
v-hasPerm="['system:notice:edit']"
|
||||
v-if="scope.row.publishStatus != 1"
|
||||
v-hasPerm="['sys:notice:edit']"
|
||||
type="primary"
|
||||
size="small"
|
||||
link
|
||||
@@ -199,8 +196,8 @@
|
||||
编辑
|
||||
</el-button>
|
||||
<el-button
|
||||
v-if="scope.row.releaseStatus != 1"
|
||||
v-hasPerm="['system:notice:delete']"
|
||||
v-if="scope.row.publishStatus != 1"
|
||||
v-hasPerm="['sys:notice:delete']"
|
||||
type="danger"
|
||||
size="small"
|
||||
link
|
||||
@@ -239,38 +236,38 @@
|
||||
<el-input v-model="formData.title" placeholder="通知标题" clearable />
|
||||
</el-form-item>
|
||||
<el-form-item label="通知内容" prop="content">
|
||||
<editor
|
||||
<WangEditor
|
||||
v-model="formData.content"
|
||||
style="min-height: 480px; max-height: 500px"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item label="通知类型" prop="noticeType">
|
||||
<el-form-item label="通知类型" prop="type">
|
||||
<dictionary
|
||||
type="button"
|
||||
v-model="formData.noticeType"
|
||||
v-model="formData.type"
|
||||
code="notice_type"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item label="优先级" prop="priority">
|
||||
<el-radio-group v-model="formData.priority">
|
||||
<el-radio :value="0">低</el-radio>
|
||||
<el-radio :value="1">中</el-radio>
|
||||
<el-radio :value="2">高</el-radio>
|
||||
<el-form-item label="优先级" prop="level">
|
||||
<el-radio-group v-model="formData.level">
|
||||
<el-radio value="L">低</el-radio>
|
||||
<el-radio value="M">中</el-radio>
|
||||
<el-radio value="H">高</el-radio>
|
||||
</el-radio-group>
|
||||
</el-form-item>
|
||||
<el-form-item label="目标类型" prop="tarType">
|
||||
<el-radio-group v-model="formData.tarType">
|
||||
<el-radio :value="0">全体</el-radio>
|
||||
<el-radio :value="1">指定</el-radio>
|
||||
<el-form-item label="目标类型" prop="targetType">
|
||||
<el-radio-group v-model="formData.targetType">
|
||||
<el-radio :value="1">全体</el-radio>
|
||||
<el-radio :value="2">指定</el-radio>
|
||||
</el-radio-group>
|
||||
</el-form-item>
|
||||
<el-form-item
|
||||
label="指定用户"
|
||||
prop="tarType"
|
||||
v-if="formData.tarType == 1"
|
||||
prop="targetUserIds"
|
||||
v-if="formData.targetType == 2"
|
||||
>
|
||||
<el-select
|
||||
v-model="formData.tarIds"
|
||||
v-model="formData.targetUserIds"
|
||||
multiple
|
||||
search
|
||||
placeholder="请选择指定用户"
|
||||
@@ -291,19 +288,16 @@
|
||||
</div>
|
||||
</template>
|
||||
</el-dialog>
|
||||
|
||||
<NoticeModal ref="noticeModalRef" />
|
||||
<!-- 通知公告详情 -->
|
||||
<NoticeDetail ref="noticeDetailRef" />
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script setup lang="ts">
|
||||
import NoticeModal from "@/components/NoticeModal/index.vue";
|
||||
|
||||
defineOptions({
|
||||
name: "Notice",
|
||||
inheritAttrs: false,
|
||||
});
|
||||
import Editor from "@/components/WangEditor/index.vue";
|
||||
|
||||
import NoticeAPI, {
|
||||
NoticePageVO,
|
||||
@@ -314,6 +308,7 @@ import UserAPI from "@/api/user";
|
||||
|
||||
const queryFormRef = ref(ElForm);
|
||||
const dataFormRef = ref(ElForm);
|
||||
const noticeDetailRef = ref();
|
||||
|
||||
const loading = ref(false);
|
||||
const ids = ref<number[]>([]);
|
||||
@@ -336,12 +331,10 @@ const dialog = reactive({
|
||||
|
||||
// 通知公告表单数据
|
||||
const formData = reactive<NoticeForm>({
|
||||
priority: 0, // 默认优先级为低
|
||||
tarType: 0, // 默认目标类型为全体
|
||||
level: "L", // 默认优先级为低
|
||||
targetType: 1, // 默认目标类型为全体
|
||||
});
|
||||
|
||||
const noticeModalRef = ref(NoticeModal);
|
||||
|
||||
// 通知公告表单校验规则
|
||||
const rules = reactive({
|
||||
title: [{ required: true, message: "请输入通知标题", trigger: "blur" }],
|
||||
@@ -359,9 +352,7 @@ const rules = reactive({
|
||||
},
|
||||
},
|
||||
],
|
||||
noticeType: [
|
||||
{ required: true, message: "请选择通知类型", trigger: "change" },
|
||||
],
|
||||
type: [{ required: true, message: "请选择通知类型", trigger: "change" }],
|
||||
});
|
||||
|
||||
/** 查询通知公告 */
|
||||
@@ -389,34 +380,33 @@ function handleSelectionChange(selection: any) {
|
||||
ids.value = selection.map((item: any) => item.id);
|
||||
}
|
||||
|
||||
function examine(id: number) {
|
||||
noticeModalRef.value?.open(id, true);
|
||||
}
|
||||
|
||||
/** 打开通知公告弹窗 */
|
||||
function handleOpenDialog(id?: number) {
|
||||
getUserOptions();
|
||||
UserAPI.getOptions().then((data) => {
|
||||
userOptions.value = data;
|
||||
});
|
||||
|
||||
dialog.visible = true;
|
||||
if (id) {
|
||||
dialog.title = "修改通知公告";
|
||||
dialog.title = "修改公告";
|
||||
NoticeAPI.getFormData(id).then((data) => {
|
||||
Object.assign(formData, data);
|
||||
});
|
||||
} else {
|
||||
Object.assign(formData, { priority: 0, tarType: 0 });
|
||||
dialog.title = "新增通知公告";
|
||||
Object.assign(formData, { level: 0, targetType: 0 });
|
||||
dialog.title = "新增公告";
|
||||
}
|
||||
}
|
||||
|
||||
function releaseNotice(id: number) {
|
||||
NoticeAPI.releaseNotice(id).then((res) => {
|
||||
function handlePublishNotice(id: number) {
|
||||
NoticeAPI.publish(id).then(() => {
|
||||
ElMessage.success("发布成功");
|
||||
handleQuery();
|
||||
});
|
||||
}
|
||||
|
||||
function revokeNotice(id: number) {
|
||||
NoticeAPI.revokeNotice(id).then((res) => {
|
||||
NoticeAPI.revoke(id).then(() => {
|
||||
ElMessage.success("撤回成功");
|
||||
handleQuery();
|
||||
});
|
||||
@@ -485,12 +475,9 @@ function handleDelete(id?: number) {
|
||||
);
|
||||
}
|
||||
|
||||
function getUserOptions() {
|
||||
if (userOptions.value.length == 0) {
|
||||
UserAPI.getOptions().then((res) => {
|
||||
userOptions.value = res;
|
||||
});
|
||||
}
|
||||
/** 打开通知公告详情弹窗 */
|
||||
function openNoticeDetailDialog(id: number) {
|
||||
noticeDetailRef.value.openNotice(id);
|
||||
}
|
||||
|
||||
onMounted(() => {
|
||||
|
||||
156
src/views/system/notice/my-notice.vue
Normal file
156
src/views/system/notice/my-notice.vue
Normal file
@@ -0,0 +1,156 @@
|
||||
<template>
|
||||
<div class="app-container">
|
||||
<div class="search-container">
|
||||
<el-form ref="queryFormRef" :model="queryParams" :inline="true">
|
||||
<el-form-item label="通知标题" prop="title">
|
||||
<el-input
|
||||
v-model="queryParams.title"
|
||||
placeholder="关键字"
|
||||
clearable
|
||||
@keyup.enter="handleQuery()"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item>
|
||||
<el-button type="primary" @click="handleQuery()">
|
||||
<i-ep-search />
|
||||
搜索
|
||||
</el-button>
|
||||
<el-button @click="handleResetQuery()">
|
||||
<i-ep-refresh />
|
||||
重置
|
||||
</el-button>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
</div>
|
||||
|
||||
<el-card shadow="never" class="table-container">
|
||||
<el-table
|
||||
ref="dataTableRef"
|
||||
v-loading="loading"
|
||||
:data="pageData"
|
||||
highlight-current-row
|
||||
>
|
||||
<el-table-column type="index" label="序号" width="60" />
|
||||
<el-table-column
|
||||
align="center"
|
||||
key="title"
|
||||
label="通知标题"
|
||||
prop="title"
|
||||
min-width="150"
|
||||
/>
|
||||
<el-table-column
|
||||
align="center"
|
||||
label="通知类型"
|
||||
prop="typeLabel"
|
||||
min-width="150"
|
||||
/>
|
||||
<el-table-column
|
||||
align="center"
|
||||
label="发布人"
|
||||
prop="publisherName"
|
||||
min-width="100"
|
||||
/>
|
||||
<el-table-column align="center" label="通知等级" min-width="100">
|
||||
<template #default="scope">
|
||||
<!-- 翻译字典 字典code 为level,显示不同的tag和label -->
|
||||
<el-tag v-if="scope.row.level == 'L'" type="danger">低</el-tag>
|
||||
<el-tag v-if="scope.row.level == 'M'" type="success">中</el-tag>
|
||||
<el-tag v-if="scope.row.level == 'H'" type="warning">高</el-tag>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column
|
||||
align="center"
|
||||
key="releaseTime"
|
||||
label="发布时间"
|
||||
prop="publishTime"
|
||||
min-width="100"
|
||||
/>
|
||||
|
||||
<el-table-column
|
||||
align="center"
|
||||
label="发布人"
|
||||
prop="publisherName"
|
||||
min-width="100"
|
||||
/>
|
||||
<el-table-column align="center" label="状态" min-width="100">
|
||||
<template #default="scope">
|
||||
<el-tag v-if="scope.row.isRead == 1" type="success">已读</el-tag>
|
||||
<el-tag v-if="scope.row.isRead == 0" type="warning">未读</el-tag>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column align="center" fixed="right" label="操作" width="80">
|
||||
<template #default="scope">
|
||||
<el-button
|
||||
type="primary"
|
||||
size="small"
|
||||
link
|
||||
@click="viewNoticeDetail(scope.row.id)"
|
||||
>
|
||||
查看
|
||||
</el-button>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
|
||||
<pagination
|
||||
v-if="total > 0"
|
||||
v-model:total="total"
|
||||
v-model:page="queryParams.pageNum"
|
||||
v-model:limit="queryParams.pageSize"
|
||||
@pagination="handleQuery()"
|
||||
/>
|
||||
</el-card>
|
||||
|
||||
<NoticeDetail ref="noticeDetailRef" />
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script setup lang="ts">
|
||||
defineOptions({
|
||||
name: "MyNotice",
|
||||
inheritAttrs: false,
|
||||
});
|
||||
|
||||
import NoticeAPI, { NoticePageVO, NoticePageQuery } from "@/api/notice";
|
||||
|
||||
const queryFormRef = ref(ElForm);
|
||||
const noticeDetailRef = ref();
|
||||
|
||||
const pageData = ref<NoticePageVO[]>([]);
|
||||
|
||||
const loading = ref(false);
|
||||
const total = ref(0);
|
||||
|
||||
const queryParams = reactive<NoticePageQuery>({
|
||||
pageNum: 1,
|
||||
pageSize: 10,
|
||||
});
|
||||
|
||||
/** 查询通知公告 */
|
||||
function handleQuery() {
|
||||
loading.value = true;
|
||||
NoticeAPI.getMyNoticePage(queryParams)
|
||||
.then((data) => {
|
||||
pageData.value = data.list;
|
||||
total.value = data.total;
|
||||
})
|
||||
.finally(() => {
|
||||
loading.value = false;
|
||||
});
|
||||
}
|
||||
|
||||
/** 重置通知公告查询 */
|
||||
function handleResetQuery() {
|
||||
queryFormRef.value!.resetFields();
|
||||
queryParams.pageNum = 1;
|
||||
handleQuery();
|
||||
}
|
||||
|
||||
function viewNoticeDetail(id: string) {
|
||||
noticeDetailRef.value.openNotice(id);
|
||||
}
|
||||
|
||||
onMounted(() => {
|
||||
handleQuery();
|
||||
});
|
||||
</script>
|
||||
@@ -4,7 +4,7 @@
|
||||
<el-row :gutter="20">
|
||||
<!-- 部门树 -->
|
||||
<el-col :lg="4" :xs="24" class="mb-[12px]">
|
||||
<dept-tree v-model="queryParams.deptId" @node-click="handleQuery" />
|
||||
<DeptTree v-model="queryParams.deptId" @node-click="handleQuery" />
|
||||
</el-col>
|
||||
|
||||
<!-- 用户列表 -->
|
||||
@@ -289,9 +289,9 @@
|
||||
</el-drawer>
|
||||
|
||||
<!-- 用户导入弹窗 -->
|
||||
<user-import
|
||||
<UserImport
|
||||
v-model:visible="importDialogVisible"
|
||||
@import-success="handleOpenImportDialogSuccess"
|
||||
@import-success="handleUserImportSuccess"
|
||||
/>
|
||||
</div>
|
||||
</template>
|
||||
@@ -306,6 +306,9 @@ import UserAPI, { UserForm, UserPageQuery, UserPageVO } from "@/api/user";
|
||||
import DeptAPI from "@/api/dept";
|
||||
import RoleAPI from "@/api/role";
|
||||
|
||||
import DeptTree from "./dept-tree.vue";
|
||||
import UserImport from "./import.vue";
|
||||
|
||||
const queryFormRef = ref(ElForm);
|
||||
const userFormRef = ref(ElForm);
|
||||
|
||||
@@ -504,7 +507,7 @@ function handleOpenImportDialog() {
|
||||
}
|
||||
|
||||
/** 导入用户成功 */
|
||||
function handleOpenImportDialogSuccess() {
|
||||
function handleUserImportSuccess() {
|
||||
handleQuery();
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user