Skip to content

Commit 8dc3cae

Browse files
perf: Optimize copywriting
1 parent a5a2744 commit 8dc3cae

File tree

11 files changed

+79
-94
lines changed

11 files changed

+79
-94
lines changed

ui/src/components/app-table-infinite-scroll/index.vue

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -41,11 +41,17 @@ const load = () => {
4141
if (disabled.value) return
4242
4343
// props.paginationConfig.current_page++;
44-
if (props.paginationConfig.current_page <= props.paginationConfig.total) {
44+
if (
45+
props.paginationConfig.current_page * props.paginationConfig.page_size <=
46+
props.paginationConfig.total
47+
) {
4548
emit('changePage')
4649
}
4750
48-
if (props.paginationConfig.current_page === props.paginationConfig.total) {
51+
if (
52+
props.paginationConfig.current_page * props.paginationConfig.page_size ===
53+
props.paginationConfig.total
54+
) {
4955
disabled.value = true
5056
}
5157
}

ui/src/locales/lang/en-US/common.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -74,6 +74,7 @@ export default {
7474
success: 'Successful',
7575
fail: 'Failed',
7676
all: 'All',
77+
padding: 'Padding',
7778
},
7879
param: {
7980
outputParam: 'Output Parameters',

ui/src/locales/lang/en-US/workflow.ts

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -81,9 +81,8 @@ export default {
8181
},
8282
nodes: {
8383
knowledgeWriteNode: {
84-
text: 'Knowledge write',
85-
label:
86-
'Write the input paragraph list into the current knowledge base and complete vectorization processing',
84+
label: 'Knowledge write',
85+
text: 'Write the input paragraph list into the current knowledge base and complete vectorization processing',
8786
},
8887
dataSourceWebNode: {
8988
label: 'Web Site',
@@ -142,6 +141,9 @@ export default {
142141
},
143142
},
144143
},
144+
KnowledgeBaseNode: {
145+
DocumentSetting: 'Document Processing Setting',
146+
},
145147
aiChatNode: {
146148
label: 'AI Chat',
147149
text: 'Chat with an AI model',

ui/src/locales/lang/zh-CN/common.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -76,6 +76,7 @@ export default {
7676
success: '成功',
7777
fail: '失败',
7878
all: '全部',
79+
padding: '执行中',
7980
},
8081
param: {
8182
outputParam: '输出参数',

ui/src/locales/lang/zh-CN/workflow.ts

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -85,8 +85,8 @@ export default {
8585
},
8686
nodes: {
8787
knowledgeWriteNode: {
88-
text: '知识库写入',
89-
label: '将输入的分段列表写入当前知识库,并完成向量化处理',
88+
label: '知识库写入',
89+
text: '将输入的分段列表写入当前知识库,并完成向量化处理',
9090
},
9191
dataSourceWebNode: {
9292
label: 'Web站点',
@@ -146,6 +146,9 @@ export default {
146146
},
147147
},
148148
},
149+
KnowledgeBaseNode: {
150+
DocumentSetting: '文档处理设置',
151+
},
149152
aiChatNode: {
150153
label: 'AI 对话',
151154
text: '与 AI 大模型进行对话',

ui/src/locales/lang/zh-Hant/common.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -74,6 +74,7 @@ export default {
7474
success: '成功',
7575
fail: '失敗',
7676
all: '全部',
77+
padding: '執行中',
7778
},
7879
param: {
7980
outputParam: '輸出參數',

ui/src/locales/lang/zh-Hant/workflow.ts

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -81,8 +81,8 @@ export default {
8181
},
8282
nodes: {
8383
knowledgeWriteNode: {
84-
text: '知識庫寫入',
85-
label: '將輸入的分段列表寫入當前知識庫,並完成向量化處理',
84+
label: '知識庫寫入',
85+
text: '將輸入的分段列表寫入當前知識庫,並完成向量化處理',
8686
},
8787
dataSourceWebNode: {
8888
label: 'Web網站',
@@ -141,6 +141,9 @@ export default {
141141
},
142142
},
143143
},
144+
KnowledgeBaseNode: {
145+
DocumentSetting: '文檔處理設置',
146+
},
144147
aiChatNode: {
145148
label: 'AI 對話',
146149
text: '與 AI 大模型進行對話',

ui/src/views/knowledge-workflow/component/execution-record/ExecutionRecordDrawer.vue

Lines changed: 30 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -46,26 +46,42 @@
4646
class="w-full"
4747
v-loading="loading"
4848
@changePage="changePage"
49-
:maxTableHeight="200"
49+
:maxTableHeight="150"
50+
:paginationConfig="paginationConfig"
5051
>
5152
<el-table-column prop="user_name" :label="$t('workflow.initiator')">
5253
<template #default="{ row }">
53-
{{ row.user_name }}
54+
{{ row.meta.user_name }}
5455
</template>
5556
</el-table-column>
56-
<el-table-column prop="state" label="状态" width="180">
57+
<el-table-column prop="state" :label="$t('common.status.label')" width="180">
5758
<template #default="{ row }">
58-
{{ row.state }}
59+
<el-text class="color-text-primary" v-if="row.state === 'SUCCESS'">
60+
<el-icon class="color-success"><SuccessFilled /></el-icon>
61+
{{ $t('common.status.success') }}
62+
</el-text>
63+
<el-text class="color-text-primary" v-else-if="row.state === 'FAILURE'">
64+
<el-icon class="color-danger"><CircleCloseFilled /></el-icon>
65+
{{ $t('common.status.fail') }}
66+
</el-text>
67+
<el-text class="color-text-primary" v-else>
68+
<el-icon class="is-loading color-primary"><Loading /></el-icon>
69+
{{ $t('common.status.padding') }}
70+
</el-text>
5971
</template>
6072
</el-table-column>
61-
<el-table-column prop="run_time" label="运行时间">
73+
<el-table-column prop="run_time" :label="$t('chat.KnowledgeSource.consumeTime')">
6274
<template #default="{ row }">
63-
{{ row.run_time }}
75+
{{ row.run_time != undefined ? row.run_time + 's' : '-' }}
6476
</template>
6577
</el-table-column>
66-
<el-table-column label="操作">
78+
<el-table-column :label="$t('common.operation')" width="80">
6779
<template #default="{ row }">
68-
<span @click="toDetails(row)">执行详情</span>
80+
<el-tooltip effect="dark" :content="$t('chat.executionDetails.title')" placement="top">
81+
<el-button type="primary" text @click.stop="toDetails(row)">
82+
<AppIcon iconName="app-operate-log"></AppIcon>
83+
</el-button>
84+
</el-tooltip>
6985
</template>
7086
</el-table-column>
7187
</app-table-infinite-scroll>
@@ -106,6 +122,7 @@ const changeFilterHandle = () => {
106122
}
107123
const changePage = () => {
108124
paginationConfig.current_page += 1
125+
console.log(paginationConfig.current_page)
109126
getList()
110127
}
111128
@@ -114,15 +131,18 @@ const getList = () => {
114131
.getWorkflowActionPage(active_knowledge_id.value, paginationConfig, query.value, loading)
115132
.then((ok: any) => {
116133
paginationConfig.total = ok.data?.total
117-
data.value = ok.data.records
134+
data.value = data.value.concat(ok.data.records)
118135
})
119136
}
120137
const open = (knowledge_id: string) => {
121-
drawer.value = true
122138
active_knowledge_id.value = knowledge_id
123139
getList()
140+
drawer.value = true
124141
}
125142
const close = () => {
143+
paginationConfig.current_page = 1
144+
paginationConfig.total = 0
145+
data.value = []
126146
drawer.value = false
127147
}
128148
defineExpose({ open, close })

ui/src/views/system/operate-log/index.vue

Lines changed: 16 additions & 39 deletions
Original file line numberDiff line numberDiff line change
@@ -105,6 +105,7 @@
105105
@sizeChange="handleSizeChange"
106106
@changePage="getList"
107107
v-loading="loading"
108+
show-overflow-tooltip
108109
>
109110
<el-table-column prop="menu" :label="$t('views.operateLog.table.menu')" width="160">
110111
<template #header>
@@ -158,23 +159,15 @@
158159
prop="operate"
159160
:label="$t('views.operateLog.table.detail')"
160161
width="160"
162+
:tooltip-formatter="
163+
({ row }: any) =>
164+
row.operate + (row.operation_object?.name ? `【${row.operation_object.name}】` : '')
165+
"
161166
>
162167
<template #default="{ row }">
163-
<el-tooltip
164-
:content="
165-
row.operate +
166-
(row.operation_object?.name ? `【${row.operation_object.name}】` : '')
167-
"
168-
effect="dark"
169-
placement="top"
170-
>
171-
<span class="text-ellipsis">
172-
{{
173-
row.operate +
174-
(row.operation_object?.name ? `【${row.operation_object.name}】` : '')
175-
}}
176-
</span>
177-
</el-tooltip>
168+
{{
169+
row.operate + (row.operation_object?.name ? `【${row.operation_object.name}】` : '')
170+
}}
178171
</template>
179172
</el-table-column>
180173
<el-table-column
@@ -253,17 +246,13 @@
253246
</el-table-column>
254247
<el-table-column :label="$t('common.operation')" width="60" align="left" fixed="right">
255248
<template #default="{ row }">
256-
<span class="mr-4">
257-
<el-tooltip
258-
effect="dark"
259-
:content="$t('views.operateLog.table.opt')"
260-
placement="top"
261-
>
262-
<el-button type="primary" text @click.stop="showDetails(row)" class="text-button">
263-
<AppIcon iconName="app-operate-log"></AppIcon>
264-
</el-button>
265-
</el-tooltip>
266-
</span>
249+
<!-- <span class="mr-4"> -->
250+
<el-tooltip effect="dark" :content="$t('views.operateLog.table.opt')" placement="top">
251+
<el-button type="primary" text @click.stop="showDetails(row)">
252+
<AppIcon iconName="app-operate-log"></AppIcon>
253+
</el-button>
254+
</el-tooltip>
255+
<!-- </span> -->
267256
</template>
268257
</el-table-column>
269258
</app-table>
@@ -517,16 +506,4 @@ onMounted(() => {
517506
changeDayHandle(history_day.value)
518507
})
519508
</script>
520-
<style lang="scss" scoped>
521-
.text-button {
522-
font-size: 14px;
523-
}
524-
525-
.text-ellipsis {
526-
white-space: nowrap;
527-
overflow: hidden;
528-
text-overflow: ellipsis;
529-
max-width: 100%;
530-
display: block;
531-
}
532-
</style>
509+
<style lang="scss" scoped></style>

ui/src/workflow/common/template.ts

Lines changed: 6 additions & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -786,21 +786,15 @@ export const knowledgeTemplate: any = {
786786
nodes: [
787787
{
788788
x: 120,
789-
y: 114.94150000000002,
789+
y: 115.05849999999998,
790790
id: 'knowledge-base-node',
791791
type: 'knowledge-base-node',
792792
properties: {
793793
config: {
794-
globalFields: [
795-
{
796-
label: 'a',
797-
value: 'a',
798-
globeLabel: '{{global.a}}',
799-
globeValue: "{{context['global'].a}}",
800-
},
801-
],
794+
fields: [],
795+
globalFields: [],
802796
},
803-
height: 384.266,
797+
height: 394.383,
804798
showNode: true,
805799
stepName: '\u57fa\u672c\u4fe1\u606f',
806800
node_data: {
@@ -812,32 +806,9 @@ export const knowledgeTemplate: any = {
812806
},
813807
input_field_list: [],
814808
user_input_config: {
815-
title: '\u7528\u6237\u8f93\u5165',
809+
title: '\u6587\u6863\u5904\u7406\u8bbe\u7f6e',
816810
},
817-
user_input_field_list: [
818-
{
819-
attrs: {
820-
maxlength: 200,
821-
minlength: 1,
822-
'show-word-limit': true,
823-
},
824-
field: 'a',
825-
label: 'a',
826-
required: false,
827-
input_type: 'TextInput',
828-
props_info: {
829-
rules: [
830-
{
831-
max: 200,
832-
min: 1,
833-
message: 'a\u957f\u5ea6\u5728 1 \u5230 200 \u4e2a\u5b57\u7b26',
834-
trigger: 'blur',
835-
},
836-
],
837-
},
838-
show_default_value: true,
839-
},
840-
],
811+
user_input_field_list: [],
841812
},
842813
},
843814
{

0 commit comments

Comments
 (0)