!function(){function e(t){return e="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},e(t)}function t(e){return function(e){if(Array.isArray(e))return r(e)}(e)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(e)||function(e,t){if(!e)return;if("string"==typeof e)return r(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return r(e,t)}(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function r(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}function n(){"use strict";/*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */n=function(){return t};var t={},r=Object.prototype,i=r.hasOwnProperty,o=Object.defineProperty||function(e,t,r){e[t]=r.value},a="function"==typeof Symbol?Symbol:{},s=a.iterator||"@@iterator",c=a.asyncIterator||"@@asyncIterator",u=a.toStringTag||"@@toStringTag";function l(e,t,r){return Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}),e[t]}try{l({},"")}catch(k){l=function(e,t,r){return e[t]=r}}function h(e,t,r,n){var i=t&&t.prototype instanceof d?t:d,a=Object.create(i.prototype),s=new P(n||[]);return o(a,"_invoke",{value:S(e,r,s)}),a}function f(e,t,r){try{return{type:"normal",arg:e.call(t,r)}}catch(k){return{type:"throw",arg:k}}}t.wrap=h;var p={};function d(){}function v(){}function y(){}var m={};l(m,s,(function(){return this}));var g=Object.getPrototypeOf,w=g&&g(g(j([])));w&&w!==r&&i.call(w,s)&&(m=w);var b=y.prototype=d.prototype=Object.create(m);function x(e){["next","throw","return"].forEach((function(t){l(e,t,(function(e){return this._invoke(t,e)}))}))}function C(t,r){function n(o,a,s,c){var u=f(t[o],t,a);if("throw"!==u.type){var l=u.arg,h=l.value;return h&&"object"==e(h)&&i.call(h,"__await")?r.resolve(h.__await).then((function(e){n("next",e,s,c)}),(function(e){n("throw",e,s,c)})):r.resolve(h).then((function(e){l.value=e,s(l)}),(function(e){return n("throw",e,s,c)}))}c(u.arg)}var a;o(this,"_invoke",{value:function(e,t){function i(){return new r((function(r,i){n(e,t,r,i)}))}return a=a?a.then(i,i):i()}})}function S(e,t,r){var n="suspendedStart";return function(i,o){if("executing"===n)throw new Error("Generator is already running");if("completed"===n){if("throw"===i)throw o;return A()}for(r.method=i,r.arg=o;;){var a=r.delegate;if(a){var s=O(a,r);if(s){if(s===p)continue;return s}}if("next"===r.method)r.sent=r._sent=r.arg;else if("throw"===r.method){if("suspendedStart"===n)throw n="completed",r.arg;r.dispatchException(r.arg)}else"return"===r.method&&r.abrupt("return",r.arg);n="executing";var c=f(e,t,r);if("normal"===c.type){if(n=r.done?"completed":"suspendedYield",c.arg===p)continue;return{value:c.arg,done:r.done}}"throw"===c.type&&(n="completed",r.method="throw",r.arg=c.arg)}}}function O(e,t){var r=t.method,n=e.iterator[r];if(void 0===n)return t.delegate=null,"throw"===r&&e.iterator.return&&(t.method="return",t.arg=void 0,O(e,t),"throw"===t.method)||"return"!==r&&(t.method="throw",t.arg=new TypeError("The iterator does not provide a '"+r+"' method")),p;var i=f(n,e.iterator,t.arg);if("throw"===i.type)return t.method="throw",t.arg=i.arg,t.delegate=null,p;var o=i.arg;return o?o.done?(t[e.resultName]=o.value,t.next=e.nextLoc,"return"!==t.method&&(t.method="next",t.arg=void 0),t.delegate=null,p):o:(t.method="throw",t.arg=new TypeError("iterator result is not an object"),t.delegate=null,p)}function L(e){var t={tryLoc:e[0]};1 in e&&(t.catchLoc=e[1]),2 in e&&(t.finallyLoc=e[2],t.afterLoc=e[3]),this.tryEntries.push(t)}function E(e){var t=e.completion||{};t.type="normal",delete t.arg,e.completion=t}function P(e){this.tryEntries=[{tryLoc:"root"}],e.forEach(L,this),this.reset(!0)}function j(e){if(e){var t=e[s];if(t)return t.call(e);if("function"==typeof e.next)return e;if(!isNaN(e.length)){var r=-1,n=function t(){for(;++r<e.length;)if(i.call(e,r))return t.value=e[r],t.done=!1,t;return t.value=void 0,t.done=!0,t};return n.next=n}}return{next:A}}function A(){return{value:void 0,done:!0}}return v.prototype=y,o(b,"constructor",{value:y,configurable:!0}),o(y,"constructor",{value:v,configurable:!0}),v.displayName=l(y,u,"GeneratorFunction"),t.isGeneratorFunction=function(e){var t="function"==typeof e&&e.constructor;return!!t&&(t===v||"GeneratorFunction"===(t.displayName||t.name))},t.mark=function(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,y):(e.__proto__=y,l(e,u,"GeneratorFunction")),e.prototype=Object.create(b),e},t.awrap=function(e){return{__await:e}},x(C.prototype),l(C.prototype,c,(function(){return this})),t.AsyncIterator=C,t.async=function(e,r,n,i,o){void 0===o&&(o=Promise);var a=new C(h(e,r,n,i),o);return t.isGeneratorFunction(r)?a:a.next().then((function(e){return e.done?e.value:a.next()}))},x(b),l(b,u,"Generator"),l(b,s,(function(){return this})),l(b,"toString",(function(){return"[object Generator]"})),t.keys=function(e){var t=Object(e),r=[];for(var n in t)r.push(n);return r.reverse(),function e(){for(;r.length;){var n=r.pop();if(n in t)return e.value=n,e.done=!1,e}return e.done=!0,e}},t.values=j,P.prototype={constructor:P,reset:function(e){if(this.prev=0,this.next=0,this.sent=this._sent=void 0,this.done=!1,this.delegate=null,this.method="next",this.arg=void 0,this.tryEntries.forEach(E),!e)for(var t in this)"t"===t.charAt(0)&&i.call(this,t)&&!isNaN(+t.slice(1))&&(this[t]=void 0)},stop:function(){this.done=!0;var e=this.tryEntries[0].completion;if("throw"===e.type)throw e.arg;return this.rval},dispatchException:function(e){if(this.done)throw e;var t=this;function r(r,n){return a.type="throw",a.arg=e,t.next=r,n&&(t.method="next",t.arg=void 0),!!n}for(var n=this.tryEntries.length-1;n>=0;--n){var o=this.tryEntries[n],a=o.completion;if("root"===o.tryLoc)return r("end");if(o.tryLoc<=this.prev){var s=i.call(o,"catchLoc"),c=i.call(o,"finallyLoc");if(s&&c){if(this.prev<o.catchLoc)return r(o.catchLoc,!0);if(this.prev<o.finallyLoc)return r(o.finallyLoc)}else if(s){if(this.prev<o.catchLoc)return r(o.catchLoc,!0)}else{if(!c)throw new Error("try statement without catch or finally");if(this.prev<o.finallyLoc)return r(o.finallyLoc)}}}},abrupt:function(e,t){for(var r=this.tryEntries.length-1;r>=0;--r){var n=this.tryEntries[r];if(n.tryLoc<=this.prev&&i.call(n,"finallyLoc")&&this.prev<n.finallyLoc){var o=n;break}}o&&("break"===e||"continue"===e)&&o.tryLoc<=t&&t<=o.finallyLoc&&(o=null);var a=o?o.completion:{};return a.type=e,a.arg=t,o?(this.method="next",this.next=o.finallyLoc,p):this.complete(a)},complete:function(e,t){if("throw"===e.type)throw e.arg;return"break"===e.type||"continue"===e.type?this.next=e.arg:"return"===e.type?(this.rval=this.arg=e.arg,this.method="return",this.next="end"):"normal"===e.type&&t&&(this.next=t),p},finish:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var r=this.tryEntries[t];if(r.finallyLoc===e)return this.complete(r.completion,r.afterLoc),E(r),p}},catch:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var r=this.tryEntries[t];if(r.tryLoc===e){var n=r.completion;if("throw"===n.type){var i=n.arg;E(r)}return i}}throw new Error("illegal catch attempt")},delegateYield:function(e,t,r){return this.delegate={iterator:j(e),resultName:t,nextLoc:r},"next"===this.method&&(this.arg=void 0),p}},t}function i(e,t,r,n,i,o,a){try{var s=e[o](a),c=s.value}catch(u){return void r(u)}s.done?t(c):Promise.resolve(c).then(n,i)}function o(e){return function(){var t=this,r=arguments;return new Promise((function(n,o){var a=e.apply(t,r);function s(e){i(a,n,o,s,c,"next",e)}function c(e){i(a,n,o,s,c,"throw",e)}s(void 0)}))}}function a(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function s(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?a(Object(r),!0).forEach((function(t){c(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):a(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}function c(e,t,r){return(t=f(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function u(){return u="undefined"!=typeof Reflect&&Reflect.get?Reflect.get.bind():function(e,t,r){var n=function(e,t){for(;!Object.prototype.hasOwnProperty.call(e,t)&&null!==(e=g(e)););return e}(e,t);if(n){var i=Object.getOwnPropertyDescriptor(n,t);return i.get?i.get.call(arguments.length<3?e:r):i.value}},u.apply(this,arguments)}function l(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,f(n.key),n)}}function h(e,t,r){return t&&l(e.prototype,t),r&&l(e,r),Object.defineProperty(e,"prototype",{writable:!1}),e}function f(t){var r=function(t,r){if("object"!==e(t)||null===t)return t;var n=t[Symbol.toPrimitive];if(void 0!==n){var i=n.call(t,r||"default");if("object"!==e(i))return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===r?String:Number)(t)}(t,"string");return"symbol"===e(r)?r:String(r)}function p(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function d(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&v(e,t)}function v(e,t){return v=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},v(e,t)}function y(t){var r=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var n,i=g(t);if(r){var o=g(this).constructor;n=Reflect.construct(i,arguments,o)}else n=i.apply(this,arguments);return function(t,r){if(r&&("object"===e(r)||"function"==typeof r))return r;if(void 0!==r)throw new TypeError("Derived constructors may only return object or undefined");return m(t)}(this,n)}}function m(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function g(e){return g=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},g(e)}System.register(["vue","@ibiz-template/vue-util","@ibiz-template/model","@ibiz-template/controller","qx-util","echarts","ramda","@ibiz-template/service"],(function(e,r){"use strict";var i,a,l,f,v,w,b,x,C,S,O,L,E;return{setters:[function(e){i=e.defineComponent,a=e.getCurrentInstance,l=e.h},function(e){f=e.useControlController,v=e.useNamespace},function(e){w=e.ChartModel},function(e){b=e.Neuron,x=e.ControlNerve,C=e.ControlController},function(e){S=e.createUUID},function(e){O=e.init},function(e){L=e.mergeDeepRight},function(e){E=e.ControlService}],execute:function(){var r=function(e){d(r,e);var t=y(r);function r(){return p(this,r),t.apply(this,arguments)}return h(r)}(b),P=function(e){d(n,e);var t=y(n);function n(){return p(this,n),t.apply(this,arguments)}return h(n,[{key:"createNeuron",value:function(){return new r(this.bindAbility())}},{key:"bindAbility",value:function(){return s(s({},u(g(n.prototype),"bindAbility",this).call(this)),{},{load:this.controller.load.bind(this.controller)})}}]),n}(x);function j(e){var t={};return e&&Object.keys(e).forEach((function(r){var n=r.indexOf(".");if(-1!==n){var i=r.slice(n+1);i&&void 0!==e[r]&&(t[i]=JSON.parse(e[r]))}})),t}function A(e){return{axisLabel:{formatter:function(t){return 1===e?t.length>4?"".concat(t.slice(0,4).split("").join("\n"),"\n..."):t.split("").join("\n"):2===e&&t.length>4?"".concat(t.slice(0,4),"..."):t},rotate:2===e?45:0}}}var k=function(e){d(l,e);var r,i,a,u=y(l);function l(e){var t;p(this,l),c(m(t=u.call(this,e)),"seriesList",[]);var r=e.source.getPSDEChartSerieses();if(!r||!r.length)throw new Error("图表序列集合不能为空");return t.seriesList=r,t}return h(l,[{key:"fetch",value:(a=o(n().mark((function e(t){var r,i,o=arguments;return n().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return r=o.length>1&&void 0!==o[1]?o[1]:{},e.next=3,this.exec(this.model.fetchAction,t,r);case 3:return i=e.sent,e.abrupt("return",i);case 5:case"end":return e.stop()}}),e,this)}))),function(e){return a.apply(this,arguments)})},{key:"getAllCodeListMap",value:(i=o(n().mark((function e(t,r){var i;return n().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return i=[],e.next=3,Promise.all(this.seriesList.map(function(){var e=o(n().mark((function e(o,a){var s,c,u,l,h,f,p,d,v,y,m;return n().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(h={},f=null===(s=o.getCatalogPSCodeList)||void 0===s||null===(c=s.call(o))||void 0===c?void 0:c.codeName,p=null===(u=o.getSeriesPSCodeList)||void 0===u||null===(l=u.call(o))||void 0===l?void 0:l.codeName,!f){e.next=8;break}return e.next=6,ibiz.codeListService.get(f,t,r);case 6:(d=e.sent)&&(v=new Map,d.forEach((function(e){v.set(e.value,e.text)})),h.catalog=v);case 8:if(!p){e.next=13;break}return e.next=11,ibiz.codeListService.get(p,t,r);case 11:(y=e.sent)&&(m=new Map,y.forEach((function(e){m.set(e.value,e.text)})),h.series=m);case 13:i[a]=h;case 14:case"end":return e.stop()}}),e)})));return function(t,r){return e.apply(this,arguments)}}()));case 3:return e.abrupt("return",i);case 4:case"end":return e.stop()}}),e,this)}))),function(e,t){return i.apply(this,arguments)})},{key:"generateDatasetOption",value:function(e,r,n){var i,o={},a=[];o.source=a;var s=e.catalogField.toLowerCase(),c=e.valueField.toLowerCase(),u=null===(i=e.seriesField)||void 0===i?void 0:i.toLowerCase();if(u){var l=new Set;r.forEach((function(e){l.add(e[u])})),a.push([s].concat(t(l)))}else a.push([s,c]);a.push.apply(a,t(r.map((function(e){return a[0].map((function(t,r){return 0===r?(n&&n.catalog?n.catalog.get(e[t]):e[t])||"未定义":u?t===e[u]&&e[c]||0:e[c]||0}))})))),n&&n.series&&(a[0]=a[0].map((function(e,t){var r;return 0===t?e:(null===(r=n.series)||void 0===r?void 0:r.get(e))||e})));for(var h=function(e){for(var t=e+1;t<a.length;t++)a[t][0]===a[e][0]&&(a[t].forEach((function(t,r){0!==r&&(a[e][r]+=t)})),a.splice(t,1),t-=1)},f=1;f<a.length;f++)h(f);return o}},{key:"generateChartOption",value:(r=o(n().mark((function e(r,i,o){var a,s,c=this;return n().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return(a={}).dataset=[],a.series=[],e.next=5,this.getAllCodeListMap(i,o);case 5:return s=e.sent,this.seriesList.forEach((function(e,n){if("radar"!==e.eChartsType){var i=c.generateDatasetOption(e,r,s[n]);if(Array.isArray(a.dataset)&&a.dataset.push(i),"bar"===e.eChartsType){var o,u=c.generateBarSeriesOption(e,r,s[n],n);Array.isArray(a.series)&&(o=a.series).push.apply(o,t(u))}else if("line"===e.eChartsType){var l,h=c.generateLineSeriesOption(e,r,s[n],n);Array.isArray(a.series)&&(l=a.series).push.apply(l,t(h))}else if("pie"===e.eChartsType){var f,p=c.generatePieSeriesOption(e,r,s[n],n);Array.isArray(a.series)&&(f=a.series).push.apply(f,t(p))}else if("funnel"===e.eChartsType){var d,v=c.generateFunnelSeriesOption(e,r,s[n],n);Array.isArray(a.series)&&(d=a.series).push.apply(d,t(v))}else{if("scatter"!==e.eChartsType)throw new Error("".concat(e.eChartsType,"类型的图表暂未实现"));var y,m=c.generateScatterSeriesOption(e,r,s[n],n);Array.isArray(a.series)&&(y=a.series).push.apply(y,t(m))}}else{var g,w=c.generateRadarSeriesOption(e,r,s[n]),b=w.series,x=w.radar;Array.isArray(a.series)&&(g=a.series).push.apply(g,t(b)),a.radar=x}})),e.abrupt("return",a);case 8:case"end":return e.stop()}}),e,this)}))),function(e,t,n){return r.apply(this,arguments)})},{key:"generateBarSeriesOption",value:function(e,r,n,i){var o,a,c,u,l,h,f,p=[],d=e.eChartsType,v=e.catalogField.toLowerCase(),y=e.valueField.toLowerCase(),m=null===(o=e.seriesField)||void 0===o?void 0:o.toLowerCase(),g=+(null===(a=e.M)||void 0===a||null===(c=a.getPSChartSeriesEncode)||void 0===c||null===(u=c.getPSChartXAxis)||void 0===u?void 0:u.id)||0,w=+(null===(l=e.M)||void 0===l||null===(h=l.getPSChartSeriesEncode)||void 0===h||null===(f=h.getPSChartYAxis)||void 0===f?void 0:f.id)||0,b={};if(m){var x=new Set;r.forEach((function(e){var t=e[m];x.add(n&&n.series&&n.series.get(t)||t)})),p.push.apply(p,t(t(x).map((function(t){return s({type:d,xAxisIndex:g,yAxisIndex:w,name:t,datasetIndex:i,encode:{x:v,y:t}},L(b,j(e.userParams)))}))))}else p.push(s({type:d,xAxisIndex:g,yAxisIndex:w,name:e.caption||e.id,datasetIndex:i,encode:{x:v,y:y}},L(b,j(e.userParams))));return p}},{key:"generateLineSeriesOption",value:function(e,r,n,i){var o,a,c,u,l,h,f,p=[],d=e.eChartsType,v=e.catalogField.toLowerCase(),y=e.valueField.toLowerCase(),m=null===(o=e.seriesField)||void 0===o?void 0:o.toLowerCase(),g=+(null===(a=e.M)||void 0===a||null===(c=a.getPSChartSeriesEncode)||void 0===c||null===(u=c.getPSChartXAxis)||void 0===u?void 0:u.id)||0,w=+(null===(l=e.M)||void 0===l||null===(h=l.getPSChartSeriesEncode)||void 0===h||null===(f=h.getPSChartYAxis)||void 0===f?void 0:f.id)||0,b={emphasis:{label:{fontSize:20,show:!0}},label:{position:"top",show:!0}};if(m){var x=new Set;r.forEach((function(e){var t=e[m];x.add(n&&n.series&&n.series.get(t)||t)})),p.push.apply(p,t(t(x).map((function(t){return s({type:d,xAxisIndex:g,yAxisIndex:w,name:t,datasetIndex:i,encode:{x:v,y:t},stack:e.M.stack?e.id:void 0,step:!!e.M.step&&"middle"},L(b,j(e.userParams)))}))))}else p.push(s({type:d,xAxisIndex:g,yAxisIndex:w,name:e.caption||e.id,datasetIndex:i,encode:{x:v,y:y}},L(b,j(e.userParams))));return p}},{key:"generatePieSeriesOption",value:function(e,r,n,i){var o,a=[],c=e.eChartsType,u=e.catalogField.toLowerCase(),l=e.valueField.toLowerCase(),h=null===(o=e.seriesField)||void 0===o?void 0:o.toLowerCase(),f={emphasis:{label:{fontSize:20,show:!0}},label:{formatter:"{b}: {d}%({@age})",position:"outside",show:!0}};if(h){var p=new Set;r.forEach((function(e){var t=e[h];p.add(n&&n.series&&n.series.get(t)||t)})),a.push.apply(a,t(t(p).map((function(t){return s({type:c,name:t,datasetIndex:i,encode:{itemName:u,value:t}},L(f,j(e.userParams)))}))))}else a.push(s({type:c,name:e.caption||e.id,datasetIndex:i,encode:{itemName:u,value:l}},L(f,j(e.userParams))));return a}},{key:"generateFunnelSeriesOption",value:function(e,r,n,i){var o,a=[],c=e.eChartsType,u=e.catalogField.toLowerCase(),l=e.valueField.toLowerCase(),h=null===(o=e.seriesField)||void 0===o?void 0:o.toLowerCase(),f={emphasis:{label:{fontSize:20,show:!0}},label:{formatter:"{b}: {d}%({@age})",position:"outside",show:!0}};if(h){var p=new Set;r.forEach((function(e){var t=e[h];p.add(n&&n.series&&n.series.get(t)||t)})),a.push.apply(a,t(t(p).map((function(t){return s({type:c,name:t,datasetIndex:i,encode:{itemName:u,value:t}},L(f,j(e.userParams)))}))))}else a.push(s({type:c,name:e.caption||e.id,datasetIndex:i,encode:{itemName:u,value:l}},L(f,j(e.userParams))));return a}},{key:"generateScatterSeriesOption",value:function(e,r,n,i){var o,a=[],c=e.eChartsType,u=e.catalogField.toLowerCase(),l=e.valueField.toLowerCase(),h=null===(o=e.seriesField)||void 0===o?void 0:o.toLowerCase(),f={emphasis:{label:{fontSize:20,show:!0}},label:{position:"top",show:!0}};if(h){var p=new Set;r.forEach((function(e){var t=e[h];p.add(n&&n.series&&n.series.get(t)||t)})),a.push.apply(a,t(t(p).map((function(t){return s({type:c,name:t,datasetIndex:i,encode:{x:u,y:t}},L(f,j(e.userParams)))}))))}else a.push(s({type:c,name:e.caption||e.id,datasetIndex:i,encode:{x:u,y:l}},L(f,j(e.userParams))));return a}},{key:"generateRadarSeriesOption",value:function(e,r,n){var i,o=[],a=[],c=e.eChartsType,u=e.catalogField.toLowerCase(),l=e.valueField.toLowerCase(),h=null===(i=e.seriesField)||void 0===i?void 0:i.toLowerCase();if(h){var f=new Set;r.forEach((function(e){f.add(e[h])})),a.push([u].concat(t(f)))}else a.push([u,l]);a.push.apply(a,t(r.map((function(e){return a[0].map((function(t,r){return 0===r?(n&&n.catalog?n.catalog.get(e[t]):e[t])||"未定义":h?t===e[h]?e[l]:0:e[l]}))})))),n&&n.series&&(a[0]=a[0].map((function(e,t){var r;return 0===t?e:(null===(r=n.series)||void 0===r?void 0:r.get(e))||e})));for(var p=function(e){for(var t=e+1;t<a.length;t++)a[t][0]===a[e][0]&&(a[t].forEach((function(t,r){0!==r&&(a[e][r]+=t)})),a.splice(t,1),t-=1)},d=1;d<a.length;d++)p(d);var v=a[0].slice(1).map((function(e,t){return a.slice(1).map((function(e){return e[t+1]}))}));o.push(s({type:c,name:e.caption||e.id,data:v},L({emphasis:{label:{fontSize:20,show:!0}},label:{position:"top",show:!0}},j(e.userParams))));var y=-1/0;return v.forEach((function(e){e.forEach((function(e){+e>y&&(y=+e)}))})),{series:o,radar:{indicator:a.slice(1).map((function(e){return{name:e[0],max:y}}))}}}}]),l}(E),I=function(e){d(a,e);var t,r,i=y(a);function a(){var e;p(this,a);for(var t=arguments.length,r=new Array(t),n=0;n<t;n++)r[n]=arguments[n];return c(m(e=i.call.apply(i,[this].concat(r))),"chart",null),c(m(e),"chartId","chart_".concat(S())),c(m(e),"chartStaticOption",{}),c(m(e),"items",[]),c(m(e),"queryParams",{page:0,size:1e3,query:""}),c(m(e),"width","100%"),c(m(e),"height","100%"),e}return h(a,[{key:"createNerve",value:function(){return new P(this)}},{key:"onInit",value:(r=o(n().mark((function e(){var t,r,i;return n().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,u(g(a.prototype),"onInit",this).call(this);case 2:return this.service=new k(this.model),e.next=5,this.service.init(this.context);case 5:this.initChartStaticOption(),this.resizeChart=this.resizeChart.bind(this),window.addEventListener("resize",this.resizeChart),t=this.model.source,r=t.width,i=t.height,r&&(this.width="".concat(r,"px")),i&&(this.height="".concat(i,"px"));case 11:case"end":return e.stop()}}),e,this)}))),function(){return r.apply(this,arguments)})},{key:"resizeChart",value:function(){var e;null===(e=this.chart)||void 0===e||e.resize()}},{key:"initChartStaticOption",value:function(){var e={},t=this.model.source.getPSDEChartTitle();e.title=t?function(e){var t={};if(e){var r;t.show=e.showTitle,t.text=e.title,t.subtext=e.subTitle;var n=null===(r=e.titlePos)||void 0===r?void 0:r.toLowerCase();"left"===n||"right"===n?t.left=n:"bottom"!==n&&"top"!==n||(t.left="center",t.top=n)}return t}(t):{},e.tooltip={show:!0};var r=this.model.source.getPSDEChartSerieses();r&&r.length&&"bar"===r[0].eChartsType&&(e.tooltip={show:!0,padding:0,backgroundColor:"rgba(255, 255, 255, 0)",borderWidth:0,className:"chart-tooltip",borderRadius:6,extraCssText:"box-shadow: none;",trigger:"axis",axisPointer:{type:"shadow"},appendToBody:!0,formatter:function(e){var t=e,r=document.createElement("div");if(r.classList.add("chart-tooltip-container"),Array.isArray(e)){var n=[],i=new Map;t.forEach((function(e){var t=e.seriesName,r=e.dimensionNames;r.slice(1).forEach((function(o,a){var s=2===r.length?t:o,c=e.value[a+1];i.has(s)||(n.push({x:s,y:c}),i.set(s,c))}))}));var o=document.createElement("div");return o.classList.add("chart-tooltip-title"),o.textContent=t[0].value[0],r.appendChild(o),n.forEach((function(e){var t=document.createElement("div");t.classList.add("chart-tooltip-item");var n=document.createElement("div");n.classList.add("chart-tooltip-item-name"),n.textContent=e.x,t.appendChild(n);var i=document.createElement("div");i.classList.add("chart-tooltip-item-number"),i.textContent=e.y,t.appendChild(i),r.appendChild(t)})),r}return r}});var n=this.model.source.getPSDEChartLegend();e.legend=n?function(e){var t={};if(e){var r;t.show=e.showLegend;var n=null===(r=e.legendPos)||void 0===r?void 0:r.toLowerCase();"left"===n||"right"===n?(t.left=n,t.top="middle",t.orient="vertical"):"bottom"===n&&(t.top=n)}return t}(n):{};var i=this.model.source.getPSChartXAxises();e.xAxis=i?function(e){var t=[];return e&&e.length&&e.forEach((function(e){var r=e.caption,n=e.minValue,i=e.maxValue,o=e.eChartsType,a=e.position,c={name:r,min:n,max:i};Object.assign(c,s({type:o,position:a},L(A(e.dataShowMode),j(e.userParams)))),t.push(c)})),t}(i):[];var o=this.model.source.getPSChartYAxises();e.yAxis=o?function(e){var t=[];return e&&e.length&&e.forEach((function(e){var r=e.caption,n=e.minValue,i=e.maxValue,o=e.eChartsType,a=e.position,c={name:r,min:n,max:i};Object.assign(c,s({type:o,position:a},L(A(e.dataShowMode),j(e.userParams)))),t.push(c)})),t}(o):[],Object.assign(this.chartStaticOption,L(e,j(this.model.source.userParams)))}},{key:"load",value:(t=o(n().mark((function e(){var t,r,i,o,a;return n().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this.startLoading();case 2:return e.prev=2,e.next=5,this.service.fetch(this.context,s(s({},this.params),this.queryParams));case 5:if(t=e.sent,r=t.data,!Array.isArray(r)||!r.length){e.next=20;break}if(this.items=r,this.chart){e.next=14;break}if(i=document.querySelector("#".concat(this.chartId))){e.next=13;break}throw new Error("未找到ECharts绘制容器元素");case 13:this.chart=O(i);case 14:return e.next=16,this.service.generateChartOption(r,this.context,this.params);case 16:o=e.sent,this.chart.setOption(s(s({},this.chartStaticOption),o)),e.next=22;break;case 20:this.items=[],null===(a=this.chart)||void 0===a||a.clear();case 22:return e.prev=22,e.next=25,this.endLoading();case 25:return e.finish(22);case 26:case"end":return e.stop()}}),e,this,[[2,,22,26]])}))),function(){return t.apply(this,arguments)})},{key:"destroy",value:function(){var e;u(g(a.prototype),"destroy",this).call(this),null===(e=this.chart)||void 0===e||e.dispose(),window.removeEventListener("resize",this.resizeChart)}}]),a}(C);e("default",i({name:"ChartControl",props:{modelData:{type:w,required:!0},context:{type:Object,required:!0},params:{type:Object,default:function(){return{}}}},setup:function(e){var t=a().proxy,r=v("chart"),n=function(e,t,r){var n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{};return f(e,(function(){return new I(t,r,n)}))}(t,e.modelData,e.context,e.params);return{c:n,ns:r}},render:function(){if(this.c.complete)return l("control-layout",{attrs:{modelData:this.c.model}},[l("div",{class:this.ns.b(),style:{width:this.c.width,height:this.c.height}},[l("div",{attrs:{id:this.c.chartId},class:this.ns.b("content")}),this.c.items.length?null:l("div",{class:this.ns.b("empty-content")},["暂无数据"])])])}}))}}}))}();