import { withInstall as vr } from "@das-fed/upf-utils/with-install/index";
import { useAttrs as Tr, ref as z, computed as ae, watch as _r, onMounted as wr, nextTick as jr, defineComponent as $r, unref as N, openBlock as mr, createElementBlock as Or, createVNode as Sr, mergeProps as Ar, createCommentVNode as Cr } from "vue";
import { DasSearchForm as Pr } from "@das-fed/upf-ui/packages/components/search-form/index";
import { i18n as v, getLang as xr, setI18nRule as Mr } from "@das-fed/upf-web/packages/i18n/index";
import { createService as le } from "@das-fed/upf-utils/api-services/src/create-service";
import { spaceManage as Fr } from "@das-fed/upf-utils/api-services/modules/space-manage";
import { getProjectInfo as $e } from "@das-fed/upf-utils/common-info/index";
import me from "dayjs";
var Ie = typeof global == "object" && global && global.Object === Object && global, Er = typeof self == "object" && self && self.Object === Object && self, j = Ie || Er || Function("return this")(), B = j.Symbol, Qe = Object.prototype, Dr = Qe.hasOwnProperty, zr = Qe.toString, Y = B ? B.toStringTag : void 0;
function Nr(e) {
  var r = Dr.call(e, Y), t = e[Y];
  try {
    e[Y] = void 0;
    var n = !0;
  } catch {
  }
  var d = zr.call(e);
  return n && (r ? e[Y] = t : delete e[Y]), d;
}
var Br = Object.prototype, Lr = Br.toString;
function Kr(e) {
  return Lr.call(e);
}
var kr = "[object Null]", Yr = "[object Undefined]", Oe = B ? B.toStringTag : void 0;
function G(e) {
  return e == null ? e === void 0 ? Yr : kr : Oe && Oe in Object(e) ? Nr(e) : Kr(e);
}
function q(e) {
  return e != null && typeof e == "object";
}
var pe = Array.isArray;
function H(e) {
  var r = typeof e;
  return e != null && (r == "object" || r == "function");
}
var Ur = "[object AsyncFunction]", Vr = "[object Function]", Rr = "[object GeneratorFunction]", Gr = "[object Proxy]";
function We(e) {
  if (!H(e))
    return !1;
  var r = G(e);
  return r == Vr || r == Rr || r == Ur || r == Gr;
}
var ne = j["__core-js_shared__"], Se = function() {
  var e = /[^.]+$/.exec(ne && ne.keys && ne.keys.IE_PROTO || "");
  return e ? "Symbol(src)_1." + e : "";
}();
function qr(e) {
  return !!Se && Se in e;
}
var Hr = Function.prototype, Ir = Hr.toString;
function E(e) {
  if (e != null) {
    try {
      return Ir.call(e);
    } catch {
    }
    try {
      return e + "";
    } catch {
    }
  }
  return "";
}
var Qr = /[\\^$.*+?()[\]{}|]/g, Wr = /^\[object .+?Constructor\]$/, Jr = Function.prototype, Xr = Object.prototype, Zr = Jr.toString, et = Xr.hasOwnProperty, rt = RegExp(
  "^" + Zr.call(et).replace(Qr, "\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g, "$1.*?") + "$"
);
function tt(e) {
  if (!H(e) || qr(e))
    return !1;
  var r = We(e) ? rt : Wr;
  return r.test(E(e));
}
function at(e, r) {
  return e == null ? void 0 : e[r];
}
function D(e, r) {
  var t = at(e, r);
  return tt(t) ? t : void 0;
}
var ce = D(j, "WeakMap"), Ae = Object.create, nt = /* @__PURE__ */ function() {
  function e() {
  }
  return function(r) {
    if (!H(r))
      return {};
    if (Ae)
      return Ae(r);
    e.prototype = r;
    var t = new e();
    return e.prototype = void 0, t;
  };
}();
function ot(e, r) {
  var t = -1, n = e.length;
  for (r || (r = Array(n)); ++t < n; )
    r[t] = e[t];
  return r;
}
var Ce = function() {
  try {
    var e = D(Object, "defineProperty");
    return e({}, "", {}), e;
  } catch {
  }
}();
function ct(e, r) {
  for (var t = -1, n = e == null ? 0 : e.length; ++t < n && r(e[t], t, e) !== !1; )
    ;
  return e;
}
var it = 9007199254740991, st = /^(?:0|[1-9]\d*)$/;
function ut(e, r) {
  var t = typeof e;
  return r = r ?? it, !!r && (t == "number" || t != "symbol" && st.test(e)) && e > -1 && e % 1 == 0 && e < r;
}
function Je(e, r, t) {
  r == "__proto__" && Ce ? Ce(e, r, {
    configurable: !0,
    enumerable: !0,
    value: t,
    writable: !0
  }) : e[r] = t;
}
function Xe(e, r) {
  return e === r || e !== e && r !== r;
}
var lt = Object.prototype, pt = lt.hasOwnProperty;
function Ze(e, r, t) {
  var n = e[r];
  (!(pt.call(e, r) && Xe(n, t)) || t === void 0 && !(r in e)) && Je(e, r, t);
}
function X(e, r, t, n) {
  var d = !t;
  t || (t = {});
  for (var u = -1, l = r.length; ++u < l; ) {
    var b = r[u], h = void 0;
    h === void 0 && (h = e[b]), d ? Je(t, b, h) : Ze(t, b, h);
  }
  return t;
}
var ft = 9007199254740991;
function er(e) {
  return typeof e == "number" && e > -1 && e % 1 == 0 && e <= ft;
}
function rr(e) {
  return e != null && er(e.length) && !We(e);
}
var dt = Object.prototype;
function fe(e) {
  var r = e && e.constructor, t = typeof r == "function" && r.prototype || dt;
  return e === t;
}
function ht(e, r) {
  for (var t = -1, n = Array(e); ++t < e; )
    n[t] = r(t);
  return n;
}
var yt = "[object Arguments]";
function Pe(e) {
  return q(e) && G(e) == yt;
}
var tr = Object.prototype, bt = tr.hasOwnProperty, gt = tr.propertyIsEnumerable, vt = Pe(/* @__PURE__ */ function() {
  return arguments;
}()) ? Pe : function(e) {
  return q(e) && bt.call(e, "callee") && !gt.call(e, "callee");
};
function Tt() {
  return !1;
}
var ar = typeof exports == "object" && exports && !exports.nodeType && exports, xe = ar && typeof module == "object" && module && !module.nodeType && module, _t = xe && xe.exports === ar, Me = _t ? j.Buffer : void 0, wt = Me ? Me.isBuffer : void 0, nr = wt || Tt, jt = "[object Arguments]", $t = "[object Array]", mt = "[object Boolean]", Ot = "[object Date]", St = "[object Error]", At = "[object Function]", Ct = "[object Map]", Pt = "[object Number]", xt = "[object Object]", Mt = "[object RegExp]", Ft = "[object Set]", Et = "[object String]", Dt = "[object WeakMap]", zt = "[object ArrayBuffer]", Nt = "[object DataView]", Bt = "[object Float32Array]", Lt = "[object Float64Array]", Kt = "[object Int8Array]", kt = "[object Int16Array]", Yt = "[object Int32Array]", Ut = "[object Uint8Array]", Vt = "[object Uint8ClampedArray]", Rt = "[object Uint16Array]", Gt = "[object Uint32Array]", f = {};
f[Bt] = f[Lt] = f[Kt] = f[kt] = f[Yt] = f[Ut] = f[Vt] = f[Rt] = f[Gt] = !0;
f[jt] = f[$t] = f[zt] = f[mt] = f[Nt] = f[Ot] = f[St] = f[At] = f[Ct] = f[Pt] = f[xt] = f[Mt] = f[Ft] = f[Et] = f[Dt] = !1;
function qt(e) {
  return q(e) && er(e.length) && !!f[G(e)];
}
function de(e) {
  return function(r) {
    return e(r);
  };
}
var or = typeof exports == "object" && exports && !exports.nodeType && exports, U = or && typeof module == "object" && module && !module.nodeType && module, Ht = U && U.exports === or, oe = Ht && Ie.process, L = function() {
  try {
    var e = U && U.require && U.require("util").types;
    return e || oe && oe.binding && oe.binding("util");
  } catch {
  }
}(), Fe = L && L.isTypedArray, It = Fe ? de(Fe) : qt, Qt = Object.prototype, Wt = Qt.hasOwnProperty;
function cr(e, r) {
  var t = pe(e), n = !t && vt(e), d = !t && !n && nr(e), u = !t && !n && !d && It(e), l = t || n || d || u, b = l ? ht(e.length, String) : [], h = b.length;
  for (var y in e)
    (r || Wt.call(e, y)) && !(l && // Safari 9 has enumerable `arguments.length` in strict mode.
    (y == "length" || // Node.js 0.10 has enumerable non-index properties on buffers.
    d && (y == "offset" || y == "parent") || // PhantomJS 2 has enumerable non-index properties on typed arrays.
    u && (y == "buffer" || y == "byteLength" || y == "byteOffset") || // Skip index properties.
    ut(y, h))) && b.push(y);
  return b;
}
function ir(e, r) {
  return function(t) {
    return e(r(t));
  };
}
var Jt = ir(Object.keys, Object), Xt = Object.prototype, Zt = Xt.hasOwnProperty;
function ea(e) {
  if (!fe(e))
    return Jt(e);
  var r = [];
  for (var t in Object(e))
    Zt.call(e, t) && t != "constructor" && r.push(t);
  return r;
}
function he(e) {
  return rr(e) ? cr(e) : ea(e);
}
function ra(e) {
  var r = [];
  if (e != null)
    for (var t in Object(e))
      r.push(t);
  return r;
}
var ta = Object.prototype, aa = ta.hasOwnProperty;
function na(e) {
  if (!H(e))
    return ra(e);
  var r = fe(e), t = [];
  for (var n in e)
    n == "constructor" && (r || !aa.call(e, n)) || t.push(n);
  return t;
}
function ye(e) {
  return rr(e) ? cr(e, !0) : na(e);
}
var V = D(Object, "create");
function oa() {
  this.__data__ = V ? V(null) : {}, this.size = 0;
}
function ca(e) {
  var r = this.has(e) && delete this.__data__[e];
  return this.size -= r ? 1 : 0, r;
}
var ia = "__lodash_hash_undefined__", sa = Object.prototype, ua = sa.hasOwnProperty;
function la(e) {
  var r = this.__data__;
  if (V) {
    var t = r[e];
    return t === ia ? void 0 : t;
  }
  return ua.call(r, e) ? r[e] : void 0;
}
var pa = Object.prototype, fa = pa.hasOwnProperty;
function da(e) {
  var r = this.__data__;
  return V ? r[e] !== void 0 : fa.call(r, e);
}
var ha = "__lodash_hash_undefined__";
function ya(e, r) {
  var t = this.__data__;
  return this.size += this.has(e) ? 0 : 1, t[e] = V && r === void 0 ? ha : r, this;
}
function F(e) {
  var r = -1, t = e == null ? 0 : e.length;
  for (this.clear(); ++r < t; ) {
    var n = e[r];
    this.set(n[0], n[1]);
  }
}
F.prototype.clear = oa;
F.prototype.delete = ca;
F.prototype.get = la;
F.prototype.has = da;
F.prototype.set = ya;
function ba() {
  this.__data__ = [], this.size = 0;
}
function Z(e, r) {
  for (var t = e.length; t--; )
    if (Xe(e[t][0], r))
      return t;
  return -1;
}
var ga = Array.prototype, va = ga.splice;
function Ta(e) {
  var r = this.__data__, t = Z(r, e);
  if (t < 0)
    return !1;
  var n = r.length - 1;
  return t == n ? r.pop() : va.call(r, t, 1), --this.size, !0;
}
function _a(e) {
  var r = this.__data__, t = Z(r, e);
  return t < 0 ? void 0 : r[t][1];
}
function wa(e) {
  return Z(this.__data__, e) > -1;
}
function ja(e, r) {
  var t = this.__data__, n = Z(t, e);
  return n < 0 ? (++this.size, t.push([e, r])) : t[n][1] = r, this;
}
function A(e) {
  var r = -1, t = e == null ? 0 : e.length;
  for (this.clear(); ++r < t; ) {
    var n = e[r];
    this.set(n[0], n[1]);
  }
}
A.prototype.clear = ba;
A.prototype.delete = Ta;
A.prototype.get = _a;
A.prototype.has = wa;
A.prototype.set = ja;
var R = D(j, "Map");
function $a() {
  this.size = 0, this.__data__ = {
    hash: new F(),
    map: new (R || A)(),
    string: new F()
  };
}
function ma(e) {
  var r = typeof e;
  return r == "string" || r == "number" || r == "symbol" || r == "boolean" ? e !== "__proto__" : e === null;
}
function ee(e, r) {
  var t = e.__data__;
  return ma(r) ? t[typeof r == "string" ? "string" : "hash"] : t.map;
}
function Oa(e) {
  var r = ee(this, e).delete(e);
  return this.size -= r ? 1 : 0, r;
}
function Sa(e) {
  return ee(this, e).get(e);
}
function Aa(e) {
  return ee(this, e).has(e);
}
function Ca(e, r) {
  var t = ee(this, e), n = t.size;
  return t.set(e, r), this.size += t.size == n ? 0 : 1, this;
}
function K(e) {
  var r = -1, t = e == null ? 0 : e.length;
  for (this.clear(); ++r < t; ) {
    var n = e[r];
    this.set(n[0], n[1]);
  }
}
K.prototype.clear = $a;
K.prototype.delete = Oa;
K.prototype.get = Sa;
K.prototype.has = Aa;
K.prototype.set = Ca;
function sr(e, r) {
  for (var t = -1, n = r.length, d = e.length; ++t < n; )
    e[d + t] = r[t];
  return e;
}
var ur = ir(Object.getPrototypeOf, Object);
function Pa() {
  this.__data__ = new A(), this.size = 0;
}
function xa(e) {
  var r = this.__data__, t = r.delete(e);
  return this.size = r.size, t;
}
function Ma(e) {
  return this.__data__.get(e);
}
function Fa(e) {
  return this.__data__.has(e);
}
var Ea = 200;
function Da(e, r) {
  var t = this.__data__;
  if (t instanceof A) {
    var n = t.__data__;
    if (!R || n.length < Ea - 1)
      return n.push([e, r]), this.size = ++t.size, this;
    t = this.__data__ = new K(n);
  }
  return t.set(e, r), this.size = t.size, this;
}
function k(e) {
  var r = this.__data__ = new A(e);
  this.size = r.size;
}
k.prototype.clear = Pa;
k.prototype.delete = xa;
k.prototype.get = Ma;
k.prototype.has = Fa;
k.prototype.set = Da;
function za(e, r) {
  return e && X(r, he(r), e);
}
function Na(e, r) {
  return e && X(r, ye(r), e);
}
var lr = typeof exports == "object" && exports && !exports.nodeType && exports, Ee = lr && typeof module == "object" && module && !module.nodeType && module, Ba = Ee && Ee.exports === lr, De = Ba ? j.Buffer : void 0, ze = De ? De.allocUnsafe : void 0;
function La(e, r) {
  if (r)
    return e.slice();
  var t = e.length, n = ze ? ze(t) : new e.constructor(t);
  return e.copy(n), n;
}
function Ka(e, r) {
  for (var t = -1, n = e == null ? 0 : e.length, d = 0, u = []; ++t < n; ) {
    var l = e[t];
    r(l, t, e) && (u[d++] = l);
  }
  return u;
}
function pr() {
  return [];
}
var ka = Object.prototype, Ya = ka.propertyIsEnumerable, Ne = Object.getOwnPropertySymbols, be = Ne ? function(e) {
  return e == null ? [] : (e = Object(e), Ka(Ne(e), function(r) {
    return Ya.call(e, r);
  }));
} : pr;
function Ua(e, r) {
  return X(e, be(e), r);
}
var Va = Object.getOwnPropertySymbols, fr = Va ? function(e) {
  for (var r = []; e; )
    sr(r, be(e)), e = ur(e);
  return r;
} : pr;
function Ra(e, r) {
  return X(e, fr(e), r);
}
function dr(e, r, t) {
  var n = r(e);
  return pe(e) ? n : sr(n, t(e));
}
function Ga(e) {
  return dr(e, he, be);
}
function qa(e) {
  return dr(e, ye, fr);
}
var ie = D(j, "DataView"), se = D(j, "Promise"), ue = D(j, "Set"), Be = "[object Map]", Ha = "[object Object]", Le = "[object Promise]", Ke = "[object Set]", ke = "[object WeakMap]", Ye = "[object DataView]", Ia = E(ie), Qa = E(R), Wa = E(se), Ja = E(ue), Xa = E(ce), S = G;
(ie && S(new ie(new ArrayBuffer(1))) != Ye || R && S(new R()) != Be || se && S(se.resolve()) != Le || ue && S(new ue()) != Ke || ce && S(new ce()) != ke) && (S = function(e) {
  var r = G(e), t = r == Ha ? e.constructor : void 0, n = t ? E(t) : "";
  if (n)
    switch (n) {
      case Ia:
        return Ye;
      case Qa:
        return Be;
      case Wa:
        return Le;
      case Ja:
        return Ke;
      case Xa:
        return ke;
    }
  return r;
});
var Za = Object.prototype, en = Za.hasOwnProperty;
function rn(e) {
  var r = e.length, t = new e.constructor(r);
  return r && typeof e[0] == "string" && en.call(e, "index") && (t.index = e.index, t.input = e.input), t;
}
var Ue = j.Uint8Array;
function ge(e) {
  var r = new e.constructor(e.byteLength);
  return new Ue(r).set(new Ue(e)), r;
}
function tn(e, r) {
  var t = r ? ge(e.buffer) : e.buffer;
  return new e.constructor(t, e.byteOffset, e.byteLength);
}
var an = /\w*$/;
function nn(e) {
  var r = new e.constructor(e.source, an.exec(e));
  return r.lastIndex = e.lastIndex, r;
}
var Ve = B ? B.prototype : void 0, Re = Ve ? Ve.valueOf : void 0;
function on(e) {
  return Re ? Object(Re.call(e)) : {};
}
function cn(e, r) {
  var t = r ? ge(e.buffer) : e.buffer;
  return new e.constructor(t, e.byteOffset, e.length);
}
var sn = "[object Boolean]", un = "[object Date]", ln = "[object Map]", pn = "[object Number]", fn = "[object RegExp]", dn = "[object Set]", hn = "[object String]", yn = "[object Symbol]", bn = "[object ArrayBuffer]", gn = "[object DataView]", vn = "[object Float32Array]", Tn = "[object Float64Array]", _n = "[object Int8Array]", wn = "[object Int16Array]", jn = "[object Int32Array]", $n = "[object Uint8Array]", mn = "[object Uint8ClampedArray]", On = "[object Uint16Array]", Sn = "[object Uint32Array]";
function An(e, r, t) {
  var n = e.constructor;
  switch (r) {
    case bn:
      return ge(e);
    case sn:
    case un:
      return new n(+e);
    case gn:
      return tn(e, t);
    case vn:
    case Tn:
    case _n:
    case wn:
    case jn:
    case $n:
    case mn:
    case On:
    case Sn:
      return cn(e, t);
    case ln:
      return new n();
    case pn:
    case hn:
      return new n(e);
    case fn:
      return nn(e);
    case dn:
      return new n();
    case yn:
      return on(e);
  }
}
function Cn(e) {
  return typeof e.constructor == "function" && !fe(e) ? nt(ur(e)) : {};
}
var Pn = "[object Map]";
function xn(e) {
  return q(e) && S(e) == Pn;
}
var Ge = L && L.isMap, Mn = Ge ? de(Ge) : xn, Fn = "[object Set]";
function En(e) {
  return q(e) && S(e) == Fn;
}
var qe = L && L.isSet, Dn = qe ? de(qe) : En, zn = 1, Nn = 2, Bn = 4, hr = "[object Arguments]", Ln = "[object Array]", Kn = "[object Boolean]", kn = "[object Date]", Yn = "[object Error]", yr = "[object Function]", Un = "[object GeneratorFunction]", Vn = "[object Map]", Rn = "[object Number]", br = "[object Object]", Gn = "[object RegExp]", qn = "[object Set]", Hn = "[object String]", In = "[object Symbol]", Qn = "[object WeakMap]", Wn = "[object ArrayBuffer]", Jn = "[object DataView]", Xn = "[object Float32Array]", Zn = "[object Float64Array]", eo = "[object Int8Array]", ro = "[object Int16Array]", to = "[object Int32Array]", ao = "[object Uint8Array]", no = "[object Uint8ClampedArray]", oo = "[object Uint16Array]", co = "[object Uint32Array]", p = {};
p[hr] = p[Ln] = p[Wn] = p[Jn] = p[Kn] = p[kn] = p[Xn] = p[Zn] = p[eo] = p[ro] = p[to] = p[Vn] = p[Rn] = p[br] = p[Gn] = p[qn] = p[Hn] = p[In] = p[ao] = p[no] = p[oo] = p[co] = !0;
p[Yn] = p[yr] = p[Qn] = !1;
function J(e, r, t, n, d, u) {
  var l, b = r & zn, h = r & Nn, y = r & Bn;
  if (l !== void 0)
    return l;
  if (!H(e))
    return e;
  var C = pe(e);
  if (C) {
    if (l = rn(e), !b)
      return ot(e, l);
  } else {
    var P = S(e), I = P == yr || P == Un;
    if (nr(e))
      return La(e, b);
    if (P == br || P == hr || I && !d) {
      if (l = h || I ? {} : Cn(e), !b)
        return h ? Ra(e, Na(l, e)) : Ua(e, za(l, e));
    } else {
      if (!p[P])
        return d ? e : {};
      l = An(e, P, b);
    }
  }
  u || (u = new k());
  var Q = u.get(e);
  if (Q)
    return Q;
  u.set(e, l), Dn(e) ? e.forEach(function(g) {
    l.add(J(g, r, t, g, e, u));
  }) : Mn(e) && e.forEach(function(g, _) {
    l.set(_, J(g, r, t, _, e, u));
  });
  var re = y ? h ? qa : Ga : h ? ye : he, W = C ? void 0 : re(e);
  return ct(W || e, function(g, _) {
    W && (_ = g, g = e[_]), Ze(l, _, J(g, r, t, _, e, u));
  }), l;
}
var io = 1, so = 4;
function T(e) {
  return J(e, io | so);
}
const He = le, uo = le("/workflow/form/dataTemplate/v1/getBpmDataTemplateInfoByFlowKey"), lo = uo.get(""), gr = Fr, po = le("/form/dataTemplate/v1/getBpmDataTemplateInfoByFlowKey"), fo = gr.get("/controller/space-children"), ho = gr.get("/controller/fuzzy-tree");
po.get("");
const yo = (e, r) => {
  var _e, we;
  const t = Tr(), n = z([]), d = z([]), u = z([]), l = z([]), b = z([]), h = ae(() => e.borderType), y = (_e = $e()) != null && _e.id ? (we = $e()) == null ? void 0 : we.id : "1268137555009052672", C = ae(() => e.orgConfig), P = ae(() => {
    var i;
    if (t != null && t.showFilterPanel) {
      const s = (i = d.value) == null ? void 0 : i.filter((c) => c.layout !== "out");
      if ((s == null ? void 0 : s.length) === 0) return !1;
    }
    return t == null ? void 0 : t.showFilterPanel;
  }), I = async (i) => {
    let s = { projectId: y, project: y, spaceId: null };
    i != null && i.id && (s.spaceId = i.id);
    const [c, a] = await fo(s).run();
    return c ? {} : a;
  }, Q = async (i) => {
    if (!i) return {};
    const [s, c] = await ho({ projectId: y, project: y, name: i }).run();
    return s ? {} : c;
  }, re = async () => {
    var a, $, x;
    const i = {
      flowKey: e.flowKey,
      needDisplayFileds: e.needDisplayFileds,
      project: y
    }, [s, c] = await lo(i).run();
    s || ((a = c.value) != null && a.conditionField && (n.value = JSON.parse(c.value.conditionField)), ($ = c.value) != null && $.manageField && (l.value = JSON.parse(c.value.manageField), r("getBtnSetting", l.value)), (x = c.value) != null && x.sortField && (b.value = JSON.parse(c.value.sortField).map((M) => ({
      property: M.name,
      direction: M.sort
    }))));
  }, W = z([
    /** 0 */
    {
      key: "searchInputKey",
      label: "",
      type: "searchInput",
      placeholder: v("请输入关键字").value,
      value: "",
      clearable: !0,
      isIconLeft: !0,
      layout: "out",
      size: "small",
      width: "200px"
    },
    /** 1 */
    {
      key: "input1",
      label: v("输入框").value,
      type: "input",
      borderType: h.value == "underline" ? "bottom" : "bordered",
      value: "",
      closable: !0,
      width: "200px"
    },
    /** 2 */
    {
      key: "sourceKey",
      label: v("选择框").value,
      borderType: h.value,
      type: "select",
      placeholder: v("请选择").value,
      value: void 0,
      options: [],
      optionsValueKey: "key",
      optionsLabelKey: "value",
      clearable: !1,
      allowClear: !0,
      width: "200px",
      // change: (val) => {
      //   console.log(val)
      // },
      closable: !0
    },
    /** 3*/
    {
      key: "timeKey",
      borderType: h.value,
      label: v("时间框").value,
      width: "200px",
      type: "date",
      format: "YYYY/MM/DD",
      valueFormat: "YYYY/MM/DD",
      value: "",
      closable: !0,
      allowClear: !0
    },
    /** 4 */
    {
      key: "treeKey",
      label: v("位置选择").value,
      type: "treeSelect",
      borderType: h.value,
      width: "200px",
      mode: "",
      value: "",
      nodeKey: "id",
      closable: !0,
      allowClear: !0,
      options: [],
      checkedNodes: [],
      treeProps: {
        label: "name",
        disabled: (i) => i.id == 1
      },
      load: I,
      keyword: "",
      selectAttrs: { showSearch: !1, allowClear: !0 },
      search: Q
    },
    /** 5 */
    {
      key: "radioKey",
      label: v("单选").value,
      type: "radio",
      value: "",
      options: [],
      optionsValueKey: "key",
      optionsLabelKey: "value"
    },
    /** 6*/
    {
      key: "timeRangeKey",
      borderType: h.value,
      label: v("时间框").value,
      width: "200px",
      type: "dateRange",
      format: "YYYY/MM/DD",
      valueFormat: "YYYY/MM/DD",
      value: [],
      closable: !0,
      allowClear: !0
    },
    /** 7 组织树 业务内置 */
    {
      key: "orgKey",
      label: v("组织").value,
      type: "treeSelect",
      borderType: h.value,
      width: "200px",
      mode: "",
      value: "",
      // value:'371378117828677',
      nodeKey: "id",
      closable: !1,
      options: [],
      // load:reqOrgTree,
      // change: selectChangeTree,
      treeProps: {},
      checkedNodes: []
    }
  ]), g = (i) => {
    jr(() => {
      const s = [];
      Object.keys(i).map((c) => (n.value.map((a) => {
        var $;
        if (($ = c == null ? void 0 : c.split(",")) != null && $.includes(a.name) && i[c])
          if (a.ct === "dateRange") {
            if (i[c][0] && i[c][1]) {
              const x = me(i[c][0]).startOf("day").format("YYYY-MM-DD"), M = me(i[c][1]).endOf("day").format("YYYY-MM-DD");
              s.push({
                property: c,
                value: [x, M],
                group: "quick",
                // 自定义
                // relation: (it.mg as boolean) ? 'AND' : 'OR',
                relation: "AND",
                operation: a.qt.toUpperCase()
              });
            }
          } else
            s.push({
              property: a.name,
              value: i[c],
              group: a.mg ? "merge" : "quick",
              // 自定义
              relation: a.mg ? "OR" : "AND",
              operation: a.qt.toUpperCase()
            });
      }), {})), r("processConfirm", s, b.value);
    });
  }, _ = () => {
    const i = {};
    d.value.map((s) => {
      if (s.type === "treeSelect") {
        const c = ve(s == null ? void 0 : s.options, s == null ? void 0 : s.value, s == null ? void 0 : s.nodeKey);
        s.checkedNodes = c;
      }
      i[s.key] = s.value;
    }), g(i);
  };
  function ve(i, s, c) {
    for (let a of i) {
      if (a[c] === s)
        return a;
      if (a.children) {
        const $ = ve(a.children, s, c);
        if ($)
          return $;
      }
    }
    return null;
  }
  const Te = async () => {
    await re();
    const i = T(W.value);
    u.value = [];
    let s = !1;
    const c = T(i[0]);
    c.key = "", c.label = "", c.placeholder = "", await Promise.all(
      n.value.map((a, $) => (async () => {
        var x, M, je;
        if (a.ct === "onetext") {
          if (a.mg) {
            const m = xr().value === "en-US";
            s = !0;
            const O = a.name, w = a.cm;
            c.key += c.key ? `,${O}` : O, c.label += c.label ? `,${w}` : w, c.placeholder += c.placeholder ? m ? `/${w}` : `/${w}`.toLowerCase() : m ? `${v("process-search-form-search").value}${w}` : `${v("process-search-form-search").value}` + w.toLowerCase(), a.defaultValue && (c.value = a.defaultValue);
            return;
          }
          const o = T(i[1]);
          o.label = a.cm, o.key = a.name, a.defaultValue && (o.value = a.defaultValue), u.value.push(o);
        }
        if (a.ct === "select") {
          const o = T(i[2]);
          if (o.label = a.cm, o.key = a.name, o.value = a.defaultValue ? a.defaultValue : void 0, ((x = a.option) == null ? void 0 : x.choiceType) === "static" && (o.options = a.controlContent), ((M = a.option) == null ? void 0 : M.choiceType) === "dynamic" && (o.optionsValueKey = a.option.customQuery.valueBind, o.optionsLabelKey = a.option.customQuery.labelBind, a.option.customQuery.url)) {
            const m = {};
            if (a.option.customQuery.conditionfield.map((O) => {
              m[O.field] = O.defaultValue;
            }), a.option.customQuery.requestType === "GET") {
              const O = { project: y, ...m }, [w, te] = await He(a.option.customQuery.url).get("")(O).run();
              if (w) return;
              o.options = te;
            }
            if (a.option.customQuery.requestType === "POST") {
              const O = { project: y, ...m }, [w, te] = await He(a.option.customQuery.url).post("")(O).run();
              if (w) return;
              o.options = te;
            }
          }
          u.value.push(o);
        }
        if (a.ct === "date") {
          const o = T(i[3]);
          o.label = a.cm, o.key = a.name, a.defaultValue && (o.value = a.defaultValue), u.value.push(o);
        }
        if (a.ct === "pasitionSelector") {
          const o = T(i[4]);
          o.label = a.cm, a.defaultValue && (o.value = a.defaultValue), o.key = a.name, u.value.push(o);
        }
        if (a.ct === "radio") {
          const o = T(i[5]);
          o.label = a.cm, o.key = a.name, a.defaultValue && (o.value = a.defaultValue), ((je = a.option) == null ? void 0 : je.choiceType) === "static" && (o.options = a.controlContent), u.value.push(o);
        }
        if (a.ct === "dateRange") {
          const o = T(i[6]);
          o.label = a.cm, o.key = a.name, a.defaultValue && (o.value = a.defaultValue), u.value.push(o);
        }
        if (a.ct === "orgSelector") {
          const o = T(i[7]);
          o.label = a.cm, o.key = a.name, a.defaultValue && (o.value = a.defaultValue), C.value && Object.keys(C.value || {}).forEach((m) => {
            o[m] = C.value[m];
          }), u.value.push(o);
        }
      })())
    ), s && u.value.unshift(c);
  };
  return _r(
    () => C.value,
    async () => {
      await Te(), d.value = T(u.value), _();
    },
    {
      deep: !0,
      flush: "post"
    }
  ), wr(async () => {
    C.value || (await Te(), d.value = T(u.value), _());
  }), {
    searchOptions: d,
    buttonSetting: l,
    settingData: n,
    searchList: g,
    showFilterPanel: P
  };
}, bo = {
  key: 0,
  class: "das-process-search-from"
}, go = /* @__PURE__ */ $r({
  __name: "App",
  props: {
    flowKey: { default: "" },
    needDisplayFileds: { type: Boolean, default: !1 },
    borderType: { default: "bordered" },
    orgConfig: {}
  },
  emits: ["processConfirm", "getBtnSetting"],
  setup(e, { emit: r }) {
    const t = e, n = r, {
      searchOptions: d,
      searchList: u,
      settingData: l,
      showFilterPanel: b
    } = yo(t, n);
    return (h, y) => N(l).length > 0 ? (mr(), Or("div", bo, [
      Sr(N(Pr), Ar(h.$attrs, {
        options: N(d),
        onConfirm: N(u),
        showFilterPanel: N(b),
        isMarginRight: h.$attrs.isMarginRight ?? (N(b) ? void 0 : !0)
      }), null, 16, ["options", "onConfirm", "showFilterPanel", "isMarginRight"])
    ])) : Cr("v-if", !0);
  }
}), vo = {
  请输入关键字: { "zh-CN": "请输入关键字", en: "Please enter keyword", "zh-MO": "請輸入關鍵字", _appCode: "framework" },
  输入框: { "zh-CN": "输入框", en: "Input Box", "zh-MO": "輸入框", _appCode: "framework" },
  选择框: { "zh-CN": "选择框", en: "Select Box", "zh-MO": "選擇框", _appCode: "framework" },
  请选择: { "zh-CN": "请选择", en: "Please select", "zh-MO": "請選擇", _appCode: "framework" },
  时间框: { "zh-CN": "时间框", en: "Time Box", "zh-MO": "時間框", _appCode: "framework" },
  位置选择: { "zh-CN": "位置选择", en: "Location Selection", "zh-MO": "位置選擇", _appCode: "framework" },
  单选: { "zh-CN": "单选", en: "Single Choice", "zh-MO": "單選", _appCode: "framework" },
  组织: { "zh-CN": "组织", en: "Organization", "zh-MO": "組織", _appCode: "framework" },
  "process-search-form-search": { "zh-CN": "搜索", en: "Search ", "zh-MO": "搜尋", _appCode: "framework" }
};
Mr(vo);
const Ao = vr(go);
export {
  Ao as DasProcessSearchForm,
  Ao as default
};
