import { V as re, bk as ne, r as d, d as $e, f as Ae, aj as oe, a4 as K, a as Be, aw as Oe, c as L, o as v, w as t, j as l, W as We, ao as ze, h as S, F as q, a9 as O, l as n, ap as Ve, p as h, A as f, t as je, U as Ge, D as R, k as Qe, cb as Xe, c8 as Ye, H as Ze, c9 as Je, aE as et, aH as tt, hr as at, i as g, N as ot, i6 as lt, S as st, ak as rt, aF as nt, B as it, aI as ut, X as pt, cZ as mt, ac as ct, __tla as __tla_0 } from "./index-9PRMimni.js";
import { _ as dt, __tla as __tla_1 } from "./SelectDataModal.vue_vue_type_script_setup_true_lang-Cjrrh7uO.js";
import { _ as vt } from "./LuckySheet.vue_vue_type_style_index_0_lang-C6fooT_k.js";
import { u as le } from "./account-C850CBTF.js";
import { e as ft, h as _t, s as yt, i as ht } from "./workpermit-ycq2YJDA.js";
import { h as gt } from "./smsFormsTemplate-Dsea_L5v.js";
import { a as wt } from "./planner-BebmniHR.js";
import { N as kt, A as bt, z as St } from "./template-rpthWlT9.js";
import { _ as Tt } from "./rejectModal.vue_vue_type_script_setup_true_lang-KCtZZHCu.js";
import "./basicModal.vue_vue_type_style_index_0_lang-8QZP7ApW.js";
import "./ImageUpload.vue_vue_type_style_index_0_scoped_cb086928_lang-D-28kXvw.js";
import "./vuedraggable.umd-Co2xEC3p.js";
import "./BasicUpload.vue_vue_type_style_index_0_scoped_a4d0e930_lang-DxRbtP01.js";
import "./BasicForm.vue_vue_type_style_index_0_scoped_b9e995ec_lang-CEvcLwxD.js";
import "./BasicSelect.vue_vue_type_style_index_0_scoped_772d51cc_lang-Brp6PjEU.js";
import "./index-DkvzUEqh.js";
import { u as qt } from "./useTags-C1thGhjF.js";
import { __tla as __tla_2 } from "./index.vue_vue_type_style_index_0_scoped_b974e5ec_lang-_0QwzFKM.js";
import "./Table.vue_vue_type_style_index_0_scoped_7b9e6ece_lang-BoW2DV_e.js";
import "./print-CT_2hrjP.js";
import { H as Rt, __tla as __tla_3 } from "./index-8tHZJCCW.js";
import "./schemas-BmKi-UM9.js";
import "./props-CLtNejQT.js";
import { _ as Pt } from "./FormItemGridItem-CDUF0EA0.js";
import "./basicModal.vue_vue_type_script_setup_true_lang-CsJydKhW.js";
import "./Table-0PViRYCf.js";
import "./useModal-CO65vga3.js";
import "./componentSetting-DVhNDBTO.js";
import "./useTimeout-BxFilWvD.js";
import "./usePageCache-DluHn7Yy.js";
import "./tabsView-BXskTdVh.js";
import "./Flex-CTSf12gq.js";
import "./BasicForm-dL_oCSPM.js";
import "./Render.vue_vue_type_script_lang-DKUYY0Zw.js";
import "./SingleImageUpload-CNx4b9eC.js";
import "./ImageUpload-DUsnro3W.js";
import "./BasicSelect-C_uwzMkE.js";
import "./dictionary-BRse4lkf.js";
import "./AutoComplete-Dv1Bqed4.js";
import "./TreeSelect-BZh2DeCh.js";
import "./useForm-CKmgcynv.js";
import { __tla as __tla_4 } from "./schemas-DEsCEng-.js";
import "./dateUtil-BtafrT1f.js";
import "./format-DgF6KtHk.js";
import "./index-kKnqLkWM.js";
import "./propTypes-CebMRUpe.js";
import "./jobOrder-CGbsc7bp.js";
import "./has-CjqcrIOV.js";
import "./componentMap-CElCaWis.js";
import "./omit-B2_8Y6O_.js";
import "./_flatRest-DBrd2CHT.js";
import "./flatten-DeoUZLdb.js";
import "./TimelineItem-Bkds7ZW8.js";
let Na;
let __tla = Promise.all([
    (()=>{
        try {
            return __tla_0;
        } catch  {}
    })(),
    (()=>{
        try {
            return __tla_1;
        } catch  {}
    })(),
    (()=>{
        try {
            return __tla_2;
        } catch  {}
    })(),
    (()=>{
        try {
            return __tla_3;
        } catch  {}
    })(),
    (()=>{
        try {
            return __tla_4;
        } catch  {}
    })()
]).then(async ()=>{
    const { t: a } = re(), se = ne(), Mt = await wt();
    function Ft(H = {}) {
        const N = [
            {
                value: 0,
                label: a("hsqe.workpermit.methodOnline")
            },
            {
                value: 1,
                label: a("hsqe.workpermit.methodOffline")
            }
        ], I = [
            {
                value: 0,
                label: a("hsqe.workpermit.statusDraft")
            },
            {
                value: 1,
                label: a("hsqe.workpermit.statusPendingReview")
            },
            {
                value: 2,
                label: a("hsqe.workpermit.statusReturned")
            },
            {
                value: 3,
                label: a("hsqe.workpermit.statusCompleted")
            }
        ], P = [
            {
                value: 1,
                label: a("hsqe.workpermit.filling")
            },
            {
                value: 2,
                label: a("hsqe.workpermit.submitted")
            },
            {
                value: 3,
                label: a("hsqe.workpermit.pendingChief")
            },
            {
                value: 4,
                label: a("hsqe.workpermit.pendingMaster")
            },
            {
                value: 5,
                label: a("hsqe.workpermit.pendingTech")
            },
            {
                value: 6,
                label: a("hsqe.workpermit.pendingMarine")
            },
            {
                value: 7,
                label: a("hsqe.workpermit.pendingSenior")
            },
            {
                value: 8,
                label: a("hsqe.workpermit.returned")
            },
            {
                value: 9,
                label: a("hsqe.workpermit.completed")
            }
        ], k = [
            {
                field: "shipId",
                component: "NSelect",
                label: a("hsqe.workpermit.vessel"),
                componentProps: {
                    options: Mt,
                    "label-field": se.getLocale === "en" ? "shipNameEn" : "shipName",
                    "value-field": "id"
                }
            },
            {
                field: "workPermitsStatus",
                component: "NSelect",
                label: a("hsqe.workpermit.Status"),
                componentProps: {
                    options: H?.type == "application" ? P : I
                }
            },
            {
                field: "_validateTime_",
                component: "NDatePicker",
                label: a("hsqe.workpermit.validateTime"),
                componentProps ({ model: i }) {
                    return {
                        type: "datetimerange",
                        format: "yyyy-MM-dd HH:00",
                        valueFormat: "yyyy-MM-dd HH:00:00",
                        timePickerProps: {
                            format: "HH:00"
                        },
                        onUpdateValue: (y, m)=>{
                            i.validateTimeStart = m?.[0], i.validateTimeEnd = m?.[1];
                        }
                    };
                }
            }
        ], u = [
            {
                field: "permitsTypeName",
                component: "NInput",
                label: a("hsqe.workpermit.permit"),
                componentProps: {
                    disabled: !0
                },
                rules: [
                    {
                        required: !0,
                        message: `${a("common.inputText")} ${a("hsqe.workpermit.permit")}`,
                        trigger: [
                            "blur"
                        ]
                    }
                ]
            },
            {
                field: "processType",
                component: "NRadioGroup",
                label: a("hsqe.workpermit.applicationMethod"),
                componentProps: {
                    options: N
                },
                rules: [
                    {
                        type: "number",
                        required: !0,
                        message: `${a("common.chooseText")} ${a("hsqe.workpermit.applicationMethod")}`,
                        trigger: [
                            "change"
                        ]
                    }
                ]
            },
            {
                field: "_validateTime_",
                component: "NDatePicker",
                label: a("hsqe.workpermit.validateTime"),
                componentProps ({ model: i }) {
                    return {
                        type: "datetimerange",
                        format: "yyyy-MM-dd HH:00",
                        valueFormat: "yyyy-MM-dd HH:00:00",
                        timePickerProps: {
                            format: "HH:00"
                        },
                        onUpdateValue: (y, m)=>{
                            i.validateTimeStart = m?.[0], i.validateTimeEnd = m?.[1];
                        }
                    };
                },
                rules: [
                    {
                        required: !0,
                        type: "array",
                        message: `${a("common.chooseText")} ${a("hsqe.workpermit.validateTime")}`,
                        trigger: [
                            "change"
                        ]
                    }
                ],
                hidden: ({ model: i, field: y })=>{
                    const m = +i.processType != 1;
                    return m && (i[y] = void 0, i.validateTimeStart = "", i.validateTimeEnd = ""), m;
                }
            },
            {
                field: "uploadUrl",
                label: a("hsqe.workpermit.uploadFile"),
                slot: "fileSlot",
                giProps: {
                    span: 1
                },
                rules: [
                    {
                        key: "uploadUrl",
                        required: !0,
                        message: `${a("common.chooseText")} ${a("hsqe.workpermit.uploadFile")}`,
                        trigger: [
                            "change"
                        ]
                    }
                ],
                hidden: ({ model: i, field: y })=>{
                    const m = +i.processType != 1;
                    return m && (i[y] = void 0), m;
                }
            }
        ], b = d([
            {
                title: a("hsqe.workpermit.tableNum"),
                key: "workPermitsNo"
            },
            {
                title: a("hsqe.workpermit.Status"),
                key: "workPermitsStatus",
                width: 200,
                viewFunc (i) {
                    return I.find((m)=>m.value === i?.workPermitsStatus)?.label;
                }
            },
            {
                title: a("hsqe.workpermit.applicationMethod"),
                key: "processType",
                width: 200,
                viewFunc (i) {
                    return N.find((m)=>m.value === i?.processType)?.label;
                }
            },
            {
                title: a("hsqe.workpermit.requestBy"),
                key: "roleNameEn",
                viewFunc (i) {
                    return se.getLocale === "en" ? i?.roleNameEn : i?.roleName;
                }
            },
            {
                title: a("hsqe.workpermit.requestTime"),
                key: "submitTime"
            }
        ]), U = {
            SSC031802: {
                isRelatePermit: !0,
                permitSelectLabel: a("hsqe.workpermit.permitSelectLabelToEnclosedSpace")
            },
            "SQR-WP-04": {
                isRelatePermit: !0,
                permitSelectLabel: a("hsqe.workpermit.permitSelectLabelToOther")
            },
            "SQR-WP-05": {
                isRelatePermit: !0,
                isRelateSafetyReport: !0,
                isRelateRAReport: !0,
                permitSelectLabel: a("hsqe.workpermit.permitSelectLabelToOther"),
                safetyReportSelectLabel: a("hsqe.workpermit.safetyReportSelectLabel"),
                raReportSelectLabel: a("hsqe.workpermit.raReportSelectLabel")
            },
            "SQR-WP-03G": {
                noApprove: !0
            },
            "SQR-WP-08": {
                noApprove: !0
            },
            "SQR-WP-09": {
                noApprove: !0,
                isRelatePermit: !0,
                permitSelectLabel: a("hsqe.workpermit.permitSelectLabelToEnclosedSpace")
            }
        }, W = [
            {
                value: 0,
                label: a("hsqe.workpermit.optionYes")
            },
            {
                value: 1,
                label: a("hsqe.workpermit.optionNo")
            }
        ], A = [
            {
                field: "workPermitsType",
                component: "NSelect",
                label: a("hsqe.workpermit.permit"),
                componentProps: {
                    defaultValue: "SSC021801",
                    options: H.treeData,
                    valueField: "businessKey",
                    labelField: "name"
                }
            }
        ];
        return {
            searchSchemas: k,
            modalSchemas: u,
            methodList: N,
            descriptionsList: b,
            statusList: I,
            businessKeyMap: U,
            yesOrNoOptions: W,
            selectPermitSearchSchemas: A
        };
    }
    let xt, Lt, Nt;
    xt = [
        "href"
    ];
    Lt = {
        style: {
            "margin-bottom": "12px"
        }
    };
    Nt = [
        "href"
    ];
    Na = $e({
        __name: "index",
        props: {
            selectedTreeItem: {},
            treeData: {},
            userId: {}
        },
        emits: [
            "success",
            "back"
        ],
        setup (H, { emit: N }) {
            const { closeCurrentTabToBack: I } = qt(), P = H, k = N, { t: u } = re(), b = mt(), U = ne(), A = Ae().query.id || "", i = d(), y = d(), m = d(), z = d(), V = d(), B = d(), E = d(!1), c = d(!1), j = d(""), G = {
                id: null,
                shipId: null,
                documentUrl: "",
                documentUrlFile: "",
                uploadUrl: "",
                validateTimeStart: "",
                validateTimeEnd: "",
                isPermitIssued: null,
                permitIssuedId: "",
                permitIssuedReason: "",
                isSafetyMeeting: null,
                safetyMeetingId: "",
                safetyMeetingReason: "",
                isRiskAssessment: null,
                riskAssessmentId: "",
                riskAssessmentReason: "",
                _validateTime_: null
            }, e = d(oe(G)), r = d(), ie = {
                _validateTime_: {
                    required: !0,
                    type: "array",
                    message: `${u("common.chooseText")} ${u("hsqe.workpermit.validateTime")}`,
                    trigger: [
                        "change"
                    ]
                }
            }, ue = K(()=>r.value?.examineFlag), M = K(()=>[
                    0,
                    2
                ].includes(Number(r.value?.workPermitsStatus)));
            K(()=>[
                    3
                ].includes(Number(r.value?.workPermitsStatus)) && (r.value?.uploadUrlFile || r.value?.documentUrlFile));
            const pe = K(()=>[
                    3
                ].includes(Number(r.value?.workPermitsStatus)) && P.userId === r.value?.createBy), { descriptionsList: me, businessKeyMap: Q, yesOrNoOptions: ce } = Ft();
            console.log(Q, "map");
            const T = d(), F = K(()=>P.selectedTreeItem?.businessKey && Q[P.selectedTreeItem?.businessKey]), de = Be([
                {
                    type: "permit",
                    show: F.value?.isRelatePermit,
                    label: F.value?.permitSelectLabel,
                    showKey: "isPermitIssued",
                    selectedKey: "permitIssuedId",
                    reasonKey: "permitIssuedReason",
                    viewLabel: u("hsqe.workpermit.viewPermit"),
                    params: {
                        workPermitsType: P.selectedTreeItem?.businessKey
                    }
                },
                {
                    type: "meetingReport",
                    show: F.value?.isRelateSafetyReport,
                    label: F.value?.safetyReportSelectLabel,
                    showKey: "isSafetyMeeting",
                    selectedKey: "safetyMeetingId",
                    reasonKey: "safetyMeetingReason",
                    viewLabel: u("hsqe.workpermit.viewReport")
                },
                {
                    type: "raReport",
                    show: F.value?.isRelateRAReport,
                    label: F.value?.raReportSelectLabel,
                    showKey: "isRiskAssessment",
                    selectedKey: "riskAssessmentId",
                    reasonKey: "riskAssessmentReason",
                    viewLabel: u("hsqe.workpermit.viewReport")
                }
            ]);
            async function X() {
                try {
                    E.value = !0, r.value = await ft(A), j.value = U.getLocale === "en" ? r.value?.permitsTypeNameEn : r.value?.permitsTypeName, console.log(r.value), B.value = r.value?.documentUrlFile;
                    for(const s in e.value)e.value[s] = r.value[s];
                    e.value._validateTime_ = e.value?.validateTimeStart && e.value?.validateTimeEnd ? [
                        e.value?.validateTimeStart,
                        e.value?.validateTimeEnd
                    ] : null, e.value.documentUrlFile || await _e(r.value?.workPermitsType), console.error("formData.value.documentUrlFile", e.value.documentUrlFile), m.value?.handleTransformExcelToLuckyByUrl(e.value.documentUrlFile), E.value = !1;
                } catch (s) {
                    e.value = oe(G), E.value = !1, console.log(s);
                }
            }
            function ve({ file: s }) {
                return s.name?.split(".")?.pop()?.toLowerCase() !== "pdf" ? (b.error(`${u("common.file.uploadFormat")} .pdf`), !1) : !0;
            }
            async function fe(s) {
                const o = new FormData;
                o.append("file", s.file?.file);
                try {
                    const _ = await le(o);
                    e.value.uploadUrl = _.name, s.onFinish(), await _t(e.value), await X(r.value, !1), b.success(u("common.optionsSuccessText")), k("success");
                } catch  {
                    s.onError(), Y();
                }
            }
            function Y() {
                e.value.uploadUrl = "";
            }
            async function _e(s) {
                try {
                    e.value.documentUrlFile = await gt(s);
                } catch (o) {
                    console.log(o);
                }
            }
            async function Z() {
                c.value = !0, await y.value?.validate();
                const s = new FormData, o = await m.value.handleGetExcelFile();
                s.append("file", o);
                const _ = await le(s);
                e.value.documentUrl = _.name || "", e.value.validateTimeStart = e.value._validateTime_?.[0], e.value.validateTimeEnd = e.value._validateTime_?.[1], await ht(e.value);
            }
            const J = d(), ee = d();
            function ye() {
                ee.value = {
                    shipId: e.value?.shipId,
                    busId: e.value.id,
                    moduleCode: "workPermit",
                    subModuleCode: r.value?.subModuleCode
                }, J.value.handleOpenModal(ee.value);
            }
            async function he() {
                try {
                    await Z(), c.value = !1, b.success(u("common.optionsSuccessText")), k("success");
                } catch  {
                    c.value = !1;
                }
            }
            async function ge() {
                try {
                    await Z(), r.value?.isSubmit == 0 ? await yt({
                        id: e.value.id
                    }) : await kt({
                        shipId: e.value?.shipId,
                        busId: e.value.id,
                        moduleCode: "workPermit",
                        subModuleCode: r.value?.subModuleCode
                    }), c.value = !1, b.success(u("common.optionsSuccessText")), k("success"), $();
                } catch (s) {
                    console.log(s), c.value = !1;
                }
            }
            async function we() {
                i.value?.setTitle(u("hsqe.workpermit.return")), i.value?.showModal();
            }
            async function ke(s) {
                try {
                    c.value = !0, await bt({
                        shipId: e.value?.shipId,
                        busId: e.value.id,
                        moduleCode: "workPermit",
                        subModuleCode: r.value?.subModuleCode,
                        ...s
                    }), k("success"), b.success(u("common.submitRejectText")), c.value = !1, i.value?.closeModal(), $();
                } catch (o) {
                    console.log(o), c.value = !1;
                }
            }
            async function be() {
                try {
                    c.value = !0, await St({
                        shipId: e.value?.shipId,
                        busId: e.value.id,
                        moduleCode: "workPermit",
                        subModuleCode: r.value?.subModuleCode
                    }), b.success(u("common.submitApproveText")), c.value = !1, $(), k("success");
                } catch (s) {
                    console.log(s), c.value = !1;
                }
            }
            function Se(s, o) {
                o.type === "permit" && (T.value = o, ct(()=>{
                    +s == 0 ? (z.value.handleOpenModal(), e.value[o.reasonKey] = "") : e.value[o.selectedKey] = null;
                }));
            }
            function Te(s) {
                s.selectedId ? (e.value[n(T)?.selectedKey] = s.selectedId, e.value[n(T)?.showKey] = 0, B.value = s?.documentUrlFile) : (e.value[n(T)?.selectedKey] = null, e.value[n(T)?.showKey] = null);
            }
            function $() {
                k("back"), I();
            }
            const qe = (s)=>{
                if (M.value) {
                    const o = new Date;
                    if (o.setHours(0, 0, 0, 0), s < o) return !0;
                }
                return !1;
            };
            return Oe(()=>{
                X();
            }), (s, o)=>{
                const _ = it, x = ut, C = Ze, Re = Ve, Pe = ze, te = Qe, D = Pt, Me = Xe, Fe = Je, xe = Ye, Le = ot, Ne = st, Ie = rt, Ue = at, Ce = tt, De = Ge, Ke = je, ae = We, He = pt;
                return v(), L(He, {
                    loading: E.value
                }, {
                    default: t(()=>[
                            l(ae, {
                                segmented: {
                                    content: !0
                                },
                                size: "small",
                                class: "proCard"
                            }, {
                                header: t(()=>[
                                        l(C, null, {
                                            default: t(()=>[
                                                    l(x, {
                                                        trigger: "hover"
                                                    }, {
                                                        trigger: t(()=>[
                                                                l(_, {
                                                                    border: !1,
                                                                    type: "text",
                                                                    class: "size-8",
                                                                    onClick: $
                                                                }, {
                                                                    icon: t(()=>o[3] || (o[3] = [
                                                                            g("i", {
                                                                                class: "iconfont icon-a-shangyibu2 text-[16px]"
                                                                            }, null, -1)
                                                                        ])),
                                                                    _: 1
                                                                })
                                                            ]),
                                                        default: t(()=>[
                                                                h(" " + f(n(u)("common.backText")), 1)
                                                            ]),
                                                        _: 1
                                                    }),
                                                    g("h1", null, f(j.value), 1)
                                                ]),
                                            _: 1
                                        })
                                    ]),
                                "header-extra": t(()=>[
                                        l(C, null, {
                                            default: t(()=>[
                                                    n(M) ? (v(), S(q, {
                                                        key: 0
                                                    }, [
                                                        l(x, {
                                                            trigger: "hover"
                                                        }, {
                                                            trigger: t(()=>[
                                                                    l(_, {
                                                                        loading: c.value,
                                                                        type: "primary",
                                                                        strong: "",
                                                                        bordered: "",
                                                                        secondary: "",
                                                                        class: "size-7",
                                                                        onClick: ge
                                                                    }, {
                                                                        icon: t(()=>o[4] || (o[4] = [
                                                                                g("i", {
                                                                                    class: "iconfont icon-Submit"
                                                                                }, null, -1)
                                                                            ])),
                                                                        _: 1
                                                                    }, 8, [
                                                                        "loading"
                                                                    ])
                                                                ]),
                                                            default: t(()=>[
                                                                    h(" " + f(n(u)("common.optionsSubmitText")), 1)
                                                                ]),
                                                            _: 1
                                                        }),
                                                        l(x, {
                                                            trigger: "hover"
                                                        }, {
                                                            trigger: t(()=>[
                                                                    l(_, {
                                                                        loading: c.value,
                                                                        type: "primary",
                                                                        strong: "",
                                                                        bordered: "",
                                                                        secondary: "",
                                                                        class: "size-7",
                                                                        onClick: o[0] || (o[0] = (p)=>he())
                                                                    }, {
                                                                        icon: t(()=>o[5] || (o[5] = [
                                                                                g("i", {
                                                                                    class: "iconfont icon-Save"
                                                                                }, null, -1)
                                                                            ])),
                                                                        _: 1
                                                                    }, 8, [
                                                                        "loading"
                                                                    ])
                                                                ]),
                                                            default: t(()=>[
                                                                    h(" " + f(n(u)("common.saveText")), 1)
                                                                ]),
                                                            _: 1
                                                        })
                                                    ], 64)) : R("", !0),
                                                    l(x, {
                                                        trigger: "hover"
                                                    }, {
                                                        trigger: t(()=>[
                                                                l(_, {
                                                                    type: "primary",
                                                                    strong: "",
                                                                    bordered: "",
                                                                    secondary: "",
                                                                    class: "size-7",
                                                                    onClick: ye
                                                                }, {
                                                                    icon: t(()=>o[6] || (o[6] = [
                                                                            g("i", {
                                                                                class: "iconfont icon-Log"
                                                                            }, null, -1)
                                                                        ])),
                                                                    _: 1
                                                                })
                                                            ]),
                                                        default: t(()=>[
                                                                h(f(n(u)("common.reviewHistory")), 1)
                                                            ]),
                                                        _: 1
                                                    }),
                                                    n(ue) ? (v(), S(q, {
                                                        key: 1
                                                    }, [
                                                        l(x, {
                                                            trigger: "hover"
                                                        }, {
                                                            trigger: t(()=>[
                                                                    l(_, {
                                                                        loading: c.value,
                                                                        type: "primary",
                                                                        strong: "",
                                                                        bordered: "",
                                                                        secondary: "",
                                                                        class: "size-7",
                                                                        onClick: be
                                                                    }, {
                                                                        icon: t(()=>o[7] || (o[7] = [
                                                                                g("i", {
                                                                                    class: "iconfont icon-Approve"
                                                                                }, null, -1)
                                                                            ])),
                                                                        _: 1
                                                                    }, 8, [
                                                                        "loading"
                                                                    ])
                                                                ]),
                                                            default: t(()=>[
                                                                    h(" " + f(n(u)("hsqe.workpermit.approve")), 1)
                                                                ]),
                                                            _: 1
                                                        }),
                                                        l(x, {
                                                            trigger: "hover"
                                                        }, {
                                                            trigger: t(()=>[
                                                                    l(_, {
                                                                        loading: c.value,
                                                                        type: "primary",
                                                                        strong: "",
                                                                        bordered: "",
                                                                        secondary: "",
                                                                        class: "size-7",
                                                                        onClick: we
                                                                    }, {
                                                                        icon: t(()=>o[8] || (o[8] = [
                                                                                g("i", {
                                                                                    class: "iconfont icon-Returned"
                                                                                }, null, -1)
                                                                            ])),
                                                                        _: 1
                                                                    }, 8, [
                                                                        "loading"
                                                                    ])
                                                                ]),
                                                            default: t(()=>[
                                                                    h(" " + f(n(u)("hsqe.workpermit.return")), 1)
                                                                ]),
                                                            _: 1
                                                        })
                                                    ], 64)) : R("", !0)
                                                ]),
                                            _: 1
                                        })
                                    ]),
                                default: t(()=>[
                                        l(Pe, {
                                            column: 6,
                                            "label-placement": "left",
                                            class: "mb-3 w-[80%]",
                                            "label-class": "font-medium"
                                        }, {
                                            default: t(()=>[
                                                    (v(!0), S(q, null, O(n(me), (p)=>(v(), L(Re, {
                                                            key: p.key,
                                                            label: p.title
                                                        }, {
                                                            default: t(()=>[
                                                                    h(f(p.viewFunc ? p.viewFunc(r.value) || "--" : r.value?.[p.key] || "--"), 1)
                                                                ]),
                                                            _: 2
                                                        }, 1032, [
                                                            "label"
                                                        ]))), 128))
                                                ]),
                                            _: 1
                                        }),
                                        l(ae, null, {
                                            default: t(()=>[
                                                    l(Ke, {
                                                        ref_key: "formRef",
                                                        ref: y,
                                                        model: e.value,
                                                        rules: ie,
                                                        "label-placement": "left",
                                                        "label-width": "auto"
                                                    }, {
                                                        default: t(()=>[
                                                                l(De, {
                                                                    cols: 6,
                                                                    responsive: "screen",
                                                                    "x-gap": "16px"
                                                                }, {
                                                                    default: t(()=>[
                                                                            l(D, {
                                                                                label: n(u)("hsqe.workpermit.vessel"),
                                                                                "label-width": "180",
                                                                                path: "shipName",
                                                                                span: "2"
                                                                            }, {
                                                                                default: t(()=>[
                                                                                        l(te, {
                                                                                            value: n(U).getLocale === "en" ? r.value?.shipNameEn : r.value?.shipName,
                                                                                            disabled: ""
                                                                                        }, null, 8, [
                                                                                            "value"
                                                                                        ])
                                                                                    ]),
                                                                                _: 1
                                                                            }, 8, [
                                                                                "label"
                                                                            ]),
                                                                            l(D, {
                                                                                label: n(u)("hsqe.workpermit.validateTime"),
                                                                                "label-width": "180",
                                                                                path: "_validateTime_",
                                                                                span: "3 m:3 l:3 xl:3 2xl:2"
                                                                            }, {
                                                                                default: t(()=>[
                                                                                        l(Me, {
                                                                                            "formatted-value": e.value._validateTime_,
                                                                                            "onUpdate:formattedValue": o[1] || (o[1] = (p)=>e.value._validateTime_ = p),
                                                                                            timePickerProps: {
                                                                                                format: "HH:00"
                                                                                            },
                                                                                            disabled: !n(M),
                                                                                            type: "datetimerange",
                                                                                            format: "yyyy-MM-dd HH:00",
                                                                                            valueFormat: "yyyy-MM-dd HH:00:00",
                                                                                            clearable: "",
                                                                                            "is-date-disabled": qe
                                                                                        }, null, 8, [
                                                                                            "formatted-value",
                                                                                            "disabled"
                                                                                        ])
                                                                                    ]),
                                                                                _: 1
                                                                            }, 8, [
                                                                                "label"
                                                                            ]),
                                                                            (v(!0), S(q, null, O(n(de), (p)=>(v(), S(q, {
                                                                                    key: p.type
                                                                                }, [
                                                                                    p.show ? (v(), L(D, {
                                                                                        key: 0,
                                                                                        label: p.label,
                                                                                        span: "6"
                                                                                    }, {
                                                                                        default: t(()=>[
                                                                                                l(xe, {
                                                                                                    value: e.value[p.showKey],
                                                                                                    "onUpdate:value": [
                                                                                                        (w)=>e.value[p.showKey] = w,
                                                                                                        (w)=>Se(w, p)
                                                                                                    ],
                                                                                                    disabled: !n(M)
                                                                                                }, {
                                                                                                    default: t(()=>[
                                                                                                            l(C, null, {
                                                                                                                default: t(()=>[
                                                                                                                        (v(!0), S(q, null, O(n(ce), (w)=>(v(), S(q, {
                                                                                                                                key: w.value
                                                                                                                            }, [
                                                                                                                                l(Fe, {
                                                                                                                                    value: w.value
                                                                                                                                }, {
                                                                                                                                    default: t(()=>[
                                                                                                                                            h(f(w.label), 1)
                                                                                                                                        ]),
                                                                                                                                    _: 2
                                                                                                                                }, 1032, [
                                                                                                                                    "value"
                                                                                                                                ]),
                                                                                                                                w.value === e.value[p.showKey] && e.value[p.showKey] === 1 ? (v(), L(te, {
                                                                                                                                    key: 0,
                                                                                                                                    value: e.value[p.reasonKey],
                                                                                                                                    "onUpdate:value": (Ee)=>e.value[p.reasonKey] = Ee,
                                                                                                                                    disabled: !n(M),
                                                                                                                                    class: "w-[300px]"
                                                                                                                                }, null, 8, [
                                                                                                                                    "value",
                                                                                                                                    "onUpdate:value",
                                                                                                                                    "disabled"
                                                                                                                                ])) : R("", !0),
                                                                                                                                e.value[p.selectedKey] && w.value === e.value[p.showKey] && e.value[p.showKey] === 0 ? (v(), S("a", {
                                                                                                                                    key: 1,
                                                                                                                                    rel: "noopener noreferrer",
                                                                                                                                    target: "_blank",
                                                                                                                                    href: B.value
                                                                                                                                }, f(p.viewLabel), 9, xt)) : R("", !0)
                                                                                                                            ], 64))), 128))
                                                                                                                    ]),
                                                                                                                _: 2
                                                                                                            }, 1024)
                                                                                                        ]),
                                                                                                    _: 2
                                                                                                }, 1032, [
                                                                                                    "value",
                                                                                                    "onUpdate:value",
                                                                                                    "disabled"
                                                                                                ])
                                                                                            ]),
                                                                                        _: 2
                                                                                    }, 1032, [
                                                                                        "label"
                                                                                    ])) : R("", !0)
                                                                                ], 64))), 128)),
                                                                            l(D, {
                                                                                span: "6"
                                                                            }, {
                                                                                default: t(()=>[
                                                                                        l(n(vt), {
                                                                                            ref_key: "luckySheetRef",
                                                                                            ref: m,
                                                                                            isShowExport: !0,
                                                                                            sheetOptions: {
                                                                                                allowEdit: n(M)
                                                                                            },
                                                                                            fileName: n(U).getLocale === "en" ? r.value?.permitsTypeNameEn : r.value?.permitsTypeName || "file"
                                                                                        }, null, 8, [
                                                                                            "sheetOptions",
                                                                                            "fileName"
                                                                                        ])
                                                                                    ]),
                                                                                _: 1
                                                                            }),
                                                                            n(pe) ? (v(), L(D, {
                                                                                key: 0,
                                                                                span: "6",
                                                                                path: "uploadUrl"
                                                                            }, {
                                                                                default: t(()=>[
                                                                                        l(C, {
                                                                                            vertical: "",
                                                                                            class: "w-full"
                                                                                        }, {
                                                                                            default: t(()=>[
                                                                                                    et(l(Ce, {
                                                                                                        ref_key: "uploadRef",
                                                                                                        ref: V,
                                                                                                        "directory-dnd": "",
                                                                                                        accept: ".pdf",
                                                                                                        "custom-request": fe,
                                                                                                        "show-file-list": !1,
                                                                                                        onBeforeUpload: ve,
                                                                                                        onRemove: Y
                                                                                                    }, {
                                                                                                        default: t(()=>[
                                                                                                                l(Ue, null, {
                                                                                                                    default: t(()=>[
                                                                                                                            g("div", Lt, [
                                                                                                                                l(Le, {
                                                                                                                                    size: "48",
                                                                                                                                    depth: 3,
                                                                                                                                    component: n(lt)
                                                                                                                                }, null, 8, [
                                                                                                                                    "component"
                                                                                                                                ])
                                                                                                                            ]),
                                                                                                                            l(Ne, {
                                                                                                                                style: {
                                                                                                                                    "font-size": "16px"
                                                                                                                                }
                                                                                                                            }, {
                                                                                                                                default: t(()=>[
                                                                                                                                        h(f(n(u)("hsqe.workpermit.uploadBtn")), 1)
                                                                                                                                    ]),
                                                                                                                                _: 1
                                                                                                                            }),
                                                                                                                            l(Ie, {
                                                                                                                                depth: "3",
                                                                                                                                style: {
                                                                                                                                    margin: "8px 0 0 0"
                                                                                                                                }
                                                                                                                            }, {
                                                                                                                                default: t(()=>[
                                                                                                                                        h(f(n(u)("hsqe.workpermit.uploadTips")), 1)
                                                                                                                                    ]),
                                                                                                                                _: 1
                                                                                                                            })
                                                                                                                        ]),
                                                                                                                    _: 1
                                                                                                                })
                                                                                                            ]),
                                                                                                        _: 1
                                                                                                    }, 512), [
                                                                                                        [
                                                                                                            nt,
                                                                                                            !r.value?.uploadUrlFile
                                                                                                        ]
                                                                                                    ]),
                                                                                                    l(C, {
                                                                                                        align: "center"
                                                                                                    }, {
                                                                                                        default: t(()=>[
                                                                                                                g("a", {
                                                                                                                    href: r.value?.uploadUrlFile
                                                                                                                }, f(r.value?.uploadUrlName), 9, Nt),
                                                                                                                r.value?.uploadUrlFile ? (v(), L(_, {
                                                                                                                    key: 0,
                                                                                                                    onClick: o[2] || (o[2] = (p)=>V.value?.openOpenFileDialog()),
                                                                                                                    type: "text"
                                                                                                                }, {
                                                                                                                    icon: t(()=>o[9] || (o[9] = [
                                                                                                                            g("i", {
                                                                                                                                class: "iconfont icon-a-Frame28 text-[#0EC06A]"
                                                                                                                            }, null, -1)
                                                                                                                        ])),
                                                                                                                    _: 1
                                                                                                                })) : R("", !0)
                                                                                                            ]),
                                                                                                        _: 1
                                                                                                    })
                                                                                                ]),
                                                                                            _: 1
                                                                                        })
                                                                                    ]),
                                                                                _: 1
                                                                            })) : R("", !0)
                                                                        ]),
                                                                    _: 1
                                                                })
                                                            ]),
                                                        _: 1
                                                    }, 8, [
                                                        "model"
                                                    ])
                                                ]),
                                            _: 1
                                        })
                                    ]),
                                _: 1
                            }),
                            l(dt, {
                                ref_key: "selectModalRef",
                                ref: z,
                                type: T.value?.type,
                                params: T.value?.params,
                                treeData: s.treeData,
                                onSuccess: Te
                            }, null, 8, [
                                "type",
                                "params",
                                "treeData"
                            ]),
                            l(Tt, {
                                ref_key: "rejectModalRef",
                                ref: i,
                                onSuccess: ke,
                                type: "return"
                            }, null, 512),
                            l(n(Rt), {
                                ref_key: "approvalHistoryModalRef",
                                ref: J
                            }, null, 512)
                        ]),
                    _: 1
                }, 8, [
                    "loading"
                ]);
            };
        }
    });
});
export { Na as default, __tla };
