From b45bad33154fb97b76e6c54a86609d446f02ad21 Mon Sep 17 00:00:00 2001
From: dengzedong <dengzedong@email>
Date: 星期四, 10 十月 2024 14:22:44 +0800
Subject: [PATCH] 分页bug修复,打包历史发布功能

---
 src/views/model/mpk/project/ProjectForm.vue |   35 +++++++++++++++++++----------------
 1 files changed, 19 insertions(+), 16 deletions(-)

diff --git a/src/views/model/mpk/project/ProjectForm.vue b/src/views/model/mpk/project/ProjectForm.vue
index 37fee70..d6937f7 100644
--- a/src/views/model/mpk/project/ProjectForm.vue
+++ b/src/views/model/mpk/project/ProjectForm.vue
@@ -1,5 +1,5 @@
 <template>
-  <Dialog v-model="dialogVisible" :title="dialogTitle">
+  <Dialog v-model="dialogVisible" :title="dialogTitle" width="60%">
     <el-form
       ref="formRef"
       v-loading="formLoading"
@@ -8,25 +8,25 @@
       label-width="80px"
     >
       <el-row :gutter="20">
-        <el-col :span="20">
-          <el-form-item label="项目名称" prop="projectName" style="width: 100%">
-            <el-input v-model="formData.projectName" placeholder="" style="width: 100%"/>
+        <el-col :span="10">
+          <el-form-item label="项目名称" prop="projectName">
+            <el-input v-model="formData.projectName" placeholder=""/>
           </el-form-item>
         </el-col>
       </el-row>
       <el-row :gutter="20">
-        <el-col :span="20">
-          <el-form-item label="项目编码" prop="projectCode" style="width: 100%">
-            <el-input v-model="formData.projectCode" placeholder="" style="width: 100%"/>
+        <el-col :span="10">
+          <el-form-item label="项目编码" prop="projectCode">
+            <el-input v-model="formData.projectCode" placeholder=""/>
           </el-form-item>
         </el-col>
       </el-row>
       <el-row :gutter="20">
-        <el-col>
+        <el-col :span="24">
           <el-form-item label="关联模型" prop="models">
-            <el-transfer :props="{key: 'id',label: 'pyName'}" :titles="['未选模型', '已选模型']" target-order="unshift" filterable :filter-method="filterMethod" v-model="formData.models" :data="modelList">
+            <el-transfer style="width: 100%" :props="{key: 'id',label: 'pyName'}" :titles="['未选模型', '已选模型']" target-order="unshift" filterable :filter-method="filterMethod" v-model="formData.models" :data="modelList">
               <template #default="{ option }">
-                <span :title="option.pyName">{{ option.pyName}}</span>
+                <span :title="option.pyName + '【' + option.pyChineseName + '】'">{{ option.pyName}}</span>
               </template>
             </el-transfer>
           </el-form-item>
@@ -40,8 +40,8 @@
   </Dialog>
 </template>
 <script lang="ts" setup>
-  import * as ProjectApi from '@/api/mpk/project'
-  import * as MpkApi from '@/api/mpk/mpk'
+  import * as ProjectApi from '@/api/model/mpk/project'
+  import * as MpkApi from '@/api/model/mpk/mpk'
   import {FormRules} from 'element-plus'
 
 
@@ -56,6 +56,7 @@
     id: undefined,
     projectName: undefined,
     projectCode: undefined,
+    models: undefined,
   })
 
 
@@ -106,9 +107,11 @@
       const data = {
         ...formData.value
       }
-      data.models = data.models.map(e => {
-        return {id: e}
-      })
+      if (data.models && data.models.length > 0) {
+        data.models = data.models.map(e => {
+          return {id: e}
+        })
+      }
       if (formType.value === 'create') {
         await ProjectApi.createProject(data)
         message.success(t('common.createSuccess'))
@@ -148,6 +151,6 @@
 
 <style scoped>
   :deep(.el-transfer-panel) {
-    width: 35%;
+    width: 40%;
   }
 </style>

--
Gitblit v1.9.3