4242 </el-form >
4343</template >
4444<script setup lang="ts">
45- import {ref , reactive , onMounted , onUnmounted , computed , watch } from ' vue'
46- import {groupBy } from ' lodash'
45+ import { ref , reactive , onMounted , onUnmounted , computed , watch } from ' vue'
46+ import { groupBy } from ' lodash'
4747import useStore from ' @/stores'
48- import type {knowledgeData } from ' @/api/type/knowledge'
49- import {t } from ' @/locales'
48+ import type { knowledgeData } from ' @/api/type/knowledge'
49+ import { t } from ' @/locales'
5050
51- const props = defineProps ( {
51+ const props = defineProps < {
5252 data: {
53- type: Object ,
54- default : () => {
55- },
56- },
57- })
58- const {model} = useStore ()
53+ type: Object
54+ default: () => {}
55+ }
56+ apiType : ' systemShare ' | ' workspace ' | ' systemManage '
57+ }>( )
58+ const { model } = useStore ()
5959const form = ref <knowledgeData >({
6060 name: ' ' ,
6161 desc: ' ' ,
@@ -92,7 +92,7 @@ const modelOptions = ref<any>([])
9292
9393watch (
9494 () => props .data ,
95- (value ) => {
95+ (value : any ) => {
9696 if (value && JSON .stringify (value ) !== ' {}' ) {
9797 form .value .name = value .name
9898 form .value .desc = value .desc
@@ -117,7 +117,7 @@ function validate() {
117117function getModel() {
118118 loading .value = true
119119 model
120- .asyncGetModel ({model_type: ' EMBEDDING' } )
120+ .asyncGetModel ({ model_type: ' EMBEDDING' }, props . apiType )
121121 .then ((res : any ) => {
122122 modelOptions .value = groupBy (res ?.data , ' provider' )
123123 loading .value = false
0 commit comments