mirror of
https://github.com/ccmjga/zhilu-admin
synced 2026-04-16 23:53:39 +00:00
fix undefined
This commit is contained in:
@@ -289,22 +289,30 @@ onMounted(async () => {
|
|||||||
initFlowbite();
|
initFlowbite();
|
||||||
const $upsertModalElement: HTMLElement | null =
|
const $upsertModalElement: HTMLElement | null =
|
||||||
document.querySelector("#user-upsert-modal");
|
document.querySelector("#user-upsert-modal");
|
||||||
userUpsertModal.value = new Modal($upsertModalElement, {});
|
if ($upsertModalElement) {
|
||||||
|
userUpsertModal.value = new Modal($upsertModalElement, {});
|
||||||
|
}
|
||||||
const $userDeleteModalElement: HTMLElement | null =
|
const $userDeleteModalElement: HTMLElement | null =
|
||||||
document.querySelector("#user-delete-modal");
|
document.querySelector("#user-delete-modal");
|
||||||
userDeleteModal.value = new Modal(
|
if ($userDeleteModalElement) {
|
||||||
$userDeleteModalElement,
|
userDeleteModal.value = new Modal(
|
||||||
{},
|
$userDeleteModalElement,
|
||||||
{
|
{},
|
||||||
id: "user-delete-modal",
|
{
|
||||||
},
|
id: "user-delete-modal",
|
||||||
);
|
},
|
||||||
|
);
|
||||||
|
}
|
||||||
const $departmentDeleteModalElement: HTMLElement | null =
|
const $departmentDeleteModalElement: HTMLElement | null =
|
||||||
document.querySelector("#department-delete-modal");
|
document.querySelector("#department-delete-modal");
|
||||||
departmentDeleteModal.value = new Modal($departmentDeleteModalElement, {});
|
if ($departmentDeleteModalElement) {
|
||||||
|
departmentDeleteModal.value = new Modal($departmentDeleteModalElement, {});
|
||||||
|
}
|
||||||
const $departmentUpsertModalElement: HTMLElement | null =
|
const $departmentUpsertModalElement: HTMLElement | null =
|
||||||
document.querySelector("#department-upsert-modal");
|
document.querySelector("#department-upsert-modal");
|
||||||
departmentUpsertModal.value = new Modal($departmentUpsertModalElement, {});
|
if ($departmentUpsertModalElement) {
|
||||||
|
departmentUpsertModal.value = new Modal($departmentUpsertModalElement, {});
|
||||||
|
}
|
||||||
});
|
});
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
|
|||||||
@@ -194,11 +194,9 @@ onMounted(async () => {
|
|||||||
const $bindModalElement: HTMLElement | null = document.querySelector(
|
const $bindModalElement: HTMLElement | null = document.querySelector(
|
||||||
"#department-bind-modal",
|
"#department-bind-modal",
|
||||||
);
|
);
|
||||||
departmentBindModal.value = new Modal(
|
if ($bindModalElement) {
|
||||||
$bindModalElement,
|
departmentBindModal.value = new Modal($bindModalElement, {});
|
||||||
{},
|
}
|
||||||
{ id: "department-bind-modal" },
|
|
||||||
);
|
|
||||||
const $unbindModalElement: HTMLElement | null = document.querySelector(
|
const $unbindModalElement: HTMLElement | null = document.querySelector(
|
||||||
"#department-unbind-modal",
|
"#department-unbind-modal",
|
||||||
);
|
);
|
||||||
|
|||||||
@@ -194,11 +194,9 @@ onMounted(async () => {
|
|||||||
const $bindModalElement: HTMLElement | null = document.querySelector(
|
const $bindModalElement: HTMLElement | null = document.querySelector(
|
||||||
"#permission-bind-modal",
|
"#permission-bind-modal",
|
||||||
);
|
);
|
||||||
permissionBindModal.value = new Modal(
|
if ($bindModalElement) {
|
||||||
$bindModalElement,
|
permissionBindModal.value = new Modal($bindModalElement, {});
|
||||||
{},
|
}
|
||||||
{ id: "permission-bind-modal" },
|
|
||||||
);
|
|
||||||
const $unbindModalElement: HTMLElement | null = document.querySelector(
|
const $unbindModalElement: HTMLElement | null = document.querySelector(
|
||||||
"#permission-unbind-modal",
|
"#permission-unbind-modal",
|
||||||
);
|
);
|
||||||
|
|||||||
@@ -184,11 +184,9 @@ onMounted(async () => {
|
|||||||
const $bindModalElement: HTMLElement | null = document.querySelector(
|
const $bindModalElement: HTMLElement | null = document.querySelector(
|
||||||
"#position-bind-modal",
|
"#position-bind-modal",
|
||||||
);
|
);
|
||||||
positionBindModal.value = new Modal(
|
if ($bindModalElement) {
|
||||||
$bindModalElement,
|
positionBindModal.value = new Modal($bindModalElement, {});
|
||||||
{},
|
}
|
||||||
{ id: "position-bind-modal" },
|
|
||||||
);
|
|
||||||
const $unbindModalElement: HTMLElement | null = document.querySelector(
|
const $unbindModalElement: HTMLElement | null = document.querySelector(
|
||||||
"#position-unbind-modal",
|
"#position-unbind-modal",
|
||||||
);
|
);
|
||||||
|
|||||||
@@ -187,11 +187,9 @@ onMounted(async () => {
|
|||||||
initFlowbite();
|
initFlowbite();
|
||||||
const $bindModalElement: HTMLElement | null =
|
const $bindModalElement: HTMLElement | null =
|
||||||
document.querySelector("#role-bind-modal");
|
document.querySelector("#role-bind-modal");
|
||||||
roleBindModal.value = new Modal(
|
if ($bindModalElement) {
|
||||||
$bindModalElement,
|
roleBindModal.value = new Modal($bindModalElement, {});
|
||||||
{},
|
}
|
||||||
{ id: "role-bind-modal" },
|
|
||||||
);
|
|
||||||
const $unbindModalElement: HTMLElement | null =
|
const $unbindModalElement: HTMLElement | null =
|
||||||
document.querySelector("#role-unbind-modal");
|
document.querySelector("#role-unbind-modal");
|
||||||
roleUnbindModal.value = new Modal(
|
roleUnbindModal.value = new Modal(
|
||||||
|
|||||||
@@ -154,8 +154,12 @@ onMounted(async () => {
|
|||||||
const $deleteModalElement: HTMLElement | null = document.querySelector(
|
const $deleteModalElement: HTMLElement | null = document.querySelector(
|
||||||
"#department-delete-modal",
|
"#department-delete-modal",
|
||||||
);
|
);
|
||||||
departmentUpsertModal.value = new Modal($upsertModalElement, {});
|
if ($upsertModalElement) {
|
||||||
departmentDeleteModal.value = new Modal($deleteModalElement, {});
|
departmentUpsertModal.value = new Modal($upsertModalElement, {});
|
||||||
|
}
|
||||||
|
if ($deleteModalElement) {
|
||||||
|
departmentDeleteModal.value = new Modal($deleteModalElement, {});
|
||||||
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
const handleUpsertDepartmentSubmit = async (
|
const handleUpsertDepartmentSubmit = async (
|
||||||
|
|||||||
@@ -167,8 +167,9 @@ onMounted(async () => {
|
|||||||
initFlowbite();
|
initFlowbite();
|
||||||
const $llmUpdateModalElement: HTMLElement | null =
|
const $llmUpdateModalElement: HTMLElement | null =
|
||||||
document.querySelector("#llm-update-modal");
|
document.querySelector("#llm-update-modal");
|
||||||
|
if ($llmUpdateModalElement) {
|
||||||
llmUpdateModal.value = new Modal($llmUpdateModalElement, {});
|
llmUpdateModal.value = new Modal($llmUpdateModalElement, {});
|
||||||
|
}
|
||||||
});
|
});
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
|
|||||||
@@ -148,8 +148,12 @@ onMounted(async () => {
|
|||||||
const $deleteModalElement: HTMLElement | null = document.querySelector(
|
const $deleteModalElement: HTMLElement | null = document.querySelector(
|
||||||
"#permission-delete-modal",
|
"#permission-delete-modal",
|
||||||
);
|
);
|
||||||
permissionUpsertModal.value = new Modal($upsertModalElement, {});
|
if ($upsertModalElement) {
|
||||||
permissionDeleteModal.value = new Modal($deleteModalElement, {});
|
permissionUpsertModal.value = new Modal($upsertModalElement, {});
|
||||||
|
}
|
||||||
|
if ($deleteModalElement) {
|
||||||
|
permissionDeleteModal.value = new Modal($deleteModalElement, {});
|
||||||
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
const handleUpsertModalSubmit = async (data: PermissionUpsertModel) => {
|
const handleUpsertModalSubmit = async (data: PermissionUpsertModel) => {
|
||||||
|
|||||||
@@ -116,7 +116,6 @@ import TablePagination from "@/components/TablePagination.vue";
|
|||||||
import usePositionDelete from "@/composables/position/usePositionDelete";
|
import usePositionDelete from "@/composables/position/usePositionDelete";
|
||||||
import { usePositionQuery } from "@/composables/position/usePositionQuery";
|
import { usePositionQuery } from "@/composables/position/usePositionQuery";
|
||||||
import { usePositionUpsert } from "@/composables/position/usePositionUpsert";
|
import { usePositionUpsert } from "@/composables/position/usePositionUpsert";
|
||||||
import { RouteName } from "@/router/constants";
|
|
||||||
import { Modal, type ModalInterface, initFlowbite } from "flowbite";
|
import { Modal, type ModalInterface, initFlowbite } from "flowbite";
|
||||||
import { nextTick, onMounted, ref } from "vue";
|
import { nextTick, onMounted, ref } from "vue";
|
||||||
import type { components } from "../api/types/schema";
|
import type { components } from "../api/types/schema";
|
||||||
@@ -147,8 +146,12 @@ onMounted(async () => {
|
|||||||
const $deleteModalElement: HTMLElement | null = document.querySelector(
|
const $deleteModalElement: HTMLElement | null = document.querySelector(
|
||||||
"#position-delete-modal",
|
"#position-delete-modal",
|
||||||
);
|
);
|
||||||
positionUpsertModal.value = new Modal($upsertModalElement, {});
|
if ($upsertModalElement) {
|
||||||
positionDeleteModal.value = new Modal($deleteModalElement, {});
|
positionUpsertModal.value = new Modal($upsertModalElement, {});
|
||||||
|
}
|
||||||
|
if ($deleteModalElement) {
|
||||||
|
positionDeleteModal.value = new Modal($deleteModalElement, {});
|
||||||
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
const handleUpsertPositionSubmit = async (
|
const handleUpsertPositionSubmit = async (
|
||||||
|
|||||||
@@ -274,10 +274,15 @@ onMounted(async () => {
|
|||||||
document.querySelector("#job-pause-modal");
|
document.querySelector("#job-pause-modal");
|
||||||
const $jobUpdateModalElement: HTMLElement | null =
|
const $jobUpdateModalElement: HTMLElement | null =
|
||||||
document.querySelector("#job-update-modal");
|
document.querySelector("#job-update-modal");
|
||||||
|
if ($jobResumeModalElement) {
|
||||||
jobResumeModal.value = new Modal($jobResumeModalElement, {});
|
jobResumeModal.value = new Modal($jobResumeModalElement, {});
|
||||||
jobPauseModal.value = new Modal($jobPauseModalElement, {});
|
}
|
||||||
jobUpdateModal.value = new Modal($jobUpdateModalElement, {});
|
if ($jobPauseModalElement) {
|
||||||
|
jobPauseModal.value = new Modal($jobPauseModalElement, {});
|
||||||
|
}
|
||||||
|
if ($jobUpdateModalElement) {
|
||||||
|
jobUpdateModal.value = new Modal($jobUpdateModalElement, {});
|
||||||
|
}
|
||||||
});
|
});
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user