refactor:基于 lint 处理排版
This commit is contained in:
@@ -133,7 +133,7 @@ export function useGridFormSchema(): VbenFormSchema[] {
|
||||
}
|
||||
|
||||
/** 列表的字段 */
|
||||
export function useGridColumns<T = SystemSmsChannelApi.SystemSmsChannel>(
|
||||
export function useGridColumns<T = SystemSmsChannelApi.SmsChannel>(
|
||||
onActionClick: OnActionClickFn<T>,
|
||||
): VxeTableGridOptions['columns'] {
|
||||
return [
|
||||
|
||||
@@ -45,12 +45,12 @@ function onCreate() {
|
||||
}
|
||||
|
||||
/** 编辑短信渠道 */
|
||||
function onEdit(row: SystemSmsChannelApi.SystemSmsChannel) {
|
||||
function onEdit(row: SystemSmsChannelApi.SmsChannel) {
|
||||
formModalApi.setData(row).open();
|
||||
}
|
||||
|
||||
/** 删除短信渠道 */
|
||||
async function onDelete(row: SystemSmsChannelApi.SystemSmsChannel) {
|
||||
async function onDelete(row: SystemSmsChannelApi.SmsChannel) {
|
||||
const hideLoading = message.loading({
|
||||
content: $t('ui.actionMessage.deleting', [row.signature]),
|
||||
duration: 0,
|
||||
@@ -72,7 +72,7 @@ async function onDelete(row: SystemSmsChannelApi.SystemSmsChannel) {
|
||||
function onActionClick({
|
||||
code,
|
||||
row,
|
||||
}: OnActionClickParams<SystemSmsChannelApi.SystemSmsChannel>) {
|
||||
}: OnActionClickParams<SystemSmsChannelApi.SmsChannel>) {
|
||||
switch (code) {
|
||||
case 'delete': {
|
||||
onDelete(row);
|
||||
@@ -111,7 +111,7 @@ const [Grid, gridApi] = useVbenVxeGrid({
|
||||
refresh: { code: 'query' },
|
||||
search: true,
|
||||
},
|
||||
} as VxeTableGridOptions<SystemSmsChannelApi.SystemSmsChannel>,
|
||||
} as VxeTableGridOptions<SystemSmsChannelApi.SmsChannel>,
|
||||
});
|
||||
</script>
|
||||
|
||||
|
||||
@@ -18,7 +18,7 @@ import { $t } from '#/locales';
|
||||
import { useFormSchema } from '../data';
|
||||
|
||||
const emit = defineEmits(['success']);
|
||||
const formData = ref<SystemSmsChannelApi.SystemSmsChannel>();
|
||||
const formData = ref<SystemSmsChannelApi.SmsChannel>();
|
||||
const getTitle = computed(() => {
|
||||
return formData.value?.id
|
||||
? $t('ui.actionTitle.edit', ['短信渠道'])
|
||||
@@ -42,8 +42,7 @@ const [Modal, modalApi] = useVbenModal({
|
||||
}
|
||||
modalApi.lock();
|
||||
// 提交表单
|
||||
const data =
|
||||
(await formApi.getValues()) as SystemSmsChannelApi.SystemSmsChannel;
|
||||
const data = (await formApi.getValues()) as SystemSmsChannelApi.SmsChannel;
|
||||
try {
|
||||
await (formData.value?.id
|
||||
? updateSmsChannel(data)
|
||||
@@ -64,7 +63,7 @@ const [Modal, modalApi] = useVbenModal({
|
||||
return;
|
||||
}
|
||||
// 加载数据
|
||||
const data = modalApi.getData<SystemSmsChannelApi.SystemSmsChannel>();
|
||||
const data = modalApi.getData<SystemSmsChannelApi.SmsChannel>();
|
||||
if (!data || !data.id) {
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -85,7 +85,7 @@ export function useGridFormSchema(): VbenFormSchema[] {
|
||||
}
|
||||
|
||||
/** 列表的字段 */
|
||||
export function useGridColumns<T = SystemSmsLogApi.SystemSmsLog>(
|
||||
export function useGridColumns<T = SystemSmsLogApi.SmsLog>(
|
||||
onActionClick: OnActionClickFn<T>,
|
||||
): VxeTableGridOptions['columns'] {
|
||||
return [
|
||||
|
||||
@@ -36,7 +36,7 @@ async function onExport() {
|
||||
}
|
||||
|
||||
/** 查看短信日志详情 */
|
||||
function onDetail(row: SystemSmsLogApi.SystemSmsLog) {
|
||||
function onDetail(row: SystemSmsLogApi.SmsLog) {
|
||||
detailModalApi.setData(row).open();
|
||||
}
|
||||
|
||||
@@ -44,7 +44,7 @@ function onDetail(row: SystemSmsLogApi.SystemSmsLog) {
|
||||
function onActionClick({
|
||||
code,
|
||||
row,
|
||||
}: OnActionClickParams<SystemSmsLogApi.SystemSmsLog>) {
|
||||
}: OnActionClickParams<SystemSmsLogApi.SmsLog>) {
|
||||
switch (code) {
|
||||
case 'detail': {
|
||||
onDetail(row);
|
||||
@@ -79,7 +79,7 @@ const [Grid, gridApi] = useVbenVxeGrid({
|
||||
refresh: { code: 'query' },
|
||||
search: true,
|
||||
},
|
||||
} as VxeTableGridOptions<SystemSmsLogApi.SystemSmsLog>,
|
||||
} as VxeTableGridOptions<SystemSmsLogApi.SmsLog>,
|
||||
});
|
||||
</script>
|
||||
|
||||
|
||||
@@ -11,7 +11,7 @@ import { Descriptions } from 'ant-design-vue';
|
||||
import { DictTag } from '#/components/dict-tag';
|
||||
import { DICT_TYPE } from '#/utils/dict';
|
||||
|
||||
const formData = ref<SystemSmsLogApi.SystemSmsLog>();
|
||||
const formData = ref<SystemSmsLogApi.SmsLog>();
|
||||
|
||||
const [Modal, modalApi] = useVbenModal({
|
||||
async onOpenChange(isOpen: boolean) {
|
||||
@@ -19,7 +19,7 @@ const [Modal, modalApi] = useVbenModal({
|
||||
return;
|
||||
}
|
||||
// 加载数据
|
||||
const data = modalApi.getData<SystemSmsLogApi.SystemSmsLog>();
|
||||
const data = modalApi.getData<SystemSmsLogApi.SmsLog>();
|
||||
if (!data || !data.id) {
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -203,7 +203,7 @@ export function useSendSmsFormSchema(): VbenFormSchema[] {
|
||||
}
|
||||
|
||||
/** 列表的字段 */
|
||||
export function useGridColumns<T = SystemSmsTemplateApi.SystemSmsTemplate>(
|
||||
export function useGridColumns<T = SystemSmsTemplateApi.SmsTemplate>(
|
||||
onActionClick: OnActionClickFn<T>,
|
||||
): VxeTableGridOptions['columns'] {
|
||||
return [
|
||||
|
||||
@@ -51,17 +51,17 @@ function onCreate() {
|
||||
}
|
||||
|
||||
/** 编辑短信模板 */
|
||||
function onEdit(row: SystemSmsTemplateApi.SystemSmsTemplate) {
|
||||
function onEdit(row: SystemSmsTemplateApi.SmsTemplate) {
|
||||
formModalApi.setData(row).open();
|
||||
}
|
||||
|
||||
/** 发送测试短信 */
|
||||
function onSend(row: SystemSmsTemplateApi.SystemSmsTemplate) {
|
||||
function onSend(row: SystemSmsTemplateApi.SmsTemplate) {
|
||||
sendModalApi.setData(row).open();
|
||||
}
|
||||
|
||||
/** 删除短信模板 */
|
||||
async function onDelete(row: SystemSmsTemplateApi.SystemSmsTemplate) {
|
||||
async function onDelete(row: SystemSmsTemplateApi.SmsTemplate) {
|
||||
const hideLoading = message.loading({
|
||||
content: $t('ui.actionMessage.deleting', [row.name]),
|
||||
duration: 0,
|
||||
@@ -83,7 +83,7 @@ async function onDelete(row: SystemSmsTemplateApi.SystemSmsTemplate) {
|
||||
function onActionClick({
|
||||
code,
|
||||
row,
|
||||
}: OnActionClickParams<SystemSmsTemplateApi.SystemSmsTemplate>) {
|
||||
}: OnActionClickParams<SystemSmsTemplateApi.SmsTemplate>) {
|
||||
switch (code) {
|
||||
case 'delete': {
|
||||
onDelete(row);
|
||||
@@ -126,7 +126,7 @@ const [Grid, gridApi] = useVbenVxeGrid({
|
||||
refresh: { code: 'query' },
|
||||
search: true,
|
||||
},
|
||||
} as VxeTableGridOptions<SystemSmsTemplateApi.SystemSmsTemplate>,
|
||||
} as VxeTableGridOptions<SystemSmsTemplateApi.SmsTemplate>,
|
||||
});
|
||||
</script>
|
||||
|
||||
|
||||
@@ -18,7 +18,7 @@ import { $t } from '#/locales';
|
||||
import { useFormSchema } from '../data';
|
||||
|
||||
const emit = defineEmits(['success']);
|
||||
const formData = ref<SystemSmsTemplateApi.SystemSmsTemplate>();
|
||||
const formData = ref<SystemSmsTemplateApi.SmsTemplate>();
|
||||
const getTitle = computed(() => {
|
||||
return formData.value?.id
|
||||
? $t('ui.actionTitle.edit', ['短信模板'])
|
||||
@@ -43,7 +43,7 @@ const [Modal, modalApi] = useVbenModal({
|
||||
modalApi.lock();
|
||||
// 提交表单
|
||||
const data =
|
||||
(await formApi.getValues()) as SystemSmsTemplateApi.SystemSmsTemplate;
|
||||
(await formApi.getValues()) as SystemSmsTemplateApi.SmsTemplate;
|
||||
try {
|
||||
await (formData.value?.id
|
||||
? updateSmsTemplate(data)
|
||||
@@ -64,7 +64,7 @@ const [Modal, modalApi] = useVbenModal({
|
||||
return;
|
||||
}
|
||||
// 加载数据
|
||||
const data = modalApi.getData<SystemSmsTemplateApi.SystemSmsTemplate>();
|
||||
const data = modalApi.getData<SystemSmsTemplateApi.SmsTemplate>();
|
||||
if (!data || !data.id) {
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -13,7 +13,7 @@ import { sendSms } from '#/api/system/sms/template';
|
||||
import { useSendSmsFormSchema } from '../data';
|
||||
|
||||
const emit = defineEmits(['success']);
|
||||
const formData = ref<SystemSmsTemplateApi.SystemSmsTemplate>();
|
||||
const formData = ref<SystemSmsTemplateApi.SmsTemplate>();
|
||||
|
||||
const [Form, formApi] = useVbenForm({
|
||||
layout: 'horizontal',
|
||||
@@ -38,7 +38,7 @@ const [Modal, modalApi] = useVbenModal({
|
||||
paramsObj[param] = values[`param_${param}`];
|
||||
});
|
||||
}
|
||||
const data: SystemSmsTemplateApi.SystemSmsSendReqVO = {
|
||||
const data: SystemSmsTemplateApi.SmsSendReqVO = {
|
||||
mobile: values.mobile,
|
||||
templateCode: formData.value?.code || '',
|
||||
templateParams: paramsObj,
|
||||
@@ -65,7 +65,7 @@ const [Modal, modalApi] = useVbenModal({
|
||||
return;
|
||||
}
|
||||
// 获取数据
|
||||
const data = modalApi.getData<SystemSmsTemplateApi.SystemSmsTemplate>();
|
||||
const data = modalApi.getData<SystemSmsTemplateApi.SmsTemplate>();
|
||||
if (!data) {
|
||||
return;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user