import { B as k } from "./Table-0PViRYCf.js";
import { r as c, V as g, bk as v, Z as s, H as b, c9 as S, c8 as I, n as w, k as T, d as x, gF as M, gG as V, aw as O, h as C, o as L, j as B, l as d, ac as N, __tla as __tla_0 } from "./index-9PRMimni.js";
import { a1 as m } from "./template-rpthWlT9.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 "./index-kKnqLkWM.js";
let se;
let __tla = Promise.all([
    (()=>{
        try {
            return __tla_0;
        } catch  {}
    })()
]).then(async ()=>{
    const { t: r } = g(), f = v(), h = c(), _ = c();
    try {
        h.value = await m("comment_yes_no"), _.value = await m("good_fair_poor");
    } catch (a) {
        console.error(a);
    }
    function q(a = {}) {
        const o = c(!1);
        return {
            columns: [
                {
                    title: r("hsqe.auditInspection.vesselInspection.shipVisitReport.certificateSMS.no"),
                    key: "no",
                    align: "center",
                    width: 30,
                    render: (e, i)=>i + 1
                },
                {
                    title: r("hsqe.auditInspection.vesselInspection.shipVisitReport.certificateSMS.content"),
                    key: f.getLocale === "en" ? "inspectionContentEn" : "inspectionContentZh",
                    width: 300,
                    ellipsis: !1
                },
                {
                    title: ()=>s("span", [
                            o.value ? "" : s(w, {
                                style: {
                                    marginRight: "8px"
                                },
                                onUpdateChecked: (e)=>{
                                    a?.handleSelectAll?.(e);
                                }
                            }),
                            r("hsqe.auditInspection.vesselInspection.shipVisitReport.certificateSMS.result"),
                            s("span", {
                                style: {
                                    color: "red",
                                    marginLeft: "4px"
                                }
                            }, "*")
                        ]),
                    key: "inspectionResult",
                    width: 120,
                    editRule: !0,
                    render (e) {
                        const i = e.type === "yes_no" ? h.value : _.value;
                        return s(I, {
                            value: e.inspectionResult,
                            disabled: o.value,
                            onUpdateValue (n) {
                                e.inspectionResult = n;
                            }
                        }, ()=>s(b, {}, i?.map((n)=>s(S, {
                                    label: f.getLocale === "en" ? n?.labelEn : n?.label,
                                    value: n.value
                                }))));
                    }
                },
                {
                    title: r("hsqe.auditInspection.vesselInspection.shipVisitReport.certificateSMS.remark"),
                    key: "remark",
                    width: 160,
                    align: "left",
                    ellipsis: !1,
                    render (e, i) {
                        return o.value ? e.remark : s(T, {
                            type: "textarea",
                            maxlength: 100,
                            style: {
                                width: "100%"
                            },
                            "show-count": !0,
                            value: e.remark,
                            autosize: {
                                minRows: 1,
                                maxRows: 3
                            },
                            onUpdateValue (n) {
                                e.remark = n;
                            }
                        });
                    }
                }
            ],
            methods: {
                setReadOnly: (e)=>{
                    o.value = e;
                }
            }
        };
    }
    se = x({
        __name: "index",
        props: M({
            currentTab: {},
            readOnly: {
                type: Boolean
            }
        }, {
            dataInfo: {
                type: Object,
                default: ()=>({})
            },
            dataInfoModifiers: {}
        }),
        emits: [
            "update:dataInfo"
        ],
        setup (a) {
            const o = a, l = V(a, "dataInfo"), u = c(), { columns: e, methods: i } = q({
                handleSelectAll: n
            });
            function n(p) {
                p ? (l.value.checkTeb?.[o.currentTab] || []).filter((t)=>{
                    t.inspectionResult !== "No" && t.inspectionResult !== "poor" && (t.type === "yes_no" ? t.inspectionResult = "Yes" : t.inspectionResult = "good");
                }) : (l.value.checkTeb?.[o.currentTab] || []).filter((t)=>{
                    t.inspectionResult !== "No" && t.inspectionResult !== "poor" && (t.inspectionResult = "");
                });
            }
            function y() {
                N(()=>{
                    i.setReadOnly(o.readOnly);
                });
            }
            return O(()=>{
                y();
            }), (p, t)=>(L(), C("div", null, [
                    B(d(k), {
                        ref_key: "tableRef",
                        ref: u,
                        dataSource: l.value.checkTeb?.[p.currentTab],
                        columns: d(e),
                        "row-key": (R)=>R.id,
                        pagination: !1,
                        autoScrollX: !0,
                        "virtual-scroll": !1,
                        showTableSetting: !1,
                        canResize: !1
                    }, null, 8, [
                        "dataSource",
                        "columns",
                        "row-key"
                    ])
                ]));
        }
    });
});
export { se as default, __tla };
