แก้ list ประเภทสมรรถนะซ้ำ

This commit is contained in:
Warunee Tamkoo 2024-04-09 11:36:19 +07:00
parent 7a0ca5bb65
commit 618037135d
2 changed files with 40 additions and 57 deletions

View file

@ -5,40 +5,35 @@ import { useCounterMixin } from "@/stores/mixin";
import { useQuasar } from "quasar";
import { useRouter } from "vue-router";
import type{ DataOption } from '@/modules/14_KPI/interface/index/Main'
import type { DataOption } from "@/modules/14_KPI/interface/index/Main";
import http from "@/plugins/http";
import config from "@/app.config";
const router = useRouter()
const rows = ref<any>()
const router = useRouter();
const rows = ref<any>();
const competencyTypeOp = ref<DataOption[]>([
{
id:'ID1',
name:'สมรรถนะหลัก',
id: "ID1",
name: "สมรรถนะหลัก",
},
{
id:'ID2',
name:'สมรรถนะประจำกลุ่มงาน',
id: "ID2",
name: "สมรรถนะประจำกลุ่มงาน",
},
{
id:'ID3',
name:'สมรรถนะประจำกลุ่มงาน',
id: "ID3",
name: "สมรรถนะประจำผู้บริหารกรุงเทพมหานคร",
},
{
id:'ID4',
name:'สมรรถนะประจำผู้บริหารกรุงเทพมหานคร',
id: "ID4",
name: "สมรรถนะเฉพาะสำหรับตำแหน่ง ผอ.เขต ผช.ผอ.เขต และหัวหน้าฝ่ายในสังกัด สนง.เขต",
},
{
id:'ID5',
name:'สมรรถนะเฉพาะสำหรับตำแหน่ง ผอ.เขต ผช.ผอ.เขต และหัวหน้าฝ่ายในสังกัด สนง.เขต',
id: "ID5",
name: "สมรรถนะเฉพาะสำหรับตำแหน่งผู้ตรวจราชการ กทม. และผู้ตรวจราชการ",
},
{
id:'ID6',
name:'สมรรถนะเฉพาะสำหรับตำแหน่งผู้ตรวจราชการ กทม. และผู้ตรวจราชการ',
},
])
]);
const columns = ref<QTableProps["columns"]>([
{
name: "competency",
@ -51,32 +46,30 @@ const columns = ref<QTableProps["columns"]>([
sort: (a: string, b: string) =>
a.localeCompare(b, undefined, { numeric: true, sensitivity: "base" }),
},
])
]);
const $q = useQuasar();
const mixin = useCounterMixin();
const { dialogRemove, messageError, showLoader, hideLoader, success } = mixin;
const competencyType = ref<string>('ID1')
const competencyType = ref<string>("ID1");
const filterKeyword = ref<string>("");
const visibleColumns = ref<string[]>([
"competency",
]);
const visibleColumns = ref<string[]>(["competency"]);
/** ดึงข้อมูล */
async function getData() {
const data = [
{
id:'ID1',
competency:'รายการสมรรถะ 1'
id: "ID1",
competency: "รายการสมรรถะ 1",
},
{
id:'ID2',
competency:'รายการสมรรถะ 2'
id: "ID2",
competency: "รายการสมรรถะ 2",
},
]
rows.value = data
];
rows.value = data;
// showLoader();
// await http
// .get(config.API.orgPrefix)
@ -91,7 +84,7 @@ async function getData() {
}
async function editData(id: string) {
console.log(id)
console.log(id);
// await http
// .put(config.API.orgPrefixId(id), {
// name: prefix.value,
@ -109,7 +102,7 @@ async function editData(id: string) {
}
async function deleteData(id: string) {
console.log(id)
console.log(id);
// await http
// .delete(config.API.orgPrefixId(id))
// .then(() => {
@ -125,8 +118,8 @@ async function deleteData(id: string) {
}
/** เปลี่ยนเป็นหน้าเพิ่มข้อมูล */
function onAdd(){
router.push(`/KPI-competency/add`)
function onAdd() {
router.push(`/KPI-competency/add`);
}
onMounted(async () => {
@ -137,24 +130,18 @@ onMounted(async () => {
<template>
<q-toolbar style="padding: 0">
<q-select
v-model="competencyType"
outlined
label="ประเภทสมรรถนะ"
dense
option-label="name"
option-value="id"
:options="competencyTypeOp"
style="min-width: 200px"
emit-value
map-options
v-model="competencyType"
outlined
label="ประเภทสมรรถนะ"
dense
option-label="name"
option-value="id"
:options="competencyTypeOp"
style="min-width: 200px"
emit-value
map-options
/>
<q-btn
flat
round
color="primary"
icon="add"
@click="onAdd()"
>
<q-btn flat round color="primary" icon="add" @click="onAdd()">
<q-tooltip> เพมขอม </q-tooltip>
</q-btn>
<q-space />

View file

@ -30,18 +30,14 @@ const competencyTypeOp = ref<DataOption[]>([
},
{
id: "ID3",
name: "สมรรถนะประจำกลุ่มงาน",
},
{
id: "ID4",
name: "สมรรถนะประจำผู้บริหารกรุงเทพมหานคร",
},
{
id: "ID5",
id: "ID4",
name: "สมรรถนะเฉพาะสำหรับตำแหน่ง ผอ.เขต ผช.ผอ.เขต และหัวหน้าฝ่ายในสังกัด สนง.เขต",
},
{
id: "ID6",
id: "ID5",
name: "สมรรถนะเฉพาะสำหรับตำแหน่งผู้ตรวจราชการ กทม. และผู้ตรวจราชการ",
},
]);