var Y = Object.defineProperty;
var J = (t, n, s) => n in t ? Y(t, n, { enumerable: !0, configurable: !0, writable: !0, value: s }) : t[n] = s;
var v = (t, n, s) => (J(t, typeof n != "symbol" ? n + "" : n, s), s);
import { PluginStaticResource as G, ViewMode as Q } from "@ibiz-template/runtime";
import { ref as x, watch as S, defineComponent as q, getCurrentInstance as I, onMounted as V, computed as j, h as a, toRefs as F, reactive as X, nextTick as K, toRef as Z } from "vue";
import { useRouter as ee, useRoute as te, useIndexViewController as se, useNamespace as D, useControlController as ae, usePropsWatch as ne, useListController as re, useListExpViewController as ie, useRouteKey as oe, getUploadProps as le, getEditorEmits as ce, useMPickupViewController as de, useTreeController as ue } from "@ibiz-template/vue-util";
import { createUUID as $ } from "qx-util";
import { IndexViewModel as pe, PortletPartModel as he, ViewPortletModel as me, ListModel as B, TreeModel as fe } from "@ibiz-template/model";
import T from "dayjs";
import { CustomPortletController as ye, ViewPortletController as ve, EditFormController as ge, ListController as xe, UploadEditorController as Ce, FormMDCtrlController as ke } from "@ibiz-template/controller";
import { init as U, registerMap as we } from "echarts";
import { mergeDeepRight as be } from "ramda";
import { Treeselect as qe } from "@riophae/vue-treeselect";
const _ = new G(import.meta.url);
class De {
  constructor() {
    v(this, "component", "UserIndexView");
  }
}
const Se = (t) => {
  const { view2: n, params2: s, params1: e } = t.params;
  if (!n)
    return "";
  let i = s.replace(
    new RegExp(";srfnav=[^;=]*$|(?<=;)srfnav=[^;=]*;|^srfnav=[^;=]*;|^srfnav=[^;=]*$", "g"),
    ""
  );
  return i = i || ibiz.env.routePlaceholder, `/${e}/${n}/${i}`;
}, Pe = (t) => {
  const { view1: n, appContext: s } = t.params;
  return `/${s}/${n}/${ibiz.env.routePlaceholder}`;
};
function _e(t, n) {
  const s = ee(t), e = x(""), i = x(""), r = x([]), d = x([]), y = (m) => {
    m.forEach((h) => {
      const l = r.value.indexOf(h);
      if (l !== -1) {
        r.value.splice(l, 1);
        const o = d.value.findIndex((f) => f.key === h);
        d.value.splice(o, 1);
      }
    });
  };
  return S(
    () => t.$route.path,
    (m, h) => {
      if (m !== h) {
        const l = te(t);
        e.value = Se(l), i.value = Pe(l);
        const o = d.value.find(
          (f) => f.key === e.value
        );
        if (o)
          o.fullPath = l.fullPath;
        else {
          if (m === i.value)
            return;
          d.value.push({
            key: e.value,
            fullPath: l.fullPath,
            modelPath: "",
            caption: ""
          });
        }
      }
    },
    { deep: !0, immediate: !0 }
  ), S(
    e,
    (m, h) => {
      if (m !== h && m) {
        const l = r.value.indexOf(m);
        l === -1 || r.value.splice(l, 1), r.value.unshift(m);
      }
    },
    { immediate: !0 }
  ), {
    currentKey: e,
    keyHistory: r,
    routeMsgs: d,
    updateRouteMsg: (m, h) => {
      const l = d.value.find((o) => o.key === e.value);
      l && (h.caption && (l.caption = h.caption), h.modelPath && (l.modelPath = h.modelPath));
    },
    closeView: (m = e.value) => {
      y([m]);
      const h = r.value[0];
      if (!h)
        n.model.source.blankMode ? (window.callback && window.callback(), window.close()) : (e.value = "", s.push(i.value));
      else {
        const l = d.value.find((o) => o.key === h);
        s.push(l.fullPath);
      }
    },
    deleteRouteCache: y
  };
}
const Me = /* @__PURE__ */ q({
  __name: "index-view",
  props: {
    context: null,
    params: { default: () => ({}) },
    modelPath: null
  },
  setup(t) {
    const n = t, { proxy: s } = I(), e = se(s, n.modelPath), {
      currentKey: i,
      keyHistory: r,
      routeMsgs: d,
      updateRouteMsg: y,
      closeView: c,
      deleteRouteCache: u
    } = _e(s, e), m = x($()), h = (p) => {
      const k = i.value;
      p.evt.on("closeView", () => {
        c(k);
      }), p.evt.on("setTitle", (P) => {
        y(k, { caption: P });
      });
    };
    V(() => {
      setTimeout(() => {
        const p = document.querySelector(".app-loading-x");
        p && (p.style.display = "none");
      }, 300);
    });
    const l = (p) => {
      y(i.value, p);
    }, o = (p) => {
      e.collapseChange = p;
    }, f = () => {
      u(r.value.slice(0)), m.value = $();
    };
    window.onpopstate = () => {
      u([r.value[1]]);
    };
    const C = j(() => {
      const p = d.value.find((k) => k.key === i.value);
      return (p == null ? void 0 : p.modelPath) || "";
    });
    return { __sfc: !0, props: n, proxy: s, c: e, currentKey: i, keyHistory: r, routeMsgs: d, updateRouteMsg: y, closeView: c, deleteRouteCache: u, appKeepAliveKey: m, onCreated: h, onViewFound: l, collapseChange: o, onMenuRouteChange: f, currentPath: C };
  }
});
function Ie(t, n, s, e, i, r, d, y) {
  var c = typeof t == "function" ? t.options : t;
  n && (c.render = n, c.staticRenderFns = s, c._compiled = !0), e && (c.functional = !0), r && (c._scopeId = "data-v-" + r);
  var u;
  if (d ? (u = function(l) {
    l = l || this.$vnode && this.$vnode.ssrContext || this.parent && this.parent.$vnode && this.parent.$vnode.ssrContext, !l && typeof __VUE_SSR_CONTEXT__ < "u" && (l = __VUE_SSR_CONTEXT__), i && i.call(this, l), l && l._registeredComponents && l._registeredComponents.add(d);
  }, c._ssrRegister = u) : i && (u = y ? function() {
    i.call(
      this,
      (c.functional ? this.parent : this).$root.$options.shadowRoot
    );
  } : i), u)
    if (c.functional) {
      c._injectStyles = u;
      var m = c.render;
      c.render = function(o, f) {
        return u.call(f), m(o, f);
      };
    } else {
      var h = c.beforeCreate;
      c.beforeCreate = h ? [].concat(h, u) : [u];
    }
  return {
    exports: t,
    options: c
  };
}
var Ve = 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 }, on: { onCollapseChange: e.collapseChange } }, [e.c.complete ? [e.c.complete ? s("AppMenu", { 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(), 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);
}, Ee = [], ze = /* @__PURE__ */ Ie(
  Me,
  Ve,
  Ee,
  !1,
  null,
  null,
  null,
  null
);
const Le = ze.exports;
function R(t, n) {
  return a("div", {
    class: t.e("logo")
  }, [a("img", {
    class: t.e("logo-img"),
    attrs: {
      src: _.dir("/assets/img/jh.png")
    }
  }), a("div", {
    class: t.e("logo-caption")
  }, [n.caption])]);
}
const Te = q({
  name: "UserAppLayout",
  props: {
    model: {
      type: pe,
      required: !0
    },
    isComplete: {
      type: Boolean,
      default: !1
    }
  },
  setup(t, {
    emit: n,
    slots: s
  }) {
    const e = D("layout"), i = x(!1), r = () => {
      i.value = !i.value, n("onCollapseChange", i.value);
    }, d = j(() => t.model.source.blankMode === !0);
    return {
      ns: e,
      collapseChange: i,
      isBlank: d,
      collapseMenus: r,
      openView: async () => {
        var u;
        const c = (u = s.menu) == null ? void 0 : u.call(s)[0].componentInstance;
        c && c.c && await c.c.onClickMenuItem("menuitem46");
      }
    };
  },
  render() {
    return this.isComplete ? a("i-layout", {
      class: [this.ns.b(), this.isBlank ? this.ns.m("blank") : "", this.ns.is("collapse", this.collapseChange)]
    }, [a("i-sider", {
      attrs: {
        "hide-trigger": !0,
        value: this.collapseChange
      },
      class: [this.ns.b("nav"), this.ns.is("collapse", this.collapseChange)]
    }, [R(this.ns, this.model), 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-header", {
      class: this.ns.b("header")
    }, [a("div", {
      class: this.ns.be("header", "left")
    }, [R(this.ns, this.model), this.model.source.mainMenuAlign === "TOP" ? a("i-menu", {
      class: this.ns.be("header", "menu"),
      attrs: {
        mode: "horizontal",
        "active-name": "1"
      }
    }) : null]), a("div", {
      class: this.ns.be("header", "right")
    }, [a("ion-icon", {
      class: this.ns.e("warning"),
      attrs: {
        name: "warning"
      },
      on: {
        click: () => this.openView()
      }
    }), a("app-user"), a("img", {
      class: this.ns.e("xs"),
      attrs: {
        src: _.dir("/assets/img/xs.svg")
      }
    }), a("img", {
      class: this.ns.e("sz"),
      attrs: {
        src: _.dir("/assets/img/sz.svg")
      }
    })])]), a("i-content", {
      class: this.ns.be("content", "main")
    }, [this.$slots.default])])]) : null;
  }
});
class H extends ye {
  constructor() {
    super(...arguments);
    v(this, "options", []);
    v(this, "kqrq", "");
    v(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 = T().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 je = q({
  name: "PortletSearchHeader",
  props: {
    modelData: {
      type: he,
      required: !0
    },
    controller: {
      type: H,
      required: !0
    }
  },
  setup(t) {
    const n = D("portal-search-header"), s = x([]), e = x(new Date()), i = (c) => {
      s.value = c, t.controller.rylx = c.join(","), t.controller.changeViewParams();
    }, r = (c) => {
      e.value = c, t.controller.kqrq = c ? T(c).format("YYYY-MM-DD") : "", t.controller.changeViewParams();
    };
    e.value = new Date(t.controller.kqrq), s.value = t.controller.rylx.split(",");
    const d = T();
    return {
      ns: n,
      selectArray: s,
      selectDate: e,
      options: {
        disabledDate: (c) => {
          const u = T(c);
          return d.isSame(u, "day") || d.isBefore(u, "day");
        }
      },
      onSelectArrayChange: i,
      onDateChange: r
    };
  },
  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 Ne {
  constructor() {
    v(this, "component", je);
  }
  async createController(n, s, e) {
    const i = new H(
      n,
      s,
      e
    );
    return await i.init(), i;
  }
}
class W extends ve {
  constructor() {
    super(...arguments);
    v(this, "data", {});
    v(this, "mapData", []);
    v(this, "pointData", []);
    v(this, "form");
    v(this, "hasLoad", !1);
    v(this, "isloading", !1);
    v(this, "entityService");
    v(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 ge(s, this.context, {
      ...this.params
    }), await this.form.init(), this.dashboard.nerve.self.evt.on("mounted", () => {
      this.load();
    });
  }
  calcPercent(s, e, i = 1) {
    return s ? parseFloat((s * 100 / e).toFixed(i)) : 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((r) => ({
      name: r.orgcode,
      value: this.calcPercent(Number(r.zcl), 1, 2),
      title: r.orgname,
      zcl: `${this.calcPercent(Number(r.zcl), 1, 2)}%`,
      zcrs: r.zcrs,
      jd: r.jd,
      wd: r.wd
    })), i = e.findIndex(
      (r) => r.name === this.params.orgcode
    );
    i !== -1 && (this.pointData = e.splice(i, 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 L = q({
  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 = D("ring-chart"), s = x();
    let e;
    const i = j(() => {
      const u = 100 / t.colors.length, m = Math.round(t.percent / u);
      return t.colors[m];
    }), r = () => ({
      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(u) {
            return [`{a|${`${u.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: i.value
          },
          label: {
            show: !0
          }
        }, {
          value: 100 - t.percent,
          itemStyle: {
            color: "#EBF4FF"
          }
        }, {
          value: 100,
          itemStyle: {
            color: "none"
          }
        }]
      }]
    });
    V(() => {
      e = U(s.value), e.setOption(r());
    });
    const {
      percent: d,
      colors: y,
      text: c
    } = F(t);
    return S([d, y, c], () => {
      e && (e.setOption(r()), e.resize());
    }), window.addEventListener("resize", () => {
      e == null || e.resize();
    }), {
      ns: n,
      chartRef: s
    };
  },
  render() {
    return a("div", {
      class: this.ns.b(),
      ref: "chartRef"
    });
  }
}), Oe = ["#FF0700", "#FFF400", "#73A0FA"], Ae = {
  strMapCode: !0,
  visualMap: {
    text: ["\u9AD8", "\u4F4E"],
    min: 0,
    max: 100,
    rangeColor: Oe
  },
  pointSymbol: "pin"
}, Ke = "/assets/json/map/jiangsu/{id}.json";
async function $e(t) {
  return (await ibiz.net.axios({
    url: _.dir(Ke.replace("{id}", t))
  })).data;
}
function Re(t, n) {
  const s = /* @__PURE__ */ new Map(), e = x(""), i = x([]);
  let r;
  const d = x(), y = (o) => {
    const f = {
      cityNames: {},
      noChild: o.features.length === 1
    };
    return o.features.forEach((C) => {
      const { adcode: p, name: k } = C.properties;
      f.cityNames[p] = k;
    }), f;
  }, c = async (o) => {
    if (s.has(o))
      return;
    const f = await $e(o);
    s.set(o, y(f)), we(o, f);
  }, u = (o) => {
    const f = s.get(e.value);
    if (f)
      return f.cityNames[o];
  }, m = () => {
    const o = t(e.value);
    r.setOption(o), r.resize();
  }, h = async (o, f = !1) => {
    f || n("mapChange", { name: o }), s.has(o) || await c(o), e.value = o, i.value.push(o), m();
  }, l = () => {
    if (i.value.length > 1) {
      i.value.pop();
      const o = i.value.pop();
      h(o);
    }
  };
  return V(() => {
    r = U(d.value), window.addEventListener("resize", () => {
      r == null || r.resize();
    }), r.on("click", (o) => {
      if (o.componentType === "series" && o.seriesType === "scatter") {
        n("pointClick", o.data);
        return;
      }
      o.name !== e.value && h(o.name);
    }), r.on("mouseover", function(o) {
      if (o.componentType === "series" && o.seriesType === "scatter") {
        const f = o.dataIndex, C = r.getOption(), p = C.series[o.seriesIndex].data, k = C.series[o.seriesIndex].symbolSize;
        p[f].symbolSize = k + 10, r.setOption(C);
      }
    }), r.on("mouseout", function(o) {
      if (o.componentType === "series" && o.seriesType === "scatter") {
        const f = o.dataIndex, C = r.getOption(), p = C.series[o.seriesIndex].data;
        delete p[f].symbolSize, r.setOption(C);
      }
    });
  }), {
    chartRef: d,
    historyNames: i,
    currenName: e,
    changeMap: h,
    getCityName: u,
    goBack: l,
    refresh: m
  };
}
const Fe = q({
  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 = D("map-chart"), e = j(() => be(Ae, t.options)), {
      chartRef: i,
      historyNames: r,
      changeMap: d,
      getCityName: y,
      goBack: c,
      refresh: u
    } = Re((l) => {
      const {
        visualMap: o,
        pointSymbol: f
      } = e.value, C = {
        geo: {
          map: l
        },
        tooltip: {
          trigger: "item",
          textStyle: {
            color: "#fff",
            fontSize: 12
          },
          backgroundColor: "rgba(0, 0, 0, 0.47)",
          borderWidth: 0,
          extraCssText: "backdrop-filter: blur(3px);"
        },
        visualMap: {
          min: o.min,
          max: o.max,
          text: o.text,
          realtime: !1,
          hoverLink: !1,
          inRange: {
            color: o.rangeColor
          }
        },
        series: [
          {
            type: "map",
            map: l,
            nameProperty: e.value.strMapCode ? "adcodeStr" : "adcode",
            tooltip: {
              formatter: (p) => {
                const k = y(p.name), P = t.mapData.find((O) => O.name == p.name);
                if (!!P)
                  return `
                      <div style='display:flex;justify-content: space-between;'>
                        <span>${k}</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>
                    `;
              }
            },
            label: {
              show: !0,
              color: "#000000",
              fontSize: 11,
              formatter: (p) => y(p.name)
            },
            select: {
              disabled: !0
            },
            data: t.mapData.map((p) => ({
              name: p.name,
              value: p.value
            }))
          }
        ]
      };
      return t.pointData && C.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: (p) => p.data.title,
          position: "left",
          offset: [10, -15]
        },
        tooltip: {
          formatter: (p) => {
            const k = p.data;
            return `
                    <div style='display:flex;justify-content: space-between;'>
                      <span>${k.title}</span>
                      <span>${k.zcrs}</span>
                    </div>
                    <div style='display:flex;justify-content: space-between;'>
                      <span>\u6B63\u5E38\u7387\uFF1A</span>
                      <span>${k.zcl}</span>
                    </div>
                  `;
          }
        },
        data: t.pointData.map((p) => ({
          ...p,
          value: [Number(p.jd), Number(p.wd)],
          visualMap: !1
        }))
      }), C;
    }, (l, o) => {
      l === "mapChange" ? n("mapChange", o.name) : n(l, o);
    });
    V(() => {
      d(t.defaultMapName, !0);
    });
    const {
      mapData: m,
      pointData: h
    } = F(t);
    return S([m, h], () => {
      u();
    }), {
      ns: s,
      chartRef: i,
      historyNames: r,
      goBack: c
    };
  },
  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"])]);
  }
}), Be = `image://${_.dir("/assets/img/fiveStars.png")}`, Ue = q({
  name: "PortalMapArea",
  props: {
    modelData: {
      type: me,
      required: !0
    },
    controller: {
      type: W,
      required: !0
    }
  },
  setup(t) {
    const n = X(t.controller), s = D("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(L, {
      attrs: {
        percent: this.c.data.zcl,
        text: `\u6B63\u5E38\u6570 ${this.c.data.zcrs}`
      }
    }), a(L, {
      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(Fe, {
      class: this.ns.e("map"),
      attrs: {
        mapData: this.c.mapData,
        pointData: this.c.pointData,
        defaultMapName: this.c.params.orgcode,
        options: {
          pointSymbol: Be
        }
      },
      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(L, {
      attrs: {
        percent: this.c.data.qjl,
        text: `\u8BF7\u5047\u4EBA\u6570 ${this.c.data.qjrs}`
      }
    }), a(L, {
      attrs: {
        percent: this.c.data.xjl,
        text: `\u4F11\u5047\u4EBA\u6570 ${this.c.data.xjrs}`
      }
    })])]);
  }
});
class He {
  constructor() {
    v(this, "component", Ue);
  }
  async createController(n, s, e) {
    const i = new W(
      n,
      s,
      e
    );
    return await i.init(), i;
  }
}
class We extends xe {
  constructor() {
    super(...arguments);
    v(this, "unit", "");
    v(this, "isPercent", !1);
    v(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 Ye(t, n, s, e = {}) {
  return ae(t, () => {
    const i = new We(n, s, e);
    return ne(t, "mdCtrlActiveMode", i.setMdCtrlActiveMode.bind(i)), i;
  });
}
function Je(t) {
  return { handleClick: (e) => {
    const i = t.selectedData.findIndex((r) => e.srfkey === r.srfkey);
    if (t.singleSelect)
      i === -1 ? t.onSelectionChange([e]) : t.onSelectionChange([]);
    else {
      const r = t.selectedData;
      i === -1 ? r.push(e) : r.splice(i, 1), t.onSelectionChange(r);
    }
    t.handleClick(e);
  }, handleDblClick: (e) => {
    t.handleDblClick(e);
  } };
}
const Ge = q({
  name: "KqqkListControl",
  props: {
    modelData: {
      type: B,
      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
    } = I(), s = D("kqqk-list"), e = Ye(n, t.modelData, t.context, t.params), {
      handleClick: i,
      handleDblClick: r
    } = Je(e), d = (c, u) => {
      const m = e.selectedData.findIndex((l) => l.srfkey === c.srfkey), h = [s.b("item"), s.is("active", m !== -1)];
      return a("div", {
        class: h,
        key: c.srfkey + u,
        on: {
          click: () => i(c),
          dblclick: () => r(c)
        }
      }, [a("span", {
        class: s.be("item", "title")
      }, [c.title]), a("div", {
        class: s.be("item", "progress")
      }, [a("span", {
        style: `width:${c.percent}%;`,
        class: s.be("item", "progress-bar")
      }), a("span", {
        class: s.be("item", "progress-text")
      }, [c.num, e.unit])])]);
    };
    return {
      c: e,
      ns: s,
      renderListContent: () => e.items.map((c, u) => d(c, u))
    };
  },
  render() {
    return a("control-layout", {
      class: this.ns.b(),
      attrs: {
        modelData: this.c.model
      }
    }, [this.c.complete && [this.renderListContent()]]);
  }
});
class Qe {
  constructor() {
    v(this, "component", Ge);
  }
}
function Xe(t) {
  return { handleClick: (e) => {
    const i = t.selectedData.findIndex((r) => e.srfkey === r.srfkey);
    if (t.singleSelect)
      i === -1 ? t.onSelectionChange([e]) : t.onSelectionChange([]);
    else {
      const r = t.selectedData;
      i === -1 ? r.push(e) : r.splice(i, 1), t.onSelectionChange(r);
    }
    t.handleClick(e);
  }, handleDblClick: (e) => {
    t.handleDblClick(e);
  } };
}
const N = q({
  name: "ListExpControl",
  props: {
    modelData: {
      type: B,
      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
    } = I(), s = D("control-list"), e = re(n, t.modelData, t.context, t.params), {
      handleClick: i,
      handleDblClick: r
    } = Xe(e);
    let d = !0;
    V(() => {
      S(() => e, (l, o) => {
        if (t.isExpView && l && l !== o) {
          let f = e.items[0];
          if (t.defaultSelectKeys && t.defaultSelectKeys.length > 0) {
            const C = e.items.find((p) => p.srfkey === t.defaultSelectKeys[0]);
            C && (f = C);
          }
          f && e.onSelectionChange([f]);
        }
      }, {
        immediate: !0
      }), S(() => e.items.length, (l) => {
        t.isExpView && l && e.onSelectionChange([e.items[0]]);
      }, {
        immediate: !0,
        deep: !0
      });
    });
    const y = (l) => {
      e.selectedData.length === 0 && (e.selectedData = [{
        srfkey: e.items[0].srfkey
      }]);
      const o = e.selectedData.findIndex((p) => p.srfkey === l.srfkey), f = () => {
        d = !1, delete e.context.n_orgid_eq, e.context.calendarcaption = l.deptname, i(l);
      }, C = [s.b("item"), s.is("active", o !== -1 && d === !1)];
      return a("div", {
        class: C,
        on: {
          click: () => f(),
          dblclick: () => r(l)
        }
      }, [e.layoutPanelProvider ? a(e.layoutPanelProvider.component, {
        props: {
          modelData: e.model,
          context: e.context,
          params: e.params,
          inputData: l
        }
      }) : `${l.deptname}`]);
    }, c = () => e.model.source.enableGroup ? a("el-collapse") : e.items.map((l) => y(l)), u = () => Object.is(e.total, e.items.length) ? null : a("div", {
      class: s.e("no-data")
    }, [a("div", ["\u6682\u65E0\u6570\u636E"])]), m = (l) => {
      d = !0, Object.assign(e.context, {
        n_orgid_eq: e.params.n_orgid_eq
      }), e.context.calendarcaption = l.deptname, i(l);
    }, h = () => {
      const l = [s.b("item"), s.is("active", d === !0)];
      return e.items.length > 0 ? a("div", {
        class: l,
        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 K(() => {
      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);
    }), S(() => e.items, () => {
      K(() => {
        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: c,
      renderLoadMore: u,
      renderAll: h,
      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 Ze = q({
  name: "ListExpSelectTreeView",
  components: {
    Treeselect: qe,
    ListExpControl: N
  },
  props: {
    context: Object,
    params: {
      type: Object
    },
    srfnav: String,
    modelPath: {
      type: String,
      required: !0
    },
    modal: {
      type: Object
    }
  },
  setup(t) {
    const {
      proxy: n
    } = I(), s = ie(n, t.modelPath), e = x(""), i = x([]), r = D("list-exp-select-tree");
    s.context.isRouter === !0 && s.nerve.self.evt.on("created", () => {
      t.srfnav && (s.navItem.key = t.srfnav, i.value = [t.srfnav]), oe(Z(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 y = (h) => ({
      id: h.id,
      label: h.text,
      children: h.children
    }), c = (h) => {
      s.context.selectedDeptName = h.text, Object.assign(s.params, {
        n_orgid_eq: h.value
      }), s.nerve.list.call.load();
    }, u = x(!1);
    return {
      c: s,
      defaultSelectKeys: i,
      routeViewKey: e,
      normalizer: y,
      select: c,
      dataItems: [],
      isLoadCodeList: u,
      value: d,
      ns: r
    };
  },
  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: i
        } = this.c.model.source.getQuickGroupPSCodeList();
        (async (d) => {
          this.dataItems = await ibiz.codeListService.get(d, this.c.context, {
            size: 1e3
          }), this.isLoadCodeList = !0;
        })(i);
      }
      return a("exp-view-base", {
        class: [this.ns.b()],
        attrs: {
          controller: this.c,
          expBarModel: this.c.model.listExpBar
        },
        scopedSlots: {
          default: () => a(N, {
            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: Q.EMBED
              },
              modelPath: s.navView.source.modelPath
            },
            key: this.c.navItem.key
          }) : null
        }
      });
    }
    return null;
  }
});
class et {
  constructor() {
    v(this, "component", "ListExpSelectTreeView");
  }
}
class tt {
  constructor() {
    v(this, "component", "BYQKEditView");
  }
}
class st {
  constructor() {
    v(this, "formEditor", "KqBase64ImageUpload");
    v(this, "gridEditor", "IBizGridFileUpload");
  }
  async createController(n, s) {
    const e = new Ce(n, s);
    return await e.init(), e;
  }
}
const at = q({
  name: "KqBase64ImageUpload",
  props: le(),
  emits: ce(),
  setup(t) {
    var r, d, y;
    const n = D("kq-base64-image-upload"), s = ((r = t.controller.model) == null ? void 0 : r.width) || "auto", e = ((d = t.controller.model) == null ? void 0 : d.height) || "150px", i = ((y = t.controller.editorParams) == null ? void 0 : y["justify-content"]) || "center";
    return () => a("div", {
      class: n.b(),
      style: {
        width: s,
        height: e,
        justifyContent: i
      }
    }, [a("img", {
      attrs: {
        src: t.value
      },
      class: n.e("image")
    })]);
  }
});
class nt {
  constructor() {
    v(this, "component", "KqdwCustomPickupTreeView");
  }
}
const rt = q({
  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 = D("kqdw-custom-pickup-tree-view"), {
      proxy: s
    } = I(), e = de(s, t.modelPath), i = x(null);
    let r = null;
    const d = x([]), y = x({}), c = x([]), u = x([]), m = x(""), h = x([]), l = async (g) => {
      await r.loadNodes(g), y.value = g, c.value.push(g);
    };
    return S(() => e.complete, async (g, w) => {
      var b;
      if (g !== w && g) {
        await e.model.pickupViewPanel.embedView.init();
        const A = (b = e.model.pickupViewPanel.embedView.source.getPSControls()) == null ? void 0 : b.find((z) => z.controlType === "TREEVIEW");
        A || console.warn("\u672A\u627E\u5230[\u6811(tree)]\u90E8\u4EF6"), i.value = new fe(A), await i.value.init(), r = ue(s, i.value, t.context, t.params), await r.init();
        const E = await r.load();
        if (E.length > 0 && (d.value = E, y.value.children = E, c.value.push({
          text: "\u5F53\u524D\u9662",
          children: E
        })), e.params.selectedData) {
          const z = JSON.parse(e.params.selectedData);
          z.length > 0 && (u.value = z.map((M) => ({
            srfkey: M.srfkey,
            srfmajortext: M.srfmajortext,
            value: M.srfkey,
            text: M.srfmajortext,
            dxlx: M.dxlx
          })));
        }
      }
    }), {
      ns: n,
      c: e,
      treeDatas: d,
      currentTreeNode: y,
      clickTreeNode: l,
      treeHistory: c,
      isChecked: (g) => u.value.findIndex((b) => b.value === g.value) !== -1,
      selectTreeNodes: u,
      handleSelect: (g) => {
        const w = u.value.findIndex((b) => b.value === g.value);
        w === -1 ? u.value.push(g) : u.value.splice(w, 1);
      },
      clickHistory: (g) => {
        const w = c.value.findIndex((b) => b.value === g.value);
        c.value = c.value.slice(0, w + 1), y.value = g;
      },
      clearAll: () => {
        u.value = [];
      },
      onOkButtonClick: () => {
        const g = u.value.map((w) => {
          var b;
          return {
            srfkey: w.value,
            srfmajortext: w.text,
            dxlx: (b = w.deData) == null ? void 0 : b.dxlx
          };
        });
        e.closeView({
          ok: !0,
          data: g
        });
      },
      query: m,
      queryChange: (g) => {
        g.target && (m.value = g.target.value, Object.assign(e.params, {
          query: m.value
        }));
      },
      search: async () => {
        const g = await (r == null ? void 0 : r.load());
        g && (h.value = g);
      },
      queryTreeNodeList: h
    };
  },
  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 it {
  constructor() {
    v(this, "component", "KqbcFormMDCtrl");
  }
  async createController(n, s, e) {
    const i = new ke(n, s, e);
    return await i.init(), i;
  }
}
const xt = {
  mateUrl: import.meta.url,
  install(t) {
    t.component("UserIndexView", Le), t.component("UserAppLayout", Te), t.component("ListExpSelectTreeView", Ze), t.component("ListExpControl", N), 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 De()
    ), ibiz.register.view.register(
      "VIEW_CUSTOM_ListExpSelectTreeView",
      new et()
    ), _.loadStyle(["/style.css"]), ibiz.register.portletPart.register(
      "PORTLET_CUSTOM_JskqWebPortalSearchHeader",
      new Ne()
    ), ibiz.register.portletPart.register(
      "PORTLET_CUSTOM_jskqWebPortalMapArea",
      new He()
    ), ibiz.register.control.register(
      "LIST_RENDER_JskqWebKqqkList",
      new Qe()
    ), ibiz.register.view.register(
      "VIEW_CUSTOM_ByqkCustomEditView",
      new tt()
    ), t.component("KqBase64ImageUpload", at), ibiz.register.editor.register(
      "PICTURE_ONE_Base64ImageUpload",
      new st()
    ), t.component("KqdwCustomPickupTreeView", rt), ibiz.register.view.register(
      "VIEW_CUSTOM_KqdwCustomPickupTreeView",
      new nt()
    ), ibiz.register.formDetail.register("MDCTRL", new it());
  }
};
export {
  xt as default
};
