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;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user