ข้อมูลตำแหน่ง: เพิ่มจำtab
This commit is contained in:
parent
727f3c6765
commit
253163fecc
2 changed files with 10 additions and 7 deletions
|
|
@ -9,8 +9,8 @@ import { useCounterMixin } from "@/stores/mixin";
|
|||
const { date2Thai } = useCounterMixin();
|
||||
|
||||
export const usePositionDataStore = defineStore("PositionData", () => {
|
||||
const pathLocation = ref<string>("list_position");
|
||||
const row = ref<DataRow[]>([]);
|
||||
const name = ref<any>([]);
|
||||
function save(data: DataResponse[], id: string) {
|
||||
const list = data.map((e) => ({
|
||||
...e,
|
||||
|
|
@ -26,5 +26,6 @@ export const usePositionDataStore = defineStore("PositionData", () => {
|
|||
return {
|
||||
save,
|
||||
row,
|
||||
pathLocation,
|
||||
};
|
||||
});
|
||||
|
|
|
|||
|
|
@ -4,8 +4,10 @@ import { ref, onMounted } from "vue";
|
|||
import ListPosition from "@/modules/01_metadataNew/components/position/01ListPosition.vue";
|
||||
import ListType from "@/modules/01_metadataNew/components/position/02ListType.vue";
|
||||
import ListExecutive from "@/modules/01_metadataNew/components/position/04ListExecutive.vue";
|
||||
const currentTab = ref<string>("list_position");
|
||||
import { usePositionDataStore } from "../stores/positionListStore";
|
||||
// const store.pathLocation = ref<string>("list_position");
|
||||
const tabs = ref<Array<any>>([]);
|
||||
const store = usePositionDataStore();
|
||||
|
||||
onMounted(() => {
|
||||
const tabsPerson = [
|
||||
|
|
@ -23,7 +25,7 @@ onMounted(() => {
|
|||
<q-card flat bordered>
|
||||
<q-tabs
|
||||
dense
|
||||
v-model="currentTab"
|
||||
v-model="store.pathLocation"
|
||||
align="left"
|
||||
indicator-color="primary"
|
||||
active-color="primary bg-teal-1"
|
||||
|
|
@ -33,7 +35,7 @@ onMounted(() => {
|
|||
<q-tab
|
||||
v-for="tab in tabs"
|
||||
:key="tab.value"
|
||||
v-on:click="currentTab = tab.value"
|
||||
v-on:click="store.pathLocation = tab.value"
|
||||
:label="tab.label"
|
||||
:name="tab.value"
|
||||
class="q-py-xs"
|
||||
|
|
@ -41,9 +43,9 @@ onMounted(() => {
|
|||
</q-tabs>
|
||||
<q-separator size="2px" />
|
||||
<div class="q-pa-md">
|
||||
<ListPosition v-if="currentTab == 'list_position'" />
|
||||
<ListType v-if="currentTab == 'list_type'" />
|
||||
<ListExecutive v-if="currentTab == 'list_executive'" />
|
||||
<ListPosition v-if="store.pathLocation == 'list_position'" />
|
||||
<ListType v-if="store.pathLocation == 'list_type'" />
|
||||
<ListExecutive v-if="store.pathLocation == 'list_executive'" />
|
||||
</div>
|
||||
</q-card>
|
||||
</template>
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue