From 291bf570b2106cb99b0e689af7d6ccaacc9e5c1c Mon Sep 17 00:00:00 2001
From: 潘志宝 <979469083@qq.com>
Date: 星期三, 25 十二月 2024 18:10:42 +0800
Subject: [PATCH] Merge branch 'master' of http://dlindusit.com:53929/r/iailab-plat-ui-vue3

---
 src/views/system/app/AppForm.vue |   87 +++++++++++++++++++++++++++----------------
 1 files changed, 54 insertions(+), 33 deletions(-)

diff --git a/src/views/system/app/AppForm.vue b/src/views/system/app/AppForm.vue
index e8598f7..4dd599f 100644
--- a/src/views/system/app/AppForm.vue
+++ b/src/views/system/app/AppForm.vue
@@ -9,6 +9,32 @@
     >
       <el-row>
         <el-col :span="12">
+          <el-form-item label="应用类型">
+            <el-select v-model="formData.type" placeholder="请选择">
+              <el-option
+                v-for="dict in getIntDictOptions(DICT_TYPE.SYSTEM_APP_TYPE)"
+                :key="dict.value"
+                :label="dict.label"
+                :value="dict.value"
+              />
+            </el-select>
+          </el-form-item>
+        </el-col>
+        <el-col :span="12">
+          <el-form-item label="应用分组" prop="groupId">
+            <el-select v-model="formData.groupId" clearable placeholder="请选择分组">
+              <el-option
+                v-for="item in groupList"
+                :key="item.id"
+                :label="item.name"
+                :value="item.id"
+              />
+            </el-select>
+          </el-form-item>
+        </el-col>
+      </el-row>
+      <el-row>
+        <el-col :span="12">
           <el-form-item label="应用编号" prop="appCode">
             <el-input v-model="formData.appCode" placeholder="请输入应用编号" />
           </el-form-item>
@@ -44,33 +70,16 @@
         </el-col>
       </el-row>
       <el-row>
-        <el-col :span="12">
-          <el-form-item label="应用分组" prop="appGroup">
-            <el-input v-model="formData.appGroup" placeholder="请输入应用分组" />
-          </el-form-item>
-        </el-col>
-        <el-col :span="12">
-          <el-form-item label="加载类型" prop="loadType">
-            <el-input v-model="formData.loadType" placeholder="请输入加载类型" />
+        <el-col :span="24">
+          <el-form-item label="应用图标" prop="icon">
+            <UploadImg v-model="formData.icon" :limit="1" />
           </el-form-item>
         </el-col>
       </el-row>
       <el-row>
-        <el-col :span="12">
-          <el-form-item label="应用图标" prop="icon">
-            <el-input v-model="formData.icon" placeholder="请输入应用图标" />
-          </el-form-item>
-        </el-col>
         <el-col :span="12">
           <el-form-item label="排序" prop="orderNum">
-            <el-input v-model="formData.orderNum" placeholder="请输入排序" />
-          </el-form-item>
-        </el-col>
-      </el-row>
-      <el-row>
-        <el-col :span="12">
-          <el-form-item label="开发者" prop="devName">
-            <el-input v-model="formData.devName" placeholder="请输入开发者" />
+            <el-input-number v-model="formData.orderNum" placeholder="请输入排序" />
           </el-form-item>
         </el-col>
         <el-col :span="12">
@@ -105,6 +114,8 @@
   import { DICT_TYPE, getIntDictOptions } from '@/utils/dict'
   import * as AppApi from '@/api/system/app'
   import { CommonStatusEnum } from '@/utils/constants'
+  import * as TenantApi from "@/api/system/tenant";
+  import * as AppGroupApi from "@/api/system/appgroup";
 
   defineOptions({ name: 'SystemAppForm' })
 
@@ -118,18 +129,20 @@
     id: undefined,
     appCode: undefined,
     appName: undefined,
+    type: undefined,
     appDomain: undefined,
     apiDomain: undefined,
     appKey: undefined,
     appSecret: undefined,
-    appGroup: undefined,
+    groupId: undefined,
     loadType: undefined,
     icon: undefined,
     orderNum: undefined,
     status: CommonStatusEnum.ENABLE,
     devId: undefined,
     devName: undefined,
-    remark: undefined
+    remark: undefined,
+    tenantId: undefined
   })
   const formRules = reactive({
     appCode: [{ required: true, message: '应用编号不能为空', trigger: 'blur' }],
@@ -138,7 +151,8 @@
     appSecret: [{ required: true, message: '应用密码不能为空', trigger: 'blur' }]
   })
   const formRef = ref() // 表单 Ref
-
+  const tenantList = ref([] as TenantApi.TenantVO[]) // 租户列表
+  const groupList = ref([] as AppGroupApi.AppGroupVO[]) // 分组列表
   /** 打开弹窗 */
   const open = async (type: string, id?: number) => {
     dialogVisible.value = true
@@ -154,6 +168,8 @@
         formLoading.value = false
       }
     }
+    tenantList.value = await TenantApi.getSimpleTenant()
+    groupList.value = await AppGroupApi.getAppGroupList()
   }
   defineExpose({ open }) // 提供 open 方法,用于打开弹窗
 
@@ -187,16 +203,21 @@
   const resetForm = () => {
     formData.value = {
       id: undefined,
-      name: undefined,
-      packageId: undefined,
-      contactName: undefined,
-      contactMobile: undefined,
-      accountCount: undefined,
-      expireTime: undefined,
-      website: undefined,
+      appCode: undefined,
+      appName: undefined,
+      appDomain: undefined,
+      apiDomain: undefined,
+      appKey: undefined,
+      appSecret: undefined,
+      groupId: undefined,
+      loadType: undefined,
+      icon: undefined,
+      orderNum: undefined,
       status: CommonStatusEnum.ENABLE,
-      username: undefined,
-      password: undefined
+      devId: undefined,
+      devName: undefined,
+      remark: undefined,
+      tenantId: undefined
     }
     formRef.value?.resetFields()
   }

--
Gitblit v1.9.3