From d14b47373a852a1cb89666c2f7d7c16165ccec7c Mon Sep 17 00:00:00 2001 From: wangdan-fit2cloud Date: Tue, 13 May 2025 16:19:21 +0800 Subject: [PATCH] feat: model --- ui/package.json | 2 +- ui/src/components/app-icon/icons/folder.ts | 61 ++++ ui/src/components/app-icon/index.ts | 26 +- ui/src/components/common-list/index.vue | 93 ++++++ ui/src/components/folder-tree/index.vue | 2 +- ui/src/components/index.ts | 2 + .../layout-container/ContentContainer.vue | 18 +- ui/src/components/layout-container/index.vue | 2 +- ui/src/styles/app.scss | 7 + ui/src/styles/component.scss | 14 + ui/src/styles/element-plus.scss | 56 ++++ ui/src/styles/index.scss | 1 + ui/src/styles/variables.scss | 23 +- ui/src/views/knowledge/index.vue | 10 +- ui/src/views/model/component/ModelCard.vue | 22 +- ui/src/views/model/index.vue | 273 +++++++++--------- ui/src/views/tool/index.vue | 8 +- 17 files changed, 427 insertions(+), 193 deletions(-) create mode 100644 ui/src/components/app-icon/icons/folder.ts create mode 100644 ui/src/components/common-list/index.vue create mode 100644 ui/src/styles/component.scss diff --git a/ui/package.json b/ui/package.json index 87e1c579e..f76c53ddc 100644 --- a/ui/package.json +++ b/ui/package.json @@ -16,7 +16,7 @@ "@codemirror/lang-json": "^6.0.1", "@codemirror/theme-one-dark": "^6.1.2", "axios": "^1.8.4", - "element-plus": "^2.9.7", + "element-plus": "^2.9.10", "nprogress": "^0.2.0", "pinia": "^3.0.1", "use-element-plus-theme": "^0.0.5", diff --git a/ui/src/components/app-icon/icons/folder.ts b/ui/src/components/app-icon/icons/folder.ts new file mode 100644 index 000000000..963fadff0 --- /dev/null +++ b/ui/src/components/app-icon/icons/folder.ts @@ -0,0 +1,61 @@ +import { h } from 'vue' +export default { + 'app-folder': { + 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 170.666667a42.666667 42.666667 0 0 1 42.666666-42.666667h357.632a42.666667 42.666667 0 0 1 38.144 23.594667L512 213.333333h426.666667a42.666667 42.666667 0 0 1 42.666666 42.666667v597.333333a42.666667 42.666667 0 0 1-42.666666 42.666667H85.333333a42.666667 42.666667 0 0 1-42.666666-42.666667V170.666667z', + fill: '#FFA53D', + }), + h('path', { + d: 'M42.666667 256a42.666667 42.666667 0 0 1 42.666666-42.666667h853.333334a42.666667 42.666667 0 0 1 42.666666 42.666667v597.333333a42.666667 42.666667 0 0 1-42.666666 42.666667H85.333333a42.666667 42.666667 0 0 1-42.666666-42.666667V256z', + fill: '#FFC60A', + }), + ], + ), + ]) + }, + }, + 'app-all-menu-active': { + iconReader: () => { + return h('i', [ + h( + 'svg', + { + style: { height: '100%', width: '100%' }, + viewBox: '0 0 20 20', + version: '1.1', + xmlns: 'http://www.w3.org/2000/svg' + }, + [ + h('path', { + d: 'M8.33317 1.6665H2.49984C2.0396 1.6665 1.6665 2.0396 1.6665 2.49984V8.33317C1.6665 8.79341 2.0396 9.1665 2.49984 9.1665H8.33317C8.79341 9.1665 9.1665 8.79341 9.1665 8.33317V2.49984C9.1665 2.0396 8.79341 1.6665 8.33317 1.6665Z', + fill: 'currentColor' + }), + h('path', { + d: 'M8.33317 10.8332H2.49984C2.0396 10.8332 1.6665 11.2063 1.6665 11.6665V17.4998C1.6665 17.9601 2.0396 18.3332 2.49984 18.3332H8.33317C8.79341 18.3332 9.1665 17.9601 9.1665 17.4998V11.6665C9.1665 11.2063 8.79341 10.8332 8.33317 10.8332Z', + fill: 'currentColor' + }), + h('path', { + d: 'M17.4998 1.6665H11.6665C11.2063 1.6665 10.8332 2.0396 10.8332 2.49984V8.33317C10.8332 8.79341 11.2063 9.1665 11.6665 9.1665H17.4998C17.9601 9.1665 18.3332 8.79341 18.3332 8.33317V2.49984C18.3332 2.0396 17.9601 1.6665 17.4998 1.6665Z', + fill: 'currentColor' + }), + h('path', { + d: 'M17.4508 10.8332H11.7155C11.2282 10.8332 10.8332 11.2282 10.8332 11.7155V17.4508C10.8332 17.9381 11.2282 18.3332 11.7155 18.3332H17.4508C17.9381 18.3332 18.3332 17.9381 18.3332 17.4508V11.7155C18.3332 11.2282 17.9381 10.8332 17.4508 10.8332Z', + fill: 'currentColor' + }) + ] + ) + ]) + } + }, +} diff --git a/ui/src/components/app-icon/index.ts b/ui/src/components/app-icon/index.ts index c88dd2655..65f578f19 100644 --- a/ui/src/components/app-icon/index.ts +++ b/ui/src/components/app-icon/index.ts @@ -117,31 +117,7 @@ export const iconMap: any = { ]) }, }, - 'app-folder': { - 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 170.666667a42.666667 42.666667 0 0 1 42.666666-42.666667h357.632a42.666667 42.666667 0 0 1 38.144 23.594667L512 213.333333h426.666667a42.666667 42.666667 0 0 1 42.666666 42.666667v597.333333a42.666667 42.666667 0 0 1-42.666666 42.666667H85.333333a42.666667 42.666667 0 0 1-42.666666-42.666667V170.666667z', - fill: '#FFA53D', - }), - h('path', { - d: 'M42.666667 256a42.666667 42.666667 0 0 1 42.666666-42.666667h853.333334a42.666667 42.666667 0 0 1 42.666666 42.666667v597.333333a42.666667 42.666667 0 0 1-42.666666 42.666667H85.333333a42.666667 42.666667 0 0 1-42.666666-42.666667V256z', - fill: '#FFC60A', - }), - ], - ), - ]) - }, - }, + // 动态加载的图标 ...dynamicIcons, } diff --git a/ui/src/components/common-list/index.vue b/ui/src/components/common-list/index.vue new file mode 100644 index 000000000..1e3784251 --- /dev/null +++ b/ui/src/components/common-list/index.vue @@ -0,0 +1,93 @@ + + + diff --git a/ui/src/components/folder-tree/index.vue b/ui/src/components/folder-tree/index.vue index 2b208e524..fd5d95431 100644 --- a/ui/src/components/folder-tree/index.vue +++ b/ui/src/components/folder-tree/index.vue @@ -5,7 +5,7 @@ :placeholder="$t('common.search')" prefix-icon="Search" clearable - class="p-8" + class="p-16" /> -
+
- -

{{ header }}

-
+
+ +

{{ header }}

+
+ +

{{ header }}

+
+
-
+
@@ -34,11 +39,10 @@ const showBack = computed(() => { transition: 0.3s; .content-container__header { box-sizing: border-box; - padding: calc(var(--app-base-px) * 2) 0; + padding: calc(var(--app-base-px) * 2) calc(var(--app-base-px) * 2) 0; flex-wrap: wrap; } .content-container__main { - // background-color: var(--app-view-bg-color); box-sizing: border-box; min-width: 447px; } diff --git a/ui/src/components/layout-container/index.vue b/ui/src/components/layout-container/index.vue index 81399c610..fa604a048 100644 --- a/ui/src/components/layout-container/index.vue +++ b/ui/src/components/layout-container/index.vue @@ -1,6 +1,6 @@