reactor:优化批量删除的代码,从 as number 变成 !
This commit is contained in:
@@ -81,7 +81,7 @@ function handleRowCheckboxChange({
|
||||
}: {
|
||||
records: SystemDeptApi.Dept[];
|
||||
}) {
|
||||
checkedIds.value = records.map((item) => item.id as number);
|
||||
checkedIds.value = records.map((item) => item.id!);
|
||||
}
|
||||
|
||||
/** 批量删除部门 */
|
||||
|
||||
@@ -78,7 +78,7 @@ function handleRowCheckboxChange({
|
||||
}: {
|
||||
records: SystemDictDataApi.DictData[];
|
||||
}) {
|
||||
checkedIds.value = records.map((item) => item.id as number);
|
||||
checkedIds.value = records.map((item) => item.id!);
|
||||
}
|
||||
|
||||
/** 批量删除字典数据 */
|
||||
|
||||
@@ -76,7 +76,7 @@ function handleRowCheckboxChange({
|
||||
}: {
|
||||
records: SystemDictTypeApi.DictType[];
|
||||
}) {
|
||||
checkedIds.value = records.map((item) => item.id as number);
|
||||
checkedIds.value = records.map((item) => item.id!);
|
||||
}
|
||||
|
||||
/** 批量删除字典类型 */
|
||||
|
||||
@@ -64,7 +64,7 @@ function handleRowCheckboxChange({
|
||||
}: {
|
||||
records: SystemMailAccountApi.MailAccount[];
|
||||
}) {
|
||||
checkedIds.value = records.map((item) => item.id as number);
|
||||
checkedIds.value = records.map((item) => item.id!);
|
||||
}
|
||||
|
||||
/** 批量删除邮箱账号 */
|
||||
|
||||
@@ -76,7 +76,7 @@ function handleRowCheckboxChange({
|
||||
}: {
|
||||
records: SystemMailTemplateApi.MailTemplate[];
|
||||
}) {
|
||||
checkedIds.value = records.map((item) => item.id as number);
|
||||
checkedIds.value = records.map((item) => item.id!);
|
||||
}
|
||||
|
||||
/** 批量删除邮件模板 */
|
||||
|
||||
@@ -59,15 +59,6 @@ async function handleDelete(row: SystemNoticeApi.Notice) {
|
||||
}
|
||||
}
|
||||
|
||||
const checkedIds = ref<number[]>([]);
|
||||
function handleRowCheckboxChange({
|
||||
records,
|
||||
}: {
|
||||
records: SystemNoticeApi.Notice[];
|
||||
}) {
|
||||
checkedIds.value = records.map((item) => item.id as number);
|
||||
}
|
||||
|
||||
/** 批量删除公告 */
|
||||
async function handleDeleteBatch() {
|
||||
const hideLoading = message.loading({
|
||||
@@ -85,6 +76,15 @@ async function handleDeleteBatch() {
|
||||
}
|
||||
}
|
||||
|
||||
const checkedIds = ref<number[]>([]);
|
||||
function handleRowCheckboxChange({
|
||||
records,
|
||||
}: {
|
||||
records: SystemNoticeApi.Notice[];
|
||||
}) {
|
||||
checkedIds.value = records.map((item) => item.id as number);
|
||||
}
|
||||
|
||||
/** 推送公告 */
|
||||
async function handlePush(row: SystemNoticeApi.Notice) {
|
||||
const hideLoading = message.loading({
|
||||
|
||||
@@ -82,7 +82,7 @@ function handleRowCheckboxChange({
|
||||
}: {
|
||||
records: SystemNotifyTemplateApi.NotifyTemplate[];
|
||||
}) {
|
||||
checkedIds.value = records.map((item) => item.id as number);
|
||||
checkedIds.value = records.map((item) => item.id!);
|
||||
}
|
||||
|
||||
/** 批量删除站内信模板 */
|
||||
|
||||
@@ -71,7 +71,7 @@ function handleRowCheckboxChange({
|
||||
}: {
|
||||
records: SystemPostApi.Post[];
|
||||
}) {
|
||||
checkedIds.value = records.map((item) => item.id as number);
|
||||
checkedIds.value = records.map((item) => item.id!);
|
||||
}
|
||||
|
||||
/** 批量删除岗位 */
|
||||
|
||||
@@ -84,7 +84,7 @@ function handleRowCheckboxChange({
|
||||
}: {
|
||||
records: SystemRoleApi.Role[];
|
||||
}) {
|
||||
checkedIds.value = records.map((item) => item.id as number);
|
||||
checkedIds.value = records.map((item) => item.id!);
|
||||
}
|
||||
|
||||
/** 批量删除角色 */
|
||||
|
||||
@@ -65,14 +65,13 @@ async function handleDelete(row: SystemSmsChannelApi.SmsChannel) {
|
||||
}
|
||||
}
|
||||
|
||||
// 选中的短信渠道ID
|
||||
const checkedIds = ref<number[]>([]);
|
||||
function handleRowCheckboxChange({
|
||||
records,
|
||||
}: {
|
||||
records: SystemSmsChannelApi.SmsChannel[];
|
||||
}) {
|
||||
checkedIds.value = records.map((item) => item.id as number);
|
||||
checkedIds.value = records.map((item) => item.id!);
|
||||
}
|
||||
|
||||
/** 批量删除处理 */
|
||||
|
||||
@@ -82,7 +82,7 @@ function handleRowCheckboxChange({
|
||||
}: {
|
||||
records: SystemSmsTemplateApi.SmsTemplate[];
|
||||
}) {
|
||||
checkedIds.value = records.map((item) => item.id as number);
|
||||
checkedIds.value = records.map((item) => item.id!);
|
||||
}
|
||||
|
||||
/** 批量删除短信模板 */
|
||||
|
||||
@@ -83,7 +83,7 @@ function handleRowCheckboxChange({
|
||||
}: {
|
||||
records: SystemTenantApi.Tenant[];
|
||||
}) {
|
||||
checkedIds.value = records.map((item) => item.id as number);
|
||||
checkedIds.value = records.map((item) => item.id!);
|
||||
}
|
||||
|
||||
/** 批量删除租户 */
|
||||
|
||||
@@ -64,7 +64,7 @@ function handleRowCheckboxChange({
|
||||
}: {
|
||||
records: SystemTenantPackageApi.TenantPackage[];
|
||||
}) {
|
||||
checkedIds.value = records.map((item) => item.id as number);
|
||||
checkedIds.value = records.map((item) => item.id!);
|
||||
}
|
||||
|
||||
/** 批量删除租户套餐 */
|
||||
|
||||
@@ -106,7 +106,7 @@ function handleRowCheckboxChange({
|
||||
}: {
|
||||
records: SystemUserApi.User[];
|
||||
}) {
|
||||
checkedIds.value = records.map((item) => item.id as number);
|
||||
checkedIds.value = records.map((item) => item.id!);
|
||||
}
|
||||
|
||||
/** 批量删除用户 */
|
||||
|
||||
Reference in New Issue
Block a user