<script setup lang="ts">
import { ref, watch, reactive, onMounted } from "vue";
import { useQuasar } from "quasar";

import { useRoute } from "vue-router";
import http from "@/plugins/http";
import config from "@/app.config";
import { useCounterMixin } from "@/stores/mixin";
import { useStructureTree } from "@/stores/structureTree";

import type { QTableProps } from "quasar";
import type {
  OrgTree,
  DataTree,
  PositionMain,
  PositionNo,
  Positions,
  DataPositionNo,
  FormActive,
  TreeMain,
} from "@/interface/request/orgSelect/org";

import DialogHeader from "@/components/DialogHeader.vue";
const props = defineProps({
  dataRows: {
    type: Object,
    require: true,
  },
  onSubmit: Function,
});
const $q = useQuasar();
const route = useRoute();
const storeTree = useStructureTree();
const { fetchStructureTree } = useStructureTree();
const mixin = useCounterMixin();
const {
  dialogConfirm,
  showLoader,
  messageError,
  hideLoader,
  date2Thai,
  dialogMessageNotify,
  onSearchDataTable,
} = mixin;

/** props*/
const modal = defineModel<boolean>("modal", { required: true });
const title = defineModel<string>("title", { required: true });
const type = defineModel<any>("type", { required: true });
const posType = defineModel<any>("posType", { required: true });
const posLevel = defineModel<any>("posLevel", { required: true });
const position = defineModel<any>("position", { required: true });

// const routeName = ref<string>(route?.name);
const orgRevisionId = ref<string>("");
const filter = ref<string>("");
const isAll = ref<boolean>(false);
const isBlank = ref<boolean>(false);
const posMasterMain = ref<any>([]);
const positionNo = ref<DataPositionNo[]>([]);
const rowData = ref<DataPositionNo[]>([]);
const itemTaps = ref<string[]>();
const filters = ref<string>("");
const positionId = ref<string>("");
const selectedPos = ref<any[]>([]);
const seletcId = ref<string>("");
const datePos = ref<Date>(new Date());
const rowsPosition = ref<Positions[]>([]);
const positionData = ref<any[]>([]);
/** active form */
const formActive = reactive<FormActive>({
  activeId: "",
  activeName: "",
  draftId: "",
  draftName: "",
  orgPublishDate: null,
  isPublic: false,
});
/** node */
const nodes = ref<Array<OrgTree>>([]);
const lazy = ref(nodes);
const expanded = ref<string[]>([]);
const nodeLevel = ref<number>(0);
const nodeId = ref<string>(""); // id ของ Tree

