diff --git a/package.json b/package.json index 3879a32..b629327 100644 --- a/package.json +++ b/package.json @@ -70,11 +70,11 @@ "unplugin-auto-import": "0.13.0", "unplugin-icons": "0.15.1", "unplugin-vue-components": "0.23.0", - "vite": "4.3.1", "vite-plugin-compression": "0.5.1", "vite-plugin-svg-icons": "2.0.1", "vite-plugin-vue-setup-extend": "^0.4.0", "vitest": "^0.29.7", + "vite": "4.3.1", "vue-eslint-parser": "9.1.0", "vue-tsc": "0.35.0" } diff --git a/src/api/system/oss/index.ts b/src/api/system/oss/index.ts index 6821d4e..4472112 100644 --- a/src/api/system/oss/index.ts +++ b/src/api/system/oss/index.ts @@ -5,7 +5,7 @@ import { AxiosPromise } from 'axios'; // 查询OSS对象存储列表 export function listOss(query: OssQuery): AxiosPromise { return request({ - url: '/system/oss/list', + url: '/resource/oss/list', method: 'get', params: query }); @@ -14,7 +14,7 @@ export function listOss(query: OssQuery): AxiosPromise { // 查询OSS对象基于id串 export function listByIds(ossId: string | number): AxiosPromise { return request({ - url: '/system/oss/listByIds/' + ossId, + url: '/resource/oss/listByIds/' + ossId, method: 'get' }); } @@ -22,7 +22,7 @@ export function listByIds(ossId: string | number): AxiosPromise { // 删除OSS对象存储 export function delOss(ossId: string | number | Array) { return request({ - url: '/system/oss/' + ossId, + url: '/resource/oss/' + ossId, method: 'delete' }); } diff --git a/src/api/system/ossConfig/index.ts b/src/api/system/ossConfig/index.ts index b9ff537..d0faefe 100644 --- a/src/api/system/ossConfig/index.ts +++ b/src/api/system/ossConfig/index.ts @@ -5,7 +5,7 @@ import { AxiosPromise } from 'axios'; // 查询对象存储配置列表 export function listOssConfig(query: OssConfigQuery): AxiosPromise { return request({ - url: '/system/oss/config/list', + url: '/resource/oss/config/list', method: 'get', params: query }); @@ -14,7 +14,7 @@ export function listOssConfig(query: OssConfigQuery): AxiosPromise { return request({ - url: '/system/oss/config/' + ossConfigId, + url: '/resource/oss/config/' + ossConfigId, method: 'get' }); } @@ -22,7 +22,7 @@ export function getOssConfig(ossConfigId: string | number): AxiosPromise) { return request({ - url: '/system/oss/config/' + ossConfigId, + url: '/resource/oss/config/' + ossConfigId, method: 'delete' }); } @@ -53,7 +53,7 @@ export function changeOssConfigStatus(ossConfigId: string | number, status: stri configKey }; return request({ - url: '/system/oss/config/changeStatus', + url: '/resource/oss/config/changeStatus', method: 'put', data: data }); diff --git a/src/assets/styles/sidebar.scss b/src/assets/styles/sidebar.scss index 2d11eaf..06bf057 100644 --- a/src/assets/styles/sidebar.scss +++ b/src/assets/styles/sidebar.scss @@ -1,6 +1,6 @@ #app { .main-container { - min-height: 100%; + height: 100%; transition: margin-left 0.28s; margin-left: $base-sidebar-width; position: relative; diff --git a/src/components/DictTag/index.vue b/src/components/DictTag/index.vue index 827a7af..f27b16a 100644 --- a/src/components/DictTag/index.vue +++ b/src/components/DictTag/index.vue @@ -2,13 +2,9 @@
+
diff --git a/src/components/ImageUpload/index.vue b/src/components/ImageUpload/index.vue index 57697fa..0791f3e 100644 --- a/src/components/ImageUpload/index.vue +++ b/src/components/ImageUpload/index.vue @@ -76,7 +76,7 @@ const dialogImageUrl = ref(""); const dialogVisible = ref(false); const baseUrl = import.meta.env.VITE_APP_BASE_API; -const uploadImgUrl = ref(baseUrl + "/system/oss/upload"); // 上传的图片服务器地址 +const uploadImgUrl = ref(baseUrl + "/resource/oss/upload"); // 上传的图片服务器地址 const headers = ref({ Authorization: "Bearer " + getToken() }); const fileList = ref([]); diff --git a/src/components/TopNav/index.vue b/src/components/TopNav/index.vue index 79b7786..2092415 100644 --- a/src/components/TopNav/index.vue +++ b/src/components/TopNav/index.vue @@ -104,7 +104,7 @@ const setVisibleNumber = () => { visibleNumber.value = parseInt(String(width / 85)); } -const handleSelect = (key: string, keyPath: string[]) => { +const handleSelect = (key: string) => { currentIndex.value = key; const route = routers.value.find(item => item.path === key); if (isHttp(key)) { @@ -112,7 +112,13 @@ const handleSelect = (key: string, keyPath: string[]) => { window.open(key, "_blank"); } else if (!route || !route.children) { // 没有子路由路径内部打开 - router.push({ path: key, fullPath: '' }); + const routeMenu = childrenMenus.value.find(item => item.path === key); + if (routeMenu && routeMenu.query) { + let query = JSON.parse(routeMenu.query); + router.push({ path: key, query: query }); + } else { + router.push({ path: key }); + } appStore.toggleSideBarHide(true); } else { // 显示左侧联动菜单 diff --git a/src/layout/components/AppMain.vue b/src/layout/components/AppMain.vue index 463224d..8a73232 100644 --- a/src/layout/components/AppMain.vue +++ b/src/layout/components/AppMain.vue @@ -56,3 +56,25 @@ watch(()=> useSettingsStore().animationEnable, (val) => { } } + diff --git a/src/layout/components/TagsView/ScrollPane.vue b/src/layout/components/TagsView/ScrollPane.vue index e4624dc..64d9fdb 100644 --- a/src/layout/components/TagsView/ScrollPane.vue +++ b/src/layout/components/TagsView/ScrollPane.vue @@ -96,7 +96,7 @@ defineExpose({ bottom: 0px; } :deep(.el-scrollbar__wrap) { - height: 49px; + height: 39px; } } diff --git a/src/layout/components/TagsView/index.vue b/src/layout/components/TagsView/index.vue index d82ddf9..467081e 100644 --- a/src/layout/components/TagsView/index.vue +++ b/src/layout/components/TagsView/index.vue @@ -246,9 +246,10 @@ onMounted(() => { position: relative; cursor: pointer; height: 26px; - line-height: 26px; + line-height: 23px; background-color: var(--el-bg-color); border: 1px solid var(--el-border-color-light); + color: #495060; padding: 0 8px; font-size: 12px; margin-left: 5px; diff --git a/src/layout/index.vue b/src/layout/index.vue index 4c6ab94..5c01f90 100644 --- a/src/layout/index.vue +++ b/src/layout/index.vue @@ -1,17 +1,23 @@ @@ -54,17 +60,17 @@ const navbarRef = ref(Navbar); const settingRef = ref(Settings); onMounted(() => { - nextTick(() => { - navbarRef.value.initTenantList(); - }) + nextTick(() => { + navbarRef.value.initTenantList(); + }) }) const handleClickOutside = () => { - useAppStore().closeSideBar({ withoutAnimation: false }) + useAppStore().closeSideBar({ withoutAnimation: false }) } const setLayout = () => { - settingRef.value.openSetting(); + settingRef.value.openSetting(); } @@ -78,18 +84,6 @@ const setLayout = () => { height: 100%; width: 100%; - .el-scrollbar { - height: 100%; - } - - :deep(.el-scrollbar__bar).is-vertical { - z-index: 10; - } - - :deep(.el-scrollbar__wrap) { - overflow-x: hidden; - } - &.mobile.openSidebar { position: fixed; top: 0; diff --git a/src/plugins/download.ts b/src/plugins/download.ts index 2640763..e1c4414 100644 --- a/src/plugins/download.ts +++ b/src/plugins/download.ts @@ -9,7 +9,7 @@ const baseURL = import.meta.env.VITE_APP_BASE_API; let downloadLoadingInstance: LoadingInstance; export default { async oss(ossId: string | number) { - const url = baseURL + '/system/oss/download/' + ossId; + const url = baseURL + '/resource/oss/download/' + ossId; downloadLoadingInstance = ElLoading.service({ text: '正在下载数据,请稍候', background: 'rgba(0, 0, 0, 0.7)' }); try { const res = await axios({ diff --git a/src/router/index.ts b/src/router/index.ts index bbfc448..9540ab2 100644 --- a/src/router/index.ts +++ b/src/router/index.ts @@ -134,7 +134,7 @@ export const dynamicRoutes: RouteOption[] = [ path: '/system/oss-config', component: Layout, hidden: true, - permissions: ['monitor:job:list'], + permissions: ['system:oss:list'], children: [ { path: 'index', diff --git a/src/types/router.d.ts b/src/types/router.d.ts index 0f2b026..b60b831 100644 --- a/src/types/router.d.ts +++ b/src/types/router.d.ts @@ -13,6 +13,7 @@ declare module 'vue-router' { title: string; icon: string; }; + query?: string; } & RouteRecordRaw; interface _RouteLocationBase { diff --git a/src/views/system/dept/index.vue b/src/views/system/dept/index.vue index 22b254d..4e7750d 100644 --- a/src/views/system/dept/index.vue +++ b/src/views/system/dept/index.vue @@ -232,7 +232,7 @@ const handleAdd = (row?: DeptVO) => { nextTick(() => { reset(); if (row && row.deptId) { - form.value.parentId = row?.parentId; + form.value.parentId = row?.deptId; } }) } diff --git a/src/views/system/role/authUser.vue b/src/views/system/role/authUser.vue index 4b2bec8..ae4f73f 100644 --- a/src/views/system/role/authUser.vue +++ b/src/views/system/role/authUser.vue @@ -63,7 +63,7 @@ :total="total" v-model:page="queryParams.pageNum" v-model:limit="queryParams.pageSize" - @pagination="handleQuery" + @pagination="getList" /> diff --git a/src/views/system/role/index.vue b/src/views/system/role/index.vue index 237f173..1cd0506 100644 --- a/src/views/system/role/index.vue +++ b/src/views/system/role/index.vue @@ -95,7 +95,7 @@ v-model:total="total" v-model:page="queryParams.pageNum" v-model:limit="queryParams.pageSize" - @pagination="handleQuery" + @pagination="getList" /> diff --git a/src/views/system/user/index.vue b/src/views/system/user/index.vue index 13e6659..f7b3a35 100644 --- a/src/views/system/user/index.vue +++ b/src/views/system/user/index.vue @@ -146,7 +146,7 @@ :total="total" v-model:page="queryParams.pageNum" v-model:limit="queryParams.pageSize" - @pagination="handleQuery" + @pagination="getList" /> diff --git a/src/views/tool/gen/editTable.vue b/src/views/tool/gen/editTable.vue index eb11b88..15e6edd 100644 --- a/src/views/tool/gen/editTable.vue +++ b/src/views/tool/gen/editTable.vue @@ -136,54 +136,53 @@ const genInfo = ref(genInfoForm); /** 提交按钮 */ const submitForm = () => { - const basicForm = basicInfo.value.$refs.basicInfoForm; - const genForm = genInfo.value.$refs.genInfoForm; + const basicForm = basicInfo.value.$refs.basicInfoForm; + const genForm = genInfo.value.$refs.genInfoForm; - Promise.all([basicForm, genForm].map(getFormPromise)).then(async res => { - const validateResult = res.every(item => !!item); - if (validateResult) { - const genTable: any = Object.assign({}, info.value); - genTable.columns = columns.value; - genTable.params = { - treeCode: info.value?.treeCode, - treeName: info.value.treeName, - treeParentCode: info.value.treeParentCode, - parentMenuId: info.value.parentMenuId - }; - const response = await updateGenTable(genTable); - proxy?.$modal.msgSuccess(response.msg); - if (response.code === 200) { - close(); - } - } else { - proxy?.$modal.msgError("表单校验未通过,请重新检查提交内容"); - } - }); + Promise.all([basicForm, genForm].map(getFormPromise)).then(async res => { + const validateResult = res.every(item => !!item); + if (validateResult) { + const genTable: any = Object.assign({}, info.value); + genTable.columns = columns.value; + genTable.params = { + treeCode: info.value?.treeCode, + treeName: info.value.treeName, + treeParentCode: info.value.treeParentCode, + parentMenuId: info.value.parentMenuId + }; + const response = await updateGenTable(genTable); + proxy?.$modal.msgSuccess(response.msg); + if (response.code === 200) { + close(); + } + } else { + proxy?.$modal.msgError("表单校验未通过,请重新检查提交内容"); + } + }); } const getFormPromise = (form: any) => { - return new Promise(resolve => { - form.validate((res: any) => { - resolve(res); - }); + return new Promise(resolve => { + form.validate((res: any) => { + resolve(res); }); + }); } const close = () => { - const obj = { path: "/tool/gen", query: { t: Date.now(), pageNum: route.query.pageNum } }; - proxy?.$tab.closeOpenPage(obj); + const obj = {path: "/tool/gen", query: {t: Date.now(), pageNum: route.query.pageNum}}; + proxy?.$tab.closeOpenPage(obj); } (async () => { - const tableId = route.params && route.params.tableId as string; - if (tableId) { - // 获取表详细信息 - const res = await getGenTable(tableId); - res.data.info.parentMenuId = Number(res.data.info.parentMenuId); - columns.value = res.data.rows; - info.value = res.data.info; - tables.value = res.data.tables; - /** 查询字典下拉列表 */ - const response = await getDictOptionselect(); - dictOptions.value = response.data; - } + const tableId = route.params && route.params.tableId as string; + if (tableId) { + // 获取表详细信息 + const res = await getGenTable(tableId); + columns.value = res.data.rows; + info.value = res.data.info; + tables.value = res.data.tables; + /** 查询字典下拉列表 */ + const response = await getDictOptionselect(); + dictOptions.value = response.data; + } })(); diff --git a/src/views/tool/gen/genInfoForm.vue b/src/views/tool/gen/genInfoForm.vue index 54a9a19..ab6e714 100644 --- a/src/views/tool/gen/genInfoForm.vue +++ b/src/views/tool/gen/genInfoForm.vue @@ -226,9 +226,9 @@ import { listMenu } from '@/api/system/menu'; import { ComponentInternalInstance, PropType } from 'vue'; interface MenuOptionsType { - menuId: number; - menuName: string; - children: MenuOptionsType[] | undefined; + menuId: number | string; + menuName: string; + children: MenuOptionsType[] | undefined; } const subColumns = ref([]); @@ -236,14 +236,14 @@ const menuOptions = ref>([]); const { proxy } = getCurrentInstance() as ComponentInternalInstance; const props = defineProps({ - info: { - type: Object as PropType, - default: null - }, - tables: { - type: Array as PropType, - default: null - } + info: { + type: Object as PropType, + default: null + }, + tables: { + type: Array as PropType, + default: null + } }); const infoForm = computed(() => props.info); @@ -252,45 +252,46 @@ const table = computed(() => props.tables); // 表单校验 const rules = ref({ - tplCategory: [{ required: true, message: "请选择生成模板", trigger: "blur" }], - packageName: [{ required: true, message: "请输入生成包路径", trigger: "blur" }], - moduleName: [{ required: true, message: "请输入生成模块名", trigger: "blur" }], - businessName: [{ required: true, message: "请输入生成业务名", trigger: "blur" }], - functionName: [{ required: true, message: "请输入生成功能名", trigger: "blur" }] + tplCategory: [{required: true, message: "请选择生成模板", trigger: "blur"}], + packageName: [{required: true, message: "请输入生成包路径", trigger: "blur"}], + moduleName: [{required: true, message: "请输入生成模块名", trigger: "blur"}], + businessName: [{required: true, message: "请输入生成业务名", trigger: "blur"}], + functionName: [{required: true, message: "请输入生成功能名", trigger: "blur"}] }); const subSelectChange = () => { - infoForm.value.subTableFkName = ""; + infoForm.value.subTableFkName = ""; } const tplSelectChange = (value: string) => { - if (value !== "sub") { - infoForm.value.subTableName = ""; - infoForm.value.subTableFkName = ""; - } + if (value !== "sub") { + infoForm.value.subTableName = ""; + infoForm.value.subTableFkName = ""; + } } const setSubTableColumns = (value: string) => { - table.value.forEach(item => { - const name = item.tableName; - if (value === name) { - subColumns.value = item.columns; - return; - } - }) + table.value.forEach(item => { + const name = item.tableName; + if (value === name) { + subColumns.value = item.columns; + return; + } + }) } /** 查询菜单下拉树结构 */ const getMenuTreeselect = async () => { - const res = await listMenu(); - const data = proxy?.handleTree(res.data, "menuId"); + const res = await listMenu(); + res.data.forEach(m => m.menuId = m.menuId.toString()); + const data = proxy?.handleTree(res.data, "menuId"); if (data) { - menuOptions.value = data - } + menuOptions.value = data + } } watch(() => props.info.subTableName, val => { - setSubTableColumns(val); + setSubTableColumns(val); }); onMounted(() => { - getMenuTreeselect(); + getMenuTreeselect(); })