index-7562e272.js 2.5 KB
var a = Object.defineProperty;
var s = (t, o, r) => o in t ? a(t, o, { enumerable: !0, configurable: !0, writable: !0, value: r }) : t[o] = r;
var e = (t, o, r) => (s(t, typeof o != "symbol" ? o + "" : o, r), r);
import { ControlType as c, ViewType as l } from "@ibiz-template/model";
import { PluginStaticResource as h } from "@ibiz-template/runtime";
import { PortletPartController as C } from "@ibiz-template/controller";
const m = new h(import.meta.url);
class p {
  constructor() {
    e(this, "component", "ChartControl");
  }
}
class w {
  constructor() {
    e(this, "component", "ChartView");
  }
}
class d extends C {
  constructor() {
    super(...arguments);
    /**
     * 图表神经元
     *
     * @author zhanghengfeng
     * @date 2023-10-30 19:10:58
     * @type {ChartNeuron}
     */
    e(this, "chart");
    /**
     * 图表适配器
     *
     * @author zhanghengfeng
     * @date 2023-10-30 19:10:22
     * @type {IControlProvider}
     */
    e(this, "chartProvider");
  }
  async onInit() {
    await super.onInit();
    const { chart: r } = this.model;
    r && (this.chartProvider = await ibiz.register.control.get(r));
  }
  /**
   * 设置图表神经元
   *
   * @author zhanghengfeng
   * @date 2023-10-30 19:10:45
   * @param {ChartNeuron} neuron
   */
  setChartNeuron(r) {
    this.chart = r, this.chart.evt.on("mounted", () => {
      var i;
      (i = this.chart) == null || i.call.load();
    }), this.chart.evt.on("destroyed", () => {
      this.chart = void 0;
    });
  }
}
class P {
  constructor() {
    e(this, "component", "ChartPortlet");
  }
  async createController(o, r, i) {
    const n = new d(
      o,
      r,
      i
    );
    return await n.init(), n;
  }
}
class g {
  constructor() {
    e(this, "component", "GwxnChartControl");
  }
}
const T = {
  mateUrl: import.meta.url,
  install(t) {
    m.loadStyle(["/style.css"]), t.component(
      "ChartControl",
      () => import("./chart-control-e83eabb6.js")
    ), ibiz.register.control.register(c.CHART, new p()), t.component(
      "ChartView",
      () => import("./chart-view-2e05f0a8.js")
    ), ibiz.register.view.register(
      l.DE_CHART_VIEW,
      new w()
    ), t.component(
      "ChartPortlet",
      () => import("./chart-portlet-533d5bd9.js")
    ), ibiz.register.portletPart.register("CHART", new P()), t.component(
      "GwxnChartControl",
      () => import("./gwxn-chart-control-f043106c.js")
    ), ibiz.register.control.register("CUSTOM_GwxnChart", new g());
  }
};
export {
  d as C,
  T as i
};