/** columns*/
const columns = ref<QTableProps["columns"]>([
  {
    name: "isPosition",
    align: "left",
    label: "",
    sortable: true,
    field: "isPosition",
    headerStyle: "font-size: 14px",
    style: "font-size: 14px",
  },
  {
    name: "no",
    align: "left",
    label: "ลำดับ",
    sortable: true,
    field: "no",
    headerStyle: "font-size: 14px",
    style: "font-size: 14px",
  },
  {
    name: "posMasterNo",
    align: "left",
    label: "ตำแหน่งเลขที่",
    sortable: true,
    field: "posMasterNo",
    headerStyle: "font-size: 14px",
    style: "font-size: 14px",
  },
  {
    name: "positionName",
    align: "left",
    label: "ตำแหน่งในสายงาน",
    field: "positionName",
    sortable: true,
    headerStyle: "font-size: 14px",
    style: "font-size: 14px",
  },
  {
    name: "posTypeName",
    align: "left",
    label: "ประเภทตำแหน่ง",
    sortable: true,
    field: "posTypeName",
    headerStyle: "font-size: 14px",
    style: "font-size: 14px",
  },
  {
    name: "posLevelName",
    align: "left",
    label: "ระดับตำแหน่ง",
    sortable: true,
    field: "posLevelName",
    headerStyle: "font-size: 14px",
    style: "font-size: 14px",
  },
  {
    name: "positionIsSelected",
    align: "left",
    label: "คนครอง",
    sortable: true,
    field: "positionIsSelected",
    headerStyle: "font-size: 14px",
    style: "font-size: 14px",
  },
]);
const columnsPostition = ref<QTableProps["columns"]>([
  {
    name: "no",
    align: "left",
    label: "ลำดับ",
    sortable: false,
    field: "no",
    headerStyle: "font-size: 14px",
    style: "font-size: 14px",
  },
  {
    name: "positionName",
    align: "left",
    label: "ตำแหน่งในสายงาน",
    sortable: true,
    field: "positionName",
    headerStyle: "font-size: 14px",
    style: "font-size: 14px",
  },
  {
    name: "positionField",
    align: "left",
    label: "สายงาน",
    sortable: true,
    field: "positionField",
    headerStyle: "font-size: 14px",
    style: "font-size: 14px",
  },
  {
    name: "posTypeName",
    align: "left",
    label: "ประเภทตำเเหน่ง",
    sortable: true,
    field: "posTypeName",
    headerStyle: "font-size: 14px",
    style: "font-size: 14px",
  },
  {
    name: "posLevelName",
    align: "left",
    label: "ระดับตำแหน่ง",
    sortable: true,
    field: "posLevelName",
    headerStyle: "font-size: 14px",
    style: "font-size: 14px",
  },
  {
    name: "posExecutiveName",
    align: "left",
    label: "ตำแหน่งทางการบริหาร",
    sortable: true,
    field: "posExecutiveName",
    headerStyle: "font-size: 14px",
    style: "font-size: 14px",
  },
  {
    name: "positionExecutiveField",
    align: "left",
    label: "ด้านทางการบริหาร",
    sortable: true,
    field: "positionExecutiveField",
    headerStyle: "font-size: 14px",
    style: "font-size: 14px",
  },
  {
    name: "positionArea",
    align: "left",
    label: "ด้าน/สาขา",
    sortable: true,
    field: "positionArea",
    headerStyle: "font-size: 14px",
    style: "font-size: 14px",
  },
]);
const visibleColumns = ref<string[]>([
  "isPosition",
  "no",
  "posMasterNo",
  "positionName",
  "posTypeName",
  "posLevelName",
  "positionIsSelected",
]);

/** ปิด dialog */
function close() {
  modal.value = false;
  type.value = null;
  filter.value = "";
  isAll.value = false;
  isBlank.value = false;
  expanded.value = [];
  nodeLevel.value = 0;
  nodeId.value = "";
}

async function getDataTable(id: string, level: number = 0) {
  showLoader();
  const body = {
    node: level,
    nodeId: id,
    typeCommand: type.value,
    position: position.value ? position.value : "",
    posLevel: posLevel.value ? posLevel.value : "",
    posType: posType.value ? posType.value : "",
    isAll: isAll.value,
    isBlank: isBlank.value,
  };

  await http
    .post(config.API.orgPosPlacement, body)
    .then((res) => {
      const dataMain: PositionMain[] = [];
      posMasterMain.value = res.data.result.data;

      res.data.result.data.forEach((e: PositionNo) => {
        const p = e.positions;
        if (p.length !== 0) {
          const a = p.find((el: Positions) => el.positionIsSelected === true);
          const { id, ...rest } = a ? a : p[0];
          const data: any = { ...e, ...rest };
          dataMain.push(data);
        }
      });
      const listPosNo: DataPositionNo[] = dataMain.map((e: PositionMain) => ({
        id: e.id,
        isPosition: e.isPosition,
        posMasterNo:
          e.orgShortname +
          (e.posMasterNoPrefix != null ? e.posMasterNoPrefix : "") +
          " " +
          e.posMasterNo +
          (e.posMasterNoSuffix != null ? e.posMasterNoSuffix : ""),
        positionName: e.positionName,
        posTypeName: e.posTypeName,
        posLevelName: e.posLevelName,
        positionIsSelected: e.fullNameCurrentHolder
          ? e.fullNameCurrentHolder
          : "-",
        isSit: e.isSit,
        positions: e.positions,
        node: e.node,
        nodeId: e.nodeId,
        isCondition: e.isCondition,
        isDirector: e.isDirector,
      }));

      positionNo.value = listPosNo;
      rowData.value = listPosNo;
      // positionData.value = listPosNo;

      if (props.dataRows?.posmasterId) {
        const newUse = positionUse.value.filter(
          (e) => e !== props.dataRows?.posmasterId
        );
        positionData.value = listPosNo.filter(
          (e: any) => !newUse.includes(e.id)
        );
      } else {
        positionData.value = listPosNo.filter(
          (e: any) => !positionUse.value.includes(e.id)
        );
      }
    })
    .catch((err) => {
      messageError($q, err);
    })
    .finally(() => {
      setTimeout(() => {
        hideLoader();
      }, 1000);
    });
}

