Prechádzať zdrojové kódy

feat:【infra】代码生成:优化 admin uniapp 模版,增加 const formRef = ref<FormInstance>() 的类型

YunaiV 4 mesiacov pred
rodič
commit
17d014421a

+ 2 - 1
src/pages-bpm/category/form/index.vue

@@ -74,6 +74,7 @@
 </template>
 
 <script lang="ts" setup>
+import type { FormInstance } from 'wot-design-uni/components/wd-form/types'
 import type { Category } from '@/api/bpm/category'
 import { computed, onMounted, ref } from 'vue'
 import { useToast } from 'wot-design-uni'
@@ -109,7 +110,7 @@ const formRules = {
   code: [{ required: true, message: '分类标志不能为空' }],
   status: [{ required: true, message: '分类状态不能为空' }],
 }
-const formRef = ref()
+const formRef = ref<FormInstance>()
 
 /** 返回上一页 */
 function handleBack() {

+ 2 - 1
src/pages-bpm/process-expression/form/index.vue

@@ -57,6 +57,7 @@
 </template>
 
 <script lang="ts" setup>
+import type { FormInstance } from 'wot-design-uni/components/wd-form/types'
 import type { ProcessExpression } from '@/api/bpm/process-expression'
 import { computed, onMounted, ref } from 'vue'
 import { useToast } from 'wot-design-uni'
@@ -90,7 +91,7 @@ const formRules = {
   status: [{ required: true, message: '表达式状态不能为空' }],
   expression: [{ required: true, message: '表达式不能为空' }],
 }
-const formRef = ref()
+const formRef = ref<FormInstance>()
 
 /** 返回上一页 */
 function handleBack() {

+ 2 - 1
src/pages-bpm/process-listener/form/index.vue

@@ -90,6 +90,7 @@
 </template>
 
 <script lang="ts" setup>
+import type { FormInstance } from 'wot-design-uni/components/wd-form/types'
 import type { ProcessListener } from '@/api/bpm/process-listener'
 import { computed, onMounted, ref } from 'vue'
 import { useToast } from 'wot-design-uni'
@@ -145,7 +146,7 @@ const formRules = {
   valueType: [{ required: true, message: '值类型不能为空' }],
   value: [{ required: true, message: '值不能为空' }],
 }
-const formRef = ref()
+const formRef = ref<FormInstance>()
 
 /** 根据类型获取事件选项 */
 const eventOptions = computed(() => {

+ 2 - 1
src/pages-bpm/user-group/form/index.vue

@@ -64,6 +64,7 @@
 </template>
 
 <script lang="ts" setup>
+import type { FormInstance } from 'wot-design-uni/components/wd-form/types'
 import type { UserGroup } from '@/api/bpm/user-group'
 import { computed, onMounted, ref } from 'vue'
 import { useToast } from 'wot-design-uni'
@@ -100,7 +101,7 @@ const formRules = {
   userIds: [{ required: true, message: '成员不能为空' }],
   status: [{ required: true, message: '状态不能为空' }],
 }
-const formRef = ref()
+const formRef = ref<FormInstance>()
 const userPickerRef = ref()
 
 /** 返回上一页 */

+ 2 - 1
src/pages-core/user/feedback/index.vue

@@ -52,6 +52,7 @@
 </template>
 
 <script lang="ts" setup>
+import type { FormInstance } from 'wot-design-uni/components/wd-form/types'
 import type { UploadFile, UploadMethod } from 'wot-design-uni/components/wd-upload/types'
 import { ref } from 'vue'
 import { useToast } from 'wot-design-uni'
@@ -80,7 +81,7 @@ const formRules = {
     },
   ],
 }
-const formRef = ref()
+const formRef = ref<FormInstance>()
 
 /** 返回上一页 */
 function handleBack() {

+ 2 - 1
src/pages-infra/config/form/index.vue

@@ -80,6 +80,7 @@
 </template>
 
 <script lang="ts" setup>
+import type { FormInstance } from 'wot-design-uni/components/wd-form/types'
 import type { Config } from '@/api/infra/config'
 import { computed, onMounted, ref } from 'vue'
 import { useToast } from 'wot-design-uni'
@@ -117,7 +118,7 @@ const formRules = {
   value: [{ required: true, message: '参数键值不能为空' }],
   visible: [{ required: true, message: '是否可见不能为空' }],
 }
-const formRef = ref()
+const formRef = ref<FormInstance>()
 
 /** 返回上一页 */
 function handleBack() {

+ 2 - 1
src/pages-infra/data-source-config/form/index.vue

@@ -63,6 +63,7 @@
 </template>
 
 <script lang="ts" setup>
+import type { FormInstance } from 'wot-design-uni/components/wd-form/types'
 import type { DataSourceConfig } from '@/api/infra/data-source-config'
 import { computed, onMounted, ref } from 'vue'
 import { useToast } from 'wot-design-uni'
@@ -96,7 +97,7 @@ const formRules = {
   username: [{ required: true, message: '用户名不能为空' }],
   password: [{ required: true, message: '密码不能为空' }],
 }
-const formRef = ref()
+const formRef = ref<FormInstance>()
 
 /** 返回上一页 */
 function handleBack() {

+ 2 - 1
src/pages-infra/file/config/form/index.vue

@@ -191,6 +191,7 @@
 </template>
 
 <script lang="ts" setup>
+import type { FormInstance } from 'wot-design-uni/components/wd-form/types'
 import type { FileConfig } from '@/api/infra/file/config'
 import { computed, onMounted, ref } from 'vue'
 import { useToast } from 'wot-design-uni'
@@ -239,7 +240,7 @@ const formRules = {
   name: [{ required: true, message: '配置名不能为空' }],
   storage: [{ required: true, message: '存储器不能为空' }],
 }
-const formRef = ref()
+const formRef = ref<FormInstance>()
 
 /** 返回上一页 */
 function handleBack() {

+ 2 - 1
src/pages-infra/job/job/form/index.vue

@@ -89,6 +89,7 @@
 </template>
 
 <script lang="ts" setup>
+import type { FormInstance } from 'wot-design-uni/components/wd-form/types'
 import type { Job } from '@/api/infra/job'
 import { computed, onMounted, ref } from 'vue'
 import { useToast } from 'wot-design-uni'
@@ -128,7 +129,7 @@ const formRules = {
   retryCount: [{ required: true, message: '重试次数不能为空' }],
   retryInterval: [{ required: true, message: '重试间隔不能为空' }],
 }
-const formRef = ref()
+const formRef = ref<FormInstance>()
 
 /** 返回上一页 */
 function handleBack() {

+ 2 - 1
src/pages-system/dept/form/index.vue

@@ -76,6 +76,7 @@
 </template>
 
 <script lang="ts" setup>
+import type { FormInstance } from 'wot-design-uni/components/wd-form/types'
 import type { Dept } from '@/api/system/dept'
 import { computed, onMounted, ref } from 'vue'
 import { useToast } from 'wot-design-uni'
@@ -116,7 +117,7 @@ const formRules = {
   sort: [{ required: true, message: '显示顺序不能为空' }],
   status: [{ required: true, message: '状态不能为空' }],
 }
-const formRef = ref()
+const formRef = ref<FormInstance>()
 
 /** 返回上一页 */
 function handleBack() {

+ 2 - 1
src/pages-system/dict/data/form/index.vue

@@ -101,6 +101,7 @@
 </template>
 
 <script lang="ts" setup>
+import type { FormInstance } from 'wot-design-uni/components/wd-form/types'
 import type { DictData } from '@/api/system/dict/data'
 import { computed, onMounted, ref } from 'vue'
 import { useToast } from 'wot-design-uni'
@@ -143,7 +144,7 @@ const formRules = {
   sort: [{ required: true, message: '显示排序不能为空' }],
   status: [{ required: true, message: '状态不能为空' }],
 }
-const formRef = ref()
+const formRef = ref<FormInstance>()
 
 /** 字典类型选项 */
 const dictTypeOptions = ref<{ label: string, value: string }[]>([])

+ 2 - 1
src/pages-system/dict/type/form/index.vue

@@ -66,6 +66,7 @@
 </template>
 
 <script lang="ts" setup>
+import type { FormInstance } from 'wot-design-uni/components/wd-form/types'
 import type { DictType } from '@/api/system/dict/type'
 import { computed, onMounted, ref } from 'vue'
 import { useToast } from 'wot-design-uni'
@@ -100,7 +101,7 @@ const formRules = {
   type: [{ required: true, message: '字典类型不能为空' }],
   status: [{ required: true, message: '状态不能为空' }],
 }
-const formRef = ref()
+const formRef = ref<FormInstance>()
 
 /** 返回上一页 */
 function handleBack() {

+ 2 - 1
src/pages-system/mail/account/form/index.vue

@@ -89,6 +89,7 @@
 </template>
 
 <script lang="ts" setup>
+import type { FormInstance } from 'wot-design-uni/components/wd-form/types'
 import type { MailAccount } from '@/api/system/mail/account'
 import { computed, onMounted, ref } from 'vue'
 import { useToast } from 'wot-design-uni'
@@ -130,7 +131,7 @@ const formRules = {
   sslEnable: [{ required: true, message: '是否开启 SSL 不能为空' }],
   starttlsEnable: [{ required: true, message: '是否开启 STARTTLS 不能为空' }],
 }
-const formRef = ref()
+const formRef = ref<FormInstance>()
 
 /** 返回上一页 */
 function handleBack() {

+ 2 - 1
src/pages-system/mail/template/form/index.vue

@@ -97,6 +97,7 @@
 </template>
 
 <script lang="ts" setup>
+import type { FormInstance } from 'wot-design-uni/components/wd-form/types'
 import type { MailAccount } from '@/api/system/mail/account'
 import type { MailTemplate } from '@/api/system/mail/template'
 import { computed, onMounted, ref } from 'vue'
@@ -140,7 +141,7 @@ const formRules = {
   content: [{ required: true, message: '模板内容不能为空' }],
   status: [{ required: true, message: '开启状态不能为空' }],
 }
-const formRef = ref()
+const formRef = ref<FormInstance>()
 
 /** 邮箱账号列表 */
 const accountList = ref<MailAccount[]>([])

+ 2 - 1
src/pages-system/menu/form/index.vue

@@ -121,6 +121,7 @@
 </template>
 
 <script lang="ts" setup>
+import type { FormInstance } from 'wot-design-uni/components/wd-form/types'
 import type { Menu } from '@/api/system/menu'
 import { computed, onMounted, ref } from 'vue'
 import { useToast } from 'wot-design-uni'
@@ -167,7 +168,7 @@ const formRules = {
   sort: [{ required: true, message: '显示排序不能为空' }],
   status: [{ required: true, message: '状态不能为空' }],
 }
-const formRef = ref()
+const formRef = ref<FormInstance>()
 
 /** 返回上一页 */
 function handleBack() {

+ 2 - 1
src/pages-system/notice/form/index.vue

@@ -68,6 +68,7 @@
 </template>
 
 <script lang="ts" setup>
+import type { FormInstance } from 'wot-design-uni/components/wd-form/types'
 import type { Notice } from '@/api/system/notice'
 import { computed, onMounted, ref } from 'vue'
 import { useToast } from 'wot-design-uni'
@@ -103,7 +104,7 @@ const formRules = {
   type: [{ required: true, message: '公告类型不能为空' }],
   status: [{ required: true, message: '公告状态不能为空' }],
 }
-const formRef = ref()
+const formRef = ref<FormInstance>()
 
 /** 返回上一页 */
 function handleBack() {

+ 2 - 1
src/pages-system/notify/template/form/index.vue

@@ -89,6 +89,7 @@
 </template>
 
 <script lang="ts" setup>
+import type { FormInstance } from 'wot-design-uni/components/wd-form/types'
 import type { NotifyTemplate } from '@/api/system/notify/template'
 import { computed, onMounted, ref } from 'vue'
 import { useToast } from 'wot-design-uni'
@@ -129,7 +130,7 @@ const formRules = {
   status: [{ required: true, message: '状态不能为空' }],
   content: [{ required: true, message: '模板内容不能为空' }],
 }
-const formRef = ref()
+const formRef = ref<FormInstance>()
 
 /** 模板类型选项 */
 const templateTypeOptions = computed(() => {

+ 2 - 1
src/pages-system/oauth2/client/form/index.vue

@@ -91,6 +91,7 @@
 </template>
 
 <script lang="ts" setup>
+import type { FormInstance } from 'wot-design-uni/components/wd-form/types'
 import type { OAuth2Client } from '@/api/system/oauth2/client'
 import { computed, onMounted, ref } from 'vue'
 import { useToast } from 'wot-design-uni'
@@ -138,7 +139,7 @@ const formRules = {
   accessTokenValiditySeconds: [{ required: true, message: '访问令牌有效期不能为空' }],
   refreshTokenValiditySeconds: [{ required: true, message: '刷新令牌有效期不能为空' }],
 }
-const formRef = ref()
+const formRef = ref<FormInstance>()
 
 /** 返回上一页 */
 function handleBack() {

+ 2 - 1
src/pages-system/post/form/index.vue

@@ -68,6 +68,7 @@
 </template>
 
 <script lang="ts" setup>
+import type { FormInstance } from 'wot-design-uni/components/wd-form/types'
 import type { Post } from '@/api/system/post'
 import { computed, onMounted, ref } from 'vue'
 import { useToast } from 'wot-design-uni'
@@ -103,7 +104,7 @@ const formRules = {
   sort: [{ required: true, message: '显示顺序不能为空' }],
   status: [{ required: true, message: '状态不能为空' }],
 }
-const formRef = ref()
+const formRef = ref<FormInstance>()
 
 /** 返回上一页 */
 function handleBack() {

+ 2 - 1
src/pages-system/role/form/index.vue

@@ -68,6 +68,7 @@
 </template>
 
 <script lang="ts" setup>
+import type { FormInstance } from 'wot-design-uni/components/wd-form/types'
 import type { Role } from '@/api/system/role'
 import { computed, onMounted, ref } from 'vue'
 import { useToast } from 'wot-design-uni'
@@ -103,7 +104,7 @@ const formRules = {
   sort: [{ required: true, message: '显示顺序不能为空' }],
   status: [{ required: true, message: '状态不能为空' }],
 }
-const formRef = ref()
+const formRef = ref<FormInstance>()
 
 /** 返回上一页 */
 function handleBack() {

+ 2 - 1
src/pages-system/sms/channel/form/index.vue

@@ -90,6 +90,7 @@
 </template>
 
 <script lang="ts" setup>
+import type { FormInstance } from 'wot-design-uni/components/wd-form/types'
 import type { SmsChannel } from '@/api/system/sms/channel'
 import { computed, onMounted, ref } from 'vue'
 import { useToast } from 'wot-design-uni'
@@ -128,7 +129,7 @@ const formRules = {
   status: [{ required: true, message: '启用状态不能为空' }],
   apiKey: [{ required: true, message: 'API 账号不能为空' }],
 }
-const formRef = ref()
+const formRef = ref<FormInstance>()
 
 /** 返回上一页 */
 function handleBack() {

+ 2 - 1
src/pages-system/sms/template/form/index.vue

@@ -96,6 +96,7 @@
 </template>
 
 <script lang="ts" setup>
+import type { FormInstance } from 'wot-design-uni/components/wd-form/types'
 import type { SmsChannel } from '@/api/system/sms/channel'
 import type { SmsTemplate } from '@/api/system/sms/template'
 import { computed, onMounted, ref } from 'vue'
@@ -140,7 +141,7 @@ const formRules = {
   content: [{ required: true, message: '模板内容不能为空' }],
   apiTemplateId: [{ required: true, message: 'API 模板编号不能为空' }],
 }
-const formRef = ref()
+const formRef = ref<FormInstance>()
 
 /** 短信渠道列表 */
 const channelList = ref<SmsChannel[]>([])

+ 2 - 1
src/pages-system/social/client/form/index.vue

@@ -103,6 +103,7 @@
 </template>
 
 <script lang="ts" setup>
+import type { FormInstance } from 'wot-design-uni/components/wd-form/types'
 import type { SocialClient } from '@/api/system/social/client'
 import { computed, onMounted, ref } from 'vue'
 import { useToast } from 'wot-design-uni'
@@ -143,7 +144,7 @@ const formRules = {
   clientId: [{ required: true, message: '应用编号不能为空' }],
   clientSecret: [{ required: true, message: '应用密钥不能为空' }],
 }
-const formRef = ref()
+const formRef = ref<FormInstance>()
 
 /** 返回上一页 */
 function handleBack() {

+ 2 - 1
src/pages-system/tenant/package/form/index.vue

@@ -57,6 +57,7 @@
 </template>
 
 <script lang="ts" setup>
+import type { FormInstance } from 'wot-design-uni/components/wd-form/types'
 import type { TenantPackage } from '@/api/system/tenant/package'
 import { computed, onMounted, ref } from 'vue'
 import { useToast } from 'wot-design-uni'
@@ -90,7 +91,7 @@ const formRules = {
   name: [{ required: true, message: '套餐名称不能为空' }],
   status: [{ required: true, message: '状态不能为空' }],
 }
-const formRef = ref()
+const formRef = ref<FormInstance>()
 
 /** 返回上一页 */
 function handleBack() {

+ 2 - 1
src/pages-system/tenant/tenant/form/index.vue

@@ -110,6 +110,7 @@
 </template>
 
 <script lang="ts" setup>
+import type { FormInstance } from 'wot-design-uni/components/wd-form/types'
 import type { Tenant } from '@/api/system/tenant'
 import type { TenantPackage } from '@/api/system/tenant/package'
 import { computed, onMounted, ref } from 'vue'
@@ -157,7 +158,7 @@ const formRules = {
   username: [{ required: true, message: '用户名称不能为空' }],
   password: [{ required: true, message: '用户密码不能为空' }],
 }
-const formRef = ref()
+const formRef = ref<FormInstance>()
 
 /** 返回上一页 */
 function handleBack() {

+ 2 - 1
src/pages-system/user/detail/components/password-form.vue

@@ -35,6 +35,7 @@
 </template>
 
 <script lang="ts" setup>
+import type { FormInstance } from 'wot-design-uni/components/wd-form/types'
 import { computed, ref, watch } from 'vue'
 import { useToast } from 'wot-design-uni'
 import { resetUserPassword } from '@/api/system/user'
@@ -55,7 +56,6 @@ const visible = computed({
   set: val => emit('update:modelValue', val),
 })
 const loading = ref(false)
-const formRef = ref()
 const formData = ref({
   password: '',
   confirmPassword: '',
@@ -71,6 +71,7 @@ const formRules = {
     },
   ],
 }
+const formRef = ref<FormInstance>()
 
 /** 监听弹窗打开,重置表单 */
 watch(

+ 2 - 1
src/pages-system/user/form/index.vue

@@ -100,6 +100,7 @@
 </template>
 
 <script lang="ts" setup>
+import type { FormInstance } from 'wot-design-uni/components/wd-form/types'
 import type { User } from '@/api/system/user'
 import { computed, onMounted, ref } from 'vue'
 import { useToast } from 'wot-design-uni'
@@ -147,7 +148,7 @@ const formRules = {
   sex: [{ required: true, message: '性别不能为空' }],
   status: [{ required: true, message: '状态不能为空' }],
 }
-const formRef = ref()
+const formRef = ref<FormInstance>()
 
 /** 返回上一页 */
 function handleBack() {