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