feat: 🚀 物料列表刷新
This commit is contained in:
@@ -1,6 +1,8 @@
|
||||
import { getMaterialListReloadApi } from "@/api/modules/foundationMaterial";
|
||||
import { useMsg } from "@/hooks/useMsg";
|
||||
//getMaterialListResetApi
|
||||
// 直接导出函数,无需额外包装对象
|
||||
export const handleDel = (item: any, selectionList: any[], proTable: any) => {
|
||||
export const handleExport = (item: any, selectionList: any[], proTable: any) => {
|
||||
console.log("导出操作", item);
|
||||
console.log(selectionList, "=selectionList=");
|
||||
let length = selectionList.length;
|
||||
@@ -24,8 +26,8 @@ export const handleDel = (item: any, selectionList: any[], proTable: any) => {
|
||||
})
|
||||
.catch(() => {});
|
||||
};
|
||||
// proTable: any
|
||||
export const handleAdd = (item: any, selectionList: any[]) => {
|
||||
// proTable: any getMaterialListReloadApi
|
||||
export const handleReload = async (item: any, selectionList: any[], proTable: any) => {
|
||||
console.log("刷新操作", item);
|
||||
let length = selectionList.length;
|
||||
let ids: any = [];
|
||||
@@ -36,9 +38,15 @@ export const handleAdd = (item: any, selectionList: any[]) => {
|
||||
selectionList.forEach((item: any) => {
|
||||
ids.push(item.id);
|
||||
});
|
||||
let id = ids.join(",");
|
||||
const result = await getMaterialListReloadApi({ id });
|
||||
if (result?.code === 0) {
|
||||
useMsg("success", "数据刷新成功 !");
|
||||
proTable.value!.getTableList();
|
||||
}
|
||||
};
|
||||
|
||||
export const btnClick: any = {
|
||||
del: handleDel,
|
||||
add: handleAdd
|
||||
export: handleExport,
|
||||
reset: handleReload
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user