| | |
| | | <a-form-item field="name" label="API-Key"> |
| | | <a-input v-model="form.name" placeholder="API-Key" /> |
| | | </a-form-item> |
| | | <!-- <a-form-item |
| | | <!-- <a-form-item field="describe" label="Base-Url"> |
| | | <a-input v-model="form.name" placeholder="Base-Url" /> |
| | | </a-form-item> --> |
| | | <a-form-item |
| | | field="raptor" |
| | | label="是否支持 Vision" |
| | | v-if="form.model_type === 'chat'" |
| | | > |
| | | <a-switch v-model="form.raptor" /> |
| | | </a-form-item> --> |
| | | </a-form-item> |
| | | <a-form-item field="logo" label="模型图片"> |
| | | <a-space direction="vertical" :style="{ width: '100%' }"> |
| | | <a-space |
| | | direction="vertical" |
| | | v-model="form.logo" |
| | | :style="{ width: '100%' }" |
| | | > |
| | | <Upload |
| | | :action="uploadAction" |
| | | :limit="1" |
| | | :url="form.urlS" |
| | | @handleRemove="deleteRemove" |
| | | @update:fileList="updateFileList" |
| | | @success="handleSuccess" |
| | | ></Upload> |
| | |
| | | :action="uploadAction" |
| | | :limit="1" |
| | | :url="form.urlS" |
| | | @handleRemove="deleteRemove" |
| | | @update:fileList="updateFileList" |
| | | @success="handleSuccess" |
| | | ></Upload> |
| | |
| | | message: '请输入api_base', |
| | | }, |
| | | ], |
| | | logo: [ |
| | | { |
| | | required: true, |
| | | message: '模型图片不能为空', |
| | | }, |
| | | ], |
| | | }; |
| | | |
| | | const uploadAction = '/api/v1/llm/upload'; // 替换为你的上传API |
| | |
| | | |
| | | const handleSuccess = (urls) => { |
| | | uploadUrl.value = urls; |
| | | form.logo = urls[0]; |
| | | |
| | | const urlsArr = urls.map((url) => { |
| | | return httpUrl + url; |
| | | }); |
| | | imageUrls.value = urlsArr; // 拿到上传的图片地址 |
| | | }; |
| | | const deleteRemove = () => { |
| | | form.logo = ''; |
| | | uploadUrl.value = []; |
| | | imageUrls.value = []; |
| | | }; |
| | | |
| | | const emit = defineEmits(['refresh-parent']); |
| | | const handleSubmit = ({ values, errors }) => { |
| | | const all_params = form.addFomList.map((item) => { |