Explorar o código

update: 修复检索表单短信下拉菜单undefined问题

puhui999 %!s(int64=2) %!d(string=hai) anos
pai
achega
bf2b4ced8c
Modificáronse 1 ficheiros con 5 adicións e 5 borrados
  1. 5 5
      src/views/system/sms/smsTemplate/index.vue

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

@@ -51,10 +51,7 @@
             :key="channel.id"
             :value="channel.id"
             :label="
-              channel.signature +
-              '【' +
-              getDictObj(DICT_TYPE.SYSTEM_SMS_CHANNEL_CODE, channel.code) +
-              '】'
+              channel.signature + optionLabel(DICT_TYPE.SYSTEM_SMS_CHANNEL_CODE, channel.code)
             "
           />
         </el-select>
@@ -205,7 +202,7 @@
   <SmsTemplateFrom ref="modalRef" :channelOptions="channelOptions" @success="getList" />
 </template>
 <script setup lang="ts" name="SmsTemplate">
-import { DICT_TYPE, getDictOptions, getDictObj } from '@/utils/dict'
+import { DICT_TYPE, getDictOptions, getDictLabel } from '@/utils/dict'
 import { dateFormatter } from '@/utils/formatTime'
 import * as templateApi from '@/api/system/sms/smsTemplate'
 import * as SmsChannelApi from '@/api/system/sms/smsChannel'
@@ -282,6 +279,9 @@ onMounted(() => {
     channelOptions.value = res
   })
 })
+const optionLabel = computed(
+  () => (type: string, code: string) => `【${getDictLabel(type, code)}】`
+)
 /** 格式化短信渠道 */
 const formatChannelSignature = (channelId: number) => {
   channelOptions.value.forEach((item) => {