/**
 * funtion เลือกข้อมูล Tree
 * @param data ข่อมูล Tree
 */
function updateSelected(data: DataTree) {
  if (props?.dataRows?.nodeId === data.orgTreeId) {
    positionId.value = props?.dataRows?.posmasterId;
    seletcId.value = props?.dataRows?.positionId;
    datePos.value = props?.dataRows?.reportingDate;
  } else {
    positionId.value = "";
    seletcId.value = "";
    selectedPos.value = [];
    datePos.value = new Date();
  }

  nodeId.value = data.orgTreeId ? data.orgTreeId : "";
  nodeLevel.value = data.orgLevel;
  getDataTable(data.orgTreeId, data.orgLevel);
}

/** ดึงข้อมูล active */
async function fetchTree() {
  const dataTree = await fetchStructureTree(route.meta.Key as string);
  if (dataTree) {
    formActive.activeId = storeTree.activeId;
    nodes.value = dataTree;
    filterItemsTaps(dataTree);
  }
}

function filterItemsTaps(data: TreeMain[]) {
  let orgTreeIds: string[] = [];
  for (const child of data) {
    orgTreeIds.push(child.orgTreeId);
    if (child.children) {
      orgTreeIds = orgTreeIds.concat(filterItemsTaps(child.children));
    }
  }
  itemTaps.value = orgTreeIds;
  return orgTreeIds;
}

/**
 * function เลือกตำแหน่งเลขที่
 * @param id เลชที่ตำแหน่ง
 */
async function onClickSelectPos(id: string) {
  positionData.value = positionNo.value;
  positionId.value = id;
  selectedPos.value = [];
  const position: DataPositionNo = positionData.value.find(
    (e: DataPositionNo) => e.id === id
  );

  // หาตำแหน่ง
  if (position) {
    rowsPosition.value = position.positions;
    if (seletcId.value) {
      selectedPos.value = rowsPosition.value.filter(
        (e) => e.id === seletcId.value
      );
    }
  }
}

/**
 * function fetch ข้อมูล expanded tree
 * @param level levelTree
 * @param id treeId
 */
async function fetchPosFind(level: number, id: string) {
  showLoader();
  const body = {
    node: level,
    nodeId: id,
  };
  await http
    .post(config.API.orgPosFind, body)
    .then((res) => {
      const data = res.data.result;
      expanded.value = data;
      nodeId.value = id;
      positionId.value = props?.dataRows?.posmasterId;
      seletcId.value = props?.dataRows?.positionId;
      datePos.value = props?.dataRows?.reportingDate;

      getDataTable(nodeId.value, level);
    })
    .catch((e) => {
      messageError($q, e);
      hideLoader();
    });
}

watch(
  () => modal.value,
  async (n) => {
    if (n == true) {
      fetchPositionUes();

      if (props?.dataRows?.node !== null && props?.dataRows?.nodeId !== null) {
        await fetchPosFind(props?.dataRows?.node, props?.dataRows?.nodeId);
        if (positionId.value) {
          setTimeout(async () => {
            await onClickSelectPos(positionId.value);
          }, 200);
        }
      } else {
        expanded.value = [];
      }
    }
  }
);

const positionUse = ref<string[]>([]);
function fetchPositionUes() {
  const URL =
    route.name === "appoint-promote"
      ? config.API.apppointmentPosition()
      : route.name === "receive"
      ? config.API.receiveDataPosition()
      : route.name === "other"
      ? config.API.otherPositionUse()
      : null;
  if (URL) {
    http
      .get(URL)
      .then((res) => {
        positionUse.value = res.data.result;
      })
      .catch((err) => {
        messageError($q, err);
      });
  }
}

watch(
  () => isAll.value,
  (value, oldVal) => {
    if (value !== oldVal) {
      getDataTable(nodeId.value, nodeLevel.value);
    }
  }
);

watch(
  () => isBlank.value,
  (value, oldVal) => {
    if (value !== oldVal) {
      getDataTable(nodeId.value, nodeLevel.value);
    }
  }
);

