mirror of
https://github.com/1Panel-dev/MaxKB.git
synced 2025-12-26 10:12:51 +00:00
perf: Optimize copywriting
This commit is contained in:
parent
a5a27445d6
commit
8dc3cae775
|
|
@ -41,11 +41,17 @@ const load = () => {
|
|||
if (disabled.value) return
|
||||
|
||||
// props.paginationConfig.current_page++;
|
||||
if (props.paginationConfig.current_page <= props.paginationConfig.total) {
|
||||
if (
|
||||
props.paginationConfig.current_page * props.paginationConfig.page_size <=
|
||||
props.paginationConfig.total
|
||||
) {
|
||||
emit('changePage')
|
||||
}
|
||||
|
||||
if (props.paginationConfig.current_page === props.paginationConfig.total) {
|
||||
if (
|
||||
props.paginationConfig.current_page * props.paginationConfig.page_size ===
|
||||
props.paginationConfig.total
|
||||
) {
|
||||
disabled.value = true
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -74,6 +74,7 @@ export default {
|
|||
success: 'Successful',
|
||||
fail: 'Failed',
|
||||
all: 'All',
|
||||
padding: 'Padding',
|
||||
},
|
||||
param: {
|
||||
outputParam: 'Output Parameters',
|
||||
|
|
|
|||
|
|
@ -81,9 +81,8 @@ export default {
|
|||
},
|
||||
nodes: {
|
||||
knowledgeWriteNode: {
|
||||
text: 'Knowledge write',
|
||||
label:
|
||||
'Write the input paragraph list into the current knowledge base and complete vectorization processing',
|
||||
label: 'Knowledge write',
|
||||
text: 'Write the input paragraph list into the current knowledge base and complete vectorization processing',
|
||||
},
|
||||
dataSourceWebNode: {
|
||||
label: 'Web Site',
|
||||
|
|
@ -142,6 +141,9 @@ export default {
|
|||
},
|
||||
},
|
||||
},
|
||||
KnowledgeBaseNode: {
|
||||
DocumentSetting: 'Document Processing Setting',
|
||||
},
|
||||
aiChatNode: {
|
||||
label: 'AI Chat',
|
||||
text: 'Chat with an AI model',
|
||||
|
|
|
|||
|
|
@ -76,6 +76,7 @@ export default {
|
|||
success: '成功',
|
||||
fail: '失败',
|
||||
all: '全部',
|
||||
padding: '执行中',
|
||||
},
|
||||
param: {
|
||||
outputParam: '输出参数',
|
||||
|
|
|
|||
|
|
@ -85,8 +85,8 @@ export default {
|
|||
},
|
||||
nodes: {
|
||||
knowledgeWriteNode: {
|
||||
text: '知识库写入',
|
||||
label: '将输入的分段列表写入当前知识库,并完成向量化处理',
|
||||
label: '知识库写入',
|
||||
text: '将输入的分段列表写入当前知识库,并完成向量化处理',
|
||||
},
|
||||
dataSourceWebNode: {
|
||||
label: 'Web站点',
|
||||
|
|
@ -146,6 +146,9 @@ export default {
|
|||
},
|
||||
},
|
||||
},
|
||||
KnowledgeBaseNode: {
|
||||
DocumentSetting: '文档处理设置',
|
||||
},
|
||||
aiChatNode: {
|
||||
label: 'AI 对话',
|
||||
text: '与 AI 大模型进行对话',
|
||||
|
|
|
|||
|
|
@ -74,6 +74,7 @@ export default {
|
|||
success: '成功',
|
||||
fail: '失敗',
|
||||
all: '全部',
|
||||
padding: '執行中',
|
||||
},
|
||||
param: {
|
||||
outputParam: '輸出參數',
|
||||
|
|
|
|||
|
|
@ -81,8 +81,8 @@ export default {
|
|||
},
|
||||
nodes: {
|
||||
knowledgeWriteNode: {
|
||||
text: '知識庫寫入',
|
||||
label: '將輸入的分段列表寫入當前知識庫,並完成向量化處理',
|
||||
label: '知識庫寫入',
|
||||
text: '將輸入的分段列表寫入當前知識庫,並完成向量化處理',
|
||||
},
|
||||
dataSourceWebNode: {
|
||||
label: 'Web網站',
|
||||
|
|
@ -141,6 +141,9 @@ export default {
|
|||
},
|
||||
},
|
||||
},
|
||||
KnowledgeBaseNode: {
|
||||
DocumentSetting: '文檔處理設置',
|
||||
},
|
||||
aiChatNode: {
|
||||
label: 'AI 對話',
|
||||
text: '與 AI 大模型進行對話',
|
||||
|
|
|
|||
|
|
@ -46,26 +46,42 @@
|
|||
class="w-full"
|
||||
v-loading="loading"
|
||||
@changePage="changePage"
|
||||
:maxTableHeight="200"
|
||||
:maxTableHeight="150"
|
||||
:paginationConfig="paginationConfig"
|
||||
>
|
||||
<el-table-column prop="user_name" :label="$t('workflow.initiator')">
|
||||
<template #default="{ row }">
|
||||
{{ row.user_name }}
|
||||
{{ row.meta.user_name }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="state" label="状态" width="180">
|
||||
<el-table-column prop="state" :label="$t('common.status.label')" width="180">
|
||||
<template #default="{ row }">
|
||||
{{ row.state }}
|
||||
<el-text class="color-text-primary" v-if="row.state === 'SUCCESS'">
|
||||
<el-icon class="color-success"><SuccessFilled /></el-icon>
|
||||
{{ $t('common.status.success') }}
|
||||
</el-text>
|
||||
<el-text class="color-text-primary" v-else-if="row.state === 'FAILURE'">
|
||||
<el-icon class="color-danger"><CircleCloseFilled /></el-icon>
|
||||
{{ $t('common.status.fail') }}
|
||||
</el-text>
|
||||
<el-text class="color-text-primary" v-else>
|
||||
<el-icon class="is-loading color-primary"><Loading /></el-icon>
|
||||
{{ $t('common.status.padding') }}
|
||||
</el-text>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="run_time" label="运行时间">
|
||||
<el-table-column prop="run_time" :label="$t('chat.KnowledgeSource.consumeTime')">
|
||||
<template #default="{ row }">
|
||||
{{ row.run_time }}
|
||||
{{ row.run_time != undefined ? row.run_time + 's' : '-' }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="操作">
|
||||
<el-table-column :label="$t('common.operation')" width="80">
|
||||
<template #default="{ row }">
|
||||
<span @click="toDetails(row)">执行详情</span>
|
||||
<el-tooltip effect="dark" :content="$t('chat.executionDetails.title')" placement="top">
|
||||
<el-button type="primary" text @click.stop="toDetails(row)">
|
||||
<AppIcon iconName="app-operate-log"></AppIcon>
|
||||
</el-button>
|
||||
</el-tooltip>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</app-table-infinite-scroll>
|
||||
|
|
@ -106,6 +122,7 @@ const changeFilterHandle = () => {
|
|||
}
|
||||
const changePage = () => {
|
||||
paginationConfig.current_page += 1
|
||||
console.log(paginationConfig.current_page)
|
||||
getList()
|
||||
}
|
||||
|
||||
|
|
@ -114,15 +131,18 @@ const getList = () => {
|
|||
.getWorkflowActionPage(active_knowledge_id.value, paginationConfig, query.value, loading)
|
||||
.then((ok: any) => {
|
||||
paginationConfig.total = ok.data?.total
|
||||
data.value = ok.data.records
|
||||
data.value = data.value.concat(ok.data.records)
|
||||
})
|
||||
}
|
||||
const open = (knowledge_id: string) => {
|
||||
drawer.value = true
|
||||
active_knowledge_id.value = knowledge_id
|
||||
getList()
|
||||
drawer.value = true
|
||||
}
|
||||
const close = () => {
|
||||
paginationConfig.current_page = 1
|
||||
paginationConfig.total = 0
|
||||
data.value = []
|
||||
drawer.value = false
|
||||
}
|
||||
defineExpose({ open, close })
|
||||
|
|
|
|||
|
|
@ -105,6 +105,7 @@
|
|||
@sizeChange="handleSizeChange"
|
||||
@changePage="getList"
|
||||
v-loading="loading"
|
||||
show-overflow-tooltip
|
||||
>
|
||||
<el-table-column prop="menu" :label="$t('views.operateLog.table.menu')" width="160">
|
||||
<template #header>
|
||||
|
|
@ -158,23 +159,15 @@
|
|||
prop="operate"
|
||||
:label="$t('views.operateLog.table.detail')"
|
||||
width="160"
|
||||
:tooltip-formatter="
|
||||
({ row }: any) =>
|
||||
row.operate + (row.operation_object?.name ? `【${row.operation_object.name}】` : '')
|
||||
"
|
||||
>
|
||||
<template #default="{ row }">
|
||||
<el-tooltip
|
||||
:content="
|
||||
row.operate +
|
||||
(row.operation_object?.name ? `【${row.operation_object.name}】` : '')
|
||||
"
|
||||
effect="dark"
|
||||
placement="top"
|
||||
>
|
||||
<span class="text-ellipsis">
|
||||
{{
|
||||
row.operate +
|
||||
(row.operation_object?.name ? `【${row.operation_object.name}】` : '')
|
||||
}}
|
||||
</span>
|
||||
</el-tooltip>
|
||||
{{
|
||||
row.operate + (row.operation_object?.name ? `【${row.operation_object.name}】` : '')
|
||||
}}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column
|
||||
|
|
@ -253,17 +246,13 @@
|
|||
</el-table-column>
|
||||
<el-table-column :label="$t('common.operation')" width="60" align="left" fixed="right">
|
||||
<template #default="{ row }">
|
||||
<span class="mr-4">
|
||||
<el-tooltip
|
||||
effect="dark"
|
||||
:content="$t('views.operateLog.table.opt')"
|
||||
placement="top"
|
||||
>
|
||||
<el-button type="primary" text @click.stop="showDetails(row)" class="text-button">
|
||||
<AppIcon iconName="app-operate-log"></AppIcon>
|
||||
</el-button>
|
||||
</el-tooltip>
|
||||
</span>
|
||||
<!-- <span class="mr-4"> -->
|
||||
<el-tooltip effect="dark" :content="$t('views.operateLog.table.opt')" placement="top">
|
||||
<el-button type="primary" text @click.stop="showDetails(row)">
|
||||
<AppIcon iconName="app-operate-log"></AppIcon>
|
||||
</el-button>
|
||||
</el-tooltip>
|
||||
<!-- </span> -->
|
||||
</template>
|
||||
</el-table-column>
|
||||
</app-table>
|
||||
|
|
@ -517,16 +506,4 @@ onMounted(() => {
|
|||
changeDayHandle(history_day.value)
|
||||
})
|
||||
</script>
|
||||
<style lang="scss" scoped>
|
||||
.text-button {
|
||||
font-size: 14px;
|
||||
}
|
||||
|
||||
.text-ellipsis {
|
||||
white-space: nowrap;
|
||||
overflow: hidden;
|
||||
text-overflow: ellipsis;
|
||||
max-width: 100%;
|
||||
display: block;
|
||||
}
|
||||
</style>
|
||||
<style lang="scss" scoped></style>
|
||||
|
|
|
|||
|
|
@ -786,21 +786,15 @@ export const knowledgeTemplate: any = {
|
|||
nodes: [
|
||||
{
|
||||
x: 120,
|
||||
y: 114.94150000000002,
|
||||
y: 115.05849999999998,
|
||||
id: 'knowledge-base-node',
|
||||
type: 'knowledge-base-node',
|
||||
properties: {
|
||||
config: {
|
||||
globalFields: [
|
||||
{
|
||||
label: 'a',
|
||||
value: 'a',
|
||||
globeLabel: '{{global.a}}',
|
||||
globeValue: "{{context['global'].a}}",
|
||||
},
|
||||
],
|
||||
fields: [],
|
||||
globalFields: [],
|
||||
},
|
||||
height: 384.266,
|
||||
height: 394.383,
|
||||
showNode: true,
|
||||
stepName: '\u57fa\u672c\u4fe1\u606f',
|
||||
node_data: {
|
||||
|
|
@ -812,32 +806,9 @@ export const knowledgeTemplate: any = {
|
|||
},
|
||||
input_field_list: [],
|
||||
user_input_config: {
|
||||
title: '\u7528\u6237\u8f93\u5165',
|
||||
title: '\u6587\u6863\u5904\u7406\u8bbe\u7f6e',
|
||||
},
|
||||
user_input_field_list: [
|
||||
{
|
||||
attrs: {
|
||||
maxlength: 200,
|
||||
minlength: 1,
|
||||
'show-word-limit': true,
|
||||
},
|
||||
field: 'a',
|
||||
label: 'a',
|
||||
required: false,
|
||||
input_type: 'TextInput',
|
||||
props_info: {
|
||||
rules: [
|
||||
{
|
||||
max: 200,
|
||||
min: 1,
|
||||
message: 'a\u957f\u5ea6\u5728 1 \u5230 200 \u4e2a\u5b57\u7b26',
|
||||
trigger: 'blur',
|
||||
},
|
||||
],
|
||||
},
|
||||
show_default_value: true,
|
||||
},
|
||||
],
|
||||
user_input_field_list: [],
|
||||
},
|
||||
},
|
||||
{
|
||||
|
|
|
|||
|
|
@ -118,7 +118,7 @@ const tableRef = ref()
|
|||
const UserFieldFormDialogRef = ref()
|
||||
const UserInputTitleDialogRef = ref()
|
||||
const inputFieldList = ref<any[]>([])
|
||||
const inputFieldConfig = ref({ title: t('chat.userInput') })
|
||||
const inputFieldConfig = ref({ title: t('workflow.nodes.KnowledgeBaseNode.DocumentSetting') })
|
||||
|
||||
function openAddDialog(data?: any, index?: any) {
|
||||
UserFieldFormDialogRef.value.open(data, index)
|
||||
|
|
|
|||
Loading…
Reference in New Issue