From 702a1bb8fb9b1bdefc1d2401e67146675912f6ae Mon Sep 17 00:00:00 2001 From: Gary Fu Date: Mon, 1 Jan 2024 18:34:58 +0800 Subject: [PATCH] =?UTF-8?q?tab=E4=BC=98=E5=8C=96=EF=BC=8C=E8=A1=A8?= =?UTF-8?q?=E6=A0=BC=E4=BC=98=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../common-table/common-table-column.vue | 20 +++++++++++++++++- src/components/common-table/index.vue | 7 ++++++- .../common-tabs-view/tabs-view-item.vue | 14 +++++++++++-- src/messages/common_cn.js | 1 + src/messages/common_en.js | 1 + src/route/ToolsRoutes.js | 15 ++++++++++++- src/stores/TabsViewStore.js | 20 ++++++++++++------ src/views/tools/TableEdit.vue | 21 +++++++++++++++++++ src/views/tools/Tables.vue | 13 +++++++++--- 9 files changed, 98 insertions(+), 14 deletions(-) create mode 100644 src/views/tools/TableEdit.vue diff --git a/src/components/common-table/common-table-column.vue b/src/components/common-table/common-table-column.vue index ff60a6a..68e7f28 100644 --- a/src/components/common-table/common-table-column.vue +++ b/src/components/common-table/common-table-column.vue @@ -10,6 +10,10 @@ * @property {string} slot 自定义插槽 * @property [ButtonProps] buttons 自定义按钮 * @property {Object} attrs 其他属性 + * @property {string} link 链接地址 + * @property {Object} linkAttrs 链接配置 + * @method click 点击事件 + * @method formatter 格式化 */ /** * 配置信息 @@ -22,6 +26,9 @@ const props = defineProps({ type: Object, required: true }, + /** + * @type {'large'|'small'|'default'} + */ buttonSize: { type: String, default: 'small' @@ -37,13 +44,24 @@ const props = defineProps({ :property="column.property" :width="column.width" v-bind="column.attrs" + :formatter="column.formatter" > diff --git a/src/components/common-table/index.vue b/src/components/common-table/index.vue index d7650dc..986190f 100644 --- a/src/components/common-table/index.vue +++ b/src/components/common-table/index.vue @@ -67,7 +67,10 @@ const props = defineProps({ } } }) - +/** + * + * @type {ComputedRef<[CommonTableColumn]>} + */ const calcColumns = computed(() => { let _columns = props.columns if (props.buttons.length || props.buttonsSlot) { @@ -102,8 +105,10 @@ const calcColumns = computed(() => { #default="scope" > diff --git a/src/components/common-tabs-view/tabs-view-item.vue b/src/components/common-tabs-view/tabs-view-item.vue index 5e9d7fe..ccb6b4e 100644 --- a/src/components/common-tabs-view/tabs-view-item.vue +++ b/src/components/common-tabs-view/tabs-view-item.vue @@ -25,6 +25,16 @@ const menuName = computed(() => { const menuInfo = computed(() => { return props.tabItem.path === '/' ? { icon: 'HomeFilled' } : useMenuInfo(props.tabItem) }) + +const menuIcon = computed(() => { + if (menuInfo.value && menuInfo.value.icon) { + return menuInfo.value.icon + } + if (props.tabItem.meta && props.tabItem.meta.icon) { + return props.tabItem.meta.icon + } + return null +})