import { B as U } from "./Table-0PViRYCf.js";
import { r as n, V as B, Z as i, S as L, bk as z, H as b, c9 as E, c8 as H, k, d as K, aw as P, ac as Y, h as Z, o as $, j as x, l as y, v as j, __tla as __tla_0 } from "./index-9PRMimni.js";
import { _ as G, __tla as __tla_1 } from "./Modal.vue_vue_type_script_setup_true_lang-hxh84a9j.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 "./BasicForm-dL_oCSPM.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";
import "./useForm-CKmgcynv.js";
import "./template-rpthWlT9.js";
import "./helper-Czt-QYps.js";
import "./memoize-C3Z21RQJ.js";
let Be;
let __tla = Promise.all([
    (()=>{
        try {
            return __tla_0;
        } catch  {}
    })(),
    (()=>{
        try {
            return __tla_1;
        } catch  {}
    })()
]).then(async ()=>{
    const W = z(), { t: s } = B(), X = (o)=>o == "yes_no" ? [
            {
                label: s("common.yes"),
                value: "Yes"
            },
            {
                label: s("common.no"),
                value: "No"
            }
        ] : [
            {
                label: s("common.good"),
                value: "good"
            },
            {
                label: s("common.fair"),
                value: "fair"
            },
            {
                label: s("common.poor"),
                value: "poor"
            }
        ];
    function A(o) {
        const u = n(o?.summaryInput || ""), v = ()=>({
                no: {
                    align: "left",
                    ellipsis: !1,
                    value: i(b, {
                        class: "sumary-row"
                    }, ()=>[
                            i("span", {
                                style: {
                                    lineHeight: "34px"
                                }
                            }, s("hsqe.auditInspection.vesselInspection.generalComment")),
                            i(k, {
                                type: "textarea",
                                autosize: {
                                    minRows: 1,
                                    maxRows: 6
                                },
                                style: {
                                    width: "100%"
                                },
                                value: u.value,
                                disabled: o?.readOnly,
                                onUpdateValue: (t)=>{
                                    console.log("汇总输入:", t), u.value = t, o?.updateSummaryInput?.(t);
                                }
                            })
                        ]),
                    colSpan: 4
                }
            });
        return {
            columns: [
                {
                    title: s("hsqe.auditInspection.vesselInspection.shipVisitReport.certificateSMS.no"),
                    key: "no",
                    align: "left",
                    width: 30,
                    render: (t, l)=>i(L, {}, ()=>(l + 1).toString())
                },
                {
                    align: "left",
                    title: s("hsqe.auditInspection.vesselInspection.shipVisitReport.certificateSMS.content"),
                    key: W.getLocale === "en" ? "inspectionContentEn" : "inspectionContentZh",
                    width: 300,
                    ellipsis: !1
                },
                {
                    title: s("hsqe.auditInspection.vesselInspection.shipVisitReport.certificateSMS.result"),
                    key: "inspectionResult",
                    width: 80,
                    editRule: !0,
                    render (t, l) {
                        return i(H, {
                            value: t.inspectionResult,
                            disabled: o?.readOnly || t.inspectionResult === "No",
                            onUpdateValue (a) {
                                t.inspectionResult = a, o?.updateResult?.(t, l);
                            }
                        }, ()=>i(b, {}, ()=>X(t.type).map((a)=>i(E, {
                                        label: a.label,
                                        value: a.value
                                    }))));
                    }
                },
                {
                    title: s("hsqe.auditInspection.vesselInspection.shipVisitReport.certificateSMS.remark"),
                    key: "remark",
                    width: 160,
                    align: "left",
                    ellipsis: !1,
                    render (t, l) {
                        return o?.readOnly ? t.remark : i(k, {
                            type: "textarea",
                            maxlength: 100,
                            style: {
                                width: "100%"
                            },
                            "show-count": !0,
                            value: t.remark,
                            disabled: o?.readOnly,
                            autosize: {
                                minRows: 1,
                                maxRows: 3
                            },
                            onUpdateValue (a) {
                                t.remark = a;
                            }
                        });
                    }
                }
            ],
            summary: v,
            summaryInput: u
        };
    }
    let F;
    F = K({
        __name: "index",
        emits: [
            "getData"
        ],
        setup (o, { expose: u, emit: v }) {
            const f = v, t = n(""), l = n(!1), a = n(), _ = n(), h = n(), m = n(), r = n([]), g = n(), I = n(), R = n();
            function w(e) {
                console.log("rowKeys", e);
            }
            async function V() {
                return {
                    list: r.value,
                    total: r.value.length
                };
            }
            function O() {
                return {
                    tableList: m.value?.getDataSource(),
                    summaryInput: t.value
                };
            }
            const S = n();
            function C(e) {
                (e.inspectionResult === "No" || e.inspectionResult === "Poor") && (console.log("去缺陷反馈页面"), S.value?.showModal(h.value, {
                    ...e,
                    shipId: g.value,
                    plannerId: I.value,
                    visitType: R.value
                }));
            }
            function D(e) {
                t.value = e;
            }
            function N(e) {
                console.log("val: ", e);
            }
            function T() {}
            function q(e, c, p) {
                const d = r.value.find((M)=>M.id === e.id);
                d && (p && p !== "" ? (d.inspectionResult = e.type == "yes_no" ? "No" : "Poor", d.deficiencyId = p) : d.inspectionResult = e.type == "yes_no" ? "Yes" : "Good");
            }
            return P(()=>{
                f("getData", (e)=>{
                    r.value = e.tableList, t.value = e.summaryInput || "", l.value = e.readOnly, h.value = e.reportNum, g.value = e.shipId, I.value = e.plannerId, R.value = e.visitType;
                    const c = A({
                        updateResult: C,
                        updateSummaryInput: D,
                        summaryInput: String(t.value),
                        readOnly: l.value
                    });
                    a.value = c.columns, _.value = c.summary;
                }), m?.value?.setBordered(!0), Y(()=>{
                    m?.value?.setDataSource(r.value);
                });
            }), u({
                setData: N,
                getData: O
            }), (e, c)=>($(), Z("div", null, [
                    x(y(U), {
                        ref_key: "tableRef",
                        ref: m,
                        columns: y(a),
                        request: V,
                        "row-key": (p)=>p.id,
                        pagination: !1,
                        "onUpdate:checkedRowKeys": w,
                        autoScrollX: !0,
                        "virtual-scroll": "",
                        summary: y(_),
                        showTableSetting: !1
                    }, null, 8, [
                        "columns",
                        "row-key",
                        "summary"
                    ]),
                    x(G, {
                        ref_key: "modalRef",
                        ref: S,
                        onSuccess: T,
                        onChangeResult: q
                    }, null, 512)
                ]));
        }
    });
    Be = j(F, [
        [
            "__scopeId",
            "data-v-5940103c"
        ]
    ]);
});
export { Be as default, __tla };