watch(
  () => positionId.value,
  (n) => {
    if (n) {
      onClickSelectPos(n);
    }
  }
);
function onSubmit() {
  const dataPosMaster = posMasterMain.value?.find(
    (e: any) => e.id === positionId.value
  );
  if (selectedPos.value.length === 0) {
    dialogMessageNotify($q, "กรุณาเลือกตำแหน่ง");
  } else {
    dialogConfirm($q, async () => {
      const body = {
        personalId: props?.dataRows?.id,
        node: dataPosMaster.node,
        nodeId: dataPosMaster.nodeId,
        orgRevisionId: formActive.activeId,
        positionId: selectedPos.value[0].id,
        posMasterNo: dataPosMaster.posMasterNo, //ตำแหน่งเลขที่(เลขอย่่างเดียว)
        positionName: selectedPos.value[0].positionName, //ชื่อตำแหน่ง
        positionField: selectedPos.value[0].positionField, //ชื่อตำแหน่ง
        posTypeId: selectedPos.value[0].posTypeId, //ชื่อตำแหน่ง
        posTypeName: selectedPos.value[0].posTypeName, //ชื่อตำแหน่ง
        posLevelId: selectedPos.value[0].posLevelId, //ชื่อตำแหน่ง
        posLevelName: selectedPos.value[0].posLevelName, //ชื่อตำแหน่ง
        posExecutiveName: selectedPos.value[0].posExecutiveName, //ชื่อตำแหน่ง
        reportingDate: datePos.value,
        posmasterId: dataPosMaster.id,
        typeCommand: type.value,
        positionExecutiveField: selectedPos.value[0].positionExecutiveField, //ด้านทางการบริหาร
        positionArea: selectedPos.value[0].positionArea, //ด้าน/สาขา
      };

      await props.onSubmit?.(body);
      close();
    });
  }
}

function onSearch() {
  positionNo.value = onSearchDataTable(
    filters.value,
    rowData.value,
    columns.value ? columns.value : []
  );
}

