diff --git a/ui/package.json b/ui/package.json index d17f1fc23..e0c89ce99 100644 --- a/ui/package.json +++ b/ui/package.json @@ -16,17 +16,24 @@ "@codemirror/lang-json": "^6.0.1", "@codemirror/lang-python": "^6.2.1", "@codemirror/theme-one-dark": "^6.1.2", + "@vavt/cm-extension": "^1.9.1", "@wecom/jssdk": "^2.3.1", "axios": "^1.8.4", + "cropperjs": "^2.0.0-rc.2", "dingtalk-jsapi": "^3.1.0", "element-plus": "^2.9.10", + "highlight.js": "^11.11.1", + "katex": "^0.16.22", "md-editor-v3": "^5.6.1", + "mermaid": "^11.6.0", "nprogress": "^0.2.0", "pinia": "^3.0.1", + "screenfull": "^6.0.2", "use-element-plus-theme": "^0.0.5", "vue": "^3.5.13", "vue-clipboard3": "^2.0.0", "vue-codemirror": "^6.1.1", + "vue-draggable-plus": "^0.6.0", "vue-i18n": "^11.1.3", "vue-router": "^4.5.0" }, diff --git a/ui/src/assets/sort.svg b/ui/src/assets/sort.svg new file mode 100644 index 000000000..e24e0450a --- /dev/null +++ b/ui/src/assets/sort.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/ui/src/components/index.ts b/ui/src/components/index.ts index dbd79d8a8..9e840e3ee 100644 --- a/ui/src/components/index.ts +++ b/ui/src/components/index.ts @@ -19,6 +19,7 @@ import AutoTooltip from './auto-tooltip/index.vue' import MdEditor from './markdown/MdEditor.vue' import MdPreview from './markdown/MdPreview.vue' import MdEditorMagnify from './markdown/MdEditorMagnify.vue' +import TagEllipsis from './tag-ellipsis/index.vue' export default { install(app: App) { app.component('LogoFull', LogoFull) @@ -41,5 +42,6 @@ export default { app.component('MdPreview', MdPreview) app.component('MdEditor', MdEditor) app.component('MdEditorMagnify', MdEditorMagnify) + app.component('TagEllipsis', TagEllipsis) }, } diff --git a/ui/src/components/tag-ellipsis/index.vue b/ui/src/components/tag-ellipsis/index.vue new file mode 100644 index 000000000..23811bb17 --- /dev/null +++ b/ui/src/components/tag-ellipsis/index.vue @@ -0,0 +1,26 @@ + + + diff --git a/ui/src/main.ts b/ui/src/main.ts index 9180a5325..7cd83df71 100644 --- a/ui/src/main.ts +++ b/ui/src/main.ts @@ -19,7 +19,6 @@ import katex from 'katex' import 'katex/dist/katex.min.css' import Cropper from 'cropperjs' -import 'cropperjs/dist/cropper.css' import mermaid from 'mermaid' diff --git a/ui/src/stores/index.ts b/ui/src/stores/index.ts index e2b1db221..7ed8955c4 100644 --- a/ui/src/stores/index.ts +++ b/ui/src/stores/index.ts @@ -7,6 +7,7 @@ import useKnowledgeStore from './modules/knowledge' import useModelStore from './modules/model' import usePromptStore from './modules/prompt' import useProblemStore from './modules/problem' +import useParagraphStore from './modules/paragraph' const useStore = () => ({ common: useCommonStore(), @@ -18,6 +19,7 @@ const useStore = () => ({ model: useModelStore(), prompt: usePromptStore(), problem: useProblemStore(), + paragraph: useParagraphStore(), }) export default useStore diff --git a/ui/src/stores/modules/paragraph.ts b/ui/src/stores/modules/paragraph.ts new file mode 100644 index 000000000..0149e4280 --- /dev/null +++ b/ui/src/stores/modules/paragraph.ts @@ -0,0 +1,47 @@ +import { defineStore } from 'pinia' +import paragraphApi from '@/api/knowledge/paragraph' +import type { Ref } from 'vue' + +const useParagraphStore = defineStore('paragraph', { + state: () => ({}), + actions: { + async asyncPutParagraph( + datasetId: string, + documentId: string, + paragraphId: string, + data: any, + loading?: Ref, + ) { + return new Promise((resolve, reject) => { + paragraphApi + .putParagraph(datasetId, documentId, paragraphId, data, loading) + .then((data) => { + resolve(data) + }) + .catch((error) => { + reject(error) + }) + }) + }, + + async asyncDelParagraph( + datasetId: string, + documentId: string, + paragraphId: string, + loading?: Ref, + ) { + return new Promise((resolve, reject) => { + paragraphApi + .delParagraph(datasetId, documentId, paragraphId, loading) + .then((data) => { + resolve(data) + }) + .catch((error) => { + reject(error) + }) + }) + }, + }, +}) + +export default useParagraphStore diff --git a/ui/src/styles/component.scss b/ui/src/styles/component.scss index 8366a4ed1..60d169fba 100644 --- a/ui/src/styles/component.scss +++ b/ui/src/styles/component.scss @@ -99,3 +99,25 @@ padding: 0 !important; } } + +// 分段 dialog +.paragraph-dialog { + padding: 0 !important; + .el-scrollbar { + height: auto !important; + } + .el-dialog__header { + padding: 16px 24px; + } + .el-dialog__body { + border-top: 1px solid var(--el-border-color); + } + .el-dialog__footer { + padding: 16px 24px; + border-top: 1px solid var(--el-border-color); + } + + .title { + color: var(--app-text-color); + } +} diff --git a/ui/src/styles/index.scss b/ui/src/styles/index.scss index 0d5b82957..e1476a3e7 100644 --- a/ui/src/styles/index.scss +++ b/ui/src/styles/index.scss @@ -3,6 +3,7 @@ @use './variables.scss'; @use './app.scss'; @use './component.scss'; +@use './md-editor.scss'; @import 'nprogress/nprogress.css'; @import 'md-editor-v3/lib/style.css'; -@import './md-editor.scss'; + diff --git a/ui/src/views/application-overview/component/XPackDisplaySettingDialog.vue b/ui/src/views/application-overview/component/XPackDisplaySettingDialog.vue index 3f7c8d61a..d28bbe6de 100644 --- a/ui/src/views/application-overview/component/XPackDisplaySettingDialog.vue +++ b/ui/src/views/application-overview/component/XPackDisplaySettingDialog.vue @@ -59,7 +59,7 @@ @@ -69,7 +69,7 @@ :size="20" class="color-secondary" :style="{ - color: xpackForm.custom_theme?.header_font_color + color: xpackForm.custom_theme?.header_font_color, }" > @@ -305,7 +305,7 @@ ({ disclaimer_value: t('views.applicationOverview.appInfo.SettingDisplayDialog.disclaimerValue'), custom_theme: { theme_color: '', - header_font_color: '#1f2329' + header_font_color: '#1f2329', }, float_location: { y: {type: 'bottom', value: 30}, x: {type: 'right', value: 0} }, show_avatar: true, - show_user_avatar: false + show_user_avatar: false, }) const imgUrl = ref({ @@ -512,7 +512,7 @@ const detail = ref(null) const customStyle = computed(() => { return { background: xpackForm.value.custom_theme?.theme_color, - color: xpackForm.value.custom_theme?.header_font_color + color: xpackForm.value.custom_theme?.header_font_color, } }) @@ -561,7 +561,7 @@ const open = (data: any, content: any) => { t('views.applicationOverview.appInfo.SettingDisplayDialog.disclaimerValue') ) { xpackForm.value.disclaimer_value = t( - 'views.applicationOverview.appInfo.SettingDisplayDialog.disclaimerValue' + 'views.applicationOverview.appInfo.SettingDisplayDialog.disclaimerValue', ) } xpackForm.value.avatar_url = data.avatar @@ -573,7 +573,7 @@ const open = (data: any, content: any) => { xpackForm.value.show_user_avatar = data.show_user_avatar xpackForm.value.custom_theme = { theme_color: data.custom_theme?.theme_color || '', - header_font_color: data.custom_theme?.header_font_color || '#1f2329' + header_font_color: data.custom_theme?.header_font_color || '#1f2329', } xpackForm.value.float_location = data.float_location dialogVisible.value = true @@ -613,7 +613,7 @@ defineExpose({open}) diff --git a/ui/src/views/paragraph/index.vue b/ui/src/views/paragraph/index.vue index 36539e459..7c2d9eb9b 100644 --- a/ui/src/views/paragraph/index.vue +++ b/ui/src/views/paragraph/index.vue @@ -25,7 +25,7 @@
@@ -46,22 +46,58 @@
- -
- -
- - - +
+
+ + + +
+
+ +
+ +
+ + + + + +
+
- +
@@ -89,12 +125,15 @@