var Z = Object.defineProperty;
var ee = (t, a, s) => a in t ? Z(t, a, { enumerable: !0, configurable: !0, writable: !0, value: s }) : t[a] = s;
var w = (t, a, s) => (ee(t, typeof a != "symbol" ? a + "" : a, s), s);
import { PluginStaticResource as te, ViewMode as se } from "@ibiz-template/runtime";
import { ref as C, watch as _, defineComponent as D, getCurrentInstance as I, computed as L, onMounted as N, h as i, toRefs as ae, reactive as ie, nextTick as K, toRef as re, onActivated as ne } from "vue";
import { useRouter as G, useRoute as B, useIndexViewController as oe, useNamespace as S, useControlController as le, usePropsWatch as ce, useListController as de, useListExpViewController as ue, useRouteKey as he, getUploadProps as pe, getEditorEmits as me, useMPickupViewController as fe, useTreeController as ge, useViewController as ve } from "@ibiz-template/vue-util";
import { createUUID as ye, notNilEmpty as we } from "qx-util";
import { IndexViewModel as be, PortletPartModel as Ce, ViewPortletModel as xe, ListModel as H, TreeModel as ke, getControl as $, GridModel as U } from "@ibiz-template/model";
import A from "dayjs";
import { CustomPortletController as Pe, ViewPortletController as qe, EditFormController as De, ListController as Se, UploadEditorController as _e, FormMDCtrlController as Me, GridViewNerve as Ee, GridViewController as Te } from "@ibiz-template/controller";
import { mergeDeepRight as Ie } from "ramda";
import { init as Ve, registerMap as je } from "echarts";
import { Treeselect as ze } from "@riophae/vue-treeselect";
import { convertNavData as Ae } from "@ibiz-template/service";
const M = new te(import.meta.url);
class Oe {
  constructor() {
    w(this, "component", "UserIndexView");
  }
}
const Re = (t) => {
  const { view2: a, params2: s, params1: e } = t.params;
  if (!a)
    return "";
  let r = s.replace(
    new RegExp(";srfnav=[^;=]*$|(?<=;)srfnav=[^;=]*;|^srfnav=[^;=]*;|^srfnav=[^;=]*$", "g"),
    ""
  );
  return r = r || ibiz.env.routePlaceholder, `/${e}/${a}/${r}`;
}, Le = (t) => {
  const { view1: a, appContext: s } = t.params;
  return `/${s}/${a}/${ibiz.env.routePlaceholder}`;
};
function Ne(t, a) {
  const s = G(t), e = C(""), r = C(""), n = C([]), u = C([]), y = (l) => {
    l.forEach((h) => {
      const b = n.value.indexOf(h);
      b !== -1 && n.value.splice(b, 1);
      const k = u.value.findIndex((v) => v.key === h);
      k !== -1 && u.value.splice(k, 1);
    });
  };
  _(
    () => t.$route.path,
    (l, h) => {
      if (l !== h) {
        const b = B(t);
        e.value = Re(b), r.value = Le(b);
        const k = u.value.find(
          (v) => v.key === e.value
        );
        if (k)
          b.matched.length === 2 ? s.push(k.fullPath) : k.fullPath = b.fullPath;
        else {
          if (l === r.value)
            return;
          u.value.push({
            key: e.value,
            fullPath: b.fullPath,
            modelPath: "",
            caption: ""
          });
        }
      }
    },
    { deep: !0, immediate: !0 }
  ), _(
    e,
    (l, h) => {
      if (l !== h && l) {
        const b = n.value.indexOf(l);
        b === -1 || n.value.splice(b, 1), n.value.unshift(l);
      }
    },
    { immediate: !0 }
  );
  const o = async (l, h) => {
    const b = u.value.find((k) => k.key === e.value);
    b && (h.caption && (b.caption = h.caption), h.modelPath && (b.modelPath = h.modelPath));
  }, p = (l = e.value) => {
    y([l]);
    const h = n.value[0];
    if (!h)
      a.model.source.blankMode ? window.close() : (e.value = "", s.push(r.value));
    else {
      const b = u.value.find((k) => k.key === h);
      s.push(b.fullPath);
    }
  }, f = (l) => {
    const h = u.value[l];
    h && s.push(h.fullPath);
  }, g = () => {
    const h = B(t).fullPath;
    let b = h.indexOf("/");
    for (let v = 0; v < 2; v++)
      b = h.indexOf("/", b + 1);
    const k = `${h.substring(0, b)}/-`;
    s.push(k);
  }, d = () => {
    if (n.value.length > 0) {
      const l = u.value.find(
        (h) => h.key === n.value[0]
      );
      l && s.push(l.fullPath);
    } else
      g();
  };
  return {
    currentKey: e,
    keyHistory: n,
    routeMsgs: u,
    updateRouteMsg: o,
    closeView: p,
    deleteRouteCache: y,
    handleTabClick: f,
    handleTabDelete: (l) => {
      const h = u.value[l];
      h && (y([h.key]), d());
    },
    handleCloseAll: () => {
      if (u.value.length > 0) {
        const l = [];
        u.value.forEach((h) => {
          l.push(h.key);
        }), y(l), d();
      }
    },
    handleCloseOther: () => {
      if (u.value.length > 0) {
        const l = [];
        u.value.forEach((h) => {
          h.key !== e.value && l.push(h.key);
        }), y(l), d();
      }
    }
  };
}
const Fe = /* @__PURE__ */ D({
  __name: "index-view",
  props: {
    context: null,
    params: { default: () => ({}) },
    modelPath: null
  },
  setup(t) {
    const a = t, { proxy: s } = I(), e = oe(s, a.modelPath), r = !0;
    let n = null, u = null, y = () => {
    }, o = null, p = null, f = null, g = null, d = null, c, m, x, l;
    const h = C(ye());
    {
      const {
        currentKey: k,
        keyHistory: v,
        routeMsgs: q,
        updateRouteMsg: P,
        closeView: z,
        deleteRouteCache: O,
        handleTabClick: V,
        handleTabDelete: j,
        handleCloseAll: T,
        handleCloseOther: J
      } = Ne(s, e);
      m = k, x = v, l = q, o = O, p = V, f = j, g = T, d = J, n = (E) => {
        const R = m.value;
        E.evt.on("closeView", () => {
          z(R);
        }), E.evt.on("setTitle", (X) => {
          P(R, { caption: X });
        });
      }, u = (E) => {
        P(m.value, E);
      }, window.onpopstate = () => {
        o([x.value[1]]);
      }, c = L(() => {
        const E = l.value.find(
          (R) => R.key === m.value
        );
        return (E == null ? void 0 : E.modelPath) || "";
      });
    }
    return N(() => {
      setTimeout(() => {
        const k = document.querySelector(".app-loading-x");
        k && (k.style.display = "none");
      }, 300);
    }), { __sfc: !0, props: a, proxy: s, c: e, isShowTabPageExp: r, onCreated: n, onViewFound: u, onMenuRouteChange: y, deleteRouteCache: o, handleTabClick: p, handleTabDelete: f, handleCloseAll: g, handleCloseOther: d, currentPath: c, currentKey: m, keyHistory: x, routeMsgs: l, appKeepAliveKey: h, collapseChange: (k) => {
      e.collapseChange = k;
    } };
  }
});
function Ke(t, a, s, e, r, n, u, y) {
  var o = typeof t == "function" ? t.options : t;
  a && (o.render = a, o.staticRenderFns = s, o._compiled = !0), e && (o.functional = !0), n && (o._scopeId = "data-v-" + n);
  var p;
  if (u ? (p = function(d) {
    d = d || this.$vnode && this.$vnode.ssrContext || this.parent && this.parent.$vnode && this.parent.$vnode.ssrContext, !d && typeof __VUE_SSR_CONTEXT__ < "u" && (d = __VUE_SSR_CONTEXT__), r && r.call(this, d), d && d._registeredComponents && d._registeredComponents.add(u);
  }, o._ssrRegister = p) : r && (p = y ? function() {
    r.call(
      this,
      (o.functional ? this.parent : this).$root.$options.shadowRoot
    );
  } : r), p)
    if (o.functional) {
      o._injectStyles = p;
      var f = o.render;
      o.render = function(c, m) {
        return p.call(m), f(c, m);
      };
    } else {
      var g = o.beforeCreate;
      o.beforeCreate = g ? [].concat(g, p) : [p];
    }
  return {
    exports: t,
    options: o
  };
}
var Be = function() {
  var a = this, s = a._self._c, e = a._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" }) : a._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" }) : a._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)] : a._e()], 2);
}, $e = [], Ue = /* @__PURE__ */ Ke(
  Fe,
  Be,
  $e,
  !1,
  null,
  null,
  null,
  null
);
const Ge = Ue.exports;
const Y = D({
  name: "ChangePassword",
  props: {
    isShowModal: {
      type: Boolean,
      default: !1
    }
  },
  setup(t, {
    emit: a
  }) {
    const s = S("change-password"), e = C(null), r = C({
      oldPwd: "",
      newPwd: "",
      newPwd2: ""
    }), n = C(!1), u = {
      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(o, p, f) {
          p !== r.value.newPwd ? f(new Error("\u4E24\u6B21\u8F93\u5165\u5BC6\u7801\u4E0D\u4E00\u81F4\uFF0C\u8BF7\u68C0\u67E5")) : f();
        }
      }]
    }, y = () => {
      e.value.validate(async (o) => {
        var p, f, g;
        if (o)
          try {
            n.value = !0;
            const d = await ibiz.net.post("/v7/changepwd ", {
              oldPwd: r.value.oldPwd,
              newPwd: r.value.newPwd
            });
            if (d.ok) {
              ibiz.notification.success({
                title: "\u4FEE\u6539\u5BC6\u7801\u6210\u529F\uFF01"
              }), n.value = !1, a("change-success");
              return;
            }
            ibiz.notification.error({
              title: ((p = d.data) == null ? void 0 : p.message) || "\u4FEE\u6539\u5BC6\u7801\u5931\u8D25\uFF01"
            }), n.value = !1;
          } catch (d) {
            ibiz.notification.error({
              title: ((g = (f = d.response) == null ? void 0 : f.data) == null ? void 0 : g.message) || "\u4FEE\u6539\u5BC6\u7801\u5931\u8D25\uFF01"
            }), n.value = !1;
          }
      });
    };
    return _(() => t.isShowModal, (o) => {
      o === !0 && e.value && e.value.resetFields();
    }), {
      ns: s,
      formData: r,
      rules: u,
      loading: n,
      formRef: e,
      handleSubmit: y
    };
  },
  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: (a) => {
          this.$set(this.formData, "oldPwd", a);
        }
      }
    })]), 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: (a) => {
          this.$set(this.formData, "newPwd", a);
        }
      }
    })]), 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: (a) => {
          this.$set(this.formData, "newPwd2", a);
        }
      }
    })]), 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 He(t, a) {
  return i("div", {
    class: t.e("logo")
  }, [i("img", {
    class: t.e("logo-img"),
    attrs: {
      src: M.dir("/assets/img/jh-800.png")
    }
  }), i("div", {
    class: t.e("logo-caption")
  }, [a.caption])]);
}
const Ye = D({
  name: "UserAppLayout",
  props: {
    model: {
      type: be,
      required: !0
    },
    isComplete: {
      type: Boolean,
      default: !1
    },
    isShowTabPageExp: {
      type: Boolean,
      default: !1
    }
  },
  setup(t, {
    emit: a,
    slots: s
  }) {
    var v;
    const e = S("layout"), r = C(!1), n = () => {
      r.value = !r.value, a("onCollapseChange", r.value);
    }, u = L(() => t.model.source.blankMode === !0), y = async (q) => {
      var z;
      const P = (z = s.menu) == null ? void 0 : z.call(s)[0].componentInstance;
      P && P.c && await P.c.onClickMenuItem(q);
    }, {
      srfusername: o = "\u6E38\u5BA2",
      srforgsectorname: p,
      srffirstlogin: f
    } = ((v = ibiz.appData) == null ? void 0 : v.context) || {}, {
      proxy: g
    } = I(), d = G(g), c = async () => {
      (await ibiz.auth.v7logout()).ok ? (ibiz.message.success("\u767B\u51FA\u6210\u529F"), d.push(`/login?ru=${encodeURIComponent(window.location.hash.replace("#/", "/"))}`)) : ibiz.message.error("\u767B\u51FA\u5931\u8D25");
    }, m = C(!0), x = () => {
      m.value = !m.value;
    }, l = C(!1), h = C(!0);
    return f === 1 && (l.value = !0, h.value = !1), {
      ns: e,
      collapseChange: r,
      isBlank: u,
      collapseMenus: n,
      openView: y,
      srfusername: o,
      srforgsectorname: p,
      clickOut: c,
      isShowOpt: m,
      isShowModal: l,
      isModalClosable: h,
      changeShowOpt: x,
      showChangePassword: () => {
        l.value = !0;
      },
      hideChangePassword: () => {
        l.value = !1, h.value = !0;
      }
    };
  },
  render() {
    return this.isComplete ? i("i-layout", {
      class: [this.ns.b(), this.isBlank ? this.ns.m("blank") : "", this.ns.is("collapse", this.collapseChange), this.ns.is("tab", this.isShowTabPageExp)]
    }, [i("i-sider", {
      attrs: {
        "hide-trigger": !0,
        value: this.collapseChange
      },
      class: [this.ns.b("nav"), this.ns.is("collapse", this.collapseChange)]
    }, [He(this.ns, this.model), i("div", {
      class: this.ns.b("option")
    }, [i("i-poptip", {
      attrs: {
        trigger: "click",
        transfer: !0,
        "popper-class": "opt-box",
        placement: "bottom-end"
      },
      scopedSlots: {
        default: () => i("div", {
          class: this.ns.be("option", "top")
        }, [i("img", {
          class: "head",
          attrs: {
            src: M.dir("/assets/img/head.svg")
          }
        }), i("div", {
          class: "user"
        }, [i("div", {
          class: "username"
        }, [this.srfusername]), i("div", {
          class: "orgname"
        }, [this.srforgsectorname])]), i("img", {
          class: "down",
          attrs: {
            src: M.dir("/assets/img/down.svg")
          }
        })]),
        content: () => i("div", {
          class: "opts"
        }, [i("div", {
          on: {
            click: this.showChangePassword
          }
        }, [i("img", {
          class: "lr",
          attrs: {
            src: M.dir("/assets/img/lr.svg")
          }
        }), "\u4FEE\u6539\u5BC6\u7801"]), i("div", {
          class: "logout",
          on: {
            click: this.clickOut
          }
        }, [i("i", {
          class: "ivu-icon ivu-icon-ios-log-out"
        }), "\u9000\u51FA\u767B\u5F55"])])
      }
    }), i("div", {
      class: [this.ns.be("option", "content")]
    }, [i("div", {
      class: this.ns.e("download"),
      on: {
        click: () => this.openView("menuitem62")
      }
    }, [i("img", {
      class: "gj",
      attrs: {
        src: M.dir("/assets/img/download.svg")
      }
    }), i("div", {
      class: this.ns.em("download", "text")
    }, ["\u6587\u4EF6\u4E0B\u8F7D"])])]), i("div", {
      class: [this.ns.be("option", "bottom")]
    }, [i("i-tooltip", {
      attrs: {
        content: "\u8BBE\u5907\u79BB\u7EBF\u544A\u8B66",
        placement: "right",
        theme: "light"
      }
    }, [i("img", {
      class: "gj",
      attrs: {
        src: M.dir("/assets/img/gj.svg")
      },
      on: {
        click: () => this.openView("menuitem46")
      }
    })])])]), this.$slots.menu, i("div", {
      class: this.ns.be("slider", "collapse-icon")
    }, [this.collapseChange ? i("ion-icon", {
      attrs: {
        src: "./assets/img/menu-unfold.svg"
      },
      on: {
        click: () => this.collapseMenus()
      }
    }) : i("ion-icon", {
      attrs: {
        src: "./assets/img/menu-fold.svg"
      },
      on: {
        click: () => this.collapseMenus()
      }
    })])]), i("i-layout", {
      class: [this.ns.b("content")]
    }, [i("i-content", {
      class: this.ns.be("content", "main")
    }, [this.$slots.tabPageExp, this.$slots.default]), i("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;
        }
      }
    }, [i(Y, {
      attrs: {
        isShowModal: this.isShowModal
      },
      on: {
        "change-success": this.hideChangePassword
      }
    })])])]) : null;
  }
});
class Q extends Pe {
  constructor() {
    super(...arguments);
    w(this, "options", []);
    w(this, "kqrq", "");
    w(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 = A().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 Qe = D({
  name: "PortletSearchHeader",
  props: {
    modelData: {
      type: Ce,
      required: !0
    },
    controller: {
      type: Q,
      required: !0
    }
  },
  setup(t) {
    const a = S("portal-search-header"), s = C([]), e = C(new Date()), r = (o) => {
      s.value = o, t.controller.rylx = o.join(","), t.controller.changeViewParams();
    }, n = (o) => {
      e.value = o, t.controller.kqrq = o ? A(o).format("YYYY-MM-DD") : "", t.controller.changeViewParams();
    };
    e.value = new Date(t.controller.kqrq), s.value = t.controller.rylx.split(",");
    const u = A();
    return {
      ns: a,
      selectArray: s,
      selectDate: e,
      options: {
        disabledDate: (o) => {
          const p = A(o);
          return u.isSame(p, "day") || u.isBefore(p, "day");
        }
      },
      onSelectArrayChange: r,
      onDateChange: n
    };
  },
  render() {
    const t = [this.ns.b(), this.ns.m(this.modelData.modelClass)];
    return i("portlet-layout", {
      attrs: {
        controller: this.controller
      },
      class: t
    }, [i("i-checkbox-group", {
      class: this.ns.e("rylx-checkbox"),
      attrs: {
        value: this.selectArray
      },
      on: {
        "on-change": this.onSelectArrayChange
      }
    }, [this.controller.options.map((a) => i("i-checkbox", {
      attrs: {
        label: a.value
      }
    }, [a.text]))]), i("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 We {
  constructor() {
    w(this, "component", Qe);
  }
  async createController(a, s, e) {
    const r = new Q(
      a,
      s,
      e
    );
    return await r.init(), r;
  }
}
class W extends qe {
  constructor() {
    super(...arguments);
    w(this, "data", {});
    w(this, "mapData", []);
    w(this, "pointData", []);
    w(this, "form");
    w(this, "hasLoad", !1);
    w(this, "isloading", !1);
    w(this, "entityService");
    w(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 De(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((n) => ({
      name: n.orgcode,
      value: this.calcPercent(Number(n.zcl), 1, 2),
      title: n.orgname,
      zcl: `${this.calcPercent(Number(n.zcl), 1, 2)}%`,
      zcrs: n.zcrs,
      yzrs: n.yzrs != null ? n.yzrs : "",
      zgrs: n.zgrs != null ? n.zgrs : "",
      jd: n.jd,
      wd: n.wd
    })), r = e.findIndex(
      (n) => n.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 Je = ["#FF0700", "#FFF400", "#73A0FA"], Xe = {
  strMapCode: !0,
  visualMap: {
    text: ["\u9AD8", "\u4F4E"],
    min: 0,
    max: 100,
    rangeColor: Je
  },
  pointSymbol: "pin"
}, Ze = "/assets/json/map/jiangsu/{id}.json";
async function et(t) {
  return (await ibiz.net.axios({
    url: M.dir(Ze.replace("{id}", t))
  })).data;
}
function tt(t, a) {
  const s = /* @__PURE__ */ new Map(), e = C(""), r = C([]);
  let n;
  const u = C(), y = (c) => {
    const m = {
      cityNames: {},
      noChild: c.features.length === 1
    };
    return c.features.forEach((x) => {
      const { adcode: l, name: h } = x.properties;
      m.cityNames[l] = h;
    }), m;
  }, o = async (c) => {
    if (s.has(c))
      return;
    const m = await et(c);
    s.set(c, y(m)), je(c, m);
  }, p = (c) => {
    const m = s.get(e.value);
    if (m)
      return m.cityNames[c];
  }, f = () => {
    const c = t(e.value);
    n.setOption(c), n.resize();
  }, g = async (c, m = !1) => {
    m || a("mapChange", { name: c }), s.has(c) || await o(c), e.value = c, r.value.push(c), f();
  }, d = () => {
    if (r.value.length > 1) {
      r.value.pop();
      const c = r.value.pop();
      g(c);
    }
  };
  return N(() => {
    n = Ve(u.value), window.addEventListener("resize", () => {
      n == null || n.resize();
    }), n.on("click", (c) => {
      if (c.componentType === "series" && c.seriesType === "scatter") {
        a("pointClick", c.data);
        return;
      }
      c.name !== e.value && g(c.name);
    }), n.on("mouseover", function(c) {
      if (c.componentType === "series" && c.seriesType === "scatter") {
        const m = c.dataIndex, x = n.getOption(), l = x.series[c.seriesIndex].data, h = x.series[c.seriesIndex].symbolSize;
        l[m].symbolSize = h + 10, n.setOption(x);
      }
    }), n.on("mouseout", function(c) {
      if (c.componentType === "series" && c.seriesType === "scatter") {
        const m = c.dataIndex, x = n.getOption(), l = x.series[c.seriesIndex].data;
        delete l[m].symbolSize, n.setOption(x);
      }
    });
  }), {
    chartRef: u,
    historyNames: r,
    currenName: e,
    changeMap: g,
    getCityName: p,
    goBack: d,
    refresh: f
  };
}
const st = D({
  name: "MapChart",
  props: {
    mapData: {
      type: Array,
      required: !0
    },
    pointData: {
      type: Array
    },
    options: {
      type: Object,
      default: () => ({})
    },
    defaultMapName: {
      type: String,
      required: !0
    }
  },
  setup(t, {
    emit: a
  }) {
    const s = S("map-chart"), e = L(() => Ie(Xe, t.options)), {
      chartRef: r,
      historyNames: n,
      changeMap: u,
      getCityName: y,
      goBack: o,
      refresh: p
    } = tt((d) => {
      const {
        visualMap: c,
        pointSymbol: m
      } = e.value, x = {
        geo: {
          map: d
        },
        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: d,
            nameProperty: e.value.strMapCode ? "adcodeStr" : "adcode",
            tooltip: {
              formatter: (l) => {
                const h = y(l.name), b = t.mapData.find((k) => k.name == l.name);
                if (!!b)
                  return `
                      <div style='display:flex;justify-content: center;'>
                        <span>${h}</span>
                      </div>
                      <div style='display:flex;justify-content: space-between;'>
                        <span style='margin-right: 16px;'>\u5728\u5C97\u4EBA\u6570/\u603B\u4EBA\u6570</span>
                        <span>${b.zgrs}/${b.yzrs}</span>
                      </div>
                    `;
              }
            },
            label: {
              show: !0,
              color: "#000000",
              fontSize: 11,
              formatter: (l) => y(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: m,
        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 h = l.data;
            return `
                    <div style='display:flex;justify-content: center;'>
                      <span>${h.title}</span>
                    </div>
                    <div style='display:flex;justify-content: space-between;'>
                      <span style='margin-right: 16px;'>\u5728\u5C97\u4EBA\u6570/\u603B\u4EBA\u6570</span>
                      <span>${h.zgrs}/${h.yzrs}</span>
                    </div>
                  `;
          }
        },
        data: t.pointData.map((l) => ({
          ...l,
          value: [Number(l.jd), Number(l.wd)],
          visualMap: !1
        }))
      }), x;
    }, (d, c) => {
      d === "mapChange" ? a("mapChange", c.name) : a(d, c);
    });
    N(() => {
      u(t.defaultMapName, !0);
    });
    const {
      mapData: f,
      pointData: g
    } = ae(t);
    return _([f, g], () => {
      p();
    }), {
      ns: s,
      chartRef: r,
      historyNames: n,
      goBack: o
    };
  },
  render() {
    return i("div", {
      class: this.ns.b()
    }, [i("div", {
      class: this.ns.e("chart"),
      ref: "chartRef"
    }), this.historyNames.length > 1 && i("div", {
      class: this.ns.e("goback"),
      on: {
        click: () => {
          this.goBack();
        }
      }
    }, ["\u8FD4\u56DE"])]);
  }
}), at = `image://${M.dir("/assets/img/fiveStars.png")}`, it = D({
  name: "PortalMapArea",
  props: {
    modelData: {
      type: xe,
      required: !0
    },
    controller: {
      type: W,
      required: !0
    }
  },
  setup(t) {
    const a = ie(t.controller), s = S("portal-map-area");
    return {
      c: a,
      ns: s
    };
  },
  render() {
    if (!this.c.hasLoad)
      return;
    const t = [this.ns.b(), this.ns.m(this.modelData.modelClass)];
    return i("portlet-layout", {
      attrs: {
        controller: this.controller
      },
      class: t
    }, [this.c.isloading ? i("i-spin", {
      attrs: {
        size: "large",
        fix: !0
      }
    }) : null, i("div", {
      class: this.ns.e("left")
    }), i("div", {
      class: this.ns.e("center")
    }, [i("div", {
      class: this.ns.e("title")
    }, [`${this.c.data.orgname} \u2014 ${this.c.data.yzrs}\u4EBA`]), i(st, {
      class: this.ns.e("map"),
      attrs: {
        mapData: this.c.mapData,
        pointData: this.c.pointData,
        defaultMapName: this.c.params.orgcode,
        options: {
          pointSymbol: at
        }
      },
      on: {
        mapChange: (a) => {
          this.c.onMapChange(a);
        },
        pointClick: (a) => {
          this.c.onPointClick(a);
        }
      }
    }), this.c.pointClicked && i("div", {
      class: this.ns.e("goback"),
      on: {
        click: () => {
          this.c.goBackFrominstitution();
        }
      }
    }, ["\u8FD4\u56DE"])]), i("div", {
      class: this.ns.e("right")
    })]);
  }
});
class rt {
  constructor() {
    w(this, "component", it);
  }
  async createController(a, s, e) {
    const r = new W(
      a,
      s,
      e
    );
    return await r.init(), r;
  }
}
class nt extends Se {
  constructor() {
    super(...arguments);
    w(this, "unit", "");
    w(this, "isPercent", !1);
    w(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 ot(t, a, s, e = {}) {
  return le(t, () => {
    const r = new nt(a, s, e);
    return ce(t, "mdCtrlActiveMode", r.setMdCtrlActiveMode.bind(r)), r;
  });
}
function lt(t) {
  return { handleClick: (e) => {
    const r = t.selectedData.findIndex((n) => e.srfkey === n.srfkey);
    if (t.singleSelect)
      r === -1 ? t.onSelectionChange([e]) : t.onSelectionChange([]);
    else {
      const n = t.selectedData;
      r === -1 ? n.push(e) : n.splice(r, 1), t.onSelectionChange(n);
    }
    t.handleClick(e);
  }, handleDblClick: (e) => {
    t.handleDblClick(e);
  } };
}
const ct = D({
  name: "KqqkListControl",
  props: {
    modelData: {
      type: H,
      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: a
    } = I(), s = S("kqqk-list"), e = ot(a, t.modelData, t.context, t.params), {
      handleClick: r,
      handleDblClick: n
    } = lt(e), u = (o, p) => {
      const f = e.selectedData.findIndex((d) => d.srfkey === o.srfkey), g = [s.b("item"), s.is("active", f !== -1)];
      return i("div", {
        class: g,
        key: o.srfkey + p,
        on: {
          click: () => r(o),
          dblclick: () => n(o)
        }
      }, [i("span", {
        class: s.be("item", "title")
      }, [o.title]), i("div", {
        class: s.be("item", "progress")
      }, [i("span", {
        style: `width:${o.percent}%;`,
        class: s.be("item", "progress-bar")
      }), i("span", {
        class: s.be("item", "progress-text")
      }, [o.num, e.unit])])]);
    };
    return {
      c: e,
      ns: s,
      renderListContent: () => e.items.map((o, p) => u(o, p))
    };
  },
  render() {
    return i("control-layout", {
      class: this.ns.b(),
      attrs: {
        modelData: this.c.model
      }
    }, [this.c.complete && [this.renderListContent()]]);
  }
});
class dt {
  constructor() {
    w(this, "component", ct);
  }
}
function ut(t) {
  return { handleClick: (e) => {
    const r = t.selectedData.findIndex((n) => e.srfkey === n.srfkey);
    if (t.singleSelect)
      r === -1 ? t.onSelectionChange([e]) : t.onSelectionChange([]);
    else {
      const n = t.selectedData;
      r === -1 ? n.push(e) : n.splice(r, 1), t.onSelectionChange(n);
    }
    t.handleClick(e);
  }, handleDblClick: (e) => {
    t.handleDblClick(e);
  } };
}
const F = D({
  name: "ListExpControl",
  props: {
    modelData: {
      type: H,
      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: a
    } = I(), s = S("control-list"), e = de(a, t.modelData, t.context, t.params), {
      handleClick: r,
      handleDblClick: n
    } = ut(e);
    let u = !0;
    N(() => {
      _(() => e, (d, c) => {
        if (t.isExpView && d && d !== c) {
          let m = e.items[0];
          if (t.defaultSelectKeys && t.defaultSelectKeys.length > 0) {
            const x = e.items.find((l) => l.srfkey === t.defaultSelectKeys[0]);
            x && (m = x);
          }
          m && e.onSelectionChange([m]);
        }
      }, {
        immediate: !0
      }), _(() => e.items.length, (d) => {
        t.isExpView && d && e.onSelectionChange([e.items[0]]);
      }, {
        immediate: !0,
        deep: !0
      });
    });
    const y = (d) => {
      e.selectedData.length === 0 && (e.selectedData = [{
        srfkey: e.items[0].srfkey
      }]);
      const c = e.selectedData.findIndex((l) => l.srfkey === d.srfkey), m = () => {
        u = !1, delete e.context.n_orgid_eq, e.context.calendarcaption = d.deptname, r(d);
      }, x = [s.b("item"), s.is("active", c !== -1 && u === !1)];
      return i("div", {
        class: x,
        on: {
          click: () => m(),
          dblclick: () => n(d)
        }
      }, [e.layoutPanelProvider ? i(e.layoutPanelProvider.component, {
        props: {
          modelData: e.model,
          context: e.context,
          params: e.params,
          inputData: d
        }
      }) : `${d.deptname}`]);
    }, o = () => e.model.source.enableGroup ? i("el-collapse") : e.items.map((d) => y(d)), p = () => Object.is(e.total, e.items.length) ? null : i("div", {
      class: s.e("no-data")
    }, [i("div", ["\u6682\u65E0\u6570\u636E"])]), f = (d) => {
      u = !0, Object.assign(e.context, {
        n_orgid_eq: e.params.n_orgid_eq
      }), e.context.calendarcaption = d.deptname, r(d);
    }, g = () => {
      const d = [s.b("item"), s.is("active", u === !0)];
      return e.items.length > 0 ? i("div", {
        class: d,
        on: {
          click: () => f({
            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 K(() => {
      u && (f({
        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, () => {
      K(() => {
        u = !0, Object.assign(e.context, {
          n_orgid_eq: e.params.n_orgid_eq
        }), f({
          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: o,
      renderLoadMore: p,
      renderAll: g,
      renderAllClick: f,
      isSelectAll: u
    };
  },
  render() {
    return i("control-layout", {
      class: [this.ns.b()],
      attrs: {
        modelData: this.c.model
      }
    }, [this.c.complete && [this.renderAll(), this.renderListContent(), this.renderLoadMore()]]);
  }
});
const ht = D({
  name: "ListExpSelectTreeView",
  components: {
    Treeselect: ze,
    ListExpControl: F
  },
  props: {
    context: Object,
    params: {
      type: Object
    },
    srfnav: String,
    modelPath: {
      type: String,
      required: !0
    },
    modal: {
      type: Object
    }
  },
  setup(t) {
    const {
      proxy: a
    } = I(), s = ue(a, t.modelPath), e = C(""), r = C([]), n = S("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]), he(re(s.navItem, "key"), a, e);
    });
    const u = [`${s.context.srforgid}`];
    s.context.srforgid && (s.context.selectedDeptName = s.context.srforgname, Object.assign(s.params, {
      n_orgid_eq: s.context.srforgid
    }));
    const y = (g) => ({
      id: g.id,
      label: g.text,
      children: g.children
    }), o = (g) => {
      s.context.selectedDeptName = g.text, Object.assign(s.params, {
        n_orgid_eq: g.value
      }), s.nerve.list.call.load();
    }, p = C(!1);
    return {
      c: s,
      defaultSelectKeys: r,
      routeViewKey: e,
      normalizer: y,
      select: o,
      dataItems: [],
      isLoadCodeList: p,
      value: u,
      ns: n
    };
  },
  render() {
    if (this.c.complete) {
      const t = this.c.context.isRouter === !0, {
        listExpBar: a
      } = this.c.model, {
        list: s
      } = a, e = this.c.model.codeName;
      if (this.dataItems.length === 0 && e === "SysDepartmentKqAYTJListExp1View") {
        const {
          codeName: r
        } = this.c.model.source.getQuickGroupPSCodeList();
        (async (u) => {
          this.dataItems = await ibiz.codeListService.get(u, this.c.context, {
            size: 1e3
          }), this.isLoadCodeList = !0;
        })(r);
      }
      return i("exp-view-base", {
        class: [this.ns.b()],
        attrs: {
          controller: this.c,
          expBarModel: this.c.model.listExpBar
        },
        scopedSlots: {
          default: () => i(F, {
            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" ? i("div", {
            class: "ibiz-selectTree"
          }, [i("treeselect", {
            attrs: {
              value: this.value,
              options: this.dataItems,
              normalizer: this.normalizer,
              clearable: !1,
              "default-expand-level": 1
            },
            on: {
              select: this.select
            }
          })]) : e === "SysDepartmentkqBmtjListExpView" ? i("div", {
            class: "ibiz-bmtj"
          }, [i("div", {
            class: "ibiz-bmyj-content"
          }, [this.c.context.srforgname])]) : null,
          expView: () => s.navView ? t ? this.routeViewKey ? i("router-view", {
            key: this.routeViewKey
          }) : null : i("ViewShell", {
            attrs: {
              context: this.c.navItem.context,
              params: this.c.navItem.params,
              modal: {
                mode: se.EMBED
              },
              modelPath: s.navView.source.modelPath
            },
            key: this.c.navItem.key
          }) : null
        }
      });
    }
    return null;
  }
});
class pt {
  constructor() {
    w(this, "component", "ListExpSelectTreeView");
  }
}
class mt {
  constructor() {
    w(this, "component", "BYQKEditView");
  }
}
class ft {
  constructor() {
    w(this, "formEditor", "KqBase64ImageUpload");
    w(this, "gridEditor", "IBizGridFileUpload");
  }
  async createController(a, s) {
    const e = new _e(a, s);
    return await e.init(), e;
  }
}
const gt = D({
  name: "KqBase64ImageUpload",
  props: pe(),
  emits: me(),
  setup(t) {
    var n, u, y;
    const a = S("kq-base64-image-upload"), s = ((n = t.controller.model) == null ? void 0 : n.width) || "auto", e = ((u = t.controller.model) == null ? void 0 : u.height) || "150px", r = ((y = t.controller.editorParams) == null ? void 0 : y["justify-content"]) || "center";
    return () => i("div", {
      class: a.b(),
      style: {
        width: s,
        height: e,
        justifyContent: r
      }
    }, [i("img", {
      attrs: {
        src: t.value
      },
      class: a.e("image")
    })]);
  }
});
class vt {
  constructor() {
    w(this, "component", "KqdwCustomPickupTreeView");
  }
}
const yt = D({
  name: "KqdwCustomPickupTreeView",
  props: {
    context: {
      type: Object,
      required: !0
    },
    params: {
      type: Object
    },
    srfnav: String,
    modelPath: {
      type: String,
      required: !0
    },
    modal: {
      type: Object
    }
  },
  setup(t) {
    const a = S("kqdw-custom-pickup-tree-view"), {
      proxy: s
    } = I(), e = fe(s, t.modelPath), r = C(null);
    let n = null;
    const u = C([]), y = C({}), o = C([]), p = C([]), f = C(""), g = C([]), d = async (v) => {
      await n.loadNodes(v), y.value = v, o.value.push(v);
    };
    return _(() => e.complete, async (v, q) => {
      var P;
      if (v !== q && v) {
        await e.model.pickupViewPanel.embedView.init();
        const O = (P = e.model.pickupViewPanel.embedView.source.getPSControls()) == null ? void 0 : P.find((j) => j.controlType === "TREEVIEW");
        O || console.warn("\u672A\u627E\u5230[\u6811(tree)]\u90E8\u4EF6"), r.value = new ke(O), await r.value.init(), n = ge(s, r.value, t.context, t.params), await n.init();
        const V = await n.load();
        if (V.length > 0 && (u.value = V, y.value.children = V, o.value.push({
          text: "\u5F53\u524D\u9662",
          children: V
        })), e.params.selectedData) {
          const j = JSON.parse(e.params.selectedData);
          j.length > 0 && (p.value = j.map((T) => ({
            srfkey: T.srfkey,
            srfmajortext: T.srfmajortext,
            value: T.srfkey,
            text: T.srfmajortext,
            dxlx: T.dxlx
          })));
        }
      }
    }), {
      ns: a,
      c: e,
      treeDatas: u,
      currentTreeNode: y,
      clickTreeNode: d,
      treeHistory: o,
      isChecked: (v) => p.value.findIndex((P) => P.value === v.value) !== -1,
      selectTreeNodes: p,
      handleSelect: (v) => {
        const q = p.value.findIndex((P) => P.value === v.value);
        q === -1 ? p.value.push(v) : p.value.splice(q, 1);
      },
      clickHistory: (v) => {
        const q = o.value.findIndex((P) => P.value === v.value);
        o.value = o.value.slice(0, q + 1), y.value = v;
      },
      clearAll: () => {
        p.value = [];
      },
      onOkButtonClick: () => {
        const v = p.value.map((q) => {
          var P;
          return {
            srfkey: q.value,
            srfmajortext: q.text,
            dxlx: (P = q.deData) == null ? void 0 : P.dxlx
          };
        });
        e.closeView({
          ok: !0,
          data: v
        });
      },
      query: f,
      queryChange: (v) => {
        v.target && (f.value = v.target.value, Object.assign(e.params, {
          query: f.value
        }));
      },
      search: async () => {
        const v = await (n == null ? void 0 : n.load());
        v && (g.value = v);
      },
      queryTreeNodeList: g
    };
  },
  render() {
    return i("div", {
      class: this.ns.b()
    }, [i("div", {
      class: "top"
    }, [i("div", {
      class: "left"
    }, [i("div", {
      class: "title"
    }, ["\u672A\u9009\u62E9\u7528\u6237"]), i("div", {
      class: "search"
    }, [i("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
      }
    })]), i("div", {
      class: "cascader"
    }, [i("div", {
      class: "history"
    }, [!this.query && this.treeHistory.length > 0 && this.treeHistory.map((t, a) => i("span", {
      class: "content"
    }, [i("span", {
      on: {
        click: () => this.clickHistory(t)
      }
    }, [t.text]), a < this.treeHistory.length - 1 && i("span", {
      class: "icon"
    }, [">"])]))]), i("div", {
      class: "children"
    }, [this.query ? this.queryTreeNodeList.map((t) => i("div", {
      class: "child",
      key: t.id
    }, [this.isChecked(t) ? i("span", {
      class: "checked",
      on: {
        click: () => {
          this.handleSelect(t);
        }
      }
    }, ["\u221A"]) : i("span", {
      class: "no-checked",
      on: {
        click: () => {
          this.handleSelect(t);
        }
      }
    }), i("span", {
      class: "text"
    }, [t.text])])) : this.currentTreeNode && this.currentTreeNode.children && this.currentTreeNode.children.map((t) => i("div", {
      class: "child",
      key: t.id
    }, [this.isChecked(t) ? i("span", {
      class: "checked",
      on: {
        click: () => {
          this.handleSelect(t);
        }
      }
    }, ["\u221A"]) : i("span", {
      class: "no-checked",
      on: {
        click: () => {
          this.handleSelect(t);
        }
      }
    }), i("span", {
      class: "text",
      on: {
        click: () => this.clickTreeNode(t)
      }
    }, [t.text])]))])])]), i("div", {
      class: "right"
    }, [i("div", {
      class: "title"
    }, [i("span", [" \u5DF2\u9009\u62E9\u7528\u6237"]), " ", i("span", {
      class: "clear",
      on: {
        click: () => this.clearAll()
      }
    }, ["\u5168\u90E8\u6E05\u9664"])]), i("div", {
      class: "list"
    }, [this.selectTreeNodes.map((t) => i("div", {
      class: "node"
    }, [i("span", [t.text]), " ", i("span", {
      class: "remove",
      on: {
        click: () => {
          this.handleSelect(t);
        }
      }
    }, ["x"])]))])])]), i("div", {
      class: "bottom"
    }, [i("i-button", {
      on: {
        click: () => {
          this.onOkButtonClick();
        }
      }
    }, ["\u786E\u5B9A"]), i("i-button", {
      on: {
        click: () => {
          this.c.onCancelButtonClick();
        }
      }
    }, ["\u53D6\u6D88"])])]);
  }
});
class wt {
  constructor() {
    w(this, "component", "KqbcFormMDCtrl");
  }
  async createController(a, s, e) {
    const r = new Me(a, s, e);
    return await r.init(), r;
  }
}
const bt = D({
  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: a
  }) {
    const s = S("user-tab-page-exp"), e = C("0"), r = [{
      text: "\u5173\u95ED\u6240\u6709",
      value: "closeAll"
    }, {
      text: "\u5173\u95ED\u5176\u4ED6",
      value: "closeOther"
    }];
    return _(() => t.currentKey, (o, p) => {
      const f = t.routeMsgs.findIndex((g) => g.key === o);
      f !== -1 && (e.value = `${f}`);
    }), {
      ns: s,
      tabsValue: e,
      actions: r,
      changePage: (o) => {
        e.value = o, a("tab-click", +o);
      },
      onClose: (o) => {
        a("tab-delete", +o);
      },
      handleCommand: (o) => {
        o === "closeAll" ? a("close-all") : o === "closeOther" && a("close-other");
      }
    };
  },
  render() {
    var t;
    return i("div", {
      class: this.ns.b()
    }, [i("div", {
      class: this.ns.e("left")
    }, [i("i-tabs", {
      attrs: {
        type: "card",
        closable: !0
      },
      on: {
        "on-click": this.changePage,
        "on-tab-remove": this.onClose
      },
      model: {
        value: this.tabsValue,
        callback: (a) => {
          this.tabsValue = a;
        }
      }
    }, [(t = this.routeMsgs) == null ? void 0 : t.map((a, s) => i("i-tab-pane", {
      key: a.key,
      attrs: {
        name: `${s}`,
        label: a.caption
      }
    }))])])]);
  }
});
class Ct {
  constructor() {
    w(this, "component", "QytjGridView");
  }
}
class xt extends Ee {
  constructor() {
    super(...arguments);
    w(this, "qjgrid");
    w(this, "ycgrid");
  }
  inclusive(s) {
    return s === "ycgrid" || s === "qjgrid" || super.inclusive(s);
  }
  connect(s, e) {
    super.connect(s, e), s === "qjgrid" && (this.qjgrid = e), s === "ycgrid" && (this.ycgrid = e);
  }
}
class kt extends Te {
  constructor() {
    super(...arguments);
    w(this, "activeRadio", "qyry");
    w(this, "selectTimeFrame", A().format("YYYY-MM"));
    w(this, "activeGrid", !0);
  }
  createNerve() {
    return new xt(this);
  }
  async onInit() {
    await super.onInit();
    const s = $(this.model.source, "BytjYcry");
    this.ycgrid = new U(s), await this.ycgrid.init();
    const e = $(this.model.source, "BytjQjry");
    this.qjgrid = new U(e), await this.qjgrid.init();
  }
  load() {
    return this.params.n_kqny_eq || this.setTimeFrameParams(), this.activeRadio === "ycry" ? this.nerve.ycgrid.call.load() : this.activeRadio === "qjry" ? this.nerve.qjgrid.call.load() : this.nerve.grid.call.load();
  }
  setSort() {
    let s = null;
    if (this.activeRadio === "ycry")
      s = this.ycgrid.source.getPSControlParam();
    else if (this.activeRadio === "qjry")
      s = this.qjgrid.source.getPSControlParam();
    else {
      const e = this.model.source.getPSAppViewNavParams();
      let r = {};
      we(e) && (r = Ae(e, this.context, this.params)), Object.assign(this.params, r);
    }
    s && s.ctrlParams.SORT && (this.params.sort = s.ctrlParams.SORT);
  }
  setActiveRadio(s) {
    this.activeRadio = s, this.setTimeFrameParams(), this.load();
  }
  setSelectTimeFrame(s) {
    this.selectTimeFrame = s, this.setTimeFrameParams(), this.load();
  }
  setTimeFrameParams() {
    this.params.n_kqny_eq = this.selectTimeFrame, this.setSort();
  }
  async exportData(s) {
    if (this.activeRadio === "ycry") {
      const { ycgrid: e } = this.nerve;
      await e.call.exportData(s);
    } else if (this.activeRadio === "qjry") {
      const { qjgrid: e } = this.nerve;
      await e.call.exportData(s);
    } else {
      const { grid: e } = this.nerve;
      await e.call.exportData(s);
    }
  }
}
function Pt(t, a) {
  return ve(
    t,
    (s, e) => new kt(a, s, e)
  );
}
const qt = D({
  name: "QytjGridView",
  props: {
    context: Object,
    params: {
      type: Object,
      default: () => ({})
    },
    modelPath: {
      type: String,
      required: !0
    },
    modal: {
      type: Object
    }
  },
  setup(t) {
    const {
      proxy: a
    } = I(), s = S("qytj-grid-view"), e = Pt(a, t.modelPath);
    ne(() => e.refresh());
    const r = L(() => e.activeRadio);
    return _(() => t.context, () => {
      const n = e.context.n_orgid_eq;
      n ? Object.assign(e.params, {
        n_orgid_eq: n
      }) : e.params.n_orgid_eq && delete e.params.n_orgid_eq;
    }, {
      deep: !0,
      immediate: !0
    }), {
      c: e,
      ns: s,
      activeRadio: r
    };
  },
  render(t) {
    let a = null, s = null, e = null;
    if (this.c.complete) {
      const {
        grid: r
      } = this.c.model;
      if (this.c.providers[r.name] && (a = t(this.c.providers[r.name].component, {
        key: "grid",
        class: [this.ns.e("grid"), this.ns.is("active", this.activeRadio === "qyry")],
        props: {
          modelData: r,
          context: this.c.context,
          params: this.c.params
        },
        on: {
          neuronInit: this.c.nerve.onNeuronInit(r.name)
        }
      })), this.activeRadio === "ycry" || this.c.activeGrid) {
        const {
          ycgrid: n
        } = this.c;
        this.c.providers.grid && (s = t(this.c.providers.grid.component, {
          key: "ycgrid",
          class: [this.ns.e("grid"), this.ns.is("active", this.activeRadio === "ycry")],
          props: {
            modelData: n,
            context: this.c.context,
            params: this.c.params,
            "grid-row-active-mode": this.c.model.gridRowActiveMode
          },
          on: {
            neuronInit: this.c.nerve.onNeuronInit(n.name)
          }
        }));
      }
      if (this.activeRadio === "qjry" || this.c.activeGrid) {
        const {
          qjgrid: n
        } = this.c;
        this.c.providers.grid && (e = t(this.c.providers.grid.component, {
          key: "qjgrid",
          class: [this.ns.e("grid"), this.ns.is("active", this.activeRadio === "qjry")],
          props: {
            modelData: n,
            context: this.c.context,
            params: this.c.params,
            "grid-row-active-mode": this.c.model.gridRowActiveMode
          },
          on: {
            neuronInit: this.c.nerve.onNeuronInit(n.name)
          }
        }));
      }
    }
    return t("view-base", {
      class: [this.ns.b()],
      attrs: {
        controller: this.c
      },
      scopedSlots: {
        caption: () => {
          const r = `${this.c.context.calendarcaption || this.c.context.srfpersonname}\u7EDF\u8BA1`;
          return t("div", {
            class: this.ns.b("caption")
          }, [t("span", {
            class: this.ns.be("caption", "text"),
            attrs: {
              title: r
            }
          }, [r])]);
        },
        toolbar: () => [t("div", {
          class: [this.ns.b("exp")]
        }, [t("i-radio-group", {
          attrs: {
            value: this.activeRadio,
            type: "button"
          },
          on: {
            "on-change": (r) => {
              this.c.setActiveRadio(r);
            }
          }
        }, [t("i-radio", {
          attrs: {
            label: "qyry"
          }
        }, ["\u5168\u9662\u4EBA\u5458"]), t("i-radio", {
          attrs: {
            label: "ycry"
          }
        }, ["\u5F02\u5E38\u4EBA\u5458"]), t("i-radio", {
          attrs: {
            label: "qjry"
          }
        }, ["\u8BF7\u5047\u4EBA\u5458"])])])],
        quickSearch: () => [this.c.model.toolbar && t("view-toolbar", {
          attrs: {
            modelData: this.c.model.toolbar,
            toolbarState: this.c.toolbarState,
            viewMode: this.c.modal.mode
          },
          on: {
            neuronInit: this.c.nerve.onNeuronInit(this.c.model.toolbar.source.name)
          }
        }), t("div", {
          class: [this.ns.b("search")]
        }, [t("div", {
          class: [this.ns.be("search", "time-frame")]
        }, [t("i-CalendarPicker", {
          attrs: {
            value: this.c.selectTimeFrame,
            clearable: !1,
            type: "month",
            format: "yyyy-MM",
            placeholder: "\u8BF7\u9009\u62E9"
          },
          on: {
            "on-change": (r) => {
              this.c.setSelectTimeFrame(r);
            }
          },
          style: "width: 110px;"
        })])])]
      }
    }, [a, s, e]);
  }
}), Rt = {
  mateUrl: import.meta.url,
  install(t) {
    t.component("UserTabPageExp", bt), t.component("UserIndexView", Ge), t.component("UserAppLayout", Ye), t.component("ListExpSelectTreeView", ht), t.component("ListExpControl", F), t.component("ChangePassword", Y), 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 Oe()
    ), ibiz.register.view.register(
      "VIEW_CUSTOM_ListExpSelectTreeView",
      new pt()
    ), M.loadStyle(["/style.css"]), ibiz.register.portletPart.register(
      "PORTLET_CUSTOM_JskqWebPortalSearchHeader",
      new We()
    ), ibiz.register.portletPart.register(
      "PORTLET_CUSTOM_jskqWebPortalMapArea",
      new rt()
    ), ibiz.register.control.register(
      "LIST_RENDER_JskqWebKqqkList",
      new dt()
    ), ibiz.register.view.register(
      "VIEW_CUSTOM_ByqkCustomEditView",
      new mt()
    ), t.component("KqBase64ImageUpload", gt), ibiz.register.editor.register(
      "PICTURE_ONE_Base64ImageUpload",
      new ft()
    ), t.component("KqdwCustomPickupTreeView", yt), ibiz.register.view.register(
      "VIEW_CUSTOM_KqdwCustomPickupTreeView",
      new vt()
    ), t.component("QytjGridView", qt), ibiz.register.view.register(
      "VIEW_CUSTOM_QytjGridView",
      new Ct()
    ), ibiz.register.formDetail.register("MDCTRL", new wt());
  }
};
export {
  Rt as default
};
