diff --git a/src/components/forms/EmployeeForm.vue b/src/components/forms/EmployeeForm.vue index edf4607..dcc1cb1 100644 --- a/src/components/forms/EmployeeForm.vue +++ b/src/components/forms/EmployeeForm.vue @@ -35,7 +35,7 @@ @@ -121,12 +121,6 @@ export default defineComponent({ phone: '', rank: 0 }); - const categoryOptions = computed(() => - positionStore.getEntries.map(d => ({ - label: d.identifier, - value: d.id - })) - ); const handleSave = async () => { loadingBar.start(); @@ -186,12 +180,12 @@ export default defineComponent({ return { store, + positionStore, localFormData, handleSave, handleArchive, activeTab, goBack, - categoryOptions }; }, }); diff --git a/src/components/lists/EmployeeList.vue b/src/components/lists/EmployeeList.vue index f2ce3d8..adf4f75 100644 --- a/src/components/lists/EmployeeList.vue +++ b/src/components/lists/EmployeeList.vue @@ -93,7 +93,9 @@ export default defineComponent({ return false; } }, - { title: 'Name', key: 'identifier' }, + { title: 'Name', key: 'localizedName.ENG' }, + { title: 'Identifier', key: 'identifier' }, + { title: 'Position', key: 'position.localizedName.ENG' }, { title: 'Registered', key: 'regDate' } ]); diff --git a/src/components/lists/PositionList.vue b/src/components/lists/PositionList.vue new file mode 100644 index 0000000..6e2d160 --- /dev/null +++ b/src/components/lists/PositionList.vue @@ -0,0 +1,160 @@ + + + + + \ No newline at end of file diff --git a/src/router/index.ts b/src/router/index.ts index 8f6ebef..502e01c 100644 --- a/src/router/index.ts +++ b/src/router/index.ts @@ -13,6 +13,7 @@ import OrganizationsList from "../components/lists/OrganizationsList.vue"; import EmployeeList from "../components/lists/EmployeeList.vue"; import EmployeeForm from "../components/forms/EmployeeForm.vue"; import OrganizationForm from "../components/forms/OrganizationForm.vue"; +import PositionList from "../components/lists/PositionList.vue"; const routes: Array = [ { @@ -87,9 +88,31 @@ const routes: Array = [ }, { path: 'lookups', - component: EmployeeList + children: [ + { + path: 'languages', + component: PositionList + }, + { + path: 'labels', + component: PositionList + }, + { + path: 'org_categories', + component: PositionList + }, + { + path: 'positions', + component: PositionList + }, + { + path: 'task_types', + component: PositionList + } + ] } - ]}, + ] + }, { path: 'ai', component: AiAssistant, diff --git a/src/stores/of/positionStore.ts b/src/stores/of/positionStore.ts index 09a63a3..65b6dac 100644 --- a/src/stores/of/positionStore.ts +++ b/src/stores/of/positionStore.ts @@ -44,7 +44,14 @@ export const usePositionStore = defineStore('positionStore', () => { }; }); - const fetchOrgCategories = async (page = 1, pageSize = 10) => { + const getOptions = computed(() => { + return getEntries.value.map(position => ({ + label: position.localizedName.ENG, + value: position.id + })); + }); + + const fetchPositions = async (page = 1, pageSize = 10) => { const response = await apiClient.get(`/positions?page=${page}&size=${pageSize}`); if (response && response.data && response.data.payload) { apiViewResponse.value = response.data.payload; @@ -53,7 +60,7 @@ export const usePositionStore = defineStore('positionStore', () => { } }; - const fetchOrgCategory = async (id: string) => { + const fetchPosition = async (id: string) => { const response = await apiClient.get(`/positions/${id}`); if (response && response.data && response.data.payload) { apiFormResponse.value = response.data.payload; @@ -84,8 +91,9 @@ export const usePositionStore = defineStore('positionStore', () => { apiViewResponse, apiFormResponse, setupApiClient, - fetchAll: fetchOrgCategories, - fetch: fetchOrgCategory, + getOptions, + fetchAll: fetchPositions, + fetch: fetchPosition, save, getEntries, getPagination,