onMounted(async () => {
  await fetchTree();
});
</script>
<template>
  <q-dialog v-model="modal" persistent full-width>
    <q-card class="no-scroll">
      <DialogHeader :tittle="title" :close="close" />
      <q-separator />
      <q-card-section style="max-height: 80vh">
        <div class="row">
          <q-card
            bordered
            class="col-12 col-sm-3 scroll q-pa-sm"
            style="height: 75vh"
          >
            <q-toolbar style="padding: 0">
              <q-toolbar-title class="text-subtitle2 text-bold"
                >เลือกหน่วยงาน/ส่วนราชการ</q-toolbar-title
              >
            </q-toolbar>

            <q-input dense outlined v-model="filter" label="ค้นหา">
              <template v-slot:append>
                <q-icon
                  v-if="filter !== ''"
                  name="clear"
                  class="cursor-pointer"
                  @click="filter = ''"
                />
              </template>
            </q-input>
            <q-tree
              class="q-pa-sm q-gutter-sm"
              dense
              :nodes="lazy"
              node-key="orgTreeId"
              label-key="labelName"
              :filter="filter"
              no-results-label="ไม่พบข้อมูลที่ค้นหา"
              no-nodes-label="ไม่มีข้อมูล"
              v-model:expanded="expanded"
            >
              <template v-slot:default-header="prop">
                <q-item
                  @click.stop="updateSelected(prop.node)"
                  clickable
                  :active="nodeId == prop.node.orgTreeId"
                  active-class="my-list-link text-primary text-weight-medium"
                  class="row col-12 items-center text-dark q-py-xs q-pl-sm rounded-borders my-list"
                >
                  <div>
                    <div class="text-weight-medium">
                      {{ prop.node.orgTreeName }}
                    </div>
                    <div class="text-weight-light">
                      {{ prop.node.orgCode == null ? null : prop.node.orgCode }}
                      {{
                        prop.node.orgTreeShortName == null
                          ? null
                          : prop.node.orgTreeShortName
                      }}
                    </div>
                  </div>
                </q-item>
              </template>
            </q-tree>
          </q-card>

          <q-card
            bordered
            style="height: 75vh"
            class="col-12 col-sm-9 q-pa-sm scroll"
          >
            <q-tab-panels
              v-model="nodeId"
              animated
              transition-prev="jump-up"
              transition-next="jump-up"
            >
              <q-tab-panel
                v-for="(item, index) in itemTaps"
                :key="index"
                :name="item"
              >
                <div class="column q-col-gutter-sm">
                  <!-- เลือกตำแหน่งเลขที่ -->
                  <div class="col-7">
                    <q-card
                      bordered
                      style="height: 100%; border: 1px solid #d6dee1"
                    >
                      <div
                        class="col-12 text-weight-medium bg-grey-1 q-py-sm q-px-md"
                      >
                        เลือกตำแหน่งเลขที่
                      </div>
                      <div class="col-12"><q-separator /></div>
                      <div class="col-12 q-pa-md">
                        <q-toolbar style="padding: 0px">
                          <div class="row q-gutter-sm">
                            <q-checkbox
                              keep-color
                              v-model="isBlank"
                              label="แสดงเฉพาะตำแหน่งว่าง"
                              color="primary"
                            >
                              <q-tooltip>แสดงเฉพาะตำแหน่งว่าง </q-tooltip>
                            </q-checkbox>
                          </div>
                          <q-space />

                          <div class="row q-gutter-sm">
                            <q-checkbox
                              keep-color
                              v-model="isAll"
                              label="แสดงตำแหน่งทั้งหมด"
                              color="primary"
                            >
                              <q-tooltip
                                >แสดงตำแหน่งทั้งหมดภายใต้หน่วยงาน/ส่วนราชการที่เลือก</q-tooltip
                              >
                            </q-checkbox>
                            <div>
                              <q-input
                                outlined
                                dense
                                v-model="filters"
                                label="ค้นหา"
                                @keydown.enter.prevent="onSearch"
                              >
                                <template v-slot:append>
                                  <q-icon name="search" />
                                </template>
                              </q-input>
                            </div>
                            <div>
                              <q-select
                                v-model="visibleColumns"
                                multiple
                                outlined
                                dense
                                options-dense
                                emit-value
                                :display-value="$q.lang.table.columns"
                                map-options
                                :options="columns"
                                option-value="name"
                                style="min-width: 140px"
                              />
                            </div>
                          </div>
                        </q-toolbar>
                        <d-table
                          ref="table"
                          :columns="columns"
                          :rows="positionNo"
                          row-key="id"
                          flat
                          bordered
                          :paging="true"
                          dense
                          :rows-per-page-options="[10, 25, 50, 100]"
                          class="tableTb"
                          :visible-columns="visibleColumns"
                        >
                          <template v-slot:header="props">
                            <q-tr :props="props">
                              <q-th
                                v-for="col in props.cols"
                                :key="col.name"
                                :props="props"
                              >
                                <span class="text-weight-medium">{{
                                  col.label
                                }}</span>
                              </q-th>
                            </q-tr>
                          </template>
                          <template v-slot:body="props">
                            <q-tr :props="props" class="cursor-pointer">
                              <q-td
                                v-for="col in props.cols"
                                :key="col.name"
                                :props="props"
                                @click="onClickSelectPos(props.row.id)"
                                :class="{
                                  'text-red': props.row.isCondition === true,
                                  'bg-blue-2': props.row.id === positionId,
                                }"
                              >
                                <div v-if="col.name == 'no'">
                                  {{ props.rowIndex + 1 }}
                                </div>
                                <div v-else-if="col.name === 'posMasterNo'">
                                  {{
                                    props.row.isSit
                                      ? col.value + " " + "(ทับที่)"
                                      : col.value
                                  }}
                                  <q-icon
                                    name="mdi-star"
                                    color="primary"
                                    v-if="props.row.isDirector"
                                  >
                                    <q-tooltip>ผู้อำนวยการ/หัวหน้า</q-tooltip>
                                  </q-icon>
                                </div>
                                <div v-else-if="col.name === 'isPosition'">
                                  <div v-if="col.value">
                                    <q-icon
                                      name="done"
                                      color="primary"
                                      size="24px"
                                    >
                                      <q-tooltip>ตรงตามตำแหน่ง </q-tooltip>
                                    </q-icon>
                                  </div>
                                </div>

                                <div v-else>
                                  {{ col.value ? col.value : "-" }}
                                </div>
                              </q-td>
                            </q-tr>
                          </template>
                        </d-table>
                      </div>
                    </q-card>
                  </div>

                  <!-- เลือกตำแหน่ง -->
                  <div class="col-5">
                    <q-card
                      bordered
                      style="min-height: 30vh; border: 1px solid #d6dee1"
                    >
                      <div
                        class="col-12 text-weight-medium bg-grey-1 q-py-sm q-px-md"
                      >
                        เลือกตำแหน่ง
                      </div>
                      <div class="col-12"><q-separator /></div>
                      <q-tab-panels
                        v-model="positionId"
                        animated
                        swipeable
                        vertical
                        transition-prev="jump-up"
                        transition-next="jump-up"
                      >
                        <q-tab-panel
                          v-for="(item, index) in positionData"
                          :key="index"
                          :name="item.id"
                        >
                          <div class="col-12">
                            <q-toolbar style="padding: 0px">
                              <datepicker
                                menu-class-name="modalfix"
                                v-model="datePos"
                                :locale="'th'"
                                autoApply
                                borderless
                                :enableTimePicker="false"
                                week-start="0"
                                :min-date="datePos"
                              >
                                <template #year="{ year }">
                                  {{ year + 543 }}
                                </template>
                                <template #year-overlay-value="{ value }">
                                  {{ parseInt(value + 543) }}
                                </template>
                                <template #trigger>
                                  <q-input
                                    ref="dateRef"
                                    outlined
                                    dense
                                    hide-bottom-space
                                    :model-value="
                                      datePos != null
                                        ? date2Thai(datePos)
                                        : null
                                    "
                                    label="วันที่รายงานตัว"
                                  >
                                    <template v-slot:prepend>
                                      <q-icon
                                        name="event"
                                        class="cursor-pointer"
                                        style="color: var(--q-primary)"
                                      >
                                      </q-icon>
                                    </template>
                                  </q-input>
                                </template>
                              </datepicker>
                            </q-toolbar>
                            <d-table
                              ref="table"
                              :columns="columnsPostition"
                              :rows="rowsPosition"
                              row-key="id"
                              flat
                              bordered
                              :paging="true"
                              dense
                              :rows-per-page-options="[10, 25, 50, 100]"
                              class="tableTb"
                              selection="single"
                              v-model:selected="selectedPos"
                            >
                              <template v-slot:header-selection="scope">
                                <q-checkbox
                                  keep-color
                                  color="primary"
                                  dense
                                  v-model="scope.checkBox"
                                />
                              </template>
                              <template v-slot:header="props">
                                <q-tr :props="props">
                                  <q-th auto-width />
                                  <q-th
                                    v-for="col in props.cols"
                                    :key="col.name"
                                    :props="props"
                                  >
                                    <span class="text-weight-medium">{{
                                      col.label
                                    }}</span>
                                  </q-th>
                                </q-tr>
                              </template>
                              <template v-slot:body="props">
                                <q-tr :props="props">
                                  <q-td>
                                    <q-checkbox
                                      keep-color
                                      color="primary"
                                      dense
                                      v-model="props.selected"
                                    />
                                  </q-td>
                                  <q-td
                                    v-for="col in props.cols"
                                    :key="col.name"
                                    :props="props"
                                  >
                                    <div v-if="col.name == 'no'">
                                      {{ props.rowIndex + 1 }}
                                    </div>
                                    <div v-else-if="col.name === 'posMasterNo'">
                                      {{
                                        props.row.isSit
                                          ? col.value + " " + "(ทับที่)"
                                          : col.value
                                      }}
                                    </div>
                                    <div
                                      v-else-if="col.name === 'positionArea'"
                                      class="table_ellipsis"
                                    >
                                      {{
                                        props.row.positionArea
                                          ? props.row.positionArea
                                          : "-"
                                      }}
                                    </div>

                                    <div v-else>
                                      {{ col.value ? col.value : "-" }}
                                    </div>
                                  </q-td>
                                </q-tr>
                              </template>
                            </d-table>
                          </div>
                        </q-tab-panel>
                      </q-tab-panels>
                    </q-card>
                  </div>
                </div>
              </q-tab-panel>
            </q-tab-panels>
          </q-card>
        </div>
      </q-card-section>
      <q-separator />

      <q-card-actions align="right" class="bg-white text-teal">
        <q-btn label="บันทึก" color="secondary" type="submit" @click="onSubmit"
          ><q-tooltip>บันทึกข้อมูล</q-tooltip></q-btn
        >
      </q-card-actions>
    </q-card>
  </q-dialog>
</template>
<style scoped>
.my-list-link {
  color: rgb(118, 168, 222);
  border-radius: 5px;
  background: #a3d3fb48 !important;
  font-weight: 600;
  border: 1px solid rgba(175, 185, 196, 0.217);
}
</style>
