Refactoring code module 12_organization
This commit is contained in:
parent
606064c77c
commit
33f23e4fc5
1 changed files with 6 additions and 6 deletions
|
|
@ -1,19 +1,21 @@
|
||||||
<script setup lang="ts">
|
<script setup lang="ts">
|
||||||
import { ref, computed, onMounted, watch } from "vue";
|
import { ref, onMounted } from "vue";
|
||||||
import { useQuasar } from "quasar";
|
import { useQuasar } from "quasar";
|
||||||
import { useRouter } from "vue-router";
|
import { useRouter } from "vue-router";
|
||||||
|
|
||||||
import http from "@/plugins/http";
|
import http from "@/plugins/http";
|
||||||
import config from "@/app.config";
|
import config from "@/app.config";
|
||||||
import { StructChart } from "structure-chart";
|
import { StructChart } from "structure-chart";
|
||||||
import "structure-chart/structure-chart.css";
|
|
||||||
import { useCounterMixin } from "@/stores/mixin";
|
import { useCounterMixin } from "@/stores/mixin";
|
||||||
|
|
||||||
|
import "structure-chart/structure-chart.css";
|
||||||
|
|
||||||
/** use*/
|
/** use*/
|
||||||
|
const $q = useQuasar();
|
||||||
|
const router = useRouter();
|
||||||
const mixin = useCounterMixin();
|
const mixin = useCounterMixin();
|
||||||
const { showLoader, hideLoader, messageError } = mixin;
|
const { showLoader, hideLoader, messageError } = mixin;
|
||||||
const router = useRouter();
|
|
||||||
const $q = useQuasar();
|
|
||||||
const chartRef = ref(); // อ้างอิงไปที่ตัว chart
|
const chartRef = ref(); // อ้างอิงไปที่ตัว chart
|
||||||
const theBreadcrumb = ref();
|
const theBreadcrumb = ref();
|
||||||
const rootOrgID = ref(); // org id ของ root ตัวปัจจุบันที่เลือกอยู่
|
const rootOrgID = ref(); // org id ของ root ตัวปัจจุบันที่เลือกอยู่
|
||||||
|
|
@ -98,7 +100,6 @@ function savePDF() {
|
||||||
* @param data
|
* @param data
|
||||||
*/
|
*/
|
||||||
async function refreshChart(data: any, type: number) {
|
async function refreshChart(data: any, type: number) {
|
||||||
|
|
||||||
if (data.value === undefined) {
|
if (data.value === undefined) {
|
||||||
fetchStructChart(data, type.toString());
|
fetchStructChart(data, type.toString());
|
||||||
rootOrgID.value = data;
|
rootOrgID.value = data;
|
||||||
|
|
@ -112,7 +113,6 @@ async function fetchStructChart(
|
||||||
type: string,
|
type: string,
|
||||||
status: boolean = false
|
status: boolean = false
|
||||||
) {
|
) {
|
||||||
|
|
||||||
showLoader();
|
showLoader();
|
||||||
await http
|
await http
|
||||||
.get(config.API.orgStructChart(id, type))
|
.get(config.API.orgStructChart(id, type))
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue