import { B as L } from "./BasicForm-dL_oCSPM.js";
import { r as w, __tla as __tla_0 } from "./columns-CcSTU2Qa.js";
import { s as O, __tla as __tla_1 } from "./schemas-h8fDbkdf.js";
import { B as H } from "./Table-0PViRYCf.js";
import { d as U, V as A, bk as W, r as p, h as j, o as k, j as m, l as t, w as u, aH as z, ds as V, cO as X, fm as G, cq as P, aI as q, p as M, A as $, B as K, c as Z, ca as J, gW as Q, gX as Y, F as ee, hc as ne, bR as te, R as ae, cZ as oe, ac as re, __tla as __tla_2 } from "./index-9PRMimni.js";
import { c as se } from "./componentSetting-DVhNDBTO.js";
import { v as ie, __tla as __tla_3 } from "./schemas-DzvLPsci.js";
import { u as le } from "./useForm-CKmgcynv.js";
let ke;
let __tla = Promise.all([
    (()=>{
        try {
            return __tla_0;
        } catch  {}
    })(),
    (()=>{
        try {
            return __tla_1;
        } catch  {}
    })(),
    (()=>{
        try {
            return __tla_2;
        } catch  {}
    })(),
    (()=>{
        try {
            return __tla_3;
        } catch  {}
    })()
]).then(async ()=>{
    let me;
    me = {
        name: "CrewHospitalizingReport"
    };
    ke = U({
        ...me,
        props: {
            readonly: {
                type: Boolean,
                default: !1
            }
        },
        setup (E, { expose: v }) {
            const g = E, { t: y } = A(), _ = oe(), c = W(), s = p([]), d = p(), { schemasUpload: S } = O(), [b] = le({
                schemas: S,
                labelWidth: "auto",
                layout: "horizontal",
                collapsed: !0,
                gridProps: {
                    cols: 4,
                    xGap: 15
                },
                showActionButtonGroup: !1
            }), r = p([
                {
                    nameContent: "船舶信息和航行状态",
                    nameContentEn: "Ship’s identity and navigation status",
                    isWeight: !0
                },
                {
                    nameContent: "船名",
                    nameContentEn: "Ship Name",
                    title: "船东",
                    titleEn: "Owner",
                    isInput: !0,
                    remark1: "",
                    remark2: ""
                },
                {
                    nameContent: "岸上代理的姓名和地址",
                    nameContentEn: "Name And Address Of On-Shore Agent",
                    isInput: !0,
                    remark1: ""
                },
                {
                    nameContent: "发病时的位置（纬度/经度）",
                    nameContentEn: "Position (latitude, longitude) at onset of illness",
                    title: "目的港和预计到达时间",
                    titleEn: "Destination and ETA (expected time of arrival)",
                    isInput: !0,
                    isDate: !0,
                    remark1: "",
                    remark2: null
                },
                {
                    nameContent: "病员和医疗问题",
                    nameContentEn: "The patient and the medical problem",
                    isWeight: !0
                },
                {
                    nameContent: "病员姓名",
                    nameContentEn: "Surname and first name",
                    title: "性别",
                    titleEn: "Sex",
                    isInput: !0,
                    remark1: "",
                    remark2: "1"
                },
                {
                    nameContent: "出生日期(-年-月-日）",
                    nameContentEn: "Date of birth (dd-mm-yyyy)",
                    isDate: !0,
                    isInput: !0,
                    title: "国籍",
                    titleEn: "Nationality",
                    remark1: null,
                    remark2: ""
                },
                {
                    nameContent: "海员注册号",
                    nameContentEn: "Seafarer registration number",
                    isInput: !0,
                    title: "船上的工作职务",
                    titleEn: "Shipboard job title",
                    remark1: "",
                    remark2: ""
                },
                {
                    nameContent: "下班的时间和日期",
                    nameContentEn: "Hour and date when taken off work",
                    isDate: !0,
                    title: "重返工作岗位的时间和日期",
                    titleEn: "Hour and date when returned to work",
                    remark1: null,
                    remark2: null
                },
                {
                    nameContent: "受伤或疾病",
                    nameContentEn: "Injury or illness ",
                    isWeight: !0
                },
                {
                    nameContent: "受伤或发病的时间和日期",
                    nameContentEn: "Hour and date lf injury or onset of illness",
                    isDate: !0,
                    title: "首次检查或治疗的时间和日期",
                    titleEn: "Hour and date of first examination or treatment",
                    remark1: null,
                    remark2: null
                },
                {
                    nameContent: "受伤发生时船舶的位置",
                    nameContentEn: "Location on ship where injury occurred",
                    isInput: !0,
                    remark1: ""
                },
                {
                    nameContent: "受伤的情形",
                    nameContentEn: "Circumstances of injury",
                    isInput: !0,
                    remark1: ""
                },
                {
                    nameContent: "症状",
                    nameContentEn: "Symptoms",
                    isInput: !0,
                    remark1: ""
                },
                {
                    nameContent: "物理检查结果",
                    nameContentEn: "Findings of physical examination",
                    isInput: !0,
                    remark1: ""
                },
                {
                    nameContent: "X 射线或试验测试结果",
                    nameContentEn: "Findings of X-ray or laboratory tests",
                    isInput: !0,
                    remark1: ""
                },
                {
                    nameContent: "治疗前的临床总体印象",
                    nameContentEn: "Overall clinical impression before treatment",
                    isInput: !0,
                    remark1: ""
                },
                {
                    nameContent: "船上的治疗",
                    nameContentEn: "Treatment given on board",
                    isInput: !0,
                    remark1: ""
                },
                {
                    nameContent: "治疗后的临床总体印象",
                    nameContentEn: "Overall clinical impression after treatment",
                    isInput: !0,
                    remark1: ""
                },
                {
                    nameContent: "远程医疗会诊",
                    nameContentEn: "Telemedical consultation ",
                    isWeight: !0
                },
                {
                    nameContent: "初次联络的时间和日期",
                    nameContentEn: "Hour and date of initial contact",
                    isDate: !0,
                    title: "联络方式",
                    titleEn: "Mode of communication",
                    isInput: !0,
                    remark1: null,
                    remark2: ""
                },
                {
                    nameContent: "远程医疗顾问的姓氏和名字",
                    nameContentEn: "Surname and first name of telemedical consultant",
                    isInput: !0,
                    remark1: ""
                },
                {
                    nameContent: "远程医疗意见详情",
                    nameContentEn: "Details of telemedical advice given",
                    isInput: !0,
                    remark1: ""
                }
            ]), l = p(), { crewHospitalizingReportColumns: T } = w(g);
            function x() {
                return l.value?.getDataSource();
            }
            function N(e) {
                d.value = ie.find((n)=>n.id === e), r.value[1].remark1 = c.getLocale === "en" ? d.value?.shipNameEn || "" : d.value?.shipName || "";
            }
            async function I(e) {
                const n = await ne();
                N(n[0].id), r.value[5].remark1 = c.getLocale === "en" ? e?.crewNameEn : e?.crewName, r.value[6].remark1 = Date.parse(e?.birthday) || null, r.value[6].remark2 = c.getLocale === "en" ? e?.nationalNameEn : e?.nationalName, r.value[7].remark1 = e?.empNo || "", r.value[7].remark2 = c.getLocale === "en" ? e?.rankNameEn : e?.rankName, h();
            }
            function h() {
                l.value?.setBordered(!0), l.value?.setStriped(!1);
            }
            function R({ file: e, event: n }) {
                try {
                    const a = te("(" + n.target.response + ")"), { infoField: o } = se.upload.apiSetting, { code: f } = a, C = a.msg || a.message || "上传失败", i = a[o];
                    f === ae.SUCCESS ? e.thumbnailUrl = i.name : _.error(C);
                } catch  {}
            }
            function D(e, n) {
                r.value = e;
                const a = [];
                n && n.length > 0 && (n.forEach((o)=>{
                    o.fileType === "1" && a.push({
                        id: o.fileName || "",
                        url: o.fileUrl || "",
                        name: o.fileName?.split("/").pop() || "",
                        thumbnailUrl: o.fileName || "",
                        fileType: o.fileType,
                        status: "finished"
                    });
                }), s.value = a), re(()=>{
                    l.value?.reload(), h();
                });
            }
            function B() {
                const e = [];
                return s.value && s.value.length > 0 && s.value.forEach((n)=>{
                    e.push({
                        fileName: n.thumbnailUrl || "",
                        fileType: "1"
                    });
                }), e;
            }
            return v({
                handleOpen: I,
                voList: x,
                listInfo: D,
                getFileList: B
            }), (e, n)=>{
                const a = K, o = q, f = z, C = L;
                return k(), j(ee, null, [
                    m(t(H), {
                        class: "isTitleTable",
                        ref_key: "monthTableRef",
                        ref: l,
                        columns: t(T),
                        dataSource: t(r),
                        "row-key": (i)=>i.id,
                        autoScrollX: !0,
                        immediate: !1,
                        pagination: !1,
                        "show-table-setting": !1,
                        "can-resize": !1
                    }, null, 8, [
                        "columns",
                        "dataSource",
                        "row-key"
                    ]),
                    m(C, {
                        onRegister: t(b)
                    }, {
                        attachment: u(({})=>[
                                m(f, {
                                    action: `${t(P)().urlPrefix}/files`,
                                    accept: ".doc,.docx,.pdf,.xls,.xlsx",
                                    headers: {
                                        timestamp: new Date().getTime(),
                                        authorization: `${t(X).get(t(G))}`
                                    },
                                    max: 15,
                                    "file-list": t(s),
                                    "onUpdate:fileList": n[0] || (n[0] = (i)=>V(s) ? s.value = i : null),
                                    onFinish: n[1] || (n[1] = ({ file: i, event: F })=>R({
                                            file: i,
                                            event: F
                                        })),
                                    class: "uploadStyle",
                                    "file-list-style": {
                                        margin: 0,
                                        flex: 1
                                    },
                                    disabled: g.readonly
                                }, {
                                    default: u(()=>[
                                            m(o, {
                                                trigger: "hover"
                                            }, {
                                                trigger: u(()=>[
                                                        m(a, {
                                                            strong: "",
                                                            secondary: "",
                                                            class: "size-7"
                                                        }, {
                                                            icon: u(()=>[
                                                                    (k(), Z(J(t(Q)(t(Y).upload))))
                                                                ]),
                                                            _: 1
                                                        })
                                                    ]),
                                                default: u(()=>[
                                                        M(" " + $(t(y)("hsqe.rs.uploadText")), 1)
                                                    ]),
                                                _: 1
                                            })
                                        ]),
                                    _: 1
                                }, 8, [
                                    "action",
                                    "headers",
                                    "file-list",
                                    "disabled"
                                ])
                            ]),
                        _: 1
                    }, 8, [
                        "onRegister"
                    ])
                ], 64);
            };
        }
    });
});
export { ke as _, __tla };
