From 7689b58b1370286d448398312b06fe33d9cbf1da Mon Sep 17 00:00:00 2001 From: "gary.fu" Date: Tue, 2 Jan 2024 17:10:45 +0800 Subject: [PATCH] =?UTF-8?q?=E9=9D=A2=E5=8C=85=E5=B1=91=E5=AF=BC=E8=88=AA?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- package-lock.json | 20 ++++++ package.json | 1 + src/components/common-breadcrumb/index.vue | 71 +++++++++++++++++++ src/components/common-form/index.vue | 11 ++- src/components/common-icon-select/index.vue | 9 ++- src/components/common-menu-item/index.vue | 4 +- src/components/common-menu/index.vue | 6 +- src/components/common-tabs-view/index.vue | 10 +-- .../common-tabs-view/tabs-view-item.vue | 34 +++------ src/components/index.js | 2 + src/layout/TopNav.vue | 9 ++- src/messages/common_cn.js | 1 + src/messages/common_en.js | 1 + src/route/routes.js | 15 +++- src/stores/GlobalConfigStore.js | 2 + src/views/HomeView.vue | 6 ++ .../components/global/GlobalSettings.vue | 9 +++ src/views/tools/TableEdit.vue | 2 +- 18 files changed, 165 insertions(+), 48 deletions(-) create mode 100644 src/components/common-breadcrumb/index.vue diff --git a/package-lock.json b/package-lock.json index 9366b11..ec949de 100644 --- a/package-lock.json +++ b/package-lock.json @@ -14,6 +14,7 @@ "dayjs": "^1.11.10", "element-plus": "^2.4.4", "lodash": "^4.17.21", + "mockjs": "^1.1.0", "pinia": "^2.1.7", "pinia-plugin-persistedstate": "^3.2.1", "vue": "^3.3.13", @@ -865,6 +866,14 @@ "integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==", "dev": true }, + "node_modules/commander": { + "version": "11.1.0", + "resolved": "https://registry.npmjs.org/commander/-/commander-11.1.0.tgz", + "integrity": "sha512-yPVavfyCcRhmorC7rWlkHn15b4wDVgVmBA7kV4QVBsF7kv/9TKJAbAXVTxvTnwP8HHKjRCJDClKbciiYS7p0DQ==", + "engines": { + "node": ">=16" + } + }, "node_modules/concat-map": { "version": "0.0.1", "resolved": "https://registry.npmjs.org/concat-map/-/concat-map-0.0.1.tgz", @@ -2469,6 +2478,17 @@ "resolved": "https://registry.npmjs.org/mitt/-/mitt-2.1.0.tgz", "integrity": "sha512-ILj2TpLiysu2wkBbWjAmww7TkZb65aiQO+DkVdUTBpBXq+MHYiETENkKFMtsJZX1Lf4pe4QOrTSjIfUwN5lRdg==" }, + "node_modules/mockjs": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/mockjs/-/mockjs-1.1.0.tgz", + "integrity": "sha512-eQsKcWzIaZzEZ07NuEyO4Nw65g0hdWAyurVol1IPl1gahRwY+svqzfgfey8U8dahLwG44d6/RwEzuK52rSa/JQ==", + "dependencies": { + "commander": "*" + }, + "bin": { + "random": "bin/random" + } + }, "node_modules/ms": { "version": "2.1.2", "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.2.tgz", diff --git a/package.json b/package.json index 108b260..4a9d80b 100644 --- a/package.json +++ b/package.json @@ -15,6 +15,7 @@ "dayjs": "^1.11.10", "element-plus": "^2.4.4", "lodash": "^4.17.21", + "mockjs": "^1.1.0", "pinia": "^2.1.7", "pinia-plugin-persistedstate": "^3.2.1", "vue": "^3.3.13", diff --git a/src/components/common-breadcrumb/index.vue b/src/components/common-breadcrumb/index.vue new file mode 100644 index 0000000..5ab186b --- /dev/null +++ b/src/components/common-breadcrumb/index.vue @@ -0,0 +1,71 @@ + + + + + diff --git a/src/components/common-form/index.vue b/src/components/common-form/index.vue index 501cac4..4afac56 100644 --- a/src/components/common-form/index.vue +++ b/src/components/common-form/index.vue @@ -27,7 +27,8 @@ const props = defineProps({ default: '100px' }, model: { - type: Object + type: Object, + default: null }, showButtons: { type: Boolean, @@ -40,10 +41,6 @@ const props = defineProps({ showReset: { type: Boolean, default: true - }, - submitForm: { - type: Function, - default () {} } }) @@ -77,6 +74,8 @@ const rules = computed(() => { return ruleResult }) +defineEmits(['submitForm']) + const form = ref() @@ -99,7 +98,7 @@ const form = ref() {{ $t('common.label.submit') }} diff --git a/src/components/common-icon-select/index.vue b/src/components/common-icon-select/index.vue index cafa1b6..099c11b 100644 --- a/src/components/common-icon-select/index.vue +++ b/src/components/common-icon-select/index.vue @@ -113,8 +113,8 @@ const selectIcon = icon => { - - + { - + @@ -164,4 +164,7 @@ const selectIcon = icon => { .el-radio { margin-right: 10px; } +.icon-area { + padding: 0; +} diff --git a/src/components/common-menu-item/index.vue b/src/components/common-menu-item/index.vue index 2b6d580..048b20d 100644 --- a/src/components/common-menu-item/index.vue +++ b/src/components/common-menu-item/index.vue @@ -28,7 +28,7 @@ const props = defineProps({ required: true }, index: { - type: Number, + type: [Number, String], required: false } }) @@ -65,7 +65,7 @@ const dropdownClick = menuItem => { :key="menuItem.index||index" :class="menuCls" > - {{ menuItem.splitText }} + { + > + + diff --git a/src/components/common-tabs-view/index.vue b/src/components/common-tabs-view/index.vue index 46e067c..e2f7d68 100644 --- a/src/components/common-tabs-view/index.vue +++ b/src/components/common-tabs-view/index.vue @@ -81,12 +81,12 @@ const onDropdownVisibleChange = (visible, tab) => { v-for="item in tabsViewStore.historyTabs" ref="tabItems" :key="item.path" - :refresh-history-tab="refreshHistoryTab" - :remove-history-tab="removeHistoryTab" - :remove-other-history-tabs="removeOtherHistoryTabs" - :remove-history-tabs="removeHistoryTabs" - :on-dropdown-visible-change="onDropdownVisibleChange" :tab-item="item" + @refresh-history-tab="refreshHistoryTab" + @remove-other-history-tabs="removeOtherHistoryTabs" + @remove-history-tabs="removeHistoryTabs" + @on-dropdown-visible-change="onDropdownVisibleChange" + @remove-history-tab="removeHistoryTab" /> diff --git a/src/components/common-tabs-view/tabs-view-item.vue b/src/components/common-tabs-view/tabs-view-item.vue index 290a0e7..091f3cb 100644 --- a/src/components/common-tabs-view/tabs-view-item.vue +++ b/src/components/common-tabs-view/tabs-view-item.vue @@ -12,29 +12,11 @@ const props = defineProps({ tabItem: { type: Object, required: true - }, - removeHistoryTab: { - type: Function, - required: true - }, - removeOtherHistoryTabs: { - type: Function, - required: true - }, - removeHistoryTabs: { - type: Function, - required: true - }, - refreshHistoryTab: { - type: Function, - required: true - }, - onDropdownVisibleChange: { - type: Function, - required: true } }) +defineEmits(['removeHistoryTab', 'removeOtherHistoryTabs', 'removeHistoryTabs', 'refreshHistoryTab', 'onDropdownVisibleChange']) + const menuName = computed(() => { return useMenuName(props.tabItem) }) @@ -69,7 +51,7 @@ defineExpose({ :id="tabItem.path" ref="dropdownRef" trigger="contextmenu" - @visible-change="onDropdownVisibleChange($event, tabItem)" + @visible-change="$emit('onDropdownVisibleChange', $event, tabItem)" > {{ $t('common.label.refresh') }} {{ $t('common.label.close') }} {{ $t('common.label.closeLeft') }} {{ $t('common.label.closeRight') }} {{ $t('common.label.closeOther') }} diff --git a/src/components/index.js b/src/components/index.js index cbee7e3..d5ea3fe 100644 --- a/src/components/index.js +++ b/src/components/index.js @@ -6,6 +6,7 @@ import CommonMenu from '@/components/common-menu/index.vue' import CommonMenuItem from '@/components/common-menu-item/index.vue' import CommonTabsView from '@/components/common-tabs-view/index.vue' import CommonTable from '@/components/common-table/index.vue' +import CommonBreadcrumb from '@/components/common-breadcrumb/index.vue' /** * 自定义通用组件自动注册 @@ -23,5 +24,6 @@ export default { Vue.component('CommonMenuItem', CommonMenuItem) Vue.component('CommonTabsView', CommonTabsView) Vue.component('CommonTable', CommonTable) + Vue.component('CommonBreadcrumb', CommonBreadcrumb) } } diff --git a/src/layout/TopNav.vue b/src/layout/TopNav.vue index 0a5680f..abbbbef 100644 --- a/src/layout/TopNav.vue +++ b/src/layout/TopNav.vue @@ -22,7 +22,14 @@ const allMenus = computed(() => { mode="horizontal" :ellipsis="false" :menus="allMenus" - /> + > + +