refactor: เก็บตัวเเปร record ของ tree
This commit is contained in:
parent
eb5c4b1560
commit
e45f55f4e3
1 changed files with 8 additions and 1 deletions
|
|
@ -19,8 +19,9 @@ import {
|
|||
ProductOnWork,
|
||||
WorkCreate,
|
||||
ServiceAndProduct,
|
||||
TreeProduct,
|
||||
} from './types';
|
||||
import { ref } from 'vue';
|
||||
import { computed, ref } from 'vue';
|
||||
import useFlowStore from '../flow';
|
||||
|
||||
import useMyBranchStore from 'src/stores/my-branch';
|
||||
|
|
@ -28,6 +29,8 @@ import useMyBranchStore from 'src/stores/my-branch';
|
|||
const useProductServiceStore = defineStore('api-product-service', () => {
|
||||
const useMyBranch = useMyBranchStore();
|
||||
|
||||
const recordTreeProductType = ref<Record<string, TreeProduct[]>>({});
|
||||
|
||||
// Product Type
|
||||
const flowStore = useFlowStore();
|
||||
|
||||
|
|
@ -91,6 +94,9 @@ const useProductServiceStore = defineStore('api-product-service', () => {
|
|||
|
||||
if (!res) return false;
|
||||
if (res.status === 200) {
|
||||
if (!!opts?.productGroupId) {
|
||||
recordTreeProductType.value[opts?.productGroupId] = res.data.result;
|
||||
}
|
||||
return res.data;
|
||||
}
|
||||
|
||||
|
|
@ -771,6 +777,7 @@ const useProductServiceStore = defineStore('api-product-service', () => {
|
|||
|
||||
return {
|
||||
workNameItems,
|
||||
recordTreeProductType,
|
||||
|
||||
fetchStatsProductType,
|
||||
fetchListProductServiceByIdType,
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue