From d60c2992f7dd1b427d1c2b80fb2fc4b7ef124261 Mon Sep 17 00:00:00 2001 From: GaoF Date: Mon, 5 Aug 2024 09:19:55 +0800 Subject: [PATCH] =?UTF-8?q?=E5=9F=BA=E7=A1=80=E8=B5=84=E6=96=99=E4=BC=98?= =?UTF-8?q?=E5=8C=96=E5=A4=84=E7=90=86?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/components/DynamicTree/index.vue | 34 +++++++++---------- src/config/index.js | 4 +-- src/hook/useFormHandler.js | 4 +-- src/layout/components/userbar.vue | 33 +++++++++--------- src/router/index.js | 4 +-- .../basicData/brand/index.vue | 2 +- .../client/detail/CustomerCategoryForm.vue | 4 +-- .../basicData/client/detail/index.vue | 11 ++---- .../basicData/client/index.vue | 2 +- .../basicData/materiel/detail/index.vue | 12 +++++++ .../materiel/detail/materialCategoryForm.vue | 2 +- .../basicData/materiel/index.vue | 1 - .../basicData/publicAccount/index.vue | 2 +- .../basicData/stash/index.vue | 5 ++- .../basicData/tissue/detail/TissueForm.vue | 28 ++++++++++++--- .../basicData/tissue/index.vue | 26 +++++++++++--- .../basicData/unit/index.vue | 8 ++--- 17 files changed, 108 insertions(+), 74 deletions(-) diff --git a/src/components/DynamicTree/index.vue b/src/components/DynamicTree/index.vue index ada435f..de5ad3c 100644 --- a/src/components/DynamicTree/index.vue +++ b/src/components/DynamicTree/index.vue @@ -30,12 +30,11 @@ - + > @@ -120,18 +119,16 @@ const expandedKeys = ref() const selectedKeys = ref([]) const localLoading = ref(false) - const treeData = ref([ - { - id: 0, - parentId: '-1', - name: '所有', - children: '' - } - ]) + const treeData = ref([]) let treeRow = {} + let paramsValue = {} const handleTreeClick = (selectedKeys, event) => { - treeRow = event.node + if (selectedKeys.length > 0) { + treeRow = event.node + } else { + treeRow = {} + } emit('selectTree', treeRow) } @@ -150,23 +147,24 @@ selectedKeys.value = [] treeRow = {} emit('delTree', treeRow) - loadTreeData() + loadTreeData(paramsValue) }) } const handleRefresh = () => { - loadTreeData() + loadTreeData(paramsValue) emit('treeRefresh') } - const loadTreeData = async () => { + const loadTreeData = async (params) => { try { + paramsValue = params localLoading.value = true - const treeRes = await props.apiModel.getTree() + const treeRes = await props.apiModel.getTree(paramsValue) if (Array.isArray(treeRes)) { - treeData.value[0].children = treeRes + treeData.value = treeRes } else { - treeData.value[0].children = [] + treeData.value = [] } if (selectedKeys.value.length > 0) { diff --git a/src/config/index.js b/src/config/index.js index 83491a0..5e1c9d1 100644 --- a/src/config/index.js +++ b/src/config/index.js @@ -31,7 +31,7 @@ const DEFAULT_CONFIG = { REQUEST_CACHE: false, // 布局 经典:classical,双排菜单:doublerow, 顶栏菜单:top - SNOWY_LAYOUT: 'doublerow', + SNOWY_LAYOUT: 'classical', // 菜单是否折叠 SNOWY_MENU_COLLAPSE: false, @@ -70,7 +70,7 @@ const DEFAULT_CONFIG = { COLOR: '#1677FF', // 默认整体主题 - SNOWY_THEME: 'dark', + SNOWY_THEME: 'light', // 整体表单风格 SNOWY_FORM_STYLE: 'drawer', diff --git a/src/hook/useFormHandler.js b/src/hook/useFormHandler.js index 8471f88..b5d4966 100644 --- a/src/hook/useFormHandler.js +++ b/src/hook/useFormHandler.js @@ -93,8 +93,8 @@ export default function useFormHandler(formItems, api) { * 处理返回操作,返回上一级页面并关闭当前标签页。 */ const handleBack = () => { - useTabs.close(route) - // router.push('/basicData/unit') // 优化为通用的返回上一页操作 + // useTabs.close(route) + router.push('/basicData/publicAccount') // 优化为通用的返回上一页操作 } /** diff --git a/src/layout/components/userbar.vue b/src/layout/components/userbar.vue index d9ffec0..9a0c0ab 100644 --- a/src/layout/components/userbar.vue +++ b/src/layout/components/userbar.vue @@ -6,6 +6,23 @@ + +
+ +
+
@@ -29,22 +46,6 @@ - - - - -
- -
diff --git a/src/router/index.js b/src/router/index.js index 24596f6..b11228f 100644 --- a/src/router/index.js +++ b/src/router/index.js @@ -8,7 +8,7 @@ * 5.不可二次分发开源参与同类竞品,如有想法可联系团队xiaonuobase@qq.com商议合作。 * 6.若您的项目无法满足以上几点,需要更多功能代码,获取Snowy商业授权许可,请在官网购买授权,地址为 https://www.xiaonuo.vip */ -import { createRouter, createWebHistory } from 'vue-router' +import { createRouter, createWebHashHistory, createWebHistory } from 'vue-router' import { notification } from 'ant-design-vue' import NProgress from 'nprogress' import 'nprogress/nprogress.css' @@ -37,7 +37,7 @@ const routes_404 = [ const routes = [...systemRouter, ...whiteListRouters, ...routes_404] const router = createRouter({ - history: createWebHistory(), + history: createWebHashHistory(), routes }) diff --git a/src/views/productionBusiness/basicData/brand/index.vue b/src/views/productionBusiness/basicData/brand/index.vue index 7349319..b490fb6 100644 --- a/src/views/productionBusiness/basicData/brand/index.vue +++ b/src/views/productionBusiness/basicData/brand/index.vue @@ -41,7 +41,7 @@ :row-selection="options.rowSelection" :scroll="{ x: 100, - y: 'calc(100vh - 300px)' + }" >