|
|
|
@ -4,7 +4,7 @@ import { h } from 'vue';
@@ -4,7 +4,7 @@ import { h } from 'vue';
|
|
|
|
|
import { Tag, Switch } from 'ant-design-vue'; |
|
|
|
|
import { setDefaultType } from '/@/api/platform/common/controller/pushConcernFanType'; |
|
|
|
|
import { useMessage } from '/@/hooks/web/useMessage'; |
|
|
|
|
const { createConfirm } = useMessage(); |
|
|
|
|
const { createConfirm, createMessage } = useMessage(); |
|
|
|
|
|
|
|
|
|
/** 表格列配置 */ |
|
|
|
|
export const columns: BasicColumn[] = [ |
|
|
|
@ -153,27 +153,24 @@ export const pushTypeColumns = (refreshPushType: Function) => [
@@ -153,27 +153,24 @@ export const pushTypeColumns = (refreshPushType: Function) => [
|
|
|
|
|
unCheckedChildren: '已禁用', |
|
|
|
|
loading: record.pendingStatus, |
|
|
|
|
onChange(checked: boolean) { |
|
|
|
|
const text = checked ? '启用' : '禁用'; |
|
|
|
|
createConfirm({ |
|
|
|
|
checked ? createConfirm({ |
|
|
|
|
iconType: 'warning', |
|
|
|
|
title: '警告', |
|
|
|
|
content: `确认要"${text}${record.name}推送类型吗?`, |
|
|
|
|
content: `确认要启用${record.name}推送类型吗?`, |
|
|
|
|
onOk: async () => { |
|
|
|
|
record.pendingStatus = true; |
|
|
|
|
const { createMessage } = useMessage(); |
|
|
|
|
const defaultType = checked ? '1' : '0'; |
|
|
|
|
setDefaultType({ |
|
|
|
|
id: record.id, |
|
|
|
|
concernFanId: record.concernFanId, |
|
|
|
|
defaultType |
|
|
|
|
defaultType: '1' |
|
|
|
|
}).then(() => { |
|
|
|
|
refreshPushType(); |
|
|
|
|
createMessage.success(`${text}成功`); |
|
|
|
|
createMessage.success('启用成功!'); |
|
|
|
|
}).catch(() => { |
|
|
|
|
createMessage.error(`${text}失败`); |
|
|
|
|
createMessage.error('启用失败!'); |
|
|
|
|
}).finally(() => record.pendingStatus = false); |
|
|
|
|
} |
|
|
|
|
}); |
|
|
|
|
}) : createMessage.error('不允许禁用!'); |
|
|
|
|
} |
|
|
|
|
}); |
|
|
|
|
} |
|
|
|
|