import '@das-fed/ui/packages/business-components/process-table/style.css';
import { withInstall as Bt } from "@das-fed/utils/with-install/index";
import { ref as T, useSlots as Tt, watch as ie, defineComponent as Ut, mergeModels as He, useModel as Rt, onMounted as Lt, createElementBlock as Oe, openBlock as oe, normalizeClass as kt, unref as n, createVNode as z, createCommentVNode as $e, mergeProps as Vt, isRef as Ae, withCtx as B, renderSlot as qe, Fragment as Ht, renderList as qt, createBlock as Ge, createElementVNode as K, toDisplayString as Q, createTextVNode as Ke } from "vue";
import { t as L, setI18nRule as Gt } from "@das-fed/web/packages/i18n/index";
import { DasTable as Qe, DasTableColumn as ye } from "@das-fed/ui/packages/components/table/index";
import { DasDialog as Kt } from "@das-fed/ui/packages/components/dialog/index";
import { DasButton as Je } from "@das-fed/ui/packages/components/button/index";
import { DasSwitch as Qt } from "@das-fed/ui/packages/components/switch/index";
import { DasTooltip as Jt } from "@das-fed/ui/packages/components/tooltip/index";
import { createService as Ie } from "@das-fed/utils/api-services/src/create-service";
import { getProjectInfo as We } from "@das-fed/utils/common-info/index";
import Ye from "dayjs";
const Wt = Ie("/api/admin/hotent/v1/table"), Yt = Ie("/workflow/form/dataTemplate/v1/getBpmDataTemplateInfoByFlowKey");
Wt.post("/value/report/page");
const Xt = Yt.get(""), Zt = (e, t) => ({
  reportTableList: Ie(e)[t]("")
});
var St = typeof global == "object" && global && global.Object === Object && global, er = typeof self == "object" && self && self.Object === Object && self, D = St || er || Function("return this")(), ee = D.Symbol, jt = Object.prototype, tr = jt.hasOwnProperty, rr = jt.toString, se = ee ? ee.toStringTag : void 0;
function ar(e) {
  var t = tr.call(e, se), r = e[se];
  try {
    e[se] = void 0;
    var a = !0;
  } catch {
  }
  var o = rr.call(e);
  return a && (t ? e[se] = r : delete e[se]), o;
}
var nr = Object.prototype, or = nr.toString;
function sr(e) {
  return or.call(e);
}
var ir = "[object Null]", lr = "[object Undefined]", Xe = ee ? ee.toStringTag : void 0;
function pe(e) {
  return e == null ? e === void 0 ? lr : ir : Xe && Xe in Object(e) ? ar(e) : sr(e);
}
function fe(e) {
  return e != null && typeof e == "object";
}
var ze = Array.isArray;
function Te(e) {
  var t = typeof e;
  return e != null && (t == "object" || t == "function");
}
var cr = "[object AsyncFunction]", ur = "[object Function]", pr = "[object GeneratorFunction]", fr = "[object Proxy]";
function wt(e) {
  if (!Te(e))
    return !1;
  var t = pe(e);
  return t == ur || t == pr || t == cr || t == fr;
}
var xe = D["__core-js_shared__"], Ze = function() {
  var e = /[^.]+$/.exec(xe && xe.keys && xe.keys.IE_PROTO || "");
  return e ? "Symbol(src)_1." + e : "";
}();
function dr(e) {
  return !!Ze && Ze in e;
}
var gr = Function.prototype, hr = gr.toString;
function W(e) {
  if (e != null) {
    try {
      return hr.call(e);
    } catch {
    }
    try {
      return e + "";
    } catch {
    }
  }
  return "";
}
var br = /[\\^$.*+?()[\]{}|]/g, yr = /^\[object .+?Constructor\]$/, vr = Function.prototype, mr = Object.prototype, _r = vr.toString, Tr = mr.hasOwnProperty, Sr = RegExp(
  "^" + _r.call(Tr).replace(br, "\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g, "$1.*?") + "$"
);
function jr(e) {
  if (!Te(e) || dr(e))
    return !1;
  var t = wt(e) ? Sr : yr;
  return t.test(W(e));
}
function wr(e, t) {
  return e == null ? void 0 : e[t];
}
function Y(e, t) {
  var r = wr(e, t);
  return jr(r) ? r : void 0;
}
var Ne = Y(D, "WeakMap"), et = Object.create, Cr = /* @__PURE__ */ function() {
  function e() {
  }
  return function(t) {
    if (!Te(t))
      return {};
    if (et)
      return et(t);
    e.prototype = t;
    var r = new e();
    return e.prototype = void 0, r;
  };
}(), tt = function() {
  try {
    var e = Y(Object, "defineProperty");
    return e({}, "", {}), e;
  } catch {
  }
}();
function Or(e, t) {
  for (var r = -1, a = e == null ? 0 : e.length; ++r < a && t(e[r], r, e) !== !1; )
    ;
  return e;
}
var $r = 9007199254740991, Ar = /^(?:0|[1-9]\d*)$/;
function xr(e, t) {
  var r = typeof e;
  return t = t ?? $r, !!t && (r == "number" || r != "symbol" && Ar.test(e)) && e > -1 && e % 1 == 0 && e < t;
}
function Pr(e, t, r) {
  t == "__proto__" && tt ? tt(e, t, {
    configurable: !0,
    enumerable: !0,
    value: r,
    writable: !0
  }) : e[t] = r;
}
function Ct(e, t) {
  return e === t || e !== e && t !== t;
}
var Dr = Object.prototype, Nr = Dr.hasOwnProperty;
function Er(e, t, r) {
  var a = e[t];
  (!(Nr.call(e, t) && Ct(a, r)) || r === void 0 && !(t in e)) && Pr(e, t, r);
}
var Mr = 9007199254740991;
function Ot(e) {
  return typeof e == "number" && e > -1 && e % 1 == 0 && e <= Mr;
}
function Fr(e) {
  return e != null && Ot(e.length) && !wt(e);
}
var Ir = Object.prototype;
function $t(e) {
  var t = e && e.constructor, r = typeof t == "function" && t.prototype || Ir;
  return e === r;
}
function zr(e, t) {
  for (var r = -1, a = Array(e); ++r < e; )
    a[r] = t(r);
  return a;
}
var Br = "[object Arguments]";
function rt(e) {
  return fe(e) && pe(e) == Br;
}
var At = Object.prototype, Ur = At.hasOwnProperty, Rr = At.propertyIsEnumerable, Lr = rt(/* @__PURE__ */ function() {
  return arguments;
}()) ? rt : function(e) {
  return fe(e) && Ur.call(e, "callee") && !Rr.call(e, "callee");
};
function kr() {
  return !1;
}
var xt = typeof exports == "object" && exports && !exports.nodeType && exports, at = xt && typeof module == "object" && module && !module.nodeType && module, Vr = at && at.exports === xt, nt = Vr ? D.Buffer : void 0, Hr = nt ? nt.isBuffer : void 0, Pt = Hr || kr, qr = "[object Arguments]", Gr = "[object Array]", Kr = "[object Boolean]", Qr = "[object Date]", Jr = "[object Error]", Wr = "[object Function]", Yr = "[object Map]", Xr = "[object Number]", Zr = "[object Object]", ea = "[object RegExp]", ta = "[object Set]", ra = "[object String]", aa = "[object WeakMap]", na = "[object ArrayBuffer]", oa = "[object DataView]", sa = "[object Float32Array]", ia = "[object Float64Array]", la = "[object Int8Array]", ca = "[object Int16Array]", ua = "[object Int32Array]", pa = "[object Uint8Array]", fa = "[object Uint8ClampedArray]", da = "[object Uint16Array]", ga = "[object Uint32Array]", d = {};
d[sa] = d[ia] = d[la] = d[ca] = d[ua] = d[pa] = d[fa] = d[da] = d[ga] = !0;
d[qr] = d[Gr] = d[na] = d[Kr] = d[oa] = d[Qr] = d[Jr] = d[Wr] = d[Yr] = d[Xr] = d[Zr] = d[ea] = d[ta] = d[ra] = d[aa] = !1;
function ha(e) {
  return fe(e) && Ot(e.length) && !!d[pe(e)];
}
function Be(e) {
  return function(t) {
    return e(t);
  };
}
var Dt = typeof exports == "object" && exports && !exports.nodeType && exports, le = Dt && typeof module == "object" && module && !module.nodeType && module, ba = le && le.exports === Dt, Pe = ba && St.process, te = function() {
  try {
    var e = le && le.require && le.require("util").types;
    return e || Pe && Pe.binding && Pe.binding("util");
  } catch {
  }
}(), ot = te && te.isTypedArray, ya = ot ? Be(ot) : ha, va = Object.prototype, ma = va.hasOwnProperty;
function _a(e, t) {
  var r = ze(e), a = !r && Lr(e), o = !r && !a && Pt(e), i = !r && !a && !o && ya(e), s = r || a || o || i, m = s ? zr(e.length, String) : [], g = m.length;
  for (var c in e)
    ma.call(e, c) && !(s && // Safari 9 has enumerable `arguments.length` in strict mode.
    (c == "length" || // Node.js 0.10 has enumerable non-index properties on buffers.
    o && (c == "offset" || c == "parent") || // PhantomJS 2 has enumerable non-index properties on typed arrays.
    i && (c == "buffer" || c == "byteLength" || c == "byteOffset") || // Skip index properties.
    xr(c, g))) && m.push(c);
  return m;
}
function Nt(e, t) {
  return function(r) {
    return e(t(r));
  };
}
var Ta = Nt(Object.keys, Object), Sa = Object.prototype, ja = Sa.hasOwnProperty;
function wa(e) {
  if (!$t(e))
    return Ta(e);
  var t = [];
  for (var r in Object(e))
    ja.call(e, r) && r != "constructor" && t.push(r);
  return t;
}
function Ca(e) {
  return Fr(e) ? _a(e) : wa(e);
}
var ce = Y(Object, "create");
function Oa() {
  this.__data__ = ce ? ce(null) : {}, this.size = 0;
}
function $a(e) {
  var t = this.has(e) && delete this.__data__[e];
  return this.size -= t ? 1 : 0, t;
}
var Aa = "__lodash_hash_undefined__", xa = Object.prototype, Pa = xa.hasOwnProperty;
function Da(e) {
  var t = this.__data__;
  if (ce) {
    var r = t[e];
    return r === Aa ? void 0 : r;
  }
  return Pa.call(t, e) ? t[e] : void 0;
}
var Na = Object.prototype, Ea = Na.hasOwnProperty;
function Ma(e) {
  var t = this.__data__;
  return ce ? t[e] !== void 0 : Ea.call(t, e);
}
var Fa = "__lodash_hash_undefined__";
function Ia(e, t) {
  var r = this.__data__;
  return this.size += this.has(e) ? 0 : 1, r[e] = ce && t === void 0 ? Fa : t, this;
}
function J(e) {
  var t = -1, r = e == null ? 0 : e.length;
  for (this.clear(); ++t < r; ) {
    var a = e[t];
    this.set(a[0], a[1]);
  }
}
J.prototype.clear = Oa;
J.prototype.delete = $a;
J.prototype.get = Da;
J.prototype.has = Ma;
J.prototype.set = Ia;
function za() {
  this.__data__ = [], this.size = 0;
}
function Se(e, t) {
  for (var r = e.length; r--; )
    if (Ct(e[r][0], t))
      return r;
  return -1;
}
var Ba = Array.prototype, Ua = Ba.splice;
function Ra(e) {
  var t = this.__data__, r = Se(t, e);
  if (r < 0)
    return !1;
  var a = t.length - 1;
  return r == a ? t.pop() : Ua.call(t, r, 1), --this.size, !0;
}
function La(e) {
  var t = this.__data__, r = Se(t, e);
  return r < 0 ? void 0 : t[r][1];
}
function ka(e) {
  return Se(this.__data__, e) > -1;
}
function Va(e, t) {
  var r = this.__data__, a = Se(r, e);
  return a < 0 ? (++this.size, r.push([e, t])) : r[a][1] = t, this;
}
function R(e) {
  var t = -1, r = e == null ? 0 : e.length;
  for (this.clear(); ++t < r; ) {
    var a = e[t];
    this.set(a[0], a[1]);
  }
}
R.prototype.clear = za;
R.prototype.delete = Ra;
R.prototype.get = La;
R.prototype.has = ka;
R.prototype.set = Va;
var ue = Y(D, "Map");
function Ha() {
  this.size = 0, this.__data__ = {
    hash: new J(),
    map: new (ue || R)(),
    string: new J()
  };
}
function qa(e) {
  var t = typeof e;
  return t == "string" || t == "number" || t == "symbol" || t == "boolean" ? e !== "__proto__" : e === null;
}
function je(e, t) {
  var r = e.__data__;
  return qa(t) ? r[typeof t == "string" ? "string" : "hash"] : r.map;
}
function Ga(e) {
  var t = je(this, e).delete(e);
  return this.size -= t ? 1 : 0, t;
}
function Ka(e) {
  return je(this, e).get(e);
}
function Qa(e) {
  return je(this, e).has(e);
}
function Ja(e, t) {
  var r = je(this, e), a = r.size;
  return r.set(e, t), this.size += r.size == a ? 0 : 1, this;
}
function re(e) {
  var t = -1, r = e == null ? 0 : e.length;
  for (this.clear(); ++t < r; ) {
    var a = e[t];
    this.set(a[0], a[1]);
  }
}
re.prototype.clear = Ha;
re.prototype.delete = Ga;
re.prototype.get = Ka;
re.prototype.has = Qa;
re.prototype.set = Ja;
function Wa(e, t) {
  for (var r = -1, a = t.length, o = e.length; ++r < a; )
    e[o + r] = t[r];
  return e;
}
var Ya = Nt(Object.getPrototypeOf, Object);
function Xa() {
  this.__data__ = new R(), this.size = 0;
}
function Za(e) {
  var t = this.__data__, r = t.delete(e);
  return this.size = t.size, r;
}
function en(e) {
  return this.__data__.get(e);
}
function tn(e) {
  return this.__data__.has(e);
}
var rn = 200;
function an(e, t) {
  var r = this.__data__;
  if (r instanceof R) {
    var a = r.__data__;
    if (!ue || a.length < rn - 1)
      return a.push([e, t]), this.size = ++r.size, this;
    r = this.__data__ = new re(a);
  }
  return r.set(e, t), this.size = r.size, this;
}
function ae(e) {
  var t = this.__data__ = new R(e);
  this.size = t.size;
}
ae.prototype.clear = Xa;
ae.prototype.delete = Za;
ae.prototype.get = en;
ae.prototype.has = tn;
ae.prototype.set = an;
var Et = typeof exports == "object" && exports && !exports.nodeType && exports, st = Et && typeof module == "object" && module && !module.nodeType && module, nn = st && st.exports === Et, it = nn ? D.Buffer : void 0;
it && it.allocUnsafe;
function on(e, t) {
  return e.slice();
}
function sn(e, t) {
  for (var r = -1, a = e == null ? 0 : e.length, o = 0, i = []; ++r < a; ) {
    var s = e[r];
    t(s, r, e) && (i[o++] = s);
  }
  return i;
}
function ln() {
  return [];
}
var cn = Object.prototype, un = cn.propertyIsEnumerable, lt = Object.getOwnPropertySymbols, pn = lt ? function(e) {
  return e == null ? [] : (e = Object(e), sn(lt(e), function(t) {
    return un.call(e, t);
  }));
} : ln;
function fn(e, t, r) {
  var a = t(e);
  return ze(e) ? a : Wa(a, r(e));
}
function dn(e) {
  return fn(e, Ca, pn);
}
var Ee = Y(D, "DataView"), Me = Y(D, "Promise"), Fe = Y(D, "Set"), ct = "[object Map]", gn = "[object Object]", ut = "[object Promise]", pt = "[object Set]", ft = "[object WeakMap]", dt = "[object DataView]", hn = W(Ee), bn = W(ue), yn = W(Me), vn = W(Fe), mn = W(Ne), U = pe;
(Ee && U(new Ee(new ArrayBuffer(1))) != dt || ue && U(new ue()) != ct || Me && U(Me.resolve()) != ut || Fe && U(new Fe()) != pt || Ne && U(new Ne()) != ft) && (U = function(e) {
  var t = pe(e), r = t == gn ? e.constructor : void 0, a = r ? W(r) : "";
  if (a)
    switch (a) {
      case hn:
        return dt;
      case bn:
        return ct;
      case yn:
        return ut;
      case vn:
        return pt;
      case mn:
        return ft;
    }
  return t;
});
var _n = Object.prototype, Tn = _n.hasOwnProperty;
function Sn(e) {
  var t = e.length, r = new e.constructor(t);
  return t && typeof e[0] == "string" && Tn.call(e, "index") && (r.index = e.index, r.input = e.input), r;
}
var gt = D.Uint8Array;
function Ue(e) {
  var t = new e.constructor(e.byteLength);
  return new gt(t).set(new gt(e)), t;
}
function jn(e, t) {
  var r = Ue(e.buffer);
  return new e.constructor(r, e.byteOffset, e.byteLength);
}
var wn = /\w*$/;
function Cn(e) {
  var t = new e.constructor(e.source, wn.exec(e));
  return t.lastIndex = e.lastIndex, t;
}
var ht = ee ? ee.prototype : void 0, bt = ht ? ht.valueOf : void 0;
function On(e) {
  return bt ? Object(bt.call(e)) : {};
}
function $n(e, t) {
  var r = Ue(e.buffer);
  return new e.constructor(r, e.byteOffset, e.length);
}
var An = "[object Boolean]", xn = "[object Date]", Pn = "[object Map]", Dn = "[object Number]", Nn = "[object RegExp]", En = "[object Set]", Mn = "[object String]", Fn = "[object Symbol]", In = "[object ArrayBuffer]", zn = "[object DataView]", Bn = "[object Float32Array]", Un = "[object Float64Array]", Rn = "[object Int8Array]", Ln = "[object Int16Array]", kn = "[object Int32Array]", Vn = "[object Uint8Array]", Hn = "[object Uint8ClampedArray]", qn = "[object Uint16Array]", Gn = "[object Uint32Array]";
function Kn(e, t, r) {
  var a = e.constructor;
  switch (t) {
    case In:
      return Ue(e);
    case An:
    case xn:
      return new a(+e);
    case zn:
      return jn(e);
    case Bn:
    case Un:
    case Rn:
    case Ln:
    case kn:
    case Vn:
    case Hn:
    case qn:
    case Gn:
      return $n(e);
    case Pn:
      return new a();
    case Dn:
    case Mn:
      return new a(e);
    case Nn:
      return Cn(e);
    case En:
      return new a();
    case Fn:
      return On(e);
  }
}
function Qn(e) {
  return typeof e.constructor == "function" && !$t(e) ? Cr(Ya(e)) : {};
}
var Jn = "[object Map]";
function Wn(e) {
  return fe(e) && U(e) == Jn;
}
var yt = te && te.isMap, Yn = yt ? Be(yt) : Wn, Xn = "[object Set]";
function Zn(e) {
  return fe(e) && U(e) == Xn;
}
var vt = te && te.isSet, eo = vt ? Be(vt) : Zn, Mt = "[object Arguments]", to = "[object Array]", ro = "[object Boolean]", ao = "[object Date]", no = "[object Error]", Ft = "[object Function]", oo = "[object GeneratorFunction]", so = "[object Map]", io = "[object Number]", It = "[object Object]", lo = "[object RegExp]", co = "[object Set]", uo = "[object String]", po = "[object Symbol]", fo = "[object WeakMap]", go = "[object ArrayBuffer]", ho = "[object DataView]", bo = "[object Float32Array]", yo = "[object Float64Array]", vo = "[object Int8Array]", mo = "[object Int16Array]", _o = "[object Int32Array]", To = "[object Uint8Array]", So = "[object Uint8ClampedArray]", jo = "[object Uint16Array]", wo = "[object Uint32Array]", f = {};
f[Mt] = f[to] = f[go] = f[ho] = f[ro] = f[ao] = f[bo] = f[yo] = f[vo] = f[mo] = f[_o] = f[so] = f[io] = f[It] = f[lo] = f[co] = f[uo] = f[po] = f[To] = f[So] = f[jo] = f[wo] = !0;
f[no] = f[Ft] = f[fo] = !1;
function ve(e, t, r, a, o, i) {
  var s;
  if (s !== void 0)
    return s;
  if (!Te(e))
    return e;
  var m = ze(e);
  if (m)
    s = Sn(e);
  else {
    var g = U(e), c = g == Ft || g == oo;
    if (Pt(e))
      return on(e);
    if (g == It || g == Mt || c && !o)
      s = c ? {} : Qn(e);
    else {
      if (!f[g])
        return o ? e : {};
      s = Kn(e, g);
    }
  }
  i || (i = new ae());
  var h = i.get(e);
  if (h)
    return h;
  i.set(e, s), eo(e) ? e.forEach(function(v) {
    s.add(ve(v, t, r, v, e, i));
  }) : Yn(e) && e.forEach(function(v, j) {
    s.set(j, ve(v, t, r, j, e, i));
  });
  var $ = dn, N = m ? void 0 : $(e);
  return Or(N || e, function(v, j) {
    N && (j = v, v = e[j]), Er(s, j, ve(v, t, r, j, e, i));
  }), s;
}
var Co = 1, Oo = 4;
function me(e) {
  return ve(e, Co | Oo);
}
const $o = (e, t, r) => {
  var Z, O, p, M;
  const a = (Z = We()) != null && Z.id ? (O = We()) == null ? void 0 : O.id : "371344636432453", o = T([]), i = T([]), s = T([]), m = T(), g = Tt(), c = ((p = g.prepend) == null ? void 0 : p.call(g)) ?? [], h = ((M = g.append) == null ? void 0 : M.call(g)) ?? [], $ = T(!1), { reportTableList: N } = Zt(e.apiUrl, e.reqMethod), v = T([]), j = T([]), X = T([]), E = T(0), x = T(20), b = T(1), u = T({
    flowKey: e.flowKey,
    clientType: e.clientType,
    permissionFilterTypes: e.permissionQuery,
    pageBean: {
      page: b.value,
      pageSize: x.value
    },
    params: {},
    sorter: [
      // {
      //   property: 'creation_time',
      //   direction: 'DESC',
      // },
    ],
    querys: e.searchQuerys
  });
  ie(
    () => e.searchQuerys,
    (l) => {
      u.value.querys = l, t("getSearchQuery", u.value);
    },
    {
      deep: !0,
      immediate: !0
    }
  ), ie(
    () => e.permissionQuery,
    (l) => {
      u.value.permissionFilterTypes = l, t("getSearchQuery", u.value);
    },
    {
      deep: !0,
      immediate: !0
    }
  );
  const w = async () => new Promise((l) => {
    if ($.value)
      l(!0);
    else {
      let A = ie(
        () => $.value,
        (P) => {
          P && (A(), A = null, l(!0));
        }
      );
    }
  }), C = async () => {
    await w(), r.value = !0, console.log(e.extraParams, "==props.extraParams");
    const l = {
      ...u.value,
      ...e.extraParams,
      sorter: u.value.sorter || []
    }, [A, P] = await N(l, { params: { project: a } }).run();
    r.value = !1, !A && (X.value = P.data, E.value = P.totalCount);
  }, k = async () => {
    var G;
    const l = {
      flowKey: e.flowKey,
      needDisplayFileds: e.needDisplayFileds,
      project: a
    }, [A, P] = await Xt(l).run();
    if (A) return;
    const S = P.value;
    if (!S) return;
    let q = [];
    if (S.sortField && (v.value = JSON.parse(S.sortField).map((F) => ({
      property: F.name,
      direction: F.sort
    })), j.value = (e == null ? void 0 : e.defaultSort) ?? JSON.parse(S.sortField).map((F) => {
      const he = F.sort === "ASC" ? "ascending" : "descending";
      return {
        prop: F.name,
        order: he
      };
    }), ((G = v.value) == null ? void 0 : G.length) > 0 ? u.value.sorter = [v.value[0]] : u.value.sorter = [], t("getSearchQuery", u.value), q = v.value.map((F) => F.property)), S.displayField) {
      const F = JSON.parse(S.displayField), he = {}, Ce = /* @__PURE__ */ new Map(), Re = [], Le = [];
      S.boDef.boEnt.attributeList.forEach((y) => {
        he[y.name] = y;
      }), h.forEach((y) => {
        const _ = y.props, I = { desc: _.label, name: _.label };
        Ce.set(_.prop, I), Re.push({ name: _.prop, desc: _.label, switch: !0 });
      }), c.forEach((y) => {
        const _ = y.props, I = { desc: _.label, name: _.label };
        Ce.set(_.prop, I), Le.push({ name: _.prop, desc: _.label, switch: !0 });
      }), o.value = [], F.forEach((y) => {
        if (Ce.has(y.name)) return;
        const _ = he[y.name];
        y.encryption = (_ == null ? void 0 : _.encryption) ?? "", q.includes(y.name) ? y.sort = "custom" : y.sort = !1, o.value.push(y);
      });
      const zt = o.value.map((y) => ({
        name: y.name,
        desc: y.desc,
        switch: !0
      }));
      s.value = [...Le, ...zt, ...Re], console.log("显示列", o.value);
      const be = window.localStorage.getItem(e.columnSettingName);
      if (be && be !== "undefined") {
        const y = s.value.map((I) => I.name).join(","), _ = JSON.parse(be).map((I) => I.name).join(",");
        console.log("reqName===storeName", y === _), y === _ ? m.value = JSON.parse(be) : (m.value = me(s.value), window.localStorage.setItem(e.columnSettingName, JSON.stringify(s.value))), i.value = o.value.filter((I) => {
          let ke = !1;
          return m.value.map((Ve) => {
            Ve.name === I.name && Ve.switch && (ke = !0);
          }), ke;
        });
      } else
        i.value = me(o.value), m.value = me(s.value);
    }
    $.value = !0;
  }, ne = (l) => {
    b.value = l, u.value.pageBean.page = l, C();
  }, de = (l) => {
    x.value = l, u.value.pageBean.pageSize = l, C();
  }, ge = (l) => {
    const A = l.order === "ascending" ? "ASC" : "DESC", P = v.value.find((S) => {
      if (S.property === l.prop)
        return S.direction = A, S;
    });
    u.value.sorter = [P], console.log("reqData.value.sorter: ", u.value.sorter), t("getSearchQuery", u.value), C();
  }, V = T(!0), we = (l, A, P) => {
    const S = l.button_list ? JSON.parse(l.button_list) : [], q = T([]);
    if (S && S.length > 0 ? q.value = S.map((G) => ({
      label: G.name,
      value: G.alias
    })) : q.value = [], e.customOperation) {
      const G = typeof e.customOperation == "function" ? e.customOperation(l, A, P) || [] : e.customOperation || [];
      q.value.unshift(...G);
    }
    return q.value;
  }, H = T(!0);
  return ie(
    () => i.value,
    (l) => {
      e.showOperationColumn ? l.length > 0 ? (V.value = !0, H.value = e.selection) : (V.value = !1, H.value = !1) : (V.value = !1, l.length > 0 ? H.value = e.selection : H.value = !1);
    },
    {
      immediate: !0,
      deep: !0
    }
  ), {
    filterSetting: v,
    defaultFilterSetting: j,
    copySettingHeaderData: i,
    copyDialogHeaderData: m,
    operation: we,
    reqTableList: C,
    tableData: X,
    reqSearchSetting: k,
    settingHeaderData: o,
    dialogHeaderData: s,
    total: E,
    pageIndex: b,
    pageSize: x,
    handleCurrentPageChange: ne,
    handlePageSizeChange: de,
    sortChange: ge,
    customSelectionOptions: H,
    showOperationColumn: V
  };
}, Ao = (e, t, r, a, o, i) => {
  var E, x;
  const s = Tt(), m = ((E = s.append) == null ? void 0 : E.call(s)) ?? [], g = ((x = s.prepend) == null ? void 0 : x.call(s)) ?? [], c = T([]), h = T(!1), $ = () => {
    h.value = !1;
    const b = window.localStorage.getItem(e.columnSettingName);
    b ? o.value = JSON.parse(b) : o.value = r.value;
  }, N = () => {
    var b;
    (b = o.value) == null || b.forEach((u) => u.switch = !0);
  }, v = () => {
    var b;
    (b = o.value) == null || b.forEach((u) => u.switch = !1);
  }, j = () => {
    h.value = !0;
  }, X = () => {
    c.value = me(o.value), window.localStorage.setItem(e.columnSettingName, JSON.stringify(c.value)), console.log("headerBackData.value: ", c.value);
    const b = /* @__PURE__ */ new Map();
    c.value.forEach((w) => {
      b.set(w.name, w);
    });
    const u = [];
    g.forEach((w) => {
      const C = w.props.prop, k = b.get(C);
      u.push(k);
    }), m.forEach((w) => {
      const C = w.props.prop, k = b.get(C);
      u.push(k);
    }), t("changeSlotShow", u), h.value = !1;
  };
  return ie(
    () => c.value,
    (b) => {
      console.log("copySettingHeaderData: ", i.value), i.value = a.value.filter((u) => {
        let w = !1;
        return b.map((C) => {
          C.name === u.name && C.switch && (w = !0);
        }), w;
      });
    }
  ), {
    headerBackData: c,
    showSettingDialog: h,
    cancelTabel: $,
    resetDefault: N,
    showAll: v,
    setTable: X,
    tableSetting: j
  };
}, xo = (e) => {
  const r = "****", a = String(e), o = a.slice(0, 15), i = a.slice(15);
  return ((g) => {
    const c = g.length;
    if (c < 6) return g;
    let h = 0;
    switch (c) {
      case 6:
      case 7:
        h = 1;
        break;
      case 8:
      case 9:
        h = 2;
        break;
      case 10:
      case 11:
        h = 3;
        break;
      case 12:
        h = 4;
        break;
      case 13:
        h = 5;
        break;
      case 14:
        h = 6;
        break;
      case 15:
        h = 7;
        break;
    }
    const $ = h + r.length;
    return g.slice(0, h) + r + g.slice($);
  })(o) + i;
}, Po = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
  __proto__: null,
  default: xo
}, Symbol.toStringTag, { value: "Module" })), _e = {}, Do = /^\.\/(.+)\/index\.ts$/, mt = /* @__PURE__ */ Object.assign({ "./phone/index.ts": Po });
var _t;
for (const e in mt) {
  const t = mt[e], r = (_t = e.match(Do)) == null ? void 0 : _t[1];
  _e[r] = t.default;
}
const No = (e, t) => {
  var a;
  return t ? ((a = _e[e]) == null ? void 0 : a.call(_e, t)) ?? t : "-";
}, Eo = (e, t) => {
  if (e && t) {
    const r = Number(e);
    return isNaN(r) ? Ye(e).format(t) : Ye(r).format(t);
  }
  return "-";
}, Mo = (e, t) => {
  const r = String(e);
  if (r && t && t.length > 0) {
    const a = t.find((o) => o.key_ === r);
    return a ? a.value_ : "-";
  } else
    return "-";
}, De = (e, t) => {
  var a, o;
  const r = e[t.name];
  return t.encryption ? No(t.encryption, r) : t.dateFormatter ? Eo(e[t.name], t.dateFormatter) : ((a = t.formatterData) == null ? void 0 : a.length) > 0 ? Mo(e[t.name], t.formatterData) : t.type === "date" ? ((o = e[t.name]) == null ? void 0 : o.replaceAll("-", "/")) || "-" : e[t.name] || "-";
}, Fo = { class: "das-ui-text-context" }, Io = { key: 1 }, zo = { class: "setting-top" }, Bo = { class: "setting-top-content" }, Uo = { class: "operate" }, Ro = /* @__PURE__ */ Ut({
  __name: "App",
  props: /* @__PURE__ */ He({
    flowKey: { default: "" },
    clientType: { default: "pc" },
    needDisplayFileds: { type: Boolean, default: !1 },
    customOperation: {},
    searchQuerys: { default: () => [] },
    sortQuerys: { default: () => [] },
    extraParams: { default: () => ({}) },
    permissionQuery: { default: () => [1] },
    apiUrl: { default: "/api/admin/hotent/v1/table/value/report/page" },
    defaultSort: {},
    reqMethod: { default: "post" },
    columnSettingName: { default: "headerSetting" },
    selection: { type: [Boolean, Object] },
    showOperationColumn: { type: Boolean, default: !0 }
  }, {
    loading: { type: Boolean, default: !1 },
    loadingModifiers: {}
  }),
  emits: /* @__PURE__ */ He(["getSearchQuery", "changeSlotShow"], ["update:loading"]),
  setup(e, { expose: t, emit: r }) {
    const a = e;
    console.log("props", a);
    const o = Rt(e, "loading"), i = r, {
      copySettingHeaderData: s,
      copyDialogHeaderData: m,
      defaultFilterSetting: g,
      operation: c,
      reqTableList: h,
      dialogHeaderData: $,
      tableData: N,
      reqSearchSetting: v,
      settingHeaderData: j,
      total: X,
      pageIndex: E,
      pageSize: x,
      handleCurrentPageChange: b,
      handlePageSizeChange: u,
      sortChange: w,
      customSelectionOptions: C,
      showOperationColumn: k
    } = $o(a, i, o), { showSettingDialog: ne, cancelTabel: de, resetDefault: ge, showAll: V, setTable: we, tableSetting: H } = Ao(
      a,
      i,
      $,
      j,
      m,
      s
    );
    return Lt(async () => {
      await v();
    }), t({
      reqTableList: h,
      handleCurrentPageChange: b
    }), (Z, O) => (oe(), Oe(
      "div",
      {
        class: kt(["das-process-table", { "no-header-column": n(s).length === 0 }])
      },
      [
        z(n(Qe), Vt({ data: n(N) }, Z.$attrs, {
          operation: n(c),
          total: n(X),
          selection: n(C),
          "default-sort": n(g)[0],
          showOperationColumn: n(k),
          "current-page": n(E),
          "onUpdate:currentPage": O[0] || (O[0] = (p) => Ae(E) ? E.value = p : null),
          "page-size": n(x),
          "onUpdate:pageSize": O[1] || (O[1] = (p) => Ae(x) ? x.value = p : null),
          onCurrentPageChange: n(b),
          onSizeChange: n(u),
          onTableSetting: n(H),
          onSortChange: n(w)
        }), {
          default: B(() => [
            $e(" 此处用来处理业务固定联动字段，前置插槽，插入DasTableColumn"),
            qe(Z.$slots, "prepend", {}, void 0, !0),
            (oe(!0), Oe(
              Ht,
              null,
              qt(n(s), (p) => (oe(), Ge(n(ye), {
                sortable: p.sort,
                key: p.name,
                label: p.desc,
                prop: p.name,
                "show-overflow-tooltip": !p.encryption
              }, {
                default: B(({ row: M, column: l, $index: A }) => [
                  p.encryption ? (oe(), Ge(n(Jt), {
                    key: 0,
                    placement: "top",
                    disabled: n(De)(M, p) === "-",
                    content: M[p.name]
                  }, {
                    default: B(() => [
                      K(
                        "div",
                        Fo,
                        Q(n(De)(M, p)),
                        1
                        /* TEXT */
                      )
                    ]),
                    _: 2
                    /* DYNAMIC */
                  }, 1032, ["disabled", "content"])) : (oe(), Oe(
                    "span",
                    Io,
                    Q(n(De)(M, p)),
                    1
                    /* TEXT */
                  ))
                ]),
                _: 2
                /* DYNAMIC */
              }, 1032, ["sortable", "label", "prop", "show-overflow-tooltip"]))),
              128
              /* KEYED_FRAGMENT */
            )),
            $e(" 此处用来处理业务固定联动字段，后置插槽，插入DasTableColumn"),
            qe(Z.$slots, "append", {}, void 0, !0)
          ]),
          _: 3
          /* FORWARDED */
        }, 16, ["data", "operation", "total", "selection", "default-sort", "showOperationColumn", "current-page", "page-size", "onCurrentPageChange", "onSizeChange", "onTableSetting", "onSortChange"]),
        $e(" 配置table显示列  "),
        z(n(Kt), {
          modelValue: n(ne),
          "onUpdate:modelValue": O[4] || (O[4] = (p) => Ae(ne) ? ne.value = p : null),
          width: "960px",
          title: n(L)("列表控制"),
          height: "580px",
          onClose: n(de),
          "body-style": { padding: "10px 20px 20px" }
        }, {
          footer: B(() => [
            K("div", null, [
              z(n(Je), { onClick: n(de) }, {
                default: B(() => [
                  Ke(
                    Q(n(L)("取消")),
                    1
                    /* TEXT */
                  )
                ]),
                _: 1
                /* STABLE */
              }, 8, ["onClick"]),
              z(n(Je), {
                btnType: "primary",
                style: { "margin-left": "12px" },
                onClick: n(we)
              }, {
                default: B(() => [
                  Ke(
                    Q(n(L)("确定")),
                    1
                    /* TEXT */
                  )
                ]),
                _: 1
                /* STABLE */
              }, 8, ["onClick"])
            ])
          ]),
          default: B(() => [
            K("div", zo, [
              K(
                "div",
                Bo,
                Q(n(L)("表格设置")),
                1
                /* TEXT */
              )
            ]),
            K("div", Uo, [
              K(
                "div",
                {
                  class: "text-btn",
                  onClick: O[2] || (O[2] = //@ts-ignore
                  (...p) => n(ge) && n(ge)(...p))
                },
                Q(n(L)("恢复默认")),
                1
                /* TEXT */
              ),
              K(
                "div",
                {
                  class: "text-btn",
                  onClick: O[3] || (O[3] = //@ts-ignore
                  (...p) => n(V) && n(V)(...p)),
                  style: { "padding-left": "20px" }
                },
                Q(n(L)("全部隐藏")),
                1
                /* TEXT */
              )
            ]),
            z(n(Qe), {
              data: n(m),
              "outer-border": "",
              ref: "setTableRef",
              "max-height": "377px"
            }, {
              default: B(() => [
                z(n(ye), {
                  type: "index",
                  width: "56"
                }),
                z(n(ye), {
                  label: n(L)("列名"),
                  prop: "desc"
                }, null, 8, ["label"]),
                z(n(ye), {
                  label: n(L)("显示列"),
                  prop: "switch"
                }, {
                  default: B(({ row: p }) => [
                    z(n(Qt), {
                      modelValue: p.switch,
                      "onUpdate:modelValue": (M) => p.switch = M
                    }, null, 8, ["modelValue", "onUpdate:modelValue"])
                  ]),
                  _: 1
                  /* STABLE */
                }, 8, ["label"])
              ]),
              _: 1
              /* STABLE */
            }, 8, ["data"])
          ]),
          _: 1
          /* STABLE */
        }, 8, ["modelValue", "title", "onClose"])
      ],
      2
      /* CLASS */
    ));
  }
}), Lo = (e, t) => {
  const r = e.__vccOpts || e;
  for (const [a, o] of t)
    r[a] = o;
  return r;
}, ko = /* @__PURE__ */ Lo(Ro, [["__scopeId", "data-v-52c0d32b"]]), Vo = {
  列表控制: { "zh-CN": "列表控制", en: "List Control", _appCode: "framework" },
  表格设置: { "zh-CN": "表格设置", en: "Table Settings", _appCode: "framework" },
  恢复默认: { "zh-CN": "恢复默认", en: "Reset to Default", _appCode: "framework" },
  全部隐藏: { "zh-CN": "全部隐藏", en: "Hide All", _appCode: "framework" },
  列名: { "zh-CN": "列名", en: "Column Name", _appCode: "framework" },
  显示列: { "zh-CN": "显示列", en: "Visible Columns", _appCode: "framework" },
  取消: { "zh-CN": "取消", en: "Cancel", _appCode: "framework" },
  确定: { "zh-CN": "确定", en: "OK", _appCode: "framework" }
};
Gt(Vo);
const ts = Bt(ko), rs = () => T(null);
export {
  ts as DasProcessTable,
  rs as DasProcessTableRef,
  ts as default
};
