From 64b6e5bcad4a1d2a999ca0b1ff2a894e9b4db863 Mon Sep 17 00:00:00 2001
From: wangdan-fit2cloud
Date: Tue, 3 Sep 2024 15:07:15 +0800
Subject: [PATCH] =?UTF-8?q?perf:=20=E4=BC=98=E5=8C=96=E4=B8=8A=E4=BC=A0?=
=?UTF-8?q?=E6=96=87=E6=A1=A3=E9=A1=B5=E9=9D=A2?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
ui/src/components/icons/index.ts | 39 +++++----
ui/src/styles/app.scss | 9 +-
ui/src/utils/utils.ts | 6 +-
.../dataset/component/UploadComponent.vue | 87 +++++++++++++------
ui/src/views/document/index.vue | 38 ++++----
5 files changed, 113 insertions(+), 66 deletions(-)
diff --git a/ui/src/components/icons/index.ts b/ui/src/components/icons/index.ts
index a4797071c..246a1dcba 100644
--- a/ui/src/components/icons/index.ts
+++ b/ui/src/components/icons/index.ts
@@ -551,6 +551,27 @@ export const iconMap: any = {
])
}
},
+ 'app-warning-colorful': {
+ iconReader: () => {
+ return h('i', [
+ h(
+ 'svg',
+ {
+ style: { height: '100%', width: '100%' },
+ viewBox: '0 0 1024 1024',
+ version: '1.1',
+ xmlns: 'http://www.w3.org/2000/svg'
+ },
+ [
+ h('path', {
+ d: 'M42.666667 512c0 259.2 210.133333 469.333333 469.333333 469.333333s469.333333-210.133333 469.333333-469.333333S771.2 42.666667 512 42.666667 42.666667 252.8 42.666667 512z m469.333333-277.333333A53.333333 53.333333 0 1 1 512 341.333333a53.333333 53.333333 0 0 1 0-106.666666zM458.666667 384h64a42.666667 42.666667 0 0 1 42.666666 42.666667v256h53.333334a21.333333 21.333333 0 0 1 21.333333 21.333333v42.666667a21.333333 21.333333 0 0 1-21.333333 21.333333H426.666667a21.333333 21.333333 0 0 1-21.333334-21.333333v-42.666667a21.333333 21.333333 0 0 1 21.333334-21.333333h53.333333v-213.333334h-21.333333a21.333333 21.333333 0 0 1-21.333334-21.333333v-42.666667a21.333333 21.333333 0 0 1 21.333334-21.333333z',
+ fill: '#3370FF'
+ })
+ ]
+ )
+ ])
+ }
+ },
'app-operation': {
iconReader: () => {
return h('i', [
@@ -906,23 +927,7 @@ export const iconMap: any = {
},
[
h('path', {
- d: 'M494.592 165.12l-320 208a32 32 0 0 0-14.592 26.88v224a32 32 0 0 0 14.592 26.88l320 208a32 32 0 0 0 34.88 0l320-208a32 32 0 0 0 14.528-26.88v-224a32 32 0 0 0-14.528-26.88l-320-208a32 32 0 0 0-34.88 0zM224 417.408L512 230.144l288 187.2V606.72L512 793.856 224 606.656V417.28z',
- fill: 'currentColor'
- }),
- h('path', {
- d: 'M512 592a32 32 0 0 0-32 32V832a32 32 0 0 0 64 0V624a32 32 0 0 0-32-32z',
- fill: 'currentColor'
- }),
- h('path', {
- d: 'M165.76 381.632a32 32 0 0 0 7.872 44.608l320 224a32 32 0 0 0 36.736 0l320-224a32 32 0 0 0-36.736-52.48L512 584.96l-301.632-211.2a32 32 0 0 0-44.608 7.872z',
- fill: 'currentColor'
- }),
- h('path', {
- d: 'M493.632 373.76a32 32 0 0 1 36.736 0l320 224a32 32 0 0 1-36.736 52.48L512 439.04l-301.632 211.2a32 32 0 1 1-36.736-52.48l320-224z',
- fill: 'currentColor'
- }),
- h('path', {
- d: 'M512 160a32 32 0 0 0-32 32v208a32 32 0 0 0 64 0V192a32 32 0 0 0-32-32z',
+ d: 'M512 170.666667a85.333333 85.333333 0 0 1 85.333333-85.333334h256a85.333333 85.333333 0 0 1 85.333334 85.333334v256a85.333333 85.333333 0 0 1-85.333334 85.333333h-256a85.333333 85.333333 0 0 1-85.333333-85.333333V170.666667z m85.333333 0v256h256V170.666667h-256zM85.333333 597.333333a85.333333 85.333333 0 0 1 85.333334-85.333333h256a85.333333 85.333333 0 0 1 85.333333 85.333333v256a85.333333 85.333333 0 0 1-85.333333 85.333334H170.666667a85.333333 85.333333 0 0 1-85.333334-85.333334v-256z m85.333334 0v256h256v-256H170.666667zM128 298.666667a213.333333 213.333333 0 0 1 213.333333-213.333334h85.333334v85.333334H341.333333a128 128 0 0 0-128 128h57.514667a12.8 12.8 0 0 1 9.728 21.12l-100.181333 116.906666a12.8 12.8 0 0 1-19.456 0l-100.181334-116.906666A12.8 12.8 0 0 1 70.485333 298.666667H128zM896 725.333333a213.333333 213.333333 0 0 1-213.333333 213.333334h-85.333334v-85.333334h85.333334a128 128 0 0 0 128-128v-21.333333h-57.514667a12.8 12.8 0 0 1-9.728-21.12l100.181333-116.906667a12.8 12.8 0 0 1 19.456 0l100.181334 116.906667a12.8 12.8 0 0 1-9.728 21.12H896v21.333333z',
fill: 'currentColor'
})
]
diff --git a/ui/src/styles/app.scss b/ui/src/styles/app.scss
index 03ebdd8d0..c15b79913 100644
--- a/ui/src/styles/app.scss
+++ b/ui/src/styles/app.scss
@@ -699,10 +699,11 @@ h5 {
font-weight: 400;
}
.el-radio-button__original-radio:checked + .el-radio-button__inner {
- color: var(--el-color-primary);
- background: var(--el-color-primary-light-9);
- border: none;
- box-shadow: none;
+ color: var(--el-color-primary) !important;
+ background: var(--el-color-primary-light-9) !important;
+ border: none !important;
+ box-shadow: none !important;
+ font-weight: 500;
}
}
diff --git a/ui/src/utils/utils.ts b/ui/src/utils/utils.ts
index b2d77d834..b4a87f38c 100644
--- a/ui/src/utils/utils.ts
+++ b/ui/src/utils/utils.ts
@@ -38,7 +38,7 @@ export function fileType(name: string) {
获得文件对应图片
*/
const typeList: any = {
- txt: ['txt', 'pdf', 'docx', 'csv', 'md', 'html', 'PDF'],
+ txt: ['txt', 'pdf', 'docx', 'csv', 'md', 'html'],
table: ['xlsx', 'xls', 'csv'],
QA: ['xlsx', 'csv', 'xls']
}
@@ -46,12 +46,12 @@ const typeList: any = {
export function getImgUrl(name: string) {
const list = Object.values(typeList).flat()
- const type = list.includes(fileType(name.toLowerCase())) ? fileType(name.toLowerCase()) : 'unknow'
+ const type = list.includes(fileType(name).toLowerCase()) ? fileType(name).toLowerCase() : 'unknow'
return new URL(`../assets/${type}-icon.svg`, import.meta.url).href
}
// 是否是白名单后缀
export function isRightType(name: string, type: string) {
- return typeList[type].includes(fileType(name))
+ return typeList[type].includes(fileType(name).toLowerCase())
}
/*
diff --git a/ui/src/views/dataset/component/UploadComponent.vue b/ui/src/views/dataset/component/UploadComponent.vue
index 305ae1ca4..45857ff67 100644
--- a/ui/src/views/dataset/component/UploadComponent.vue
+++ b/ui/src/views/dataset/component/UploadComponent.vue
@@ -7,14 +7,33 @@
label-position="top"
require-asterisk-position="right"
>
-
-
- 文本文件
- 表格
- QA 问答对
+
+
+ 文本文件
+ 表格
+ QA 问答对
-
+
+
+
+
+
+
+ 1、点击下载对应模版并完善信息:
+
+ 下载 Excel 模版
+
+
+ 下载 CSV 模版
+
+
+
2、上传的表格文件中每个 sheet 会作为一个文档,sheet名称为文档名称
+
3、每次最多上传 50 个文件,每个文件不超过 100MB
+
+
选择文件夹
-
当前支持 XLSX / XLS / CSV 格式的文档
-
每次最多上传50个文件,每个文件不超过 100MB
+
支持格式:EXCEL、CSV
-
- 下载 Excel 模板
-
-
- 下载 CSV 模板
+
+
+
+
+ 1、点击下载对应模版并完善信息:
+
+ 下载 Excel 模版
+
+
+ 下载 CSV 模版
+
+
+
2、第一行必须是列标题,且列标题必须是有意义的术语,表中每条记录将作为一个分段
+
3、上传的表格文件中每个 sheet 会作为一个文档,sheet名称为文档名称
+
4、每次最多上传 50 个文件,每个文件不超过 100MB
+
+
选择文件夹
-
当前支持 EXCEL和CSV 格式文件。
-
第一行必须是列标题,且列标题必须是有意义的术语,表中每条记录将作为一个分段。
-
每次最多上传50个文档,每个文档最大不能超过100MB。
+
支持格式:EXCEL 和 CSV
-
- 下载 Excel 模板
-
-
- 下载 CSV 模板
+
+
+
+
1、文件上传前,建议规范文件的分段标识
+
2、每次最多上传 50 个文件,每个文件不超过 100MB
+
+
选择文件夹
-
- 支持格式:TXT、Markdown、PDF、DOCX、HTML、Excel、CSV 每次最多上传50个文件,每个文件不超过 100MB
-
-
若使用【高级分段】建议上传前规范文件的分段标识
+
支持格式:TXT、Markdown、PDF、DOCX、HTML
@@ -253,4 +284,8 @@ defineExpose({
color: var(--el-color-primary-light-5);
}
}
+.update-info {
+ background: #d6e2ff;
+ line-height: 25px;
+}
diff --git a/ui/src/views/document/index.vue b/ui/src/views/document/index.vue
index b7e4d141e..f6221a395 100644
--- a/ui/src/views/document/index.vue
+++ b/ui/src/views/document/index.vue
@@ -153,6 +153,13 @@
+
+
+
+
+
+
+
@@ -160,10 +167,6 @@
-
-
- 设置
-
迁移
@@ -181,11 +184,21 @@
-
-
-
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
@@ -193,13 +206,6 @@
-
-
- 重新向量化
设置