Skip to content

Commit d4d88ac

Browse files
fix: optimize style
1 parent 720cfc7 commit d4d88ac

File tree

12 files changed

+76
-74
lines changed

12 files changed

+76
-74
lines changed

ui/src/components/app-charts/components/BarCharts.vue

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -94,6 +94,16 @@ function initChart() {
9494
},
9595
},
9696
},
97+
dataZoom: [
98+
{
99+
type: 'inside',
100+
show: props.option.dataZoom,
101+
},
102+
{
103+
type: 'slider',
104+
show: props.option.dataZoom,
105+
},
106+
],
97107
series: series,
98108
}
99109
@@ -117,6 +127,7 @@ watch(
117127
)
118128
119129
onMounted(() => {
130+
console.log(props.option.dataZoom)
120131
nextTick(() => {
121132
initChart()
122133
window.addEventListener('resize', changeChartSize)

ui/src/components/layout-container/index.vue

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
<div
44
:class="`layout-container__left border-r ${isCollapse ? 'hidden' : ''}`"
55
:style="{ width: isCollapse ? 0 : `${leftWidth}px` }"
6+
v-if="showLeft"
67
>
78
<div class="layout-container__left_content">
89
<slot name="left"></slot>
@@ -48,6 +49,10 @@ const props = defineProps({
4849
type: Number,
4950
default: 400,
5051
},
52+
showLeft: {
53+
type: Boolean,
54+
default: true,
55+
},
5156
})
5257
5358
const isCollapse = ref(false)

ui/src/components/workflow-dropdown-menu/knowledge-inner/index.vue

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
<div
33
v-show="show"
44
class="workflow-dropdown-menu border border-r-6 white-bg"
5-
:style="{ width: activeName === 'base' ? '400px' : '640px' }"
5+
:style="{ width: activeName === 'base' || route.path.includes('shared') ? '400px' : '640px' }"
66
>
77
<el-tabs v-model="activeName" class="workflow-dropdown-tabs" @tab-change="handleClick">
88
<div
@@ -73,7 +73,7 @@
7373
</el-tab-pane>
7474
<!-- 工具 -->
7575
<el-tab-pane :label="$t('views.tool.title')" name="CUSTOM_TOOL">
76-
<LayoutContainer>
76+
<LayoutContainer :showLeft="!route.path.includes('shared')">
7777
<template #left>
7878
<folder-tree
7979
:source="SourceTypeEnum.TOOL"

ui/src/components/workflow-dropdown-menu/knowledge/index.vue

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
<div
33
v-show="show"
44
class="workflow-dropdown-menu border border-r-6 white-bg"
5-
:style="{ width: activeName === 'base' ? '400px' : '640px' }"
5+
:style="{ width: activeName === 'base' || route.path.includes('shared') ? '400px' : '640px' }"
66
>
77
<el-tabs v-model="activeName" class="workflow-dropdown-tabs" @tab-change="handleClick">
88
<div
@@ -73,7 +73,7 @@
7373
</el-tab-pane>
7474
<!-- 数据源 -->
7575
<el-tab-pane :label="$t('views.tool.dataSource.title')" name="DATA_SOURCE_TOOL">
76-
<LayoutContainer>
76+
<LayoutContainer :showLeft="!route.path.includes('shared')">
7777
<template #left>
7878
<folder-tree
7979
:source="SourceTypeEnum.TOOL"
@@ -97,7 +97,7 @@
9797
</el-tab-pane>
9898
<!-- 工具 -->
9999
<el-tab-pane :label="$t('views.tool.title')" name="CUSTOM_TOOL">
100-
<LayoutContainer>
100+
<LayoutContainer :showLeft="!route.path.includes('shared')">
101101
<template #left>
102102
<folder-tree
103103
:source="SourceTypeEnum.TOOL"

ui/src/layout/layout-header/SystemHeader.vue

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -43,10 +43,7 @@ import { hasPermission } from '@/utils/permission'
4343
4444
const router = useRouter()
4545
const goHome = () => {
46-
const newUrl = router.resolve({
47-
path: `/`,
48-
}).href
49-
window.open(newUrl)
46+
router.push('/')
5047
}
5148
</script>
5249
<style lang="scss" scoped>

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -538,6 +538,6 @@ You are a master of problem optimization, adept at accurately inferring user int
538538
SystemPromptPlaceholder: 'System Prompt, can reference variables in the system, such as',
539539
UserPromptPlaceholder: 'User Prompt, can reference variables in the system, such as',
540540
ExecutionRecord: 'Execution Record',
541-
initiator: 'Initiator',
541+
initiator: 'Iniiator',
542542
debug: {},
543543
}

ui/src/views/application-overview/component/StatisticsCharts.vue

Lines changed: 12 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -109,7 +109,6 @@ const props = defineProps({
109109
},
110110
})
111111
112-
113112
const statisticsType = computed(() => [
114113
{
115114
id: 'customerCharts',
@@ -199,7 +198,12 @@ const statisticsType = computed(() => [
199198
},
200199
])
201200
202-
const topOptions = [{ label: 'TOP 10', value: 10 }, { label: 'TOP 20', value: 20}, { label: 'TOP 50', value: 50}, { label: 'TOP 100', value: 100}]
201+
const topOptions = [
202+
{ label: 'TOP 10', value: 10 },
203+
{ label: 'TOP 20', value: 20 },
204+
{ label: 'TOP 50', value: 50 },
205+
{ label: 'TOP 100', value: 100 },
206+
]
203207
const tokenUsageCount = ref(10)
204208
const topQuestionsCount = ref(10)
205209
const tokenUsageOption = computed(() => {
@@ -211,6 +215,7 @@ const tokenUsageOption = computed(() => {
211215
data: getAttrsArray(props.tokenUsage?.slice(0, tokenUsageCount.value), 'token_usage'),
212216
},
213217
],
218+
dataZoom: props.tokenUsage.length > 0,
214219
}
215220
})
216221
const topQuestionsOption = computed(() => {
@@ -219,9 +224,13 @@ const topQuestionsOption = computed(() => {
219224
xData: getAttrsArray(props.topQuestions?.slice(0, topQuestionsCount.value), 'username'),
220225
yData: [
221226
{
222-
data: getAttrsArray(props.topQuestions?.slice(0, topQuestionsCount.value), 'chat_record_count'),
227+
data: getAttrsArray(
228+
props.topQuestions?.slice(0, topQuestionsCount.value),
229+
'chat_record_count',
230+
),
223231
},
224232
],
233+
dataZoom: props.topQuestions.length > 0,
225234
}
226235
})
227236
</script>

ui/src/views/document/ImportWorkflowDocument.vue

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,7 @@ const route = useRoute()
7676
const key = ref<number>(0)
7777
const {
7878
params: { folderId },
79-
query: { id } ,
79+
query: { id },
8080
/*
8181
id为knowledgeID
8282
folderId 可以区分 resource-management shared还是 workspace
@@ -153,10 +153,7 @@ const continueImporting = () => {
153153
})
154154
}
155155
const goDocument = () => {
156-
const newUrl = router.resolve({
157-
path: `/knowledge/${id}/${folderId}/4/document`,
158-
}).href
159-
window.open(newUrl)
156+
router.push({ path: `/knowledge/${id}/${folderId}/4/document` })
160157
}
161158
162159
const back = () => {

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@
5858
<p>
5959
{{
6060
props.currentContent?.run_time != undefined
61-
? props.currentContent?.run_time + 's'
61+
? props.currentContent?.run_time?.toFixed(2) + 's'
6262
: '-'
6363
}}
6464
</p>

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

Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,7 @@
7272
</el-table-column>
7373
<el-table-column prop="run_time" :label="$t('chat.KnowledgeSource.consumeTime')">
7474
<template #default="{ row }">
75-
{{ row.run_time != undefined ? row.run_time + 's' : '-' }}
75+
{{ row.run_time != undefined ? row.run_time?.toFixed(2) + 's' : '-' }}
7676
</template>
7777
</el-table-column>
7878
<el-table-column
@@ -128,7 +128,7 @@ const apiType = computed(() => {
128128
})
129129
const paginationConfig = reactive({
130130
current_page: 1,
131-
page_size: 10,
131+
page_size: 50,
132132
total: 0,
133133
})
134134
const query = ref<any>({
@@ -168,16 +168,13 @@ const changePage = () => {
168168
const getList = (clear?: boolean) => {
169169
if (clear) {
170170
paginationConfig.current_page = 1
171+
data.value = []
171172
}
172173
return loadSharedApi({ type: 'knowledge', systemType: apiType.value })
173174
.getWorkflowActionPage(active_knowledge_id.value, paginationConfig, query.value, loading)
174175
.then((ok: any) => {
175176
paginationConfig.total = ok.data?.total
176-
if (clear) {
177-
data.value = ok.data.records
178-
} else {
179-
data.value = data.value.concat(ok.data.records)
180-
}
177+
data.value = data.value.concat(ok.data.records)
181178
})
182179
}
183180

0 commit comments

Comments
 (0)