import { V as _, bk as T, gL as X, hc as q, d as A, r as c, a as M, Z as O, gW as w, cZ as Z, gX as S, c as L, o as k, w as t, j as a, W as j, l as e, c6 as G, aI as K, p as U, A as z, B as H, ca as J, X as Q, __tla as __tla_0 } from "./index-9PRMimni.js";
import { B as Y } from "./Table-0PViRYCf.js";
import { _ as ee } from "./TableAction.vue_vue_type_script_setup_true_lang-Bj_Y4LtN.js";
import { B as oe } from "./BasicForm-dL_oCSPM.js";
import { u as te } from "./useForm-CKmgcynv.js";
import { d as ae, g as se } from "./storageLocation-CpgPSQOH.js";
import { r as ne } from "./dictUtils-D8jA3mBt.js";
import { _ as re } from "./Modal.vue_vue_type_script_setup_true_lang-DAgjG7Ml.js";
import { h as ie } from "./has-CjqcrIOV.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 "./Flex-CTSf12gq.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";
let Qe;
let __tla = Promise.all([
    (()=>{
        try {
            return __tla_0;
        } catch  {}
    })()
]).then(async ()=>{
    let ce, n, le, me, v, pe, l, C, ue;
    ce = T();
    ({ t: n } = _());
    le = await X("storage_location_category");
    me = ()=>({
            columns: [
                {
                    title: n("common.messagedefine.Num"),
                    key: "num",
                    width: 60,
                    render: (o, s)=>s + 1
                },
                {
                    title: n("storageLocation.vessel"),
                    key: ce.getLocale === "en" ? "shipNameEn" : "shipName",
                    width: 140
                },
                {
                    title: n("storageLocation.storageLocation"),
                    key: "warehouseType",
                    width: 140,
                    render: (o)=>ne(le, o.warehouseType)
                },
                {
                    title: n("storageLocation.storageLocationName"),
                    key: "warehouseName",
                    width: 140
                },
                {
                    title: n("storageLocation.remark"),
                    key: "remark",
                    width: 140
                }
            ]
        });
    ({ t: v } = _());
    pe = T();
    l = await q();
    C = l && l.length > 0 ? l[0].id : 0;
    ue = (m)=>({
            schemas: [
                {
                    field: "shipId",
                    label: v("storageLocation.vessel"),
                    component: "NSelect",
                    componentProps: {
                        options: l,
                        filterable: !0,
                        clearable: !1,
                        defaultValue: C,
                        "label-field": pe.getLocale === "en" ? "shipNameEn" : "shipName",
                        "value-field": "id",
                        onUpdateValue: (s)=>{
                            m.shipId.value = s;
                        }
                    }
                },
                {
                    field: "warehouseType",
                    label: v("storageLocation.storageLocation"),
                    component: "BasicSelect",
                    componentProps: {
                        block: !0,
                        cacheKey: "storage_location_category"
                    }
                }
            ],
            initShipValue: C
        });
    Qe = A({
        __name: "index",
        setup (m) {
            const { t: o } = _(), s = Z(), { columns: x } = me(), I = !1, g = c(), h = c(), R = c(!0), p = c(0), N = M({
                width: 200,
                title: o("common.optionsText"),
                key: "action",
                fixed: "right",
                align: "center",
                ifShow: !0,
                render (i) {
                    return O(ee, {
                        style: "text",
                        actions: [
                            {
                                label: o("common.optionsDelText"),
                                labelShow: !1,
                                icon: w(S.delete, "red"),
                                onPositiveClick: async ()=>{
                                    await ae(i.id), s.success(o("common.optionsDelSuccessText")), r();
                                },
                                onNegativeClick: ()=>{},
                                isConfirm: !0,
                                confirmContent: o("common.delPop.contRole")
                            }
                        ]
                    });
                }
            });
            function B() {
                g.value?.showModal(p.value);
            }
            function r() {
                h.value?.restReload();
            }
            async function D(i, d) {
                return !ie(b(), "shipId") && R && (P({
                    shipId: u
                }), d.shipId = u, p.value = u), await se({
                    ...i,
                    ...d
                });
            }
            const { schemas: V, initShipValue: u } = ue({
                shipId: p
            }), [F, { getFieldsValue: b, setFieldsValue: P }] = te({
                gridProps: {
                    cols: "6",
                    xGap: "15"
                },
                labelWidth: 80,
                schemas: V,
                showAdvancedButton: !1
            });
            return (i, d)=>{
                const y = j, W = H, $ = K, E = Q;
                return k(), L(E, null, {
                    default: t(()=>[
                            a(y, {
                                bordered: !1,
                                class: "proCard mb-3"
                            }, {
                                default: t(()=>[
                                        a(e(oe), {
                                            onRegister: e(F),
                                            onSubmit: r,
                                            onReset: r
                                        }, null, 8, [
                                            "onRegister"
                                        ])
                                    ]),
                                _: 1
                            }),
                            a(y, {
                                bordered: !1,
                                class: "mb-3 proCard"
                            }, {
                                default: t(()=>[
                                        a(e(Y), {
                                            columns: e(x),
                                            "row-key": (f)=>f.id,
                                            actionColumn: e(N),
                                            request: (f)=>D(f, e(b)()),
                                            showTableSetting: !1,
                                            ref_key: "basicTableRef",
                                            ref: h,
                                            autoScrollX: !0,
                                            "virtual-scroll": ""
                                        }, G({
                                            _: 2
                                        }, [
                                            e(I) ? void 0 : {
                                                name: "tableTitle",
                                                fn: t(()=>[
                                                        a($, {
                                                            trigger: "hover"
                                                        }, {
                                                            trigger: t(()=>[
                                                                    a(W, {
                                                                        strong: "",
                                                                        secondary: "",
                                                                        type: "primary",
                                                                        class: "px-[5px] h-[28px] rounded-md",
                                                                        onClick: B
                                                                    }, {
                                                                        icon: t(()=>[
                                                                                (k(), L(J(e(w)(e(S).add))))
                                                                            ]),
                                                                        _: 1
                                                                    })
                                                                ]),
                                                            default: t(()=>[
                                                                    U(" " + z(e(o)("storageLocation.addStorageLocation")), 1)
                                                                ]),
                                                            _: 1
                                                        })
                                                    ]),
                                                key: "0"
                                            }
                                        ]), 1032, [
                                            "columns",
                                            "row-key",
                                            "actionColumn",
                                            "request"
                                        ])
                                    ]),
                                _: 1
                            }),
                            a(re, {
                                ref_key: "modalRef",
                                ref: g,
                                onSuccess: r
                            }, null, 512)
                        ]),
                    _: 1
                });
            };
        }
    });
});
export { Qe as default, __tla };
