import { r as R, V as U, l, bk as S, d as F, a4 as C, ay as I, aw as E, c as x, o as L, w as s, j as o, iR as k, ee as O, ch as B, aA as V, X as W, gI as A, __tla as __tla_0 } from "./index-9PRMimni.js";
import { B as M } from "./BasicForm-dL_oCSPM.js";
import { u as z } from "./useForm-CKmgcynv.js";
import { P as G, j as X, y as h, a as $, e as q, d as _, b as H, s as y, t as r, l as f, __tla as __tla_1 } from "./helper-DaqlySQD.js";
import { f as J } from "./find-D_h_aJYR.js";
import { h as w } from "./head-aneRfQQJ.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 "./memoize-C3Z21RQJ.js";
import "./template-rpthWlT9.js";
import "./equipmentMainLibrary-bJTzj5mC.js";
import "./findIndex-BgUIH3i1.js";
import "./toInteger-DQeH-nF-.js";
let Ne;
let __tla = Promise.all([
    (()=>{
        try {
            return __tla_0;
        } catch  {}
    })(),
    (()=>{
        try {
            return __tla_1;
        } catch  {}
    })()
]).then(async ()=>{
    const { t: e } = U(), u = S();
    function K({ equipmentCode: j }) {
        const b = R(!1);
        return [
            {
                field: "shipId",
                hidden: !0
            },
            {
                field: "jobTitle",
                component: "NInput",
                label: e("jobPlan.viewDetails.jobDetailsTab.jobTitle"),
                componentProps: {
                    disabled: !0,
                    placeholder: e("jobPlan.viewDetails.jobDetailsTab.jobTitle")
                },
                rules: [
                    {
                        required: !0,
                        message: e("jobPlan.viewDetails.jobDetailsTab.jobTitleRequired"),
                        trigger: [
                            "submit"
                        ]
                    }
                ]
            },
            {
                field: "jobCode",
                component: "NInput",
                label: e("jobPlan.viewDetails.jobDetailsTab.jobCode"),
                componentProps: {
                    disabled: !0,
                    placeholder: e("jobPlan.viewDetails.jobDetailsTab.jobCode")
                }
            },
            {
                field: "equipmentCode",
                component: "NInput",
                label: e("jobPlan.viewDetails.jobDetailsTab.equipmentCode"),
                componentProps: {
                    disabled: !0,
                    placeholder: e("jobPlan.viewDetails.jobDetailsTab.equipmentCode")
                }
            },
            {
                field: "equipmentName",
                component: "NSelect",
                label: e("jobPlan.viewDetails.jobDetailsTab.equipmentName"),
                componentProps: ({ model: d, formAction: T })=>{
                    const { shipId: c, jobCode: g } = d, { setFieldsValue: m } = T;
                    return {
                        show: l(b),
                        remote: !0,
                        clearable: !0,
                        filterable: !0,
                        loading: l(H),
                        options: l(q),
                        valueField: "label",
                        placeholder: e("common.inputTextToSearch"),
                        onClear: ()=>{
                            _({
                                shipId: c,
                                code: l(j)
                            });
                        },
                        onBlur: ()=>{
                            b.value = !1;
                        },
                        onSearch: async (p)=>{
                            p.length > 0 ? b.value = !0 : b.value = !1, _({
                                shipId: c,
                                productName: p,
                                code: l(j)
                            });
                        },
                        onUpdateValue: async (p)=>{
                            const n = J(l(q), {
                                label: p
                            });
                            m({
                                equipmentCode: n?.raw?.productCode ?? null,
                                model: n?.raw?.model ?? null,
                                belongToModel: n?.raw?.belongToModel ?? null,
                                serialNumber: n?.raw?.serialNumber ?? null
                            }), b.value = !1;
                        }
                    };
                },
                rules: [
                    {
                        required: !0,
                        message: e("jobPlan.viewDetails.jobDetailsTab.equipmentNameRequired"),
                        trigger: [
                            "submit"
                        ]
                    }
                ]
            },
            {
                field: "model",
                hidden: !0
            },
            {
                field: "belongToModel",
                hidden: !0
            },
            {
                field: "serialNumber",
                hidden: !0
            },
            {
                field: "department",
                component: "NSelect",
                label: e("jobPlan.viewDetails.jobDetailsTab.department"),
                componentProps: {
                    placeholder: e("jobPlan.viewDetails.jobDetailsTab.department"),
                    labelField: u.getLocale === "en" ? "labelEn" : "label",
                    options: [
                        {
                            label: "甲板部",
                            labelEn: "Deck Department",
                            value: 1
                        },
                        {
                            label: "机舱部",
                            labelEn: "Engine Department",
                            value: 2
                        }
                    ]
                },
                rules: [
                    {
                        required: !0,
                        message: e("jobPlan.viewDetails.jobDetailsTab.departmentRequired")
                    }
                ]
            },
            {
                field: "pic",
                component: "NSelect",
                label: e("jobPlan.viewDetails.jobDetailsTab.picDiscipline"),
                componentProps: {
                    placeholder: e("jobPlan.viewDetails.jobDetailsTab.picDiscipline"),
                    labelField: u.getLocale === "en" ? "labelEn" : "label",
                    options: G
                },
                rules: [
                    {
                        required: !0,
                        message: e("jobPlan.viewDetails.jobDetailsTab.picDisciplineRequired")
                    }
                ]
            },
            {
                field: "jobPriority",
                component: "NSelect",
                label: e("jobPlan.viewDetails.jobDetailsTab.jobPriority"),
                componentProps: {
                    placeholder: e("jobPlan.viewDetails.jobDetailsTab.jobPriority"),
                    labelField: u.getLocale === "en" ? "labelEn" : "label",
                    options: X
                },
                rules: [
                    {
                        required: !0,
                        message: e("jobPlan.viewDetails.jobDetailsTab.jobPriorityRequired")
                    }
                ]
            },
            {
                field: "criticalToSafety",
                component: "NSelect",
                label: e("jobPlan.viewDetails.jobDetailsTab.criticalToSafety"),
                componentProps: {
                    placeholder: e("jobPlan.viewDetails.jobDetailsTab.criticalToSafety"),
                    labelField: u.getLocale === "en" ? "labelEn" : "label",
                    options: h
                },
                rules: [
                    {
                        required: !0,
                        message: e("jobPlan.viewDetails.jobDetailsTab.criticalToSafetyRequired")
                    }
                ]
            },
            {
                field: "jobInterval",
                component: "NInputNumber",
                label: e("jobPlan.viewDetails.jobDetailsTab.interval"),
                slot: "jobInterval",
                componentProps: {
                    placeholder: e("jobPlan.viewDetails.jobDetailsTab.interval")
                },
                rules: [
                    {
                        required: !0,
                        message: e("jobPlan.viewDetails.jobDetailsTab.intervalRequired")
                    }
                ]
            },
            {
                field: "frequency",
                hidden: !0
            },
            {
                field: "alertPeriod",
                component: "NInputNumber",
                label: e("jobPlan.viewDetails.jobDetailsTab.alertPeriod"),
                slot: "alertPeriod",
                componentProps: {
                    placeholder: e("jobPlan.viewDetails.jobDetailsTab.alertPeriod")
                },
                rules: [
                    {
                        required: !0,
                        message: e("jobPlan.viewDetails.jobDetailsTab.alertPeriodRequired")
                    }
                ]
            },
            {
                field: "alertFrequency",
                hidden: !0
            },
            {
                field: "cyclingPattern",
                component: "NSelect",
                label: e("jobPlan.viewDetails.jobDetailsTab.cyclingPattern"),
                componentProps: {
                    placeholder: e("jobPlan.viewDetails.jobDetailsTab.cyclingPattern"),
                    labelField: u.getLocale === "en" ? "labelEn" : "label",
                    options: $
                },
                rules: [
                    {
                        required: !0,
                        message: e("jobPlan.viewDetails.jobDetailsTab.cyclingPatternRequired")
                    }
                ]
            },
            {
                field: "workPermit",
                component: "NSelect",
                label: e("jobPlan.viewDetails.jobDetailsTab.workPermit"),
                componentProps: {
                    placeholder: e("jobPlan.viewDetails.jobDetailsTab.workPermit"),
                    labelField: u.getLocale === "en" ? "labelEn" : "label",
                    options: h
                },
                rules: [
                    {
                        required: !0,
                        message: e("jobPlan.viewDetails.jobDetailsTab.workPermitRequired")
                    }
                ]
            },
            {
                field: "rARequired",
                component: "NSelect",
                label: e("jobPlan.viewDetails.jobDetailsTab.raRequired"),
                componentProps: {
                    placeholder: e("jobPlan.viewDetails.jobDetailsTab.raRequired"),
                    labelField: u.getLocale === "en" ? "labelEn" : "label",
                    options: h
                },
                rules: [
                    {
                        required: !0,
                        message: e("jobPlan.viewDetails.jobDetailsTab.raRequiredRequired")
                    }
                ]
            },
            {
                field: "estimateTime",
                label: e("jobPlan.viewDetails.jobDetailsTab.estimatedTime"),
                slot: "estimateTime",
                componentProps: {
                    placeholder: e("jobPlan.viewDetails.jobDetailsTab.estimatedTime")
                },
                rules: [
                    {
                        required: !0,
                        message: e("jobPlan.viewDetails.jobDetailsTab.estimatedTimeRequired")
                    }
                ]
            },
            {
                field: "estimateTimeUnit",
                hidden: !0
            },
            {
                field: "estimateWorkforce",
                component: "NInputNumber",
                label: e("jobPlan.viewDetails.jobDetailsTab.estimatedWorkforce"),
                componentProps: {
                    min: 0,
                    precision: 0,
                    placeholder: e("jobPlan.viewDetails.jobDetailsTab.estimatedWorkforce")
                },
                rules: [
                    {
                        required: !0,
                        message: e("jobPlan.viewDetails.jobDetailsTab.estimatedWorkforceRequired")
                    }
                ]
            },
            {
                field: "tolerance",
                component: "NInputNumber",
                label: e("jobPlan.viewDetails.jobDetailsTab.tolerance"),
                slot: "tolerance",
                componentProps: {
                    placeholder: e("jobPlan.viewDetails.jobDetailsTab.tolerance")
                }
            },
            {
                field: "toleranceUnit",
                hidden: !0
            },
            {
                field: "jobDescription",
                component: "NInput",
                label: e("jobPlan.viewDetails.jobDetailsTab.jobDescription"),
                giProps: {
                    span: 2
                },
                componentProps: {
                    type: "textarea",
                    autosize: {
                        minRows: 6,
                        maxRows: 6
                    },
                    showCount: !0,
                    maxlength: 1e3,
                    placeholder: e("jobPlan.viewDetails.jobDetailsTab.jobDescription")
                }
            },
            {
                field: "specialNote",
                component: "NInput",
                label: e("jobPlan.viewDetails.jobDetailsTab.specialNote"),
                giProps: {
                    span: 2
                },
                componentProps: {
                    type: "textarea",
                    autosize: {
                        minRows: 6,
                        maxRows: 6
                    },
                    showCount: !0,
                    maxlength: 1e3,
                    placeholder: e("jobPlan.viewDetails.jobDetailsTab.specialNote")
                }
            }
        ];
    }
    Ne = F({
        __name: "index",
        props: {
            data: {},
            isReadonly: {
                type: Boolean
            }
        },
        setup (j, { expose: b }) {
            const d = j, T = C(()=>d.data?.newPlan?.equipmentCode || ""), c = K({
                equipmentCode: T
            }), [g, m] = z({
                gridProps: {
                    cols: "4"
                },
                schemas: c,
                labelPlacement: "top",
                showAdvancedButton: !1,
                showActionButtonGroup: !1
            });
            I(()=>d.data, (n)=>{
                m?.setFieldsValue(y(n));
            }), E(()=>{
                m?.setFieldsValue(y(d.data));
            });
            function p() {
                return A(c, "field");
            }
            return b({
                methods: m,
                getFields: p
            }), (n, Q)=>{
                const v = B, D = V, P = O, N = W;
                return L(), x(N, null, {
                    default: s(()=>[
                            o(l(M), {
                                onRegister: l(g),
                                disabled: "isReadonly" in n ? n.isReadonly : l(k)
                            }, {
                                jobInterval: s(({ model: a, field: i })=>[
                                        o(P, null, {
                                            default: s(()=>[
                                                    o(v, {
                                                        class: "w-full",
                                                        value: a[i],
                                                        "onUpdate:value": (t)=>a[i] = t,
                                                        min: 0,
                                                        precision: 0
                                                    }, null, 8, [
                                                        "value",
                                                        "onUpdate:value"
                                                    ]),
                                                    o(D, {
                                                        value: a.frequency,
                                                        "onUpdate:value": (t)=>a.frequency = t,
                                                        "label-field": l(f).getLocale === "en" ? "labelEn" : "label",
                                                        "default-value": l(w)(l(r))?.value,
                                                        options: l(r),
                                                        style: {
                                                            width: "140px"
                                                        },
                                                        placeholder: ""
                                                    }, null, 8, [
                                                        "value",
                                                        "onUpdate:value",
                                                        "label-field",
                                                        "default-value",
                                                        "options"
                                                    ])
                                                ]),
                                            _: 2
                                        }, 1024)
                                    ]),
                                alertPeriod: s(({ model: a, field: i })=>[
                                        o(P, null, {
                                            default: s(()=>[
                                                    o(v, {
                                                        class: "w-full",
                                                        value: a[i],
                                                        "onUpdate:value": (t)=>a[i] = t,
                                                        min: 0,
                                                        precision: 0
                                                    }, null, 8, [
                                                        "value",
                                                        "onUpdate:value"
                                                    ]),
                                                    o(D, {
                                                        value: a.alertFrequency,
                                                        "onUpdate:value": (t)=>a.alertFrequency = t,
                                                        "label-field": l(f).getLocale === "en" ? "labelEn" : "label",
                                                        "default-value": l(w)(l(r))?.value,
                                                        options: l(r),
                                                        style: {
                                                            width: "140px"
                                                        },
                                                        placeholder: ""
                                                    }, null, 8, [
                                                        "value",
                                                        "onUpdate:value",
                                                        "label-field",
                                                        "default-value",
                                                        "options"
                                                    ])
                                                ]),
                                            _: 2
                                        }, 1024)
                                    ]),
                                estimateTime: s(({ model: a, field: i })=>[
                                        o(P, null, {
                                            default: s(()=>[
                                                    o(v, {
                                                        class: "w-full",
                                                        value: a[i],
                                                        "onUpdate:value": (t)=>a[i] = t,
                                                        min: 0,
                                                        precision: 0
                                                    }, null, 8, [
                                                        "value",
                                                        "onUpdate:value"
                                                    ]),
                                                    o(D, {
                                                        value: a.estimateTimeUnit,
                                                        "onUpdate:value": (t)=>a.estimateTimeUnit = t,
                                                        "label-field": l(f).getLocale === "en" ? "labelEn" : "label",
                                                        "default-value": l(w)(l(r))?.value,
                                                        options: l(r),
                                                        style: {
                                                            width: "140px"
                                                        },
                                                        placeholder: ""
                                                    }, null, 8, [
                                                        "value",
                                                        "onUpdate:value",
                                                        "label-field",
                                                        "default-value",
                                                        "options"
                                                    ])
                                                ]),
                                            _: 2
                                        }, 1024)
                                    ]),
                                tolerance: s(({ model: a, field: i })=>[
                                        o(P, null, {
                                            default: s(()=>[
                                                    o(v, {
                                                        class: "w-full",
                                                        value: a[i],
                                                        "onUpdate:value": (t)=>a[i] = t,
                                                        min: 0,
                                                        precision: 0
                                                    }, null, 8, [
                                                        "value",
                                                        "onUpdate:value"
                                                    ]),
                                                    o(D, {
                                                        value: a.toleranceUnit,
                                                        "onUpdate:value": (t)=>a.toleranceUnit = t,
                                                        "label-field": l(f).getLocale === "en" ? "labelEn" : "label",
                                                        "default-value": l(w)(l(r))?.value,
                                                        options: l(r),
                                                        style: {
                                                            width: "140px"
                                                        },
                                                        placeholder: ""
                                                    }, null, 8, [
                                                        "value",
                                                        "onUpdate:value",
                                                        "label-field",
                                                        "default-value",
                                                        "options"
                                                    ])
                                                ]),
                                            _: 2
                                        }, 1024)
                                    ]),
                                _: 1
                            }, 8, [
                                "onRegister",
                                "disabled"
                            ])
                        ]),
                    _: 1
                });
            };
        }
    });
});
export { Ne as default, __tla };
