import { a as M, V as q, r as s, d as pe, f as me, Z as C, cZ as de, aw as _e, c as E, o as w, w as o, j as t, U as fe, M as ye, W as ve, i as g, k as ge, ds as he, l as n, N as ke, dA as be, h as xe, aB as Ce, cB as we, H as Te, B as qe, p as Se, A as F, eG as Re, aA as Be, X as Pe, __tla as __tla_0 } from "./index-9PRMimni.js";
import { B as De } from "./BasicForm-dL_oCSPM.js";
import { u as Ne } from "./useForm-CKmgcynv.js";
import { aB as Ae, aC as Ie, aj as U, aD as L, aE as Ve, aF as Ee, aG as Fe } from "./template-rpthWlT9.js";
import { B as ze } from "./Table-0PViRYCf.js";
import { _ as Ke } from "./TableAction.vue_vue_type_script_setup_true_lang-Bj_Y4LtN.js";
import { _ as Me } from "./Modal.vue_vue_type_script_setup_true_lang-FRui2pDw.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";
let Pt;
let __tla = Promise.all([
    (()=>{
        try {
            return __tla_0;
        } catch  {}
    })()
]).then(async ()=>{
    const { t: y } = q();
    await U();
    await L();
    const z = await Ie(), K = await Ae(), Ue = M([
        {
            field: "inspectionType",
            component: "NSelect",
            label: y("hsqe.question.chapter"),
            slot: "inspectionSlot"
        },
        {
            field: "resultType",
            component: "NSelect",
            label: y("hsqe.question.resultType"),
            defaultValue: K[0].value,
            componentProps: {
                placeholder: y("hsqe.question.resultTypeHint"),
                clearable: !1,
                options: K
            }
        },
        {
            field: "remarkColumns",
            component: "NSelect",
            label: y("hsqe.question.remarkColumns"),
            defaultValue: z[0].value,
            componentProps: {
                placeholder: y("hsqe.question.remarkColumnsHint"),
                clearable: !1,
                options: z
            }
        }
    ]), { t: T } = q();
    function Le() {
        const h = s(), a = s();
        return {
            columns: [
                {
                    title: T("hsqe.question.serialNo"),
                    key: "index",
                    width: 60,
                    render (_, k) {
                        return (h.value - 1) * a.value + k + 1;
                    }
                },
                {
                    title: T("hsqe.question.contentChinese"),
                    key: "inspectionContentZh",
                    width: 200,
                    ellipsis: !1
                },
                {
                    title: T("hsqe.question.contentEnglish"),
                    key: "inspectionContentEn",
                    width: 200,
                    ellipsis: !1
                }
            ],
            methods: {
                setPage: (_)=>{
                    h.value = _.pageNum, a.value = _.pageSize;
                }
            }
        };
    }
    let Oe, $e, He, je;
    Oe = {
        class: "flex items-center"
    };
    $e = {
        class: "w-full menu"
    };
    He = {
        class: "py-3 menu-list"
    };
    je = {
        key: 0,
        class: "flex items-center justify-center py-4"
    };
    Pt = pe({
        __name: "index",
        setup (h) {
            const a = me(), { t: l } = q(), S = de(), { columns: _, methods: k } = Le(), { setPage: O } = k, R = s(), b = s(!0), c = s([]), u = s([]), v = s(""), B = s([]), $ = s(""), [H, { getFieldsValue: p, setFieldsValue: j }] = Ne({
                gridProps: {
                    cols: 4,
                    xGap: 15
                },
                schemas: Ue,
                labelWidth: "80px",
                showAdvancedButton: !1
            }), G = M({
                width: 80,
                title: l("common.optionsText"),
                key: "action",
                fixed: "right",
                align: "center",
                render (e) {
                    return C(Ke, {
                        style: "text",
                        actions: [
                            {
                                label: l("common.optionsEditText"),
                                labelShow: !1,
                                icon: C("i", {
                                    class: "iconfont icon-a-Frame28"
                                }),
                                onClick: ne.bind(null, e)
                            },
                            {
                                label: l("common.optionsDelText"),
                                labelShow: !1,
                                icon: C("i", {
                                    class: "iconfont icon-Delete red"
                                }),
                                onPositiveClick: ()=>{
                                    Q(e.id);
                                },
                                color: "red",
                                onNegativeClick: ()=>{},
                                isConfirm: !0,
                                confirmContent: l("common.delPop.contRole")
                            }
                        ]
                    });
                }
            });
            async function W() {
                b.value = !0;
                const e = await Fe();
                c.value = e, b.value = !1;
            }
            let i = s([]);
            async function P() {
                let e = [];
                i.value[0] === "tank_carrier_cargo" ? e = await L() : e = await U(), B.value = e, j({
                    inspectionType: e[0].value
                });
            }
            async function Z(e) {
                console.log(e), i.value = e, P(), f();
            }
            function X(e) {
                u.value = e;
            }
            function J() {
                u.value.length ? u.value = [] : (console.log(u.value), u.value = n(c).map((e)=>e.value));
            }
            async function Q(e) {
                await Ve(e), S.success(l("common.optionsDelSuccessText")), f();
            }
            function f() {
                R.value.reload();
            }
            function Y(e) {
                f();
            }
            function ee(e) {
                f();
            }
            const m = s();
            function te() {
                m.value?.showModal(null), m.value.getData({
                    inspectionProperty: i.value.length == 0 ? c.value[0]?.children[0].value : i.value[0],
                    inspectionType: p().inspectionType,
                    resultLevel: p().resultType,
                    remarkFlag: p().remarkColumns
                });
            }
            async function ne(e) {
                await m.value?.showModal(), m.value.setProps({
                    title: l("common.optionsEditText")
                }), m.value.getData({
                    inspectionProperty: i.value.length == 0 ? c.value[0]?.children[0].value : i.value[0],
                    inspectionType: p().inspectionType,
                    resultLevel: p().resultType,
                    remarkFlag: p().remarkColumns,
                    ...e
                });
            }
            async function oe(e, d) {
                return O(e), c.value.length == 0 && await W(), Ee({
                    ...e,
                    ...d,
                    inspectionProperty: i.value.length == 0 ? c.value[a.query.stage ? Array.isArray(a.query.stage) ? parseInt(a.query.stage[0]) : parseInt(a.query.stage) : 0]?.children[a.query.name ? Array.isArray(a.query.name) ? parseInt(a.query.name[0]) : parseInt(a.query.name) : 0]?.value : i.value[0]
                });
            }
            return _e(()=>{
                P();
            }), (e, d)=>{
                const D = ke, N = qe, A = Te, ae = ge, se = Ce, le = we, x = ve, I = ye, ie = Be, re = fe, ce = Pe;
                return w(), E(ce, null, {
                    default: o(()=>[
                            t(re, {
                                cols: "1 s:1 m:1 l:4 xl:4 2xl:4",
                                responsive: "screen",
                                "x-gap": 12
                            }, {
                                default: o(()=>[
                                        t(I, {
                                            span: "1"
                                        }, {
                                            default: o(()=>[
                                                    t(x, {
                                                        segmented: {
                                                            content: "hard"
                                                        },
                                                        bordered: !1,
                                                        size: "small"
                                                    }, {
                                                        header: o(()=>[
                                                                t(A, null, {
                                                                    default: o(()=>[
                                                                            t(N, {
                                                                                type: "primary",
                                                                                ghost: "",
                                                                                "icon-placement": "left",
                                                                                onClick: J
                                                                            }, {
                                                                                icon: o(()=>[
                                                                                        g("div", Oe, [
                                                                                            t(D, {
                                                                                                size: "14"
                                                                                            }, {
                                                                                                default: o(()=>[
                                                                                                        t(n(Re))
                                                                                                    ]),
                                                                                                _: 1
                                                                                            })
                                                                                        ])
                                                                                    ]),
                                                                                default: o(()=>[
                                                                                        Se(F(n(l)("system.menu.all")) + " " + F(n(u).length ? n(l)("system.menu.retract") : n(l)("system.menu.expand")) + " ", 1)
                                                                                    ]),
                                                                                _: 1
                                                                            })
                                                                        ]),
                                                                    _: 1
                                                                })
                                                            ]),
                                                        default: o(()=>[
                                                                g("div", $e, [
                                                                    t(ae, {
                                                                        value: n(v),
                                                                        "onUpdate:value": d[0] || (d[0] = (r)=>he(v) ? v.value = r : null),
                                                                        placeholder: "Please input keyword"
                                                                    }, {
                                                                        suffix: o(()=>[
                                                                                t(D, {
                                                                                    size: "18",
                                                                                    class: "cursor-pointer"
                                                                                }, {
                                                                                    default: o(()=>[
                                                                                            t(n(be))
                                                                                        ]),
                                                                                    _: 1
                                                                                })
                                                                            ]),
                                                                        _: 1
                                                                    }, 8, [
                                                                        "value"
                                                                    ]),
                                                                    g("div", He, [
                                                                        n(b) ? (w(), xe("div", je, [
                                                                            t(se, {
                                                                                size: "medium"
                                                                            })
                                                                        ])) : (w(), E(le, {
                                                                            key: 1,
                                                                            "block-line": "",
                                                                            cascade: "",
                                                                            "key-field": "value",
                                                                            "virtual-scroll": !0,
                                                                            cancelable: !1,
                                                                            data: n(c),
                                                                            pattern: n(v),
                                                                            style: {
                                                                                "max-height": "650px",
                                                                                overflow: "hidden"
                                                                            },
                                                                            expandedKeys: n(u),
                                                                            "onUpdate:selectedKeys": Z,
                                                                            "onUpdate:expandedKeys": X
                                                                        }, null, 8, [
                                                                            "data",
                                                                            "pattern",
                                                                            "expandedKeys"
                                                                        ]))
                                                                    ])
                                                                ])
                                                            ]),
                                                        _: 1
                                                    })
                                                ]),
                                            _: 1
                                        }),
                                        t(I, {
                                            span: "3"
                                        }, {
                                            default: o(()=>[
                                                    t(x, {
                                                        bordered: !1,
                                                        class: "proCard mb-3"
                                                    }, {
                                                        default: o(()=>[
                                                                t(n(De), {
                                                                    onRegister: n(H),
                                                                    onSubmit: Y,
                                                                    onReset: ee,
                                                                    "label-placement": "top"
                                                                }, {
                                                                    inspectionSlot: o(({ model: r, field: V })=>[
                                                                            t(ie, {
                                                                                options: n(B),
                                                                                value: r[V],
                                                                                "onUpdate:value": (ue)=>r[V] = ue,
                                                                                "default-value": n($)
                                                                            }, null, 8, [
                                                                                "options",
                                                                                "value",
                                                                                "onUpdate:value",
                                                                                "default-value"
                                                                            ])
                                                                        ]),
                                                                    _: 1
                                                                }, 8, [
                                                                    "onRegister"
                                                                ])
                                                            ]),
                                                        _: 1
                                                    }),
                                                    t(x, {
                                                        bordered: !1,
                                                        class: "proCard"
                                                    }, {
                                                        default: o(()=>[
                                                                t(n(ze), {
                                                                    columns: n(_),
                                                                    request: (r)=>oe(r, n(p)()),
                                                                    "row-key": (r)=>r.id,
                                                                    ref_key: "basicTableRef",
                                                                    ref: R,
                                                                    autoScrollX: !0,
                                                                    "virtual-scroll": "",
                                                                    actionColumn: n(G)
                                                                }, {
                                                                    tableTitle: o(()=>[
                                                                            t(A, null, {
                                                                                default: o(()=>[
                                                                                        t(N, {
                                                                                            type: "primary",
                                                                                            strong: "",
                                                                                            bordered: "",
                                                                                            secondary: "",
                                                                                            class: "size-7",
                                                                                            onClick: te
                                                                                        }, {
                                                                                            icon: o(()=>d[1] || (d[1] = [
                                                                                                    g("i", {
                                                                                                        class: "iconfont icon-ADD"
                                                                                                    }, null, -1)
                                                                                                ])),
                                                                                            _: 1
                                                                                        })
                                                                                    ]),
                                                                                _: 1
                                                                            })
                                                                        ]),
                                                                    _: 1
                                                                }, 8, [
                                                                    "columns",
                                                                    "request",
                                                                    "row-key",
                                                                    "actionColumn"
                                                                ])
                                                            ]),
                                                        _: 1
                                                    })
                                                ]),
                                            _: 1
                                        })
                                    ]),
                                _: 1
                            }),
                            t(Me, {
                                ref_key: "modalRef",
                                ref: m,
                                onSuccess: f
                            }, null, 512)
                        ]),
                    _: 1
                });
            };
        }
    });
});
export { Pt as default, __tla };
