var ee = Object.defineProperty;
var te = (t, n, s) => n in t ? ee(t, n, { enumerable: !0, configurable: !0, writable: !0, value: s }) : t[n] = s;
var C = (t, n, s) => (te(t, typeof n != "symbol" ? n + "" : n, s), s);
import { PluginStaticResource as se, ViewMode as ae } from "@ibiz-template/runtime";
import { ref as w, watch as _, defineComponent as S, getCurrentInstance as V, computed as N, onMounted as A, h as a, toRefs as U, reactive as ne, nextTick as F, toRef as oe } from "vue";
import { useRouter as H, useRoute as B, useIndexViewController as re, useNamespace as q, useControlController as ie, usePropsWatch as le, useListController as ce, useListExpViewController as de, useRouteKey as ue, getUploadProps as he, getEditorEmits as pe, useMPickupViewController as me, useTreeController as fe } from "@ibiz-template/vue-util";
import { createUUID as ge } from "qx-util";
import { IndexViewModel as ve, PortletPartModel as ye, ViewPortletModel as we, ListModel as W, TreeModel as be } from "@ibiz-template/model";
import K from "dayjs";
import { CustomPortletController as Ce, ViewPortletController as xe, EditFormController as ke, ListController as Pe, UploadEditorController as De, FormMDCtrlController as Se } from "@ibiz-template/controller";
import { init as Y, registerMap as qe } from "echarts";
import { mergeDeepRight as _e } from "ramda";
import { Treeselect as Me } from "@riophae/vue-treeselect";
const E = new se(import.meta.url);
class Ee {
  constructor() {
    C(this, "component", "UserIndexView");
  }
}
const Te = (t) => {
  const { view2: n, params2: s, params1: e } = t.params;
  if (!n)
    return "";
  let r = s.replace(
    new RegExp(";srfnav=[^;=]*$|(?<=;)srfnav=[^;=]*;|^srfnav=[^;=]*;|^srfnav=[^;=]*$", "g"),
    ""
  );
  return r = r || ibiz.env.routePlaceholder, `/${e}/${n}/${r}`;
}, Ie = (t) => {
  const { view1: n, appContext: s } = t.params;
  return `/${s}/${n}/${ibiz.env.routePlaceholder}`;
};
function ze(t, n) {
  const s = H(t), e = w(""), r = w(""), o = w([]), d = w([]), g = (l) => {
    l.forEach((p) => {
      const b = o.value.indexOf(p);
      b !== -1 && o.value.splice(b, 1);
      const k = d.value.findIndex((y) => y.key === p);
      k !== -1 && d.value.splice(k, 1);
    });
  };
  _(
    () => t.$route.path,
    (l, p) => {
      if (l !== p) {
        const b = B(t);
        e.value = Te(b), r.value = Ie(b);
        const k = d.value.find(
          (y) => y.key === e.value
        );
        if (k)
          b.matched.length === 2 ? s.push(k.fullPath) : k.fullPath = b.fullPath;
        else {
          if (l === r.value)
            return;
          d.value.push({
            key: e.value,
            fullPath: b.fullPath,
            modelPath: "",
            caption: ""
          });
        }
      }
    },
    { deep: !0, immediate: !0 }
  ), _(
    e,
    (l, p) => {
      if (l !== p && l) {
        const b = o.value.indexOf(l);
        b === -1 || o.value.splice(b, 1), o.value.unshift(l);
      }
    },
    { immediate: !0 }
  );
  const i = async (l, p) => {
    const b = d.value.find((k) => k.key === e.value);
    b && (p.caption && (b.caption = p.caption), p.modelPath && (b.modelPath = p.modelPath));
  }, h = (l = e.value) => {
    g([l]);
    const p = o.value[0];
    if (!p)
      n.model.source.blankMode ? window.close() : (e.value = "", s.push(r.value));
    else {
      const b = d.value.find((k) => k.key === p);
      s.push(b.fullPath);
    }
  }, m = (l) => {
    const p = d.value[l];
    p && s.push(p.fullPath);
  }, v = () => {
    const p = B(t).fullPath;
    let b = p.indexOf("/");
    for (let y = 0; y < 2; y++)
      b = p.indexOf("/", b + 1);
    const k = `${p.substring(0, b)}/-`;
    s.push(k);
  }, u = () => {
    if (o.value.length > 0) {
      const l = d.value.find(
        (p) => p.key === o.value[0]
      );
      l && s.push(l.fullPath);
    } else
      v();
  };
  return {
    currentKey: e,
    keyHistory: o,
    routeMsgs: d,
    updateRouteMsg: i,
    closeView: h,
    deleteRouteCache: g,
    handleTabClick: m,
    handleTabDelete: (l) => {
      const p = d.value[l];
      p && (g([p.key]), u());
    },
    handleCloseAll: () => {
      if (d.value.length > 0) {
        const l = [];
        d.value.forEach((p) => {
          l.push(p.key);
        }), g(l), u();
      }
    },
    handleCloseOther: () => {
      if (d.value.length > 0) {
        const l = [];
        d.value.forEach((p) => {
          p.key !== e.value && l.push(p.key);
        }), g(l), u();
      }
    }
  };
}
const Ve = /* @__PURE__ */ S({
  __name: "index-view",
  props: {
    context: null,
    params: { default: () => ({}) },
    modelPath: null
  },
  setup(t) {
    const n = t, { proxy: s } = V(), e = re(s, n.modelPath), r = !0;
    let o = null, d = null, g = () => {
    }, i = null, h = null, m = null, v = null, u = null, c, f, x, l;
    const p = w(ge());
    {
      const {
        currentKey: k,
        keyHistory: y,
        routeMsgs: P,
        updateRouteMsg: D,
        closeView: R,
        deleteRouteCache: O,
        handleTabClick: I,
        handleTabDelete: z,
        handleCloseAll: T,
        handleCloseOther: X
      } = ze(s, e);
      f = k, x = y, l = P, i = O, h = I, m = z, v = T, u = X, o = (M) => {
        const L = f.value;
        M.evt.on("closeView", () => {
          R(L);
        }), M.evt.on("setTitle", (Z) => {
          D(L, { caption: Z });
        });
      }, d = (M) => {
        D(f.value, M);
      }, window.onpopstate = () => {
        i([x.value[1]]);
      }, c = N(() => {
        const M = l.value.find(
          (L) => L.key === f.value
        );
        return (M == null ? void 0 : M.modelPath) || "";
      });
    }
    return A(() => {
      setTimeout(() => {
        const k = document.querySelector(".app-loading-x");
        k && (k.style.display = "none");
      }, 300);
    }), { __sfc: !0, props: n, proxy: s, c: e, isShowTabPageExp: r, onCreated: o, onViewFound: d, onMenuRouteChange: g, deleteRouteCache: i, handleTabClick: h, handleTabDelete: m, handleCloseAll: v, handleCloseOther: u, currentPath: c, currentKey: f, keyHistory: x, routeMsgs: l, appKeepAliveKey: p, collapseChange: (k) => {
      e.collapseChange = k;
    } };
  }
});
function Ae(t, n, s, e, r, o, d, g) {
  var i = typeof t == "function" ? t.options : t;
  n && (i.render = n, i.staticRenderFns = s, i._compiled = !0), e && (i.functional = !0), o && (i._scopeId = "data-v-" + o);
  var h;
  if (d ? (h = function(u) {
    u = u || this.$vnode && this.$vnode.ssrContext || this.parent && this.parent.$vnode && this.parent.$vnode.ssrContext, !u && typeof __VUE_SSR_CONTEXT__ < "u" && (u = __VUE_SSR_CONTEXT__), r && r.call(this, u), u && u._registeredComponents && u._registeredComponents.add(d);
  }, i._ssrRegister = h) : r && (h = g ? function() {
    r.call(
      this,
      (i.functional ? this.parent : this).$root.$options.shadowRoot
    );
  } : r), h)
    if (i.functional) {
      i._injectStyles = h;
      var m = i.render;
      i.render = function(c, f) {
        return h.call(f), m(c, f);
      };
    } else {
      var v = i.beforeCreate;
      i.beforeCreate = v ? [].concat(v, h) : [h];
    }
  return {
    exports: t,
    options: i
  };
}
var Oe = function() {
  var n = this, s = n._self._c, e = n._self._setupProxy;
  return s("UserAppLayout", { attrs: { "is-complete": e.c.complete, model: e.c.model, "is-show-tab-page-exp": e.isShowTabPageExp }, on: { onCollapseChange: e.collapseChange } }, [e.c.complete ? [e.c.complete ? s("app-menu", { attrs: { slot: "menu", "current-path": e.currentPath, "model-data": e.c.model.appMenu, context: e.c.context, "collapse-change": e.c.collapseChange }, on: { menuRouteChange: e.onMenuRouteChange }, slot: "menu" }) : n._e(), e.isShowTabPageExp ? s("user-tab-page-exp", { attrs: { slot: "tabPageExp", "route-msgs": e.routeMsgs, "current-key": e.currentKey }, on: { "tab-click": e.handleTabClick, "tab-delete": e.handleTabDelete, "close-all": e.handleCloseAll, "close-other": e.handleCloseOther }, slot: "tabPageExp" }) : n._e(), e.isShowTabPageExp ? s("AppKeepAlive", { attrs: { "key-list": e.keyHistory } }, [s("router-view", { key: e.currentKey, on: { neuronInit: e.onCreated, viewFound: e.onViewFound } })], 1) : s("AppKeepAlive", { key: e.appKeepAliveKey, attrs: { "key-list": e.keyHistory } }, [s("router-view", { key: e.currentKey, on: { neuronInit: e.onCreated, viewFound: e.onViewFound } })], 1)] : n._e()], 2);
}, Le = [], je = /* @__PURE__ */ Ae(
  Ve,
  Oe,
  Le,
  !1,
  null,
  null,
  null,
  null
);
const Ke = je.exports;
const J = S({
  name: "ChangePassword",
  props: {
    isShowModal: {
      type: Boolean,
      default: !1
    }
  },
  setup(t, {
    emit: n
  }) {
    const s = q("change-password"), e = w(null), r = w({
      oldPwd: "",
      newPwd: "",
      newPwd2: ""
    }), o = w(!1), d = {
      oldPwd: [{
        required: !0,
        message: "\u8BF7\u8F93\u5165\u539F\u5BC6\u7801",
        trigger: "blur"
      }],
      newPwd: [{
        required: !0,
        trigger: "blur",
        min: 8,
        max: 20,
        pattern: /^(?=.*[a-z])(?=.*[A-Z])(?=.*\d)(?=.*[!@#$%^&*()_+~`/*-])[A-Za-z\d!@#$%^&*()_+~`/*-]{8,20}$/,
        message: "\u5BC6\u7801\u81F3\u5C11\u5305\u542B\u516B\u4E2A\u5B57\u7B26\uFF0C\u81F3\u591A\u4E8C\u5341\u4E2A\u5B57\u7B26\uFF0C\u5305\u62EC\u81F3\u5C11\u4E00\u4E2A\u6570\u5B57\uFF0C\u5E76\u4E14\u540C\u65F6\u5305\u542B\u5927\u5C0F\u5199\u5B57\u6BCD\u548C\u7279\u6B8A\u5B57\u7B26"
      }],
      newPwd2: [{
        required: !0,
        trigger: "blur",
        validator(i, h, m) {
          h !== r.value.newPwd ? m(new Error("\u4E24\u6B21\u8F93\u5165\u5BC6\u7801\u4E0D\u4E00\u81F4\uFF0C\u8BF7\u68C0\u67E5")) : m();
        }
      }]
    }, g = () => {
      e.value.validate(async (i) => {
        var h, m, v;
        if (i)
          try {
            o.value = !0;
            const u = await ibiz.net.post("/v7/changepwd ", {
              oldPwd: r.value.oldPwd,
              newPwd: r.value.newPwd
            });
            if (u.ok) {
              ibiz.notification.success({
                title: "\u4FEE\u6539\u5BC6\u7801\u6210\u529F\uFF01"
              }), o.value = !1, n("change-success");
              return;
            }
            ibiz.notification.error({
              title: ((h = u.data) == null ? void 0 : h.message) || "\u4FEE\u6539\u5BC6\u7801\u5931\u8D25\uFF01"
            }), o.value = !1;
          } catch (u) {
            ibiz.notification.error({
              title: ((v = (m = u.response) == null ? void 0 : m.data) == null ? void 0 : v.message) || "\u4FEE\u6539\u5BC6\u7801\u5931\u8D25\uFF01"
            }), o.value = !1;
          }
      });
    };
    return _(() => t.isShowModal, (i) => {
      i === !0 && e.value && e.value.resetFields();
    }), {
      ns: s,
      formData: r,
      rules: d,
      loading: o,
      formRef: e,
      handleSubmit: g
    };
  },
  render(t) {
    return t("i-form", {
      class: this.ns.b(),
      ref: "formRef",
      attrs: {
        model: this.formData,
        rules: this.rules
      }
    }, [t("i-form-item", {
      attrs: {
        prop: "oldPwd",
        "label-position": "top",
        label: "\u539F\u5BC6\u7801"
      }
    }, [t("i-input", {
      attrs: {
        type: "password",
        password: !0,
        placeholder: "\u8BF7\u8F93\u5165\u539F\u5BC6\u7801",
        size: "large"
      },
      model: {
        value: this.formData.oldPwd,
        callback: (n) => {
          this.$set(this.formData, "oldPwd", n);
        }
      }
    })]), t("i-form-item", {
      attrs: {
        prop: "newPwd",
        "label-position": "top",
        label: "\u65B0\u5BC6\u7801"
      }
    }, [t("i-input", {
      attrs: {
        type: "password",
        password: !0,
        placeholder: "\u8BF7\u8F93\u5165\u65B0\u5BC6\u7801",
        size: "large"
      },
      model: {
        value: this.formData.newPwd,
        callback: (n) => {
          this.$set(this.formData, "newPwd", n);
        }
      }
    })]), t("i-form-item", {
      attrs: {
        prop: "newPwd2",
        "label-position": "top",
        label: "\u786E\u8BA4\u5BC6\u7801"
      }
    }, [t("i-input", {
      attrs: {
        type: "password",
        password: !0,
        placeholder: "\u8BF7\u518D\u6B21\u8F93\u5165\u65B0\u5BC6\u7801",
        size: "large"
      },
      model: {
        value: this.formData.newPwd2,
        callback: (n) => {
          this.$set(this.formData, "newPwd2", n);
        }
      }
    })]), t("i-form-item", [t("i-button", {
      class: this.ns.b("submit"),
      on: {
        click: this.handleSubmit
      },
      attrs: {
        loading: this.loading,
        size: "large"
      }
    }, ["\u786E\u8BA4\u4FEE\u6539"])])]);
  }
});
function Ne(t, n) {
  return a("div", {
    class: t.e("logo")
  }, [a("img", {
    class: t.e("logo-img"),
    attrs: {
      src: E.dir("/assets/img/jh.png")
    }
  }), a("div", {
    class: t.e("logo-caption")
  }, [n.caption])]);
}
const $e = S({
  name: "UserAppLayout",
  props: {
    model: {
      type: ve,
      required: !0
    },
    isComplete: {
      type: Boolean,
      default: !1
    },
    isShowTabPageExp: {
      type: Boolean,
      default: !1
    }
  },
  setup(t, {
    emit: n,
    slots: s
  }) {
    var y;
    const e = q("layout"), r = w(!1), o = () => {
      r.value = !r.value, n("onCollapseChange", r.value);
    }, d = N(() => t.model.source.blankMode === !0), g = async () => {
      var D;
      const P = (D = s.menu) == null ? void 0 : D.call(s)[0].componentInstance;
      P && P.c && await P.c.onClickMenuItem("menuitem46");
    }, {
      srfusername: i = "\u6E38\u5BA2",
      srforgsectorname: h,
      srffirstlogin: m
    } = ((y = ibiz.appData) == null ? void 0 : y.context) || {}, {
      proxy: v
    } = V(), u = H(v), c = async () => {
      (await ibiz.auth.v7logout()).ok ? (ibiz.message.success("\u767B\u51FA\u6210\u529F"), u.push(`/login?ru=${encodeURIComponent(window.location.hash.replace("#/", "/"))}`)) : ibiz.message.error("\u767B\u51FA\u5931\u8D25");
    }, f = w(!0), x = () => {
      f.value = !f.value;
    }, l = w(!1), p = w(!0);
    return m === 1 && (l.value = !0, p.value = !1), {
      ns: e,
      collapseChange: r,
      isBlank: d,
      collapseMenus: o,
      openView: g,
      srfusername: i,
      srforgsectorname: h,
      clickOut: c,
      isShowOpt: f,
      isShowModal: l,
      isModalClosable: p,
      changeShowOpt: x,
      showChangePassword: () => {
        l.value = !0;
      },
      hideChangePassword: () => {
        l.value = !1, p.value = !0;
      }
    };
  },
  render() {
    return this.isComplete ? a("i-layout", {
      class: [this.ns.b(), this.isBlank ? this.ns.m("blank") : "", this.ns.is("collapse", this.collapseChange), this.ns.is("tab", this.isShowTabPageExp)]
    }, [a("i-sider", {
      attrs: {
        "hide-trigger": !0,
        value: this.collapseChange
      },
      class: [this.ns.b("nav"), this.ns.is("collapse", this.collapseChange)]
    }, [Ne(this.ns, this.model), a("div", {
      class: this.ns.b("option")
    }, [a("i-poptip", {
      attrs: {
        trigger: "hover",
        transfer: !0,
        "popper-class": "opt-box",
        placement: "bottom-end"
      },
      scopedSlots: {
        default: () => a("div", {
          class: this.ns.be("option", "top")
        }, [a("img", {
          class: "head",
          attrs: {
            src: E.dir("/assets/img/head.svg")
          }
        }), a("div", {
          class: "user"
        }, [a("div", {
          class: "username"
        }, [this.srfusername]), a("div", {
          class: "orgname"
        }, [this.srforgsectorname])]), a("img", {
          class: "down",
          attrs: {
            src: E.dir("/assets/img/down.svg")
          }
        })]),
        content: () => a("div", {
          class: "opts"
        }, [a("div", {
          on: {
            click: this.showChangePassword
          }
        }, [a("img", {
          class: "lr",
          attrs: {
            src: E.dir("/assets/img/lr.svg")
          }
        }), "\u4FEE\u6539\u5BC6\u7801"]), a("div", {
          class: "logout",
          on: {
            click: this.clickOut
          }
        }, [a("i", {
          class: "ivu-icon ivu-icon-ios-log-out"
        }), "\u9000\u51FA\u767B\u9646"])])
      }
    }), a("div", {
      class: [this.ns.be("option", "bottom")]
    }, [a("i-tooltip", {
      attrs: {
        content: "\u8BBE\u5907\u79BB\u7EBF\u544A\u8B66",
        placement: "bottom",
        theme: "light"
      }
    }, [a("img", {
      class: "gj",
      attrs: {
        src: E.dir("/assets/img/gj.svg")
      },
      on: {
        click: () => this.openView()
      }
    })])])]), this.$slots.menu, a("div", {
      class: this.ns.be("slider", "collapse-icon")
    }, [this.collapseChange ? a("ion-icon", {
      attrs: {
        src: "./assets/img/menu-unfold.svg"
      },
      on: {
        click: () => this.collapseMenus()
      }
    }) : a("ion-icon", {
      attrs: {
        src: "./assets/img/menu-fold.svg"
      },
      on: {
        click: () => this.collapseMenus()
      }
    })])]), a("i-layout", {
      class: [this.ns.b("content")]
    }, [a("i-content", {
      class: this.ns.be("content", "main")
    }, [this.$slots.tabPageExp, this.$slots.default]), a("i-modal", {
      attrs: {
        title: "\u4FEE\u6539\u5BC6\u7801",
        "class-name": "change-password-modal",
        "mask-closable": this.isModalClosable,
        closable: this.isModalClosable,
        "footer-hide": !0
      },
      model: {
        value: this.isShowModal,
        callback: (t) => {
          this.isShowModal = t;
        }
      }
    }, [a(J, {
      attrs: {
        isShowModal: this.isShowModal
      },
      on: {
        "change-success": this.hideChangePassword
      }
    })])])]) : null;
  }
});
class G extends Ce {
  constructor() {
    super(...arguments);
    C(this, "options", []);
    C(this, "kqrq", "");
    C(this, "rylx", "");
  }
  async onInit() {
    await super.onInit(), this.options = await ibiz.codeListService.get(
      "UsrCodeList0402031972",
      this.context,
      this.params
    ), this.context.srforgcode && (this.params.orgcode = this.context.srforgcode), this.kqrq = K().subtract(1, "day").startOf("day").format("YYYY-MM-DD"), this.rylx = this.options.map((s) => s.value).join(","), this.changeViewParams();
  }
  changeViewParams() {
    this.dashboard.setContextOrParams(
      void 0,
      {
        ...this.params,
        kqrq: this.kqrq || null,
        rylx: this.rylx || null
      },
      !0
    );
  }
}
const Re = S({
  name: "PortletSearchHeader",
  props: {
    modelData: {
      type: ye,
      required: !0
    },
    controller: {
      type: G,
      required: !0
    }
  },
  setup(t) {
    const n = q("portal-search-header"), s = w([]), e = w(new Date()), r = (i) => {
      s.value = i, t.controller.rylx = i.join(","), t.controller.changeViewParams();
    }, o = (i) => {
      e.value = i, t.controller.kqrq = i ? K(i).format("YYYY-MM-DD") : "", t.controller.changeViewParams();
    };
    e.value = new Date(t.controller.kqrq), s.value = t.controller.rylx.split(",");
    const d = K();
    return {
      ns: n,
      selectArray: s,
      selectDate: e,
      options: {
        disabledDate: (i) => {
          const h = K(i);
          return d.isSame(h, "day") || d.isBefore(h, "day");
        }
      },
      onSelectArrayChange: r,
      onDateChange: o
    };
  },
  render() {
    const t = [this.ns.b(), this.ns.m(this.modelData.modelClass)];
    return a("portlet-layout", {
      attrs: {
        controller: this.controller
      },
      class: t
    }, [a("i-checkbox-group", {
      class: this.ns.e("rylx-checkbox"),
      attrs: {
        value: this.selectArray
      },
      on: {
        "on-change": this.onSelectArrayChange
      }
    }, [this.controller.options.map((n) => a("i-checkbox", {
      attrs: {
        label: n.value
      }
    }, [n.text]))]), a("i-CalendarPicker", {
      class: this.ns.e("date-picker"),
      attrs: {
        type: "date",
        value: this.selectDate,
        clearable: !1,
        placement: "bottom-end",
        options: this.options
      },
      on: {
        "on-change": this.onDateChange
      }
    })]);
  }
});
class Fe {
  constructor() {
    C(this, "component", Re);
  }
  async createController(n, s, e) {
    const r = new G(
      n,
      s,
      e
    );
    return await r.init(), r;
  }
}
class Q extends xe {
  constructor() {
    super(...arguments);
    C(this, "data", {});
    C(this, "mapData", []);
    C(this, "pointData", []);
    C(this, "form");
    C(this, "hasLoad", !1);
    C(this, "isloading", !1);
    C(this, "entityService");
    C(this, "pointClicked", !1);
  }
  async onInit() {
    await super.onInit(), await this.model.embedView.init();
    const s = this.model.embedView.form;
    this.entityService = await ibiz.entityService.getService(
      s.appEntity.codeName,
      this.context
    ), this.form = new ke(s, this.context, {
      ...this.params
    }), await this.form.init(), this.dashboard.nerve.self.evt.on("mounted", () => {
      this.load();
    });
  }
  calcPercent(s, e, r = 1) {
    return s ? parseFloat((s * 100 / e).toFixed(r)) : 0;
  }
  calcViewParams() {
    super.calcViewParams(), this.dashboard.complete && (this.form.setContextOrParams(void 0, this.params, !0), this.load());
  }
  async load() {
    this.isloading = !0, this.data = await this.form.load(), this.data.zcrs = this.data.zcrs || 0, this.data.ycrs = this.data.ycrs || 0, this.data.qjrs = this.data.qjrs || 0, this.data.xjrs = this.data.xjrs || 0, this.data.zcl = this.calcPercent(this.data.zcrs, this.data.yzrs), this.data.ycl = this.calcPercent(this.data.ycrs, this.data.yzrs), this.data.qjl = this.calcPercent(this.data.qjrs, this.data.yzrs), this.data.xjl = this.calcPercent(this.data.xjrs, this.data.yzrs), await this.loadMapData(), this.hasLoad = !0, this.isloading = !1;
  }
  async loadMapData() {
    const e = (await this.entityService.exec(
      "FetchMapData",
      this.context,
      this.params
    )).data.map((o) => ({
      name: o.orgcode,
      value: this.calcPercent(Number(o.zcl), 1, 2),
      title: o.orgname,
      zcl: `${this.calcPercent(Number(o.zcl), 1, 2)}%`,
      zcrs: o.zcrs,
      jd: o.jd,
      wd: o.wd
    })), r = e.findIndex(
      (o) => o.name === this.params.orgcode
    );
    r !== -1 && (this.pointData = e.splice(r, 1)), this.mapData = e.length === 0 ? this.pointData : e;
  }
  onMapChange(s) {
    const e = `${s}`;
    this.mapData = [], this.pointData = [], this.dashboard.setContextOrParams(
      void 0,
      {
        ...this.params,
        orgcode: e,
        tjfw: void 0
      },
      !0
    );
  }
  onPointClick(s) {
    console.log("pointClick"), this.pointClicked = !0, this.dashboard.setContextOrParams(
      void 0,
      {
        ...this.params,
        tjfw: "20"
      },
      !0
    );
  }
  goBackFrominstitution() {
    this.pointClicked = !1, this.dashboard.setContextOrParams(
      void 0,
      {
        ...this.params,
        tjfw: void 0
      },
      !0
    );
  }
}
const j = S({
  name: "RingChart",
  props: {
    percent: {
      type: Number,
      required: !0
    },
    text: {
      type: String,
      required: !0
    },
    colors: {
      type: Array,
      default: () => ["#ff0700", "#ff5900", "#ff8300", "#ffa700", "#ffc800", "#ffc02f", "#ffb946", "#ffb358", "#ff9482", "#ff87ba", "#d391e9", "#73a0fa"]
    }
  },
  setup(t) {
    const n = q("ring-chart"), s = w();
    let e;
    const r = N(() => {
      const h = 100 / t.colors.length, m = Math.round(t.percent / h);
      return t.colors[m];
    }), o = () => ({
      tooltip: {
        trigger: "item"
      },
      series: [{
        name: "Access From",
        type: "pie",
        radius: ["56%", "70%"],
        center: ["50%", "70%"],
        startAngle: 180,
        avoidLabelOverlap: !1,
        hoverAnimation: !1,
        selectedOffset: 0,
        tooltip: {
          show: !1
        },
        emphasis: {
          disabled: !0
        },
        label: {
          show: !1,
          position: "center",
          formatter(h) {
            return [`{a|${`${h.percent * 2}%`}}`, `{b|${t.text}}`].join(`
`);
          },
          rich: {
            a: {
              color: "#333333",
              fontWeight: "bold",
              fontSize: 24
            },
            b: {
              color: "#666666",
              fontSize: 14,
              padding: [16, 0, 3, 0]
            }
          }
        },
        data: [{
          value: t.percent,
          itemStyle: {
            color: r.value
          },
          label: {
            show: !0
          }
        }, {
          value: 100 - t.percent,
          itemStyle: {
            color: "#EBF4FF"
          }
        }, {
          value: 100,
          itemStyle: {
            color: "none"
          }
        }]
      }]
    });
    A(() => {
      e = Y(s.value), e.setOption(o());
    });
    const {
      percent: d,
      colors: g,
      text: i
    } = U(t);
    return _([d, g, i], () => {
      e && (e.setOption(o()), e.resize());
    }), window.addEventListener("resize", () => {
      e == null || e.resize();
    }), {
      ns: n,
      chartRef: s
    };
  },
  render() {
    return a("div", {
      class: this.ns.b(),
      ref: "chartRef"
    });
  }
}), Be = ["#FF0700", "#FFF400", "#73A0FA"], Ue = {
  strMapCode: !0,
  visualMap: {
    text: ["\u9AD8", "\u4F4E"],
    min: 0,
    max: 100,
    rangeColor: Be
  },
  pointSymbol: "pin"
}, He = "/assets/json/map/jiangsu/{id}.json";
async function We(t) {
  return (await ibiz.net.axios({
    url: E.dir(He.replace("{id}", t))
  })).data;
}
function Ye(t, n) {
  const s = /* @__PURE__ */ new Map(), e = w(""), r = w([]);
  let o;
  const d = w(), g = (c) => {
    const f = {
      cityNames: {},
      noChild: c.features.length === 1
    };
    return c.features.forEach((x) => {
      const { adcode: l, name: p } = x.properties;
      f.cityNames[l] = p;
    }), f;
  }, i = async (c) => {
    if (s.has(c))
      return;
    const f = await We(c);
    s.set(c, g(f)), qe(c, f);
  }, h = (c) => {
    const f = s.get(e.value);
    if (f)
      return f.cityNames[c];
  }, m = () => {
    const c = t(e.value);
    o.setOption(c), o.resize();
  }, v = async (c, f = !1) => {
    f || n("mapChange", { name: c }), s.has(c) || await i(c), e.value = c, r.value.push(c), m();
  }, u = () => {
    if (r.value.length > 1) {
      r.value.pop();
      const c = r.value.pop();
      v(c);
    }
  };
  return A(() => {
    o = Y(d.value), window.addEventListener("resize", () => {
      o == null || o.resize();
    }), o.on("click", (c) => {
      if (c.componentType === "series" && c.seriesType === "scatter") {
        n("pointClick", c.data);
        return;
      }
      c.name !== e.value && v(c.name);
    }), o.on("mouseover", function(c) {
      if (c.componentType === "series" && c.seriesType === "scatter") {
        const f = c.dataIndex, x = o.getOption(), l = x.series[c.seriesIndex].data, p = x.series[c.seriesIndex].symbolSize;
        l[f].symbolSize = p + 10, o.setOption(x);
      }
    }), o.on("mouseout", function(c) {
      if (c.componentType === "series" && c.seriesType === "scatter") {
        const f = c.dataIndex, x = o.getOption(), l = x.series[c.seriesIndex].data;
        delete l[f].symbolSize, o.setOption(x);
      }
    });
  }), {
    chartRef: d,
    historyNames: r,
    currenName: e,
    changeMap: v,
    getCityName: h,
    goBack: u,
    refresh: m
  };
}
const Je = S({
  name: "MapChart",
  props: {
    mapData: {
      type: Array,
      required: !0
    },
    pointData: {
      type: Array
    },
    options: {
      type: Object,
      default: () => ({})
    },
    defaultMapName: {
      type: String,
      required: !0
    }
  },
  setup(t, {
    emit: n
  }) {
    const s = q("map-chart"), e = N(() => _e(Ue, t.options)), {
      chartRef: r,
      historyNames: o,
      changeMap: d,
      getCityName: g,
      goBack: i,
      refresh: h
    } = Ye((u) => {
      const {
        visualMap: c,
        pointSymbol: f
      } = e.value, x = {
        geo: {
          map: u
        },
        tooltip: {
          trigger: "item",
          textStyle: {
            color: "#fff",
            fontSize: 12
          },
          backgroundColor: "rgba(0, 0, 0, 0.47)",
          borderWidth: 0,
          extraCssText: "backdrop-filter: blur(3px);"
        },
        visualMap: {
          min: c.min,
          max: c.max,
          text: c.text,
          realtime: !1,
          hoverLink: !1,
          inRange: {
            color: c.rangeColor
          }
        },
        series: [
          {
            type: "map",
            map: u,
            nameProperty: e.value.strMapCode ? "adcodeStr" : "adcode",
            tooltip: {
              formatter: (l) => {
                const p = g(l.name), b = t.mapData.find((k) => k.name == l.name);
                if (!!b)
                  return `
                      <div style='display:flex;justify-content: space-between;'>
                        <span>${p}</span>
                        <span>${b.zcrs}</span>
                      </div>
                      <div style='display:flex;justify-content: space-between;'>
                        <span>\u6B63\u5E38\u7387\uFF1A</span>
                        <span>${b.zcl}</span>
                      </div>
                    `;
              }
            },
            label: {
              show: !0,
              color: "#000000",
              fontSize: 11,
              formatter: (l) => g(l.name)
            },
            select: {
              disabled: !0
            },
            data: t.mapData.map((l) => ({
              name: l.name,
              value: l.value
            }))
          }
        ]
      };
      return t.pointData && x.series.push({
        type: "scatter",
        coordinateSystem: "geo",
        symbol: f,
        symbolSize: 20,
        visualMap: !1,
        itemStyle: {
          color: "#FF1D00"
        },
        label: {
          show: !0,
          color: "#000000",
          fontSize: 10,
          textShadowBlur: 0,
          formatter: (l) => l.data.title,
          position: "left",
          offset: [10, -15]
        },
        tooltip: {
          formatter: (l) => {
            const p = l.data;
            return `
                    <div style='display:flex;justify-content: space-between;'>
                      <span>${p.title}</span>
                      <span>${p.zcrs}</span>
                    </div>
                    <div style='display:flex;justify-content: space-between;'>
                      <span>\u6B63\u5E38\u7387\uFF1A</span>
                      <span>${p.zcl}</span>
                    </div>
                  `;
          }
        },
        data: t.pointData.map((l) => ({
          ...l,
          value: [Number(l.jd), Number(l.wd)],
          visualMap: !1
        }))
      }), x;
    }, (u, c) => {
      u === "mapChange" ? n("mapChange", c.name) : n(u, c);
    });
    A(() => {
      d(t.defaultMapName, !0);
    });
    const {
      mapData: m,
      pointData: v
    } = U(t);
    return _([m, v], () => {
      h();
    }), {
      ns: s,
      chartRef: r,
      historyNames: o,
      goBack: i
    };
  },
  render() {
    return a("div", {
      class: this.ns.b()
    }, [a("div", {
      class: this.ns.e("chart"),
      ref: "chartRef"
    }), this.historyNames.length > 1 && a("div", {
      class: this.ns.e("goback"),
      on: {
        click: () => {
          this.goBack();
        }
      }
    }, ["\u8FD4\u56DE"])]);
  }
}), Ge = `image://${E.dir("/assets/img/fiveStars.png")}`, Qe = S({
  name: "PortalMapArea",
  props: {
    modelData: {
      type: we,
      required: !0
    },
    controller: {
      type: Q,
      required: !0
    }
  },
  setup(t) {
    const n = ne(t.controller), s = q("portal-map-area");
    return {
      c: n,
      ns: s
    };
  },
  render() {
    if (!this.c.hasLoad)
      return;
    const t = [this.ns.b(), this.ns.m(this.modelData.modelClass)];
    return a("portlet-layout", {
      attrs: {
        controller: this.controller
      },
      class: t
    }, [this.c.isloading ? a("i-spin", {
      attrs: {
        size: "large",
        fix: !0
      }
    }) : null, a("div", {
      class: this.ns.e("left")
    }, [a(j, {
      attrs: {
        percent: this.c.data.zcl,
        text: `\u6B63\u5E38\u6570 ${this.c.data.zcrs}`
      }
    }), a(j, {
      attrs: {
        percent: this.c.data.ycl,
        text: `\u5F02\u5E38\u6570 ${this.c.data.ycrs}`
      }
    })]), a("div", {
      class: this.ns.e("center")
    }, [a("div", {
      class: this.ns.e("title")
    }, [`${this.c.data.orgname} \u2014 ${this.c.data.yzrs}\u4EBA`]), a(Je, {
      class: this.ns.e("map"),
      attrs: {
        mapData: this.c.mapData,
        pointData: this.c.pointData,
        defaultMapName: this.c.params.orgcode,
        options: {
          pointSymbol: Ge
        }
      },
      on: {
        mapChange: (n) => {
          this.c.onMapChange(n);
        },
        pointClick: (n) => {
          this.c.onPointClick(n);
        }
      }
    }), this.c.pointClicked && a("div", {
      class: this.ns.e("goback"),
      on: {
        click: () => {
          this.c.goBackFrominstitution();
        }
      }
    }, ["\u8FD4\u56DE"])]), a("div", {
      class: this.ns.e("right")
    }, [a(j, {
      attrs: {
        percent: this.c.data.qjl,
        text: `\u8BF7\u5047\u4EBA\u6570 ${this.c.data.qjrs}`
      }
    }), a(j, {
      attrs: {
        percent: this.c.data.xjl,
        text: `\u4F11\u5047\u4EBA\u6570 ${this.c.data.xjrs}`
      }
    })])]);
  }
});
class Xe {
  constructor() {
    C(this, "component", Qe);
  }
  async createController(n, s, e) {
    const r = new Q(
      n,
      s,
      e
    );
    return await r.init(), r;
  }
}
class Ze extends Pe {
  constructor() {
    super(...arguments);
    C(this, "unit", "");
    C(this, "isPercent", !1);
    C(this, "maxNum", 0);
  }
  async onInit() {
    var s;
    await super.onInit(), (s = this.model.source.getPSDEListDataItems()) == null || s.forEach((e) => {
      e.name === "unit" && (this.unit = e.format), e.name === "percent" && (this.isPercent = !0);
    });
  }
  async afterLoad(s) {
    return super.afterLoad(s), this.maxNum = 0, this.items.forEach((e) => {
      this.isPercent ? (e.num = (parseFloat(e.num) * 100).toFixed(2), e.num === "0.00" && (e.num = "0"), e.percent = Number(e.num)) : e.num > this.maxNum && (this.maxNum = e.num);
    }), this.isPercent || this.items.forEach((e) => {
      e.percent = this.maxNum ? e.num * 100 / this.maxNum : 0;
    }), s;
  }
}
function et(t, n, s, e = {}) {
  return ie(t, () => {
    const r = new Ze(n, s, e);
    return le(t, "mdCtrlActiveMode", r.setMdCtrlActiveMode.bind(r)), r;
  });
}
function tt(t) {
  return { handleClick: (e) => {
    const r = t.selectedData.findIndex((o) => e.srfkey === o.srfkey);
    if (t.singleSelect)
      r === -1 ? t.onSelectionChange([e]) : t.onSelectionChange([]);
    else {
      const o = t.selectedData;
      r === -1 ? o.push(e) : o.splice(r, 1), t.onSelectionChange(o);
    }
    t.handleClick(e);
  }, handleDblClick: (e) => {
    t.handleDblClick(e);
  } };
}
const st = S({
  name: "KqqkListControl",
  props: {
    modelData: {
      type: W,
      required: !0
    },
    context: {
      type: Object,
      required: !0
    },
    params: {
      type: Object,
      default: () => ({})
    },
    mdCtrlActiveMode: {
      type: Number,
      default: 2
    },
    isSelectFirstDefault: {
      type: Boolean,
      required: !1
    },
    defaultSelectKeys: {
      type: Array,
      required: !1
    }
  },
  setup(t) {
    const {
      proxy: n
    } = V(), s = q("kqqk-list"), e = et(n, t.modelData, t.context, t.params), {
      handleClick: r,
      handleDblClick: o
    } = tt(e), d = (i, h) => {
      const m = e.selectedData.findIndex((u) => u.srfkey === i.srfkey), v = [s.b("item"), s.is("active", m !== -1)];
      return a("div", {
        class: v,
        key: i.srfkey + h,
        on: {
          click: () => r(i),
          dblclick: () => o(i)
        }
      }, [a("span", {
        class: s.be("item", "title")
      }, [i.title]), a("div", {
        class: s.be("item", "progress")
      }, [a("span", {
        style: `width:${i.percent}%;`,
        class: s.be("item", "progress-bar")
      }), a("span", {
        class: s.be("item", "progress-text")
      }, [i.num, e.unit])])]);
    };
    return {
      c: e,
      ns: s,
      renderListContent: () => e.items.map((i, h) => d(i, h))
    };
  },
  render() {
    return a("control-layout", {
      class: this.ns.b(),
      attrs: {
        modelData: this.c.model
      }
    }, [this.c.complete && [this.renderListContent()]]);
  }
});
class at {
  constructor() {
    C(this, "component", st);
  }
}
function nt(t) {
  return { handleClick: (e) => {
    const r = t.selectedData.findIndex((o) => e.srfkey === o.srfkey);
    if (t.singleSelect)
      r === -1 ? t.onSelectionChange([e]) : t.onSelectionChange([]);
    else {
      const o = t.selectedData;
      r === -1 ? o.push(e) : o.splice(r, 1), t.onSelectionChange(o);
    }
    t.handleClick(e);
  }, handleDblClick: (e) => {
    t.handleDblClick(e);
  } };
}
const $ = S({
  name: "ListExpControl",
  props: {
    modelData: {
      type: W,
      required: !0
    },
    context: {
      type: Object,
      required: !0
    },
    params: {
      type: Object,
      default: () => ({})
    },
    mdCtrlActiveMode: {
      type: Number,
      default: 2
    },
    isSelectFirstDefault: {
      type: Boolean,
      required: !0
    },
    defaultSelectKeys: {
      type: Array,
      required: !1
    },
    isExpView: {
      type: Boolean,
      required: !1
    }
  },
  setup(t) {
    const {
      proxy: n
    } = V(), s = q("control-list"), e = ce(n, t.modelData, t.context, t.params), {
      handleClick: r,
      handleDblClick: o
    } = nt(e);
    let d = !0;
    A(() => {
      _(() => e, (u, c) => {
        if (t.isExpView && u && u !== c) {
          let f = e.items[0];
          if (t.defaultSelectKeys && t.defaultSelectKeys.length > 0) {
            const x = e.items.find((l) => l.srfkey === t.defaultSelectKeys[0]);
            x && (f = x);
          }
          f && e.onSelectionChange([f]);
        }
      }, {
        immediate: !0
      }), _(() => e.items.length, (u) => {
        t.isExpView && u && e.onSelectionChange([e.items[0]]);
      }, {
        immediate: !0,
        deep: !0
      });
    });
    const g = (u) => {
      e.selectedData.length === 0 && (e.selectedData = [{
        srfkey: e.items[0].srfkey
      }]);
      const c = e.selectedData.findIndex((l) => l.srfkey === u.srfkey), f = () => {
        d = !1, delete e.context.n_orgid_eq, e.context.calendarcaption = u.deptname, r(u);
      }, x = [s.b("item"), s.is("active", c !== -1 && d === !1)];
      return a("div", {
        class: x,
        on: {
          click: () => f(),
          dblclick: () => o(u)
        }
      }, [e.layoutPanelProvider ? a(e.layoutPanelProvider.component, {
        props: {
          modelData: e.model,
          context: e.context,
          params: e.params,
          inputData: u
        }
      }) : `${u.deptname}`]);
    }, i = () => e.model.source.enableGroup ? a("el-collapse") : e.items.map((u) => g(u)), h = () => Object.is(e.total, e.items.length) ? null : a("div", {
      class: s.e("no-data")
    }, [a("div", ["\u6682\u65E0\u6570\u636E"])]), m = (u) => {
      d = !0, Object.assign(e.context, {
        n_orgid_eq: e.params.n_orgid_eq
      }), e.context.calendarcaption = u.deptname, r(u);
    }, v = () => {
      const u = [s.b("item"), s.is("active", d === !0)];
      return e.items.length > 0 ? a("div", {
        class: u,
        on: {
          click: () => m({
            deptid: e.params.n_orgid_eq,
            orgid: e.params.n_orgid_eq,
            srfkey: e.params.n_orgid_eq,
            deptname: e.context.selectedDeptName,
            sysdepartment: void 0
          })
        }
      }, ["\u5168\u90E8"]) : null;
    };
    return F(() => {
      d && (m({
        deptid: e.params.n_orgid_eq,
        orgid: e.params.n_orgid_eq,
        srfkey: e.params.n_orgid_eq,
        deptname: e.context.selectedDeptName,
        sysdepartment: void 0
      }), e.selectedData.length = 0);
    }), _(() => e.items, () => {
      F(() => {
        d = !0, Object.assign(e.context, {
          n_orgid_eq: e.params.n_orgid_eq
        }), m({
          deptid: e.params.n_orgid_eq,
          orgid: e.params.n_orgid_eq,
          srfkey: e.params.n_orgid_eq,
          deptname: e.context.selectedDeptName,
          sysdepartment: void 0
        }), e.selectedData.length = 0;
      });
    }, {
      immediate: !0,
      deep: !0
    }), {
      c: e,
      ns: s,
      renderListContent: i,
      renderLoadMore: h,
      renderAll: v,
      renderAllClick: m,
      isSelectAll: d
    };
  },
  render() {
    return a("control-layout", {
      class: [this.ns.b()],
      attrs: {
        modelData: this.c.model
      }
    }, [this.c.complete && [this.renderAll(), this.renderListContent(), this.renderLoadMore()]]);
  }
});
const ot = S({
  name: "ListExpSelectTreeView",
  components: {
    Treeselect: Me,
    ListExpControl: $
  },
  props: {
    context: Object,
    params: {
      type: Object
    },
    srfnav: String,
    modelPath: {
      type: String,
      required: !0
    },
    modal: {
      type: Object
    }
  },
  setup(t) {
    const {
      proxy: n
    } = V(), s = de(n, t.modelPath), e = w(""), r = w([]), o = q("list-exp-select-tree");
    s.context.isRouter === !0 && s.nerve.self.evt.on("created", () => {
      t.srfnav && (s.navItem.key = t.srfnav, r.value = [t.srfnav]), ue(oe(s.navItem, "key"), n, e);
    });
    const d = [`${s.context.srforgid}`];
    s.context.srforgid && (s.context.selectedDeptName = s.context.srforgname, Object.assign(s.params, {
      n_orgid_eq: s.context.srforgid
    }));
    const g = (v) => ({
      id: v.id,
      label: v.text,
      children: v.children
    }), i = (v) => {
      s.context.selectedDeptName = v.text, Object.assign(s.params, {
        n_orgid_eq: v.value
      }), s.nerve.list.call.load();
    }, h = w(!1);
    return {
      c: s,
      defaultSelectKeys: r,
      routeViewKey: e,
      normalizer: g,
      select: i,
      dataItems: [],
      isLoadCodeList: h,
      value: d,
      ns: o
    };
  },
  render() {
    if (this.c.complete) {
      const t = this.c.context.isRouter === !0, {
        listExpBar: n
      } = this.c.model, {
        list: s
      } = n, e = this.c.model.codeName;
      if (this.dataItems.length === 0 && e === "SysDepartmentKqAYTJListExp1View") {
        const {
          codeName: r
        } = this.c.model.source.getQuickGroupPSCodeList();
        (async (d) => {
          this.dataItems = await ibiz.codeListService.get(d, this.c.context, {
            size: 1e3
          }), this.isLoadCodeList = !0;
        })(r);
      }
      return a("exp-view-base", {
        class: [this.ns.b()],
        attrs: {
          controller: this.c,
          expBarModel: this.c.model.listExpBar
        },
        scopedSlots: {
          default: () => a($, {
            attrs: {
              modelData: s,
              context: this.c.context,
              params: this.c.params,
              isExpView: !0,
              isSelectFirstDefault: !1,
              mdCtrlActiveMode: 1,
              defaultSelectKeys: this.defaultSelectKeys
            },
            on: {
              neuronInit: this.c.nerve.onNeuronInit(s.name)
            }
          }),
          searchForm: () => this.isLoadCodeList && e === "SysDepartmentKqAYTJListExp1View" ? a("div", {
            class: "ibiz-selectTree"
          }, [a("treeselect", {
            attrs: {
              value: this.value,
              options: this.dataItems,
              normalizer: this.normalizer,
              clearable: !1,
              "default-expand-level": 1
            },
            on: {
              select: this.select
            }
          })]) : e === "SysDepartmentkqBmtjListExpView" ? a("div", {
            class: "ibiz-bmtj"
          }, [a("div", {
            class: "ibiz-bmyj-content"
          }, [this.c.context.srforgname])]) : null,
          expView: () => s.navView ? t ? this.routeViewKey ? a("router-view", {
            key: this.routeViewKey
          }) : null : a("ViewShell", {
            attrs: {
              context: this.c.navItem.context,
              params: this.c.navItem.params,
              modal: {
                mode: ae.EMBED
              },
              modelPath: s.navView.source.modelPath
            },
            key: this.c.navItem.key
          }) : null
        }
      });
    }
    return null;
  }
});
class rt {
  constructor() {
    C(this, "component", "ListExpSelectTreeView");
  }
}
class it {
  constructor() {
    C(this, "component", "BYQKEditView");
  }
}
class lt {
  constructor() {
    C(this, "formEditor", "KqBase64ImageUpload");
    C(this, "gridEditor", "IBizGridFileUpload");
  }
  async createController(n, s) {
    const e = new De(n, s);
    return await e.init(), e;
  }
}
const ct = S({
  name: "KqBase64ImageUpload",
  props: he(),
  emits: pe(),
  setup(t) {
    var o, d, g;
    const n = q("kq-base64-image-upload"), s = ((o = t.controller.model) == null ? void 0 : o.width) || "auto", e = ((d = t.controller.model) == null ? void 0 : d.height) || "150px", r = ((g = t.controller.editorParams) == null ? void 0 : g["justify-content"]) || "center";
    return () => a("div", {
      class: n.b(),
      style: {
        width: s,
        height: e,
        justifyContent: r
      }
    }, [a("img", {
      attrs: {
        src: t.value
      },
      class: n.e("image")
    })]);
  }
});
class dt {
  constructor() {
    C(this, "component", "KqdwCustomPickupTreeView");
  }
}
const ut = S({
  name: "KqdwCustomPickupTreeView",
  props: {
    context: {
      type: Object,
      required: !0
    },
    params: {
      type: Object
    },
    srfnav: String,
    modelPath: {
      type: String,
      required: !0
    },
    modal: {
      type: Object
    }
  },
  setup(t) {
    const n = q("kqdw-custom-pickup-tree-view"), {
      proxy: s
    } = V(), e = me(s, t.modelPath), r = w(null);
    let o = null;
    const d = w([]), g = w({}), i = w([]), h = w([]), m = w(""), v = w([]), u = async (y) => {
      await o.loadNodes(y), g.value = y, i.value.push(y);
    };
    return _(() => e.complete, async (y, P) => {
      var D;
      if (y !== P && y) {
        await e.model.pickupViewPanel.embedView.init();
        const O = (D = e.model.pickupViewPanel.embedView.source.getPSControls()) == null ? void 0 : D.find((z) => z.controlType === "TREEVIEW");
        O || console.warn("\u672A\u627E\u5230[\u6811(tree)]\u90E8\u4EF6"), r.value = new be(O), await r.value.init(), o = fe(s, r.value, t.context, t.params), await o.init();
        const I = await o.load();
        if (I.length > 0 && (d.value = I, g.value.children = I, i.value.push({
          text: "\u5F53\u524D\u9662",
          children: I
        })), e.params.selectedData) {
          const z = JSON.parse(e.params.selectedData);
          z.length > 0 && (h.value = z.map((T) => ({
            srfkey: T.srfkey,
            srfmajortext: T.srfmajortext,
            value: T.srfkey,
            text: T.srfmajortext,
            dxlx: T.dxlx
          })));
        }
      }
    }), {
      ns: n,
      c: e,
      treeDatas: d,
      currentTreeNode: g,
      clickTreeNode: u,
      treeHistory: i,
      isChecked: (y) => h.value.findIndex((D) => D.value === y.value) !== -1,
      selectTreeNodes: h,
      handleSelect: (y) => {
        const P = h.value.findIndex((D) => D.value === y.value);
        P === -1 ? h.value.push(y) : h.value.splice(P, 1);
      },
      clickHistory: (y) => {
        const P = i.value.findIndex((D) => D.value === y.value);
        i.value = i.value.slice(0, P + 1), g.value = y;
      },
      clearAll: () => {
        h.value = [];
      },
      onOkButtonClick: () => {
        const y = h.value.map((P) => {
          var D;
          return {
            srfkey: P.value,
            srfmajortext: P.text,
            dxlx: (D = P.deData) == null ? void 0 : D.dxlx
          };
        });
        e.closeView({
          ok: !0,
          data: y
        });
      },
      query: m,
      queryChange: (y) => {
        y.target && (m.value = y.target.value, Object.assign(e.params, {
          query: m.value
        }));
      },
      search: async () => {
        const y = await (o == null ? void 0 : o.load());
        y && (v.value = y);
      },
      queryTreeNodeList: v
    };
  },
  render() {
    return a("div", {
      class: this.ns.b()
    }, [a("div", {
      class: "top"
    }, [a("div", {
      class: "left"
    }, [a("div", {
      class: "title"
    }, ["\u672A\u9009\u62E9\u7528\u6237"]), a("div", {
      class: "search"
    }, [a("i-input", {
      attrs: {
        value: this.query,
        search: !0,
        placeholder: "\u8BF7\u8F93\u5165"
      },
      on: {
        "on-change": this.queryChange,
        "on-enter": this.search,
        "on-search": this.search
      }
    })]), a("div", {
      class: "cascader"
    }, [a("div", {
      class: "history"
    }, [!this.query && this.treeHistory.length > 0 && this.treeHistory.map((t, n) => a("span", {
      class: "content"
    }, [a("span", {
      on: {
        click: () => this.clickHistory(t)
      }
    }, [t.text]), n < this.treeHistory.length - 1 && a("span", {
      class: "icon"
    }, [">"])]))]), a("div", {
      class: "children"
    }, [this.query ? this.queryTreeNodeList.map((t) => a("div", {
      class: "child",
      key: t.id
    }, [this.isChecked(t) ? a("span", {
      class: "checked",
      on: {
        click: () => {
          this.handleSelect(t);
        }
      }
    }, ["\u221A"]) : a("span", {
      class: "no-checked",
      on: {
        click: () => {
          this.handleSelect(t);
        }
      }
    }), a("span", {
      class: "text"
    }, [t.text])])) : this.currentTreeNode && this.currentTreeNode.children && this.currentTreeNode.children.map((t) => a("div", {
      class: "child",
      key: t.id
    }, [this.isChecked(t) ? a("span", {
      class: "checked",
      on: {
        click: () => {
          this.handleSelect(t);
        }
      }
    }, ["\u221A"]) : a("span", {
      class: "no-checked",
      on: {
        click: () => {
          this.handleSelect(t);
        }
      }
    }), a("span", {
      class: "text",
      on: {
        click: () => this.clickTreeNode(t)
      }
    }, [t.text])]))])])]), a("div", {
      class: "right"
    }, [a("div", {
      class: "title"
    }, [a("span", [" \u5DF2\u9009\u62E9\u7528\u6237"]), " ", a("span", {
      class: "clear",
      on: {
        click: () => this.clearAll()
      }
    }, ["\u5168\u90E8\u6E05\u9664"])]), a("div", {
      class: "list"
    }, [this.selectTreeNodes.map((t) => a("div", {
      class: "node"
    }, [a("span", [t.text]), " ", a("span", {
      class: "remove",
      on: {
        click: () => {
          this.handleSelect(t);
        }
      }
    }, ["x"])]))])])]), a("div", {
      class: "bottom"
    }, [a("i-button", {
      on: {
        click: () => {
          this.onOkButtonClick();
        }
      }
    }, ["\u786E\u5B9A"]), a("i-button", {
      on: {
        click: () => {
          this.c.onCancelButtonClick();
        }
      }
    }, ["\u53D6\u6D88"])])]);
  }
});
class ht {
  constructor() {
    C(this, "component", "KqbcFormMDCtrl");
  }
  async createController(n, s, e) {
    const r = new Se(n, s, e);
    return await r.init(), r;
  }
}
const pt = S({
  name: "UserTabPageExp",
  props: {
    routeMsgs: {
      type: Array,
      required: !0
    },
    currentKey: {
      type: String,
      required: !0
    }
  },
  emits: ["tab-delete", "tab-click", "close-all", "close-other"],
  setup(t, {
    emit: n
  }) {
    const s = q("user-tab-page-exp"), e = w("0"), r = [{
      text: "\u5173\u95ED\u6240\u6709",
      value: "closeAll"
    }, {
      text: "\u5173\u95ED\u5176\u4ED6",
      value: "closeOther"
    }];
    return _(() => t.currentKey, (i, h) => {
      const m = t.routeMsgs.findIndex((v) => v.key === i);
      m !== -1 && (e.value = `${m}`);
    }), {
      ns: s,
      tabsValue: e,
      actions: r,
      changePage: (i) => {
        e.value = i, n("tab-click", +i);
      },
      onClose: (i) => {
        n("tab-delete", +i);
      },
      handleCommand: (i) => {
        i === "closeAll" ? n("close-all") : i === "closeOther" && n("close-other");
      }
    };
  },
  render() {
    var t;
    return a("div", {
      class: this.ns.b()
    }, [a("div", {
      class: this.ns.e("left")
    }, [a("i-tabs", {
      attrs: {
        type: "card",
        closable: !0
      },
      on: {
        "on-click": this.changePage,
        "on-tab-remove": this.onClose
      },
      model: {
        value: this.tabsValue,
        callback: (n) => {
          this.tabsValue = n;
        }
      }
    }, [(t = this.routeMsgs) == null ? void 0 : t.map((n, s) => a("i-tab-pane", {
      key: n.key,
      attrs: {
        name: `${s}`,
        label: n.caption
      }
    }))])])]);
  }
}), Dt = {
  mateUrl: import.meta.url,
  install(t) {
    t.component("UserTabPageExp", pt), t.component("UserIndexView", Ke), t.component("UserAppLayout", $e), t.component("ListExpSelectTreeView", ot), t.component("ListExpControl", $), t.component("ChangePassword", J), t.component(
      "BYQKEditView",
      () => import("./byqk-edit-view.fea98c06.js")
    ), t.component(
      "KqbcFormMDCtrl",
      () => import("./kqbc-form-mdctrl.b92c2279.js")
    ), ibiz.register.view.register(
      "VIEW_CUSTOM_JskqIndexView",
      new Ee()
    ), ibiz.register.view.register(
      "VIEW_CUSTOM_ListExpSelectTreeView",
      new rt()
    ), E.loadStyle(["/style.css"]), ibiz.register.portletPart.register(
      "PORTLET_CUSTOM_JskqWebPortalSearchHeader",
      new Fe()
    ), ibiz.register.portletPart.register(
      "PORTLET_CUSTOM_jskqWebPortalMapArea",
      new Xe()
    ), ibiz.register.control.register(
      "LIST_RENDER_JskqWebKqqkList",
      new at()
    ), ibiz.register.view.register(
      "VIEW_CUSTOM_ByqkCustomEditView",
      new it()
    ), t.component("KqBase64ImageUpload", ct), ibiz.register.editor.register(
      "PICTURE_ONE_Base64ImageUpload",
      new lt()
    ), t.component("KqdwCustomPickupTreeView", ut), ibiz.register.view.register(
      "VIEW_CUSTOM_KqdwCustomPickupTreeView",
      new dt()
    ), ibiz.register.formDetail.register("MDCTRL", new ht());
  }
};
export {
  Dt as default
};
