Hua vor 2 Monaten
Ursprung
Commit
d576f7e68b
1 geänderte Dateien mit 17 neuen und 5 gelöschten Zeilen
  1. 17 5
      ruoyi-ui/src/views/standardization/modelUsing/index.vue

+ 17 - 5
ruoyi-ui/src/views/standardization/modelUsing/index.vue

@@ -74,6 +74,7 @@
       :title="title"
       v-model="isContentVisible"
       width="30%"
+      @close="clearForm"
   >
     <div>
       <el-form ref="formAddref" :model="formAdd" label-width="100px" class="coz-mg-card" :rules="rulesAdd">
@@ -189,7 +190,10 @@ function goFlow(item) {
   store.commit('setId', item.appId);
   proxy.$router.push({path: '/standardization/modeling'});
 }
-
+function clearForm(){
+  formAdd.value = {}
+  previewUrl.value = ''
+}
 function editModel(item) {
   parModel.value = item
   isAdd.value = false
@@ -197,10 +201,13 @@ function editModel(item) {
   title.value = '修改模型应用'
   getModelingById(item.appId).then(res => {
     if (res.code === 200) {
+      const parUrl = import.meta.env.VITE_APP_BASE_API 
       formAdd.value.appTitle = res.data.appTitle
       formAdd.value.appNote = res.data.appNote
       formAdd.value.appId = res.data.appId
-      previewUrl.value = res.data.appIcon ? res.data.appIcon : imagePath;
+      formAdd.value.appIcon = parUrl + res.data.appIcon
+      previewUrl.value = res.data.appIcon ? parUrl + res.data.appIcon : imagePath;
+      console.log(previewUrl.value)
     } else {
       proxy.$message.error('获取模型详情失败');
     }
@@ -366,9 +373,14 @@ function getList() {
     pageSize: 12,
     pageNum: pageNum.value,
   }
-  getModellist(par).then(response => {
-    modelList.value = response.rows
-    total.value = response.total
+  const parUrl = import.meta.env.VITE_APP_BASE_API 
+  getModellist(par).then(res => {
+    modelList.value = res.rows
+    total.value = res.total
+    modelList.value.forEach(item=>{
+      item.appIcon = parUrl + item.appIcon
+    })
+    console.log(parUrl)
   })
 }