import { computed as h, h as I, defineComponent as _, reactive as k, ref as p, onMounted as T, resolveComponent as f, openBlock as v, createBlock as A, mergeProps as C, withCtx as P, createVNode as y, nextTick as x } from "vue";
import { o as m, b as W, C as B, g as D } from "./index.e7201430.js";
import { W as b } from "./WorkflowBackModal.6c390a74.js";
import { useRouter as F } from "vue-router";
function N(e, n) {
  const i = h(() => n.hideActions);
  return {
    columns: [{
      title: "\u6807\u9898",
      dataIndex: "title",
      width: 300,
      fixed: "left"
    }, {
      title: "\u6D41\u7A0B",
      dataIndex: "flowName",
      width: 100
    }, {
      title: "\u6240\u5728\u6B65\u9AA4",
      dataIndex: "stepName",
      width: 120
    }, {
      title: "\u53D1\u8D77\u4EBA",
      dataIndex: "senderName",
      width: 100
    }, {
      title: "\u5904\u7406\u4EBA",
      dataIndex: "receiverName",
      width: 100
    }, {
      title: "\u63A5\u6536\u65E5\u671F",
      dataIndex: "receiveTime",
      width: 180
    }, {
      title: "\u72B6\u6001",
      dataIndex: "status",
      width: 100,
      customRender: function({ record: t }) {
        return I(b, {
          dict: "WORKFLOW_TASK_STATUS",
          value: t.status
        });
      }
    }, {
      title: "\u64CD\u4F5C",
      dataIndex: "actions",
      width: 80,
      fixed: "right",
      hide: i,
      buttons: [
        {
          title: "\u8DF3\u8FC7",
          icon: "forward-outlined",
          props: {
            type: "default"
          },
          key: "jump",
          hide: function(t) {
            return t.status !== "WAIT_HANDLE";
          },
          onClick: function(t) {
            const { instanceId: o, flowId: a, id: s } = t;
            m({ params: { instanceId: o, flowId: a, taskId: s }, router: e });
          }
        },
        {
          title: "\u5B8C\u6210",
          icon: "check-outlined",
          props: {
            type: "dashed"
          },
          key: "computed",
          hide: function(t) {
            return t.status !== "WAIT_HANDLE";
          },
          onClick: function(t) {
            const { instanceId: o, flowId: a, id: s } = t;
            m({ params: { instanceId: o, flowId: a, taskId: s }, router: e });
          }
        }
      ]
    }],
    pagination: !1
  };
}
const M = _({
  components: { WorkflowStatus: b, ConfigTable: B },
  props: {
    hideActions: {
      type: [Boolean],
      default: !1
    }
  },
  emits: ["register"],
  setup(e, { emit: n }) {
    const i = F(), u = k({
      tableQuery: {},
      tableProps: N(i, e),
      formProps: {
        queryForm: !1
      }
    }), r = p(!1), t = p({}), o = {};
    function a(l) {
      Object.assign(o, l);
    }
    function s(l = {}) {
      r.value = !0;
      const { data: c = {} } = l;
      t.value = c;
      const { instanceId: w = "" } = c;
      u.tableQuery.id = w, x(() => {
        o.reload();
      });
    }
    function d() {
      r.value = !1;
    }
    function g() {
      return D("apis").getWorkflowTaskByInstanceId;
    }
    return T(() => {
      n("register", { openModal: s, closeModal: d });
    }), {
      visible: r,
      modalData: t,
      getTableData: g,
      state: u,
      registerTable: a
    };
  }
});
function R(e, n, i, u, r, t) {
  const o = f("ConfigTable"), a = f("a-drawer");
  return v(), A(a, C({
    title: "\u5DE5\u4F5C\u4EFB\u52A1",
    visible: e.visible,
    "onUpdate:visible": n[0] || (n[0] = (s) => e.visible = s),
    width: "800px"
  }, e.$attrs), {
    default: P(() => [
      y(o, {
        api: e.getTableData(),
        autoGet: !1,
        extraParams: e.state.tableQuery,
        tableProps: e.state.tableProps,
        formProps: e.state.formProps,
        onRegister: e.registerTable
      }, null, 8, ["api", "extraParams", "tableProps", "formProps", "onRegister"])
    ]),
    _: 1
  }, 16, ["visible"]);
}
const O = /* @__PURE__ */ W(M, [["render", R], ["__scopeId", "data-v-7ace8249"]]);
export {
  O as W
};
