新增系统模块注释

This commit is contained in:
zjl 2024-10-08 09:47:03 +08:00
parent 857bdfe37f
commit 2b53c953c8
21 changed files with 654 additions and 36 deletions

View File

@ -73,6 +73,10 @@
import { onMounted, reactive, ref, shallowRef } from 'vue'; import { onMounted, reactive, ref, shallowRef } from 'vue';
import { message, buildTree } from '@/utils/auth'; import { message, buildTree } from '@/utils/auth';
import { useLockFn } from '@/utils/useLockFn'; import { useLockFn } from '@/utils/useLockFn';
/**
* 定义接收的参数
*/
const props = defineProps({ const props = defineProps({
visible: { visible: {
type: Boolean, type: Boolean,
@ -89,6 +93,10 @@
default: 0, default: 0,
}, },
}); });
/**
* 定义选项数据
*/
const optionData = reactive({ const optionData = reactive({
deptTypeList: [ deptTypeList: [
{ {
@ -111,6 +119,10 @@
}); });
const emit = defineEmits(['success', 'update:visible']); const emit = defineEmits(['success', 'update:visible']);
const formRef = shallowRef<FormInstance>(); const formRef = shallowRef<FormInstance>();
/**
* 定义表单参数
*/
const formData = reactive({ const formData = reactive({
id: '', id: '',
//id //id
@ -121,23 +133,36 @@
name: '', name: '',
// //
sort: 0, sort: 0,
//
note: '', note: '',
}); });
/**
* 关闭窗体
*/
const dialogClose = () => { const dialogClose = () => {
emit('update:visible', false); emit('update:visible', false);
}; };
/**
* 定义上级部门数据选项
*/
const deptOptions = ref<any[]>([]); const deptOptions = ref<any[]>([]);
const getMenu = async () => { /**
* 获取部门数据
*/
const getDept = async () => {
const data: any = await getDeptList(); const data: any = await getDeptList();
const menu: any = [{ id: 0, name: '顶级', children: [] }]; const dept: any = [{ id: 0, name: '顶级', children: [] }];
const lists = buildTree(data); const lists = buildTree(data);
menu[0].children.push(...lists); dept[0].children.push(...lists);
deptOptions.value = menu; deptOptions.value = dept;
}; };
/**
* 执行提交表单数据
*/
const handleSubmit = async () => { const handleSubmit = async () => {
await formRef.value?.validate(); await formRef.value?.validate();
props.deptId ? await deptUpdate(formData) : await deptAdd(formData); props.deptId ? await deptUpdate(formData) : await deptAdd(formData);
@ -148,6 +173,10 @@
const { isLock: subLoading, lockFn: submit } = useLockFn(handleSubmit); const { isLock: subLoading, lockFn: submit } = useLockFn(handleSubmit);
/**
* 设置表单数据
* @param data 参数
*/
const setFormData = (data: Record<any, any>) => { const setFormData = (data: Record<any, any>) => {
for (const key in formData) { for (const key in formData) {
if (data[key] != null && data[key] != undefined) { if (data[key] != null && data[key] != undefined) {
@ -156,13 +185,19 @@
} }
}; };
/**
* 获取部门详情
*/
const getDetail = async () => { const getDetail = async () => {
const data = await getDeptDetail(props.deptId); const data = await getDeptDetail(props.deptId);
setFormData(data); setFormData(data);
}; };
/**
* 钩子函数
*/
onMounted(() => { onMounted(() => {
getMenu(); getDept();
if (props.deptId) { if (props.deptId) {
getDetail(); getDetail();
} else { } else {

View File

@ -98,6 +98,9 @@
const pid = ref(0); const pid = ref(0);
const lists = ref([]); const lists = ref([]);
/**
* 获取部门列表
*/
const getLists = async () => { const getLists = async () => {
loading.value = true; loading.value = true;
try { try {
@ -109,6 +112,10 @@
} }
}; };
/**
*执行添加
* @param parentId 上级ID
*/
const handleAdd = async (parentId: any) => { const handleAdd = async (parentId: any) => {
deptId.value = 0; deptId.value = 0;
pid.value = parentId ? parentId : 0; pid.value = parentId ? parentId : 0;
@ -116,12 +123,20 @@
editVisible.value = true; editVisible.value = true;
}; };
/**
* 执行编辑
* @param data 参数
*/
const handleEdit = async (data: any) => { const handleEdit = async (data: any) => {
deptId.value = data.id; deptId.value = data.id;
await nextTick(); await nextTick();
editVisible.value = true; editVisible.value = true;
}; };
/**
* 执行删除
* @param deptId 部门ID
*/
const handleDelete = async (deptId: number) => { const handleDelete = async (deptId: number) => {
await confirm('确定要删除?'); await confirm('确定要删除?');
try { try {
@ -134,11 +149,19 @@
} }
}; };
/**
* 执行扩展收缩
*/
const handleExpand = () => { const handleExpand = () => {
isExpand.value = !isExpand.value; isExpand.value = !isExpand.value;
toggleExpand(lists.value, isExpand.value); toggleExpand(lists.value, isExpand.value);
}; };
/**
* 扩展收缩函数实现
* @param children 子级数据
* @param unfold
*/
const toggleExpand = (children: any[], unfold = true) => { const toggleExpand = (children: any[], unfold = true) => {
for (const key in children) { for (const key in children) {
tableRef.value?.toggleRowExpansion(children[key], unfold); tableRef.value?.toggleRowExpansion(children[key], unfold);
@ -148,10 +171,16 @@
} }
}; };
/**
* 获取全部数据
*/
const getAll = () => { const getAll = () => {
getLists(); getLists();
}; };
/**
* 钩子函数
*/
onMounted(() => { onMounted(() => {
getAll(); getAll();
}); });

View File

@ -41,6 +41,10 @@
const emit = defineEmits(['success', 'update:visible']); const emit = defineEmits(['success', 'update:visible']);
const formRef = shallowRef<FormInstance>(); const formRef = shallowRef<FormInstance>();
/**
* 定义表单参数
*/
const formData = reactive({ const formData = reactive({
id: '', id: '',
name: '', name: '',
@ -48,6 +52,9 @@
sort: 0, sort: 0,
}); });
/**
* 定义接收的参数
*/
const props = defineProps({ const props = defineProps({
visible: { visible: {
type: Boolean, type: Boolean,
@ -61,6 +68,9 @@
}, },
}); });
/**
* 执行提交表单
*/
const handleSubmit = async () => { const handleSubmit = async () => {
await formRef.value?.validate(); await formRef.value?.validate();
props.levelId ? await levelUpdate(formData) : await levelAdd(formData); props.levelId ? await levelUpdate(formData) : await levelAdd(formData);
@ -69,12 +79,18 @@
emit('success'); emit('success');
}; };
/**
* 关闭窗体
*/
const dialogClose = () => { const dialogClose = () => {
emit('update:visible', false); emit('update:visible', false);
}; };
const { isLock: subLoading, lockFn: submit } = useLockFn(handleSubmit); const { isLock: subLoading, lockFn: submit } = useLockFn(handleSubmit);
/**
* 设置表单数据
*/
const setFormData = async () => { const setFormData = async () => {
const data = await getLevelDetail(props.levelId); const data = await getLevelDetail(props.levelId);
for (const key in formData) { for (const key in formData) {
@ -85,6 +101,9 @@
} }
}; };
/**
* 钩子函数
*/
onMounted(() => { onMounted(() => {
if (props.levelId) { if (props.levelId) {
setFormData(); setFormData();

View File

@ -94,20 +94,40 @@
import { PlusOutlined } from '@vicons/antd'; import { PlusOutlined } from '@vicons/antd';
import { message, confirm, loading, closeLoading } from '@/utils/auth'; import { message, confirm, loading, closeLoading } from '@/utils/auth';
import { useUserStore } from '@/store/modules/user'; import { useUserStore } from '@/store/modules/user';
//
const editDialog = defineAsyncComponent(() => import('./edit.vue')); const editDialog = defineAsyncComponent(() => import('./edit.vue'));
/**
* 定义参数变量
*/
const levelId = ref(0); const levelId = ref(0);
const upload = ref<UploadInstance>(); const upload = ref<UploadInstance>();
const exportLoading = ref(false); const exportLoading = ref(false);
const editVisible = ref(false); const editVisible = ref(false);
const selectionData = ref([]); const selectionData = ref([]);
const tableRef = ref(); const tableRef = ref();
/**
* 定义查询参数
*/
const formParams = reactive({ const formParams = reactive({
//
name: '', name: '',
//
status: '', status: '',
}); });
/**
* 上传请求头设置
*/
const uploadHeaders = reactive({ const uploadHeaders = reactive({
authorization: useUserStore().getToken, authorization: useUserStore().getToken,
}); });
/**
* 定义操作栏
*/
const actionColumn = reactive({ const actionColumn = reactive({
width: 200, width: 200,
label: '操作', label: '操作',
@ -137,14 +157,25 @@
}, },
}); });
/**
* 加载数据列表
*/
const loadDataTable = async (res: any) => { const loadDataTable = async (res: any) => {
const result = await getLevelList({ ...formParams, ...res }); const result = await getLevelList({ ...formParams, ...res });
return result; return result;
}; };
/**
*刷新数据列表
* @param noRefresh 参数
*/
function reloadTable(noRefresh = '') { function reloadTable(noRefresh = '') {
tableRef.value.reload(noRefresh ? {} : { pageNo: 1 }); tableRef.value.reload(noRefresh ? {} : { pageNo: 1 });
} }
/**
* 注册
*/
const [register, {}] = useForm({ const [register, {}] = useForm({
labelWidth: 80, labelWidth: 80,
layout: 'horizontal', layout: 'horizontal',
@ -152,6 +183,11 @@
submitOnReset: true, submitOnReset: true,
schemas, schemas,
}); });
/**
* 执行提交表单
* @param values 参数
*/
function handleSubmit(values: Recordable) { function handleSubmit(values: Recordable) {
handleReset(); handleReset();
for (const key in values) { for (const key in values) {
@ -160,23 +196,38 @@
reloadTable(); reloadTable();
} }
/**
* 执行重置
*/
function handleReset() { function handleReset() {
for (const key in formParams) { for (const key in formParams) {
formParams[key] = ''; formParams[key] = '';
} }
} }
/**
* 执行添加
*/
const handleAdd = async () => { const handleAdd = async () => {
levelId.value = 0; levelId.value = 0;
await nextTick(); await nextTick();
editVisible.value = true; editVisible.value = true;
}; };
/**
* 执行编辑
* @param record 参数
*/
const handleEdit = async (record: Recordable) => { const handleEdit = async (record: Recordable) => {
levelId.value = record.row.id; levelId.value = record.row.id;
await nextTick(); await nextTick();
editVisible.value = true; editVisible.value = true;
}; };
/**
* 执行删除
* @param record 参数
*/
async function handleDelete(record: Recordable) { async function handleDelete(record: Recordable) {
let ids = []; let ids = [];
if (!record) { if (!record) {
@ -187,9 +238,19 @@
message('删除成功'); message('删除成功');
reloadTable(); reloadTable();
} }
/**
* 选项发生变化
* @param value 参数
*/
function onSelectionChange(value) { function onSelectionChange(value) {
selectionData.value = value; selectionData.value = value;
} }
/**
* 上传之前
* @param file 文件
*/
const beforeUpload = (file: UploadFile) => { const beforeUpload = (file: UploadFile) => {
const isLt2M = file.size / 1024 / 1024 < 200; const isLt2M = file.size / 1024 / 1024 < 200;
if (!isLt2M) { if (!isLt2M) {
@ -203,6 +264,10 @@
loading('上传中'); loading('上传中');
return true; return true;
}; };
/**
* 上传成功处理
* @param file 文件
*/
const onSuccess = (file: UploadFile) => { const onSuccess = (file: UploadFile) => {
upload.value!.clearFiles(); upload.value!.clearFiles();
closeLoading(); closeLoading();
@ -213,12 +278,18 @@
message(file.msg ? file.msg : '导入失败', 'error'); message(file.msg ? file.msg : '导入失败', 'error');
} }
}; };
/**
* 上传失败处理
*/
const onError = () => { const onError = () => {
upload.value!.clearFiles(); upload.value!.clearFiles();
closeLoading(); closeLoading();
message('导入失败', 'error'); message('导入失败', 'error');
}; };
//
/**
* 执行导出
*/
const handleExport = async () => { const handleExport = async () => {
exportLoading.value = true; exportLoading.value = true;
const data = await levelExport(); const data = await levelExport();

View File

@ -53,11 +53,19 @@
const editVisible = ref(false); const editVisible = ref(false);
const selectionData = ref([]); const selectionData = ref([]);
const tableRef = ref(); const tableRef = ref();
/**
* 定义查询参数
*/
const formParams = reactive({ const formParams = reactive({
username: '', username: '',
type: '', type: '',
status: '', status: '',
}); });
/**
* 操作栏
*/
const actionColumn = reactive({ const actionColumn = reactive({
width: 200, width: 200,
label: '操作', label: '操作',
@ -71,7 +79,7 @@
label: '详情', label: '详情',
icon: 'View', icon: 'View',
type: 'warning', type: 'warning',
onClick: handleInfo.bind(null, record), onClick: handleDetail.bind(null, record),
auth: ['sys:loginLog:detail'], auth: ['sys:loginLog:detail'],
}, },
{ {
@ -86,14 +94,24 @@
}, },
}); });
/**
* 加载数据表
*/
const loadDataTable = async (res: any) => { const loadDataTable = async (res: any) => {
const result = await getLoginLogList({ ...formParams, ...res }); const result = await getLoginLogList({ ...formParams, ...res });
return result; return result;
}; };
/**
* 刷新数据表
*/
function reloadTable(noRefresh = '') { function reloadTable(noRefresh = '') {
tableRef.value.reload(noRefresh ? {} : { pageNo: 1 }); tableRef.value.reload(noRefresh ? {} : { pageNo: 1 });
} }
/**
* 注册
*/
const [register, {}] = useForm({ const [register, {}] = useForm({
labelWidth: 80, labelWidth: 80,
layout: 'horizontal', layout: 'horizontal',
@ -101,6 +119,11 @@
submitOnReset: true, submitOnReset: true,
schemas, schemas,
}); });
/**
* 执行提交表单
* @param values 参数
*/
function handleSubmit(values: Recordable) { function handleSubmit(values: Recordable) {
handleReset(); handleReset();
for (const key in values) { for (const key in values) {
@ -109,17 +132,28 @@
reloadTable(); reloadTable();
} }
/**
* 执行重置
*/
function handleReset() { function handleReset() {
for (const key in formParams) { for (const key in formParams) {
formParams[key] = ''; formParams[key] = '';
} }
} }
const handleInfo = async (record: Recordable) => {
/**
* 执行查询详情
* @param record 参数
*/
const handleDetail = async (record: Recordable) => {
loginlogId.value = record.row.id; loginlogId.value = record.row.id;
await nextTick(); await nextTick();
editVisible.value = true; editVisible.value = true;
}; };
/**
* 执行删除
*/
async function handleDelete(record: Recordable) { async function handleDelete(record: Recordable) {
let ids = []; let ids = [];
if (!record) { if (!record) {
@ -130,6 +164,11 @@
message('删除成功'); message('删除成功');
reloadTable(); reloadTable();
} }
/**
* 选项发生变量
* @param value 参数
*/
function onSelectionChange(value) { function onSelectionChange(value) {
selectionData.value = value; selectionData.value = value;
} }

View File

@ -55,6 +55,9 @@
const emit = defineEmits(['success', 'update:visible']); const emit = defineEmits(['success', 'update:visible']);
const formData = ref({}); const formData = ref({});
/**
* 定义接收的参数
*/
const props = defineProps({ const props = defineProps({
visible: { visible: {
type: Boolean, type: Boolean,
@ -68,16 +71,26 @@
}, },
}); });
/**
* 关闭窗体
*/
const dialogClose = () => { const dialogClose = () => {
emit('update:visible', false); emit('update:visible', false);
}; };
/**
* 设置表单数据
*/
const setFormData = async () => { const setFormData = async () => {
const data = await getLoginLogDetail(props.loginlogId); const data = await getLoginLogDetail(props.loginlogId);
formData.value = data; formData.value = data;
}; };
/**
* 钩子函数
*/
onMounted(() => { onMounted(() => {
//
if (props.loginlogId) { if (props.loginlogId) {
setFormData(); setFormData();
} }

View File

@ -53,10 +53,18 @@
const editVisible = ref(false); const editVisible = ref(false);
const selectionData = ref([]); const selectionData = ref([]);
const tableRef = ref(); const tableRef = ref();
/**
* 定义查询参数
*/
const formParams = reactive({ const formParams = reactive({
title: '', title: '',
status: '', status: '',
}); });
/**
* 定义操作栏
*/
const actionColumn = reactive({ const actionColumn = reactive({
width: 200, width: 200,
label: '操作', label: '操作',
@ -70,7 +78,7 @@
label: '详情', label: '详情',
icon: 'View', icon: 'View',
type: 'warning', type: 'warning',
onClick: handleInfo.bind(null, record), onClick: handleDetail.bind(null, record),
auth: ['sys:operLog:detail'], auth: ['sys:operLog:detail'],
}, },
{ {
@ -85,14 +93,25 @@
}, },
}); });
/**
* 加载数据列表
*/
const loadDataTable = async (res: any) => { const loadDataTable = async (res: any) => {
const result = await getOperLogList({ ...formParams, ...res }); const result = await getOperLogList({ ...formParams, ...res });
return result; return result;
}; };
/**
* 刷新数据列表
* @param noRefresh 参数
*/
function reloadTable(noRefresh = '') { function reloadTable(noRefresh = '') {
tableRef.value.reload(noRefresh ? {} : { pageNo: 1 }); tableRef.value.reload(noRefresh ? {} : { pageNo: 1 });
} }
/**
* 注册
*/
const [register, {}] = useForm({ const [register, {}] = useForm({
labelWidth: 80, labelWidth: 80,
layout: 'horizontal', layout: 'horizontal',
@ -100,6 +119,11 @@
submitOnReset: true, submitOnReset: true,
schemas, schemas,
}); });
/**
* 执行提交表达那
* @param values 参数
*/
function handleSubmit(values: Recordable) { function handleSubmit(values: Recordable) {
handleReset(); handleReset();
for (const key in values) { for (const key in values) {
@ -108,17 +132,29 @@
reloadTable(); reloadTable();
} }
/**
* 执行重置
*/
function handleReset() { function handleReset() {
for (const key in formParams) { for (const key in formParams) {
formParams[key] = ''; formParams[key] = '';
} }
} }
const handleInfo = async (record: Recordable) => {
/**
* 执行查询详情
* @param record 参数
*/
const handleDetail = async (record: Recordable) => {
operlogId.value = record.row.id; operlogId.value = record.row.id;
await nextTick(); await nextTick();
editVisible.value = true; editVisible.value = true;
}; };
/**
* 执行删除
* @param record 参数
*/
async function handleDelete(record: Recordable) { async function handleDelete(record: Recordable) {
let ids = []; let ids = [];
if (!record) { if (!record) {
@ -129,6 +165,11 @@
message('删除成功'); message('删除成功');
reloadTable(); reloadTable();
} }
/**
* 选项发生变化
* @param value 参数
*/
function onSelectionChange(value) { function onSelectionChange(value) {
selectionData.value = value; selectionData.value = value;
} }

View File

@ -55,6 +55,9 @@
const emit = defineEmits(['success', 'update:visible']); const emit = defineEmits(['success', 'update:visible']);
const formData = ref({}); const formData = ref({});
/**
* 定义接收的参数
*/
const props = defineProps({ const props = defineProps({
visible: { visible: {
type: Boolean, type: Boolean,
@ -68,16 +71,26 @@
}, },
}); });
/**
* 关闭窗体
*/
const dialogClose = () => { const dialogClose = () => {
emit('update:visible', false); emit('update:visible', false);
}; };
/**
* 设置表单数据
*/
const setFormData = async () => { const setFormData = async () => {
const data = await getOperLogDetail(props.operlogId); const data = await getOperLogDetail(props.operlogId);
formData.value = data; formData.value = data;
}; };
/**
* 钩子函数
*/
onMounted(() => { onMounted(() => {
//
if (props.operlogId) { if (props.operlogId) {
setFormData(); setFormData();
} }

View File

@ -126,6 +126,10 @@
import { treeToArray, message, buildTree } from '@/utils/auth'; import { treeToArray, message, buildTree } from '@/utils/auth';
import { useLockFn } from '@/utils/useLockFn'; import { useLockFn } from '@/utils/useLockFn';
import IconPicker from '@/components/icon/picker.vue'; import IconPicker from '@/components/icon/picker.vue';
/**
* 定义接收的参数
*/
const props = defineProps({ const props = defineProps({
visible: { visible: {
type: Boolean, type: Boolean,
@ -155,6 +159,9 @@
cb(results.map((item) => ({ value: item }))); cb(results.map((item) => ({ value: item })));
}; };
/**
* 定义表单参数
*/
const formData = reactive({ const formData = reactive({
id: '', id: '',
//id //id
@ -186,6 +193,9 @@
const menuOptions = ref<any[]>([]); const menuOptions = ref<any[]>([]);
/**
* 获取菜单数据
*/
const getMenu = async () => { const getMenu = async () => {
const data: any = await getMenuList(); const data: any = await getMenuList();
const menu: any = { id: 0, name: '顶级', children: [] }; const menu: any = { id: 0, name: '顶级', children: [] };
@ -194,6 +204,9 @@
menuOptions.value.push(menu); menuOptions.value.push(menu);
}; };
/**
* 执行提交表单
*/
const handleSubmit = async () => { const handleSubmit = async () => {
await formRef.value?.validate(); await formRef.value?.validate();
props.menuId ? await menuUpdate(formData) : await menuAdd(formData); props.menuId ? await menuUpdate(formData) : await menuAdd(formData);
@ -204,6 +217,9 @@
const { isLock: subLoading, lockFn: submit } = useLockFn(handleSubmit); const { isLock: subLoading, lockFn: submit } = useLockFn(handleSubmit);
/**
* 设置表单数据
*/
const setFormData = (data: Record<any, any>) => { const setFormData = (data: Record<any, any>) => {
for (const key in formData) { for (const key in formData) {
if (data[key] != null && data[key] != undefined) { if (data[key] != null && data[key] != undefined) {
@ -217,11 +233,11 @@
setFormData(data); setFormData(data);
}; };
const handleClose = () => { /**
emit('close'); * 钩子函数
}; */
onMounted(() => { onMounted(() => {
//
getMenu(); getMenu();
if (props.menuId) { if (props.menuId) {
getDetail(); getDetail();

View File

@ -127,6 +127,9 @@
const pid = ref(0); const pid = ref(0);
const lists = ref([]); const lists = ref([]);
/**
* 获取菜单列表
*/
const getLists = async () => { const getLists = async () => {
loading.value = true; loading.value = true;
try { try {
@ -138,6 +141,10 @@
} }
}; };
/**
* 执行添加
* @param parentId 上级ID
*/
const handleAdd = async (parentId: any) => { const handleAdd = async (parentId: any) => {
menuId.value = 0; menuId.value = 0;
pid.value = parentId ? parentId : 0; pid.value = parentId ? parentId : 0;
@ -145,6 +152,10 @@
editVisible.value = true; editVisible.value = true;
}; };
/**
* 执行编辑
* @param data 参数
*/
const handleEdit = async (data: any) => { const handleEdit = async (data: any) => {
menuId.value = data.id; menuId.value = data.id;
await nextTick(); await nextTick();
@ -163,11 +174,17 @@
} }
}; };
/**
* 执行扩展收缩
*/
const handleExpand = () => { const handleExpand = () => {
isExpand.value = !isExpand.value; isExpand.value = !isExpand.value;
toggleExpand(lists.value, isExpand.value); toggleExpand(lists.value, isExpand.value);
}; };
/**
* 扩展收缩实现
*/
const toggleExpand = (children: any[], unfold = true) => { const toggleExpand = (children: any[], unfold = true) => {
for (const key in children) { for (const key in children) {
tableRef.value?.toggleRowExpansion(children[key], unfold); tableRef.value?.toggleRowExpansion(children[key], unfold);
@ -177,11 +194,18 @@
} }
}; };
/**
* 获取全部数据
*/
const getAll = () => { const getAll = () => {
getLists(); getLists();
}; };
/**
* 钩子函数
*/
onMounted(() => { onMounted(() => {
//
getAll(); getAll();
}); });

View File

@ -41,6 +41,10 @@
const emit = defineEmits(['success', 'update:visible']); const emit = defineEmits(['success', 'update:visible']);
const formRef = shallowRef<FormInstance>(); const formRef = shallowRef<FormInstance>();
/**
* 定义表单参数
*/
const formData = reactive({ const formData = reactive({
id: '', id: '',
name: '', name: '',
@ -48,6 +52,9 @@
sort: 0, sort: 0,
}); });
/**
* 定义接收的参数
*/
const props = defineProps({ const props = defineProps({
visible: { visible: {
type: Boolean, type: Boolean,
@ -61,6 +68,9 @@
}, },
}); });
/**
* 执行提交表单
*/
const handleSubmit = async () => { const handleSubmit = async () => {
await formRef.value?.validate(); await formRef.value?.validate();
props.positionId ? await positionUpdate(formData) : await positionAdd(formData); props.positionId ? await positionUpdate(formData) : await positionAdd(formData);
@ -69,12 +79,18 @@
emit('success'); emit('success');
}; };
/**
* 关闭窗体
*/
const dialogClose = () => { const dialogClose = () => {
emit('update:visible', false); emit('update:visible', false);
}; };
const { isLock: subLoading, lockFn: submit } = useLockFn(handleSubmit); const { isLock: subLoading, lockFn: submit } = useLockFn(handleSubmit);
/**
* 设置表单数据
*/
const setFormData = async () => { const setFormData = async () => {
const data = await getPositionDetail(props.positionId); const data = await getPositionDetail(props.positionId);
for (const key in formData) { for (const key in formData) {
@ -85,6 +101,9 @@
} }
}; };
/**
* 钩子函数
*/
onMounted(() => { onMounted(() => {
if (props.positionId) { if (props.positionId) {
setFormData(); setFormData();

View File

@ -62,10 +62,18 @@
const editVisible = ref(false); const editVisible = ref(false);
const selectionData = ref([]); const selectionData = ref([]);
const tableRef = ref(); const tableRef = ref();
/**
* 定义查询参数
*/
const formParams = reactive({ const formParams = reactive({
name: '', name: '',
status: '', status: '',
}); });
/**
* 定义操作栏
*/
const actionColumn = reactive({ const actionColumn = reactive({
width: 200, width: 200,
label: '操作', label: '操作',
@ -94,14 +102,26 @@
}, },
}); });
/**
* 加载数据列表
* @param res 参数
*/
const loadDataTable = async (res: any) => { const loadDataTable = async (res: any) => {
const result = await getPositionList({ ...formParams, ...res }); const result = await getPositionList({ ...formParams, ...res });
return result; return result;
}; };
/**
* 刷新数据列表
* @param noRefresh 参数
*/
function reloadTable(noRefresh = '') { function reloadTable(noRefresh = '') {
tableRef.value.reload(noRefresh ? {} : { pageNo: 1 }); tableRef.value.reload(noRefresh ? {} : { pageNo: 1 });
} }
/**
* 注册
*/
const [register, {}] = useForm({ const [register, {}] = useForm({
labelWidth: 80, labelWidth: 80,
layout: 'horizontal', layout: 'horizontal',
@ -109,6 +129,10 @@
submitOnReset: true, submitOnReset: true,
schemas, schemas,
}); });
/**
* 执行提交表单
*/
function handleSubmit(values: Recordable) { function handleSubmit(values: Recordable) {
handleReset(); handleReset();
for (const key in values) { for (const key in values) {
@ -117,23 +141,38 @@
reloadTable(); reloadTable();
} }
/**
* 执行重置
*/
function handleReset() { function handleReset() {
for (const key in formParams) { for (const key in formParams) {
formParams[key] = ''; formParams[key] = '';
} }
} }
/**
* 执行添加
*/
const handleAdd = async () => { const handleAdd = async () => {
positionId.value = 0; positionId.value = 0;
await nextTick(); await nextTick();
editVisible.value = true; editVisible.value = true;
}; };
/**
* 执行编辑
* @param record 参数
*/
const handleEdit = async (record: Recordable) => { const handleEdit = async (record: Recordable) => {
positionId.value = record.row.id; positionId.value = record.row.id;
await nextTick(); await nextTick();
editVisible.value = true; editVisible.value = true;
}; };
/**
* 执行删除
* @param record 参数
*/
async function handleDelete(record: Recordable) { async function handleDelete(record: Recordable) {
let ids = []; let ids = [];
if (!record) { if (!record) {
@ -144,6 +183,11 @@
message('删除成功'); message('删除成功');
reloadTable(); reloadTable();
} }
/**
* 选项发生变化
* @param value 参数
*/
function onSelectionChange(value) { function onSelectionChange(value) {
selectionData.value = value; selectionData.value = value;
} }

View File

@ -43,6 +43,16 @@
import { nextTick, onMounted, ref, shallowRef } from 'vue'; import { nextTick, onMounted, ref, shallowRef } from 'vue';
import { useLockFn } from '@/utils/useLockFn'; import { useLockFn } from '@/utils/useLockFn';
const emit = defineEmits(['success', 'update:visible']);
const treeRef = shallowRef<InstanceType<typeof ElTree>>();
const formRef = shallowRef<FormInstance>();
const isExpand = ref(false);
const menuArray = ref<any[]>([]);
const menuTree = ref<any[]>([]);
/**
* 定义接收的参数
*/
const props = defineProps({ const props = defineProps({
visible: { visible: {
type: Boolean, type: Boolean,
@ -55,12 +65,6 @@
default: 0, default: 0,
}, },
}); });
const emit = defineEmits(['success', 'update:visible']);
const treeRef = shallowRef<InstanceType<typeof ElTree>>();
const formRef = shallowRef<FormInstance>();
const isExpand = ref(false);
const menuArray = ref<any[]>([]);
const menuTree = ref<any[]>([]);
// //
const getDeptAllCheckedKeys = () => { const getDeptAllCheckedKeys = () => {
@ -70,6 +74,9 @@
return checkedKeys; return checkedKeys;
}; };
/**
* 执行扩展收缩
*/
const handleExpand = (check: CheckboxValueType) => { const handleExpand = (check: CheckboxValueType) => {
const treeList = menuTree.value; const treeList = menuTree.value;
for (let i = 0; i < treeList.length; i++) { for (let i = 0; i < treeList.length; i++) {
@ -77,6 +84,9 @@
} }
}; };
/**
* 执行选中全部
*/
const handleSelectAll = (check: CheckboxValueType) => { const handleSelectAll = (check: CheckboxValueType) => {
if (check) { if (check) {
treeRef.value?.setCheckedKeys(menuArray.value.map((item) => item.id)); treeRef.value?.setCheckedKeys(menuArray.value.map((item) => item.id));
@ -85,6 +95,9 @@
} }
}; };
/**
* 执行提交表单
*/
const handleSubmit = async () => { const handleSubmit = async () => {
await formRef.value?.validate(); await formRef.value?.validate();
const menuIds = getDeptAllCheckedKeys()!; const menuIds = getDeptAllCheckedKeys()!;
@ -96,10 +109,16 @@
const { isLock: subLoading, lockFn: submit } = useLockFn(handleSubmit); const { isLock: subLoading, lockFn: submit } = useLockFn(handleSubmit);
/**
* 关闭窗体
*/
const dialogClose = () => { const dialogClose = () => {
emit('update:visible', false); emit('update:visible', false);
}; };
/**
* 设置表单数据
*/
const setFormData = async () => { const setFormData = async () => {
const data = await getRoleMenuList(props.roleId); const data = await getRoleMenuList(props.roleId);
menuTree.value = buildTree(data); menuTree.value = buildTree(data);
@ -113,6 +132,9 @@
}); });
}; };
/**
* 钩子函数
*/
onMounted(() => { onMounted(() => {
setFormData(); setFormData();
}); });

View File

@ -45,6 +45,10 @@
const emit = defineEmits(['success', 'update:visible']); const emit = defineEmits(['success', 'update:visible']);
const formRef = shallowRef<FormInstance>(); const formRef = shallowRef<FormInstance>();
/**
* 定义表单参数
*/
const formData = reactive({ const formData = reactive({
id: '', id: '',
name: '', name: '',
@ -53,6 +57,9 @@
note: '', note: '',
}); });
/**
* 定义接收的参数
*/
const props = defineProps({ const props = defineProps({
visible: { visible: {
type: Boolean, type: Boolean,
@ -66,6 +73,9 @@
}, },
}); });
/**
* 执行提交表单
*/
const handleSubmit = async () => { const handleSubmit = async () => {
await formRef.value?.validate(); await formRef.value?.validate();
props.roleId ? await roleUpdate(formData) : await roleAdd(formData); props.roleId ? await roleUpdate(formData) : await roleAdd(formData);
@ -74,12 +84,18 @@
emit('success'); emit('success');
}; };
/**
* 关闭窗体
*/
const dialogClose = () => { const dialogClose = () => {
emit('update:visible', false); emit('update:visible', false);
}; };
const { isLock: subLoading, lockFn: submit } = useLockFn(handleSubmit); const { isLock: subLoading, lockFn: submit } = useLockFn(handleSubmit);
/**
* 设置表单数据
*/
const setFormData = async () => { const setFormData = async () => {
const data = await getRoleDetail(props.roleId); const data = await getRoleDetail(props.roleId);
for (const key in formData) { for (const key in formData) {
@ -90,6 +106,9 @@
} }
}; };
/**
* 钩子函数
*/
onMounted(() => { onMounted(() => {
if (props.roleId) { if (props.roleId) {
setFormData(); setFormData();

View File

@ -63,17 +63,32 @@
import { columns } from './columns'; import { columns } from './columns';
import { PlusOutlined } from '@vicons/antd'; import { PlusOutlined } from '@vicons/antd';
import { message, confirm } from '@/utils/auth'; import { message, confirm } from '@/utils/auth';
const formParams = reactive({
name: '', /**
}); * 注册组件
*/
const editDialog = defineAsyncComponent(() => import('./edit.vue')); const editDialog = defineAsyncComponent(() => import('./edit.vue'));
const authDialog = defineAsyncComponent(() => import('./auth.vue')); const authDialog = defineAsyncComponent(() => import('./auth.vue'));
/**
* 定义参数变量
*/
const roleId = ref(0); const roleId = ref(0);
const editVisible = ref(false); const editVisible = ref(false);
const authVisible = ref(false); const authVisible = ref(false);
const selectionData = ref([]); const selectionData = ref([]);
const tableRef = ref(); const tableRef = ref();
/**
* 定义表单参数
*/
const formParams = reactive({
name: '',
});
/**
* 定义操作栏
*/
const actionColumn = reactive({ const actionColumn = reactive({
width: 300, width: 300,
label: '操作', label: '操作',
@ -111,14 +126,25 @@
}, },
}); });
/**
* 加载数据列表
*/
const loadDataTable = async (res: any) => { const loadDataTable = async (res: any) => {
const result = await getRoleList({ ...formParams, ...res }); const result = await getRoleList({ ...formParams, ...res });
return result; return result;
}; };
/**
* 刷新数据列表
* @param noRefresh 参数
*/
function reloadTable(noRefresh = '') { function reloadTable(noRefresh = '') {
tableRef.value.reload(noRefresh ? {} : { pageNo: 1 }); tableRef.value.reload(noRefresh ? {} : { pageNo: 1 });
} }
/**
* 注册
*/
const [register, {}] = useForm({ const [register, {}] = useForm({
labelWidth: 80, labelWidth: 80,
layout: 'horizontal', layout: 'horizontal',
@ -126,6 +152,11 @@
submitOnReset: true, submitOnReset: true,
schemas, schemas,
}); });
/**
* 执行提交表单
* @param values 参数
*/
function handleSubmit(values: Recordable) { function handleSubmit(values: Recordable) {
handleReset(); handleReset();
for (const key in values) { for (const key in values) {
@ -134,28 +165,48 @@
reloadTable(); reloadTable();
} }
/**
* 执行重置
*/
function handleReset() { function handleReset() {
for (const key in formParams) { for (const key in formParams) {
formParams[key] = ''; formParams[key] = '';
} }
} }
/**
* 执行添加
*/
const handleAdd = async () => { const handleAdd = async () => {
roleId.value = 0; roleId.value = 0;
await nextTick(); await nextTick();
editVisible.value = true; editVisible.value = true;
}; };
/**
* 执行编辑
* @param record 参数
*/
const handleEdit = async (record: Recordable) => { const handleEdit = async (record: Recordable) => {
roleId.value = record.row.id; roleId.value = record.row.id;
await nextTick(); await nextTick();
editVisible.value = true; editVisible.value = true;
}; };
/**
* 执行权限设置
* @param record 参数
*/
const handleAuth = async (record: Recordable) => { const handleAuth = async (record: Recordable) => {
roleId.value = record.row.id; roleId.value = record.row.id;
await nextTick(); await nextTick();
authVisible.value = true; authVisible.value = true;
}; };
/**
* 执行删除
* @param record 参数
*/
async function handleDelete(record: Recordable) { async function handleDelete(record: Recordable) {
let ids = []; let ids = [];
if (!record) { if (!record) {
@ -166,6 +217,11 @@
message('删除成功'); message('删除成功');
reloadTable(); reloadTable();
} }
/**
* 选项发生变化
* @param value 参数
*/
function onSelectionChange(value) { function onSelectionChange(value) {
selectionData.value = value; selectionData.value = value;
} }

View File

@ -3,9 +3,9 @@ export const schemas: FormSchema[] = [
{ {
field: 'name', field: 'name',
component: 'Input', component: 'Input',
label: '角色名', label: '角色名',
componentProps: { componentProps: {
placeholder: '请输入角色名', placeholder: '请输入角色名',
}, },
}, },
]; ];

View File

@ -173,6 +173,10 @@
const formRef = shallowRef<FormInstance>(); const formRef = shallowRef<FormInstance>();
import { useLockFn } from '@/utils/useLockFn'; import { useLockFn } from '@/utils/useLockFn';
/**
* 定义接收的参数
*/
const props = defineProps({ const props = defineProps({
visible: { visible: {
type: Boolean, type: Boolean,
@ -187,6 +191,10 @@
}); });
const emit = defineEmits(['success', 'update:visible']); const emit = defineEmits(['success', 'update:visible']);
/**
* 定义表单参数
*/
const formData = reactive({ const formData = reactive({
id: 0, id: 0,
code: '', code: '',
@ -205,10 +213,17 @@
number: '', number: '',
}); });
/**
* 关闭窗体
*/
const dialogClose = () => { const dialogClose = () => {
emit('update:visible', false); emit('update:visible', false);
}; };
/**
* 设置表单数据
* @param row 参数
*/
const setFormData = async (row: any) => { const setFormData = async (row: any) => {
const data = await getTenantDetail(row.tenantId); const data = await getTenantDetail(row.tenantId);
for (const key in formData) { for (const key in formData) {
@ -231,6 +246,9 @@
} }
}; };
/**
* 执行提交表单
*/
const handleSubmit = async () => { const handleSubmit = async () => {
await formRef.value?.validate(); await formRef.value?.validate();
props.tenantId ? await tenantUpdate(formData) : await tenantAdd(formData); props.tenantId ? await tenantUpdate(formData) : await tenantAdd(formData);
@ -240,6 +258,9 @@
const { isLock: subLoading, lockFn: submit } = useLockFn(handleSubmit); const { isLock: subLoading, lockFn: submit } = useLockFn(handleSubmit);
/**
* 钩子函数
*/
onMounted(() => { onMounted(() => {
if (props.tenantId) { if (props.tenantId) {
setFormData({ tenantId: props.tenantId }); setFormData({ tenantId: props.tenantId });

View File

@ -74,11 +74,20 @@
const editVisible = ref(false); const editVisible = ref(false);
const selectionData = ref([]); const selectionData = ref([]);
const editDialog = defineAsyncComponent(() => import('./edit.vue')); const editDialog = defineAsyncComponent(() => import('./edit.vue'));
/**
* 定义查询参数
*/
const formParams = reactive({ const formParams = reactive({
//
name: '', name: '',
//
status: '', status: '',
}); });
/**
* 定义操作栏
*/
const actionColumn = reactive({ const actionColumn = reactive({
width: 320, width: 320,
label: '操作', label: '操作',
@ -115,25 +124,54 @@
}, },
}); });
/**
* 加载数据列表
* @param res 参数
*/
const loadDataTable = async (res) => { const loadDataTable = async (res) => {
const result = await getTenantList({ ...formParams, ...res }); const result = await getTenantList({ ...formParams, ...res });
return result; return result;
}; };
/**
* 刷新数据列表
* @param noRefresh 参数
*/
function reloadTable(noRefresh = '') { function reloadTable(noRefresh = '') {
tableRef.value.reload(noRefresh ? {} : { pageNo: 1 }); tableRef.value.reload(noRefresh ? {} : { pageNo: 1 });
} }
/**
* 添加添加
*/
function addTenant() {
tenantId.value = 0;
editVisible.value = true;
}
/**
* 执行编辑
* @param record 参数
*/
async function handleEdit(record: Recordable) { async function handleEdit(record: Recordable) {
tenantId.value = record.row.id; tenantId.value = record.row.id;
await nextTick(); await nextTick();
editVisible.value = true; editVisible.value = true;
} }
/**
* 执行添加账号
* @param recored 参数
*/
const handleAddAccount = async (recored: Recordable) => { const handleAddAccount = async (recored: Recordable) => {
await tenantAccount({ tenantId: recored.row.id }); await tenantAccount({ tenantId: recored.row.id });
message('创建成功'); message('创建成功');
}; };
/**
* 执行删除
* @param record 参数
*/
async function handleDelete(record: Recordable) { async function handleDelete(record: Recordable) {
let ids = []; let ids = [];
if (!record) { if (!record) {
@ -145,6 +183,10 @@
reloadTable(); reloadTable();
} }
/**
* 执行提交表单
* @param values 参数
*/
function handleSubmit(values: Recordable) { function handleSubmit(values: Recordable) {
handleReset(); handleReset();
for (const key in values) { for (const key in values) {
@ -153,14 +195,26 @@
reloadTable(); reloadTable();
} }
/**
* 执行重置
*/
function handleReset() { function handleReset() {
for (const key in formParams) { for (const key in formParams) {
formParams[key] = ''; formParams[key] = '';
} }
} }
/**
* 选项发生变化
* @param value 参数
*/
function onSelectionChange(value) { function onSelectionChange(value) {
selectionData.value = value; selectionData.value = value;
} }
/**
* 注册
*/
const [register, {}] = useForm({ const [register, {}] = useForm({
labelWidth: 80, labelWidth: 80,
layout: 'horizontal', layout: 'horizontal',
@ -168,11 +222,6 @@
submitOnReset: true, submitOnReset: true,
schemas, schemas,
}); });
//
function addTenant() {
tenantId.value = 0;
editVisible.value = true;
}
</script> </script>
<style lang="scss" scoped></style> <style lang="scss" scoped></style>

View File

@ -248,6 +248,10 @@
import { useGlobSetting } from '@/hooks/setting'; import { useGlobSetting } from '@/hooks/setting';
import { useUserStore } from '@/store/modules/user'; import { useUserStore } from '@/store/modules/user';
const globSetting = useGlobSetting(); const globSetting = useGlobSetting();
/**
* 定义接收的参数
*/
const props = defineProps({ const props = defineProps({
visible: { visible: {
type: Boolean, type: Boolean,
@ -262,6 +266,10 @@
}); });
const cropperCircled = ref(); const cropperCircled = ref();
const emit = defineEmits(['success', 'update:visible']); const emit = defineEmits(['success', 'update:visible']);
/**
* 定义表单参数
*/
const formData = reactive({ const formData = reactive({
id: 0, id: 0,
avatarName: '', avatarName: '',
@ -292,14 +300,26 @@
callback(); callback();
}; };
/**
* 执行上传
* @param data 参数
*/
const uploadSuccess = (data) => { const uploadSuccess = (data) => {
formData.avatar = data.fileUrl; formData.avatar = data.fileUrl;
formRef.value?.validateField('avatar'); formRef.value?.validateField('avatar');
}; };
/**
* 关闭窗体
*/
const dialogClose = () => { const dialogClose = () => {
emit('update:visible', false); emit('update:visible', false);
}; };
/**
* 设置表单数据
* @param row 参数
*/
const setFormData = async (row: any) => { const setFormData = async (row: any) => {
const data = await getUserDetail(row.userId); const data = await getUserDetail(row.userId);
for (const key in formData) { for (const key in formData) {
@ -322,6 +342,9 @@
} }
}; };
/**
* 执行提交表单
*/
const handleSubmit = async () => { const handleSubmit = async () => {
await formRef.value?.validate(); await formRef.value?.validate();
props.userId ? await userUpdate(formData) : await userAdd(formData); props.userId ? await userUpdate(formData) : await userAdd(formData);
@ -331,6 +354,9 @@
const { isLock: subLoading, lockFn: submit } = useLockFn(handleSubmit); const { isLock: subLoading, lockFn: submit } = useLockFn(handleSubmit);
/**
* 定义选项数据
*/
const optionData = reactive({ const optionData = reactive({
roleList: [], roleList: [],
deptList: [], deptList: [],
@ -346,6 +372,9 @@
console.log(file); console.log(file);
}; };
/**
* 获取全部字典数据
*/
const getAllDict = async () => { const getAllDict = async () => {
let list = await getRoleAllList(); let list = await getRoleAllList();
optionData.roleList = list ? list : []; optionData.roleList = list ? list : [];
@ -356,6 +385,10 @@
list = await getPositionAllList(); list = await getPositionAllList();
optionData.positionList = list ? list : []; optionData.positionList = list ? list : [];
}; };
/**
* 钩子函数
*/
onMounted(() => { onMounted(() => {
getAllDict(); getAllDict();
if (props.userId) { if (props.userId) {

View File

@ -124,12 +124,19 @@
const exportLoading = ref(false); const exportLoading = ref(false);
const editDialog = defineAsyncComponent(() => import('./edit.vue')); const editDialog = defineAsyncComponent(() => import('./edit.vue'));
const userUpload = defineAsyncComponent(() => import('./userUpload.vue')); const userUpload = defineAsyncComponent(() => import('./userUpload.vue'));
/**
* 定义查询参数
*/
const formParams = reactive({ const formParams = reactive({
realname: '', realname: '',
role: '', role: '',
status: '', status: '',
}); });
/**
* 定义操作栏
*/
const actionColumn = reactive({ const actionColumn = reactive({
width: 400, width: 400,
label: '操作', label: '操作',
@ -185,26 +192,53 @@
}, },
}); });
/**
* 加载数据列表
*/
const loadDataTable = async (res) => { const loadDataTable = async (res) => {
const result = await getUserList({ ...formParams, ...res }); const result = await getUserList({ ...formParams, ...res });
return result; return result;
}; };
/**
* 刷新数据列表
* @param noRefresh 参数
*/
function reloadTable(noRefresh = '') { function reloadTable(noRefresh = '') {
tableRef.value.reload(noRefresh ? {} : { pageNo: 1 }); tableRef.value.reload(noRefresh ? {} : { pageNo: 1 });
} }
/**
* 执行添加
*/
function addUser() {
userId.value = 0;
editVisible.value = true;
}
/**
* 执行编辑
*/
async function handleEdit(record: Recordable) { async function handleEdit(record: Recordable) {
userId.value = record.row.id; userId.value = record.row.id;
await nextTick(); await nextTick();
editVisible.value = true; editVisible.value = true;
} }
/**
* 执行重置密码
* @param record 参数
*/
async function handleResetPassWord(record: Recordable) { async function handleResetPassWord(record: Recordable) {
await confirm('确定重置密码?'); await confirm('确定重置密码?');
await resetPwd({ userId: record.row.id }); await resetPwd({ userId: record.row.id });
message('重置成功'); message('重置成功');
} }
/**
* 执行删除
* @param record 参数
*/
async function handleDelete(record: Recordable) { async function handleDelete(record: Recordable) {
let ids = []; let ids = [];
if (!record) { if (!record) {
@ -215,6 +249,11 @@
message('删除成功'); message('删除成功');
reloadTable(); reloadTable();
} }
/**
* 执行打印
* @param record 参数
*/
const handlePrint = async (record: Recordable) => { const handlePrint = async (record: Recordable) => {
const res = await getUserDocument(record.row.id); const res = await getUserDocument(record.row.id);
printJS({ printJS({
@ -224,6 +263,10 @@
}); });
}; };
/**
* 执行提交表单
* @param values 参数
*/
function handleSubmit(values: Recordable) { function handleSubmit(values: Recordable) {
handleReset(); handleReset();
for (const key in values) { for (const key in values) {
@ -232,14 +275,26 @@
reloadTable(); reloadTable();
} }
/**
* 执行重置
*/
function handleReset() { function handleReset() {
for (const key in formParams) { for (const key in formParams) {
formParams[key] = ''; formParams[key] = '';
} }
} }
/**
* 选项发生变化
* @param value 参数
*/
function onSelectionChange(value) { function onSelectionChange(value) {
selectionData.value = value; selectionData.value = value;
} }
/**
* 注册
*/
const [register, {}] = useForm({ const [register, {}] = useForm({
labelWidth: 80, labelWidth: 80,
layout: 'horizontal', layout: 'horizontal',
@ -247,13 +302,10 @@
submitOnReset: true, submitOnReset: true,
schemas, schemas,
}); });
//
function addUser() {
userId.value = 0;
editVisible.value = true;
}
// /**
* 执行导出
*/
const handleExport = async () => { const handleExport = async () => {
exportLoading.value = true; exportLoading.value = true;
const data = await userExport(); const data = await userExport();

View File

@ -39,6 +39,9 @@
import { useUserStore } from '@/store/modules/user'; import { useUserStore } from '@/store/modules/user';
/**
* 定义接收的参数
*/
const props = defineProps({ const props = defineProps({
visible: { visible: {
type: Boolean, type: Boolean,