Browse Source

🐛 修复 sms 在 IDEA 报错的问题

YunaiV 1 year ago
parent
commit
3407cc66a9

+ 1 - 1
src/api/system/sms/smsChannel/index.ts

@@ -19,7 +19,7 @@ export const getSmsChannelPage = (params: PageParam) => {
 
 // 获得短信渠道精简列表
 export function getSimpleSmsChannelList() {
-  return request.get({ url: '/system/sms-channel/list-all-simple' })
+  return request.get({ url: '/system/sms-channel/simple-list' })
 }
 
 // 查询短信渠道详情

+ 3 - 3
src/api/system/sms/smsTemplate/index.ts

@@ -1,15 +1,15 @@
 import request from '@/config/axios'
 
 export interface SmsTemplateVO {
-  id: number | null
-  type: number | null
+  id?: number
+  type?: number
   status: number
   code: string
   name: string
   content: string
   remark: string
   apiTemplateId: string
-  channelId: number | null
+  channelId?: number
   channelCode?: string
   params?: string[]
   createTime?: Date

+ 2 - 2
src/views/system/sms/channel/SmsChannelForm.vue

@@ -14,7 +14,7 @@
         <el-select v-model="formData.code" clearable placeholder="请选择渠道编码">
           <el-option
             v-for="dict in getStrDictOptions(DICT_TYPE.SYSTEM_SMS_CHANNEL_CODE)"
-            :key="dict.value"
+            :key="dict.value as number"
             :label="dict.label"
             :value="dict.value"
           />
@@ -24,7 +24,7 @@
         <el-radio-group v-model="formData.status">
           <el-radio
             v-for="dict in getIntDictOptions(DICT_TYPE.COMMON_STATUS)"
-            :key="dict.value"
+            :key="dict.value as number"
             :label="dict.value"
           >
             {{ dict.label }}

+ 1 - 1
src/views/system/sms/channel/index.vue

@@ -21,7 +21,7 @@
         <el-select v-model="queryParams.status" placeholder="请选择启用状态" clearable>
           <el-option
             v-for="dict in getIntDictOptions(DICT_TYPE.COMMON_STATUS)"
-            :key="dict.value"
+            :key="dict.value as number"
             :label="dict.label"
             :value="dict.value"
           />

+ 8 - 8
src/views/system/sms/template/SmsTemplateForm.vue

@@ -24,7 +24,7 @@
         <el-select v-model="formData.type" placeholder="请选择短信类型">
           <el-option
             v-for="dict in getIntDictOptions(DICT_TYPE.SYSTEM_SMS_TEMPLATE_TYPE)"
-            :key="dict.value"
+            :key="dict.value as number"
             :label="dict.label"
             :value="dict.value"
           />
@@ -43,7 +43,7 @@
         <el-radio-group v-model="formData.status">
           <el-radio
             v-for="dict in getIntDictOptions(DICT_TYPE.COMMON_STATUS)"
-            :key="dict.value"
+            :key="dict.value as number"
             :label="parseInt(dict.value as string)"
           >
             {{ dict.label }}
@@ -79,15 +79,15 @@ const dialogTitle = ref('') // 弹窗的标题
 const formLoading = ref(false) // 表单的加载中:1)修改时的数据加载;2)提交的按钮禁用
 const formType = ref('') // 表单的类型
 const formData = ref<SmsTemplateApi.SmsTemplateVO>({
-  id: null,
-  type: null,
+  id: undefined,
+  type: undefined,
   status: CommonStatusEnum.ENABLE,
   code: '',
   name: '',
   content: '',
   remark: '',
   apiTemplateId: '',
-  channelId: null
+  channelId: undefined
 })
 const formRules = reactive({
   type: [{ required: true, message: '短信类型不能为空', trigger: 'change' }],
@@ -148,15 +148,15 @@ const submitForm = async () => {
 /** 重置表单 */
 const resetForm = () => {
   formData.value = {
-    id: null,
-    type: null,
+    id: undefined,
+    type: undefined,
     status: CommonStatusEnum.ENABLE,
     code: '',
     name: '',
     content: '',
     remark: '',
     apiTemplateId: '',
-    channelId: null
+    channelId: undefined
   }
   formRef.value?.resetFields()
 }

+ 5 - 5
src/views/system/sms/template/index.vue

@@ -19,7 +19,7 @@
         >
           <el-option
             v-for="dict in getIntDictOptions(DICT_TYPE.SYSTEM_SMS_TEMPLATE_TYPE)"
-            :key="dict.value"
+            :key="dict.value as number"
             :label="dict.label"
             :value="dict.value"
           />
@@ -34,7 +34,7 @@
         >
           <el-option
             v-for="dict in getIntDictOptions(DICT_TYPE.COMMON_STATUS)"
-            :key="dict.value"
+            :key="dict.value as number"
             :label="dict.label"
             :value="dict.value"
           />
@@ -232,12 +232,12 @@ const queryFormRef = ref() // 搜索的表单
 const queryParams = reactive({
   pageNo: 1,
   pageSize: 10,
-  type: null,
-  status: null,
+  type: undefined,
+  status: undefined,
   code: '',
   content: '',
   apiTemplateId: '',
-  channelId: null,
+  channelId: undefined,
   createTime: []
 })
 const exportLoading = ref(false) // 导出的加载中