feat: ตัวเเปร workNameItems
This commit is contained in:
parent
2b0b1b7f8c
commit
eb41274a50
1 changed files with 16 additions and 0 deletions
|
|
@ -19,9 +19,13 @@ import {
|
||||||
ProductOnWork,
|
ProductOnWork,
|
||||||
WorkCreate,
|
WorkCreate,
|
||||||
} from './types';
|
} from './types';
|
||||||
|
import { ref } from 'vue';
|
||||||
|
|
||||||
const useProductServiceStore = defineStore('api-product-service', () => {
|
const useProductServiceStore = defineStore('api-product-service', () => {
|
||||||
// Product Type
|
// Product Type
|
||||||
|
|
||||||
|
const workNameItems = ref<string[]>([]);
|
||||||
|
|
||||||
async function fetchStatsProductType() {
|
async function fetchStatsProductType() {
|
||||||
const res = await api.get('/product-type/stats');
|
const res = await api.get('/product-type/stats');
|
||||||
|
|
||||||
|
|
@ -666,7 +670,17 @@ const useProductServiceStore = defineStore('api-product-service', () => {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
async function fetchListOfWork() {
|
||||||
|
const res = await fetchListWork();
|
||||||
|
|
||||||
|
if (res) {
|
||||||
|
workNameItems.value = res.result.map((item) => item.name);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
return {
|
return {
|
||||||
|
workNameItems,
|
||||||
|
|
||||||
fetchStatsProductType,
|
fetchStatsProductType,
|
||||||
fetchListProductServiceByIdType,
|
fetchListProductServiceByIdType,
|
||||||
fetchListProductServiceType,
|
fetchListProductServiceType,
|
||||||
|
|
@ -702,6 +716,8 @@ const useProductServiceStore = defineStore('api-product-service', () => {
|
||||||
editWork,
|
editWork,
|
||||||
deleteWork,
|
deleteWork,
|
||||||
fetchListProductByIdWork,
|
fetchListProductByIdWork,
|
||||||
|
|
||||||
|
fetchListOfWork,
|
||||||
};
|
};
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue