From 72bce3b71b7b8ef13f498ae69618e2d583f64ccc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=99=88=E6=98=B1=E8=BE=BE?= Date: Wed, 23 Apr 2025 16:48:14 +0800 Subject: [PATCH] =?UTF-8?q?refactor(knowledge):=20=E4=BC=98=E5=8C=96?= =?UTF-8?q?=E7=9F=A5=E8=AF=86=E5=BA=93=E7=9B=B8=E5=85=B3=E7=BB=84=E4=BB=B6?= =?UTF-8?q?=E7=9A=84=E6=A0=B7=E5=BC=8F=E5=92=8C=E5=8A=9F=E8=83=BD-=20?= =?UTF-8?q?=E4=BF=AE=E6=94=B9=E6=8C=89=E9=92=AE=E6=A0=B7=E5=BC=8F=EF=BC=8C?= =?UTF-8?q?=E5=A2=9E=E5=8A=A0=E5=9B=BE=E6=A0=87=E5=B9=B6=E9=9A=90=E8=97=8F?= =?UTF-8?q?=E6=96=87=E5=AD=97=20-=20=E4=BC=98=E5=8C=96=E8=A1=A8=E6=A0=BC?= =?UTF-8?q?=E6=B8=B2=E6=9F=93=E9=80=BB=E8=BE=91=EF=BC=8C=E6=8F=90=E9=AB=98?= =?UTF-8?q?=E7=BB=84=E4=BB=B6=E7=81=B5=E6=B4=BB=E6=80=A7=20-=E7=BB=9F?= =?UTF-8?q?=E4=B8=80=E4=BD=BF=E7=94=A8=20outline=20=E5=9B=BE=E6=A0=87?= =?UTF-8?q?=E9=A3=8E=E6=A0=BC-=20=E4=BF=AE=E5=A4=8D=E6=90=9C=E7=B4=A2?= =?UTF-8?q?=E6=A1=86=E5=9B=9E=E8=BD=A6=E4=BA=8B=E4=BB=B6=E5=A4=84=E7=90=86?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../RenderTable/component/bodySlot/index.vue | 18 ++++--- .../components/split/CustomSplitDialog.vue | 49 +++++++++---------- .../detail/components/words/CustomWords.vue | 49 +++++++++---------- src/views/knowledge/detail/index.vue | 2 +- src/views/knowledge/index.vue | 2 +- 5 files changed, 59 insertions(+), 61 deletions(-) diff --git a/src/components/RenderTable/component/bodySlot/index.vue b/src/components/RenderTable/component/bodySlot/index.vue index 0f208af..c5b141d 100644 --- a/src/components/RenderTable/component/bodySlot/index.vue +++ b/src/components/RenderTable/component/bodySlot/index.vue @@ -18,8 +18,8 @@ const RenderSlot = { { props: { placement: 'bottom-end', - content: first[0].data.props.title, - effect: 'light' + content: first[0].data.props.title + // effect: 'light' } }, first @@ -76,12 +76,16 @@ const RenderSlot = { content.children = [renderTooltip(first), renderPopver(other)] return content } else { - const first = contentDiv.splice(0, 1) - first[0].data.class = 'normal-button' - first[0].data.props.type = null - first[0].data.props.size = null - content.children = [renderTooltip(first)] + // const first = contentDiv.splice(0, contentDiv) + contentDiv = contentDiv.map(item => { + console.log(item) + item.data.class = 'normal-button' + item.data.props.type = null + item.data.props.size = null + return renderTooltip([item]) + }) + content.children = contentDiv return content } // let div = diff --git a/src/views/knowledge/detail/components/split/CustomSplitDialog.vue b/src/views/knowledge/detail/components/split/CustomSplitDialog.vue index 3a0f842..20d74b0 100644 --- a/src/views/knowledge/detail/components/split/CustomSplitDialog.vue +++ b/src/views/knowledge/detail/components/split/CustomSplitDialog.vue @@ -112,36 +112,33 @@ export default { prop: 'knowledgeDesc', width: '150px', align: 'center', + isRedraw: true, render: (h, params) => { return h('span', {}, [ - h( - 'el-button', - { - class: 'floatSpan', - props: { - type: 'primary', - size: 'medium' - }, - on: { - click: () => this.handleEdit(params.row) - } + h('el-button', { + class: 'floatSpan', + props: { + type: 'primary', + size: 'medium', + title: '修改', + icon: 'el-icon-edit-outline' }, - '修改' - ), - h( - 'el-button', - { - class: 'floatSpan', - props: { - type: 'primary', - size: 'medium' - }, - on: { - click: () => this.handlePreview(params.row) - } + on: { + click: () => this.handleEdit(params.row) + } + }), + h('el-button', { + class: 'floatSpan', + props: { + type: 'primary', + size: 'medium', + title: '预览', + icon: 'el-icon-view' }, - '预览' - ) + on: { + click: () => this.handlePreview(params.row) + } + }) ]) } } diff --git a/src/views/knowledge/detail/components/words/CustomWords.vue b/src/views/knowledge/detail/components/words/CustomWords.vue index e57e44b..968b029 100644 --- a/src/views/knowledge/detail/components/words/CustomWords.vue +++ b/src/views/knowledge/detail/components/words/CustomWords.vue @@ -118,36 +118,33 @@ export default { prop: 'knowledgeDesc', width: '150px', align: 'center', + isRedraw: true, render: (h, params) => { return h('span', {}, [ - h( - 'el-button', - { - class: 'floatSpan', - props: { - type: 'primary', - size: 'medium' - }, - on: { - click: () => this.handleEdit(params.row) - } + h('el-button', { + class: 'floatSpan', + props: { + type: 'primary', + size: 'medium', + title: '修改', + icon: 'el-icon-edit-outline' }, - '修改' - ), - h( - 'el-button', - { - class: 'floatSpan', - props: { - type: 'primary', - size: 'medium' - }, - on: { - click: () => this.handlePreview(params.row) - } + on: { + click: () => this.handleEdit(params.row) + } + }), + h('el-button', { + class: 'floatSpan', + props: { + type: 'primary', + size: 'medium', + title: '预览', + icon: 'el-icon-view' }, - '预览' - ) + on: { + click: () => this.handlePreview(params.row) + } + }) ]) } } diff --git a/src/views/knowledge/detail/index.vue b/src/views/knowledge/detail/index.vue index fe56db9..1370174 100644 --- a/src/views/knowledge/detail/index.vue +++ b/src/views/knowledge/detail/index.vue @@ -390,7 +390,7 @@ export default { type: 'primary', size: 'mini', disabled: true, - icon: 'el-icon-edit', + icon: 'el-icon-edit-outline', title: '编辑' }, on: {} diff --git a/src/views/knowledge/index.vue b/src/views/knowledge/index.vue index 755023e..31ac158 100644 --- a/src/views/knowledge/index.vue +++ b/src/views/knowledge/index.vue @@ -2,7 +2,7 @@
- +