import { B as I } from "./BasicForm-dL_oCSPM.js";
import { r as N, __tla as __tla_0 } from "./columns-CcSTU2Qa.js";
import { B as D } from "./Table-0PViRYCf.js";
import { d as U, V as L, bk as O, r as d, h as P, o as h, j as i, l as a, w as m, aH as H, ds as z, cO as A, fm as V, cq as G, aI as M, p as W, A as j, B as q, c as X, ca as Y, gW as $, gX as K, F as Z, ac as J, bR as Q, R as ee, cZ as te, __tla as __tla_1 } from "./index-9PRMimni.js";
import { s as ne, __tla as __tla_2 } from "./schemas-h8fDbkdf.js";
import { c as ae } from "./componentSetting-DVhNDBTO.js";
import { u as oe } from "./useForm-CKmgcynv.js";
let de;
let __tla = Promise.all([
    (()=>{
        try {
            return __tla_0;
        } catch  {}
    })(),
    (()=>{
        try {
            return __tla_1;
        } catch  {}
    })(),
    (()=>{
        try {
            return __tla_2;
        } catch  {}
    })()
]).then(async ()=>{
    let se;
    se = {
        name: "PatientHealthStatus"
    };
    de = U({
        ...se,
        props: {
            readonly: {
                type: Boolean,
                default: !1
            }
        },
        setup (_, { expose: k }) {
            const f = _, { t: b } = L(), y = te(), C = O(), s = d([]), { schemasUpload: E } = ne(), [S] = oe({
                schemas: E,
                labelWidth: "auto",
                layout: "horizontal",
                collapsed: !0,
                gridProps: {
                    cols: 4,
                    xGap: 15
                },
                showActionButtonGroup: !1
            }), { patientHealthStatusColumns: v } = N(f), u = d([
                {
                    nameContent: "姓名",
                    nameContentEn: "Surname and first name",
                    title: "年龄（岁）",
                    titleEn: "Age (years)",
                    isInput: !0,
                    remark: "",
                    remark2: ""
                },
                {
                    nameContent: "性别",
                    nameContentEn: "Sex",
                    title: "日期和时间",
                    titleEn: "Time (hour) and date",
                    isInput: !0,
                    remark: "1",
                    remark2: null
                },
                {
                    nameContent: "生命体征",
                    nameContentEn: "Vital signs",
                    title: "血压（收缩压/舒张压）",
                    titleEn: "Blood pressure (systolic/diastolic)",
                    isInput: !0,
                    remark: "",
                    remark2: ""
                },
                {
                    nameContent: "脉搏（次/分钟）",
                    nameContentEn: "Pulse (beats/min)",
                    title: "体温（口腔），注明华氏度或摄氏度",
                    titleEn: "Body temperature (oral), note F or ℃",
                    isInput: !0,
                    remark: "",
                    remark2: ""
                },
                {
                    nameContent: "呈现的医疗问题：症状，疼痛或受伤的位置，发病时间，持续时间，导致症状的因素",
                    nameContentEn: "Presenting medical problem: symptoms, site (s) of pain or injury, time of onset, duration of problem, contributing factors",
                    title: "治疗（药物，敷料等）",
                    titleEn: "Treatment given (medication, dressings, etc.)",
                    isInput: !0,
                    remark: "",
                    remark2: ""
                },
                {
                    nameContent: "接收的远程医疗意见",
                    nameContentEn: "Telemedical advice received",
                    title: "其他当前的医疗问题",
                    titleEn: "Other current medical problems",
                    isInput: !0,
                    remark: "",
                    remark2: ""
                },
                {
                    nameContent: "过去重要的医疗史",
                    nameContentEn: "Past history of significant medical problems",
                    title: "当前正在采取治疗的药物（通用和品牌名称，用量；最后一剂的时间）",
                    titleEn: "Current medication being taken (generic and brand names; dosage; time of last dose)",
                    isInput: !0,
                    remark: "",
                    remark2: ""
                },
                {
                    nameContent: "其他",
                    nameContentEn: "Other",
                    title: "",
                    titleEn: "",
                    isInput: !0,
                    remark: "",
                    remark2: ""
                }
            ]), l = d();
            function T() {
                return l.value?.getDataSource();
            }
            function x(n) {
                u.value[0].remark = C.getLocale === "en" ? n?.crewNameEn || "" : n?.crewName || "";
                let e = n?.birthday || "1994-03-02", t = new Date().getFullYear() - new Date(e).getFullYear() - (new Date().getMonth() < new Date(e).getMonth() ? 1 : 0);
                u.value[0].remark2 = t.toString(), g();
            }
            function g() {
                l.value?.setBordered(!0), l.value?.setStriped(!1);
            }
            function B(n, e) {
                u.value = n;
                const t = [];
                e && e.length > 0 && (e.forEach((o)=>{
                    o.fileType === "3" && t.push({
                        id: o.fileName || "",
                        url: o.fileUrl || "",
                        name: o.fileName?.split("/").pop() || "",
                        thumbnailUrl: o.fileName || "",
                        fileType: o.fileType,
                        status: "finished"
                    });
                }), s.value = t), J(()=>{
                    l.value?.reload(), g();
                });
            }
            function F({ file: n, event: e }) {
                try {
                    const t = Q("(" + e.target.response + ")"), { infoField: o } = ae.upload.apiSetting, { code: c } = t, p = t.msg || t.message || "上传失败", r = t[o];
                    c === ee.SUCCESS ? n.thumbnailUrl = r.name : y.error(p);
                } catch  {}
            }
            function R() {
                const n = [];
                return s.value && s.value.length > 0 && s.value.forEach((e)=>{
                    n.push({
                        fileName: e.thumbnailUrl || "",
                        fileType: "3"
                    });
                }), n;
            }
            return k({
                handleOpen: x,
                voList: T,
                listInfo: B,
                getFileList: R
            }), (n, e)=>{
                const t = q, o = M, c = H, p = I;
                return h(), P(Z, null, [
                    i(a(D), {
                        class: "isTitleTable",
                        ref_key: "patientHealthStatusTableRef",
                        ref: l,
                        columns: a(v),
                        dataSource: a(u),
                        "row-key": (r)=>r.id,
                        autoScrollX: !0,
                        immediate: !1,
                        pagination: !1,
                        "show-table-setting": !1,
                        "can-resize": !1
                    }, null, 8, [
                        "columns",
                        "dataSource",
                        "row-key"
                    ]),
                    i(p, {
                        onRegister: a(S)
                    }, {
                        attachment: m(({})=>[
                                i(c, {
                                    action: `${a(G)().urlPrefix}/files`,
                                    accept: ".doc,.docx,.pdf,.xls,.xlsx",
                                    headers: {
                                        timestamp: new Date().getTime(),
                                        authorization: `${a(A).get(a(V))}`
                                    },
                                    max: 15,
                                    "file-list": a(s),
                                    "onUpdate:fileList": e[0] || (e[0] = (r)=>z(s) ? s.value = r : null),
                                    onFinish: e[1] || (e[1] = ({ file: r, event: w })=>F({
                                            file: r,
                                            event: w
                                        })),
                                    class: "uploadStyle",
                                    "file-list-style": {
                                        margin: 0,
                                        flex: 1
                                    },
                                    disabled: f.readonly
                                }, {
                                    default: m(()=>[
                                            i(o, {
                                                trigger: "hover"
                                            }, {
                                                trigger: m(()=>[
                                                        i(t, {
                                                            strong: "",
                                                            secondary: "",
                                                            class: "size-7"
                                                        }, {
                                                            icon: m(()=>[
                                                                    (h(), X(Y(a($)(a(K).upload))))
                                                                ]),
                                                            _: 1
                                                        })
                                                    ]),
                                                default: m(()=>[
                                                        W(" " + j(a(b)("hsqe.rs.uploadText")), 1)
                                                    ]),
                                                _: 1
                                            })
                                        ]),
                                    _: 1
                                }, 8, [
                                    "action",
                                    "headers",
                                    "file-list",
                                    "disabled"
                                ])
                            ]),
                        _: 1
                    }, 8, [
                        "onRegister"
                    ])
                ], 64);
            };
        }
    });
});
export { de as _, __tla };
