refactor(knowledge): 优化知识库相关组件的样式和功能- 修改按钮样式,增加图标并隐藏文字

- 优化表格渲染逻辑,提高组件灵活性
-统一使用 outline 图标风格- 修复搜索框回车事件处理
This commit is contained in:
陈昱达
2025-04-23 16:48:14 +08:00
parent 425cbe7621
commit 72bce3b71b
5 changed files with 59 additions and 61 deletions

View File

@@ -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 =

View File

@@ -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)
}
})
])
}
}

View File

@@ -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)
}
})
])
}
}

View File

@@ -390,7 +390,7 @@ export default {
type: 'primary',
size: 'mini',
disabled: true,
icon: 'el-icon-edit',
icon: 'el-icon-edit-outline',
title: '编辑'
},
on: {}

View File

@@ -2,7 +2,7 @@
<div id="index-container" class="container index-container">
<el-row>
<el-col :span="8">
<el-input placeholder="输入知识库名称" clearable v-model="nameLike" size="medium" class="underBorder">
<el-input placeholder="输入知识库名称" clearable v-model="nameLike" size="medium" class="underBorder" @keydown.enter.native="getList">
<template slot="prepend">
<el-button slot="append" icon="el-icon-search" @click="getList"></el-button>
</template>