删除根目录的node_modules

This commit is contained in:
砂糖
2025-08-28 13:07:28 +08:00
parent 69e967325b
commit 93b5100f9b
21 changed files with 1540 additions and 5 deletions

View File

@@ -0,0 +1,41 @@
import { listProduct } from '@/api/oa/product';
import { listBomItem } from '@/api/oa/bomItem';
const useProductStore = defineStore('product', {
state: () => ({
productMap: {},
bomMap: {},
}),
actions: {
setProductMap(productMap) {
this.productMap = productMap;
},
setBomMap(bomMap) {
this.bomMap = bomMap;
},
async getBomInfo(bomId) {
try {
if (!this.bomMap[bomId]) {
const res = await listBomItem({ bomId });
this.bomMap[bomId] = res.rows;
}
return this.bomMap[bomId];
} catch (error) {
console.error(error);
return [];
}
},
fetchProductMap() {
listProduct().then(res => {
const map = {};
res.data.forEach(item => {
map[item.productId] = item;
});
this.productMap = map;
})
},
}
})
export default useProductStore;