reactor:优化批量删除的代码,从 as number 变成 !
This commit is contained in:
@@ -159,7 +159,7 @@ function handleRowCheckboxChange({
|
||||
}: {
|
||||
records: InfraCodegenApi.CodegenTable[];
|
||||
}) {
|
||||
checkedIds.value = records.map((item) => item.id);
|
||||
checkedIds.value = records.map((item) => item.id!);
|
||||
}
|
||||
|
||||
const [Grid, gridApi] = useVbenVxeGrid({
|
||||
|
||||
@@ -80,7 +80,7 @@ function handleRowCheckboxChange({
|
||||
}: {
|
||||
records: InfraConfigApi.Config[];
|
||||
}) {
|
||||
checkedIds.value = records.map((item) => item.id as number);
|
||||
checkedIds.value = records.map((item) => item.id!);
|
||||
}
|
||||
|
||||
/** 表格操作按钮的回调函数 */
|
||||
|
||||
@@ -59,7 +59,7 @@ async function onDeleteBatch() {
|
||||
await deleteDataSourceConfigList(checkedIds.value);
|
||||
checkedIds.value = [];
|
||||
ElMessage.success($t('ui.actionMessage.deleteSuccess'));
|
||||
onRefresh();
|
||||
await onRefresh();
|
||||
}
|
||||
|
||||
const checkedIds = ref<number[]>([]);
|
||||
@@ -68,7 +68,7 @@ function handleRowCheckboxChange({
|
||||
}: {
|
||||
records: InfraDataSourceConfigApi.DataSourceConfig[];
|
||||
}) {
|
||||
checkedIds.value = records.map((item) => item.id as number);
|
||||
checkedIds.value = records.map((item) => item.id!);
|
||||
}
|
||||
|
||||
/** 表格操作按钮的回调函数 */
|
||||
|
||||
@@ -78,7 +78,7 @@ function handleRowCheckboxChange({
|
||||
}: {
|
||||
records: Demo01ContactApi.Demo01Contact[];
|
||||
}) {
|
||||
checkedIds.value = records.map((item) => item.id);
|
||||
checkedIds.value = records.map((item) => item.id!);
|
||||
}
|
||||
|
||||
/** 导出表格 */
|
||||
|
||||
@@ -84,7 +84,7 @@ function handleRowCheckboxChange({
|
||||
}: {
|
||||
records: Demo03StudentApi.Demo03Student[];
|
||||
}) {
|
||||
checkedIds.value = records.map((item) => item.id);
|
||||
checkedIds.value = records.map((item) => item.id!);
|
||||
}
|
||||
|
||||
/** 导出表格 */
|
||||
|
||||
@@ -83,7 +83,7 @@ function handleRowCheckboxChange({
|
||||
}: {
|
||||
records: Demo03StudentApi.Demo03Course[];
|
||||
}) {
|
||||
checkedIds.value = records.map((item) => item.id);
|
||||
checkedIds.value = records.map((item) => item.id!);
|
||||
}
|
||||
|
||||
const [Grid, gridApi] = useVbenVxeGrid({
|
||||
|
||||
@@ -83,7 +83,7 @@ function handleRowCheckboxChange({
|
||||
}: {
|
||||
records: Demo03StudentApi.Demo03Grade[];
|
||||
}) {
|
||||
checkedIds.value = records.map((item) => item.id);
|
||||
checkedIds.value = records.map((item) => item.id!);
|
||||
}
|
||||
|
||||
const [Grid, gridApi] = useVbenVxeGrid({
|
||||
|
||||
@@ -83,7 +83,7 @@ function handleRowCheckboxChange({
|
||||
}: {
|
||||
records: Demo03StudentApi.Demo03Student[];
|
||||
}) {
|
||||
checkedIds.value = records.map((item) => item.id);
|
||||
checkedIds.value = records.map((item) => item.id!);
|
||||
}
|
||||
|
||||
/** 导出表格 */
|
||||
|
||||
@@ -78,7 +78,7 @@ function handleRowCheckboxChange({
|
||||
}: {
|
||||
records: Demo03StudentApi.Demo03Student[];
|
||||
}) {
|
||||
checkedIds.value = records.map((item) => item.id);
|
||||
checkedIds.value = records.map((item) => item.id!);
|
||||
}
|
||||
|
||||
/** 导出表格 */
|
||||
|
||||
@@ -135,7 +135,7 @@ function handleRowCheckboxChange({
|
||||
}: {
|
||||
records: Demo01ContactApi.Demo01Contact[];
|
||||
}) {
|
||||
checkedIds.value = records.map((item) => item.id);
|
||||
checkedIds.value = records.map((item) => item.id!);
|
||||
}
|
||||
|
||||
/** 导出表格 */
|
||||
|
||||
@@ -147,7 +147,7 @@ function handleRowCheckboxChange({
|
||||
}: {
|
||||
records: Demo03StudentApi.Demo03Student[];
|
||||
}) {
|
||||
checkedIds.value = records.map((item) => item.id);
|
||||
checkedIds.value = records.map((item) => item.id!);
|
||||
}
|
||||
|
||||
/** 导出表格 */
|
||||
|
||||
@@ -91,7 +91,7 @@ function handleRowCheckboxChange({
|
||||
}: {
|
||||
records: Demo03StudentApi.Demo03Course[];
|
||||
}) {
|
||||
checkedIds.value = records.map((item) => item.id);
|
||||
checkedIds.value = records.map((item) => item.id!);
|
||||
}
|
||||
|
||||
const loading = ref(true); // 列表的加载中
|
||||
|
||||
@@ -91,7 +91,7 @@ function handleRowCheckboxChange({
|
||||
}: {
|
||||
records: Demo03StudentApi.Demo03Grade[];
|
||||
}) {
|
||||
checkedIds.value = records.map((item) => item.id);
|
||||
checkedIds.value = records.map((item) => item.id!);
|
||||
}
|
||||
|
||||
const loading = ref(true); // 列表的加载中
|
||||
|
||||
@@ -143,7 +143,7 @@ function handleRowCheckboxChange({
|
||||
}: {
|
||||
records: Demo03StudentApi.Demo03Student[];
|
||||
}) {
|
||||
checkedIds.value = records.map((item) => item.id);
|
||||
checkedIds.value = records.map((item) => item.id!);
|
||||
}
|
||||
|
||||
/** 导出表格 */
|
||||
|
||||
@@ -136,7 +136,7 @@ function handleRowCheckboxChange({
|
||||
}: {
|
||||
records: Demo03StudentApi.Demo03Student[];
|
||||
}) {
|
||||
checkedIds.value = records.map((item) => item.id);
|
||||
checkedIds.value = records.map((item) => item.id!);
|
||||
}
|
||||
|
||||
/** 导出表格 */
|
||||
|
||||
@@ -90,7 +90,7 @@ function handleRowCheckboxChange({
|
||||
}: {
|
||||
records: InfraFileApi.File[];
|
||||
}) {
|
||||
checkedIds.value = records.map((item) => item.id as number);
|
||||
checkedIds.value = records.map((item) => item.id!);
|
||||
}
|
||||
|
||||
/** 表格操作按钮的回调函数 */
|
||||
|
||||
@@ -114,7 +114,7 @@ function handleRowCheckboxChange({
|
||||
}: {
|
||||
records: InfraFileConfigApi.FileConfig[];
|
||||
}) {
|
||||
checkedIds.value = records.map((item) => item.id as number);
|
||||
checkedIds.value = records.map((item) => item.id!);
|
||||
}
|
||||
|
||||
/** 表格操作按钮的回调函数 */
|
||||
|
||||
@@ -129,7 +129,7 @@ async function onDeleteBatch() {
|
||||
|
||||
const checkedIds = ref<number[]>([]);
|
||||
function handleRowCheckboxChange({ records }: { records: InfraJobApi.Job[] }) {
|
||||
checkedIds.value = records.map((item) => item.id as number);
|
||||
checkedIds.value = records.map((item) => item.id!);
|
||||
}
|
||||
|
||||
/** 表格操作按钮的回调函数 */
|
||||
|
||||
@@ -63,7 +63,7 @@ function handleRowCheckboxChange({
|
||||
}: {
|
||||
records: MallCouponTemplateApi.CouponTemplate[];
|
||||
}) {
|
||||
checkedIds.value = records.map((item) => item.id as number);
|
||||
checkedIds.value = records.map((item) => item.id!);
|
||||
}
|
||||
|
||||
/** 优惠券模板状态修改 */
|
||||
|
||||
@@ -47,7 +47,7 @@ function onRefresh() {
|
||||
/** 设置选中 ID */
|
||||
const checkedIds = ref<number[]>([]);
|
||||
function setCheckedIds({ records }: { records: MemberUserApi.User[] }) {
|
||||
checkedIds.value = records.map((item) => item.id as number);
|
||||
checkedIds.value = records.map((item) => item.id!);
|
||||
}
|
||||
|
||||
/** 发送优惠券 */
|
||||
|
||||
@@ -87,7 +87,7 @@ function handleRowCheckboxChange({
|
||||
}: {
|
||||
records: SystemDictDataApi.DictData[];
|
||||
}) {
|
||||
checkedIds.value = records.map((item) => item.id as number);
|
||||
checkedIds.value = records.map((item) => item.id!);
|
||||
}
|
||||
|
||||
/** 表格操作按钮回调 */
|
||||
|
||||
@@ -82,7 +82,7 @@ function handleRowCheckboxChange({
|
||||
}: {
|
||||
records: SystemDictTypeApi.DictType[];
|
||||
}) {
|
||||
checkedIds.value = records.map((item) => item.id as number);
|
||||
checkedIds.value = records.map((item) => item.id!);
|
||||
}
|
||||
|
||||
/** 表格操作按钮回调 */
|
||||
|
||||
@@ -73,7 +73,7 @@ function handleRowCheckboxChange({
|
||||
}: {
|
||||
records: SystemMailAccountApi.MailAccount[];
|
||||
}) {
|
||||
checkedIds.value = records.map((item) => item.id as number);
|
||||
checkedIds.value = records.map((item) => item.id!);
|
||||
}
|
||||
|
||||
/** 表格操作按钮的回调函数 */
|
||||
|
||||
@@ -93,7 +93,7 @@ function handleRowCheckboxChange({
|
||||
}: {
|
||||
records: SystemMailTemplateApi.MailTemplate[];
|
||||
}) {
|
||||
checkedIds.value = records.map((item) => item.id as number);
|
||||
checkedIds.value = records.map((item) => item.id!);
|
||||
}
|
||||
|
||||
/** 表格操作按钮的回调函数 */
|
||||
|
||||
@@ -35,6 +35,7 @@ function onRefresh() {
|
||||
}
|
||||
|
||||
/** 创建公告 */
|
||||
// TODO @霖:【规范讨论】方法名,要不要都换成 handleXXX 开头,和 ep 保持一致;
|
||||
function onCreate() {
|
||||
formModalApi.setData(null).open();
|
||||
}
|
||||
@@ -74,7 +75,7 @@ function handleRowCheckboxChange({
|
||||
}: {
|
||||
records: SystemNoticeApi.Notice[];
|
||||
}) {
|
||||
checkedIds.value = records.map((item) => item.id as number);
|
||||
checkedIds.value = records.map((item) => item.id!);
|
||||
}
|
||||
|
||||
/** 推送公告 */
|
||||
@@ -173,6 +174,7 @@ const [Grid, gridApi] = useVbenVxeGrid({
|
||||
]"
|
||||
/>
|
||||
</template>
|
||||
<!-- TODO @霖:【规范讨论】要不要类似 antd 一样,改成 TableAction;可见 /apps/web-ele/src/views/system/notice/index.vue 的 167 到 195 -->
|
||||
</Grid>
|
||||
</Page>
|
||||
</template>
|
||||
|
||||
@@ -102,7 +102,7 @@ function handleRowCheckboxChange({
|
||||
}: {
|
||||
records: SystemNotifyTemplateApi.NotifyTemplate[];
|
||||
}) {
|
||||
checkedIds.value = records.map((item) => item.id as number);
|
||||
checkedIds.value = records.map((item) => item.id!);
|
||||
}
|
||||
|
||||
/** 表格操作按钮的回调函数 */
|
||||
|
||||
@@ -73,7 +73,7 @@ function handleRowCheckboxChange({
|
||||
}: {
|
||||
records: SystemOAuth2ClientApi.OAuth2Client[];
|
||||
}) {
|
||||
checkedIds.value = records.map((item) => item.id as number);
|
||||
checkedIds.value = records.map((item) => item.id!);
|
||||
}
|
||||
|
||||
/** 表格操作按钮的回调函数 */
|
||||
|
||||
@@ -80,7 +80,7 @@ function handleRowCheckboxChange({
|
||||
}: {
|
||||
records: SystemPostApi.Post[];
|
||||
}) {
|
||||
checkedIds.value = records.map((item) => item.id as number);
|
||||
checkedIds.value = records.map((item) => item.id!);
|
||||
}
|
||||
|
||||
/** 表格操作按钮的回调函数 */
|
||||
|
||||
@@ -94,7 +94,7 @@ function handleRowCheckboxChange({
|
||||
}: {
|
||||
records: SystemRoleApi.Role[];
|
||||
}) {
|
||||
checkedIds.value = records.map((item) => item.id as number);
|
||||
checkedIds.value = records.map((item) => item.id!);
|
||||
}
|
||||
|
||||
/** 分配角色的数据权限 */
|
||||
|
||||
@@ -80,7 +80,7 @@ function handleRowCheckboxChange({
|
||||
}: {
|
||||
records: SystemSmsChannelApi.SmsChannel[];
|
||||
}) {
|
||||
checkedIds.value = records.map((item) => item.id as number);
|
||||
checkedIds.value = records.map((item) => item.id!);
|
||||
}
|
||||
|
||||
/** 表格操作按钮的回调函数 */
|
||||
|
||||
@@ -91,7 +91,7 @@ function handleRowCheckboxChange({
|
||||
}: {
|
||||
records: SystemSmsTemplateApi.SmsTemplate[];
|
||||
}) {
|
||||
checkedIds.value = records.map((item) => item.id as number);
|
||||
checkedIds.value = records.map((item) => item.id!);
|
||||
}
|
||||
|
||||
/** 表格操作按钮的回调函数 */
|
||||
|
||||
@@ -73,7 +73,7 @@ function handleRowCheckboxChange({
|
||||
}: {
|
||||
records: SystemSocialClientApi.SocialClient[];
|
||||
}) {
|
||||
checkedIds.value = records.map((item) => item.id as number);
|
||||
checkedIds.value = records.map((item) => item.id!);
|
||||
}
|
||||
|
||||
/** 表格操作按钮的回调函数 */
|
||||
|
||||
@@ -92,7 +92,7 @@ function handleRowCheckboxChange({
|
||||
}: {
|
||||
records: SystemTenantApi.Tenant[];
|
||||
}) {
|
||||
checkedIds.value = records.map((item) => item.id as number);
|
||||
checkedIds.value = records.map((item) => item.id!);
|
||||
}
|
||||
|
||||
/** 表格操作按钮的回调函数 */
|
||||
|
||||
@@ -73,7 +73,7 @@ function handleRowCheckboxChange({
|
||||
}: {
|
||||
records: SystemTenantPackageApi.TenantPackage[];
|
||||
}) {
|
||||
checkedIds.value = records.map((item) => item.id as number);
|
||||
checkedIds.value = records.map((item) => item.id!);
|
||||
}
|
||||
|
||||
/** 表格操作按钮的回调函数 */
|
||||
|
||||
@@ -111,7 +111,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