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!);
|
||||
}
|
||||
|
||||
/** 表格操作按钮的回调函数 */
|
||||
|
||||
Reference in New Issue
Block a user