refactor: vue3.3 defineOptions

This commit is contained in:
xingyu
2023-06-21 19:14:34 +08:00
parent a5c7c886ee
commit 922f83d99c
259 changed files with 955 additions and 381 deletions

View File

@ -50,11 +50,13 @@
</template>
</Dialog>
</template>
<script lang="ts" name="SystemSmsChannelForm" setup>
<script lang="ts" setup>
import { DICT_TYPE, getIntDictOptions, getStrDictOptions } from '@/utils/dict'
import * as SmsChannelApi from '@/api/system/sms/smsChannel'
import { CommonStatusEnum } from '@/utils/constants'
defineOptions({ name: 'SystemSmsChannelForm' })
const { t } = useI18n() // 国际化
const message = useMessage() // 消息弹窗

View File

@ -129,11 +129,14 @@
<!-- 表单弹窗添加/修改 -->
<SmsChannelForm ref="formRef" @success="getList" />
</template>
<script setup lang="ts" name="SystemSmsChannel">
<script setup lang="ts">
import { DICT_TYPE, getIntDictOptions } from '@/utils/dict'
import { dateFormatter } from '@/utils/formatTime'
import * as SmsChannelApi from '@/api/system/sms/smsChannel'
import SmsChannelForm from './SmsChannelForm.vue'
defineOptions({ name: 'SystemSmsChannel' })
const { t } = useI18n() // 国际化
const message = useMessage() // 消息弹窗

View File

@ -59,12 +59,14 @@
</el-descriptions>
</Dialog>
</template>
<script lang="ts" name="SystemSmsLogDetail" setup>
<script lang="ts" setup>
import { DICT_TYPE } from '@/utils/dict'
import { formatDate } from '@/utils/formatTime'
import * as SmsLogApi from '@/api/system/sms/smsLog'
import * as SmsChannelApi from '@/api/system/sms/smsChannel'
defineOptions({ name: 'SystemSmsLogDetail' })
const dialogVisible = ref(false) // 弹窗的是否展示
const detailLoading = ref(false) // 表单的加载中
const detailData = ref() // 详情数据

View File

@ -184,13 +184,16 @@
<!-- 表单弹窗详情 -->
<SmsLogDetail ref="detailRef" />
</template>
<script setup lang="ts" name="SystemSmsLog">
<script setup lang="ts">
import { DICT_TYPE, getIntDictOptions, getDictLabel } from '@/utils/dict'
import { dateFormatter, formatDate } from '@/utils/formatTime'
import download from '@/utils/download'
import * as SmsChannelApi from '@/api/system/sms/smsChannel'
import * as SmsLogApi from '@/api/system/sms/smsLog'
import SmsLogDetail from './SmsLogDetail.vue'
defineOptions({ name: 'SystemSmsLog' })
const message = useMessage() // 消息弹窗
const loading = ref(false) // 列表的加载中

View File

@ -63,12 +63,14 @@
</template>
</Dialog>
</template>
<script lang="ts" name="SystemSmsTemplateForm" setup>
<script lang="ts" setup>
import { DICT_TYPE, getDictLabel, getIntDictOptions } from '@/utils/dict'
import * as SmsTemplateApi from '@/api/system/sms/smsTemplate'
import * as SmsChannelApi from '@/api/system/sms/smsChannel'
import { CommonStatusEnum } from '@/utils/constants'
defineOptions({ name: 'SystemSmsTemplateForm' })
const { t } = useI18n() // 国际化
const message = useMessage() // 消息弹窗

View File

@ -36,9 +36,11 @@
</template>
</Dialog>
</template>
<script lang="ts" name="SystemSmsTemplateSendForm" setup>
<script lang="ts" setup>
import * as SmsTemplateApi from '@/api/system/sms/smsTemplate'
defineOptions({ name: 'SystemSmsTemplateSendForm' })
const message = useMessage() // 消息弹窗
const dialogVisible = ref(false) // 弹窗的是否展示

View File

@ -211,7 +211,7 @@
<!-- 表单弹窗测试发送 -->
<SmsTemplateSendForm ref="sendFormRef" />
</template>
<script setup lang="ts" name="SystemSmsTemplate">
<script setup lang="ts">
import { DICT_TYPE, getIntDictOptions, getDictLabel } from '@/utils/dict'
import { dateFormatter } from '@/utils/formatTime'
import * as SmsTemplateApi from '@/api/system/sms/smsTemplate'
@ -219,6 +219,9 @@ import * as SmsChannelApi from '@/api/system/sms/smsChannel'
import download from '@/utils/download'
import SmsTemplateForm from './SmsTemplateForm.vue'
import SmsTemplateSendForm from './SmsTemplateSendForm.vue'
defineOptions({ name: 'SystemSmsTemplate' })
const message = useMessage() // 消息弹窗
const { t } = useI18n() // 国际化