From 74f2c0c7f3de951b6c21d2e423da5c7663df6f31 Mon Sep 17 00:00:00 2001
From: Jay <csj123456>
Date: 星期二, 24 九月 2024 08:37:39 +0800
Subject: [PATCH] 指标定义

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

diff --git a/src/views/system/app/AppForm.vue b/src/views/system/app/AppForm.vue
index e8598f7..362fd2b 100644
--- a/src/views/system/app/AppForm.vue
+++ b/src/views/system/app/AppForm.vue
@@ -7,6 +7,44 @@
       :rules="formRules"
       label-width="80px"
     >
+      <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-row>
+        <el-col :span="12">
+          <el-form-item label="选择租户" prop="tenantId">
+            <el-select v-model="formData.tenantId" clearable placeholder="请选择租户">
+              <el-option
+                v-for="item in tenantList"
+                :key="item.id"
+                :label="item.name"
+                :value="item.id"
+              />
+            </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">
@@ -44,33 +82,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 +126,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 +141,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 +163,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 +180,8 @@
         formLoading.value = false
       }
     }
+    tenantList.value = await TenantApi.getSimpleTenant()
+    groupList.value = await AppGroupApi.getAppGroupList()
   }
   defineExpose({ open }) // 提供 open 方法,用于打开弹窗
 
@@ -187,16 +215,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