review:【ANTD】批量删除代码
parent
0e6c46ea09
commit
f03d8fa9ee
|
@ -47,6 +47,7 @@ export function deleteDemo01Contact(id: number) {
|
|||
}
|
||||
|
||||
/** 批量删除示例联系人 */
|
||||
// TODO @puhui999:ByIds,这种按照约定,是不带的,针对 Id 的情况哈。
|
||||
export function deleteDemo01ContactListByIds(ids: number[]) {
|
||||
return requestClient.delete(
|
||||
`/infra/demo01-contact/delete-list?ids=${ids.join(',')}`,
|
||||
|
|
|
@ -18,7 +18,7 @@ export function useTableToolbar() {
|
|||
const table = tableRef.value;
|
||||
const tableToolbar = tableToolbarRef.value;
|
||||
if (table && tableToolbar) {
|
||||
// TODO @puhui999:通过 nexttick 可以解决么?试过不得行🤣刚好列表组件出现后延迟一秒挂载很稳
|
||||
// 延迟 1 秒,确保 toolbar 组件已经挂载
|
||||
setTimeout(async () => {
|
||||
const toolbar = tableToolbar.getToolbarRef();
|
||||
if (!toolbar) {
|
||||
|
|
|
@ -77,6 +77,8 @@ async function onDeleteBatch() {
|
|||
}
|
||||
}
|
||||
|
||||
// TODO @puhui999:方法名,改成 handleRowCheckboxChange;注释:处理选中表格行
|
||||
// TODO @puhui999:deleteIds => checkedIds;然后注释去掉?
|
||||
const deleteIds = ref<number[]>([]); // 待删除示例联系人 ID
|
||||
function setDeleteIds({
|
||||
records,
|
||||
|
|
|
@ -199,7 +199,6 @@ export function useDemo03CourseGridEditColumns(
|
|||
minWidth: 60,
|
||||
align: 'center',
|
||||
fixed: 'right',
|
||||
|
||||
showOverflow: false,
|
||||
cellRender: {
|
||||
attrs: {
|
||||
|
|
|
@ -198,7 +198,6 @@ export function useDemo03CourseGridEditColumns(
|
|||
minWidth: 60,
|
||||
align: 'center',
|
||||
fixed: 'right',
|
||||
|
||||
showOverflow: false,
|
||||
cellRender: {
|
||||
attrs: {
|
||||
|
|
Loading…
Reference in New Issue