import { V as R, bk as K, d as X, dc as Z, bl as k, r as j, a as H, Z as d, fc as G, e6 as J, cZ as Q, c as x, o as D, w as n, j as a, W as Y, l as t, D as A, H as ee, df as se, p as v, A as h, aI as te, B as oe, i1 as ne, i as ae, X as le, gI as ie, __tla as __tla_0 } from "./index-9PRMimni.js";
import { B as re } from "./BasicForm-dL_oCSPM.js";
import { u as ce } from "./useForm-CKmgcynv.js";
import { B as ue } from "./Table-0PViRYCf.js";
import { _ as pe } from "./TableAction.vue_vue_type_script_setup_true_lang-Bj_Y4LtN.js";
import { c as me, M as g, a as de, _ as ye, i as fe, g as _e, __tla as __tla_1 } from "./index.vue_vue_type_script_setup_true_lang-D2_SSGp-.js";
import { f as ve } from "./find-D_h_aJYR.js";
import { i as b } from "./includes-DdMWPj0t.js";
import "./Render.vue_vue_type_script_lang-DKUYY0Zw.js";
import "./SingleImageUpload-CNx4b9eC.js";
import "./ImageUpload.vue_vue_type_style_index_0_scoped_cb086928_lang-D-28kXvw.js";
import "./componentSetting-DVhNDBTO.js";
import "./ImageUpload-DUsnro3W.js";
import "./vuedraggable.umd-Co2xEC3p.js";
import "./BasicUpload.vue_vue_type_style_index_0_scoped_a4d0e930_lang-DxRbtP01.js";
import "./tabsView-BXskTdVh.js";
import "./BasicForm.vue_vue_type_style_index_0_scoped_b9e995ec_lang-CEvcLwxD.js";
import "./propTypes-CebMRUpe.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 "./usePageCache-DluHn7Yy.js";
import "./Table.vue_vue_type_style_index_0_scoped_7b9e6ece_lang-BoW2DV_e.js";
import "./componentMap-CElCaWis.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 "./useTimeout-BxFilWvD.js";
import "./Flex-CTSf12gq.js";
import "./equipmentMainLibrary-bJTzj5mC.js";
import "./findIndex-BgUIH3i1.js";
import "./toInteger-DQeH-nF-.js";
let is;
let __tla = Promise.all([
    (()=>{
        try {
            return __tla_0;
        } catch  {}
    })(),
    (()=>{
        try {
            return __tla_1;
        } catch  {}
    })()
]).then(async ()=>{
    var u = ((o)=>(o[o.UNISSUED = 0] = "UNISSUED", o[o.ISSUED = 1] = "ISSUED", o[o.CANCELLED = 2] = "CANCELLED", o))(u || {});
    const he = [
        {
            label: "未下发",
            labelEn: "Unissued",
            value: 0
        },
        {
            label: "已下发",
            labelEn: "Issued",
            value: 1
        },
        {
            label: "已废除",
            labelEn: "Cancelled",
            value: 2
        }
    ], C = !1, { t: c } = R(), E = K();
    function ge() {
        return [
            {
                type: "selection",
                key: "_select",
                width: 40,
                disabled (o) {
                    return o.status !== 0;
                }
            },
            {
                title: "No.",
                key: "num",
                width: 60,
                render: (o, s)=>s + 1
            },
            {
                title: c("vesselsSurveyType.vesselType"),
                key: E.getLocale === "en" ? "vesselTypeNameEn" : "vesselTypeName",
                width: 150
            },
            {
                title: c("vesselsSurveyType.surveyTypeNo"),
                key: "no",
                width: 160
            },
            {
                title: c("vesselsSurveyType.surveyTypeNameEn"),
                key: "englishName",
                width: 170
            },
            {
                title: c("vesselsSurveyType.surveyTypeNameCn"),
                key: "chineseName",
                width: 170
            },
            {
                title: c("vesselsSurveyType.status"),
                key: "status",
                width: 160,
                render (o) {
                    const { status: s } = o, l = ve(he, {
                        value: s
                    });
                    return l ? l[E.getLocale === "en" ? "labelEn" : "label"] : "";
                }
            }
        ];
    }
    is = X({
        __name: "index",
        setup (o) {
            const { t: s } = R(), { hasPermission: l } = Z(), S = Q(), y = k("tableRef"), p = k("infoModalRef"), f = j([]);
            function I(e, i) {
                f.value = i;
            }
            const N = H({
                width: 160,
                title: s("common.optionsText"),
                key: "action",
                fixed: "right",
                align: "center",
                render (e) {
                    return d(pe, {
                        style: "text",
                        actions: [
                            {
                                label: s("common.optionsViewText"),
                                labelShow: !1,
                                ifShow: b([
                                    u.UNISSUED,
                                    u.ISSUED
                                ], e.status),
                                icon: d(G, {
                                    class: "text-[#2180F1] text-[14px]"
                                }),
                                onClick: P.bind(null, e)
                            },
                            {
                                label: s("common.optionsEditText"),
                                labelShow: !1,
                                ifShow: l([
                                    "vessel:surveyType:handle"
                                ]) && b([
                                    u.UNISSUED
                                ], e.status) && C,
                                icon: d("i", {
                                    class: "iconfont icon-a-Frame28"
                                }),
                                onClick: V.bind(null, e)
                            },
                            {
                                label: s("vesselsSurveyType.cancel"),
                                labelShow: !1,
                                ifShow: l([
                                    "vessel:surveyType:handle"
                                ]) && b([
                                    u.ISSUED
                                ], e.status) && C,
                                icon: d(J, {
                                    class: "text-red-500 text-[14px]"
                                }),
                                onPositiveClick: W.bind(null, e),
                                isConfirm: !0,
                                confirmContent: s("vesselsSurveyType.cancelConfirmText")
                            }
                        ]
                    });
                }
            }), [B, { getFieldsValue: M }] = ce({
                gridProps: {
                    cols: 6
                },
                schemas: me(),
                showAdvancedButton: !1
            });
            function O() {
                fe({
                    configIds: ie(t(f), "id")
                }).then(()=>{
                    S.success(s("vesselsSurveyType.issuedSuccessText")), U(), r();
                });
            }
            function F() {
                p.value?.handleOpenModal({
                    mode: g.ADD
                });
            }
            function P(e) {
                p.value?.handleOpenModal({
                    mode: g.VIEW,
                    record: e
                });
            }
            function V(e) {
                p.value?.handleOpenModal({
                    mode: g.EDIT,
                    record: e
                });
            }
            function W(e) {
                de({
                    id: e.id
                }).then(()=>{
                    S.success(s("vesselsSurveyType.cancelSuccessText")), r();
                });
            }
            async function L(e, i) {
                try {
                    return await _e({
                        ...i,
                        ...e
                    });
                } catch  {
                    return {
                        list: [],
                        total: 0
                    };
                }
            }
            function r() {
                y.value?.restReload();
            }
            function U() {
                y.value?.setCheckedRowKeys([]);
            }
            return (e, i)=>{
                const m = Y, w = oe, T = te, $ = se, q = ee, z = le;
                return D(), x(z, null, {
                    default: n(()=>[
                            a(m, {
                                bordered: !1,
                                class: "proCard"
                            }, {
                                default: n(()=>[
                                        a(t(re), {
                                            onRegister: t(B),
                                            onSubmit: r,
                                            onReset: r
                                        }, null, 8, [
                                            "onRegister"
                                        ])
                                    ]),
                                _: 1
                            }),
                            a(m, {
                                bordered: !1,
                                class: "proCard mt-2"
                            }, {
                                default: n(()=>[
                                        a(t(ue), {
                                            ref_key: "tableRef",
                                            ref: y,
                                            columns: t(ge)(),
                                            request: (_)=>L(_, t(M)()),
                                            "row-key": (_)=>_.id,
                                            autoScrollX: !0,
                                            actionColumn: t(N),
                                            onCheckedRowChange: I,
                                            "virtual-scroll": ""
                                        }, {
                                            toolbar: n(()=>[
                                                    t(C) && t(l)([
                                                        "vessel:surveyType:handle"
                                                    ]) ? (D(), x(q, {
                                                        key: 0
                                                    }, {
                                                        default: n(()=>[
                                                                a($, {
                                                                    onPositiveClick: O
                                                                }, {
                                                                    trigger: n(()=>[
                                                                            a(T, {
                                                                                trigger: "hover"
                                                                            }, {
                                                                                trigger: n(()=>[
                                                                                        a(w, {
                                                                                            type: "primary",
                                                                                            strong: "",
                                                                                            bordered: "",
                                                                                            secondary: "",
                                                                                            class: "size-7",
                                                                                            disabled: !t(f)?.length
                                                                                        }, {
                                                                                            icon: n(()=>[
                                                                                                    a(t(ne))
                                                                                                ]),
                                                                                            _: 1
                                                                                        }, 8, [
                                                                                            "disabled"
                                                                                        ])
                                                                                    ]),
                                                                                default: n(()=>[
                                                                                        v(" " + h(t(s)("vesselsSurveyType.issuedBtn")), 1)
                                                                                    ]),
                                                                                _: 1
                                                                            })
                                                                        ]),
                                                                    default: n(()=>[
                                                                            v(" " + h(t(s)("vesselsSurveyType.issuedConfirmText")), 1)
                                                                        ]),
                                                                    _: 1
                                                                }),
                                                                a(T, {
                                                                    trigger: "hover"
                                                                }, {
                                                                    trigger: n(()=>[
                                                                            a(w, {
                                                                                type: "primary",
                                                                                strong: "",
                                                                                bordered: "",
                                                                                secondary: "",
                                                                                class: "size-7",
                                                                                onClick: F
                                                                            }, {
                                                                                icon: n(()=>i[0] || (i[0] = [
                                                                                        ae("i", {
                                                                                            class: "iconfont icon-ADD"
                                                                                        }, null, -1)
                                                                                    ])),
                                                                                _: 1
                                                                            })
                                                                        ]),
                                                                    default: n(()=>[
                                                                            v(" " + h(t(s)("vesselsSurveyType.addBtn")), 1)
                                                                        ]),
                                                                    _: 1
                                                                })
                                                            ]),
                                                        _: 1
                                                    })) : A("", !0)
                                                ]),
                                            _: 1
                                        }, 8, [
                                            "columns",
                                            "request",
                                            "row-key",
                                            "actionColumn"
                                        ])
                                    ]),
                                _: 1
                            }),
                            a(ye, {
                                ref_key: "infoModalRef",
                                ref: p,
                                onRefresh: r
                            }, null, 512)
                        ]),
                    _: 1
                });
            };
        }
    });
});
export { is as default, __tla };
