|
|
@@ -3,25 +3,194 @@
|
|
|
<div class="body-item">
|
|
|
<div class="item-title">
|
|
|
<div class="title">添加了的模型</div>
|
|
|
- <div class="icon">展开 <icon-down /></div>
|
|
|
+ <div class="icon" @click="changeStatusAdd">
|
|
|
+ <template v-if="added_show_status"> 收起 <icon-up /> </template>
|
|
|
+ <template v-if="!added_show_status"> 展开 <icon-down /> </template>
|
|
|
+ </div>
|
|
|
</div>
|
|
|
- <ModelList v-for="item in 3"></ModelList>
|
|
|
+ <transition name="expand-collapse" @before-enter="beforeEnter" @enter="enter" @leave="leave">
|
|
|
+ <div v-if="added_show_status">
|
|
|
+ <ModelList v-for="item in added_data" :key="item.id" :model_item="item" @showMore="showMoreModel"></ModelList>
|
|
|
+ </div>
|
|
|
+ </transition>
|
|
|
</div>
|
|
|
<div class="body-item">
|
|
|
<div class="item-title">
|
|
|
<div class="title">待添加的模型</div>
|
|
|
- <div class="icon">展开 <icon-down /></div>
|
|
|
+ <div class="icon" @click="changeStatusUnAdd">
|
|
|
+ <template v-if="unadd_show_status"> 收起 <icon-up /> </template>
|
|
|
+ <template v-if="!unadd_show_status"> 展开 <icon-down /> </template>
|
|
|
+ </div>
|
|
|
</div>
|
|
|
+ <transition name="expand-collapse" @before-enter="beforeEnter" @enter="enter" @leave="leave">
|
|
|
+ <div v-if="unadd_show_status" class="card-list">
|
|
|
+ <CardItem v-for="item in un_added_data" :key="item.id" :name="item.name" :img_src="item.img_src">
|
|
|
+ <template #labels>
|
|
|
+ {{ item.keyword }}
|
|
|
+ </template>
|
|
|
+ <template #description>
|
|
|
+ {{ item.desc }}
|
|
|
+ </template>
|
|
|
+ <template #bottom>
|
|
|
+ <a-button>
|
|
|
+ <template #icon> <icon-plus /> </template>添加模型</a-button
|
|
|
+ ></template
|
|
|
+ >
|
|
|
+ </CardItem>
|
|
|
+ </div>
|
|
|
+ </transition>
|
|
|
</div>
|
|
|
</div>
|
|
|
</template>
|
|
|
|
|
|
<script setup>
|
|
|
+import { ref } from 'vue';
|
|
|
import ModelList from './ModelList.vue';
|
|
|
+import CardItem from '../../views/manage-common/CardItem.vue';
|
|
|
+import intelligentFrame1 from '../../assets/image/management/intelligent-frame1.png';
|
|
|
+import intelligentFrame2 from '../../assets/image/management/intelligent-frame2.png';
|
|
|
+import intelligentFrame3 from '../../assets/image/management/intelligent-frame3.png';
|
|
|
+import intelligentFrame4 from '../../assets/image/management/intelligent-frame4.png';
|
|
|
+import intelligentFrame5 from '../../assets/image/management/intelligent-frame5.png';
|
|
|
+import intelligentFrame6 from '../../assets/image/management/intelligent-frame6.png';
|
|
|
+import intelligentFrame7 from '../../assets/image/management/intelligent-frame7.png';
|
|
|
+import intelligentFrame8 from '../../assets/image/management/intelligent-frame8.png';
|
|
|
+import { useCollapse } from './use-collapse';
|
|
|
+
|
|
|
+const { beforeEnter, enter, leave } = useCollapse(1000);
|
|
|
+
|
|
|
+const added_data = ref([
|
|
|
+ {
|
|
|
+ id: '1',
|
|
|
+ name: 'OpenAl-APl-Compatible',
|
|
|
+ desc: 'LLM,TEXT EMBEDDING,SPEECH2TEXT,MODERATION',
|
|
|
+ img_src: intelligentFrame1,
|
|
|
+ show_more: false,
|
|
|
+ models: [
|
|
|
+ {
|
|
|
+ id: '1-1',
|
|
|
+ name: 'deepseek-chat2'
|
|
|
+ },
|
|
|
+ {
|
|
|
+ id: '1-2',
|
|
|
+ name: 'deepseek-coder'
|
|
|
+ },
|
|
|
+ {
|
|
|
+ id: '1-3',
|
|
|
+ name: 'deepseek-coder'
|
|
|
+ }
|
|
|
+ ]
|
|
|
+ },
|
|
|
+ {
|
|
|
+ id: '2',
|
|
|
+ name: 'OpenAl-APl-Compatible',
|
|
|
+ desc: 'LLM,TEXT EMBEDDING,SPEECH2TEXT,MODERATION',
|
|
|
+ img_src: intelligentFrame7,
|
|
|
+ show_more: false,
|
|
|
+ models: [
|
|
|
+ {
|
|
|
+ id: '1-1',
|
|
|
+ name: 'deepseek-chat2'
|
|
|
+ },
|
|
|
+ {
|
|
|
+ id: '1-2',
|
|
|
+ name: 'deepseek-coder'
|
|
|
+ },
|
|
|
+ {
|
|
|
+ id: '1-3',
|
|
|
+ name: 'deepseek-coder'
|
|
|
+ }
|
|
|
+ ]
|
|
|
+ }
|
|
|
+]);
|
|
|
+const un_added_data = ref([
|
|
|
+ {
|
|
|
+ id: '1',
|
|
|
+ name: 'BaiduYiyan',
|
|
|
+ keyword: 'LLM,TEXT',
|
|
|
+ desc: 'EMBEDDING,SPEECH2TEXT,MODERATION',
|
|
|
+ img_src: intelligentFrame1
|
|
|
+ },
|
|
|
+ {
|
|
|
+ id: '2',
|
|
|
+ name: 'BaiduYiyan',
|
|
|
+ keyword: 'LLM,TEXT',
|
|
|
+ desc: 'EMBEDDING,SPEECH2TEXT,MODERATION',
|
|
|
+ img_src: intelligentFrame2
|
|
|
+ },
|
|
|
+ {
|
|
|
+ id: '3',
|
|
|
+ name: 'BaiduYiyan',
|
|
|
+ keyword: 'LLM,TEXT',
|
|
|
+ desc: 'EMBEDDING,SPEECH2TEXT,MODERATION',
|
|
|
+ img_src: intelligentFrame3
|
|
|
+ },
|
|
|
+ {
|
|
|
+ id: '4',
|
|
|
+ name: 'BaiduYiyan',
|
|
|
+ keyword: 'LLM,TEXT',
|
|
|
+ desc: 'EMBEDDING,SPEECH2TEXT,MODERATION',
|
|
|
+ img_src: intelligentFrame4
|
|
|
+ },
|
|
|
+ {
|
|
|
+ id: '5',
|
|
|
+ name: 'BaiduYiyan',
|
|
|
+ keyword: 'LLM,TEXT',
|
|
|
+ desc: 'EMBEDDING,SPEECH2TEXT,MODERATION',
|
|
|
+ img_src: intelligentFrame5
|
|
|
+ },
|
|
|
+ {
|
|
|
+ id: '6',
|
|
|
+ name: 'BaiduYiyan',
|
|
|
+ keyword: 'LLM,TEXT',
|
|
|
+ desc: 'EMBEDDING,SPEECH2TEXT,MODERATION',
|
|
|
+ img_src: intelligentFrame6
|
|
|
+ },
|
|
|
+ {
|
|
|
+ id: '7',
|
|
|
+ name: 'BaiduYiyan',
|
|
|
+ keyword: 'LLM,TEXT',
|
|
|
+ desc: 'EMBEDDING,SPEECH2TEXT,MODERATION',
|
|
|
+ img_src: intelligentFrame7
|
|
|
+ },
|
|
|
+ {
|
|
|
+ id: '8',
|
|
|
+ name: 'BaiduYiyan',
|
|
|
+ keyword: 'LLM,TEXT',
|
|
|
+ desc: 'EMBEDDING,SPEECH2TEXT,MODERATION',
|
|
|
+ img_src: intelligentFrame8
|
|
|
+ }
|
|
|
+]);
|
|
|
+// 展开收起状态
|
|
|
+const added_show_status = ref(true);
|
|
|
+const unadd_show_status = ref(true);
|
|
|
+
|
|
|
+const changeStatusAdd = () => {
|
|
|
+ added_show_status.value = !added_show_status.value;
|
|
|
+ if (!added_show_status.value) {
|
|
|
+ added_data.value.forEach((item) => {
|
|
|
+ item.show_more = false;
|
|
|
+ });
|
|
|
+ }
|
|
|
+};
|
|
|
+const changeStatusUnAdd = () => {
|
|
|
+ unadd_show_status.value = !unadd_show_status.value;
|
|
|
+};
|
|
|
+
|
|
|
+const showMoreModel = (item) => {
|
|
|
+ const index = added_data.value.findIndex((u) => u.id === item.id);
|
|
|
+ if (index !== -1) {
|
|
|
+ added_data.value[index].show_more = !added_data.value[index].show_more;
|
|
|
+ }
|
|
|
+};
|
|
|
</script>
|
|
|
<style scoped lang="css">
|
|
|
.model-body {
|
|
|
height: calc(100% - 80px);
|
|
|
+ overflow-y: auto;
|
|
|
+}
|
|
|
+.model-body::-webkit-scrollbar {
|
|
|
+ display: none;
|
|
|
}
|
|
|
.body-item {
|
|
|
margin-bottom: 50px;
|
|
|
@@ -31,10 +200,18 @@ import ModelList from './ModelList.vue';
|
|
|
display: flex;
|
|
|
flex-direction: row;
|
|
|
justify-content: space-between;
|
|
|
+ margin-bottom: 20px;
|
|
|
cursor: pointer;
|
|
|
}
|
|
|
.title {
|
|
|
font-size: 16px;
|
|
|
font-weight: bold;
|
|
|
}
|
|
|
+.card-list {
|
|
|
+ display: flex;
|
|
|
+ flex-direction: row;
|
|
|
+ flex-wrap: wrap;
|
|
|
+ gap: 20px;
|
|
|
+ transition: all 0.3s ease;
|
|
|
+}
|
|
|
</style>
|