import { V as x, bk as z, gI as C, Z as a, N as se, i2 as te, ae as oe, d as ne, dc as ae, bl as d, r as B, a as le, fc as ie, i3 as re, hs as ce, e6 as ue, c as v, o as _, w as n, j as o, W as de, l as t, D as k, H as pe, aI as me, p as F, A as I, B as fe, i4 as ye, i5 as he, X as ve, cZ as _e, __tla as __tla_0 } from "./index-9PRMimni.js";
import { B as ge } from "./Table-0PViRYCf.js";
import { _ as Se } from "./TableAction.vue_vue_type_script_setup_true_lang-Bj_Y4LtN.js";
import { B as we } from "./BasicForm-dL_oCSPM.js";
import { u as be } from "./useForm-CKmgcynv.js";
import { s as ke, b as Re } from "./vesselsSurvey-CV_Ys9Tu.js";
import { _ as Ce } from "./index.vue_vue_type_script_setup_true_lang-CmIZCfpW.js";
import { _ as xe } from "./index.vue_vue_type_script_setup_true_lang-DyCkxlGj.js";
import { _ as Ne } from "./index.vue_vue_type_script_setup_true_lang-vOC7B-Gj.js";
import { _ as Me } from "./index.vue_vue_type_script_setup_true_lang-DuapE22l.js";
import { g as Oe } from "./equipmentMainLibrary-bJTzj5mC.js";
import { g as Ee } from "./requisitionOrder-D0IG9N7e.js";
import { h as Le } from "./head-aneRfQQJ.js";
import { g as V, I as R } from "./helper-Cj34FCgW.js";
import { _ as Te } from "./Flex-CTSf12gq.js";
import { i as g } from "./includes-DdMWPj0t.js";
import "./Table.vue_vue_type_style_index_0_scoped_7b9e6ece_lang-BoW2DV_e.js";
import "./vuedraggable.umd-Co2xEC3p.js";
import "./Render.vue_vue_type_script_lang-DKUYY0Zw.js";
import "./componentMap-CElCaWis.js";
import "./propTypes-CebMRUpe.js";
import "./format-DgF6KtHk.js";
import "./omit-B2_8Y6O_.js";
import "./_flatRest-DBrd2CHT.js";
import "./flatten-DeoUZLdb.js";
import "./print-CT_2hrjP.js";
import "./basicModal.vue_vue_type_script_setup_true_lang-CsJydKhW.js";
import "./basicModal.vue_vue_type_style_index_0_lang-8QZP7ApW.js";
import "./useModal-CO65vga3.js";
import "./componentSetting-DVhNDBTO.js";
import "./useTimeout-BxFilWvD.js";
import "./usePageCache-DluHn7Yy.js";
import "./tabsView-BXskTdVh.js";
import "./SingleImageUpload-CNx4b9eC.js";
import "./ImageUpload.vue_vue_type_style_index_0_scoped_cb086928_lang-D-28kXvw.js";
import "./ImageUpload-DUsnro3W.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-C_uwzMkE.js";
import "./BasicSelect.vue_vue_type_style_index_0_scoped_772d51cc_lang-Brp6PjEU.js";
import "./dictionary-BRse4lkf.js";
import "./index-DkvzUEqh.js";
import "./index-kKnqLkWM.js";
import "./AutoComplete-Dv1Bqed4.js";
import "./TreeSelect-BZh2DeCh.js";
import "./find-D_h_aJYR.js";
import "./findIndex-BgUIH3i1.js";
import "./toInteger-DQeH-nF-.js";
let Es;
let __tla = Promise.all([
    (()=>{
        try {
            return __tla_0;
        } catch  {}
    })()
]).then(async ()=>{
    const { t: S } = x(), $ = z(), D = await Ee().then((c)=>C(c, (s)=>({
                label: s.shipName,
                labelEn: s.shipNameEn,
                value: s.id,
                raw: s
            }))), Be = await Oe("ship_survey_status");
    function Fe() {
        return [
            {
                field: "shipId",
                component: "NSelect",
                label: S("vesselsSurvey.vessel"),
                defaultValue: Le(D)?.value,
                componentProps: {
                    placeholder: S("vesselsSurvey.vessel"),
                    labelField: $.getLocale === "en" ? "labelEn" : "label",
                    options: D
                }
            },
            {
                field: "status",
                component: "NSelect",
                label: S("vesselsSurvey.status"),
                componentProps: {
                    placeholder: S("vesselsSurvey.status"),
                    labelField: $.getLocale === "en" ? "labelEn" : "label",
                    options: Be
                }
            }
        ];
    }
    const { t: l } = x(), P = z();
    function Ie() {
        return [
            {
                type: "selection",
                width: 40
            },
            {
                title: l("vesselsSurvey.no"),
                key: "no",
                width: 60,
                render: (c, s)=>{
                    const { expiredFlag: i } = c;
                    return a(Te, {
                        class: "overflow-hidden",
                        align: "center",
                        size: "small",
                        wrap: !1
                    }, [
                        i === 1 ? a(se, {
                            size: "14px",
                            color: "#EDB716"
                        }, {
                            default: ()=>a(te)
                        }) : a("div", {
                            class: "w-[12px] h-[12px]"
                        }),
                        s + 1
                    ]);
                }
            },
            {
                title: l("vesselsSurvey.vessel"),
                key: P.getLocale === "en" ? "shipNameEn" : "shipName",
                width: 100
            },
            {
                title: l("vesselsSurvey.surveyTypeNo"),
                key: "configNo",
                width: 160
            },
            {
                title: l("vesselsSurvey.surveyTypeNameEn"),
                key: "surveyEnglishName",
                width: 170
            },
            {
                title: l("vesselsSurvey.surveyTypeNameCn"),
                key: "surveyChineseName",
                width: 170
            },
            {
                title: l("vesselsSurvey.lastSurveyDate"),
                key: "surveyDate",
                width: 110
            },
            {
                title: l("vesselsSurvey.windowStart"),
                key: "windowStart",
                width: 110
            },
            {
                title: l("vesselsSurvey.windowEnd"),
                key: "windowEnd",
                width: 110
            },
            {
                title: l("vesselsSurvey.status"),
                key: "status",
                width: 220,
                render (c) {
                    const { status: s, statusName: i, statusNameEn: p } = c, u = P.getLocale === "en" ? p : i;
                    return V(s) ? a(oe, {
                        class: "rounded-[5px]",
                        color: V(s)
                    }, {
                        default: ()=>u
                    }) : u;
                }
            }
        ];
    }
    Es = ne({
        __name: "index",
        setup (c) {
            const { t: s } = x(), { hasPermission: i } = ae(), p = _e(), u = d("tableRef"), m = d("infoModalRef"), N = d("historyModalRef"), M = d("cancelModalRef"), O = d("getSurveyListModalRef"), w = B(!1), f = B([]);
            function W(e, y) {
                f.value = y;
            }
            const q = le({
                width: 120,
                title: s("common.optionsText"),
                key: "action",
                fixed: "right",
                align: "center",
                render (e) {
                    return a(Se, {
                        style: "text",
                        actions: [
                            {
                                label: s("common.optionsViewText"),
                                labelShow: !1,
                                ifShow: g([
                                    0,
                                    1,
                                    2,
                                    3,
                                    4,
                                    5
                                ], e.status),
                                icon: a(ie, {
                                    class: "text-[#2180F1] text-[14px]"
                                }),
                                onClick: U.bind(null, e)
                            },
                            {
                                label: s("common.optionsEditText"),
                                labelShow: !1,
                                ifShow: i([
                                    "vessel:survey:handle"
                                ]) && g([
                                    0
                                ], e.status) && !0,
                                icon: a("i", {
                                    class: "iconfont icon-a-Frame28"
                                }),
                                onClick: X.bind(null, e)
                            },
                            {
                                label: s("common.optionsUpdateText"),
                                labelShow: !1,
                                ifShow: i([
                                    "vessel:survey:handle"
                                ]) && g([
                                    1,
                                    2,
                                    3,
                                    4,
                                    5
                                ], e.status) && !0,
                                icon: a(re, {
                                    class: "text-[14px]"
                                }),
                                onClick: Z.bind(null, e)
                            },
                            {
                                label: s("vesselsSurvey.history"),
                                labelShow: !1,
                                icon: a(ce, {
                                    class: "text-[14px]"
                                }),
                                onClick: j.bind(null, e)
                            },
                            {
                                label: s("vesselsSurvey.cancel"),
                                labelShow: !1,
                                ifShow: i([
                                    "vessel:survey:handle"
                                ]) && g([
                                    0,
                                    1,
                                    2,
                                    3,
                                    4,
                                    5
                                ], e.status) && R,
                                icon: a(ue, {
                                    class: "text-red-500 text-[14px]"
                                }),
                                onClick: G.bind(null, e)
                            }
                        ]
                    });
                }
            }), [H, { getFieldsValue: E }] = be({
                gridProps: {
                    cols: 6
                },
                schemas: Fe(),
                showAdvancedButton: !1
            });
            function A() {
                const { shipId: e } = E();
                if (!e) {
                    p.warning(s("vesselsSurvey.selectShipWarning"));
                    return;
                }
                O.value?.handleOpenModal({
                    shipId: e
                });
            }
            function K() {
                w.value = !0, ke({
                    idList: C(t(f), "id"),
                    configList: C(t(f), "configId")
                }).then(()=>{
                    p.success(s("vesselsSurvey.syncSuccessful")), Q(), r();
                }).finally(()=>{
                    w.value = !1;
                });
            }
            function U(e) {
                m.value?.handleOpenModal({
                    mode: "view",
                    record: e
                });
            }
            function X(e) {
                m.value?.handleOpenModal({
                    mode: "edit",
                    record: e
                });
            }
            function Z(e) {
                m.value?.handleOpenModal({
                    mode: "update",
                    record: e
                });
            }
            function j(e) {
                N.value?.handleOpenModal({
                    record: e
                });
            }
            function G(e) {
                M.value?.handleOpenModal({
                    record: e
                });
            }
            async function J(e, y) {
                try {
                    return await Re({
                        ...y,
                        ...e
                    });
                } catch  {
                    return {
                        list: [],
                        total: 0
                    };
                }
            }
            function r() {
                u.value?.restReload();
            }
            function Q() {
                u.value?.setCheckedRowKeys([]);
            }
            return (e, y)=>{
                const h = de, L = fe, T = me, Y = pe, ee = ve;
                return _(), v(ee, null, {
                    default: n(()=>[
                            o(h, {
                                bordered: !1,
                                class: "proCard"
                            }, {
                                default: n(()=>[
                                        o(t(we), {
                                            onRegister: t(H),
                                            onSubmit: r,
                                            onReset: r
                                        }, null, 8, [
                                            "onRegister"
                                        ])
                                    ]),
                                _: 1
                            }),
                            o(h, {
                                bordered: !1,
                                class: "proCard mt-2"
                            }, {
                                default: n(()=>[
                                        o(t(ge), {
                                            ref_key: "tableRef",
                                            ref: u,
                                            columns: t(Ie)(),
                                            request: (b)=>J(b, t(E)()),
                                            "row-key": (b)=>b.id,
                                            autoScrollX: !0,
                                            actionColumn: t(q),
                                            onCheckedRowChange: W,
                                            "virtual-scroll": ""
                                        }, {
                                            toolbar: n(()=>[
                                                    t(i)([
                                                        "vessel:survey:handle"
                                                    ]) ? (_(), v(Y, {
                                                        key: 0
                                                    }, {
                                                        default: n(()=>[
                                                                t(R) ? k("", !0) : (_(), v(T, {
                                                                    key: 0,
                                                                    trigger: "hover"
                                                                }, {
                                                                    trigger: n(()=>[
                                                                            o(L, {
                                                                                type: "primary",
                                                                                strong: "",
                                                                                bordered: "",
                                                                                secondary: "",
                                                                                class: "size-7",
                                                                                loading: t(w),
                                                                                disabled: !t(f)?.length,
                                                                                onClick: K
                                                                            }, {
                                                                                icon: n(()=>[
                                                                                        o(t(ye))
                                                                                    ]),
                                                                                _: 1
                                                                            }, 8, [
                                                                                "loading",
                                                                                "disabled"
                                                                            ])
                                                                        ]),
                                                                    default: n(()=>[
                                                                            F(" " + I(t(s)("vesselsSurvey.sync")), 1)
                                                                        ]),
                                                                    _: 1
                                                                })),
                                                                t(R) ? k("", !0) : (_(), v(T, {
                                                                    key: 1,
                                                                    trigger: "hover"
                                                                }, {
                                                                    trigger: n(()=>[
                                                                            o(L, {
                                                                                type: "primary",
                                                                                strong: "",
                                                                                bordered: "",
                                                                                secondary: "",
                                                                                class: "size-7",
                                                                                onClick: A
                                                                            }, {
                                                                                icon: n(()=>[
                                                                                        o(t(he))
                                                                                    ]),
                                                                                _: 1
                                                                            })
                                                                        ]),
                                                                    default: n(()=>[
                                                                            F(" " + I(t(s)("vesselsSurvey.getSurveyList")), 1)
                                                                        ]),
                                                                    _: 1
                                                                }))
                                                            ]),
                                                        _: 1
                                                    })) : k("", !0)
                                                ]),
                                            _: 1
                                        }, 8, [
                                            "columns",
                                            "request",
                                            "row-key",
                                            "actionColumn"
                                        ]),
                                        o(Ce, {
                                            ref_key: "getSurveyListModalRef",
                                            ref: O,
                                            onRefresh: r
                                        }, null, 512),
                                        o(xe, {
                                            ref_key: "infoModalRef",
                                            ref: m,
                                            onRefresh: r
                                        }, null, 512),
                                        o(Ne, {
                                            ref_key: "historyModalRef",
                                            ref: N,
                                            onRefresh: r
                                        }, null, 512),
                                        o(Me, {
                                            ref_key: "cancelModalRef",
                                            ref: M,
                                            onRefresh: r
                                        }, null, 512)
                                    ]),
                                _: 1
                            })
                        ]),
                    _: 1
                });
            };
        }
    });
});
export { Es as default, __tla };
