import { B as d } from "./BasicForm-dL_oCSPM.js";
import { u as m } from "./useForm-CKmgcynv.js";
import { V as _, r as o, bk as Y, co as J, d as Q, ay as U, c as X, o as Z, W as $, w as ee, i as u, j as h, l as s, A as y, v as te, __tla as __tla_0 } from "./index-9PRMimni.js";
import { b as se, c as oe } from "./workpermit-ycq2YJDA.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";
let We;
let __tla = Promise.all([
    (()=>{
        try {
            return __tla_0;
        } catch  {}
    })()
]).then(async ()=>{
    const re = J({
        storage: localStorage
    }), f = Y(), { t: e } = _(), q = o(1), S = 10, P = o(!0), N = o([]), k = o([]), v = async ()=>{
        if (!P.value) return;
        const t = {
            pageNum: q.value,
            pageSize: S
        };
        try {
            const i = (await se(t)).list.map((l)=>({
                    label: l.port,
                    value: l.port,
                    labelEn: l.port
                }));
            i.length < S && (P.value = !1), N.value.push(...i), q.value += 1;
        } finally{}
    }, le = async ()=>{
        const t = await oe({
            vesselId: re.get("SHIP-LIST")[0].id
        });
        k.value = t.map((r)=>({
                label: r.crewName,
                value: r.crewId + "",
                labelEn: r.crewNameEn
            }));
    };
    await v();
    await le();
    function ae(t) {
        const r = [
            {
                field: "shipStatus",
                component: "BasicSelect",
                label: e("hsqe.workpermit.shipStatus"),
                componentProps: {
                    style: {
                        width: "100%"
                    },
                    cacheKey: "ships_status",
                    disabled: t?.readOnly
                },
                rules: [
                    {
                        required: !0,
                        message: e("hsqe.workpermit.shipStatus"),
                        trigger: [
                            "blur"
                        ]
                    }
                ]
            },
            {
                field: "port",
                component: "BasicSelect",
                label: e("hsqe.workpermit.port"),
                componentProps: ()=>({
                        filterable: !0,
                        options: N.value,
                        style: {
                            width: "100%"
                        },
                        disabled: t?.readOnly,
                        onScroll: async (w)=>{
                            console.log("滚动");
                            const n = w.currentTarget;
                            n.scrollTop + .5 + n.offsetHeight >= n.scrollHeight && await v();
                        }
                    }),
                rules: [
                    {
                        required: !0,
                        message: e("hsqe.workpermit.port"),
                        trigger: [
                            "blur"
                        ]
                    }
                ]
            },
            {
                field: "lat",
                component: "NInput",
                label: e("hsqe.workpermit.postionLat"),
                componentProps: {
                    disabled: t?.readOnly
                }
            },
            {
                field: "long",
                label: e("hsqe.workpermit.postionLong"),
                component: "NInput",
                componentProps: {
                    disabled: t?.readOnly
                }
            }
        ], i = [
            {
                field: "hotWorkArea",
                component: "BasicSelect",
                label: e("hsqe.workpermit.area"),
                componentProps: {
                    style: {
                        width: "100%"
                    },
                    disabled: t?.readOnly,
                    cacheKey: "hot_work_area"
                },
                rules: [
                    {
                        required: !0,
                        message: e("hsqe.workpermit.area"),
                        trigger: [
                            "blur"
                        ]
                    }
                ]
            },
            {
                field: "dept",
                component: "BasicSelect",
                label: e("hsqe.workpermit.dept"),
                componentProps: {
                    style: {
                        width: "100%"
                    },
                    disabled: t?.readOnly,
                    cacheKey: "hot_work_dept"
                },
                rules: [
                    {
                        required: !0,
                        message: e("hsqe.workpermit.dept"),
                        trigger: [
                            "blur"
                        ]
                    }
                ]
            },
            {
                field: "startTime",
                component: "NDatePicker",
                label: e("hsqe.workpermit.startTime"),
                componentProps: {
                    type: "date",
                    disabled: t?.readOnly,
                    valueFormat: "yyyy-MM-dd"
                },
                rules: [
                    {
                        required: !0,
                        message: e("hsqe.workpermit.startTime"),
                        trigger: [
                            "blur"
                        ]
                    }
                ]
            },
            {
                field: "endTime",
                component: "NDatePicker",
                label: e("hsqe.workpermit.endTime"),
                componentProps: {
                    type: "date",
                    disabled: t?.readOnly,
                    valueFormat: "yyyy-MM-dd"
                },
                rules: [
                    {
                        required: !0,
                        message: e("hsqe.workpermit.endTime"),
                        trigger: [
                            "blur"
                        ]
                    }
                ]
            },
            {
                field: "detail",
                component: "NInput",
                label: e("hsqe.workpermit.detailItem"),
                giProps: {
                    span: 3
                },
                componentProps: ()=>({
                        type: "textarea",
                        maxlength: 300,
                        disabled: t?.readOnly
                    }),
                rules: [
                    {
                        required: !0,
                        message: e("hsqe.workpermit.detailItem"),
                        trigger: [
                            "blur"
                        ]
                    }
                ]
            },
            {
                field: "reason",
                component: "NInput",
                label: e("hsqe.workpermit.reason"),
                giProps: {
                    span: 3
                },
                componentProps: ()=>({
                        type: "textarea",
                        disabled: t?.readOnly
                    })
            },
            {
                field: "location",
                component: "NInput",
                label: e("hsqe.workpermit.detailLocation"),
                giProps: {
                    span: 3
                },
                componentProps: ()=>({
                        type: "textarea",
                        disabled: t?.readOnly
                    })
            }
        ], l = [
            {
                field: "welderName",
                component: "NSelect",
                label: e("hsqe.workpermit.welder"),
                componentProps: ()=>({
                        options: k.value,
                        "label-field": f.getLocale === "en" ? "labelEn" : "label",
                        style: {
                            width: "100%"
                        },
                        disabled: t?.readOnly
                    }),
                rules: [
                    {
                        required: !0,
                        message: e("hsqe.workpermit.welder"),
                        trigger: [
                            "blur"
                        ]
                    }
                ]
            },
            {
                field: "licence",
                component: "NSelect",
                label: e("hsqe.workpermit.licence"),
                componentProps: ()=>({
                        options: [
                            {
                                labelEn: "YES",
                                value: "licenceY",
                                label: "是"
                            },
                            {
                                labelEn: "NO",
                                value: "licenceN",
                                label: "否"
                            }
                        ],
                        "label-field": f.getLocale === "en" ? "labelEn" : "label",
                        style: {
                            width: "100%"
                        },
                        disabled: t?.readOnly
                    }),
                rules: [
                    {
                        required: !0,
                        message: e("hsqe.workpermit.licence"),
                        trigger: [
                            "blur"
                        ]
                    }
                ]
            },
            {
                field: "fireWatchName",
                component: "NSelect",
                label: e("hsqe.workpermit.watchPersonnel"),
                componentProps: ()=>({
                        options: k.value,
                        "label-field": f.getLocale === "en" ? "labelEn" : "label",
                        style: {
                            width: "100%"
                        },
                        disabled: t?.readOnly
                    }),
                rules: [
                    {
                        required: !0,
                        message: e("hsqe.workpermit.watchPersonnel"),
                        trigger: [
                            "blur"
                        ]
                    }
                ]
            }
        ], g = [
            {
                field: "cargoName1",
                component: "NInput",
                label: e("hsqe.workpermit.cargoName"),
                componentProps: {
                    disabled: t?.readOnly
                }
            },
            {
                field: "tksNo1",
                component: "NInput",
                label: e("hsqe.workpermit.tks"),
                componentProps: {
                    disabled: t?.readOnly
                }
            }
        ], b = [
            {
                field: "cargoName2",
                component: "NInput",
                label: e("hsqe.workpermit.cargoName"),
                componentProps: {
                    disabled: t?.readOnly
                }
            },
            {
                field: "tksNo2",
                component: "NInput",
                label: e("hsqe.workpermit.tks"),
                componentProps: {
                    disabled: t?.readOnly
                }
            }
        ];
        return {
            schemas: r,
            descriptSchemas: i,
            experienceSchemas: l,
            ballastSchemas: g,
            cargoSchemas: b
        };
    }
    let ie, ne, ce, pe, de, me;
    ie = {
        class: "BasicForm"
    };
    ne = {
        class: "title"
    };
    ce = {
        class: "title"
    };
    pe = {
        class: "title"
    };
    de = {
        class: "title"
    };
    me = Q({
        __name: "WorkDetail",
        props: {
            isEdit: {
                type: Boolean,
                default: !1
            },
            data: {
                type: Object,
                default: ()=>{}
            }
        },
        setup (t, { expose: r }) {
            const i = t, l = o([]), g = o([]), b = o([]), w = o([]), n = o([]), { t: p } = _(), [O, { submit: B, getFieldsValue: V, setFieldsValue: F }] = m({
                gridProps: {
                    cols: 4
                },
                collapsedRows: 3,
                labelWidth: 80,
                layout: "horizontal",
                showActionButtonGroup: !1,
                schemas: l
            }), [I, { submit: x, getFieldsValue: R, setFieldsValue: E }] = m({
                gridProps: {
                    cols: 4
                },
                collapsedRows: 3,
                labelWidth: 80,
                layout: "horizontal",
                showActionButtonGroup: !1,
                schemas: g
            }), [W, { submit: L, getFieldsValue: D, setFieldsValue: T }] = m({
                gridProps: {
                    cols: 4
                },
                collapsedRows: 3,
                labelWidth: 80,
                layout: "horizontal",
                showActionButtonGroup: !1,
                schemas: b
            }), [A, { getFieldsValue: z, setFieldsValue: C }] = m({
                gridProps: {
                    cols: 4
                },
                collapsedRows: 3,
                labelWidth: 80,
                layout: "horizontal",
                showActionButtonGroup: !1,
                schemas: w
            }), [G, { getFieldsValue: M, setFieldsValue: H }] = m({
                gridProps: {
                    cols: 4
                },
                collapsedRows: 3,
                labelWidth: 80,
                layout: "horizontal",
                showActionButtonGroup: !1,
                schemas: n
            });
            U(()=>i.isEdit, (a)=>{
                const c = ae({
                    readOnly: a
                });
                l.value = c.schemas, g.value = c.descriptSchemas, b.value = c.experienceSchemas, w.value = c.ballastSchemas, n.value = c.cargoSchemas;
            }, {
                immediate: !0
            });
            async function K(a) {
                F(a), E(a), T(a), C(a), H(a);
            }
            return r({
                getFieldsValue: V,
                getDescriptFieldsValue: R,
                getExperienceFieldsValue: D,
                getBallastFieldsValue: z,
                getCargoFieldsValue: M,
                initData: K,
                submit: B,
                descriptionSubmit: x,
                experienceSubmit: L
            }), (a, c)=>{
                const j = $;
                return Z(), X(j, {
                    bordered: !1,
                    class: "mt-3 proCard"
                }, {
                    default: ee(()=>[
                            u("div", ie, [
                                h(s(d), {
                                    onRegister: s(O)
                                }, null, 8, [
                                    "onRegister"
                                ]),
                                u("h3", ne, y(s(p)("hsqe.workpermit.description")), 1),
                                h(s(d), {
                                    onRegister: s(I)
                                }, null, 8, [
                                    "onRegister"
                                ]),
                                u("h3", ce, y(s(p)("hsqe.workpermit.experience")), 1),
                                h(s(d), {
                                    onRegister: s(W)
                                }, null, 8, [
                                    "onRegister"
                                ]),
                                u("h3", pe, y(s(p)("hsqe.workpermit.ballastInfo")), 1),
                                h(s(d), {
                                    onRegister: s(A)
                                }, null, 8, [
                                    "onRegister"
                                ]),
                                u("h3", de, y(s(p)("hsqe.workpermit.cargoInfo")), 1),
                                h(s(d), {
                                    onRegister: s(G)
                                }, null, 8, [
                                    "onRegister"
                                ])
                            ])
                        ]),
                    _: 1
                });
            };
        }
    });
    We = te(me, [
        [
            "__scopeId",
            "data-v-19505662"
        ]
    ]);
});
export { We as default, __tla };
