😎优化报表分组配置相关代码
This commit is contained in:
parent
57db9373ae
commit
57b5f03669
@ -2,7 +2,7 @@
|
||||
"name": "admin.net.pro",
|
||||
"type": "module",
|
||||
"version": "2.4.33",
|
||||
"lastBuildTime": "2025.07.05",
|
||||
"lastBuildTime": "2025.07.07",
|
||||
"description": "Admin.NET 站在巨人肩膀上的 .NET 通用权限开发框架",
|
||||
"author": "zuohuaijun",
|
||||
"license": "MIT",
|
||||
@ -54,7 +54,7 @@
|
||||
"md-editor-v3": "^5.7.1",
|
||||
"mitt": "^3.0.1",
|
||||
"monaco-editor": "^0.52.2",
|
||||
"mqtt": "^5.13.1",
|
||||
"mqtt": "^5.13.2",
|
||||
"nprogress": "^0.2.0",
|
||||
"ol": "^10.6.1",
|
||||
"pinia": "^3.0.3",
|
||||
@ -84,7 +84,7 @@
|
||||
"vue-router": "^4.5.1",
|
||||
"vue-signature-pad": "^3.0.2",
|
||||
"vue3-tree-org": "^4.2.2",
|
||||
"vxe-pc-ui": "^4.6.47",
|
||||
"vxe-pc-ui": "^4.6.48",
|
||||
"vxe-table": "^4.13.52",
|
||||
"xe-utils": "^3.7.5",
|
||||
"xlsx-js-style": "^1.2.0"
|
||||
|
||||
@ -28,7 +28,7 @@
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
<div style="margin-bottom: 45px" v-loading="state.loading">
|
||||
<div style="margin-bottom: 45px" v-loading="state.isLoading">
|
||||
<el-scrollbar>
|
||||
<el-tree
|
||||
v-if="state.treeData"
|
||||
@ -79,9 +79,9 @@ const editReportGroup = ref<InstanceType<typeof EditReportGroup>>();
|
||||
|
||||
const filterText = ref('');
|
||||
const state = reactive({
|
||||
isLoading: false, //是否加载中
|
||||
isLoading: false, // 是否加载中
|
||||
title: '',
|
||||
treeData: [],
|
||||
treeData: [] as any,
|
||||
});
|
||||
|
||||
// 页面初始化
|
||||
@ -128,21 +128,21 @@ const filterNode = (value: string, data: any) => {
|
||||
// 节点操作
|
||||
const handleCommand = async (command: string | number | object) => {
|
||||
if ('expandAll' == command) {
|
||||
//展开分组
|
||||
// 展开分组
|
||||
for (let i = 0; i < treeRef.value!.store._getAllNodes().length; i++) {
|
||||
treeRef.value!.store._getAllNodes()[i].expanded = true;
|
||||
}
|
||||
} else if ('collapseAll' == command) {
|
||||
//折叠分组
|
||||
// 折叠分组
|
||||
for (let i = 0; i < treeRef.value!.store._getAllNodes().length; i++) {
|
||||
treeRef.value!.store._getAllNodes()[i].expanded = false;
|
||||
}
|
||||
} else if ('create' == command) {
|
||||
//新增分组
|
||||
// 新增分组
|
||||
state.title = t('新增分组');
|
||||
editReportGroup.value?.openDialog({});
|
||||
} else if ('edit' == command) {
|
||||
//编辑分组
|
||||
// 编辑分组
|
||||
const currData = treeRef.value!.getCurrentNode();
|
||||
if (!currData) {
|
||||
ElMessage.error(t('请选择分组后编辑'));
|
||||
@ -155,27 +155,26 @@ const handleCommand = async (command: string | number | object) => {
|
||||
state.title = t('编辑分组');
|
||||
editReportGroup.value?.openDialog(currData);
|
||||
} else if ('delete' == command) {
|
||||
//删除分组
|
||||
// 删除分组
|
||||
const currData = treeRef.value!.getCurrentNode();
|
||||
if (currData.id == 0) {
|
||||
if (currData?.id == 0) {
|
||||
ElMessage.error(t('请选择有效的分组节点'));
|
||||
return;
|
||||
}
|
||||
ElMessageBox.confirm(t('确认删除?', { label: currData.label }), t('提示'), {
|
||||
ElMessageBox.confirm(t('确认删除?', { label: currData?.label }), t('提示'), {
|
||||
confirmButtonText: t('确定'),
|
||||
cancelButtonText: t('取消'),
|
||||
type: 'warning',
|
||||
}).then(() => {
|
||||
getAPI(SysReportGroupApi)
|
||||
.apiSysReportGroupDeletePost({ id: recordId })
|
||||
.apiSysReportGroupDeletePost({ id: currData?.id })
|
||||
.then((res) => {
|
||||
ElMessage.success(t('删除成功'));
|
||||
fetchTreeData();
|
||||
});
|
||||
});
|
||||
} else if ('refresh' == command) {
|
||||
//刷新
|
||||
fetchTreeData();
|
||||
fetchTreeData(); // 刷新
|
||||
}
|
||||
};
|
||||
</script>
|
||||
|
||||
Loading…
Reference in New Issue
Block a user