import { _ as v } from "./basicModal.vue_vue_type_script_setup_true_lang-CsJydKhW.js";
import "./basicModal.vue_vue_type_style_index_0_lang-8QZP7ApW.js";
import { h as T } from "./documentManagement-CH33LgfO.js";
import { V as g, bk as x, Z as m, ae as C, d as N, cq as S, r as d, a as R, c as V, o as B, l, w as D, j as I, ac as L, __tla as __tla_0 } from "./index-9PRMimni.js";
import { ae as q } from "./template-rpthWlT9.js";
import { B as A } from "./Table-0PViRYCf.js";
import { _ as E } from "./TableAction.vue_vue_type_script_setup_true_lang-Bj_Y4LtN.js";
import { g as O } from "./base64-BbY-I90a.js";
import { u as U } from "./useModal-CO65vga3.js";
let Y, Q;
let __tla = Promise.all([
    (()=>{
        try {
            return __tla_0;
        } catch  {}
    })()
]).then(async ()=>{
    const f = x(), { t: e } = g(), W = await q();
    function $(t) {
        return {
            0: {
                color: "rgba(33, 128, 241, 0.12)",
                textColor: "rgba(33, 128, 241, 1)",
                borderColor: "rgba(33, 128, 241, 0.50)"
            },
            1: {
                color: "rgba(213, 116, 116, 0.12)",
                textColor: "rgba(213, 116, 116, 1)",
                borderColor: "rgba(213, 116, 116, 0.50)"
            },
            2: {
                color: "rgba(29, 204, 183, 0.12)",
                textColor: "rgba(29, 204, 183, 1)",
                borderColor: "rgba(29, 204, 183, 0.50)"
            },
            3: {
                color: "rgba(213, 116, 116, 0.12)",
                textColor: "rgba(210, 76, 76, 1)",
                borderColor: "rgba(210, 76, 76, 0.50)"
            }
        }[t];
    }
    let j;
    Q = [
        {
            title: e("common.messagedefine.Num"),
            key: "num",
            width: 80,
            render: (t, o)=>o + 1
        },
        {
            title: e("document.documentManagement.fileNo"),
            key: "fileNo",
            width: 120
        },
        {
            title: e("document.documentManagement.fileName"),
            key: "fileName",
            width: 120,
            render: (t)=>f.getLocale === "en" ? t?.englishName : t?.chineseName
        },
        {
            title: e("document.documentManagement.fileVersion"),
            key: "version",
            width: 100
        },
        {
            title: e("document.documentManagement.rev"),
            key: "rev",
            width: 100
        },
        {
            title: e("document.documentManagement.effectiveDate"),
            key: "effectiveDate",
            width: 150
        },
        {
            title: e("document.documentManagement.status"),
            key: "status",
            width: 150,
            render (t) {
                const o = W.find((a)=>a.value == t.status) || {
                    label: t.label,
                    labelEn: t.label
                }, r = $(t.status);
                return m(C, {
                    color: r,
                    bordered: !0
                }, {
                    default: ()=>f.getLocale === "en" ? o.labelEn : o.label
                });
            }
        },
        {
            title: e("document.documentManagement.completedOn"),
            key: "updateTime",
            width: 150
        }
    ];
    j = [
        {
            title: e("common.messagedefine.Num"),
            key: "num",
            width: 80,
            render: (t, o)=>o + 1
        },
        {
            title: e("document.documentManagement.fileNo"),
            key: "fileNo",
            minWidth: 120
        },
        {
            title: e("document.documentManagement.fileName"),
            key: "fileName",
            minWidth: 120
        },
        {
            title: e("document.documentManagement.fileVersion"),
            key: "version",
            width: 100
        },
        {
            title: e("document.documentManagement.rev"),
            key: "rev",
            width: 100
        },
        {
            title: e("document.documentManagement.effectiveDate"),
            key: "effectiveDate",
            width: 150
        },
        {
            title: e("document.documentManagement.updateBy"),
            key: "createName",
            width: 150
        },
        {
            title: e("document.documentManagement.updateAt"),
            key: "createTime",
            width: 150
        }
    ];
    Y = N({
        __name: "HistoryModal",
        setup (t, { expose: o }) {
            const r = S(), { t: a } = g(), s = d(), u = d(), [b, { openModal: p, setProps: h }] = U({
                title: "",
                width: 1200
            }), y = R({
                width: 100,
                title: a("common.optionsText"),
                key: "action",
                fixed: "right",
                align: "center",
                render (n) {
                    return m(E, {
                        style: "text",
                        actions: [
                            {
                                label: a("common.optionsViewText"),
                                labelShow: !1,
                                icon: m("i", {
                                    class: "iconfont icon-View text-[#3F7AE9] text-[20px]"
                                }),
                                onClick: M.bind(null, n)
                            }
                        ]
                    });
                }
            });
            function w(n) {
                h({
                    title: a("document.documentManagement.history")
                }), p(), u.value = n.id, L(()=>{
                    s.value.reload();
                });
            }
            async function k(n, i) {
                return T({
                    ...n,
                    ...i,
                    documentId: u.value
                });
            }
            function M(n) {
                const { previewUrl: i } = r;
                window.open(i + encodeURIComponent(O.encode(n.fileUrl)), "_blank");
            }
            return o({
                handleOpenModal: w
            }), (n, i)=>{
                const _ = v;
                return B(), V(_, {
                    ref: "modalRef",
                    showAction: !1,
                    onRegister: l(b)
                }, {
                    default: D(()=>[
                            I(l(A), {
                                ref_key: "basicTableRef",
                                ref: s,
                                columns: l(j),
                                request: (c)=>k(c, {}),
                                "row-key": (c)=>c.id,
                                autoScrollX: !0,
                                actionColumn: l(y),
                                immediate: !1,
                                "virtual-scroll": ""
                            }, null, 8, [
                                "columns",
                                "request",
                                "row-key",
                                "actionColumn"
                            ])
                        ]),
                    _: 1
                }, 8, [
                    "onRegister"
                ]);
            };
        }
    });
});
export { Y as _, Q as c, __tla };
