import { defineComponent as ue, resolveComponent as x, openBlock as M, createBlock as V, withCtx as O, createTextVNode as ve, toDisplayString as C, createCommentVNode as P, ref as H, onMounted as ce, mergeProps as ge, createVNode as E, createElementBlock as b, Fragment as q, renderList as Me, createElementVNode as L, h as ye, reactive as Te, computed as ke, watch as Se, unref as G } from "vue";
import { message as be, Card as Ye, InputSearch as Ae, Tree as Fe, Button as Be } from "ant-design-vue";
import { useRouter as Ce } from "vue-router";
import { g as J, a as le, c as de, o as Le, b as We, C as Ee, W as Ie } from "./index.9e744748.js";
import "sanzhi-form-design-vue3";
import "axios";
const Oe = ue({
  props: {
    dict: {
      type: [String],
      default: ""
    },
    value: {
      type: [String],
      default: ""
    },
    color: {
      type: [String],
      default: ""
    }
  },
  setup(d) {
    const g = {
      success: ["COMPLETED"],
      processing: ["OTHER_HANDLE", "DELIVER", "ENTRUST", "READ", "JUMP"],
      error: ["BACK", "OTHER_BACK"],
      default: ["END"],
      warning: ["WAIT_HANDLE", "HANDLE", "WAIT"]
    };
    function i() {
      if (d.color)
        return d.color;
      for (let f in g)
        if (g[f].includes(d.value))
          return f;
      return "processing";
    }
    function y(f, m) {
      return J("showDictionary")(f, m);
    }
    return { getColor: i, showDict: y };
  }
});
function xe(d, g, i, y, f, m) {
  const p = x("a-tag");
  return d.showDict(d.dict, d.value) ? (M(), V(p, {
    key: 0,
    color: d.getColor()
  }, {
    default: O(() => [
      ve(C(d.showDict(d.dict, d.value)), 1)
    ]),
    _: 1
  }, 8, ["color"])) : P("", !0);
}
const Ne = /* @__PURE__ */ le(Oe, [["render", xe]]), fe = Ne, Pe = ue({
  components: { WorkflowStatus: fe },
  emits: ["register"],
  setup(d, { emit: g }) {
    const i = H(!1), y = H({}), f = H([]);
    function m(_ = {}) {
      i.value = !0;
      const { data: u = {} } = _;
      y.value = u;
      const { id: r = "" } = u;
      a(r);
    }
    function p() {
      i.value = !1;
    }
    function a(_) {
      !_ || J("apis").getWorkflowTaskHistory({ id: _ }).then((u) => {
        const { data: r } = u;
        f.value = r;
      });
    }
    return ce(() => {
      g("register", { openModal: m, closeModal: p });
    }), {
      visible: i,
      modalData: y,
      timeLine: f
    };
  }
}), He = { class: "time-title" }, Re = {
  key: 0,
  style: { color: "red" }
}, Ke = { style: { color: "blue" } }, Ue = {
  key: 0,
  class: "time-content"
}, Qe = { key: 0 }, je = { key: 1 };
function Ve(d, g, i, y, f, m) {
  const p = x("WorkflowStatus"), a = x("a-timeline-item"), _ = x("a-timeline"), u = x("a-drawer");
  return M(), V(u, ge({
    visible: d.visible,
    "onUpdate:visible": g[0] || (g[0] = (r) => d.visible = r)
  }, d.$attrs), {
    default: O(() => [
      E(_, null, {
        default: O(() => [
          (M(!0), b(q, null, Me(d.timeLine, (r, h) => (M(), V(a, { key: h }, {
            default: O(() => [
              L("div", He, [
                r.type === "BACK" ? (M(), b("span", Re, "\u3010\u9000\u56DE\u3011")) : P("", !0),
                E(p, {
                  dict: "TASK_HISTORY_STATUS",
                  value: r.executeType
                }, null, 8, ["value"]),
                L("span", Ke, C(r.stepName), 1)
              ]),
              r != "JUMP" ? (M(), b("div", Ue, [
                r.prevId != "00000000000000000000000000000000" ? (M(), b(q, { key: 0 }, [
                  L("p", null, "\u53D1\u9001\u4EBA\uFF1A" + C(r.senderName), 1),
                  L("p", null, "\u53D1\u9001\u65F6\u95F4\uFF1A" + C(r.sendTime), 1)
                ], 64)) : (M(), b(q, { key: 1 }, [
                  L("p", null, "\u5904\u7406\u4EBA\uFF1A" + C(r.receiverName), 1),
                  r.openTime ? (M(), b("p", Qe, "\u67E5\u770B\u65F6\u95F4\uFF1A" + C(r.openTime), 1)) : P("", !0),
                  r.completedTime ? (M(), b("p", je, "\u5904\u7406\u65F6\u95F4\uFF1A" + C(r.completedTime), 1)) : (M(), V(p, {
                    key: 2,
                    dict: "WORKFLOW_TASK_STATUS",
                    value: r.executeType
                  }, null, 8, ["value"]))
                ], 64))
              ])) : P("", !0)
            ]),
            _: 2
          }, 1024))), 128))
        ]),
        _: 1
      })
    ]),
    _: 1
  }, 16, ["visible"]);
}
const Je = /* @__PURE__ */ le(Pe, [["render", Ve]]), Ze = ue({
  components: { WorkflowStatus: fe },
  emits: ["register"],
  setup(d, { emit: g }) {
    const i = H(!1), y = H({}), f = H([]);
    function m(_ = {}) {
      i.value = !0;
      const { data: u = {} } = _;
      y.value = u;
      const { instanceId: r = "" } = u;
      a(r);
    }
    function p() {
      i.value = !1;
    }
    function a(_) {
      !_ || J("apis").getBackList({ instanceId: _ }).then((u) => {
        const { data: r } = u;
        f.value = r;
      });
    }
    return ce(() => {
      g("register", { openModal: m, closeModal: p });
    }), {
      visible: i,
      modalData: y,
      timeLine: f
    };
  }
}), ze = { class: "time-title" }, Ge = {
  key: 0,
  style: { color: "red" }
}, qe = { style: { color: "blue" } }, Xe = {
  key: 0,
  class: "time-content"
}, et = { key: 0 }, tt = { key: 1 };
function nt(d, g, i, y, f, m) {
  const p = x("WorkflowStatus"), a = x("a-timeline-item"), _ = x("a-timeline"), u = x("a-drawer");
  return M(), V(u, ge({
    visible: d.visible,
    "onUpdate:visible": g[0] || (g[0] = (r) => d.visible = r)
  }, d.$attrs), {
    default: O(() => [
      E(_, null, {
        default: O(() => [
          (M(!0), b(q, null, Me(d.timeLine, (r, h) => (M(), V(a, { key: h }, {
            default: O(() => [
              L("div", ze, [
                r.type === "BACK" ? (M(), b("span", Ge, "\u3010\u9000\u56DE\u3011")) : P("", !0),
                E(p, {
                  dict: "TASK_HISTORY_STATUS",
                  value: r.executeType
                }, null, 8, ["value"]),
                L("span", qe, C(r.stepName), 1)
              ]),
              r != "JUMP" ? (M(), b("div", Xe, [
                r.prevId != "00000000000000000000000000000000" ? (M(), b(q, { key: 0 }, [
                  L("p", null, "\u53D1\u9001\u4EBA\uFF1A" + C(r.senderName), 1),
                  L("p", null, "\u53D1\u9001\u65F6\u95F4\uFF1A" + C(r.sendTime), 1)
                ], 64)) : (M(), b(q, { key: 1 }, [
                  L("p", null, "\u5904\u7406\u4EBA\uFF1A" + C(r.receiverName), 1),
                  r.openTime ? (M(), b("p", et, "\u67E5\u770B\u65F6\u95F4\uFF1A" + C(r.openTime), 1)) : P("", !0),
                  r.completedTime ? (M(), b("p", tt, "\u5904\u7406\u65F6\u95F4\uFF1A" + C(r.completedTime), 1)) : (M(), V(p, {
                    key: 2,
                    dict: "WORKFLOW_TASK_STATUS",
                    value: r.executeType
                  }, null, 8, ["value"]))
                ], 64))
              ])) : P("", !0)
            ]),
            _: 2
          }, 1024))), 128))
        ]),
        _: 1
      })
    ]),
    _: 1
  }, 16, ["visible"]);
}
const rt = /* @__PURE__ */ le(Ze, [["render", nt]]);
var pe = { exports: {} };
(function(d, g) {
  (function(i, y) {
    d.exports = y();
  })(de, function() {
    var i = 1e3, y = 6e4, f = 36e5, m = "millisecond", p = "second", a = "minute", _ = "hour", u = "day", r = "week", h = "month", B = "quarter", D = "year", I = "date", R = "Invalid Date", X = /^(\d{4})[-/]?(\d{1,2})?[-/]?(\d{0,2})[Tt\s]*(\d{1,2})?:?(\d{1,2})?:?(\d{1,2})?[.:]?(\d+)?$/, ee = /\[([^\]]+)]|Y{1,4}|M{1,4}|D{1,2}|d{1,4}|H{1,2}|h{1,2}|a|A|m{1,2}|s{1,2}|Z{1,2}|SSS/g, te = { name: "en", weekdays: "Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_"), months: "January_February_March_April_May_June_July_August_September_October_November_December".split("_"), ordinal: function(s) {
      var n = ["th", "st", "nd", "rd"], e = s % 100;
      return "[" + s + (n[(e - 20) % 10] || n[e] || n[0]) + "]";
    } }, ne = function(s, n, e) {
      var o = String(s);
      return !o || o.length >= n ? s : "" + Array(n + 1 - o.length).join(e) + s;
    }, K = { s: ne, z: function(s) {
      var n = -s.utcOffset(), e = Math.abs(n), o = Math.floor(e / 60), t = e % 60;
      return (n <= 0 ? "+" : "-") + ne(o, 2, "0") + ":" + ne(t, 2, "0");
    }, m: function s(n, e) {
      if (n.date() < e.date())
        return -s(e, n);
      var o = 12 * (e.year() - n.year()) + (e.month() - n.month()), t = n.clone().add(o, h), l = e - t < 0, c = n.clone().add(o + (l ? -1 : 1), h);
      return +(-(o + (e - t) / (l ? t - c : c - t)) || 0);
    }, a: function(s) {
      return s < 0 ? Math.ceil(s) || 0 : Math.floor(s);
    }, p: function(s) {
      return { M: h, y: D, w: r, d: u, D: I, h: _, m: a, s: p, ms: m, Q: B }[s] || String(s || "").toLowerCase().replace(/s$/, "");
    }, u: function(s) {
      return s === void 0;
    } }, Y = "en", A = {};
    A[Y] = te;
    var Z = "$isDayjsObject", U = function(s) {
      return s instanceof ae || !(!s || !s[Z]);
    }, se = function s(n, e, o) {
      var t;
      if (!n)
        return Y;
      if (typeof n == "string") {
        var l = n.toLowerCase();
        A[l] && (t = l), e && (A[l] = e, t = l);
        var c = n.split("-");
        if (!t && c.length > 1)
          return s(c[0]);
      } else {
        var v = n.name;
        A[v] = n, t = v;
      }
      return !o && t && (Y = t), t || !o && Y;
    }, T = function(s, n) {
      if (U(s))
        return s.clone();
      var e = typeof n == "object" ? n : {};
      return e.date = s, e.args = arguments, new ae(e);
    }, $ = K;
    $.l = se, $.i = U, $.w = function(s, n) {
      return T(s, { locale: n.$L, utc: n.$u, x: n.$x, $offset: n.$offset });
    };
    var ae = function() {
      function s(e) {
        this.$L = se(e.locale, null, !0), this.parse(e), this.$x = this.$x || e.x || {}, this[Z] = !0;
      }
      var n = s.prototype;
      return n.parse = function(e) {
        this.$d = function(o) {
          var t = o.date, l = o.utc;
          if (t === null)
            return new Date(NaN);
          if ($.u(t))
            return new Date();
          if (t instanceof Date)
            return new Date(t);
          if (typeof t == "string" && !/Z$/i.test(t)) {
            var c = t.match(X);
            if (c) {
              var v = c[2] - 1 || 0, w = (c[7] || "0").substring(0, 3);
              return l ? new Date(Date.UTC(c[1], v, c[3] || 1, c[4] || 0, c[5] || 0, c[6] || 0, w)) : new Date(c[1], v, c[3] || 1, c[4] || 0, c[5] || 0, c[6] || 0, w);
            }
          }
          return new Date(t);
        }(e), this.init();
      }, n.init = function() {
        var e = this.$d;
        this.$y = e.getFullYear(), this.$M = e.getMonth(), this.$D = e.getDate(), this.$W = e.getDay(), this.$H = e.getHours(), this.$m = e.getMinutes(), this.$s = e.getSeconds(), this.$ms = e.getMilliseconds();
      }, n.$utils = function() {
        return $;
      }, n.isValid = function() {
        return this.$d.toString() !== R;
      }, n.isSame = function(e, o) {
        var t = T(e);
        return this.startOf(o) <= t && t <= this.endOf(o);
      }, n.isAfter = function(e, o) {
        return T(e) < this.startOf(o);
      }, n.isBefore = function(e, o) {
        return this.endOf(o) < T(e);
      }, n.$g = function(e, o, t) {
        return $.u(e) ? this[o] : this.set(t, e);
      }, n.unix = function() {
        return Math.floor(this.valueOf() / 1e3);
      }, n.valueOf = function() {
        return this.$d.getTime();
      }, n.startOf = function(e, o) {
        var t = this, l = !!$.u(o) || o, c = $.p(e), v = function(j, F) {
          var N = $.w(t.$u ? Date.UTC(t.$y, F, j) : new Date(t.$y, F, j), t);
          return l ? N : N.endOf(u);
        }, w = function(j, F) {
          return $.w(t.toDate()[j].apply(t.toDate("s"), (l ? [0, 0, 0, 0] : [23, 59, 59, 999]).slice(F)), t);
        }, k = this.$W, S = this.$M, W = this.$D, z = "set" + (this.$u ? "UTC" : "");
        switch (c) {
          case D:
            return l ? v(1, 0) : v(31, 11);
          case h:
            return l ? v(1, S) : v(0, S + 1);
          case r:
            var Q = this.$locale().weekStart || 0, re = (k < Q ? k + 7 : k) - Q;
            return v(l ? W - re : W + (6 - re), S);
          case u:
          case I:
            return w(z + "Hours", 0);
          case _:
            return w(z + "Minutes", 1);
          case a:
            return w(z + "Seconds", 2);
          case p:
            return w(z + "Milliseconds", 3);
          default:
            return this.clone();
        }
      }, n.endOf = function(e) {
        return this.startOf(e, !1);
      }, n.$set = function(e, o) {
        var t, l = $.p(e), c = "set" + (this.$u ? "UTC" : ""), v = (t = {}, t[u] = c + "Date", t[I] = c + "Date", t[h] = c + "Month", t[D] = c + "FullYear", t[_] = c + "Hours", t[a] = c + "Minutes", t[p] = c + "Seconds", t[m] = c + "Milliseconds", t)[l], w = l === u ? this.$D + (o - this.$W) : o;
        if (l === h || l === D) {
          var k = this.clone().set(I, 1);
          k.$d[v](w), k.init(), this.$d = k.set(I, Math.min(this.$D, k.daysInMonth())).$d;
        } else
          v && this.$d[v](w);
        return this.init(), this;
      }, n.set = function(e, o) {
        return this.clone().$set(e, o);
      }, n.get = function(e) {
        return this[$.p(e)]();
      }, n.add = function(e, o) {
        var t, l = this;
        e = Number(e);
        var c = $.p(o), v = function(S) {
          var W = T(l);
          return $.w(W.date(W.date() + Math.round(S * e)), l);
        };
        if (c === h)
          return this.set(h, this.$M + e);
        if (c === D)
          return this.set(D, this.$y + e);
        if (c === u)
          return v(1);
        if (c === r)
          return v(7);
        var w = (t = {}, t[a] = y, t[_] = f, t[p] = i, t)[c] || 1, k = this.$d.getTime() + e * w;
        return $.w(k, this);
      }, n.subtract = function(e, o) {
        return this.add(-1 * e, o);
      }, n.format = function(e) {
        var o = this, t = this.$locale();
        if (!this.isValid())
          return t.invalidDate || R;
        var l = e || "YYYY-MM-DDTHH:mm:ssZ", c = $.z(this), v = this.$H, w = this.$m, k = this.$M, S = t.weekdays, W = t.months, z = t.meridiem, Q = function(F, N, oe, ie) {
          return F && (F[N] || F(o, l)) || oe[N].slice(0, ie);
        }, re = function(F) {
          return $.s(v % 12 || 12, F, "0");
        }, j = z || function(F, N, oe) {
          var ie = F < 12 ? "AM" : "PM";
          return oe ? ie.toLowerCase() : ie;
        };
        return l.replace(ee, function(F, N) {
          return N || function(oe) {
            switch (oe) {
              case "YY":
                return String(o.$y).slice(-2);
              case "YYYY":
                return $.s(o.$y, 4, "0");
              case "M":
                return k + 1;
              case "MM":
                return $.s(k + 1, 2, "0");
              case "MMM":
                return Q(t.monthsShort, k, W, 3);
              case "MMMM":
                return Q(W, k);
              case "D":
                return o.$D;
              case "DD":
                return $.s(o.$D, 2, "0");
              case "d":
                return String(o.$W);
              case "dd":
                return Q(t.weekdaysMin, o.$W, S, 2);
              case "ddd":
                return Q(t.weekdaysShort, o.$W, S, 3);
              case "dddd":
                return S[o.$W];
              case "H":
                return String(v);
              case "HH":
                return $.s(v, 2, "0");
              case "h":
                return re(1);
              case "hh":
                return re(2);
              case "a":
                return j(v, w, !0);
              case "A":
                return j(v, w, !1);
              case "m":
                return String(w);
              case "mm":
                return $.s(w, 2, "0");
              case "s":
                return String(o.$s);
              case "ss":
                return $.s(o.$s, 2, "0");
              case "SSS":
                return $.s(o.$ms, 3, "0");
              case "Z":
                return c;
            }
            return null;
          }(F) || c.replace(":", "");
        });
      }, n.utcOffset = function() {
        return 15 * -Math.round(this.$d.getTimezoneOffset() / 15);
      }, n.diff = function(e, o, t) {
        var l, c = this, v = $.p(o), w = T(e), k = (w.utcOffset() - this.utcOffset()) * y, S = this - w, W = function() {
          return $.m(c, w);
        };
        switch (v) {
          case D:
            l = W() / 12;
            break;
          case h:
            l = W();
            break;
          case B:
            l = W() / 3;
            break;
          case r:
            l = (S - k) / 6048e5;
            break;
          case u:
            l = (S - k) / 864e5;
            break;
          case _:
            l = S / f;
            break;
          case a:
            l = S / y;
            break;
          case p:
            l = S / i;
            break;
          default:
            l = S;
        }
        return t ? l : $.a(l);
      }, n.daysInMonth = function() {
        return this.endOf(h).$D;
      }, n.$locale = function() {
        return A[this.$L];
      }, n.locale = function(e, o) {
        if (!e)
          return this.$L;
        var t = this.clone(), l = se(e, o, !0);
        return l && (t.$L = l), t;
      }, n.clone = function() {
        return $.w(this.$d, this);
      }, n.toDate = function() {
        return new Date(this.valueOf());
      }, n.toJSON = function() {
        return this.isValid() ? this.toISOString() : null;
      }, n.toISOString = function() {
        return this.$d.toISOString();
      }, n.toString = function() {
        return this.$d.toUTCString();
      }, s;
    }(), _e = ae.prototype;
    return T.prototype = _e, [["$ms", m], ["$s", p], ["$m", a], ["$H", _], ["$W", u], ["$M", h], ["$y", D], ["$D", I]].forEach(function(s) {
      _e[s[1]] = function(n) {
        return this.$g(n, s[0], s[1]);
      };
    }), T.extend = function(s, n) {
      return s.$i || (s(n, ae, T), s.$i = !0), T;
    }, T.locale = se, T.isDayjs = U, T.unix = function(s) {
      return T(1e3 * s);
    }, T.en = A[Y], T.Ls = A, T.p = {}, T;
  });
})(pe);
const me = pe.exports;
var ot = { exports: {} };
(function(d, g) {
  (function(i, y) {
    d.exports = y(pe.exports);
  })(de, function(i) {
    function y(p) {
      return p && typeof p == "object" && "default" in p ? p : { default: p };
    }
    var f = y(i), m = { name: "zh-cn", weekdays: "\u661F\u671F\u65E5_\u661F\u671F\u4E00_\u661F\u671F\u4E8C_\u661F\u671F\u4E09_\u661F\u671F\u56DB_\u661F\u671F\u4E94_\u661F\u671F\u516D".split("_"), weekdaysShort: "\u5468\u65E5_\u5468\u4E00_\u5468\u4E8C_\u5468\u4E09_\u5468\u56DB_\u5468\u4E94_\u5468\u516D".split("_"), weekdaysMin: "\u65E5_\u4E00_\u4E8C_\u4E09_\u56DB_\u4E94_\u516D".split("_"), months: "\u4E00\u6708_\u4E8C\u6708_\u4E09\u6708_\u56DB\u6708_\u4E94\u6708_\u516D\u6708_\u4E03\u6708_\u516B\u6708_\u4E5D\u6708_\u5341\u6708_\u5341\u4E00\u6708_\u5341\u4E8C\u6708".split("_"), monthsShort: "1\u6708_2\u6708_3\u6708_4\u6708_5\u6708_6\u6708_7\u6708_8\u6708_9\u6708_10\u6708_11\u6708_12\u6708".split("_"), ordinal: function(p, a) {
      return a === "W" ? p + "\u5468" : p + "\u65E5";
    }, weekStart: 1, yearStart: 4, formats: { LT: "HH:mm", LTS: "HH:mm:ss", L: "YYYY/MM/DD", LL: "YYYY\u5E74M\u6708D\u65E5", LLL: "YYYY\u5E74M\u6708D\u65E5Ah\u70B9mm\u5206", LLLL: "YYYY\u5E74M\u6708D\u65E5ddddAh\u70B9mm\u5206", l: "YYYY/M/D", ll: "YYYY\u5E74M\u6708D\u65E5", lll: "YYYY\u5E74M\u6708D\u65E5 HH:mm", llll: "YYYY\u5E74M\u6708D\u65E5dddd HH:mm" }, relativeTime: { future: "%s\u5185", past: "%s\u524D", s: "\u51E0\u79D2", m: "1 \u5206\u949F", mm: "%d \u5206\u949F", h: "1 \u5C0F\u65F6", hh: "%d \u5C0F\u65F6", d: "1 \u5929", dd: "%d \u5929", M: "1 \u4E2A\u6708", MM: "%d \u4E2A\u6708", y: "1 \u5E74", yy: "%d \u5E74" }, meridiem: function(p, a) {
      var _ = 100 * p + a;
      return _ < 600 ? "\u51CC\u6668" : _ < 900 ? "\u65E9\u4E0A" : _ < 1100 ? "\u4E0A\u5348" : _ < 1300 ? "\u4E2D\u5348" : _ < 1800 ? "\u4E0B\u5348" : "\u665A\u4E0A";
    } };
    return f.default.locale(m, null, !0), m;
  });
})(ot);
var we = { exports: {} };
(function(d, g) {
  (function(i, y) {
    d.exports = y();
  })(de, function() {
    return function(i, y, f) {
      i = i || {};
      var m = y.prototype, p = { future: "in %s", past: "%s ago", s: "a few seconds", m: "a minute", mm: "%d minutes", h: "an hour", hh: "%d hours", d: "a day", dd: "%d days", M: "a month", MM: "%d months", y: "a year", yy: "%d years" };
      function a(u, r, h, B) {
        return m.fromToBase(u, r, h, B);
      }
      f.en.relativeTime = p, m.fromToBase = function(u, r, h, B, D) {
        for (var I, R, X, ee = h.$locale().relativeTime || p, te = i.thresholds || [{ l: "s", r: 44, d: "second" }, { l: "m", r: 89 }, { l: "mm", r: 44, d: "minute" }, { l: "h", r: 89 }, { l: "hh", r: 21, d: "hour" }, { l: "d", r: 35 }, { l: "dd", r: 25, d: "day" }, { l: "M", r: 45 }, { l: "MM", r: 10, d: "month" }, { l: "y", r: 17 }, { l: "yy", d: "year" }], ne = te.length, K = 0; K < ne; K += 1) {
          var Y = te[K];
          Y.d && (I = B ? f(u).diff(h, Y.d, !0) : h.diff(u, Y.d, !0));
          var A = (i.rounding || Math.round)(Math.abs(I));
          if (X = I > 0, A <= Y.r || !Y.r) {
            A <= 1 && K > 0 && (Y = te[K - 1]);
            var Z = ee[Y.l];
            D && (A = D("" + A)), R = typeof Z == "string" ? Z.replace("%d", A) : Z(A, r, Y.l, X);
            break;
          }
        }
        if (r)
          return R;
        var U = X ? ee.future : ee.past;
        return typeof U == "function" ? U(R) : U.replace("%s", R);
      }, m.to = function(u, r) {
        return a(u, r, this, !0);
      }, m.from = function(u, r) {
        return a(u, r, this);
      };
      var _ = function(u) {
        return u.$u ? f.utc() : f();
      };
      m.toNow = function(u) {
        return this.to(_(this), u);
      }, m.fromNow = function(u) {
        return this.from(_(this), u);
      };
    };
  });
})(we);
const st = we.exports;
me.locale("zh-cn");
me.extend(st);
function at() {
  return me;
}
const he = H([]), De = H([]);
function it() {
  return new Promise((d, g) => {
    J("apis").getCategoryTree({ type: "WORKFLOW", parentId: 0 }).then((i) => {
      const { data: y } = i;
      he.value = y, y.length && De.value.push(y[0].id), d(i);
    }).catch((i) => {
      g(i);
    });
  });
}
function ut(d = {}, g) {
  return {
    columns: [
      {
        title: "\u6807\u9898",
        dataIndex: "title",
        customRender: function({ record: f }) {
          const { flowId: m, instanceId: p, id: a, title: _ } = f, u = { flowId: m, instanceId: p, taskId: a };
          return ye("span", {
            class: "ant-btn-link pointer",
            onClick: function() {
              Le(u, g);
            }
          }, _);
        }
      },
      {
        title: "\u6D41\u7A0B",
        dataIndex: "flowName",
        width: 150,
        ellipsis: !0
      },
      {
        title: "\u5F53\u524D\u6B65\u9AA4",
        dataIndex: "stepName",
        width: 100,
        ellipsis: !0
      },
      {
        title: "\u53D1\u8D77\u4EBA",
        dataIndex: "senderName",
        width: 100,
        ellipsis: !0
      },
      {
        title: "\u63A5\u6536\u65E5\u671F",
        dataIndex: "receiveTime",
        width: 190
      },
      {
        title: "\u505C\u7559\u65F6\u95F4",
        dataIndex: "stepName",
        customRender: function({ record: f }) {
          const { receiveTime: m } = f;
          return at()(m).fromNow();
        },
        width: 100
      },
      {
        title: "\u72B6\u6001",
        dataIndex: "status",
        customRender: function({ record: f }) {
          return ye(fe, {
            dict: "WORKFLOW_TASK_STATUS",
            value: f.status
          });
        },
        width: 100
      },
      {
        title: "\u64CD\u4F5C",
        dataIndex: "actions",
        width: 150,
        buttons: [
          {
            title: "\u6D41\u7A0B\u8F68\u8FF9",
            icon: "fund-outlined",
            props: {
              type: "primary"
            },
            key: "record",
            onClick: function(f) {
              d.modal.openModal({ data: f });
            }
          },
          {
            title: "\u7EC8\u6B62\u5B9E\u4F8B",
            icon: "close-circle-outlined",
            props: {
              type: "primary",
              danger: !0
            },
            key: "end",
            popconfirm: {
              title: "\u786E\u8BA4\u7EC8\u6B62\u5F53\u524D\u5B9E\u4F8B\u4E48\uFF1F",
              confirm: function(f) {
                const { instanceId: m, title: p } = f;
                !m || J("apis").endFlowByInstanceId({ id: m }).then((a) => {
                  be.success(`\u7EC8\u6B62\u5B9E\u4F8B${p}\u6210\u529F`), d.table.reload();
                });
              }
            }
          },
          {
            title: "\u67E5\u770B\u9000\u56DE\u539F\u56E0",
            icon: "warning-outlined",
            hide: function(f) {
              const { type: m } = f;
              return m != "BACK";
            },
            props: {
              type: "primary"
            },
            key: "view_return",
            onClick: function(f) {
              d.backModal.openModal({ data: f });
            }
          }
        ]
      }
    ]
  };
}
function $e(d = {}) {
  const g = d.tableQuery && d.tableQuery.categoryId, i = d.locationQuery || {};
  return {
    formProps: {
      baseColAttr: {
        span: 4
      },
      columns: [{
        field: "title",
        label: "\u6807\u9898"
      }, {
        field: "sender",
        label: "\u53D1\u8D77\u4EBA"
      }, {
        field: "timeRange",
        label: "\u65F6\u95F4",
        colAttr: {
          span: 6
        },
        timeRangeFieldNames: {
          startTime: "completedStartTime",
          endTime: "completedEndTime"
        },
        component: "a-range-picker",
        componentProps: {
          style: {
            width: "100%"
          },
          valueFormat: "YYYY-MM-DD"
        }
      }, {
        field: "categoryId",
        label: "\u5DE5\u4F5C\u6D41\u7A0B",
        hide: !i.noTree,
        defaultValue: g || "",
        component: "a-tree-select",
        componentProps: {
          "tree-data": he,
          "field-names": {
            children: "children",
            value: "id",
            label: "name"
          },
          treeDefaultExpandAll: !0
        }
      }, {
        field: "readStatus",
        label: "\u8BFB\u53D6\u72B6\u6001",
        component: "dict-select",
        componentProps: {
          dict: "TASK_READ_STATUS",
          selectProps: {
            allowClear: !0
          }
        }
      }]
    }
  };
}
const lt = { class: "workflow-manage" }, ct = {
  key: 0,
  class: "left"
}, dt = { class: "input-box" }, ft = { class: "tree-box" }, pt = { class: "right" }, mt = /* @__PURE__ */ ve("\u5BFC\u51FA"), ht = /* @__PURE__ */ ue({
  __name: "SanZhiWorkflowWait",
  setup(d) {
    const g = Ce(), i = {};
    function y(h) {
      i.table = h;
    }
    function f(h) {
      i.modal = h;
    }
    function m(h) {
      i.workflowForm = h;
    }
    function p(h) {
      i.backModal = h;
    }
    const a = Te({
      locationQuery: We(),
      keyword: "",
      treeData: he,
      fieldNames: {
        children: "children",
        title: "name",
        key: "id"
      },
      selectedKeys: De,
      formProps: $e(),
      tableProps: ut(i, g),
      tableQuery: {
        status: 0
      },
      tableData: {},
      loading: !1,
      currentEdit: {},
      openNoticeModal: !1,
      notice: {},
      openEditModal: !1,
      isEdit: !1,
      flowId: ""
    }), _ = ke(() => !a.locationQuery.noTree);
    Se(
      () => a.selectedKeys,
      (h, B) => {
        const D = h[0];
        !D || (a.tableQuery.categoryId = D, i.table.reload());
      },
      { deep: !0 }
    );
    function u() {
      return J("apis").getWorkflowTaskPageList;
    }
    function r() {
      const h = i.table.getParams();
      a.loading = !0, J("apis").getWorkflowTaskExcel({ ...h }).then((B) => {
      }).finally(() => {
        a.loading = !1;
      });
    }
    return ce(() => {
      it().then(() => {
        a.formProps = $e(a);
      });
    }), (h, B) => (M(), b("div", lt, [
      G(_) ? (M(), b("div", ct, [
        E(G(Ye), null, {
          default: O(() => [
            L("div", dt, [
              E(G(Ae), {
                value: a.keyword,
                "onUpdate:value": B[0] || (B[0] = (D) => a.keyword = D),
                placeholder: "\u8BF7\u8F93\u5165\u641C\u7D22\u5185\u5BB9"
              }, null, 8, ["value"])
            ]),
            L("div", ft, [
              E(G(Fe), {
                "tree-data": a.treeData,
                selectedKeys: a.selectedKeys,
                "onUpdate:selectedKeys": B[1] || (B[1] = (D) => a.selectedKeys = D),
                fieldNames: a.fieldNames
              }, null, 8, ["tree-data", "selectedKeys", "fieldNames"])
            ])
          ]),
          _: 1
        })
      ])) : P("", !0),
      L("div", pt, [
        E(G(Ee), {
          api: u(),
          autoGet: !1,
          extraParams: a.tableQuery,
          tableProps: a.tableProps,
          formProps: a.formProps,
          onRegister: y
        }, {
          formRight: O(() => [
            E(G(Be), {
              type: "primary",
              onClick: r,
              loading: a.loading
            }, {
              default: O(() => [
                mt
              ]),
              _: 1
            }, 8, ["loading"])
          ]),
          _: 1
        }, 8, ["api", "extraParams", "tableProps", "formProps"])
      ]),
      E(Je, { onRegister: f }),
      E(rt, { onRegister: p }),
      E(Ie, { onRegister: m })
    ]));
  }
});
const wt = /* @__PURE__ */ le(ht, [["__scopeId", "data-v-5cd6c626"]]);
export {
  wt as default
};
