diff --git a/package-lock.json b/package-lock.json index 2aa213df..8d4bdf39 100644 --- a/package-lock.json +++ b/package-lock.json @@ -12,8 +12,8 @@ "@chenfengyuan/vue-qrcode": "^2.0.0", "@element-plus/icons-vue": "^2.0.10", "@highlightjs/vue-plugin": "^2.1.0", - "@wangeditor/editor": "^5.1.23", - "@wangeditor/editor-for-vue": "^5.1.12", + "@wangeditor/editor": "5.1.23", + "@wangeditor/editor-for-vue": "5.1.12", "axios": "^1.3.3", "crypto-js": "^3.1.9-1", "echarts": "^5.4.1", @@ -28,6 +28,7 @@ "qs": "^6.11.0", "screenfull": "^6.0.2", "sortablejs": "^1.15.0", + "splitpanes": "^3.1.5", "vue": "^3.2.47", "vue-clipboard3": "^2.0.0", "vue-i18n": "^9.2.2", @@ -3707,6 +3708,12 @@ "integrity": "sha512-9NykojV5Uih4lgo5So5dtw+f0JgJX30KCNI8gwhz2J9A15wD0Ml6tjHKwf6fTSa6fAdVBdZeNOs9eJ71qCk8vA==", "license": "MIT" }, + "node_modules/splitpanes": { + "version": "3.1.5", + "resolved": "https://registry.npmmirror.com/splitpanes/-/splitpanes-3.1.5.tgz", + "integrity": "sha512-r3Mq2ITFQ5a2VXLOy4/Sb2Ptp7OfEO8YIbhVJqJXoFc9hc5nTXXkCvtVDjIGbvC0vdE7tse+xTM9BMjsszP6bw==", + "license": "MIT" + }, "node_modules/ssr-window": { "version": "3.0.0", "resolved": "https://registry.npmmirror.com/ssr-window/-/ssr-window-3.0.0.tgz", @@ -7183,6 +7190,11 @@ "resolved": "https://registry.npmmirror.com/sourcemap-codec/-/sourcemap-codec-1.4.8.tgz", "integrity": "sha512-9NykojV5Uih4lgo5So5dtw+f0JgJX30KCNI8gwhz2J9A15wD0Ml6tjHKwf6fTSa6fAdVBdZeNOs9eJ71qCk8vA==" }, + "splitpanes": { + "version": "3.1.5", + "resolved": "https://registry.npmmirror.com/splitpanes/-/splitpanes-3.1.5.tgz", + "integrity": "sha512-r3Mq2ITFQ5a2VXLOy4/Sb2Ptp7OfEO8YIbhVJqJXoFc9hc5nTXXkCvtVDjIGbvC0vdE7tse+xTM9BMjsszP6bw==" + }, "ssr-window": { "version": "3.0.0", "resolved": "https://registry.npmmirror.com/ssr-window/-/ssr-window-3.0.0.tgz", diff --git a/package.json b/package.json index 8d33a6de..8c63102f 100644 --- a/package.json +++ b/package.json @@ -14,7 +14,6 @@ "@chenfengyuan/vue-qrcode": "^2.0.0", "@element-plus/icons-vue": "^2.0.10", "@highlightjs/vue-plugin": "^2.1.0", - "@wangeditor/editor": "5.1.23", "@wangeditor/editor-for-vue": "5.1.12", "axios": "^1.3.3", "crypto-js": "^3.1.9-1", @@ -30,6 +29,7 @@ "qs": "^6.11.0", "screenfull": "^6.0.2", "sortablejs": "^1.15.0", + "splitpanes": "^3.1.5", "vue": "^3.2.47", "vue-clipboard3": "^2.0.0", "vue-i18n": "^9.2.2", diff --git a/src/components/ShortcutCard/index.vue b/src/components/ShortcutCard/index.vue new file mode 100644 index 00000000..fde0a6a8 --- /dev/null +++ b/src/components/ShortcutCard/index.vue @@ -0,0 +1,88 @@ + + + + + diff --git a/src/stores/userInfo.ts b/src/stores/userInfo.ts index cbe14921..b0cdf383 100644 --- a/src/stores/userInfo.ts +++ b/src/stores/userInfo.ts @@ -47,7 +47,7 @@ export const useUserInfo = defineStore('userInfo', { resolve(res); }) .catch((err) => { - useMessage().error(err.msg); + useMessage().error('服务器异常,请联系管理员'); reject(err); }); }); diff --git a/src/views/admin/log/index.vue b/src/views/admin/log/index.vue index 0aa2a16f..25a12f67 100644 --- a/src/views/admin/log/index.vue +++ b/src/views/admin/log/index.vue @@ -40,13 +40,7 @@ > - + diff --git a/src/views/admin/tenant/form.vue b/src/views/admin/tenant/form.vue index 81fed166..9f132d85 100644 --- a/src/views/admin/tenant/form.vue +++ b/src/views/admin/tenant/form.vue @@ -149,18 +149,21 @@ const onSubmit = async () => { } }; -// 初始化表格数据 -const getTenantData = (id: string) => { - // 获取部门数据 - getObj(id).then((res: any) => { - Object.assign(form, res.data); - }); +/** + * 初始化表格数据。 + * @param {string} id - 部门 ID。 + */ +const getTenantData = async (id) => { + const res = await getObj(id); + Object.assign(form, res.data); }; -const getMenuList = () => { - menuList().then((res: any) => { - menuData.value = res.data; - }); +/** + * 获取菜单列表数据。 + */ +const getMenuList = async () => { + const res = await menuList(); + menuData.value = res.data; }; // 暴露变量 diff --git a/src/views/admin/tenant/tenantMenu/form.vue b/src/views/admin/tenant/tenantMenu/form.vue index f2784f4c..91c9b4a9 100644 --- a/src/views/admin/tenant/tenantMenu/form.vue +++ b/src/views/admin/tenant/tenantMenu/form.vue @@ -20,7 +20,6 @@ show-checkbox ref="menuTreeRef" :check-strictly="false" - v-loading="treeLoading" :data="menuData" :props="defaultProps" :default-checked-keys="checkedMenu" @@ -117,6 +116,8 @@ const onSubmit = async () => { if (!valid) return false; try { + // 获取已经选择的节点 + form.menuIds = [...menuTreeRef.value.getCheckedKeys(), ...menuTreeRef.value.getHalfCheckedKeys()].join(','); form.id ? await putObj(form) : await addObj(form); useMessage().success(t(form.id ? 'common.editSuccessText' : 'common.addSuccessText')); visible.value = false; @@ -126,25 +127,22 @@ const onSubmit = async () => { } }; -const treeLoading = ref(false); -const getMenuData = () => { - treeLoading.value = true; - treemenu().then((res) => { - menuData.value = res.data; - if (form.menuIds) { - checkedMenu.value = other.resolveAllEunuchNodeId(menuData.value, form.menuIds.split(','), []); - } else { - checkedMenu.value = []; - } - treeLoading.value = false; - }); +/** + * 获取菜单数据 + */ +const getMenuData = async () => { + const res = await treemenu(); + menuData.value = res.data; + checkedMenu.value = form.menuIds ? other.resolveAllEunuchNodeId(menuData.value, form.menuIds.split(','), []) : []; }; -const getTenantMenuData = (id: string) => { - // 获取部门数据 - getObj(id).then((res: any) => { - Object.assign(form, res.data[0]); - }); +/** + * 获取部门下的菜单数据 + * @param {string} id - 部门 ID + */ +const getTenantMenuData = async (id: string) => { + const res = await getObj(id); + Object.assign(form, res.data[0]); }; // 暴露变量 diff --git a/src/views/admin/tenant/tenantMenu/index.vue b/src/views/admin/tenant/tenantMenu/index.vue index cbb8f385..36700ea3 100644 --- a/src/views/admin/tenant/tenantMenu/index.vue +++ b/src/views/admin/tenant/tenantMenu/index.vue @@ -53,7 +53,10 @@ const state: BasicTableProps = reactive({ }); const { getDataList, currentChangeHandle, sizeChangeHandle } = useTable(state); - +/** + * 处理删除事件。 + * @param {Object} row - 要删除的数据行对象。 + */ const handleDelete = async (row: any) => { try { await useMessageBox().confirm(t('common.delConfirmText')); diff --git a/src/views/home/current-user.vue b/src/views/home/current-user.vue index 3071b9bf..4580acf0 100644 --- a/src/views/home/current-user.vue +++ b/src/views/home/current-user.vue @@ -1,16 +1,18 @@ + + diff --git a/src/views/home/favorite.vue b/src/views/home/favorite.vue index 46b54fa6..8bed2df8 100644 --- a/src/views/home/favorite.vue +++ b/src/views/home/favorite.vue @@ -1,30 +1,30 @@ - - diff --git a/src/views/home/log-dashboard/audit-log.vue b/src/views/home/log-dashboard/audit-log.vue index ea0a7a06..23273480 100644 --- a/src/views/home/log-dashboard/audit-log.vue +++ b/src/views/home/log-dashboard/audit-log.vue @@ -1,5 +1,5 @@