zhangxiao
2024-08-12 54a72ae51d8f17379fe515eb66759ec7de0663d0
src/views/dmx/model/components/addPageModel.vue
@@ -137,6 +137,9 @@
  import { Modal, Message } from '@arco-design/web-vue';
  import message from '@arco-design/web-vue/es/message';
  import { resolveUnref } from '@vueuse/core';
  import { userModelState } from '@/store';
  const modelStore = userModelState();
  const addPageModelVisible = defineModel('show');
  const loading = ref(false);
@@ -182,9 +185,9 @@
    multiSelect: ['section one'],
    treeSelect: '',
    raptor: false,
    addFomList: [],
    addFomList: <any[]>[],
  });
  const form_ref = ref(null);
  const form_ref = ref();
  const rules = {
    model_type: [
@@ -221,15 +224,21 @@
  const uploadAction = '/api/v1/llm/upload'; // 替换为你的上传API
  const fileList = ref([]);
  const imageUrls = ref([]);
  const imageUrls = ref<any[]>([]);
  const uploadUrl = ref([]);
  const httpUrl = modelStore.hrefUrl;
  const updateFileList = (newFileList) => {
    fileList.value = newFileList;
    console.log(newFileList, 88);
  };
  const handleSuccess = (urls) => {
    imageUrls.value = urls; // 拿到上传的图片地址
    uploadUrl.value = urls;
    const urlsArr = urls.map((url) => {
      return httpUrl + url;
    });
    imageUrls.value = urlsArr; // 拿到上传的图片地址
  };
  const emit = defineEmits(['refresh-parent']);
  const handleSubmit = ({ values, errors }) => {
@@ -250,7 +259,7 @@
              volc_sk: form.volc_sk,
              api_base: form.api_base,
              all_params: all_params,
              logo: imageUrls.value[0],
              logo: uploadUrl.value[0] || '',
            });
            if ((data as any).code == 200) {
@@ -269,7 +278,7 @@
              volc_sk: form.volc_sk,
              api_base: form.api_base,
              all_params: all_params,
              logo: imageUrls.value[0],
              logo: uploadUrl.value[0] || '',
            });
            if ((data as any).code == 200) {
@@ -361,7 +370,7 @@
      });
    }
    imageUrls.value.push(data.data.logo);
    imageUrls.value.push(httpUrl + data.data.logo);
  };
  watchEffect(() => {