Skip to content

Commit bf2b4ce

Browse files
author
puhui999
committed
update: 修复检索表单短信下拉菜单undefined问题
1 parent 16c4bb5 commit bf2b4ce

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

src/views/system/sms/smsTemplate/index.vue

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -51,10 +51,7 @@
5151
:key="channel.id"
5252
:value="channel.id"
5353
:label="
54-
channel.signature +
55-
'【' +
56-
getDictObj(DICT_TYPE.SYSTEM_SMS_CHANNEL_CODE, channel.code) +
57-
'】'
54+
channel.signature + optionLabel(DICT_TYPE.SYSTEM_SMS_CHANNEL_CODE, channel.code)
5855
"
5956
/>
6057
</el-select>
@@ -205,7 +202,7 @@
205202
<SmsTemplateFrom ref="modalRef" :channelOptions="channelOptions" @success="getList" />
206203
</template>
207204
<script setup lang="ts" name="SmsTemplate">
208-
import { DICT_TYPE, getDictOptions, getDictObj } from '@/utils/dict'
205+
import { DICT_TYPE, getDictOptions, getDictLabel } from '@/utils/dict'
209206
import { dateFormatter } from '@/utils/formatTime'
210207
import * as templateApi from '@/api/system/sms/smsTemplate'
211208
import * as SmsChannelApi from '@/api/system/sms/smsChannel'
@@ -282,6 +279,9 @@ onMounted(() => {
282279
channelOptions.value = res
283280
})
284281
})
282+
const optionLabel = computed(
283+
() => (type: string, code: string) => `【${getDictLabel(type, code)}】`
284+
)
285285
/** 格式化短信渠道 */
286286
const formatChannelSignature = (channelId: number) => {
287287
channelOptions.value.forEach((item) => {

0 commit comments

Comments
 (0)