Refactoring code module 12_organization

This commit is contained in:
STW_TTTY\stwtt 2024-09-10 15:50:23 +07:00
parent 606064c77c
commit 33f23e4fc5

View file

@ -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))