import { defineComponent as b, resolveComponent as f, openBlock as s, createBlock as k, withCtx as m, createTextVNode as W, toDisplayString as c, createCommentVNode as $, ref as y, onMounted as E, mergeProps as D, createVNode as T, createElementBlock as v, Fragment as w, renderList as L, createElementVNode as u } from "vue";
import { g as S, b as h } from "./index.e7201430.js";
const M = b({
  props: {
    dict: {
      type: [String],
      default: ""
    },
    value: {
      type: [String],
      default: ""
    },
    color: {
      type: [String],
      default: ""
    }
  },
  setup(e) {
    const a = {
      success: ["COMPLETED"],
      processing: ["OTHER_HANDLE", "DELIVER", "ENTRUST", "READ", "JUMP"],
      error: ["BACK", "OTHER_BACK"],
      default: ["END"],
      warning: ["WAIT_HANDLE", "HANDLE", "WAIT"]
    };
    function i() {
      if (e.color)
        return e.color;
      for (let n in a)
        if (a[n].includes(e.value))
          return n;
      return "processing";
    }
    function d(n, _) {
      return n ? S("showDictionary")(n, _) : _;
    }
    return { getColor: i, showDict: d };
  }
});
function C(e, a, i, d, n, _) {
  const p = f("a-tag");
  return e.showDict(e.dict, e.value) ? (s(), k(p, {
    key: 0,
    color: e.getColor()
  }, {
    default: m(() => [
      W(c(e.showDict(e.dict, e.value)), 1)
    ]),
    _: 1
  }, 8, ["color"])) : $("", !0);
}
const B = /* @__PURE__ */ h(M, [["render", C]]), N = B;
const I = b({
  components: { WorkflowStatus: N },
  emits: ["register"],
  setup(e, { emit: a }) {
    const i = y(!1), d = y({}), n = y([]);
    function _(l = {}) {
      i.value = !0;
      const { data: r = {} } = l;
      d.value = r;
      const { id: t = "" } = r;
      g(t);
    }
    function p() {
      i.value = !1;
    }
    function g(l) {
      !l || S("apis").getWorkflowTaskHistory({ id: l }).then((r) => {
        const { data: t } = r;
        n.value = t;
      });
    }
    return E(() => {
      a("register", { openModal: _, closeModal: p });
    }), {
      visible: i,
      modalData: d,
      timeLine: n
    };
  }
}), R = { class: "time-title" }, H = {
  key: 0,
  style: { color: "red" }
}, U = { style: { color: "blue" } }, K = {
  key: 0,
  class: "time-content"
}, O = { key: 0 }, V = { key: 1 };
function P(e, a, i, d, n, _) {
  const p = f("WorkflowStatus"), g = f("a-card"), l = f("a-timeline-item"), r = f("a-timeline"), t = f("a-drawer");
  return s(), k(t, D({
    title: "\u6D41\u7A0B\u8F68\u8FF9",
    visible: e.visible,
    "onUpdate:visible": a[0] || (a[0] = (o) => e.visible = o)
  }, e.$attrs), {
    default: m(() => [
      T(r, null, {
        default: m(() => [
          (s(!0), v(w, null, L(e.timeLine, (o, A) => (s(), k(l, { key: A }, {
            default: m(() => [
              u("div", R, [
                o.type === "BACK" ? (s(), v("span", H, "\u3010\u9000\u56DE\u3011")) : $("", !0),
                T(p, {
                  dict: "TASK_HISTORY_STATUS",
                  value: o.executeType
                }, null, 8, ["value"]),
                u("span", U, c(o.stepName), 1)
              ]),
              o != "JUMP" ? (s(), v("div", K, [
                T(g, { size: "small" }, {
                  default: m(() => [
                    o.prevId != "00000000000000000000000000000000" ? (s(), v(w, { key: 0 }, [
                      u("p", null, "\u53D1\u9001\u4EBA\uFF1A" + c(o.senderName), 1),
                      u("p", null, "\u53D1\u9001\u65F6\u95F4\uFF1A" + c(o.sendTime), 1)
                    ], 64)) : (s(), v(w, { key: 1 }, [
                      u("p", null, "\u5904\u7406\u4EBA\uFF1A" + c(o.receiverName), 1),
                      o.openTime ? (s(), v("p", O, "\u67E5\u770B\u65F6\u95F4\uFF1A" + c(o.openTime), 1)) : $("", !0),
                      o.completedTime ? (s(), v("p", V, "\u5904\u7406\u65F6\u95F4\uFF1A" + c(o.completedTime), 1)) : (s(), k(p, {
                        key: 2,
                        dict: "WORKFLOW_TASK_STATUS",
                        value: o.executeType
                      }, null, 8, ["value"]))
                    ], 64))
                  ]),
                  _: 2
                }, 1024)
              ])) : $("", !0)
            ]),
            _: 2
          }, 1024))), 128))
        ]),
        _: 1
      })
    ]),
    _: 1
  }, 16, ["visible"]);
}
const Q = /* @__PURE__ */ h(I, [["render", P], ["__scopeId", "data-v-baa42c8e"]]);
const z = b({
  components: { WorkflowStatus: N },
  emits: ["register"],
  setup(e, { emit: a }) {
    const i = y(!1), d = y({}), n = y([]);
    function _(l = {}) {
      i.value = !0;
      const { data: r = {} } = l;
      d.value = r;
      const { instanceId: t = "" } = r;
      g(t);
    }
    function p() {
      i.value = !1;
    }
    function g(l) {
      !l || S("apis").getBackList({ instanceId: l }).then((r) => {
        const { data: t } = r;
        console.log(t), n.value = t;
      });
    }
    return E(() => {
      a("register", { openModal: _, closeModal: p });
    }), {
      visible: i,
      modalData: d,
      timeLine: n
    };
  }
}), F = { class: "time-title" }, J = { style: { color: "blue" } }, Y = { class: "time-content" };
function j(e, a, i, d, n, _) {
  const p = f("a-card"), g = f("a-timeline-item"), l = f("a-timeline"), r = f("a-drawer");
  return s(), k(r, D({
    title: "\u9000\u56DE\u4FE1\u606F",
    visible: e.visible,
    "onUpdate:visible": a[0] || (a[0] = (t) => e.visible = t)
  }, e.$attrs), {
    default: m(() => [
      T(l, null, {
        default: m(() => [
          (s(!0), v(w, null, L(e.timeLine, (t, o) => (s(), k(g, { key: o }, {
            default: m(() => [
              u("div", F, [
                u("span", J, c(t.stepName), 1)
              ]),
              u("div", Y, [
                T(p, { size: "small" }, {
                  default: m(() => [
                    u("p", null, "\u53D1\u9001\u4EBA\uFF1A" + c(t.senderName), 1),
                    u("p", null, "\u53D1\u9001\u65F6\u95F4\uFF1A" + c(t.sendTime), 1),
                    u("p", null, "\u9000\u56DE\u539F\u56E0\uFF1A" + c(t.note || ""), 1)
                  ]),
                  _: 2
                }, 1024)
              ])
            ]),
            _: 2
          }, 1024))), 128))
        ]),
        _: 1
      })
    ]),
    _: 1
  }, 16, ["visible"]);
}
const X = /* @__PURE__ */ h(z, [["render", j], ["__scopeId", "data-v-5cfe8046"]]);
export {
  N as W,
  Q as a,
  X as b
};
