!function(){functiont(e){returnt="function"==typeofSymbol&&"symbol"==typeofSymbol.iterator?function(t){returntypeoft}:function(t){returnt&&"function"==typeofSymbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeoft},t(e)}functione(){"use strict";/*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */e=function(){returnr};varr={},n=Object.prototype,i=n.hasOwnProperty,o=Object.defineProperty||function(t,e,r){t[e]=r.value},a="function"==typeofSymbol?Symbol:{},c=a.iterator||"@@iterator",u=a.asyncIterator||"@@asyncIterator",l=a.toStringTag||"@@toStringTag";functions(t,e,r){returnObject.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}),t[e]}try{s({},"")}catch(C){s=function(t,e,r){returnt[e]=r}}functionf(t,e,r,n){vari=e&&e.prototypeinstanceofd?e:d,a=Object.create(i.prototype),c=newO(n||[]);returno(a,"_invoke",{value:A(t,r,c)}),a}functionv(t,e,r){try{return{type:"normal",arg:t.call(e,r)}}catch(C){return{type:"throw",arg:C}}}r.wrap=f;varh={};functiond(){}functionp(){}functionm(){}vary={};s(y,c,(function(){returnthis}));varg=Object.getPrototypeOf,b=g&&g(g(P([])));b&&b!==n&&i.call(b,c)&&(y=b);varw=m.prototype=d.prototype=Object.create(y);functionx(t){["next","throw","return"].forEach((function(e){s(t,e,(function(t){returnthis._invoke(e,t)}))}))}functionL(e,r){functionn(o,a,c,u){varl=v(e[o],e,a);if("throw"!==l.type){vars=l.arg,f=s.value;returnf&&"object"==t(f)&&i.call(f,"__await")?r.resolve(f.__await).then((function(t){n("next",t,c,u)}),(function(t){n("throw",t,c,u)})):r.resolve(f).then((function(t){s.value=t,c(s)}),(function(t){returnn("throw",t,c,u)}))}u(l.arg)}vara;o(this,"_invoke",{value:function(t,e){functioni(){returnnewr((function(r,i){n(t,e,r,i)}))}returna=a?a.then(i,i):i()}})}functionA(t,e,r){varn="suspendedStart";returnfunction(i,o){if("executing"===n)thrownewError("Generator is already running");if("completed"===n){if("throw"===i)throwo;returnT()}for(r.method=i,r.arg=o;;){vara=r.delegate;if(a){varc=E(a,r);if(c){if(c===h)continue;returnc}}if("next"===r.method)r.sent=r._sent=r.arg;elseif("throw"===r.method){if("suspendedStart"===n)thrown="completed",r.arg;r.dispatchException(r.arg)}else"return"===r.method&&r.abrupt("return",r.arg);n="executing";varu=v(t,e,r);if("normal"===u.type){if(n=r.done?"completed":"suspendedYield",u.arg===h)continue;return{value:u.arg,done:r.done}}"throw"===u.type&&(n="completed",r.method="throw",r.arg=u.arg)}}}functionE(t,e){varr=e.method,n=t.iterator[r];if(void0===n)returne.delegate=null,"throw"===r&&t.iterator.return&&(e.method="return",e.arg=void0,E(t,e),"throw"===e.method)||"return"!==r&&(e.method="throw",e.arg=newTypeError("The iterator does not provide a '"+r+"' method")),h;vari=v(n,t.iterator,e.arg);if("throw"===i.type)returne.method="throw",e.arg=i.arg,e.delegate=null,h;varo=i.arg;returno?o.done?(e[t.resultName]=o.value,e.next=t.nextLoc,"return"!==e.method&&(e.method="next",e.arg=void0),e.delegate=null,h):o:(e.method="throw",e.arg=newTypeError("iterator result is not an object"),e.delegate=null,h)}functionj(t){vare={tryLoc:t[0]};1int&&(e.catchLoc=t[1]),2int&&(e.finallyLoc=t[2],e.afterLoc=t[3]),this.tryEntries.push(e)}functionS(t){vare=t.completion||{};e.type="normal",deletee.arg,t.completion=e}functionO(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(j,this),this.reset(!0)}functionP(t){if(t){vare=t[c];if(e)returne.call(t);if("function"==typeoft.next)returnt;if(!isNaN(t.length)){varr=-1,n=functione(){for(;++r<t.length;)if(i.call(t,r))returne.value=t[r],e.done=!1,e;returne.value=void0,e.done=!0,e};returnn.next=n}}return{next:T}}functionT(){return{value:void0,done:!0}}returnp.prototype=m,o(w,"constructor",{value:m,configurable:!0}),o(m,"constructor",{value:p,configurable:!0}),p.displayName=s(m,l,"GeneratorFunction"),r.isGeneratorFunction=function(t){vare="function"==typeoft&&t.constructor;return!!e&&(e===p||"GeneratorFunction"===(e.displayName||e.name))},r.mark=function(t){returnObject.setPrototypeOf?Object.setPrototypeOf(t,m):(t.__proto__=m,s(t,l,"GeneratorFunction")),t.prototype=Object.create(w),t},r.awrap=function(t){return{__await:t}},x(L.prototype),s(L.prototype,u,(function(){returnthis})),r.AsyncIterator=L,r.async=function(t,e,n,i,o){void0===o&&(o=Promise);vara=newL(f(t,e,n,i),o);returnr.isGeneratorFunction(e)?a:a.next().then((function(t){returnt.done?t.value:a.next()}))},x(w),s(w,l,"Generator"),s(w,c,(function(){returnthis})),s(w,"toString",(function(){return"[object Generator]"})),r.keys=function(t){vare=Object(t),r=[];for(varnine)r.push(n);returnr.reverse(),functiont(){for(;r.length;){varn=r.pop();if(nine)returnt.value=n,t.done=!1,t}returnt.done=!0,t}},r.values=P,O.prototype={constructor:O,reset:function(t){if(this.prev=0,this.next=0,this.sent=this._sent=void0,this.done=!1,this.delegate=null,this.method="next",this.arg=void0,this.tryEntries.forEach(S),!t)for(vareinthis)"t"===e.charAt(0)&&i.call(this,e)&&!isNaN(+e.slice(1))&&(this[e]=void0)},stop:function(){this.done=!0;vart=this.tryEntries[0].completion;if("throw"===t.type)throwt.arg;returnthis.rval},dispatchException:function(t){if(this.done)throwt;vare=this;functionr(r,n){returna.type="throw",a.arg=t,e.next=r,n&&(e.method="next",e.arg=void0),!!n}for(varn=this.tryEntries.length-1;n>=0;--n){varo=this.tryEntries[n],a=o.completion;if("root"===o.tryLoc)returnr("end");if(o.tryLoc<=this.prev){varc=i.call(o,"catchLoc"),u=i.call(o,"finallyLoc");if(c&&u){if(this.prev<o.catchLoc)returnr(o.catchLoc,!0);if(this.prev<o.finallyLoc)returnr(o.finallyLoc)}elseif(c){if(this.prev<o.catchLoc)returnr(o.catchLoc,!0)}else{if(!u)thrownewError("try statement without catch or finally");if(this.prev<o.finallyLoc)returnr(o.finallyLoc)}}}},abrupt:function(t,e){for(varr=this.tryEntries.length-1;r>=0;--r){varn=this.tryEntries[r];if(n.tryLoc<=this.prev&&i.call(n,"finallyLoc")&&this.prev<n.finallyLoc){varo=n;break}}o&&("break"===t||"continue"===t)&&o.tryLoc<=e&&e<=o.finallyLoc&&(o=null);vara=o?o.completion:{};returna.type=t,a.arg=e,o?(this.method="next",this.next=o.finallyLoc,h):this.complete(a)},complete:function(t,e){if("throw"===t.type)throwt.arg;return"break"===t.type||"continue"===t.type?this.next=t.arg:"return"===t.type?(this.rval=this.arg=t.arg,this.method="return",this.next="end"):"normal"===t.type&&e&&(this.next=e),h},finish:function(t){for(vare=this.tryEntries.length-1;e>=0;--e){varr=this.tryEntries[e];if(r.finallyLoc===t)returnthis.complete(r.completion,r.afterLoc),S(r),h}},catch:function(t){for(vare=this.tryEntries.length-1;e>=0;--e){varr=this.tryEntries[e];if(r.tryLoc===t){varn=r.completion;if("throw"===n.type){vari=n.arg;S(r)}returni}}thrownewError("illegal catch attempt")},delegateYield:function(t,e,r){returnthis.delegate={iterator:P(t),resultName:e,nextLoc:r},"next"===this.method&&(this.arg=void0),h}},r}functionr(t){returnfunction(t){if(Array.isArray(t))returnn(t)}(t)||function(t){if("undefined"!=typeofSymbol&&null!=t[Symbol.iterator]||null!=t["@@iterator"])returnArray.from(t)}(t)||function(t,e){if(!t)return;if("string"==typeoft)returnn(t,e);varr=Object.prototype.toString.call(t).slice(8,-1);"Object"===r&&t.constructor&&(r=t.constructor.name);if("Map"===r||"Set"===r)returnArray.from(t);if("Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))returnn(t,e)}(t)||function(){thrownewTypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}functionn(t,e){(null==e||e>t.length)&&(e=t.length);for(varr=0,n=newArray(e);r<e;r++)n[r]=t[r];returnn}functioni(t,e,r,n,i,o,a){try{varc=t[o](a),u=c.value}catch(l){returnvoidr(l)}c.done?e(u):Promise.resolve(u).then(n,i)}functiono(e,r,n){return(r=function(e){varr=function(e,r){if("object"!==t(e)||null===e)returne;varn=e[Symbol.toPrimitive];if(void0!==n){vari=n.call(e,r||"default");if("object"!==t(i))returni;thrownewTypeError("@@toPrimitive must return a primitive value.")}return("string"===r?String:Number)(e)}(e,"string");return"symbol"===t(r)?r:String(r)}(r))ine?Object.defineProperty(e,r,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[r]=n,e}System.register(["vue","@ibiz-template/vue-util","@ibiz-template/model","ramda","./use-chart-controller.legacy.js","@ibiz-template/controller","qx-util","echarts","@ibiz-template/service"],(function(t,n){"use strict";vara,c,u,l,s,f,v,h,d;return{setters:[function(t){a=t.defineComponent,c=t.ref,u=t.h,l=t.getCurrentInstance,s=t.default},function(t){f=t.useNamespace},function(t){v=t.ChartModel},function(t){h=t.mergeDeepRight},function(t){d=t.u},null,null,null,null],execute:function(){varn=a({name:"ChartTooltip",props:{params:{type:[Object,Array],required:!0},c:{type:Object,required:!0},codeListMap:{type:Array,required:!0}},setup:function(t){vare,r=f("chart-tooltip"),n=c([]),i=c(""),o=c(),a=(null===(e=t.c.model.source.getPSControlParam())||void0===e?void0:e.ctrlParams)||{},u=a.LABEL,l=a.TEXT,s=a.LEFT,v=a.CENTER,h=a.RIGHT,d=a.PERCENTAGE,p=a.RATE,m=JSON.parse(a.LIST||"[]"),y=function(t){if(null==t)return"";try{returnibiz.util.text.format("".concat(t),"#,##0")}catch(e){returnibiz.log.error("".concat(t," 值格式化错误")),"".concat(t)}};returnfunction(){vare=t.params;if(Array.isArray(e))n.value=e.map((function(e){if(!o.value&&Array.isArray(t.c.items)&&t.c.items.length){varr,n,a=e.seriesIndex||0,c=t.c.service.seriesList[a],u=null==c||null===(r=c.catalogField)||void0===r?void0:r.toLowerCase(),l=e.name||"",s=null===(n=t.codeListMap[a])||void0===n?void0:n.catalog;u&&l&&(o.value=t.c.items.find((function(t){returns&&s.get(t[u])?s.get(t[u])===l:t[u]===l})))}i.value=e.name||"";varf=Array.isArray(e.value)?e.value[1]:e.value;return{text:e.seriesName,value:y(f),color:e.color}})),Array.isArray(m)&&m.length&&(n.value=m.map((function(t){vare,r,n=null===(e=o.value)||void0===e?void0:e[t.value];return{color:t.color,text:t.text,value:y(n),rate:null===(r=o.value)||void0===r?void0:r[t.rate]}})));elseif(e){varr,a,c,u,f,g=e;if(Array.isArray(t.c.items)&&t.c.items.length){varb,w,x,L=g.seriesIndex||0,A=t.c.service.seriesList[L],E=null==A||null===(b=A.catalogField)||void0===b?void0:b.toLowerCase(),j=null==A||null===(w=A.valueField)||void0===w?void0:w.toLowerCase();if("radar"===g.seriesType)returnn.value=t.c.items.map((function(t){return{text:t[E],value:y(t[j]),color:g.color,left:s,center:t[v],right:h}})),void(o.value={});varS=g.name||"",O=null===(x=t.codeListMap[L])||void0===x?void0:x.catalog;E&&S&&(o.value=t.c.items.find((function(t){returnO&&O.get(t[E])?O.get(t[E])===S:t[E]===S})))}varP=Array.isArray(g.value)?null===(r=g.value)||void0===r?void0:r[1]:g.value;n.value=[{text:(null===(a=o.value)||void0===a?void0:a[l])||e.name,value:y(P),color:g.color,left:s,center:null===(c=o.value)||void0===c?void0:c[v],right:h,percentage:null===(u=o.value)||void0===u?void0:u[d],rate:null===(f=o.value)||void0===f?void0:f[p]}]}}(),{ns:r,title:i,items:n,curData:o,label:u}},render:function(){vart=this;if(this.curData)returnu("div",{class:this.ns.b()},[this.label&&this.curData[this.label]&&u("div",{class:this.ns.b("header")},[this.curData[this.label]]),!(this.label&&this.curData[this.label])&&this.title&&u("div",{class:this.ns.b("header")},[this.title]),u("div",{class:this.ns.b("content")},[u("div",{class:this.ns.b("item-icon")},[this.items.map((function(e){returnu("div",{class:t.ns.b("item")},[e.color&&u("div",{class:t.ns.be("item","icon"),style:{background:e.color}})])}))]),u("div",{class:this.ns.b("item-text")},[this.items.map((function(e){returnu("div",{class:t.ns.b("item")},[e.text&&u("div",{class:t.ns.be("item","text")},[e.text])])}))]),u("div",{class:this.ns.b("item-value")},[this.items.map((function(e){returnu("div",{class:t.ns.b("item")},[null!=e.value&&u("div",{class:t.ns.be("item","value")},[e.value])])}))]),u("div",{class:this.ns.b("item-center")},[this.items.map((function(e){returnu("div",{class:t.ns.b("item")},[e.left&&u("div",{class:t.ns.be("item","left")},[e.left]),null!=e.center&&u("div",{class:t.ns.be("item","center")},[e.center]),e.right&&u("div",{class:t.ns.be("item","right")},[e.right])])}))]),u("div",{class:this.ns.b("item-percentage")},[this.items.map((function(e){returnu("div",{class:t.ns.b("item")},[e.percentage&&u("div",{class:t.ns.be("item","percentage")},[e.percentage])])}))]),u("div",{class:this.ns.b("item-rate")},[this.items.map((function(e){returnu("div",{class:t.ns.b("item")},[e.rate&&u("div",{class:t.ns.be("item","rate")},[u("rate-span",{attrs:{value:e.rate}})])])}))])])])}});t("default",a({name:"GwxnChartControl",props:{modelData:{type:v,required:!0},context:{type:Object,required:!0},params:{type:Object,default:function(){return{}}}},setup:function(t){vara,c=l().proxy,u=f("chart"),v=d(c,t.modelData,t.context,t.params),p=(null===(a=v.model.source.getPSControlParam())||void0===a?void0:a.ctrlParams)||{},m=p.TYPE,y=p.TOTAL,g=!0;v.registerLoadHook((function(t){returnArray.isArray(t)&&y&&0===t.length&&(t.push(o({},y,100)),g=!1),t}));varb=function(){vart,o=(t=e().mark((functiont(i){varo,a,c,u,l,f,d,b,w,x,L,A,E,j,S;returne().wrap((function(t){for(;;)switch(t.prev=t.next){case0:if(!(o=i.tooltip)){t.next=6;break}returnt.next=4,v.service.getAllCodeListMap(v.context,v.params);case4:a=t.sent,o.formatter=function(t){vare=document.createElement("div"),r=news({el:e,render:function(e){returne(n,{props:{params:t,ctrlParams:p,c:v,codeListMap:a}})}});returnr.$el};case6:if("line"===m&&(c=i.xAxis,Array.isArray(c)&&c.length&&c.forEach((function(t){t.max=function(t){returnt.max+1}}))),u=i.series,Array.isArray(u)){t.next=10;break}returnt.abrupt("return",i);case10:return"custom"===m&&(-1!==(l=u.findIndex((function(t){return"pie"===t.type})))&&(b=!0,w=v.service.seriesList,(x=null===(f=w[l])||void0===f||null===(d=f.valueField)||void0===d?void0:d.toLowerCase())&&v.items.every((function(t){return!t[x]}))&&(u.splice(l,1),b=!1),b&&(u[l]=h(u[l],{emphasis:{label:{formatter:function(t){vare,r=null===(e=t.value[0])||void0===e?void0:e.replace("~","-"),n=t.value[1];return"{value|".concat(n,"}\n{key|").concat(r,"}")}}}}))),-1!==(L=u.findIndex((function(t){return"gauge"===t.type})))&&(u[L]=h(u[L],{axisLabel:{formatter:function(t){return24===t||t%2==1?"":"".concat(t)}}}))),"radar"===m&&(A=i.radar,E=u.find((function(t){return"radar"===t.type})),A&&!Array.isArray(A)&&Array.isArray(A.indicator)&&E&&Array.isArray(E.data)&&E.data.length&&(A.indicator=[].concat(r(A.indicator.slice(0,1)),r(A.indicator.slice(1).reverse())),E.data[0]=[].concat(r(E.data[0].slice(0,1)),r(E.data[0].slice(1).reverse())))),y&&(j=i.graphic,Array.isArray(j)&&j.length&&g&&(S=v.items.reduce((function(t,e){returnt+e[y]}),0),j[0]=h(j[0],{style:{text:S}})),g||i.tooltip&&Object.assign(i.tooltip,{show:!1})),t.abrupt("return",i);case14:case"end":returnt.stop()}}),t)})),function(){vare=this,r=arguments;returnnewPromise((function(n,o){vara=t.apply(e,r);functionc(t){i(a,n,o,c,u,"next",t)}functionu(t){i(a,n,o,c,u,"throw",t)}c(void0)}))});returnfunction(t){returno.apply(this,arguments)}}();returnv.registerHook(b),{c:v,ns:u}},render:function(){if(this.c.complete)returnu("control-layout",{attrs:{modelData:this.c.model}},[u("div",{class:this.ns.b(),style:{width:this.c.width,height:this.c.height}},[u("div",{attrs:{id:this.c.chartId},class:this.ns.b("content")}),this.c.items.length?null:u("div",{class:this.ns.b("empty-content")},["暂无数据"])])])}}))}}}))}();
!function(){functiont(e){returnt="function"==typeofSymbol&&"symbol"==typeofSymbol.iterator?function(t){returntypeoft}:function(t){returnt&&"function"==typeofSymbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeoft},t(e)}functione(){"use strict";/*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */e=function(){returnr};varr={},n=Object.prototype,i=n.hasOwnProperty,o=Object.defineProperty||function(t,e,r){t[e]=r.value},a="function"==typeofSymbol?Symbol:{},c=a.iterator||"@@iterator",u=a.asyncIterator||"@@asyncIterator",l=a.toStringTag||"@@toStringTag";functions(t,e,r){returnObject.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}),t[e]}try{s({},"")}catch(C){s=function(t,e,r){returnt[e]=r}}functionf(t,e,r,n){vari=e&&e.prototypeinstanceofd?e:d,a=Object.create(i.prototype),c=newO(n||[]);returno(a,"_invoke",{value:A(t,r,c)}),a}functionv(t,e,r){try{return{type:"normal",arg:t.call(e,r)}}catch(C){return{type:"throw",arg:C}}}r.wrap=f;varh={};functiond(){}functionp(){}functionm(){}vary={};s(y,c,(function(){returnthis}));varg=Object.getPrototypeOf,b=g&&g(g(P([])));b&&b!==n&&i.call(b,c)&&(y=b);varw=m.prototype=d.prototype=Object.create(y);functionx(t){["next","throw","return"].forEach((function(e){s(t,e,(function(t){returnthis._invoke(e,t)}))}))}functionL(e,r){functionn(o,a,c,u){varl=v(e[o],e,a);if("throw"!==l.type){vars=l.arg,f=s.value;returnf&&"object"==t(f)&&i.call(f,"__await")?r.resolve(f.__await).then((function(t){n("next",t,c,u)}),(function(t){n("throw",t,c,u)})):r.resolve(f).then((function(t){s.value=t,c(s)}),(function(t){returnn("throw",t,c,u)}))}u(l.arg)}vara;o(this,"_invoke",{value:function(t,e){functioni(){returnnewr((function(r,i){n(t,e,r,i)}))}returna=a?a.then(i,i):i()}})}functionA(t,e,r){varn="suspendedStart";returnfunction(i,o){if("executing"===n)thrownewError("Generator is already running");if("completed"===n){if("throw"===i)throwo;returnT()}for(r.method=i,r.arg=o;;){vara=r.delegate;if(a){varc=E(a,r);if(c){if(c===h)continue;returnc}}if("next"===r.method)r.sent=r._sent=r.arg;elseif("throw"===r.method){if("suspendedStart"===n)thrown="completed",r.arg;r.dispatchException(r.arg)}else"return"===r.method&&r.abrupt("return",r.arg);n="executing";varu=v(t,e,r);if("normal"===u.type){if(n=r.done?"completed":"suspendedYield",u.arg===h)continue;return{value:u.arg,done:r.done}}"throw"===u.type&&(n="completed",r.method="throw",r.arg=u.arg)}}}functionE(t,e){varr=e.method,n=t.iterator[r];if(void0===n)returne.delegate=null,"throw"===r&&t.iterator.return&&(e.method="return",e.arg=void0,E(t,e),"throw"===e.method)||"return"!==r&&(e.method="throw",e.arg=newTypeError("The iterator does not provide a '"+r+"' method")),h;vari=v(n,t.iterator,e.arg);if("throw"===i.type)returne.method="throw",e.arg=i.arg,e.delegate=null,h;varo=i.arg;returno?o.done?(e[t.resultName]=o.value,e.next=t.nextLoc,"return"!==e.method&&(e.method="next",e.arg=void0),e.delegate=null,h):o:(e.method="throw",e.arg=newTypeError("iterator result is not an object"),e.delegate=null,h)}functionj(t){vare={tryLoc:t[0]};1int&&(e.catchLoc=t[1]),2int&&(e.finallyLoc=t[2],e.afterLoc=t[3]),this.tryEntries.push(e)}functionS(t){vare=t.completion||{};e.type="normal",deletee.arg,t.completion=e}functionO(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(j,this),this.reset(!0)}functionP(t){if(t){vare=t[c];if(e)returne.call(t);if("function"==typeoft.next)returnt;if(!isNaN(t.length)){varr=-1,n=functione(){for(;++r<t.length;)if(i.call(t,r))returne.value=t[r],e.done=!1,e;returne.value=void0,e.done=!0,e};returnn.next=n}}return{next:T}}functionT(){return{value:void0,done:!0}}returnp.prototype=m,o(w,"constructor",{value:m,configurable:!0}),o(m,"constructor",{value:p,configurable:!0}),p.displayName=s(m,l,"GeneratorFunction"),r.isGeneratorFunction=function(t){vare="function"==typeoft&&t.constructor;return!!e&&(e===p||"GeneratorFunction"===(e.displayName||e.name))},r.mark=function(t){returnObject.setPrototypeOf?Object.setPrototypeOf(t,m):(t.__proto__=m,s(t,l,"GeneratorFunction")),t.prototype=Object.create(w),t},r.awrap=function(t){return{__await:t}},x(L.prototype),s(L.prototype,u,(function(){returnthis})),r.AsyncIterator=L,r.async=function(t,e,n,i,o){void0===o&&(o=Promise);vara=newL(f(t,e,n,i),o);returnr.isGeneratorFunction(e)?a:a.next().then((function(t){returnt.done?t.value:a.next()}))},x(w),s(w,l,"Generator"),s(w,c,(function(){returnthis})),s(w,"toString",(function(){return"[object Generator]"})),r.keys=function(t){vare=Object(t),r=[];for(varnine)r.push(n);returnr.reverse(),functiont(){for(;r.length;){varn=r.pop();if(nine)returnt.value=n,t.done=!1,t}returnt.done=!0,t}},r.values=P,O.prototype={constructor:O,reset:function(t){if(this.prev=0,this.next=0,this.sent=this._sent=void0,this.done=!1,this.delegate=null,this.method="next",this.arg=void0,this.tryEntries.forEach(S),!t)for(vareinthis)"t"===e.charAt(0)&&i.call(this,e)&&!isNaN(+e.slice(1))&&(this[e]=void0)},stop:function(){this.done=!0;vart=this.tryEntries[0].completion;if("throw"===t.type)throwt.arg;returnthis.rval},dispatchException:function(t){if(this.done)throwt;vare=this;functionr(r,n){returna.type="throw",a.arg=t,e.next=r,n&&(e.method="next",e.arg=void0),!!n}for(varn=this.tryEntries.length-1;n>=0;--n){varo=this.tryEntries[n],a=o.completion;if("root"===o.tryLoc)returnr("end");if(o.tryLoc<=this.prev){varc=i.call(o,"catchLoc"),u=i.call(o,"finallyLoc");if(c&&u){if(this.prev<o.catchLoc)returnr(o.catchLoc,!0);if(this.prev<o.finallyLoc)returnr(o.finallyLoc)}elseif(c){if(this.prev<o.catchLoc)returnr(o.catchLoc,!0)}else{if(!u)thrownewError("try statement without catch or finally");if(this.prev<o.finallyLoc)returnr(o.finallyLoc)}}}},abrupt:function(t,e){for(varr=this.tryEntries.length-1;r>=0;--r){varn=this.tryEntries[r];if(n.tryLoc<=this.prev&&i.call(n,"finallyLoc")&&this.prev<n.finallyLoc){varo=n;break}}o&&("break"===t||"continue"===t)&&o.tryLoc<=e&&e<=o.finallyLoc&&(o=null);vara=o?o.completion:{};returna.type=t,a.arg=e,o?(this.method="next",this.next=o.finallyLoc,h):this.complete(a)},complete:function(t,e){if("throw"===t.type)throwt.arg;return"break"===t.type||"continue"===t.type?this.next=t.arg:"return"===t.type?(this.rval=this.arg=t.arg,this.method="return",this.next="end"):"normal"===t.type&&e&&(this.next=e),h},finish:function(t){for(vare=this.tryEntries.length-1;e>=0;--e){varr=this.tryEntries[e];if(r.finallyLoc===t)returnthis.complete(r.completion,r.afterLoc),S(r),h}},catch:function(t){for(vare=this.tryEntries.length-1;e>=0;--e){varr=this.tryEntries[e];if(r.tryLoc===t){varn=r.completion;if("throw"===n.type){vari=n.arg;S(r)}returni}}thrownewError("illegal catch attempt")},delegateYield:function(t,e,r){returnthis.delegate={iterator:P(t),resultName:e,nextLoc:r},"next"===this.method&&(this.arg=void0),h}},r}functionr(t){returnfunction(t){if(Array.isArray(t))returnn(t)}(t)||function(t){if("undefined"!=typeofSymbol&&null!=t[Symbol.iterator]||null!=t["@@iterator"])returnArray.from(t)}(t)||function(t,e){if(!t)return;if("string"==typeoft)returnn(t,e);varr=Object.prototype.toString.call(t).slice(8,-1);"Object"===r&&t.constructor&&(r=t.constructor.name);if("Map"===r||"Set"===r)returnArray.from(t);if("Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))returnn(t,e)}(t)||function(){thrownewTypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}functionn(t,e){(null==e||e>t.length)&&(e=t.length);for(varr=0,n=newArray(e);r<e;r++)n[r]=t[r];returnn}functioni(t,e,r,n,i,o,a){try{varc=t[o](a),u=c.value}catch(l){returnvoidr(l)}c.done?e(u):Promise.resolve(u).then(n,i)}functiono(e,r,n){return(r=function(e){varr=function(e,r){if("object"!==t(e)||null===e)returne;varn=e[Symbol.toPrimitive];if(void0!==n){vari=n.call(e,r||"default");if("object"!==t(i))returni;thrownewTypeError("@@toPrimitive must return a primitive value.")}return("string"===r?String:Number)(e)}(e,"string");return"symbol"===t(r)?r:String(r)}(r))ine?Object.defineProperty(e,r,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[r]=n,e}System.register(["vue","@ibiz-template/vue-util","@ibiz-template/model","ramda","./use-chart-controller.legacy.js","@ibiz-template/controller","qx-util","echarts","@ibiz-template/service"],(function(t,n){"use strict";vara,c,u,l,s,f,v,h,d;return{setters:[function(t){a=t.defineComponent,c=t.ref,u=t.h,l=t.getCurrentInstance,s=t.default},function(t){f=t.useNamespace},function(t){v=t.ChartModel},function(t){h=t.mergeDeepRight},function(t){d=t.u},null,null,null,null],execute:function(){varn=a({name:"ChartTooltip",props:{params:{type:[Object,Array],required:!0},c:{type:Object,required:!0},codeListMap:{type:Array,required:!0}},setup:function(t){vare,r=f("chart-tooltip"),n=c([]),i=c(""),o=c(),a=(null===(e=t.c.model.source.getPSControlParam())||void0===e?void0:e.ctrlParams)||{},u=a.LABEL,l=a.TEXT,s=a.LEFT,v=a.CENTER,h=a.RIGHT,d=a.PERCENTAGE,p=a.RATE,m=JSON.parse(a.LIST||"[]"),y=function(t){if(null==t)return"";try{returnibiz.util.text.format("".concat(t),"#,##0.##")}catch(e){returnibiz.log.error("".concat(t," 值格式化错误")),"".concat(t)}};returnfunction(){vare=t.params;if(Array.isArray(e))n.value=e.map((function(e){if(!o.value&&Array.isArray(t.c.items)&&t.c.items.length){varr,n,a=e.seriesIndex||0,c=t.c.service.seriesList[a],u=null==c||null===(r=c.catalogField)||void0===r?void0:r.toLowerCase(),l=e.name||"",s=null===(n=t.codeListMap[a])||void0===n?void0:n.catalog;u&&l&&(o.value=t.c.items.find((function(t){returns&&s.get(t[u])?s.get(t[u])===l:t[u]===l})))}i.value=e.name||"";varf=Array.isArray(e.value)?e.value[1]:e.value;return{text:e.seriesName,value:y(f),color:e.color}})),Array.isArray(m)&&m.length&&(n.value=m.map((function(t){vare,r,n=null===(e=o.value)||void0===e?void0:e[t.value];return{color:t.color,text:t.text,value:y(n),rate:null===(r=o.value)||void0===r?void0:r[t.rate]}})));elseif(e){varr,a,c,u,f,g=e;if(Array.isArray(t.c.items)&&t.c.items.length){varb,w,x,L=g.seriesIndex||0,A=t.c.service.seriesList[L],E=null==A||null===(b=A.catalogField)||void0===b?void0:b.toLowerCase(),j=null==A||null===(w=A.valueField)||void0===w?void0:w.toLowerCase();if("radar"===g.seriesType)returnn.value=t.c.items.map((function(t){return{text:t[E],value:y(t[j]),color:g.color,left:s,center:t[v],right:h}})),void(o.value={});varS=g.name||"",O=null===(x=t.codeListMap[L])||void0===x?void0:x.catalog;E&&S&&(o.value=t.c.items.find((function(t){returnO&&O.get(t[E])?O.get(t[E])===S:t[E]===S})))}varP=Array.isArray(g.value)?null===(r=g.value)||void0===r?void0:r[1]:g.value;n.value=[{text:(null===(a=o.value)||void0===a?void0:a[l])||e.name,value:y(P),color:g.color,left:s,center:null===(c=o.value)||void0===c?void0:c[v],right:h,percentage:null===(u=o.value)||void0===u?void0:u[d],rate:null===(f=o.value)||void0===f?void0:f[p]}]}}(),{ns:r,title:i,items:n,curData:o,label:u}},render:function(){vart=this;if(this.curData)returnu("div",{class:this.ns.b()},[this.label&&this.curData[this.label]&&u("div",{class:this.ns.b("header")},[this.curData[this.label]]),!(this.label&&this.curData[this.label])&&this.title&&u("div",{class:this.ns.b("header")},[this.title]),u("div",{class:this.ns.b("content")},[u("div",{class:this.ns.b("item-icon")},[this.items.map((function(e){returnu("div",{class:t.ns.b("item")},[e.color&&u("div",{class:t.ns.be("item","icon"),style:{background:e.color}})])}))]),u("div",{class:this.ns.b("item-text")},[this.items.map((function(e){returnu("div",{class:t.ns.b("item")},[e.text&&u("div",{class:t.ns.be("item","text")},[e.text])])}))]),u("div",{class:this.ns.b("item-value")},[this.items.map((function(e){returnu("div",{class:t.ns.b("item")},[null!=e.value&&u("div",{class:t.ns.be("item","value")},[e.value])])}))]),u("div",{class:this.ns.b("item-center")},[this.items.map((function(e){returnu("div",{class:t.ns.b("item")},[e.left&&u("div",{class:t.ns.be("item","left")},[e.left]),null!=e.center&&u("div",{class:t.ns.be("item","center")},[e.center]),e.right&&u("div",{class:t.ns.be("item","right")},[e.right])])}))]),u("div",{class:this.ns.b("item-percentage")},[this.items.map((function(e){returnu("div",{class:t.ns.b("item")},[e.percentage&&u("div",{class:t.ns.be("item","percentage")},[e.percentage])])}))]),u("div",{class:this.ns.b("item-rate")},[this.items.map((function(e){returnu("div",{class:t.ns.b("item")},[e.rate&&u("div",{class:t.ns.be("item","rate")},[u("rate-span",{attrs:{value:e.rate}})])])}))])])])}});t("default",a({name:"GwxnChartControl",props:{modelData:{type:v,required:!0},context:{type:Object,required:!0},params:{type:Object,default:function(){return{}}}},setup:function(t){vara,c=l().proxy,u=f("chart"),v=d(c,t.modelData,t.context,t.params),p=(null===(a=v.model.source.getPSControlParam())||void0===a?void0:a.ctrlParams)||{},m=p.TYPE,y=p.TOTAL,g=!0;v.registerLoadHook((function(t){returnArray.isArray(t)&&y&&0===t.length&&(t.push(o({},y,100)),g=!1),t}));varb=function(){vart,o=(t=e().mark((functiont(i){varo,a,c,u,l,f,d,b,w,x,L,A,E,j,S;returne().wrap((function(t){for(;;)switch(t.prev=t.next){case0:if(!(o=i.tooltip)){t.next=6;break}returnt.next=4,v.service.getAllCodeListMap(v.context,v.params);case4:a=t.sent,o.formatter=function(t){vare=document.createElement("div"),r=news({el:e,render:function(e){returne(n,{props:{params:t,ctrlParams:p,c:v,codeListMap:a}})}});returnr.$el};case6:if("line"===m&&(c=i.xAxis,Array.isArray(c)&&c.length&&c.forEach((function(t){t.max=function(t){returnt.max+1}}))),u=i.series,Array.isArray(u)){t.next=10;break}returnt.abrupt("return",i);case10:return"custom"===m&&(-1!==(l=u.findIndex((function(t){return"pie"===t.type})))&&(b=!0,w=v.service.seriesList,(x=null===(f=w[l])||void0===f||null===(d=f.valueField)||void0===d?void0:d.toLowerCase())&&v.items.every((function(t){return!t[x]}))&&(u.splice(l,1),b=!1),b&&(u[l]=h(u[l],{emphasis:{label:{formatter:function(t){vare,r=null===(e=t.value[0])||void0===e?void0:e.replace("~","-"),n=t.value[1];return"{value|".concat(n,"}\n{key|").concat(r,"}")}}}}))),-1!==(L=u.findIndex((function(t){return"gauge"===t.type})))&&(u[L]=h(u[L],{axisLabel:{formatter:function(t){return24===t||t%2==1?"":"".concat(t)}}}))),"radar"===m&&(A=i.radar,E=u.find((function(t){return"radar"===t.type})),A&&!Array.isArray(A)&&Array.isArray(A.indicator)&&E&&Array.isArray(E.data)&&E.data.length&&(A.indicator=[].concat(r(A.indicator.slice(0,1)),r(A.indicator.slice(1).reverse())),E.data[0]=[].concat(r(E.data[0].slice(0,1)),r(E.data[0].slice(1).reverse())))),y&&(j=i.graphic,Array.isArray(j)&&j.length&&g&&(S=v.items.reduce((function(t,e){returnt+e[y]}),0),j[0]=h(j[0],{style:{text:S}})),g||i.tooltip&&Object.assign(i.tooltip,{show:!1})),t.abrupt("return",i);case14:case"end":returnt.stop()}}),t)})),function(){vare=this,r=arguments;returnnewPromise((function(n,o){vara=t.apply(e,r);functionc(t){i(a,n,o,c,u,"next",t)}functionu(t){i(a,n,o,c,u,"throw",t)}c(void0)}))});returnfunction(t){returno.apply(this,arguments)}}();returnv.registerHook(b),{c:v,ns:u}},render:function(){if(this.c.complete)returnu("control-layout",{attrs:{modelData:this.c.model}},[u("div",{class:this.ns.b(),style:{width:this.c.width,height:this.c.height}},[u("div",{attrs:{id:this.c.chartId},class:this.ns.b("content")}),this.c.items.length?null:u("div",{class:this.ns.b("empty-content")},["暂无数据"])])])}}))}}}))}();