@ecan-bi/indicator-library 1.0.99 → 1.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/assets/editor.worker-02df2e61.js +1 -1
- package/dist/assets/json.worker-867823a6.js +1 -1
- package/dist/assets/ts.worker-7254b425.js +1 -1
- package/dist/index.es.js +34 -9
- package/dist/index.es.js.map +1 -1
- package/dist/index.umd.js +2 -2
- package/dist/index.umd.js.map +1 -1
- package/dist/style.css +2 -2
- package/package.json +1 -1
package/dist/index.umd.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/*! @ecan-bi/indicator-library@1.0
|
|
1
|
+
/*! @ecan-bi/indicator-library@1.1.0 */
|
|
2
2
|
(function(he,e){typeof exports=="object"&&typeof module<"u"?e(exports,require("vue"),require("lodash-es"),require("ant-design-vue"),require("vuedraggable"),require("dayjs"),require("ant-design-vue/es/popover/style"),require("ant-design-vue/es/dropdown/style"),require("ant-design-vue/es/table/style"),require("monaco-editor"),require("ant-design-vue/es/collapse/style"),require("echarts")):typeof define=="function"&&define.amd?define(["exports","vue","lodash-es","ant-design-vue","vuedraggable","dayjs","ant-design-vue/es/popover/style","ant-design-vue/es/dropdown/style","ant-design-vue/es/table/style","monaco-editor","ant-design-vue/es/collapse/style","echarts"],e):(he=typeof globalThis<"u"?globalThis:he||self,e(he["@ecan-bi/indicator-library"]={},he.Vue,he.LodashEs,he.AntDesignVue,he.Draggable,he.Dayjs,null,null,null,he.MonacoEditor,null,he.Echarts))})(this,function(he,e,ee,j,Et,be,Ty,Ny,Ay,Zr,Ey,ei){var Jr;"use strict";function ti(t){const o=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(t){for(const n in t)if(n!=="default"){const a=Object.getOwnPropertyDescriptor(t,n);Object.defineProperty(o,n,a.get?a:{enumerable:!0,get:()=>t[n]})}}return o.default=t,Object.freeze(o)}const oi=ti(ei),da=(t,o)=>{if(t.install=n=>{for(const a of[t,...Object.values(o??{})])n.component(a.name,a)},o)for(const[n,a]of Object.entries(o))t[n]=a;return t},Be="$request",Se=((Jr=window==null?void 0:window.config)==null?void 0:Jr.indicatorURL)||"",Ve="INDICATOR_TOKEN",pa="DATA_LIST",ve="SELECTED_COMPONENT",ge="GRAPHIC_CONFIG",Ae="UPDATE_GRAPHIC_CONFIG",ua="SHOW_STYLE_CONFIG",fa="REFRESH_DATA",wo="CHARTS_OPTIONS",ma="TABLE_OPTIONS",ni=18,Ko="UPDATE_CHARTS_OPTIONS",Xo="UPDATE_TABLE_OPTIONS",Kt="SOURCE_TYPE",ko="CHANGE_CONDITION",ha="DATA_VIEW_COLUMNS",ze="RENDER_USED_COMPONENTS",xo="UPDATE_USED_COMPONENT",ba="UPDATE_COMPONENTS_CONFIG",ya="MAP_ATTRIBUTE_PROPS",ga="PAGE_CONFIG",Qo="IS_PIVOT_TABLE",Ca="IS_IFRAME_MODE",Jo={bar:{name:"柱状图",type:"bar",width:"400px",height:"400px",xAxisLabelFormatter:"{value}",yAxisLabelFormatter:"{value}",yAxisLineAlwaysDisplay:!1,titleText:"",titleSubtext:"",titleFontSize:"12px",titleColor:"#333",fontWeight:400,textAlign:"left",colors:["#5470c6","#91cc75","#fac858","#ee6666","#73c0de","#3ba272","#fc8452","#9a60b4","#ea7ccc"],legendShow:!0,legendTextStyleColor:"#333",legendOrient:"horizontal",legendTop:"top",legendLeft:"center",tooltipShow:!0,tooltipTextStyleColor:"",tooltipFormatter:"{marker} {a} {c}",xAxisSplitLineShow:!0,xAxisSplitLineInterval:0,xAxisSplitAreaShow:!1,xAxisSplitLineStyleColor:"#333",xAxisLabelInterval:0,xAxisLabelColor:"#333",xAxisLabelWidth:void 0,xAxisLabelRotate:0,xAxisLabelOverflow:"none",xAxisLineShow:!0,xAxisLineStyleColor:"#333",xAxisTickShow:!0,xAxisMinInterval:0,yAxisMinInterval:0,yAxisLabelWidth:void 0,yAxisLabelRotate:0,yAxisLabelOverflow:"none",yAxisSplitLineShow:!0,yAxisSplitAreaShow:!1,yAxisSplitLineStyleColor:"#333",yAxisLabelColor:"#333",yAxisLineStyleColor:"#333",valueTypeDataFieldNames:{name:"name",value:"value",type:"type"},keyTypeDataFieldNames:{name:"name",types:[]},dataFieldConfigType:"value",barWidth:"40%",gridContainLabel:!0,gridTop:"10%",gridBottom:"10%",gridLeft:"5%",gridRight:"5%",graphicConfig:{},toolboxShow:!1,toolboxOrient:"horizontal",toolboxItemSize:16,toolboxItemGap:8,toolboxLeft:"right",toolboxTop:"top",toolboxIconStyleBorderColor:"#666",toolboxDownloadUrl:"",toolboxInfoText:"当前无说明信息",isUseHorizontalAxis:!1,axisInverse:!1,xAxisInverse:!1,yAxisInverse:!1,isStack:!1,stackColumns:[],labelShow:!1,labelFontSize:"12px",labelPosition:"inside",labelColor:"",labelWidth:100,labelOverflow:"none",labelFormatter:"{c}",toolboxLocation:!1,toolboxDownloadShow:!0,toolboxDataZoomShow:!0,toolboxInfoShow:!0,gradientShow:!1,gradientColors:["#5470c6","#91cc75","#fac858","#ee6666","#73c0de","#3ba272","#fc8452","#9a60b4","#ea7ccc"],gradientOffset:1,barBorderRadius:"",yAxisLabelShow:!0,yAxisSplitLineType:"solid",xAxisSplitLineType:"solid",legendItemGap:10,legendItemWidth:25,legendItemHeight:14,showBarBackground:!1,legendType:"",legendFontSize:"12px",xAxisLabelFontSize:"12px",yAxisLabelFontSize:"12px",graphicType:"ecanBar",tooltipPosition:"",isShowMarkLine:!1,markLineType:"average",legendFormatter:"{name}",legendWidth:null,legendHeight:null,legendTextWidth:null,legendScroll:!1,yAxisName:"",xAxisName:"",defaultRangeValue:!1,startValue:"",endValue:"",xAxisMaxValue:null,yAxisMaxValue:null,colorsType:"默认"},line:{name:"折线图",type:"line",width:"400px",height:"400px",colors:["#FFBF53","#04B1C2","#F07474","#C55784","#9A5FB3","#CF62D7","#5E78EA","#51B3F0","#69D4DC","#49B788","#9CCC66","#C18C00"],colorsType:"默认",legendShow:!0,legendOrient:"horizontal",legendTop:"top",legendLeft:"center",legendCustomPosition:!1,legendTextStyleColor:"#333",legendTextStyleFontSize:"12px",legendTextItemGap:10,legendTopPadding:10,legendBottomPadding:10,legendLeftPadding:10,legendRightPadding:10,titleText:"",titleSubtext:"",symbolSize:4,lineStyleWidth:2,smooth:!1,xAxisName:"",xAxisType:"category",xAxisShow:!0,xAxisLabelWidth:void 0,xAxisLabelRotate:0,xAxisLabelOverflow:"none",xAxisLabelInterval:0,xAxisSplitLineShow:!0,xAxisSplitLineStyleColor:"#333",xAxisLabelColor:"#333",xAxisLineStyleColor:"#333",xAxisTickShow:!0,xAxisLabelFormatter:"{value}",xAxisMinInterval:0,yAxisName:"",yAxisMinInterval:0,yAxisSplitLineShow:!0,yAxisSplitLineStyleColor:"#333",yAxisLabelColor:"#333",yAxisLineStyleColor:"#333",yAxisLineAlwaysDisplay:!1,yAxisLabelShow:!0,yAxisLabelFormatter:"{value}",yAxisSplitLineType:"solid",xAxisSplitLineType:"solid",gridContainLabel:!0,gridTop:"10%",gridBottom:"10%",gridLeft:"5%",gridRight:"5%",tooltipShow:!0,tooltipTextStyleColor:"",tooltipFormatter:"{marker} {a} {c}",tooltipBorderColor:"#333",tooltipBackgroundColor:"#fff",toolboxShow:!1,toolboxDownloadShow:!0,toolboxDataZoomShow:!0,toolboxInfoShow:!0,toolboxOrient:"horizontal",toolboxItemSize:16,toolboxItemGap:8,toolboxLeft:"right",toolboxTop:"top",toolboxIconStyleBorderColor:"#666",toolboxDownloadUrl:"",toolboxInfoText:"当前无说明信息",areaStyleOpacity:0,titleFontSize:"12px",titleColor:"#333",fontWeight:400,textAlign:"left",titleLeft:"",xAxisSplitAreaShow:!1,xAxisSplitLineInterval:0,xAxisLineShow:!0,yAxisSplitAreaShow:!1,valueTypeDataFieldNames:{name:"name",value:"value",type:"type"},keyTypeDataFieldNames:{name:"name",types:[]},dataFieldConfigType:"value",graphicConfig:{},areaGradientShow:!1,areaGradientColor:"",isBoundaryGap:!0,legendItemGap:10,legendItemWidth:25,legendItemHeight:14,legendType:"",shadowColor:"",shadowBlur:0,shadowOffsetY:0,shadowOffsetX:0,legendFontSize:"12px",xAxisLabelFontSize:"12px",yAxisLabelFontSize:"12px",graphicType:"ecanLine",tooltipPosition:"",isShowMarkLine:!1,markLineType:"average",legendFormatter:"{name}",legendWidth:null,legendHeight:null,legendTextWidth:null,legendScroll:!1,xAxisMaxValue:null,yAxisMaxValue:null},pie:{name:"饼图",type:"pie",width:"400px",height:"400px",titleText:"",titleSubtext:"",colors:["#FFBF53","#04B1C2","#F07474","#C55784","#9A5FB3","#CF62D7","#5E78EA","#51B3F0","#69D4DC","#49B788","#9CCC66","#C18C00"],colorsType:"默认",backgroundColor:"",toolboxDownloadShow:!0,toolboxDataZoomShow:!0,toolboxInfoShow:!0,tooltipShow:!0,tooltipTextStyleColor:"",tooltipTrigger:"item",tooltipFormatter:"{marker} {b} {c} ({d}%)",tooltipBorderColor:"#333",tooltipBackgroundColor:"#fff",legendShow:!0,legendTextStyleColor:"#333",legendOrient:"vertical",legendTop:"top",legendLeft:"left",innerRadius:"0%",outerRadius:"60%",centerLeft:"50%",centerTop:"50%",minAngle:0,labelShow:!0,labelColor:"#333",isUseLabelColors:!1,labelFontSize:12,labelPosition:"outside",labelFormatter:"{b}\\n{d}%",labelLineShow:!0,labelLineLength:10,labelLineLength2:15,roseType:"",gridContainLabel:!0,gridTop:"10%",gridBottom:"10%",gridLeft:"5%",gridRight:"5%",toolboxShow:!1,toolboxOrient:"horizontal",toolboxItemSize:16,toolboxItemGap:8,toolboxLeft:"right",toolboxTop:"top",toolboxIconStyleBorderColor:"#666",toolboxDownloadUrl:"",toolboxInfoText:"当前无说明信息",titleFontSize:"12px",titleColor:"#333",fontWeight:400,textAlign:"left",titleLeft:"",labelWidth:100,labelOverflow:"none",valueTypeDataFieldNames:{name:"name",value:"value",type:"type"},dataFieldConfigType:"value",graphicConfig:{},legendItemGap:10,legendItemWidth:25,legendItemHeight:14,legendFormatter:"{name}",legendFontSize:"12px",graphicType:"ecanPie",legendWidth:null,legendHeight:null,legendTextWidth:null,legendScroll:!1},customGraph:{name:"自定义图表",type:"customGraph",width:"400px",height:"400px",option:{},optionCode:""},comboGraph:{name:"组合图表",type:"comboGraph",width:"400px",height:"400px",titleText:"",titleSubtext:"",colors:["#FFBF53","#04B1C2","#F07474","#C55784","#9A5FB3","#CF62D7","#5E78EA","#51B3F0","#69D4DC","#49B788","#9CCC66","#C18C00"],colorsType:"默认",legendShow:!0,legendTextStyleColor:"#333",legendOrient:"horizontal",legendTop:"top",legendLeft:"center",tooltipShow:!0,tooltipTextStyleColor:"",tooltipTrigger:"item",tooltipFormatter:"{marker} {a} {c}",tooltipBorderColor:"#333",tooltipBackgroundColor:"#fff",xAxisLabelInterval:0,xAxisSplitLineShow:!0,xAxisLabelRotate:0,xAxisLabelOverflow:"none",xAxisLabelWidth:void 0,xAxisSplitLineStyleColor:"#333",xAxisLabelColor:"#333",xAxisLineStyleColor:"#333",xAxisTickShow:!0,xAxisMinInterval:0,yAxisMinInterval:0,yAxisSplitLineShow:!0,yAxisSplitLineStyleColor:"#333",yAxisLabelColor:"#333",yAxisLineStyleColor:"#333",yAxisLineAlwaysDisplay:!1,yAxisLabelShow:!0,seriesTypes:[{type:"bar",axisIndex:0},{type:"line",axisIndex:0}],yAxis:[{axisLabelFormatter:"{value}"},{axisLabelFormatter:"{value}"}],gridContainLabel:!0,gridTop:"10%",gridBottom:"10%",gridLeft:"5%",gridRight:"5%",toolboxShow:!1,toolboxLocation:!1,toolboxDownloadShow:!0,toolboxDataZoomShow:!0,toolboxInfoShow:!0,toolboxOrient:"horizontal",toolboxItemSize:16,toolboxItemGap:8,toolboxLeft:"right",toolboxTop:"top",toolboxIconStyleBorderColor:"#666",toolboxDownloadUrl:"",toolboxInfoText:"当前无说明信息",areaStyleOpacity:0,symbolSize:4,lineStyleWidth:2,smooth:!1,barWidth:"40%"}},ai={name:"表格",type:"table",size:"medium",allOverflow:"title",hoverRow:!0,hoverColor:"#f5f7fa",headerCellStyleMethod:"",rowStyleMethod:"",boderList:[],columnDropEnable:!0,showTotalBool:!1,totalName:"",expandAll:!1},li=e.defineComponent({name:"DataViewList",components:{ASpin:j.Spin,ATreeSelect:j.TreeSelect,Draggable:Et},setup(){var N;const t=e.inject(Be),o=e.unref(e.inject(Ve)),n=e.inject(ge),a=e.inject(Ae),l=e.computed(()=>{var w;return((w=e.unref(n))==null?void 0:w.dataViewId)||null}),r=e.ref(!1),s=e.ref([]),c=(N=window==null?void 0:window.config)==null?void 0:N.pageId,i=e.reactive({title:"已选",value:"YXJG",id:"YXJG",pId:"0",disabled:!0,selectable:!1,isLeaf:!0}),d=async()=>{var x,S;const w=l.value;r.value=!0;try{const{data:A}=await t.post(`${Se}/diagram/sourceList`,{source:"SQL_VIEW",dataViewId:w,pageId:c,pageFlag:!0},{headers:{Authentication:o,operateContext:"ygt"}});r.value=!1,A.success&&((x=s.value)==null||x.push(i),s.value=(S=s.value)==null?void 0:S.concat(p([A.data.rows[0]],"YXJG")))}catch{r.value=!1}},p=(w=[],x)=>{const S=[];return w.forEach(A=>{S.push({id:A.id,pId:x??A.parentId,value:A.id,title:A.name,isLeaf:A.leaf||!1,nature:A.nature,selectable:A.leaf||!1})}),S},u=async(w,x)=>{var v;let S=0;if(w){const{value:D}=w.dataRef;S=D}const{data:A}=await t.post(`${Se}/dataview/treetable`,{pageFlag:!0,pageId:c,parentId:S},{headers:{Authentication:o,operateContext:"ygt"}});A.success&&(s.value=(v=e.unref(s))==null?void 0:v.concat(p(A.data)),x&&e.unref(l)&&await d())},m=w=>{f(w),a({dataViewId:w,classificationList:[],seriesList:[],leftAxisList:[],rightAxisList:[],indicators:[],controlList:[]})},{setDataList:C}=e.inject(pa,{setDataList:w=>w}),g=e.ref(!1),b=e.ref([]),f=async w=>{if(w){b.value=[],g.value=!0;try{const x=await t.post(`${Se}/diagram/sourceList`,{source:"SQL_VIEW",dataViewId:w,pageId:c,pageFlag:!0},{headers:{Authentication:o,operateContext:"ygt"}}),{success:S,data:A={}}=x.data;if(g.value=!1,S){const{rows:v=[]}=A;v==null||v.forEach(D=>{var R;const T=((R=D==null?void 0:D.dataViewColumns)==null?void 0:R.map($=>({...$,show:!0})))||[];b.value=[...e.unref(b),...T]}),C(e.unref(b))}}catch{g.value=!1}}},h=w=>({TEXT:"字符",NUMBER:"数字",DATE:"时间"})[w],y=(w,x)=>{const S=x[w.oldIndex];if(S){const A={...S,label:S.name,name:S.label};sessionStorage.setItem("indicator-list-item",JSON.stringify(A))}};return e.onMounted(async()=>{await u(void 0,!0),f(e.unref(l))}),{dataViewId:l,handleLoadData:u,treeSelectData:s,treeSelectLoading:r,dataViewList:b,dataViewLoading:g,onDataViewIdChange:m,mapGenericType:h,onDragStart:y}}}),$y="",ae=(t,o)=>{const n=t.__vccOpts||t;for(const[a,l]of o)n[a]=l;return n},ri={class:"data-view-list"},ii={class:"columns"},si={class:"column-item"},ci={class:"column-item-name"};function di(t,o,n,a,l,r){const s=e.resolveComponent("a-tree-select"),c=e.resolveComponent("a-spin"),i=e.resolveComponent("draggable");return e.openBlock(),e.createElementBlock("div",ri,[e.createVNode(c,{"wrapper-class-name":"tree-spin",spinning:t.treeSelectLoading,tip:"视图加载中..."},{default:e.withCtx(()=>[e.createVNode(s,{value:t.dataViewId,style:{width:"100%"},placeholder:"请选择视图","dropdown-style":{maxHeight:"400px",overflow:"auto"},"tree-data":t.treeSelectData,"load-data":t.handleLoadData,"tree-data-simple-mode":"",onChange:t.onDataViewIdChange},null,8,["value","tree-data","load-data","onChange"])]),_:1},8,["spinning"]),e.createElementVNode("div",ii,[e.createVNode(c,{spinning:t.dataViewLoading,tip:"数据加载中..."},{default:e.withCtx(()=>[e.createVNode(i,{modelValue:t.dataViewList,"onUpdate:modelValue":o[0]||(o[0]=d=>t.dataViewList=d),group:{name:"cardItem",pull:"clone",put:!1},"item-key":"id",sort:!1,onStart:o[1]||(o[1]=d=>t.onDragStart(d,t.dataViewList))},{item:e.withCtx(({element:d})=>[e.createElementVNode("div",si,[e.createTextVNode(" 【"+e.toDisplayString(t.mapGenericType(d.genericType))+"】 ",1),e.createElementVNode("span",ci,e.toDisplayString(d.name),1)])]),_:1},8,["modelValue"])]),_:1},8,["spinning"])])])}const pi=ae(li,[["render",di],["__scopeId","data-v-4a66f7d2"]]);function De(t,o){ui(t)&&(t="100%");var n=fi(t);return t=o===360?t:Math.min(o,Math.max(0,parseFloat(t))),n&&(t=parseInt(String(t*o),10)/100),Math.abs(t-o)<1e-6?1:(o===360?t=(t<0?t%o+o:t%o)/parseFloat(String(o)):t=t%o/parseFloat(String(o)),t)}function ui(t){return typeof t=="string"&&t.indexOf(".")!==-1&&parseFloat(t)===1}function fi(t){return typeof t=="string"&&t.indexOf("%")!==-1}function mi(t){return t=parseFloat(t),(isNaN(t)||t<0||t>1)&&(t=1),t}function _o(t){return t<=1?"".concat(Number(t)*100,"%"):t}function Zo(t){return t.length===1?"0"+t:String(t)}function hi(t,o,n){return{r:De(t,255)*255,g:De(o,255)*255,b:De(n,255)*255}}function en(t,o,n){return n<0&&(n+=1),n>1&&(n-=1),n<1/6?t+(o-t)*(6*n):n<1/2?o:n<2/3?t+(o-t)*(2/3-n)*6:t}function bi(t,o,n){var a,l,r;if(t=De(t,360),o=De(o,100),n=De(n,100),o===0)l=n,r=n,a=n;else{var s=n<.5?n*(1+o):n+o-n*o,c=2*n-s;a=en(c,s,t+1/3),l=en(c,s,t),r=en(c,s,t-1/3)}return{r:a*255,g:l*255,b:r*255}}function yi(t,o,n){t=De(t,255),o=De(o,255),n=De(n,255);var a=Math.max(t,o,n),l=Math.min(t,o,n),r=0,s=a,c=a-l,i=a===0?0:c/a;if(a===l)r=0;else{switch(a){case t:r=(o-n)/c+(o<n?6:0);break;case o:r=(n-t)/c+2;break;case n:r=(t-o)/c+4;break}r/=6}return{h:r,s:i,v:s}}function gi(t,o,n){t=De(t,360)*6,o=De(o,100),n=De(n,100);var a=Math.floor(t),l=t-a,r=n*(1-o),s=n*(1-l*o),c=n*(1-(1-l)*o),i=a%6,d=[n,s,r,r,c,n][i],p=[c,n,n,s,r,r][i],u=[r,r,c,n,n,s][i];return{r:d*255,g:p*255,b:u*255}}function Ci(t,o,n,a){var l=[Zo(Math.round(t).toString(16)),Zo(Math.round(o).toString(16)),Zo(Math.round(n).toString(16))];return a&&l[0].startsWith(l[0].charAt(1))&&l[1].startsWith(l[1].charAt(1))&&l[2].startsWith(l[2].charAt(1))?l[0].charAt(0)+l[1].charAt(0)+l[2].charAt(0):l.join("")}function wa(t){return Le(t)/255}function Le(t){return parseInt(t,16)}var ka={aliceblue:"#f0f8ff",antiquewhite:"#faebd7",aqua:"#00ffff",aquamarine:"#7fffd4",azure:"#f0ffff",beige:"#f5f5dc",bisque:"#ffe4c4",black:"#000000",blanchedalmond:"#ffebcd",blue:"#0000ff",blueviolet:"#8a2be2",brown:"#a52a2a",burlywood:"#deb887",cadetblue:"#5f9ea0",chartreuse:"#7fff00",chocolate:"#d2691e",coral:"#ff7f50",cornflowerblue:"#6495ed",cornsilk:"#fff8dc",crimson:"#dc143c",cyan:"#00ffff",darkblue:"#00008b",darkcyan:"#008b8b",darkgoldenrod:"#b8860b",darkgray:"#a9a9a9",darkgreen:"#006400",darkgrey:"#a9a9a9",darkkhaki:"#bdb76b",darkmagenta:"#8b008b",darkolivegreen:"#556b2f",darkorange:"#ff8c00",darkorchid:"#9932cc",darkred:"#8b0000",darksalmon:"#e9967a",darkseagreen:"#8fbc8f",darkslateblue:"#483d8b",darkslategray:"#2f4f4f",darkslategrey:"#2f4f4f",darkturquoise:"#00ced1",darkviolet:"#9400d3",deeppink:"#ff1493",deepskyblue:"#00bfff",dimgray:"#696969",dimgrey:"#696969",dodgerblue:"#1e90ff",firebrick:"#b22222",floralwhite:"#fffaf0",forestgreen:"#228b22",fuchsia:"#ff00ff",gainsboro:"#dcdcdc",ghostwhite:"#f8f8ff",goldenrod:"#daa520",gold:"#ffd700",gray:"#808080",green:"#008000",greenyellow:"#adff2f",grey:"#808080",honeydew:"#f0fff0",hotpink:"#ff69b4",indianred:"#cd5c5c",indigo:"#4b0082",ivory:"#fffff0",khaki:"#f0e68c",lavenderblush:"#fff0f5",lavender:"#e6e6fa",lawngreen:"#7cfc00",lemonchiffon:"#fffacd",lightblue:"#add8e6",lightcoral:"#f08080",lightcyan:"#e0ffff",lightgoldenrodyellow:"#fafad2",lightgray:"#d3d3d3",lightgreen:"#90ee90",lightgrey:"#d3d3d3",lightpink:"#ffb6c1",lightsalmon:"#ffa07a",lightseagreen:"#20b2aa",lightskyblue:"#87cefa",lightslategray:"#778899",lightslategrey:"#778899",lightsteelblue:"#b0c4de",lightyellow:"#ffffe0",lime:"#00ff00",limegreen:"#32cd32",linen:"#faf0e6",magenta:"#ff00ff",maroon:"#800000",mediumaquamarine:"#66cdaa",mediumblue:"#0000cd",mediumorchid:"#ba55d3",mediumpurple:"#9370db",mediumseagreen:"#3cb371",mediumslateblue:"#7b68ee",mediumspringgreen:"#00fa9a",mediumturquoise:"#48d1cc",mediumvioletred:"#c71585",midnightblue:"#191970",mintcream:"#f5fffa",mistyrose:"#ffe4e1",moccasin:"#ffe4b5",navajowhite:"#ffdead",navy:"#000080",oldlace:"#fdf5e6",olive:"#808000",olivedrab:"#6b8e23",orange:"#ffa500",orangered:"#ff4500",orchid:"#da70d6",palegoldenrod:"#eee8aa",palegreen:"#98fb98",paleturquoise:"#afeeee",palevioletred:"#db7093",papayawhip:"#ffefd5",peachpuff:"#ffdab9",peru:"#cd853f",pink:"#ffc0cb",plum:"#dda0dd",powderblue:"#b0e0e6",purple:"#800080",rebeccapurple:"#663399",red:"#ff0000",rosybrown:"#bc8f8f",royalblue:"#4169e1",saddlebrown:"#8b4513",salmon:"#fa8072",sandybrown:"#f4a460",seagreen:"#2e8b57",seashell:"#fff5ee",sienna:"#a0522d",silver:"#c0c0c0",skyblue:"#87ceeb",slateblue:"#6a5acd",slategray:"#708090",slategrey:"#708090",snow:"#fffafa",springgreen:"#00ff7f",steelblue:"#4682b4",tan:"#d2b48c",teal:"#008080",thistle:"#d8bfd8",tomato:"#ff6347",turquoise:"#40e0d0",violet:"#ee82ee",wheat:"#f5deb3",white:"#ffffff",whitesmoke:"#f5f5f5",yellow:"#ffff00",yellowgreen:"#9acd32"};function Xt(t){var o={r:0,g:0,b:0},n=1,a=null,l=null,r=null,s=!1,c=!1;return typeof t=="string"&&(t=xi(t)),typeof t=="object"&&(et(t.r)&&et(t.g)&&et(t.b)?(o=hi(t.r,t.g,t.b),s=!0,c=String(t.r).substr(-1)==="%"?"prgb":"rgb"):et(t.h)&&et(t.s)&&et(t.v)?(a=_o(t.s),l=_o(t.v),o=gi(t.h,a,l),s=!0,c="hsv"):et(t.h)&&et(t.s)&&et(t.l)&&(a=_o(t.s),r=_o(t.l),o=bi(t.h,a,r),s=!0,c="hsl"),Object.prototype.hasOwnProperty.call(t,"a")&&(n=t.a)),n=mi(n),{ok:s,format:t.format||c,r:Math.min(255,Math.max(o.r,0)),g:Math.min(255,Math.max(o.g,0)),b:Math.min(255,Math.max(o.b,0)),a:n}}var wi="[-\\+]?\\d+%?",ki="[-\\+]?\\d*\\.\\d+%?",it="(?:".concat(ki,")|(?:").concat(wi,")"),tn="[\\s|\\(]+(".concat(it,")[,|\\s]+(").concat(it,")[,|\\s]+(").concat(it,")\\s*\\)?"),on="[\\s|\\(]+(".concat(it,")[,|\\s]+(").concat(it,")[,|\\s]+(").concat(it,")[,|\\s]+(").concat(it,")\\s*\\)?"),Ge={CSS_UNIT:new RegExp(it),rgb:new RegExp("rgb"+tn),rgba:new RegExp("rgba"+on),hsl:new RegExp("hsl"+tn),hsla:new RegExp("hsla"+on),hsv:new RegExp("hsv"+tn),hsva:new RegExp("hsva"+on),hex3:/^#?([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})$/,hex6:/^#?([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})$/,hex4:/^#?([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})$/,hex8:/^#?([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})$/};function xi(t){if(t=t.trim().toLowerCase(),t.length===0)return!1;var o=!1;if(ka[t])t=ka[t],o=!0;else if(t==="transparent")return{r:0,g:0,b:0,a:0,format:"name"};var n=Ge.rgb.exec(t);return n?{r:n[1],g:n[2],b:n[3]}:(n=Ge.rgba.exec(t),n?{r:n[1],g:n[2],b:n[3],a:n[4]}:(n=Ge.hsl.exec(t),n?{h:n[1],s:n[2],l:n[3]}:(n=Ge.hsla.exec(t),n?{h:n[1],s:n[2],l:n[3],a:n[4]}:(n=Ge.hsv.exec(t),n?{h:n[1],s:n[2],v:n[3]}:(n=Ge.hsva.exec(t),n?{h:n[1],s:n[2],v:n[3],a:n[4]}:(n=Ge.hex8.exec(t),n?{r:Le(n[1]),g:Le(n[2]),b:Le(n[3]),a:wa(n[4]),format:o?"name":"hex8"}:(n=Ge.hex6.exec(t),n?{r:Le(n[1]),g:Le(n[2]),b:Le(n[3]),format:o?"name":"hex"}:(n=Ge.hex4.exec(t),n?{r:Le(n[1]+n[1]),g:Le(n[2]+n[2]),b:Le(n[3]+n[3]),a:wa(n[4]+n[4]),format:o?"name":"hex8"}:(n=Ge.hex3.exec(t),n?{r:Le(n[1]+n[1]),g:Le(n[2]+n[2]),b:Le(n[3]+n[3]),format:o?"name":"hex"}:!1)))))))))}function et(t){return!!Ge.CSS_UNIT.exec(String(t))}var So=2,xa=.16,_i=.05,Si=.05,Ti=.15,_a=5,Sa=4,Ni=[{index:7,opacity:.15},{index:6,opacity:.25},{index:5,opacity:.3},{index:5,opacity:.45},{index:5,opacity:.65},{index:5,opacity:.85},{index:4,opacity:.9},{index:3,opacity:.95},{index:2,opacity:.97},{index:1,opacity:.98}];function Ta(t){var o=t.r,n=t.g,a=t.b,l=yi(o,n,a);return{h:l.h*360,s:l.s,v:l.v}}function To(t){var o=t.r,n=t.g,a=t.b;return"#".concat(Ci(o,n,a,!1))}function Ai(t,o,n){var a=n/100,l={r:(o.r-t.r)*a+t.r,g:(o.g-t.g)*a+t.g,b:(o.b-t.b)*a+t.b};return l}function Na(t,o,n){var a;return Math.round(t.h)>=60&&Math.round(t.h)<=240?a=n?Math.round(t.h)-So*o:Math.round(t.h)+So*o:a=n?Math.round(t.h)+So*o:Math.round(t.h)-So*o,a<0?a+=360:a>=360&&(a-=360),a}function Aa(t,o,n){if(t.h===0&&t.s===0)return t.s;var a;return n?a=t.s-xa*o:o===Sa?a=t.s+xa:a=t.s+_i*o,a>1&&(a=1),n&&o===_a&&a>.1&&(a=.1),a<.06&&(a=.06),Number(a.toFixed(2))}function Ea(t,o,n){var a;return n?a=t.v+Si*o:a=t.v-Ti*o,a>1&&(a=1),Number(a.toFixed(2))}function nn(t){for(var o=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},n=[],a=Xt(t),l=_a;l>0;l-=1){var r=Ta(a),s=To(Xt({h:Na(r,l,!0),s:Aa(r,l,!0),v:Ea(r,l,!0)}));n.push(s)}n.push(To(a));for(var c=1;c<=Sa;c+=1){var i=Ta(a),d=To(Xt({h:Na(i,c),s:Aa(i,c),v:Ea(i,c)}));n.push(d)}return o.theme==="dark"?Ni.map(function(p){var u=p.index,m=p.opacity,C=To(Ai(Xt(o.backgroundColor||"#141414"),Xt(n[u]),m*100));return C}):n}var an={red:"#F5222D",volcano:"#FA541C",orange:"#FA8C16",gold:"#FAAD14",yellow:"#FADB14",lime:"#A0D911",green:"#52C41A",cyan:"#13C2C2",blue:"#1890FF",geekblue:"#2F54EB",purple:"#722ED1",magenta:"#EB2F96",grey:"#666666"},ln={},rn={};Object.keys(an).forEach(function(t){ln[t]=nn(an[t]),ln[t].primary=ln[t][5],rn[t]=nn(an[t],{theme:"dark",backgroundColor:"#141414"}),rn[t].primary=rn[t][5]});var Oa=[],Qt=[],Ei="insert-css: You need to provide a CSS string. Usage: insertCss(cssString[, options]).";function Oi(){var t=document.createElement("style");return t.setAttribute("type","text/css"),t}function Bi(t,o){if(o=o||{},t===void 0)throw new Error(Ei);var n=o.prepend===!0?"prepend":"append",a=o.container!==void 0?o.container:document.querySelector("head"),l=Oa.indexOf(a);l===-1&&(l=Oa.push(a)-1,Qt[l]={});var r;return Qt[l]!==void 0&&Qt[l][n]!==void 0?r=Qt[l][n]:(r=Qt[l][n]=Oi(),n==="prepend"?a.insertBefore(r,a.childNodes[0]):a.appendChild(r)),t.charCodeAt(0)===65279&&(t=t.substr(1,t.length)),r.styleSheet?r.styleSheet.cssText+=t:r.textContent+=t,r}function Ba(t){for(var o=1;o<arguments.length;o++){var n=arguments[o]!=null?Object(arguments[o]):{},a=Object.keys(n);typeof Object.getOwnPropertySymbols=="function"&&(a=a.concat(Object.getOwnPropertySymbols(n).filter(function(l){return Object.getOwnPropertyDescriptor(n,l).enumerable}))),a.forEach(function(l){Vi(t,l,n[l])})}return t}function Vi(t,o,n){return o in t?Object.defineProperty(t,o,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[o]=n,t}function Li(t,o){process.env.NODE_ENV!=="production"&&!t&&console!==void 0&&console.error("Warning: ".concat(o))}function Fi(t,o){Li(t,"[@ant-design/icons-vue] ".concat(o))}function Va(t){return typeof t=="object"&&typeof t.name=="string"&&typeof t.theme=="string"&&(typeof t.icon=="object"||typeof t.icon=="function")}function sn(t,o,n){return n?e.h(t.tag,Ba({key:o},n,t.attrs),(t.children||[]).map(function(a,l){return sn(a,"".concat(o,"-").concat(t.tag,"-").concat(l))})):e.h(t.tag,Ba({key:o},t.attrs),(t.children||[]).map(function(a,l){return sn(a,"".concat(o,"-").concat(t.tag,"-").concat(l))}))}function La(t){return nn(t)[0]}function Fa(t){return t?Array.isArray(t)?t:[t]:[]}var $i=`
|
|
3
3
|
.anticon {
|
|
4
4
|
display: inline-block;
|
|
@@ -71,5 +71,5 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho
|
|
|
71
71
|
正确的标出区域。如果不设置标域颜色将会使用图表默认颜色。系统提供四个变量:xMax、xMin、yMax、yMin,xMax表示x轴刻度最大值,xMin表示x轴刻度最小值,
|
|
72
72
|
yMax表示y轴刻度最大值,yMin表示y轴刻度最小值。使用变量的时候需要用“{}”符号包裹变量`}}},kf=e.defineComponent({name:"Input",directives:{focus},props:{value:{type:String,default:""},disabled:{type:Boolean,default:!1}},components:{AInput:j.Input},emits:["change"],setup(t,{emit:o}){return{onInputChange:a=>{o("change",a.target.value)}}}});function xf(t,o,n,a,l,r){const s=e.resolveComponent("a-input"),c=e.resolveDirective("focus");return e.withDirectives((e.openBlock(),e.createBlock(s,{value:t.value,disabled:t.disabled,onChange:t.onInputChange},null,8,["value","disabled","onChange"])),[[c]])}const _f=ae(kf,[["render",xf]]),Sf=e.defineComponent({name:"InputNumber",props:{value:{type:[String,Number,Object],default:""},valueKey:{type:String,default:"value"},prefixValueKey:{type:String,default:"prefix"},prefix:{type:[String,Array],default:""},suffixValueKey:{type:String,default:"suffix"},suffix:{type:[String,Array],default:""},min:{type:Number,default:-1/0},max:{type:Number,default:1/0},step:{type:[String,Number],default:1},useBlurEvent:{type:Boolean,default:!0}},components:{AInputNumber:j.InputNumber,ASelect:j.Select,ASelectOption:j.SelectOption},emits:["change"],setup(t,{emit:o}){const n=e.computed(()=>{const u=t.value;return typeof u=="string"?parseFloat(u):typeof u=="object"&&u!=null?u[t.valueKey]:u}),a=u=>t.value!=null&&typeof t.value=="object"?t.value[t[`${u}ValueKey`]]:Array.isArray(t[u])?t[u][0]&&t[u][0].value:null,l=e.ref(a("prefix")),r=e.ref(a("suffix"));return{inputValue:n,onInputChange:u=>{const m=t.suffix;Array.isArray(t.prefix)||Array.isArray(t.suffix)?o("change",{[t.valueKey]:u,[t.prefixValueKey]:e.unref(l),[t.suffixValueKey]:e.unref(r)}):m===""||u==null?o("change",u):o("change",`${u}${m}`)},parser:u=>typeof t.suffix=="string"?u.replace(t.suffix,""):Array.isArray(t.suffix)&&t.value!=null&&typeof t.value=="object"?u.replace(t.value[t.suffixValueKey],""):u,onInputBlur:()=>{t.useBlurEvent&&o("change",null,!1)},prefixValue:l,suffixValue:r,onPrefixChange:()=>{Array.isArray(t.prefix)&&o("change",{[t.valueKey]:e.unref(n),[t.prefixValueKey]:e.unref(l),[t.suffixValueKey]:e.unref(r)})},onSuffixChange:()=>{Array.isArray(t.suffix)&&o("change",{[t.valueKey]:e.unref(n),[t.prefixValueKey]:e.unref(l),[t.suffixValueKey]:e.unref(r)})}}}});function Tf(t,o,n,a,l,r){const s=e.resolveComponent("a-select-option"),c=e.resolveComponent("a-select"),i=e.resolveComponent("a-input-number");return e.openBlock(),e.createBlock(i,{value:t.inputValue,min:t.min,max:t.max,step:t.step,parser:t.parser,"addon-before":Array.isArray(t.prefix)?void 0:t.prefix,"addon-after":Array.isArray(t.suffix)?void 0:t.prefix,onChange:t.onInputChange,onBlur:t.onInputBlur},e.createSlots({_:2},[Array.isArray(t.prefix)&&t.prefix.length>0?{name:"addonBefore",fn:e.withCtx(()=>[e.createVNode(c,{value:t.prefixValue,"onUpdate:value":o[0]||(o[0]=d=>t.prefixValue=d),onChange:t.onPrefixChange},{default:e.withCtx(()=>[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(t.prefix,({label:d,value:p},u)=>(e.openBlock(),e.createBlock(s,{key:u,value:p},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(d),1)]),_:2},1032,["value"]))),128))]),_:1},8,["value","onChange"])]),key:"0"}:void 0,Array.isArray(t.suffix)&&t.suffix.length>0?{name:"addonAfter",fn:e.withCtx(()=>[e.createVNode(c,{value:t.suffixValue,"onUpdate:value":o[1]||(o[1]=d=>t.suffixValue=d),onChange:t.onSuffixChange},{default:e.withCtx(()=>[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(t.suffix,({label:d,value:p},u)=>(e.openBlock(),e.createBlock(s,{key:u,value:p},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(d),1)]),_:2},1032,["value"]))),128))]),_:1},8,["value","onChange"])]),key:"1"}:void 0]),1032,["value","min","max","step","parser","addon-before","addon-after","onChange","onBlur"])}const sr=ae(Sf,[["render",Tf]]),Nf=e.defineComponent({name:"RadioGroup",props:{value:{type:[String,Number],default:""},options:{type:Array,default:()=>[]},optionType:{type:String,default:"default"},size:{type:String,default:"default"}},components:{ARadioGroup:j.RadioGroup,ARadioButton:j.RadioButton},emits:["change"],setup(t,{emit:o}){return{onRadioChange:a=>{o("change",a.target.value)}}}});function Af(t,o,n,a,l,r){const s=e.resolveComponent("a-radio-button"),c=e.resolveComponent("a-radio-group");return e.openBlock(),e.createBlock(c,{value:t.value,optionType:t.optionType,onChange:t.onRadioChange},{default:e.withCtx(()=>[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(t.options,i=>(e.openBlock(),e.createBlock(s,{key:i.value,value:i.value},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(i.label),1)]),_:2},1032,["value"]))),128))]),_:1},8,["value","optionType","onChange"])}const Ef=ae(Nf,[["render",Af]]),Of=e.defineComponent({name:"Select",props:{value:{type:[String,Number,Array,Array],default:""},options:{type:Array,default:()=>[]},customOption:{type:Function}},components:{ASelect:j.Select,ASelectOption:j.SelectOption},emits:["change"],setup(t,{emit:o}){return{onSelectChange:a=>{o("change",a)}}}});function Bf(t,o,n,a,l,r){const s=e.resolveComponent("a-select-option"),c=e.resolveComponent("a-select");return e.openBlock(),e.createBlock(c,{value:t.value,onChange:t.onSelectChange},{default:e.withCtx(()=>[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(t.options,i=>(e.openBlock(),e.createBlock(s,{key:i.value,value:i.value},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(i.label),1)]),_:2},1032,["value"]))),128))]),_:1},8,["value","onChange"])}const Vf=ae(Of,[["render",Bf]]),Lf=e.defineComponent({name:"Switch",props:{value:{type:Boolean,default:!1},width:{type:[String,Number],default:150},disabled:{type:Boolean,default:!1}},components:{ASwitch:j.Switch},emit:["change"],setup(t,{emit:o}){return{onSwitchChange:a=>{o("change",a)}}}});function Ff(t,o,n,a,l,r){const s=e.resolveComponent("a-switch");return e.openBlock(),e.createElementBlock("div",{style:e.normalizeStyle({width:`${t.width}px`})},[e.createVNode(s,{disabled:t.disabled,checked:t.value,onChange:t.onSwitchChange},null,8,["disabled","checked","onChange"])],4)}const $f=ae(Lf,[["render",Ff]]);var Ee="top",Me="bottom",Pe="right",Oe="left",qn="auto",io=[Ee,Me,Pe,Oe],Mt="start",so="end",If="clippingParents",cr="viewport",co="popper",vf="reference",dr=io.reduce(function(t,o){return t.concat([o+"-"+Mt,o+"-"+so])},[]),pr=[].concat(io,[qn]).reduce(function(t,o){return t.concat([o,o+"-"+Mt,o+"-"+so])},[]),Df="beforeRead",Mf="read",Pf="afterRead",jf="beforeMain",Rf="main",Uf="afterMain",zf="beforeWrite",Gf="write",Hf="afterWrite",Wf=[Df,Mf,Pf,jf,Rf,Uf,zf,Gf,Hf];function qe(t){return t?(t.nodeName||"").toLowerCase():null}function $e(t){if(t==null)return window;if(t.toString()!=="[object Window]"){var o=t.ownerDocument;return o&&o.defaultView||window}return t}function kt(t){var o=$e(t).Element;return t instanceof o||t instanceof Element}function je(t){var o=$e(t).HTMLElement;return t instanceof o||t instanceof HTMLElement}function Kn(t){if(typeof ShadowRoot>"u")return!1;var o=$e(t).ShadowRoot;return t instanceof o||t instanceof ShadowRoot}function Yf(t){var o=t.state;Object.keys(o.elements).forEach(function(n){var a=o.styles[n]||{},l=o.attributes[n]||{},r=o.elements[n];!je(r)||!qe(r)||(Object.assign(r.style,a),Object.keys(l).forEach(function(s){var c=l[s];c===!1?r.removeAttribute(s):r.setAttribute(s,c===!0?"":c)}))})}function qf(t){var o=t.state,n={popper:{position:o.options.strategy,left:"0",top:"0",margin:"0"},arrow:{position:"absolute"},reference:{}};return Object.assign(o.elements.popper.style,n.popper),o.styles=n,o.elements.arrow&&Object.assign(o.elements.arrow.style,n.arrow),function(){Object.keys(o.elements).forEach(function(a){var l=o.elements[a],r=o.attributes[a]||{},s=Object.keys(o.styles.hasOwnProperty(a)?o.styles[a]:n[a]),c=s.reduce(function(i,d){return i[d]="",i},{});!je(l)||!qe(l)||(Object.assign(l.style,c),Object.keys(r).forEach(function(i){l.removeAttribute(i)}))})}}const Kf={name:"applyStyles",enabled:!0,phase:"write",fn:Yf,effect:qf,requires:["computeStyles"]};function Ke(t){return t.split("-")[0]}var xt=Math.max,Lo=Math.min,Pt=Math.round;function Xn(){var t=navigator.userAgentData;return t!=null&&t.brands&&Array.isArray(t.brands)?t.brands.map(function(o){return o.brand+"/"+o.version}).join(" "):navigator.userAgent}function ur(){return!/^((?!chrome|android).)*safari/i.test(Xn())}function jt(t,o,n){o===void 0&&(o=!1),n===void 0&&(n=!1);var a=t.getBoundingClientRect(),l=1,r=1;o&&je(t)&&(l=t.offsetWidth>0&&Pt(a.width)/t.offsetWidth||1,r=t.offsetHeight>0&&Pt(a.height)/t.offsetHeight||1);var s=kt(t)?$e(t):window,c=s.visualViewport,i=!ur()&&n,d=(a.left+(i&&c?c.offsetLeft:0))/l,p=(a.top+(i&&c?c.offsetTop:0))/r,u=a.width/l,m=a.height/r;return{width:u,height:m,top:p,right:d+u,bottom:p+m,left:d,x:d,y:p}}function Qn(t){var o=jt(t),n=t.offsetWidth,a=t.offsetHeight;return Math.abs(o.width-n)<=1&&(n=o.width),Math.abs(o.height-a)<=1&&(a=o.height),{x:t.offsetLeft,y:t.offsetTop,width:n,height:a}}function fr(t,o){var n=o.getRootNode&&o.getRootNode();if(t.contains(o))return!0;if(n&&Kn(n)){var a=o;do{if(a&&t.isSameNode(a))return!0;a=a.parentNode||a.host}while(a)}return!1}function ot(t){return $e(t).getComputedStyle(t)}function Xf(t){return["table","td","th"].indexOf(qe(t))>=0}function ft(t){return((kt(t)?t.ownerDocument:t.document)||window.document).documentElement}function Fo(t){return qe(t)==="html"?t:t.assignedSlot||t.parentNode||(Kn(t)?t.host:null)||ft(t)}function mr(t){return!je(t)||ot(t).position==="fixed"?null:t.offsetParent}function Qf(t){var o=/firefox/i.test(Xn()),n=/Trident/i.test(Xn());if(n&&je(t)){var a=ot(t);if(a.position==="fixed")return null}var l=Fo(t);for(Kn(l)&&(l=l.host);je(l)&&["html","body"].indexOf(qe(l))<0;){var r=ot(l);if(r.transform!=="none"||r.perspective!=="none"||r.contain==="paint"||["transform","perspective"].indexOf(r.willChange)!==-1||o&&r.willChange==="filter"||o&&r.filter&&r.filter!=="none")return l;l=l.parentNode}return null}function po(t){for(var o=$e(t),n=mr(t);n&&Xf(n)&&ot(n).position==="static";)n=mr(n);return n&&(qe(n)==="html"||qe(n)==="body"&&ot(n).position==="static")?o:n||Qf(t)||o}function Jn(t){return["top","bottom"].indexOf(t)>=0?"x":"y"}function uo(t,o,n){return xt(t,Lo(o,n))}function Jf(t,o,n){var a=uo(t,o,n);return a>n?n:a}function hr(){return{top:0,right:0,bottom:0,left:0}}function br(t){return Object.assign({},hr(),t)}function yr(t,o){return o.reduce(function(n,a){return n[a]=t,n},{})}var Zf=function(o,n){return o=typeof o=="function"?o(Object.assign({},n.rects,{placement:n.placement})):o,br(typeof o!="number"?o:yr(o,io))};function em(t){var o,n=t.state,a=t.name,l=t.options,r=n.elements.arrow,s=n.modifiersData.popperOffsets,c=Ke(n.placement),i=Jn(c),d=[Oe,Pe].indexOf(c)>=0,p=d?"height":"width";if(!(!r||!s)){var u=Zf(l.padding,n),m=Qn(r),C=i==="y"?Ee:Oe,g=i==="y"?Me:Pe,b=n.rects.reference[p]+n.rects.reference[i]-s[i]-n.rects.popper[p],f=s[i]-n.rects.reference[i],h=po(r),y=h?i==="y"?h.clientHeight||0:h.clientWidth||0:0,N=b/2-f/2,w=u[C],x=y-m[p]-u[g],S=y/2-m[p]/2+N,A=uo(w,S,x),v=i;n.modifiersData[a]=(o={},o[v]=A,o.centerOffset=A-S,o)}}function tm(t){var o=t.state,n=t.options,a=n.element,l=a===void 0?"[data-popper-arrow]":a;l!=null&&(typeof l=="string"&&(l=o.elements.popper.querySelector(l),!l)||fr(o.elements.popper,l)&&(o.elements.arrow=l))}const om={name:"arrow",enabled:!0,phase:"main",fn:em,effect:tm,requires:["popperOffsets"],requiresIfExists:["preventOverflow"]};function Rt(t){return t.split("-")[1]}var nm={top:"auto",right:"auto",bottom:"auto",left:"auto"};function am(t,o){var n=t.x,a=t.y,l=o.devicePixelRatio||1;return{x:Pt(n*l)/l||0,y:Pt(a*l)/l||0}}function gr(t){var o,n=t.popper,a=t.popperRect,l=t.placement,r=t.variation,s=t.offsets,c=t.position,i=t.gpuAcceleration,d=t.adaptive,p=t.roundOffsets,u=t.isFixed,m=s.x,C=m===void 0?0:m,g=s.y,b=g===void 0?0:g,f=typeof p=="function"?p({x:C,y:b}):{x:C,y:b};C=f.x,b=f.y;var h=s.hasOwnProperty("x"),y=s.hasOwnProperty("y"),N=Oe,w=Ee,x=window;if(d){var S=po(n),A="clientHeight",v="clientWidth";if(S===$e(n)&&(S=ft(n),ot(S).position!=="static"&&c==="absolute"&&(A="scrollHeight",v="scrollWidth")),S=S,l===Ee||(l===Oe||l===Pe)&&r===so){w=Me;var D=u&&S===x&&x.visualViewport?x.visualViewport.height:S[A];b-=D-a.height,b*=i?1:-1}if(l===Oe||(l===Ee||l===Me)&&r===so){N=Pe;var T=u&&S===x&&x.visualViewport?x.visualViewport.width:S[v];C-=T-a.width,C*=i?1:-1}}var R=Object.assign({position:c},d&&nm),$=p===!0?am({x:C,y:b},$e(n)):{x:C,y:b};if(C=$.x,b=$.y,i){var F;return Object.assign({},R,(F={},F[w]=y?"0":"",F[N]=h?"0":"",F.transform=(x.devicePixelRatio||1)<=1?"translate("+C+"px, "+b+"px)":"translate3d("+C+"px, "+b+"px, 0)",F))}return Object.assign({},R,(o={},o[w]=y?b+"px":"",o[N]=h?C+"px":"",o.transform="",o))}function lm(t){var o=t.state,n=t.options,a=n.gpuAcceleration,l=a===void 0?!0:a,r=n.adaptive,s=r===void 0?!0:r,c=n.roundOffsets,i=c===void 0?!0:c,d={placement:Ke(o.placement),variation:Rt(o.placement),popper:o.elements.popper,popperRect:o.rects.popper,gpuAcceleration:l,isFixed:o.options.strategy==="fixed"};o.modifiersData.popperOffsets!=null&&(o.styles.popper=Object.assign({},o.styles.popper,gr(Object.assign({},d,{offsets:o.modifiersData.popperOffsets,position:o.options.strategy,adaptive:s,roundOffsets:i})))),o.modifiersData.arrow!=null&&(o.styles.arrow=Object.assign({},o.styles.arrow,gr(Object.assign({},d,{offsets:o.modifiersData.arrow,position:"absolute",adaptive:!1,roundOffsets:i})))),o.attributes.popper=Object.assign({},o.attributes.popper,{"data-popper-placement":o.placement})}const rm={name:"computeStyles",enabled:!0,phase:"beforeWrite",fn:lm,data:{}};var $o={passive:!0};function im(t){var o=t.state,n=t.instance,a=t.options,l=a.scroll,r=l===void 0?!0:l,s=a.resize,c=s===void 0?!0:s,i=$e(o.elements.popper),d=[].concat(o.scrollParents.reference,o.scrollParents.popper);return r&&d.forEach(function(p){p.addEventListener("scroll",n.update,$o)}),c&&i.addEventListener("resize",n.update,$o),function(){r&&d.forEach(function(p){p.removeEventListener("scroll",n.update,$o)}),c&&i.removeEventListener("resize",n.update,$o)}}const sm={name:"eventListeners",enabled:!0,phase:"write",fn:function(){},effect:im,data:{}};var cm={left:"right",right:"left",bottom:"top",top:"bottom"};function Io(t){return t.replace(/left|right|bottom|top/g,function(o){return cm[o]})}var dm={start:"end",end:"start"};function Cr(t){return t.replace(/start|end/g,function(o){return dm[o]})}function Zn(t){var o=$e(t),n=o.pageXOffset,a=o.pageYOffset;return{scrollLeft:n,scrollTop:a}}function ea(t){return jt(ft(t)).left+Zn(t).scrollLeft}function pm(t,o){var n=$e(t),a=ft(t),l=n.visualViewport,r=a.clientWidth,s=a.clientHeight,c=0,i=0;if(l){r=l.width,s=l.height;var d=ur();(d||!d&&o==="fixed")&&(c=l.offsetLeft,i=l.offsetTop)}return{width:r,height:s,x:c+ea(t),y:i}}function um(t){var o,n=ft(t),a=Zn(t),l=(o=t.ownerDocument)==null?void 0:o.body,r=xt(n.scrollWidth,n.clientWidth,l?l.scrollWidth:0,l?l.clientWidth:0),s=xt(n.scrollHeight,n.clientHeight,l?l.scrollHeight:0,l?l.clientHeight:0),c=-a.scrollLeft+ea(t),i=-a.scrollTop;return ot(l||n).direction==="rtl"&&(c+=xt(n.clientWidth,l?l.clientWidth:0)-r),{width:r,height:s,x:c,y:i}}function ta(t){var o=ot(t),n=o.overflow,a=o.overflowX,l=o.overflowY;return/auto|scroll|overlay|hidden/.test(n+l+a)}function wr(t){return["html","body","#document"].indexOf(qe(t))>=0?t.ownerDocument.body:je(t)&&ta(t)?t:wr(Fo(t))}function fo(t,o){var n;o===void 0&&(o=[]);var a=wr(t),l=a===((n=t.ownerDocument)==null?void 0:n.body),r=$e(a),s=l?[r].concat(r.visualViewport||[],ta(a)?a:[]):a,c=o.concat(s);return l?c:c.concat(fo(Fo(s)))}function oa(t){return Object.assign({},t,{left:t.x,top:t.y,right:t.x+t.width,bottom:t.y+t.height})}function fm(t,o){var n=jt(t,!1,o==="fixed");return n.top=n.top+t.clientTop,n.left=n.left+t.clientLeft,n.bottom=n.top+t.clientHeight,n.right=n.left+t.clientWidth,n.width=t.clientWidth,n.height=t.clientHeight,n.x=n.left,n.y=n.top,n}function kr(t,o,n){return o===cr?oa(pm(t,n)):kt(o)?fm(o,n):oa(um(ft(t)))}function mm(t){var o=fo(Fo(t)),n=["absolute","fixed"].indexOf(ot(t).position)>=0,a=n&&je(t)?po(t):t;return kt(a)?o.filter(function(l){return kt(l)&&fr(l,a)&&qe(l)!=="body"}):[]}function hm(t,o,n,a){var l=o==="clippingParents"?mm(t):[].concat(o),r=[].concat(l,[n]),s=r[0],c=r.reduce(function(i,d){var p=kr(t,d,a);return i.top=xt(p.top,i.top),i.right=Lo(p.right,i.right),i.bottom=Lo(p.bottom,i.bottom),i.left=xt(p.left,i.left),i},kr(t,s,a));return c.width=c.right-c.left,c.height=c.bottom-c.top,c.x=c.left,c.y=c.top,c}function xr(t){var o=t.reference,n=t.element,a=t.placement,l=a?Ke(a):null,r=a?Rt(a):null,s=o.x+o.width/2-n.width/2,c=o.y+o.height/2-n.height/2,i;switch(l){case Ee:i={x:s,y:o.y-n.height};break;case Me:i={x:s,y:o.y+o.height};break;case Pe:i={x:o.x+o.width,y:c};break;case Oe:i={x:o.x-n.width,y:c};break;default:i={x:o.x,y:o.y}}var d=l?Jn(l):null;if(d!=null){var p=d==="y"?"height":"width";switch(r){case Mt:i[d]=i[d]-(o[p]/2-n[p]/2);break;case so:i[d]=i[d]+(o[p]/2-n[p]/2);break}}return i}function mo(t,o){o===void 0&&(o={});var n=o,a=n.placement,l=a===void 0?t.placement:a,r=n.strategy,s=r===void 0?t.strategy:r,c=n.boundary,i=c===void 0?If:c,d=n.rootBoundary,p=d===void 0?cr:d,u=n.elementContext,m=u===void 0?co:u,C=n.altBoundary,g=C===void 0?!1:C,b=n.padding,f=b===void 0?0:b,h=br(typeof f!="number"?f:yr(f,io)),y=m===co?vf:co,N=t.rects.popper,w=t.elements[g?y:m],x=hm(kt(w)?w:w.contextElement||ft(t.elements.popper),i,p,s),S=jt(t.elements.reference),A=xr({reference:S,element:N,strategy:"absolute",placement:l}),v=oa(Object.assign({},N,A)),D=m===co?v:S,T={top:x.top-D.top+h.top,bottom:D.bottom-x.bottom+h.bottom,left:x.left-D.left+h.left,right:D.right-x.right+h.right},R=t.modifiersData.offset;if(m===co&&R){var $=R[l];Object.keys(T).forEach(function(F){var _=[Pe,Me].indexOf(F)>=0?1:-1,B=[Ee,Me].indexOf(F)>=0?"y":"x";T[F]+=$[B]*_})}return T}function bm(t,o){o===void 0&&(o={});var n=o,a=n.placement,l=n.boundary,r=n.rootBoundary,s=n.padding,c=n.flipVariations,i=n.allowedAutoPlacements,d=i===void 0?pr:i,p=Rt(a),u=p?c?dr:dr.filter(function(g){return Rt(g)===p}):io,m=u.filter(function(g){return d.indexOf(g)>=0});m.length===0&&(m=u);var C=m.reduce(function(g,b){return g[b]=mo(t,{placement:b,boundary:l,rootBoundary:r,padding:s})[Ke(b)],g},{});return Object.keys(C).sort(function(g,b){return C[g]-C[b]})}function ym(t){if(Ke(t)===qn)return[];var o=Io(t);return[Cr(t),o,Cr(o)]}function gm(t){var o=t.state,n=t.options,a=t.name;if(!o.modifiersData[a]._skip){for(var l=n.mainAxis,r=l===void 0?!0:l,s=n.altAxis,c=s===void 0?!0:s,i=n.fallbackPlacements,d=n.padding,p=n.boundary,u=n.rootBoundary,m=n.altBoundary,C=n.flipVariations,g=C===void 0?!0:C,b=n.allowedAutoPlacements,f=o.options.placement,h=Ke(f),y=h===f,N=i||(y||!g?[Io(f)]:ym(f)),w=[f].concat(N).reduce(function(U,z){return U.concat(Ke(z)===qn?bm(o,{placement:z,boundary:p,rootBoundary:u,padding:d,flipVariations:g,allowedAutoPlacements:b}):z)},[]),x=o.rects.reference,S=o.rects.popper,A=new Map,v=!0,D=w[0],T=0;T<w.length;T++){var R=w[T],$=Ke(R),F=Rt(R)===Mt,_=[Ee,Me].indexOf($)>=0,B=_?"width":"height",E=mo(o,{placement:R,boundary:p,rootBoundary:u,altBoundary:m,padding:d}),P=_?F?Pe:Oe:F?Me:Ee;x[B]>S[B]&&(P=Io(P));var I=Io(P),O=[];if(r&&O.push(E[$]<=0),c&&O.push(E[P]<=0,E[I]<=0),O.every(function(U){return U})){D=R,v=!1;break}A.set(R,O)}if(v)for(var V=g?3:1,k=function(z){var q=w.find(function(X){var J=A.get(X);if(J)return J.slice(0,z).every(function(oe){return oe})});if(q)return D=q,"break"},L=V;L>0;L--){var M=k(L);if(M==="break")break}o.placement!==D&&(o.modifiersData[a]._skip=!0,o.placement=D,o.reset=!0)}}const Cm={name:"flip",enabled:!0,phase:"main",fn:gm,requiresIfExists:["offset"],data:{_skip:!1}};function _r(t,o,n){return n===void 0&&(n={x:0,y:0}),{top:t.top-o.height-n.y,right:t.right-o.width+n.x,bottom:t.bottom-o.height+n.y,left:t.left-o.width-n.x}}function Sr(t){return[Ee,Pe,Me,Oe].some(function(o){return t[o]>=0})}function wm(t){var o=t.state,n=t.name,a=o.rects.reference,l=o.rects.popper,r=o.modifiersData.preventOverflow,s=mo(o,{elementContext:"reference"}),c=mo(o,{altBoundary:!0}),i=_r(s,a),d=_r(c,l,r),p=Sr(i),u=Sr(d);o.modifiersData[n]={referenceClippingOffsets:i,popperEscapeOffsets:d,isReferenceHidden:p,hasPopperEscaped:u},o.attributes.popper=Object.assign({},o.attributes.popper,{"data-popper-reference-hidden":p,"data-popper-escaped":u})}const km={name:"hide",enabled:!0,phase:"main",requiresIfExists:["preventOverflow"],fn:wm};function xm(t,o,n){var a=Ke(t),l=[Oe,Ee].indexOf(a)>=0?-1:1,r=typeof n=="function"?n(Object.assign({},o,{placement:t})):n,s=r[0],c=r[1];return s=s||0,c=(c||0)*l,[Oe,Pe].indexOf(a)>=0?{x:c,y:s}:{x:s,y:c}}function _m(t){var o=t.state,n=t.options,a=t.name,l=n.offset,r=l===void 0?[0,0]:l,s=pr.reduce(function(p,u){return p[u]=xm(u,o.rects,r),p},{}),c=s[o.placement],i=c.x,d=c.y;o.modifiersData.popperOffsets!=null&&(o.modifiersData.popperOffsets.x+=i,o.modifiersData.popperOffsets.y+=d),o.modifiersData[a]=s}const Sm={name:"offset",enabled:!0,phase:"main",requires:["popperOffsets"],fn:_m};function Tm(t){var o=t.state,n=t.name;o.modifiersData[n]=xr({reference:o.rects.reference,element:o.rects.popper,strategy:"absolute",placement:o.placement})}const Nm={name:"popperOffsets",enabled:!0,phase:"read",fn:Tm,data:{}};function Am(t){return t==="x"?"y":"x"}function Em(t){var o=t.state,n=t.options,a=t.name,l=n.mainAxis,r=l===void 0?!0:l,s=n.altAxis,c=s===void 0?!1:s,i=n.boundary,d=n.rootBoundary,p=n.altBoundary,u=n.padding,m=n.tether,C=m===void 0?!0:m,g=n.tetherOffset,b=g===void 0?0:g,f=mo(o,{boundary:i,rootBoundary:d,padding:u,altBoundary:p}),h=Ke(o.placement),y=Rt(o.placement),N=!y,w=Jn(h),x=Am(w),S=o.modifiersData.popperOffsets,A=o.rects.reference,v=o.rects.popper,D=typeof b=="function"?b(Object.assign({},o.rects,{placement:o.placement})):b,T=typeof D=="number"?{mainAxis:D,altAxis:D}:Object.assign({mainAxis:0,altAxis:0},D),R=o.modifiersData.offset?o.modifiersData.offset[o.placement]:null,$={x:0,y:0};if(S){if(r){var F,_=w==="y"?Ee:Oe,B=w==="y"?Me:Pe,E=w==="y"?"height":"width",P=S[w],I=P+f[_],O=P-f[B],V=C?-v[E]/2:0,k=y===Mt?A[E]:v[E],L=y===Mt?-v[E]:-A[E],M=o.elements.arrow,U=C&&M?Qn(M):{width:0,height:0},z=o.modifiersData["arrow#persistent"]?o.modifiersData["arrow#persistent"].padding:hr(),q=z[_],X=z[B],J=uo(0,A[E],U[E]),oe=N?A[E]/2-V-J-q-T.mainAxis:k-J-q-T.mainAxis,le=N?-A[E]/2+V+J+X+T.mainAxis:L+J+X+T.mainAxis,Ce=o.elements.arrow&&po(o.elements.arrow),ie=Ce?w==="y"?Ce.clientTop||0:Ce.clientLeft||0:0,we=(F=R==null?void 0:R[w])!=null?F:0,at=P+oe-we-ie,Gt=P+le-we,Ht=uo(C?Lo(I,at):I,P,C?xt(O,Gt):O);S[w]=Ht,$[w]=Ht-P}if(c){var go,Wt=w==="x"?Ee:Oe,Yt=w==="x"?Me:Pe,Ie=S[x],Qe=x==="y"?"height":"width",Tt=Ie+f[Wt],lt=Ie-f[Yt],Je=[Ee,Oe].indexOf(h)!==-1,Ue=(go=R==null?void 0:R[x])!=null?go:0,Nt=Je?Tt:Ie-A[Qe]-v[Qe]-Ue+T.altAxis,rt=Je?Ie+A[Qe]+v[Qe]-Ue-T.altAxis:lt,mt=C&&Je?Jf(Nt,Ie,rt):uo(C?Nt:Tt,Ie,C?rt:lt);S[x]=mt,$[x]=mt-Ie}o.modifiersData[a]=$}}const Om={name:"preventOverflow",enabled:!0,phase:"main",fn:Em,requiresIfExists:["offset"]};function Bm(t){return{scrollLeft:t.scrollLeft,scrollTop:t.scrollTop}}function Vm(t){return t===$e(t)||!je(t)?Zn(t):Bm(t)}function Lm(t){var o=t.getBoundingClientRect(),n=Pt(o.width)/t.offsetWidth||1,a=Pt(o.height)/t.offsetHeight||1;return n!==1||a!==1}function Fm(t,o,n){n===void 0&&(n=!1);var a=je(o),l=je(o)&&Lm(o),r=ft(o),s=jt(t,l,n),c={scrollLeft:0,scrollTop:0},i={x:0,y:0};return(a||!a&&!n)&&((qe(o)!=="body"||ta(r))&&(c=Vm(o)),je(o)?(i=jt(o,!0),i.x+=o.clientLeft,i.y+=o.clientTop):r&&(i.x=ea(r))),{x:s.left+c.scrollLeft-i.x,y:s.top+c.scrollTop-i.y,width:s.width,height:s.height}}function $m(t){var o=new Map,n=new Set,a=[];t.forEach(function(r){o.set(r.name,r)});function l(r){n.add(r.name);var s=[].concat(r.requires||[],r.requiresIfExists||[]);s.forEach(function(c){if(!n.has(c)){var i=o.get(c);i&&l(i)}}),a.push(r)}return t.forEach(function(r){n.has(r.name)||l(r)}),a}function Im(t){var o=$m(t);return Wf.reduce(function(n,a){return n.concat(o.filter(function(l){return l.phase===a}))},[])}function vm(t){var o;return function(){return o||(o=new Promise(function(n){Promise.resolve().then(function(){o=void 0,n(t())})})),o}}function Dm(t){var o=t.reduce(function(n,a){var l=n[a.name];return n[a.name]=l?Object.assign({},l,a,{options:Object.assign({},l.options,a.options),data:Object.assign({},l.data,a.data)}):a,n},{});return Object.keys(o).map(function(n){return o[n]})}var Tr={placement:"bottom",modifiers:[],strategy:"absolute"};function Nr(){for(var t=arguments.length,o=new Array(t),n=0;n<t;n++)o[n]=arguments[n];return!o.some(function(a){return!(a&&typeof a.getBoundingClientRect=="function")})}function Mm(t){t===void 0&&(t={});var o=t,n=o.defaultModifiers,a=n===void 0?[]:n,l=o.defaultOptions,r=l===void 0?Tr:l;return function(c,i,d){d===void 0&&(d=r);var p={placement:"bottom",orderedModifiers:[],options:Object.assign({},Tr,r),modifiersData:{},elements:{reference:c,popper:i},attributes:{},styles:{}},u=[],m=!1,C={state:p,setOptions:function(h){var y=typeof h=="function"?h(p.options):h;b(),p.options=Object.assign({},r,p.options,y),p.scrollParents={reference:kt(c)?fo(c):c.contextElement?fo(c.contextElement):[],popper:fo(i)};var N=Im(Dm([].concat(a,p.options.modifiers)));return p.orderedModifiers=N.filter(function(w){return w.enabled}),g(),C.update()},forceUpdate:function(){if(!m){var h=p.elements,y=h.reference,N=h.popper;if(Nr(y,N)){p.rects={reference:Fm(y,po(N),p.options.strategy==="fixed"),popper:Qn(N)},p.reset=!1,p.placement=p.options.placement,p.orderedModifiers.forEach(function(T){return p.modifiersData[T.name]=Object.assign({},T.data)});for(var w=0;w<p.orderedModifiers.length;w++){if(p.reset===!0){p.reset=!1,w=-1;continue}var x=p.orderedModifiers[w],S=x.fn,A=x.options,v=A===void 0?{}:A,D=x.name;typeof S=="function"&&(p=S({state:p,options:v,name:D,instance:C})||p)}}}},update:vm(function(){return new Promise(function(f){C.forceUpdate(),f(p)})}),destroy:function(){b(),m=!0}};if(!Nr(c,i))return C;C.setOptions(d).then(function(f){!m&&d.onFirstUpdate&&d.onFirstUpdate(f)});function g(){p.orderedModifiers.forEach(function(f){var h=f.name,y=f.options,N=y===void 0?{}:y,w=f.effect;if(typeof w=="function"){var x=w({state:p,name:h,instance:C,options:N}),S=function(){};u.push(x||S)}})}function b(){u.forEach(function(f){return f()}),u=[]}return C}}var Pm=[sm,Nm,rm,Kf,Sm,Cm,Om,om,km],jm=Mm({defaultModifiers:Pm});function na(t,o){(o==null||o>t.length)&&(o=t.length);for(var n=0,a=new Array(o);n<o;n++)a[n]=t[n];return a}function Ar(t,o){if(t){if(typeof t=="string")return na(t,o);var n=Object.prototype.toString.call(t).slice(8,-1);return n==="Object"&&t.constructor&&(n=t.constructor.name),n==="Map"||n==="Set"?Array.from(t):n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?na(t,o):void 0}}function Rm(t){return function(o){if(Array.isArray(o))return na(o)}(t)||function(o){if(typeof Symbol<"u"&&o[Symbol.iterator]!=null||o["@@iterator"]!=null)return Array.from(o)}(t)||Ar(t)||function(){throw new TypeError(`Invalid attempt to spread non-iterable instance.
|
|
73
73
|
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}()}function Ut(t){return Ut=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(o){return typeof o}:function(o){return o&&typeof Symbol=="function"&&o.constructor===Symbol&&o!==Symbol.prototype?"symbol":typeof o},Ut(t)}function Er(t,o,n,a,l,r,s){try{var c=t[r](s),i=c.value}catch(d){return void n(d)}c.done?o(i):Promise.resolve(i).then(a,l)}function Or(t){return function(){var o=this,n=arguments;return new Promise(function(a,l){var r=t.apply(o,n);function s(i){Er(r,a,l,s,c,"next",i)}function c(i){Er(r,a,l,s,c,"throw",i)}s(void 0)})}}var Br={exports:{}},Vr={exports:{}};(function(t){function o(n){return t.exports=o=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(a){return typeof a}:function(a){return a&&typeof Symbol=="function"&&a.constructor===Symbol&&a!==Symbol.prototype?"symbol":typeof a},t.exports.__esModule=!0,t.exports.default=t.exports,o(n)}t.exports=o,t.exports.__esModule=!0,t.exports.default=t.exports})(Vr),function(t){var o=Vr.exports.default;function n(){t.exports=n=function(){return l},t.exports.__esModule=!0,t.exports.default=t.exports;var a,l={},r=Object.prototype,s=r.hasOwnProperty,c=Object.defineProperty||function(O,V,k){O[V]=k.value},i=typeof Symbol=="function"?Symbol:{},d=i.iterator||"@@iterator",p=i.asyncIterator||"@@asyncIterator",u=i.toStringTag||"@@toStringTag";function m(O,V,k){return Object.defineProperty(O,V,{value:k,enumerable:!0,configurable:!0,writable:!0}),O[V]}try{m({},"")}catch{m=function(V,k,L){return V[k]=L}}function C(O,V,k,L){var M=V&&V.prototype instanceof w?V:w,U=Object.create(M.prototype),z=new P(L||[]);return c(U,"_invoke",{value:F(O,k,z)}),U}function g(O,V,k){try{return{type:"normal",arg:O.call(V,k)}}catch(L){return{type:"throw",arg:L}}}l.wrap=C;var b="suspendedStart",f="suspendedYield",h="executing",y="completed",N={};function w(){}function x(){}function S(){}var A={};m(A,d,function(){return this});var v=Object.getPrototypeOf,D=v&&v(v(I([])));D&&D!==r&&s.call(D,d)&&(A=D);var T=S.prototype=w.prototype=Object.create(A);function R(O){["next","throw","return"].forEach(function(V){m(O,V,function(k){return this._invoke(V,k)})})}function $(O,V){function k(M,U,z,q){var X=g(O[M],O,U);if(X.type!=="throw"){var J=X.arg,oe=J.value;return oe&&o(oe)=="object"&&s.call(oe,"__await")?V.resolve(oe.__await).then(function(le){k("next",le,z,q)},function(le){k("throw",le,z,q)}):V.resolve(oe).then(function(le){J.value=le,z(J)},function(le){return k("throw",le,z,q)})}q(X.arg)}var L;c(this,"_invoke",{value:function(M,U){function z(){return new V(function(q,X){k(M,U,q,X)})}return L=L?L.then(z,z):z()}})}function F(O,V,k){var L=b;return function(M,U){if(L===h)throw new Error("Generator is already running");if(L===y){if(M==="throw")throw U;return{value:a,done:!0}}for(k.method=M,k.arg=U;;){var z=k.delegate;if(z){var q=_(z,k);if(q){if(q===N)continue;return q}}if(k.method==="next")k.sent=k._sent=k.arg;else if(k.method==="throw"){if(L===b)throw L=y,k.arg;k.dispatchException(k.arg)}else k.method==="return"&&k.abrupt("return",k.arg);L=h;var X=g(O,V,k);if(X.type==="normal"){if(L=k.done?y:f,X.arg===N)continue;return{value:X.arg,done:k.done}}X.type==="throw"&&(L=y,k.method="throw",k.arg=X.arg)}}}function _(O,V){var k=V.method,L=O.iterator[k];if(L===a)return V.delegate=null,k==="throw"&&O.iterator.return&&(V.method="return",V.arg=a,_(O,V),V.method==="throw")||k!=="return"&&(V.method="throw",V.arg=new TypeError("The iterator does not provide a '"+k+"' method")),N;var M=g(L,O.iterator,V.arg);if(M.type==="throw")return V.method="throw",V.arg=M.arg,V.delegate=null,N;var U=M.arg;return U?U.done?(V[O.resultName]=U.value,V.next=O.nextLoc,V.method!=="return"&&(V.method="next",V.arg=a),V.delegate=null,N):U:(V.method="throw",V.arg=new TypeError("iterator result is not an object"),V.delegate=null,N)}function B(O){var V={tryLoc:O[0]};1 in O&&(V.catchLoc=O[1]),2 in O&&(V.finallyLoc=O[2],V.afterLoc=O[3]),this.tryEntries.push(V)}function E(O){var V=O.completion||{};V.type="normal",delete V.arg,O.completion=V}function P(O){this.tryEntries=[{tryLoc:"root"}],O.forEach(B,this),this.reset(!0)}function I(O){if(O||O===""){var V=O[d];if(V)return V.call(O);if(typeof O.next=="function")return O;if(!isNaN(O.length)){var k=-1,L=function M(){for(;++k<O.length;)if(s.call(O,k))return M.value=O[k],M.done=!1,M;return M.value=a,M.done=!0,M};return L.next=L}}throw new TypeError(o(O)+" is not iterable")}return x.prototype=S,c(T,"constructor",{value:S,configurable:!0}),c(S,"constructor",{value:x,configurable:!0}),x.displayName=m(S,u,"GeneratorFunction"),l.isGeneratorFunction=function(O){var V=typeof O=="function"&&O.constructor;return!!V&&(V===x||(V.displayName||V.name)==="GeneratorFunction")},l.mark=function(O){return Object.setPrototypeOf?Object.setPrototypeOf(O,S):(O.__proto__=S,m(O,u,"GeneratorFunction")),O.prototype=Object.create(T),O},l.awrap=function(O){return{__await:O}},R($.prototype),m($.prototype,p,function(){return this}),l.AsyncIterator=$,l.async=function(O,V,k,L,M){M===void 0&&(M=Promise);var U=new $(C(O,V,k,L),M);return l.isGeneratorFunction(V)?U:U.next().then(function(z){return z.done?z.value:U.next()})},R(T),m(T,u,"Generator"),m(T,d,function(){return this}),m(T,"toString",function(){return"[object Generator]"}),l.keys=function(O){var V=Object(O),k=[];for(var L in V)k.push(L);return k.reverse(),function M(){for(;k.length;){var U=k.pop();if(U in V)return M.value=U,M.done=!1,M}return M.done=!0,M}},l.values=I,P.prototype={constructor:P,reset:function(O){if(this.prev=0,this.next=0,this.sent=this._sent=a,this.done=!1,this.delegate=null,this.method="next",this.arg=a,this.tryEntries.forEach(E),!O)for(var V in this)V.charAt(0)==="t"&&s.call(this,V)&&!isNaN(+V.slice(1))&&(this[V]=a)},stop:function(){this.done=!0;var O=this.tryEntries[0].completion;if(O.type==="throw")throw O.arg;return this.rval},dispatchException:function(O){if(this.done)throw O;var V=this;function k(X,J){return U.type="throw",U.arg=O,V.next=X,J&&(V.method="next",V.arg=a),!!J}for(var L=this.tryEntries.length-1;L>=0;--L){var M=this.tryEntries[L],U=M.completion;if(M.tryLoc==="root")return k("end");if(M.tryLoc<=this.prev){var z=s.call(M,"catchLoc"),q=s.call(M,"finallyLoc");if(z&&q){if(this.prev<M.catchLoc)return k(M.catchLoc,!0);if(this.prev<M.finallyLoc)return k(M.finallyLoc)}else if(z){if(this.prev<M.catchLoc)return k(M.catchLoc,!0)}else{if(!q)throw new Error("try statement without catch or finally");if(this.prev<M.finallyLoc)return k(M.finallyLoc)}}}},abrupt:function(O,V){for(var k=this.tryEntries.length-1;k>=0;--k){var L=this.tryEntries[k];if(L.tryLoc<=this.prev&&s.call(L,"finallyLoc")&&this.prev<L.finallyLoc){var M=L;break}}M&&(O==="break"||O==="continue")&&M.tryLoc<=V&&V<=M.finallyLoc&&(M=null);var U=M?M.completion:{};return U.type=O,U.arg=V,M?(this.method="next",this.next=M.finallyLoc,N):this.complete(U)},complete:function(O,V){if(O.type==="throw")throw O.arg;return O.type==="break"||O.type==="continue"?this.next=O.arg:O.type==="return"?(this.rval=this.arg=O.arg,this.method="return",this.next="end"):O.type==="normal"&&V&&(this.next=V),N},finish:function(O){for(var V=this.tryEntries.length-1;V>=0;--V){var k=this.tryEntries[V];if(k.finallyLoc===O)return this.complete(k.completion,k.afterLoc),E(k),N}},catch:function(O){for(var V=this.tryEntries.length-1;V>=0;--V){var k=this.tryEntries[V];if(k.tryLoc===O){var L=k.completion;if(L.type==="throw"){var M=L.arg;E(k)}return M}}throw new Error("illegal catch attempt")},delegateYield:function(O,V,k){return this.delegate={iterator:I(O),resultName:V,nextLoc:k},this.method==="next"&&(this.arg=a),N}},l}t.exports=n,t.exports.__esModule=!0,t.exports.default=t.exports}(Br);var vo=Br.exports(),Do=vo;try{regeneratorRuntime=vo}catch{typeof globalThis=="object"?globalThis.regeneratorRuntime=vo:Function("r","regeneratorRuntime = r")(vo)}function Um(t){var o=function(n,a){if(Ut(n)!=="object"||n===null)return n;var l=n[Symbol.toPrimitive];if(l!==void 0){var r=l.call(n,a||"default");if(Ut(r)!=="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(a==="string"?String:Number)(n)}(t,"string");return Ut(o)==="symbol"?o:String(o)}function aa(t,o,n){return(o=Um(o))in t?Object.defineProperty(t,o,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[o]=n,t}var Mo=e.defineComponent({name:"Saturation",props:{size:{type:Number,default:160},hue:{type:Number,default:0},saturation:{type:Number,default:0},value:{type:Number,default:0}},emits:["change"],setup:function(t,o){var n=o.emit,a=e.computed(function(){return{width:"".concat(t.size,"px"),height:"".concat(t.size,"px"),background:"hsl(".concat(t.hue,", 100%, 50%)")}});return{saturationStyle:a,sliderStyle:e.computed(function(){return{top:"".concat((100-t.value)/100*t.size-5,"px"),left:"".concat(t.saturation*t.size/100-5,"px"),width:"".concat(10,"px"),height:"".concat(10,"px")}}),onSelect:function(l){var r=l.target.getBoundingClientRect(),s=r.left,c=r.top,i=function(d){var p=d.clientX,u=d.clientY,m=p-s,C=u-c;m<0&&(m=0),C<0&&(C=0),m>t.size&&(m=t.size),C>t.size&&(C=t.size);var g=m/t.size*100,b=100-C/t.size*100;n("change",g,b)};i(l),document.addEventListener("mousemove",i),document.addEventListener("mouseup",function d(){document.removeEventListener("mousemove",i),document.removeEventListener("mouseup",d)})}}}}),Lr=function(t){return e.pushScopeId("data-v-24517fec"),t=t(),e.popScopeId(),t},zm=Lr(function(){return e.createElementVNode("div",{class:"saturation-white"},null,-1)}),Gm=Lr(function(){return e.createElementVNode("div",{class:"saturation-black"},null,-1)});function nt(t,o){o===void 0&&(o={});var n=o.insertAt;if(t&&typeof document<"u"){var a=document.head||document.getElementsByTagName("head")[0],l=document.createElement("style");l.type="text/css",n==="top"&&a.firstChild?a.insertBefore(l,a.firstChild):a.appendChild(l),l.styleSheet?l.styleSheet.cssText=t:l.appendChild(document.createTextNode(t))}}nt(".saturation[data-v-24517fec]{position:relative}.saturation-black[data-v-24517fec],.saturation-white[data-v-24517fec]{cursor:pointer;height:100%;left:0;position:absolute;top:0;width:100%}.saturation-white[data-v-24517fec]{background:linear-gradient(90deg,#fff,hsla(0,0%,100%,0))}.saturation-black[data-v-24517fec]{background:linear-gradient(0deg,#000,transparent)}.slider[data-v-24517fec]{border:1px solid #fff;border-radius:50%;box-shadow:0 0 1px 1px rgba(0,0,0,.3);left:0;pointer-events:none;position:absolute;top:0;z-index:1}"),Mo.render=function(t,o,n,a,l,r){return e.openBlock(),e.createElementBlock("div",{class:"saturation",style:e.normalizeStyle(t.saturationStyle),onMousedown:o[0]||(o[0]=e.withModifiers(function(){return t.onSelect&&t.onSelect.apply(t,arguments)},["prevent","stop"]))},[zm,Gm,e.createElementVNode("div",{class:"slider",style:e.normalizeStyle(t.sliderStyle)},null,4)],36)},Mo.__scopeId="data-v-24517fec",Mo.__file="src/picker/Saturation.vue";var Po=e.defineComponent({name:"Hue",props:{width:{type:Number,default:15},height:{type:Number,default:160},hue:{type:Number,default:0}},emits:["change"],setup:function(t,o){var n=o.emit,a=e.computed(function(){return{top:"".concat((1-t.hue/360)*t.height-2,"px"),height:"".concat(4,"px")}}),l=e.ref();return e.onMounted(function(){(function(){l.value.width=t.width,l.value.height=t.height;var r=l.value.getContext("2d"),s=r.createLinearGradient(0,0,0,t.height);s.addColorStop(0,"#FF0000"),s.addColorStop(.17,"#FF00FF"),s.addColorStop(.34,"#0000FF"),s.addColorStop(.51,"#00FFFF"),s.addColorStop(.68,"#00FF00"),s.addColorStop(.17*5,"#FFFF00"),s.addColorStop(1,"#FF0000"),r.fillStyle=s,r.fillRect(0,0,t.width,t.height)})()}),{canvas:l,sliderStyle:a,onSelect:function(r){var s=r.target.getBoundingClientRect().top,c=function(i){var d=i.clientY-s;d<0&&(d=0),d>t.height&&(d=t.height);var p=-100*d/t.height+100;n("change",360*p/100)};c(r),document.addEventListener("mousemove",c),document.addEventListener("mouseup",function i(){document.removeEventListener("mousemove",c),document.removeEventListener("mouseup",i)})}}}}),Hm={ref:"canvas"};nt(".hue[data-v-78b9f4f0]{position:relative}.slider[data-v-78b9f4f0]{background:#fff;box-shadow:0 0 1px 0 rgba(0,0,0,.3);left:0;pointer-events:none;position:absolute;width:100%;z-index:1}"),Po.render=function(t,o,n,a,l,r){return e.openBlock(),e.createElementBlock("div",{class:"hue",onMousedown:o[0]||(o[0]=e.withModifiers(function(){return t.onSelect&&t.onSelect.apply(t,arguments)},["prevent","stop"]))},[e.createElementVNode("canvas",Hm,null,512),e.createElementVNode("div",{class:"slider",style:e.normalizeStyle(t.sliderStyle)},null,4)],32)},Po.__scopeId="data-v-78b9f4f0",Po.__file="src/picker/Hue.vue";var jo=e.defineComponent({name:"Alpha",props:{width:{type:Number,default:15},height:{type:Number,default:160},color:{type:String,default:"#000000"},alpha:{type:Number,default:1}},setup:function(t,o){var n=o.emit,a=e.computed(function(){return{top:"".concat(t.alpha*t.height-2,"px"),height:"".concat(4,"px")}}),l=e.ref(),r=function(){var s=l.value.getContext("2d");l.value.width=t.width,l.value.height=t.height;var c=function(d){var p=document.createElement("canvas"),u=p.getContext("2d"),m=2*d;return p.width=m,p.height=m,u.fillStyle="#ffffff",u.fillRect(0,0,m,m),u.fillStyle="#ccd5db",u.fillRect(0,0,d,d),u.fillRect(d,d,d,d),p}(5);s.fillStyle=s.createPattern(c,"repeat"),s.fillRect(0,0,t.width,t.height);var i=s.createLinearGradient(0,0,0,t.height);i.addColorStop(.01,"rgba(255,255,255,0)"),i.addColorStop(.99,t.color),s.fillStyle=i,s.fillRect(0,0,t.width,t.height)};return e.watch(function(){return t.color},function(){r()}),e.onMounted(function(){r()}),{canvas:l,sliderStyle:a,onSelect:function(s){var c=s.target.getBoundingClientRect().top,i=function(d){var p=d.clientY-c;p<0&&(p=0),p>t.height&&(p=t.height);var u=parseFloat((p/t.height).toFixed(2));n("change",u)};i(s),document.addEventListener("mousemove",i),document.addEventListener("mouseup",function d(){document.removeEventListener("mousemove",i),document.removeEventListener("mouseup",d)})}}}}),Wm={ref:"canvas"};nt(".alpha[data-v-24dc9656]{position:relative}.slider[data-v-24dc9656]{background:#fff;box-shadow:0 0 1px 0 rgba(0,0,0,.3);left:0;pointer-events:none;position:absolute;width:100%;z-index:1}"),jo.render=function(t,o,n,a,l,r){return e.openBlock(),e.createElementBlock("div",{class:"alpha",onMousedown:o[0]||(o[0]=e.withModifiers(function(){return t.onSelect&&t.onSelect.apply(t,arguments)},["prevent","stop"]))},[e.createElementVNode("canvas",Wm,null,512),e.createElementVNode("div",{class:"slider",style:e.normalizeStyle(t.sliderStyle)},null,4)],32)},jo.__scopeId="data-v-24dc9656",jo.__file="src/picker/Alpha.vue";var Ro=e.defineComponent({name:"Input",props:{label:{type:String,default:"RGBA"},value:{type:String,default:""},width:{type:Number,default:168}},emits:["change","focus","blur","enter"],setup:function(t,o){var n=o.emit;return{onInput:function(a){var l;n("change",(l=a.target)===null||l===void 0?void 0:l.value)},valueStyle:e.computed(function(){return{minWidth:"".concat(t.width,"px"),maxWidth:"".concat(t.width,"px"),width:"".concat(t.width,"px")}}),onFocus:function(){n("focus")},onBlur:function(){n("blur")},onEnter:function(){n("enter")}}}}),Ym={class:"input"},qm={class:"label"},Km=[".value"];function ho(t,o){return function(n){if(Array.isArray(n))return n}(t)||function(n,a){var l=n==null?null:typeof Symbol<"u"&&n[Symbol.iterator]||n["@@iterator"];if(l!=null){var r,s,c,i,d=[],p=!0,u=!1;try{if(c=(l=l.call(n)).next,a===0){if(Object(l)!==l)return;p=!1}else for(;!(p=(r=c.call(l)).done)&&(d.push(r.value),d.length!==a);p=!0);}catch(m){u=!0,s=m}finally{try{if(!p&&l.return!=null&&(i=l.return(),Object(i)!==i))return}finally{if(u)throw s}}return d}}(t,o)||Ar(t,o)||function(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
|
|
74
|
-
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}()}function Fr(t,o){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(t);o&&(a=a.filter(function(l){return Object.getOwnPropertyDescriptor(t,l).enumerable})),n.push.apply(n,a)}return n}function Re(t){for(var o=1;o<arguments.length;o++){var n=arguments[o]!=null?arguments[o]:{};o%2?Fr(Object(n),!0).forEach(function(a){aa(t,a,n[a])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):Fr(Object(n)).forEach(function(a){Object.defineProperty(t,a,Object.getOwnPropertyDescriptor(n,a))})}return t}nt(".input[data-v-d52a4d02]{display:inline-block;font-size:12px}.label[data-v-d52a4d02]{align-items:center;background:#e7e8e9;color:#999;display:flex;float:left;font-weight:500;height:30px;justify-content:center;width:45px}[pick-colors-theme=dark] .label[data-v-d52a4d02]{background:#252930;color:#999}.value[data-v-d52a4d02]{background:#eceef0;border:1px solid #eceef0;box-sizing:border-box;color:#666;flex:1;height:30px;text-align:center}[pick-colors-theme=dark] .value[data-v-d52a4d02]{background:#2e333a;border:1px solid #2e333a;color:#fff}.value[data-v-d52a4d02]:focus{border:1px solid #1890ff;outline:none}"),Ro.render=function(t,o,n,a,l,r){return e.openBlock(),e.createElementBlock("div",Ym,[e.createElementVNode("span",qm,e.toDisplayString(t.label),1),e.createElementVNode("input",{class:"value",style:e.normalizeStyle(t.valueStyle),".value":t.value,onFocus:o[0]||(o[0]=function(){return t.onFocus&&t.onFocus.apply(t,arguments)}),onInput:o[1]||(o[1]=function(){return t.onInput&&t.onInput.apply(t,arguments)}),onBlur:o[2]||(o[2]=function(){return t.onBlur&&t.onBlur.apply(t,arguments)}),onKeydown:o[3]||(o[3]=e.withKeys(function(){return t.onEnter&&t.onEnter.apply(t,arguments)},["enter"]))},null,44,Km)])},Ro.__scopeId="data-v-d52a4d02",Ro.__file="src/picker/InputValue.vue";var $r=function(t,o,n){return[t,o*n/((t=(2-o)*n)<1?t:2-t)||0,t/2]},Ir={10:"A",11:"B",12:"C",13:"D",14:"E",15:"F"},Uo=function(t){t=Math.min(Math.round(t),255);var o=Math.floor(t/16),n=t%16;return"".concat(Ir[o]||o).concat(Ir[n]||n)},vr=function(t){var o=t.r,n=t.g,a=t.b;return isNaN(o)||isNaN(n)||isNaN(a)?"":"#".concat(Uo(o)).concat(Uo(n)).concat(Uo(a))},zt=function(t,o){var n;typeof(n=t)=="string"&&n.indexOf(".")!==-1&&parseFloat(n)===1&&(t="100%");var a=function(l){return typeof l=="string"&&l.indexOf("%")!==-1}(t);return t=Math.min(o,Math.max(0,parseFloat("".concat(t)))),a&&(t=parseInt("".concat(t*o),10)/100),Math.abs(t-o)<1e-6?1:t%o/parseFloat(o)},bo=function(t,o,n){t=6*zt(t,360),o=zt(o,100),n=zt(n,100);var a=Math.floor(t),l=t-a,r=n*(1-o),s=n*(1-l*o),c=n*(1-(1-l)*o),i=a%6,d=[n,s,r,r,c,n][i],p=[c,n,n,s,r,r][i],u=[r,r,c,n,n,s][i];return{r:Math.round(255*d),g:Math.round(255*p),b:Math.round(255*u)}},Dr=function(t,o,n){var a=t.h,l=t.s,r=t.v,s=t.a;if(n)switch(o){case"hsl":var c=$r(a,l/100,r/100);return"hsla(".concat(a.toFixed(0),", ").concat(Math.round(100*c[1]),"%, ").concat(Math.round(100*c[2]),"%, ").concat(s,")");case"hsv":return"hsva(".concat(a.toFixed(0),", ").concat(Math.round(l),"%, ").concat(Math.round(r),"%, ").concat(s,")");case"rgb":var i=bo(a,l,r),d=i.r,p=i.g,u=i.b;return"rgba(".concat(d,", ").concat(p,", ").concat(u,", ").concat(s,")");default:return"".concat(vr(bo(a,l,r))).concat(Uo(255*s))}else switch(o){case"hsl":var m=$r(a,l/100,r/100);return"hsl(".concat(a.toFixed(0),", ").concat(Math.round(100*m[1]),"%, ").concat(Math.round(100*m[2]),"%)");case"hsv":return"hsv(".concat(a.toFixed(0),", ").concat(Math.round(l),"%, ").concat(Math.round(r),"%)");case"rgb":var C=bo(a,l,r),g=C.r,b=C.g,f=C.b;return"rgb(".concat(g,", ").concat(b,", ").concat(f,")");default:return vr(bo(a,l,r))}},zo=function(t){var o=t.r,n=t.g,a=t.b;o=zt(o,255),n=zt(n,255),a=zt(a,255);var l,r=Math.max(o,n,a),s=Math.min(o,n,a),c=r,i=r-s,d=r===0?0:i/r;if(r===s)l=0;else{switch(r){case o:l=(n-a)/i+(n<a?6:0);break;case n:l=(a-o)/i+2;break;case a:l=(o-n)/i+4}l/=6}return{h:360*l,s:100*d,v:100*c}},Mr=function(t){var o=t.h,n=t.s,a=t.l;a/=100;var l=n/=100,r=Math.max(a,.01);return n*=(a*=2)<=1?a:2-a,l*=r<=1?r:2-r,{h:+o,s:100*(a===0?2*l/(r+l):2*n/(a+n)),v:100*((a+n)/2)}},Pr=function(t){var o=[];if(t.match(/^#([0-9a-fA-f]{3,4})$/g))for(var n=1;n<t.length;n++)o.push(parseInt("0x"+t[n].repeat(2)));else if(t.match(/^#([0-9a-fA-f]{6}|[0-9a-fA-f]{8})$/g))for(var a=1;a<t.length;a+=2)o.push(parseInt("0x"+t.slice(a,a+2)));return{r:o[0],g:o[1],b:o[2],a:o[3]}},la=function(t,o,n){if(typeof t=="string"&&t!==""){var a=ra(t,ia(t),n),l=zr(a);return Dr(l,o,n)}return""},jr=function(t){var o=ho(t.match(/(\d(\.\d+)?)+/g),4);return{r:o[0],g:o[1],b:o[2],a:o[3]}},Rr=function(t){var o=ho(t.match(/(\d(\.\d+)?)+/g),4),n=o[0],a=o[1],l=o[2],r=o[3];return{h:n,s:parseFloat(a),l:parseFloat(l),a:r}},Ur=function(t){var o=ho(t.match(/(\d(\.\d+)?)+/g),4),n=o[0],a=o[1],l=o[2],r=o[3];return{h:parseFloat(n),s:parseFloat(a),v:parseFloat(l),a:parseFloat(r)}},ra=function(t,o){if(!(arguments.length>2&&arguments[2]!==void 0)||arguments[2])switch(o){case"rgb":var n=jr(t),a=n.r,l=n.g,r=n.b,s=n.a;return Re(Re({},zo({r:a,g:l,b:r})),{},{a:+s});case"hsv":var c=Ur(t);return{h:c.h,s:c.s,v:c.v,a:c.a};case"hsl":var i=Rr(t),d=i.h,p=i.s,u=i.l,m=i.a;return Re(Re({},Mr({h:d,s:p,l:u})),{},{a:+m});default:var C=Pr(t),g=C.r,b=C.g,f=C.b,h=C.a;return Re(Re({},zo({r:g,g:b,b:f})),{},{a:h/255})}else switch(o){case"rgb":return Re(Re({},zo(jr(t))),{},{a:1});case"hsv":var y=Ur(t);return{h:y.h,s:y.s,v:y.v,a:1};case"hsl":return Re(Re({},Mr(Rr(t))),{},{a:1});default:return Re(Re({},zo(Pr(t))),{},{a:1})}},ia=function(t){return t.match(/^#/)?"hex":t.match(/^rgb/)?"rgb":t.match(/^hsl/)?"hsl":t.match(/^hsv/)?"hsv":"hex"},zr=function(t){var o=t.h,n=t.s,a=t.v,l=t.a;return isNaN(o)&&(o=0),isNaN(n)&&(n=0),isNaN(a)&&(a=0),isNaN(l)&&(l=1),{h:o,s:n,v:a,a:l}},yo=e.defineComponent({name:"ColorItem",props:{size:{type:[Number,String],default:20},width:{type:[Number,String]},height:{type:[Number,String]},value:{type:String,default:""},border:{type:Boolean,default:!0},borderRadius:{type:Number,default:5},selected:{type:Boolean,default:!1},draggable:{type:Boolean,default:!1}},emits:["select"],setup:function(t){var o=e.ref(),n=e.inject("theme",{theme:"light"}).theme,a=e.computed(function(){return parseFloat((t.width||t.size)+"")}),l=e.computed(function(){return parseFloat((t.height||t.size)+"")}),r=e.computed(function(){return{width:"".concat(e.unref(a),"px"),height:"".concat(e.unref(l),"px"),border:t.border?"1px solid ".concat(e.unref(n)==="dark"?"#434345":"#d9d9d9"):"",borderRadius:"".concat(t.borderRadius,"px"),boxShadow:t.selected?"0 0 3px 2px ".concat(e.unref(n)==="dark"?"#2681ff":"#1890ff"):""}}),s=function(){var c=o.value.getContext("2d");o.value.width=e.unref(a),o.value.height=e.unref(l);var i=function(d){var p=document.createElement("canvas"),u=p.getContext("2d"),m=2*d;return p.width=m,p.height=m,u.fillStyle="#ffffff",u.fillRect(0,0,m,m),u.fillStyle="#ccd5db",u.fillRect(0,0,d,d),u.fillRect(d,d,d,d),p}(5);c.fillStyle=c.createPattern(i,"repeat"),c.fillRect(0,0,e.unref(a),e.unref(l)),c.fillStyle=t.value,c.fillRect(0,0,e.unref(a),e.unref(l))};return e.watch(function(){return t.value},function(){s()}),e.onMounted(function(){s()}),{canvas:o,colorItemStyle:r}}}),Xm=["draggable"];nt(".color-item[data-v-02da71fd]{display:inline-block;vertical-align:top}"),yo.render=function(t,o,n,a,l,r){return e.openBlock(),e.createElementBlock("canvas",{class:"color-item",style:e.normalizeStyle(t.colorItemStyle),ref:"canvas",draggable:t.draggable},null,12,Xm)},yo.__scopeId="data-v-02da71fd",yo.__file="src/color-item/ColorItem.vue";var Go=e.defineComponent({name:"Colors",components:{ColorItem:yo},props:{colors:{type:Array,default:function(){return[]}},selectedIndex:{type:Number,default:-1}},emits:["change"],setup:function(t,o){var n=o.emit;return{onSelectColor:function(a,l){n("change",a,l)},useColors:e.computed(function(){return t.colors.map(function(a){return la(a,"hex",!0)})})}}}),Qm={class:"colors"};function Gr(t,o){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(t);o&&(a=a.filter(function(l){return Object.getOwnPropertyDescriptor(t,l).enumerable})),n.push.apply(n,a)}return n}function Xe(t){for(var o=1;o<arguments.length;o++){var n=arguments[o]!=null?arguments[o]:{};o%2?Gr(Object(n),!0).forEach(function(a){aa(t,a,n[a])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):Gr(Object(n)).forEach(function(a){Object.defineProperty(t,a,Object.getOwnPropertyDescriptor(n,a))})}return t}nt(".colors[data-v-0f8b52a8]{align-items:center;display:flex;flex-wrap:wrap;margin-top:5px}.color-item[data-v-0f8b52a8]{margin:5px}"),Go.render=function(t,o,n,a,l,r){var s=e.resolveComponent("color-item");return e.openBlock(),e.createElementBlock("div",Qm,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(t.useColors,function(c,i){return e.openBlock(),e.createBlock(s,{key:i,class:"color-item",size:16,value:c,border:!1,"border-radius":3,selected:t.selectedIndex===i,onClick:e.withModifiers(function(d){return t.onSelectColor(c,+i)},["stop","prevent"])},null,8,["value","selected","onClick"])}),128))])},Go.__scopeId="data-v-0f8b52a8",Go.__file="src/picker/Colors.vue";var Ho=e.defineComponent({name:"Picker",components:{Colors:Go,Saturation:Mo,Hue:Po,Alpha:jo,InputValue:Ro},props:{format:{type:String,default:"hex"},showAlpha:{type:Boolean,default:!1},value:{type:String,default:""},colors:{type:Array,default:function(){return[]}},style:{type:Object,default:function(){return{}}}},emits:["change","update:value"],setup:function(t,o){var n=o.emit,a=e.computed(function(){return Xe(Xe({},t.style),{},{width:t.showAlpha?"230px":"205px"})}),l=e.computed(function(){return t.showAlpha?165:140}),r=e.ref(),s=e.ref(),c=e.ref(),i=function(){var y,N=(y=t.value)===null||y===void 0?void 0:y.trim();if(N!=null&&N!==""){var w=ia(N);return zr(ra(N,w,t.showAlpha))}return null};e.watch(function(){return t.value},function(){t.value!==e.unref(c)&&(r.value=i())},{immediate:!0}),e.watch(r,function(y,N){var w="";y!=null?(w=Dr(Xe({},y),t.format,t.showAlpha),s.value=Xe({},y)):s.value=null,c.value=w;var x=i();JSON.stringify(y)!==JSON.stringify(x)&&JSON.stringify(y)!==JSON.stringify(N)&&n("change",w)},{immediate:!0});var d=e.computed(function(){var y;return((y=e.unref(r))===null||y===void 0?void 0:y.h)||0}),p=e.computed(function(){var y;return((y=e.unref(r))===null||y===void 0?void 0:y.s)||0}),u=e.computed(function(){var y;return((y=e.unref(r))===null||y===void 0?void 0:y.v)||0}),m=e.computed(function(){var y,N;return((y=e.unref(r))===null||y===void 0?void 0:y.a)!=null?(N=e.unref(r))===null||N===void 0?void 0:N.a:1}),C=e.computed(function(){return bo(e.unref(d),e.unref(p),e.unref(u))}),g=e.computed(function(){return"rgb(".concat(e.unref(C).r,", ").concat(e.unref(C).g,", ").concat(e.unref(C).b,")")}),b=e.computed(function(){var y=t.format;if(t.showAlpha)switch(y){case"hsv":return"HSVA";case"hsl":return"HSLA";case"rgb":return"RGBA";default:return"HEX"}else switch(y){case"hsv":return"HSV";case"hsl":return"HSL";case"rgb":return"RGB";default:return"HEX"}}),f=e.ref(-1),h=function(y,N,w){if(y.length!==0){var x=ra(y,N,w),S=x.h,A=x.s,v=x.v;if(!(isNaN(S)||isNaN(A)||isNaN(v))){var D=1,T=x.a;isNaN(T)||(D=T),r.value={h:S,s:A,v,a:D}}}};return{h:d,s:p,v:u,a:m,rgbStr:g,onSelectSaturation:function(y,N){f.value=-1,e.unref(r)==null?r.value={h:e.unref(d),s:y,v:N,a:e.unref(m)}:r.value=Xe(Xe({},e.unref(r)),{},{s:y,v:N})},onSelectHue:function(y){f.value=-1,e.unref(r)==null&&(r.value={h:y,s:e.unref(p),v:e.unref(u),a:e.unref(m)}),r.value=Xe(Xe({},e.unref(r)),{},{h:y})},onSelectAlpha:function(y){f.value=-1,e.unref(r)==null?r.value={h:e.unref(d),s:e.unref(p),v:e.unref(u),a:y}:r.value=Xe(Xe({},e.unref(r)),{},{a:y})},label:b,colorValue:c,pickerStyle:a,inputWidth:l,onInputChange:function(y){f.value=-1,c.value=y},handleChange:function(){var y,N=(y=e.unref(c))===null||y===void 0?void 0:y.trim();if(N!==""){var w=t.showAlpha,x=t.format,S=function(A,v,D){if(D)switch(v){case"rgb":return/^[rR][gG][Bb][Aa][(]([\s]*(2[0-4][0-9]|25[0-5]|[01]?[0-9][0-9]?)[\s]*,){3}[\s]*(1|1.0|0|0.[0-9]|0.[0-9][0-9])[\s]*[)]{1}$/.test(A);case"hsv":return/^[hH][Ss][Vv][Aa][(]([\s]*(2[0-9][0-9]|360|3[0-5][0-9]|[01]?[0-9][0-9]?)[\s]*,)([\s]*((100|[0-9][0-9]?)%|0)[\s]*,){2}([\s]*(1|1.0|0|0.[0-9]|0.[0-9][0-9])[\s]*)[)]$/.test(A);case"hsl":return/^[hH][Ss][Ll][Aa][(]([\s]*(2[0-9][0-9]|360|3[0-5][0-9]|[01]?[0-9][0-9]?)[\s]*,)([\s]*((100|[0-9][0-9]?)%|0)[\s]*,){2}([\s]*(1|1.0|0|0.[0-9]|0.[0-9][0-9])[\s]*)[)]$/.test(A);default:return/^#([0-9a-fA-f]{4}|[0-9a-fA-F]{8})$/g.test(A)}else switch(v){case"rgb":return/^[rR][gG][Bb][(]([\s]*(2[0-4][0-9]|25[0-5]|[01]?[0-9][0-9]?)[\s]*,){2}[\s]*(2[0-4]\d|25[0-5]|[01]?\d\d?)[\s]*[)]{1}$/.test(A);case"hsv":return/^[hH][Ss][Vv][(]([\s]*(2[0-9][0-9]|360|3[0-5][0-9]|[01]?[0-9][0-9]?)[\s]*,)([\s]*((100|[0-9][0-9]?)%|0)[\s]*,)([\s]*((100|[0-9][0-9]?)%|0)[\s]*)[)]$/.test(A);case"hsl":return/^[hH][Ss][Ll][(]([\s]*(2[0-9][0-9]|360|3[0-5][0-9]|[01]?[0-9][0-9]?)[\s]*,)([\s]*((100|[0-9][0-9]?)%|0)[\s]*,)([\s]*((100|[0-9][0-9]?)%|0)[\s]*)[)]$/.test(A);default:return/^#([0-9a-fA-f]{3}|[0-9a-fA-F]{6})$/g.test(A)}}(N,x,w);S?h(N,x,w):e.unref(s)!=null?r.value=e.unref(s):c.value=""}else r.value=null},selectColorIndex:f,onSelectColor:function(y,N){if(f.value=N,(y=y.trim())==="")r.value=null;else{var w=ia(y);w?h(y,w,!0):r.value=null}}}}}),Jm={class:"picker-inner"},Zm={class:"picker-header"};nt(".picker[data-v-6ceadec6]{background:#f7f8f9;border-radius:4px;box-shadow:0 0 16px 0 rgba(0,0,0,.16)}.picker-inner[data-v-6ceadec6]{padding:10px}[pick-colors-theme=dark] .picker-inner[data-v-6ceadec6]{background:#1d2024;box-shadow:0 0 16px 0 rgba(0,0,0,.16)}.picker-header[data-v-6ceadec6]{display:flex;margin-bottom:5px}.alpha[data-v-6ceadec6],.hue[data-v-6ceadec6]{margin-left:10px}.colors[data-v-6ceadec6]{margin-top:5px}"),Ho.render=function(t,o,n,a,l,r){var s=e.resolveComponent("saturation"),c=e.resolveComponent("hue"),i=e.resolveComponent("alpha"),d=e.resolveComponent("input-value"),p=e.resolveComponent("Colors");return e.openBlock(),e.createElementBlock("div",{class:"picker",style:e.normalizeStyle(t.pickerStyle)},[e.createElementVNode("div",Jm,[e.createElementVNode("div",Zm,[e.createVNode(s,{class:"saturation",hue:t.h,saturation:t.s,value:t.v,onChange:t.onSelectSaturation},null,8,["hue","saturation","value","onChange"]),e.createVNode(c,{class:"hue",hue:t.h,onChange:t.onSelectHue},null,8,["hue","onChange"]),t.showAlpha?(e.openBlock(),e.createBlock(i,{key:0,class:"alpha",alpha:t.a,color:t.rgbStr,onChange:t.onSelectAlpha},null,8,["alpha","color","onChange"])):e.createCommentVNode("v-if",!0)]),e.createVNode(d,{label:t.label,value:t.colorValue,width:t.inputWidth,onChange:t.onInputChange,onBlur:t.handleChange,onEnter:t.handleChange},null,8,["label","value","width","onChange","onBlur","onEnter"]),t.colors.length>0?(e.openBlock(),e.createBlock(p,{key:0,class:"colors",colors:t.colors,"selected-index":t.selectColorIndex,onChange:t.onSelectColor},null,8,["colors","selected-index","onChange"])):e.createCommentVNode("v-if",!0)])],4)},Ho.__scopeId="data-v-6ceadec6",Ho.__file="src/picker/Picker.vue";var Wo=e.defineComponent({name:"AddColorItem",props:{size:{type:Number,default:20},selected:{type:Boolean,default:!1}},setup:function(t){var o=e.inject("theme",{theme:"light"}).theme;return{addColorItemStyle:e.computed(function(){return{width:"".concat(t.size,"px"),height:"".concat(t.size,"px"),lineHeight:"".concat(t.size,"px"),boxShadow:t.selected?"0 0 3px 2px ".concat(e.unref(o)==="dark"?"#2681ff":"#1890ff"):""}})}}}),eh=[function(t){return e.pushScopeId("data-v-ceb1719c"),t=t(),e.popScopeId(),t}(function(){return e.createElementVNode("g",{class:"container"},[e.createElementVNode("path",{d:"M544 464V160h-80v304H160v80h304v304h80V544h304v-80z"})],-1)})];function Hr(t,o){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(t);o&&(a=a.filter(function(l){return Object.getOwnPropertyDescriptor(t,l).enumerable})),n.push.apply(n,a)}return n}function sa(t){for(var o=1;o<arguments.length;o++){var n=arguments[o]!=null?arguments[o]:{};o%2?Hr(Object(n),!0).forEach(function(a){aa(t,a,n[a])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):Hr(Object(n)).forEach(function(a){Object.defineProperty(t,a,Object.getOwnPropertyDescriptor(n,a))})}return t}nt(".add-color-item[data-v-ceb1719c]{background:#fff;border:1px solid #d9d9d9;border-radius:5px;vertical-align:top}.container[data-v-ceb1719c]{pointer-events:none;transform:scale(.9);transform-origin:center}[pick-colors-theme=dark] .add-color-item[data-v-ceb1719c]{background:#141414;border:1px solid #434343}path[data-v-ceb1719c]{fill:#000}[pick-colors-theme=dark] path[data-v-ceb1719c]{fill:#fff}"),Wo.render=function(t,o,n,a,l,r){return e.openBlock(),e.createElementBlock("svg",{style:e.normalizeStyle(t.addColorItemStyle),class:"add-color-item",viewBox:"0 0 1024 1024",xmlns:"http://www.w3.org/2000/svg"},[].concat(eh),4)},Wo.__scopeId="data-v-ceb1719c",Wo.__file="src/add-color-item/AddColorItem.vue";var _t=null,St=e.defineComponent({name:"ColorPicker",components:{ColorItem:yo,Picker:Ho,AddColorItem:Wo},props:{value:{type:[String,Array]},theme:{type:String,default:"light"},size:{type:[Number,String],default:20},width:{type:[Number,String]},height:{type:[Number,String]},format:{type:String,default:"hex"},showPicker:{type:Boolean,default:void 0},showAlpha:{type:Boolean,default:!1},addColor:{type:Boolean,default:!1},deleteColor:{type:Boolean,default:!0},max:{type:Number,default:13},popupContainer:{type:[String,Object,Boolean]},zIndex:{type:Number,default:1e3},colors:{type:Array,default:function(){return["#ff4500","#ff8c00","#ffd700","#90ee90","#00ced1","#1e90ff","#c71585","#ff4500","#ff7d4d","#00babd","#1f93ff","#fa64c3"]}}},emits:["change","update:value","update:showPicker","overflowMax","closePicker"],setup:function(t,o){var n=o.emit,a=e.ref([]),l=e.computed(function(){return e.unref(a).map(function(_){return la(_,"hex",t.showAlpha)})});e.watch(function(){return t.value},function(){var _=t.value||"",B=Array.isArray(_)?_:[_];a.value=B.map(function(E){return la(E,t.format,t.showAlpha)})},{immediate:!0});var r=e.ref(void 0),s=e.computed(function(){return e.unref(a)[e.unref(r)]}),c=e.ref(!1);e.watch(function(){return t.showPicker},function(){c.value=t.showPicker},{immediate:!0});var i,d,p,u,m,C,g,b=e.ref(null),f=e.ref(null),h=(i=b,d=f,p={zIndex:t.zIndex},u=e.ref({}),m={strategy:"absolute",placement:"auto",onFirstUpdate:function(){_t.update()},modifiers:[{name:"offset",options:{offset:[0,5]}},{name:"computeStyles",options:{gpuAcceleration:!1,adaptive:!0}},{name:"flip",options:{fallbackPlacements:["top"],allowedAutoPlacements:["top","bottom"]}},{name:"applyStyles",enabled:!1},{name:"updateState",enabled:!0,phase:"write",requires:["computeStyles"],fn:function(_){var B=_.state,E=B.styles,P=B.placement,I=E.popper;u.value=sa(sa(sa({},I),p),{},{transformOrigin:P==="top"?"center bottom":""})}}]},e.watch(function(){return[e.unref(i),e.unref(d)]},function(_,B){var E,P=ho(_,2),I=P[0],O=P[1],V=ho(B,2),k=V[0],L=V[1];if(I&&O&&(k!==I||L!==k)){(E=_t)===null||E===void 0||E.destroy();var M=I.$el||I,U=O.$el||O;e.nextTick(function(){_t=jm(M,U,m)})}}),e.onBeforeUnmount(function(){var _;_t&&((_=_t)===null||_===void 0||_.destroy(),_t=null)}),{instance:_t,style:u}),y=h.style,N=function(){e.unref(b)==null&&(b.value=e.unref(F)[0],r.value=0),t.showPicker===void 0?c.value=!0:n("update:showPicker",!0)},w=function(){r.value=void 0,t.showPicker===void 0?c.value=!1:n("update:showPicker",!1),n("closePicker",e.toRaw(Array.isArray(t.value)||t.addColor?e.unref(a):e.unref(a)[0]))},x=e.ref(),S=function(){var _=Or(Do.mark(function B(E){var P,I,O,V;return Do.wrap(function(k){for(;;)switch(k.prev=k.next){case 0:if(I=E.target,(O=(P=I.dataset)===null||P===void 0?void 0:P.index)!=null&&O!==""){k.next=4;break}return k.abrupt("return");case 4:if(V=+O,e.unref(r)!==V){k.next=7;break}return k.abrupt("return");case 7:e.unref(r)!=null&&e.unref(r)!==V?(w(),C&&clearTimeout(C),C=setTimeout(function(){N(),clearTimeout(C)},100)):N(),r.value=V,b.value=I;case 10:case"end":return k.stop()}},B)}));return function(B){return _.apply(this,arguments)}}(),A=function(){var _=Or(Do.mark(function B(E){var P,I,O,V,k;return Do.wrap(function(L){for(;;)switch(L.prev=L.next){case 0:if(V=E.target,!(!((P=e.unref(x))!==null&&P!==void 0&&P.isEqualNode(V))&&(!((I=e.unref(x))===null||I===void 0)&&I.contains(V)))){L.next=4;break}return L.abrupt("return");case 4:if(k=(O=e.unref(f))===null||O===void 0?void 0:O.$el,!(k!=null&&k.contains(V))){L.next=8;break}return L.abrupt("return");case 8:g&&clearTimeout(g),g=setTimeout(function(){e.unref(c)&&w()},0);case 10:case"end":return L.stop()}},B)}));return function(B){return _.apply(this,arguments)}}();e.watch(c,function(){e.unref(c)&&(N(),clearTimeout(g))});var v,D=e.ref(t.max>e.unref(a).length),T=e.computed(function(){return typeof t.popupContainer=="string"||Ut(t.popupContainer)==="object"&&t.popupContainer!=null?t.popupContainer:"body"}),R=e.computed(function(){return typeof t.popupContainer=="boolean"&&t.popupContainer===!1}),$=e.computed(function(){return t.theme});e.watch(function(){return[t.theme,e.unref(f)]},function(){e.nextTick(function(){var _,B;(_=e.unref(x))===null||_===void 0||_.setAttribute("pick-colors-theme",e.unref($)),(B=e.unref(f))===null||B===void 0||(B=B.$el)===null||B===void 0||B.setAttribute("pick-colors-theme",e.unref($))})},{immediate:!0}),e.provide("theme",{theme:$});var F=e.ref([]);return e.onMounted(function(){document.addEventListener("mouseup",A,!1),t.showPicker&&N()}),e.onUnmounted(function(){document.removeEventListener("mouseup",A,!1),C&&(clearTimeout(C),C=null),g&&(clearTimeout(g),g=null)}),{valueList:a,colorItemSelected:function(_){return(t.addColor?e.unref(a).length>0:e.unref(a).length>1)&&e.unref(r)===_},selectedColor:s,selectedIndex:r,isShowPicker:c,addColorItemShow:D,onPickerChange:function(_){var B=e.unref(r),E=e.unref(a).slice(),P=e.unref(a).length;if(B!=null){B>=0?E[B]=_:(r.value=P,E.push(_));var I="";I=Array.isArray(t.value)||t.addColor?E:_,t.value===void 0?a.value=Array.isArray(I)?I:[I]:(n("update:value",I),n("change",I,_,B)),t.addColor&&P>=t.max&&(D.value=!1,n("overflowMax"))}},colorPicker:x,onColorClick:S,pickerRef:f,onColorItemDragStart:function(_){_.dataTransfer.effectAllowed="move";var B=_.target;v=+B.dataset.index},onColorItemDragOver:function(_){},onColorItemDrop:function(_){var B=+_.target.dataset.index,E=Rm(e.unref(a)),P=E[v];E.splice(v,1);var I=E.slice(0,B),O=E.splice(B),V=I.concat([P]).concat(O);n("update:value",V),n("change",V,V[v],v)},colorItemsRef:F,pickerStyle:y,values:l,teleportDisabled:R,toPopupContainer:T}}});nt(".color-picker[data-v-3c43ade8]{display:inline-block}.color-item[data-v-3c43ade8]{margin:5px}.add-color-item[data-v-3c43ade8]{display:inline-block;margin:5px}.picker[data-v-3c43ade8]{overflow:hidden}.v-enter-active[data-v-3c43ade8],.v-leave-active[data-v-3c43ade8]{opacity:1;transform:scaleY(1);transform-origin:center top;transition:opacity .2s ease-in-out,transform .2s ease-in-out}.v-enter-from[data-v-3c43ade8],.v-leave-to[data-v-3c43ade8]{opacity:0;transform:scaleY(0)}"),St.render=function(t,o,n,a,l,r){var s=e.resolveComponent("color-item"),c=e.resolveComponent("add-color-item"),i=e.resolveComponent("picker");return e.openBlock(),e.createElementBlock("div",{class:"color-picker",ref:"colorPicker",onDragstart:o[0]||(o[0]=e.withModifiers(function(){return t.onColorItemDragStart&&t.onColorItemDragStart.apply(t,arguments)},["stop"])),onDragover:o[1]||(o[1]=e.withModifiers(function(){return t.onColorItemDragOver&&t.onColorItemDragOver.apply(t,arguments)},["prevent","stop"])),onDrop:o[2]||(o[2]=e.withModifiers(function(){return t.onColorItemDrop&&t.onColorItemDrop.apply(t,arguments)},["prevent","stop"])),onClick:o[3]||(o[3]=e.withModifiers(function(){return t.onColorClick&&t.onColorClick.apply(t,arguments)},["stop"]))},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(t.values,function(d,p){return e.openBlock(),e.createBlock(s,{class:"color-item",key:p,ref_for:!0,ref:function(u){return t.colorItemsRef[p]=u},size:t.size,width:t.width,height:t.height,value:d,selected:t.colorItemSelected(p),"data-index":p,draggable:t.valueList.length>1,format:t.format},null,8,["size","width","height","value","selected","data-index","draggable","format"])}),128)),t.addColor&&t.addColorItemShow?(e.openBlock(),e.createBlock(c,{key:0,class:"add-color-item",ref:"addColorItem",selected:t.colorItemSelected(-1),"data-index":-1},null,8,["selected"])):e.createCommentVNode("v-if",!0),(e.openBlock(),e.createBlock(e.Teleport,{to:t.toPopupContainer,disabled:t.teleportDisabled},[e.createVNode(e.Transition,null,{default:e.withCtx(function(){return[t.isShowPicker?(e.openBlock(),e.createBlock(i,{key:0,class:"picker",style:e.normalizeStyle(t.pickerStyle),ref:"pickerRef",value:t.selectedColor,format:t.format,"show-alpha":t.showAlpha,colors:t.colors,onChange:t.onPickerChange},null,8,["style","value","format","show-alpha","colors","onChange"])):e.createCommentVNode("v-if",!0)]}),_:1})],8,["to","disabled"]))],544)},St.__scopeId="data-v-3c43ade8",St.__file="src/ColorPicker.vue";const th=e.defineComponent({name:"ColorPick",components:{PickColors:St,AInput:j.Input},props:{value:{type:String,require:!0}},emits:["change"],setup(t,o){const n=e.computed({get:()=>t.value,set:l=>{o.emit("change",l)}});return{colorValue:n,onChangColor:l=>{n.value=l.hex}}}}),ng="",oh={class:"color-pick"};function nh(t,o,n,a,l,r){const s=e.resolveComponent("a-input"),c=e.resolveComponent("pick-colors");return e.openBlock(),e.createElementBlock("div",oh,[e.createVNode(s,{class:"input",value:t.colorValue,"onUpdate:value":o[0]||(o[0]=i=>t.colorValue=i)},null,8,["value"]),e.createVNode(c,{class:"pick-colors",value:t.colorValue,"onUpdate:value":o[1]||(o[1]=i=>t.colorValue=i),size:25,showAlpha:!0},null,8,["value"])])}const ah=ae(th,[["render",nh],["__scopeId","data-v-2ee2749b"]]),lh=e.defineComponent({name:"ColorGroupPick",components:{PickColors:St},props:{value:{type:Array,default:()=>[]}},emits:["change"],setup(t,{emit:o}){const n=r=>{o("change",r)},a=e.ref(13);return{onColorsChange:n,max:a,onOverflowMax:()=>{j.message.warn(`已经超出最大添加个数:${a.value}`)}}}}),ag="",rh={class:"color-group-pick"};function ih(t,o,n,a,l,r){const s=e.resolveComponent("pick-colors");return e.openBlock(),e.createElementBlock("div",rh,[e.createVNode(s,{value:t.value,"add-color":"",max:t.max,onChange:t.onColorsChange,onOverflowMax:t.onOverflowMax},null,8,["value","max","onChange","onOverflowMax"])])}const sh=ae(lh,[["render",ih],["__scopeId","data-v-b2be8322"]]),ch=e.defineComponent({name:"FormGroup",components:{Draggable:Et,AppstoreAddOutlined:un,MinusCircleOutlined:Ys,PickColors:St,InputNumber:sr,PlusCircleOutlined:Qs},props:{value:{type:Array,default:()=>[]},format:{type:Array,default:()=>[]},useLabelIndex:{type:Boolean,default:!1},max:{type:Number,default:-1}},emits:["change"],setup(t,{emit:o}){const n=e.computed({get:()=>t.value,set:d=>{o("change",d)}});return{myValue:n,onAdd:()=>{var u;const d=(u=t.value)==null?void 0:u.slice();if(!Array.isArray(d))return;const p=d.length;if(t.max===-1||t.max>p){const m=d[0];if(Object.prototype.toString.call(m)==="[object Object]"){const C=Object.keys(m),g={};C.forEach(b=>{g[b]=""}),d.push(g)}else typeof m=="string"&&d.push(m);n.value=d}else j.message.warn("已达到最大上限")},useComponentType:d=>({input:"aInput",select:"aSelect",color:"pickColors","input-number":"inputNumber",switch:"aSwitch"})[d],onValueChange:(d,p,u)=>{var C;const m=(C=t.value)==null?void 0:C.slice();if(Array.isArray(m)){const g=d==null?void 0:d.target,b=(g==null?void 0:g.value)!=null?g==null?void 0:g.value:d;u?m[p][u]=b:m[p]=b,n.value=m}},onDelete:d=>{var u;const p=(u=t.value)==null?void 0:u.slice();if(Array.isArray(p)){if(p.length===1){j.message.warn("已经是最后一条数据,无法删除");return}p.splice(d,1),n.value=p}},theme:"light",formatTypeValue:d=>d||"value"}}}),lg="",dh={class:"form-group"},ph={class:"form-row"},uh={key:0,class:"label"},fh={key:1,class:"label"},mh={class:"icon-group"};function hh(t,o,n,a,l,r){const s=e.resolveComponent("appstore-add-outlined"),c=e.resolveComponent("draggable"),i=e.resolveComponent("minus-circle-outlined");return e.openBlock(),e.createElementBlock("div",dh,[e.createVNode(s,{class:"icon add",onClick:t.onAdd},null,8,["onClick"]),e.createVNode(c,{class:"form",modelValue:t.myValue,"onUpdate:modelValue":o[0]||(o[0]=d=>t.myValue=d),"item-key":"id"},{item:e.withCtx(({element:d,index:p})=>[e.createElementVNode("div",ph,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(t.format,(u,m)=>(e.openBlock(),e.createElementBlock("div",{class:"form-item",key:m},[Array.isArray(u.label)?(e.openBlock(),e.createElementBlock("span",uh,e.toDisplayString(u.useLabelIndex?u.label[p]+(p+1):u.label[p]),1)):(e.openBlock(),e.createElementBlock("span",fh,e.toDisplayString(u.useLabelIndex?u.label+(p+1):u.label),1)),(e.openBlock(),e.createBlock(e.resolveDynamicComponent(t.useComponentType(u.type)),e.mergeProps({class:"value",[t.formatTypeValue(u.typeValue)||""]:typeof d=="string"?d:d[u.value]??u.defaultValue,style:{width:!["color","switch"].includes(u.type)&&t.format.length>1?"110px":""}},u.props,{theme:t.theme,"use-blur-event":!1,onChange:C=>t.onValueChange(C,p,u.value)}),null,16,["style","theme","onChange"]))]))),128))])]),_:1},8,["modelValue"]),e.createElementVNode("div",mh,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(t.myValue,(d,p)=>(e.openBlock(),e.createElementBlock("div",{class:"icon-item",key:p},[e.createVNode(i,{class:"icon delete",onClick:u=>t.onDelete(p)},null,8,["onClick"])]))),128))])])}const bh=ae(ch,[["render",hh],["__scopeId","data-v-f0c0ab4d"]]),yh=e.defineComponent({name:"Textarea",props:{value:{type:String,default:""},disabled:{type:Boolean,default:!1}},components:{ATextarea:j.Textarea},emits:["change"],setup(t,{emit:o}){return{onTextareaChange:a=>{o("change",a.target.value)}}}});function gh(t,o,n,a,l,r){const s=e.resolveComponent("a-textarea");return e.openBlock(),e.createBlock(s,{value:t.value,disabled:t.disabled,autoSize:{minRows:3},onChange:t.onTextareaChange},null,8,["value","disabled","onChange"])}const Ch=ae(yh,[["render",gh]]),wh=e.defineComponent({name:"Slider",components:{ASlider:j.Slider,AInputNumber:j.InputNumber},props:{value:{type:Number,default:1}},emits:["change"],setup(t,{emit:o}){return{onChange:a=>{o("change",a)}}}});function kh(t,o,n,a,l,r){const s=e.resolveComponent("a-slider"),c=e.resolveComponent("a-col"),i=e.resolveComponent("a-input-number"),d=e.resolveComponent("a-row");return e.openBlock(),e.createBlock(d,null,{default:e.withCtx(()=>[e.createVNode(c,{span:16},{default:e.withCtx(()=>[e.createVNode(s,{value:t.value,min:0,max:1,step:.1,onChange:t.onChange},null,8,["value","onChange"])]),_:1}),e.createVNode(c,{span:8,style:{"padding-left":"10px"}},{default:e.withCtx(()=>[e.createVNode(i,{value:t.value,min:0,max:1,step:.1,style:{width:"100%"},onChange:t.onChange},null,8,["value","onChange"])]),_:1})]),_:1})}const xh=ae(wh,[["render",kh]]),_h=e.defineComponent({name:"PropsToForm",components:{Input:_f,InputNumber:sr,RadioGroup:Ef,Select:Vf,Switch:$f,ColorPick:ah,ColorGroupPick:sh,FormGroup:bh,Textarea:Ch,Slider:xh},props:{props:{type:Object,require:!0},disabled:{type:Boolean,default:!1},componentType:{type:String,default:""}},setup(t){const o=e.inject(wo),n=e.inject(ge),a=e.inject(Ko),l=e.inject(Xo),r=e.computed(()=>{var m;return(m=e.unref(o))==null?void 0:m.type}),s=m=>{t.componentType&&t.componentType==="table"?l(m):a(m)},c=m=>{const{result:C,mapAttributeProp:g,key:b,value:f}=m;if(C==null||typeof C!="object")return;const{valueProp:h="value",changeValueEventName:y="change",events:N,effect:w,effectVal:x,props:S}=g;C[b]={...g,valueProp:h,value:f,events:{[y]:(A,v=!0)=>{v?(s({[b]:A}),x&&x(b,A,s,e.unref(n))):s({})},...N},...d(w),props:{...S,...u(S,e.unref(n))}}},i=e.computed(()=>{const m=t.props;return m==null||typeof m!="object"?{}:ee.reduce(m,(C,g,b)=>{const f=wf[b];if(Array.isArray(f)){const h=f.find(y=>{const{onlyType:N,excludeType:w}=y;return N==null&&w==null?!0:N?ue(e.unref(r),N):w?!ue(e.unref(r),w):!1});h&&c({result:C,value:g,key:b,mapAttributeProp:h})}else c({result:C,value:g,key:b,mapAttributeProp:f});return C},{})}),d=m=>{const C={};for(const g in m)C[g]=ee.reduce(m[g].props,(b,f)=>m[g].joinType==="&&"?b&&p(f):b||p(f),!!m[g].default);return C},p=m=>{const C=t.props[m.props];let g;switch(m.rule){case"!==":g=C!==m.value;break;case"includes":g=C.includes(m.value);break;case"action":g=m.value(m,t.props);break;default:g=C===m.value}return g};function u(m={},C){const g={};for(const b in m)typeof m[b]=="function"&&(g[b]=m[b](C));return g}return{formProps:i,lowerCaseIncludes:ue}}}),rg="",Sh={class:"props-to-form"},Th={key:0,class:"prop-item"},Nh={class:"label"},Ah={class:"component-wrapper"};function Eh(t,o,n,a,l,r){return e.openBlock(),e.createElementBlock("div",Sh,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(t.formProps,(s,c)=>(e.openBlock(),e.createElementBlock(e.Fragment,{key:c},[s.hide!==!0?(e.openBlock(),e.createElementBlock("div",Th,[e.createElementVNode("span",Nh,e.toDisplayString(s.label),1),e.createElementVNode("div",Ah,[Array.isArray(s)?(e.openBlock(!0),e.createElementBlock(e.Fragment,{key:0},e.renderList(s,(i,d)=>(e.openBlock(),e.createBlock(e.resolveDynamicComponent(i.component),e.mergeProps({key:d,class:"component",style:i.style,disabled:t.disabled||i.disabled},i.props,e.toHandlers(i.events)),null,16,["style","disabled"]))),128)):e.createCommentVNode("",!0),Array.isArray(s)?e.createCommentVNode("",!0):(e.openBlock(),e.createElementBlock(e.Fragment,{key:1},[s.component?(e.openBlock(),e.createBlock(e.resolveDynamicComponent(s.component),e.mergeProps({key:0,class:"component",[s.valueProp||""]:s.value,style:s.style,disabled:t.disabled||s.disabled},s.props,e.toHandlers(s.events)),null,16,["style","disabled"])):e.createCommentVNode("",!0)],64))])])):e.createCommentVNode("",!0)],64))),128))])}const Oh=ae(_h,[["render",Eh],["__scopeId","data-v-62456472"]]);function Bh(){return new Worker("/assets/editor.worker-02df2e61.js")}function Vh(){return new Worker("/assets/json.worker-867823a6.js")}function Lh(){return new Worker("/assets/ts.worker-7254b425.js")}const Fh=e.defineComponent({name:"Editor",props:{valueData:{type:String,default:""},options:{type:Object,default:()=>({})},language:{type:String,default:"json"},isUseMinimap:{type:Boolean,default:!1},UseSuggestions:{type:Boolean,default:!1},autoFormat:{type:Boolean,default:!1},readonly:{type:Boolean,default:!1}},emits:["change","update:valueData"],setup(t,{emit:o}){window.MonacoEnvironment={getWorker(r,s){return s==="json"?new Vh:s==="typescript"||s==="javascript"?new Lh:new Bh}};const n=e.ref();let a=null;const l={light:"vs",dark:"vs-dark"};return e.onMounted(()=>{a=Zr.editor.create(n.value,{language:t.language,tabSize:2,automaticLayout:!0,scrollBeyondLastLine:!1,theme:l.light,wordWrap:"off",lineDecorationsWidth:3,lineHeight:15,lineNumbersMinChars:3,formatOnPaste:!0,formatOnType:!0,wordBasedSuggestions:!1,quickSuggestions:t.UseSuggestions,snippetSuggestions:"none",suggestOnTriggerCharacters:!1,scrollbar:{verticalScrollbarSize:6,horizontalScrollbarSize:6,alwaysConsumeMouseWheel:!1,arrowSize:0},autoIndent:"advanced",glyphMargin:!1,fontSize:13,contextmenu:!1,minimap:{enabled:t.isUseMinimap},readOnly:t.readonly,...t.options}),a==null||a.setValue(t.valueData),t.autoFormat&&setTimeout(()=>{a==null||a.getAction("editor.action.formatDocument").run()},200),a.onDidChangeModelContent(ee.debounce(()=>{const r=a==null?void 0:a.getValue();o("change",r)},300)),a.onDidBlurEditorText(()=>{const r=a==null?void 0:a.getValue();o("update:valueData",r)})}),e.watch(()=>t.valueData,r=>{if(a){const s=a.getPosition();a.setValue(r),t.autoFormat&&a.getAction("editor.action.formatDocument").run(),s!=null&&a.setPosition(s)}}),e.onUnmounted(()=>{a==null||a.dispose()}),{dom:n}}}),ig="",$h={class:"editor",ref:"dom"};function Ih(t,o,n,a,l,r){return e.openBlock(),e.createElementBlock("div",$h,null,512)}const Wr=ae(Fh,[["render",Ih],["__scopeId","data-v-71e88372"]]),vh=e.defineComponent({name:"Condition",components:{CloseOutlined:Zt,MenuOutlined:Sn,AMenu:j.Menu,AMenuItem:j.MenuItem,AInput:j.Input,ASelect:j.Select,ADropdown:j.Dropdown},props:{data:{type:Object,default:()=>({})},level:{type:Number,default:0},index:{type:Number,default:0},path:{type:String,default:""}},setup(t){const o=[{label:"大于",value:">"},{label:"大于等于",value:">="},{label:"小于",value:"<"},{label:"小于等于",value:"<="},{label:"等于",value:"=="},{label:"不等于",value:"!="}],n=e.ref({rule:"==",value:"",key:""}),{updateCondition:a,deleteCondition:l,addCondition:r}=e.inject(ko,{updateCondition:(d,p,u)=>{},deleteCondition:(d,p)=>{},addCondition:(d,p,u)=>{}});e.watch(n,d=>{a(ee.cloneDeep(d),t.index,t.path)},{deep:!0});const s=()=>{},c=d=>{r(t.path,t.index,d.key==="2"?"||":"&&")},i=()=>{l(t.index,t.path)};return e.onMounted(()=>{var d,p,u;e.unref(n).rule=((d=t.data)==null?void 0:d.rule)||"",e.unref(n).value=((p=t.data)==null?void 0:p.value)||"",e.unref(n).key=((u=t.data)==null?void 0:u.key)||ye()}),{ruleOptions:o,condition:n,onRuleChange:s,clickConditionMenu:c,onDelete:i}}}),sg="",Dh={class:"condition"};function Mh(t,o,n,a,l,r){const s=e.resolveComponent("a-select"),c=e.resolveComponent("a-input"),i=e.resolveComponent("menu-outlined"),d=e.resolveComponent("a-menu-item"),p=e.resolveComponent("a-menu"),u=e.resolveComponent("a-dropdown"),m=e.resolveComponent("close-outlined");return e.openBlock(),e.createElementBlock("div",Dh,[e.createVNode(s,{class:"field-name",value:t.condition.rule,"onUpdate:value":o[0]||(o[0]=C=>t.condition.rule=C),options:t.ruleOptions,onChange:t.onRuleChange},null,8,["value","options","onChange"]),e.createVNode(c,{class:"field-value",value:t.condition.value,"onUpdate:value":o[1]||(o[1]=C=>t.condition.value=C),placeholder:"请输入值"},null,8,["value"]),e.createVNode(u,{trigger:["click"]},{overlay:e.withCtx(()=>[e.createVNode(p,{onClick:t.clickConditionMenu},{default:e.withCtx(()=>[e.createVNode(d,{key:"1"},{default:e.withCtx(()=>[e.createTextVNode("添加且条件")]),_:1}),e.createVNode(d,{key:"2"},{default:e.withCtx(()=>[e.createTextVNode("添加或条件")]),_:1})]),_:1},8,["onClick"])]),default:e.withCtx(()=>[e.createVNode(i,{class:"more-icon"})]),_:1}),e.createVNode(m,{class:"delete-icon",onClick:t.onDelete},null,8,["onClick"])])}const Ph=ae(vh,[["render",Mh],["__scopeId","data-v-9fcdf54d"]]),jh=e.defineComponent({name:"ConditionList",props:{list:{type:Array,default:()=>[]},level:{type:Number,default:0},path:{type:String,default:""}},components:{Condition:Ph}}),cg="",Rh={key:0,class:"condition-list"},Uh={key:0,class:"condition-container"},zh={key:0,class:"condition-text"},Gh={key:1,class:"condition-text"},Hh={class:"conditions"};function Wh(t,o,n,a,l,r){const s=e.resolveComponent("condition-list",!0),c=e.resolveComponent("condition");return Array.isArray(t.list)?(e.openBlock(),e.createElementBlock("div",Rh,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(t.list,(i,d)=>(e.openBlock(),e.createElementBlock(e.Fragment,{key:d},[i.join&&i.conditions&&Array.isArray(i.conditions)?(e.openBlock(),e.createElementBlock("div",Uh,[i.conditions.length>1?(e.openBlock(),e.createElementBlock(e.Fragment,{key:0},[i.join==="||"?(e.openBlock(),e.createElementBlock("div",zh,"或")):e.createCommentVNode("",!0),i.join==="&&"?(e.openBlock(),e.createElementBlock("div",Gh,"且")):e.createCommentVNode("",!0)],64)):e.createCommentVNode("",!0),e.createElementVNode("div",Hh,[i.conditions.length>0?(e.openBlock(),e.createBlock(s,{key:0,level:t.level+1,path:`${t.path?t.path+"-":""}${d}`,list:i.conditions},null,8,["level","path","list"])):e.createCommentVNode("",!0)])])):(e.openBlock(),e.createBlock(c,{class:"condition",key:i.key||`${t.level}-${d}`,data:i,level:t.level,index:d,path:t.path||""},null,8,["data","level","index","path"]))],64))),128))])):e.createCommentVNode("",!0)}const Yh=ae(jh,[["render",Wh],["__scopeId","data-v-49c6481f"]]),qh=e.defineComponent({components:{ConditionList:Yh,PickColors:St,AButton:j.Button,AModal:j.Modal,ASelect:j.Select},props:{data:{type:Object,default:()=>({})},index:{type:Number,default:-1}},setup(t,{emit:o,expose:n}){const a=e.ref(!1),l=e.ref([]),r=e.ref({}),s=e.computed(()=>({pageId:e.unref("pageId")})),c=b=>{const f=[];for(const h of b)h.conditions?f.push(...c(h.conditions)):f.push(h);return f},i=()=>{if(c(e.unref(l)).find(f=>!f.value||!f.rule)){j.message.error("条件值或规则不能为空");return}o("save",{conditions:e.unref(l),attribute:e.unref(r)}),a.value=!1},d=b=>{var f;for(const h of b)(f=h.conditions)!=null&&f.length?d(h.conditions):h.key=ye()};e.watch(a,b=>{var f,h,y;if(b){if(Array.isArray((f=t.data)==null?void 0:f.conditions)){const N=ee.cloneDeep(((h=t.data)==null?void 0:h.conditions)||[]);d(N),l.value=N}r.value=ee.cloneDeep(((y=t.data)==null?void 0:y.attribute)||{}),e.unref(r).color||(r.value.color=""),e.unref(r).iconColor||(r.value.iconColor="")}else l.value=[],r.value={}},{flush:"post"});const p=()=>{a.value=!0},u=b=>{var f;e.unref(l)==null||((f=e.unref(l))==null?void 0:f.length)===0?l.value=[{key:ye()}]:e.unref(l)[0]!=null&&(e.unref(l)[0].conditions==null||e.unref(l)[0].join!==b?l.value=[{join:b,conditions:[e.unref(l)[0],{key:ye()}]}]:e.unref(l)[0].conditions.length>1&&e.unref(l)[0].join===b&&l.value[0].conditions.push({key:ye()}))};e.provide(ko,{updateCondition(b,f,h){var w;let y=l.value;const N=h.split("-");if(h&&(N!=null&&N.length))for(const x of N)if(y[+x])y=(w=y[+x])==null?void 0:w.conditions;else break;Array.isArray(y)&&y[f]&&(y[f]=b)},deleteCondition(b,f){var N,w,x;if(!f){l.value=[];return}let h=e.unref(l);const y=f.split("-");if(y!=null&&y.length){for(const S of y)if(h[+S])h=(N=h[+S])==null?void 0:N.conditions;else break;if(Array.isArray(h)&&h[b])if(h.splice(b,1),h.length===1){if(y.length>0){const S=y.length-1,A=y[S],v=y.slice(0,S);let D=e.unref(l),T="";for(const R of v)if(D[+R])T=(w=D[+R])==null?void 0:w.join,D=(x=D[+R])==null?void 0:x.conditions;else break;if(T===h[0].join){if(Array.isArray(h[0].conditions)){const R=ee.cloneDeep(h[0].conditions);D.splice(+A,1),D.splice(+A,0,...R)}}else D[+A]=h[0]}}else h.length===0&&(l.value=[])}},addCondition(b,f,h){var x,S;let y=e.unref(l),N="";const w=b.split("-");if(b&&(w!=null&&w.length))for(const A of w)if(y[+A])N=(x=y[+A])==null?void 0:x.join,y=(S=y[+A])==null?void 0:S.conditions;else break;if(N===h)y.splice(f+1,0,{key:ye()});else{const A=ee.cloneDeep(y[f]);y[f]={join:h,conditions:[A,{key:ye()}]}}}});const m=b=>{r.value.icon=b},C=e.computed(()=>window.config.imgBaseUrl),g=e.ref([{label:"向下箭头",value:"/static/img/indicator-icon/arrow-down.svg"},{label:"向上箭头",value:"/static/img/indicator-icon/arrow-up.svg"}]);return n({showModal:p}),{params:s,visible:a,conditionList:l,attribute:r,handleOk:i,addCondition:u,onUploadChange:m,imgBaseUrl:C,iconOptions:g}}}),dg="",ca=t=>(e.pushScopeId("data-v-a29d848a"),t=t(),e.popScopeId(),t),Kh={class:"config-wrap"},Xh={class:"wrap-item left"},Qh={class:"title"},Jh={class:"border"},Zh={class:"wrap-item right"},eb=ca(()=>e.createElementVNode("div",{class:"title"},"属性配置",-1)),tb={class:"border"},ob={class:"row"},nb=ca(()=>e.createElementVNode("div",null,"字体颜色:",-1)),ab={class:"row"},lb=ca(()=>e.createElementVNode("div",null,"图标:",-1)),rb={style:{display:"flex","align-items":"center","justify-items":"center"}};function ib(t,o,n,a,l,r){const s=e.resolveComponent("a-button"),c=e.resolveComponent("condition-list"),i=e.resolveComponent("pick-colors"),d=e.resolveComponent("a-select"),p=e.resolveComponent("a-modal");return e.openBlock(),e.createBlock(p,{width:"60%",visible:t.visible,"onUpdate:visible":o[6]||(o[6]=u=>t.visible=u),title:"条件设置",destroyOnClose:!0,maskClosable:!1,bodyStyle:{height:"500px",overflow:"auto"},onOk:t.handleOk},{default:e.withCtx(()=>[e.createElementVNode("div",Kh,[e.createElementVNode("div",Xh,[e.createElementVNode("div",Qh,[e.createTextVNode(" 条件配置 "),Array.isArray(t.conditionList)&&t.conditionList.length>0?(e.openBlock(),e.createElementBlock(e.Fragment,{key:0},[e.createVNode(s,{class:"add-and-condition",onClick:o[0]||(o[0]=u=>t.addCondition("&&"))},{default:e.withCtx(()=>[e.createTextVNode(" 添加且条件 ")]),_:1}),e.createVNode(s,{class:"add-or-condition",onClick:o[1]||(o[1]=u=>t.addCondition("||"))},{default:e.withCtx(()=>[e.createTextVNode(" 添加或条件 ")]),_:1})],64)):(e.openBlock(),e.createBlock(s,{key:1,style:{"margin-left":"15px"},onClick:o[2]||(o[2]=u=>t.addCondition())},{default:e.withCtx(()=>[e.createTextVNode(" 添加条件 ")]),_:1}))]),e.createElementVNode("div",Jh,[e.createVNode(c,{class:"condition-list",list:t.conditionList,level:0},null,8,["list"])])]),e.createElementVNode("div",Zh,[eb,e.createElementVNode("div",tb,[e.createElementVNode("div",ob,[nb,e.createVNode(i,{class:"pick-colors",value:t.attribute.color,"onUpdate:value":o[3]||(o[3]=u=>t.attribute.color=u),size:25},null,8,["value"])]),e.createElementVNode("div",ab,[lb,e.createElementVNode("div",rb,[e.createVNode(d,{value:t.attribute.icon,"onUpdate:value":o[4]||(o[4]=u=>t.attribute.icon=u),options:t.iconOptions,style:{width:"160px"}},null,8,["value","options"]),e.createVNode(i,{class:"pick-colors",value:t.attribute.iconColor,"onUpdate:value":o[5]||(o[5]=u=>t.attribute.iconColor=u),size:25},null,8,["value"])])])])])])]),_:1},8,["visible","onOk"])}const sb=ae(qh,[["render",ib],["__scopeId","data-v-a29d848a"]]),cb=e.defineComponent({components:{AModal:j.Modal,AButton:j.Button,ATable:j.Table,ConditionWrap:sb,AInput:j.Input},setup(t,{expose:o,emit:n}){console.log(t);const a=e.ref(!1),l=e.ref(),r=e.ref(),s=e.ref(0),c=[{title:"条件标题",dataIndex:"name",align:"center",ellipsis:!0,width:100},{title:"条件内容",dataIndex:"conditionCode",align:"center",ellipsis:!0,width:250},{title:"条件设置",dataIndex:"operation",ellipsis:!0,width:160}],i=e.ref([]),d=e.ref(),p=(h,y="")=>{let N="";return h.forEach((w,x)=>{const{value:S,rule:A}=w;w.conditions?N+=`(${p(w.conditions,w.join)})`:S&&A&&(N+=`value ${A} '${S}'`),N+=`${x===h.length-1?"":y?" "+y+" ":""}`}),N},u=h=>{i.value=[],d.value=h;const{rules:y,conditionCode:N,conditions:w,attribute:x}=h;if(y)i.value=ee.cloneDeep(y);else if(N){const S={conditionCode:N,conditions:w,attribute:x,name:"新条件"};i.value.push(ee.cloneDeep(S)),delete h.conditionCode,delete h.conditions,delete h.attribute}a.value=!0},m=()=>{a.value=!1;for(const h of i.value)if(h.conditionCode==="")return"不能条件为空!";n("confirm",e.unref(i))},C=()=>{i.value.push({conditionCode:"",name:"新条件",condition:[],attribute:{}})},g=h=>{h.conditionCode=p(h.conditions),Object.assign(i.value[s.value],h)},b=(h,y)=>{e.unref(l).showModal(),r.value=ee.cloneDeep(h),s.value=y},f=h=>{i.value.splice(h,1)};return o({open:u}),{visible:a,currentData:r,currentIndex:s,configColumns:c,conditionsRef:l,rules:i,open:u,close:m,addRule:C,openRuleModal:b,closeRuleModal:g,deleteRule:f}}});function db(t,o,n,a,l,r){const s=e.resolveComponent("a-button"),c=e.resolveComponent("a-input"),i=e.resolveComponent("a-table"),d=e.resolveComponent("a-modal"),p=e.resolveComponent("condition-wrap");return e.openBlock(),e.createElementBlock(e.Fragment,null,[e.createVNode(d,{width:"60%",visible:t.visible,"onUpdate:visible":o[0]||(o[0]=u=>t.visible=u),title:"条件列表",destroyOnClose:!0,maskClosable:!1,bodyStyle:{height:"500px",overflow:"auto"},onOk:t.close},{default:e.withCtx(()=>[e.createVNode(s,{onClick:t.addRule},{default:e.withCtx(()=>[e.createTextVNode("新增条件")]),_:1},8,["onClick"]),e.createVNode(i,{class:"column-table",size:"small",columns:t.configColumns,"data-source":t.rules,scroll:{x:"100%",y:400},pagination:!1,bordered:""},{bodyCell:e.withCtx(({column:u,record:m,index:C})=>[u.dataIndex==="name"?(e.openBlock(),e.createBlock(c,{key:0,size:"small",value:m.name,"onUpdate:value":g=>m.name=g},null,8,["value","onUpdate:value"])):e.createCommentVNode("",!0),u.dataIndex==="operation"?(e.openBlock(),e.createElementBlock(e.Fragment,{key:1},[e.createVNode(s,{size:"small",onClick:g=>t.openRuleModal(m,C)},{default:e.withCtx(()=>[e.createTextVNode("编辑")]),_:2},1032,["onClick"]),e.createVNode(s,{size:"small",onClick:g=>t.deleteRule(C),style:{"margin-left":"6px"}},{default:e.withCtx(()=>[e.createTextVNode("删除")]),_:2},1032,["onClick"])],64)):e.createCommentVNode("",!0)]),_:1},8,["columns","data-source"])]),_:1},8,["visible","onOk"]),e.createVNode(p,{ref:"conditionsRef",data:t.currentData,index:t.currentIndex,onSave:t.closeRuleModal},null,8,["data","index","onSave"])],64)}const pb=ae(cb,[["render",db]]),ub=[{title:"列名",dataIndex:"label",fixed:"left",ellipsis:!0,width:135},{title:"参数",dataIndex:"label",fixed:"left",ellipsis:!0,width:135},{title:"列自定义",dataIndex:"style",align:"center",ellipsis:!0,width:100},{title:"列宽度(px/%)",dataIndex:"width",ellipsis:!0,width:135},{title:"列自定义函数",dataIndex:"renderText",ellipsis:!0,width:170},{title:"列表头自定义函数",dataIndex:"headerTemplate",ellipsis:!0,width:170},{title:"数据格式化",dataIndex:"dataFormat",ellipsis:!0,width:225},{title:"保留小数位数",dataIndex:"retentiondigit",ellipsis:!0,width:135},{title:"表头/表尾列对齐方式",dataIndex:"headerAlign",ellipsis:!0,width:170},{title:"内容列对齐方式",dataIndex:"align",ellipsis:!0,width:170},{title:"固定当前列",dataIndex:"fixed",ellipsis:!0,width:170},{title:"计算行",dataIndex:"calculateShow",ellipsis:!0,width:180},{title:"条件设置",dataIndex:"conditions",ellipsis:!0,width:120}],fb=e.defineComponent({name:"TableColumnConfig",components:{ATable:j.Table,AModal:j.Modal,ACheckbox:j.Checkbox,AInput:j.Input,AInputNumber:j.InputNumber,ASelect:j.Select,ASelectOption:j.SelectOption,Editor:Wr,CodeOutlined:ys,ConditionsTable:pb},setup(){const t=e.inject(ve),o=e.inject(ge),n=e.computed(()=>{var w;return!!((w=e.unref(t))!=null&&w.isGroupTable)}),a=e.computed(()=>{var w;return((w=e.unref(t))==null?void 0:w.tableColumns)||[]}),l=e.ref([]);let r=null,s="";const c=e.ref(""),i=e.ref(""),d=e.ref(!1);e.watch(o,()=>{p()},{deep:!0,flush:"post"});const p=()=>{var x,S,A,v;let w=[];if(l.value=[],n.value){const D=((A=e.unref(o))==null?void 0:A.rowHeaderList)||[],T=((v=e.unref(o))==null?void 0:v.indicators)||[];w=[...D,...T]}else{const D=((x=e.unref(o))==null?void 0:x.queryColumnList)||[],T=((S=e.unref(o))==null?void 0:S.indicators)||[];w=[...D,...T]}console.log("columns",w,a),w.forEach(D=>{var R;let T=(R=e.unref(a))==null?void 0:R.find($=>$.label===D.label);T||(T={label:D.label,prop:D.label,style:!1,width:"",renderText:"",headerTemplate:"",headerAlign:"left",align:"left",fixed:"",dataFormat:[],retentiondigit:null,calculateShow:{sum:!1,avg:!1},conditions:[],attribute:{}}),T.calculateShow||(T.calculateShow={sum:!1,avg:!1}),l.value.push(T)}),t.value.tableColumns=l.value};e.onMounted(()=>{p()});const u=(w,x)=>{w.style=x.target.checked,w.style?w.renderBool===void 0&&(w.renderBool=!1):delete w.renderBool},m=(w,x,S)=>{w&&x&&(r=w,s=x,c.value=w[x]||"",d.value=!0,i.value=S)},C=w=>{try{c.value=w}catch(x){console.error(x)}},g=()=>{r&&s&&(r[s]=c.value),c.value="",d.value=!1},b=e.ref(),f=e.ref(0),h=e.ref();return{configColumns:ub,configData:l,editorTitle:i,editorVisible:d,optionCode:c,handleOk:g,renderSave:m,onEditorChange:C,changeRenderBool:u,openConditions:w=>{f.value=w,b.value=l.value[w],e.unref(h).open(l.value[w])},confirmConditions:w=>{b.value.rules=w},conditionsTableRef:h}}}),pg="",mb={class:"table-column-config"};function hb(t,o,n,a,l,r){const s=e.resolveComponent("a-checkbox"),c=e.resolveComponent("a-input"),i=e.resolveComponent("a-select-option"),d=e.resolveComponent("a-select"),p=e.resolveComponent("a-input-number"),u=e.resolveComponent("code-outlined"),m=e.resolveComponent("a-table"),C=e.resolveComponent("editor"),g=e.resolveComponent("a-modal"),b=e.resolveComponent("conditions-table");return e.openBlock(),e.createElementBlock("div",mb,[e.createVNode(m,{class:"column-table",columns:t.configColumns,"data-source":t.configData,scroll:{x:"100%",y:400},pagination:!1,bordered:""},{bodyCell:e.withCtx(({column:f,text:h,record:y,index:N})=>[f.dataIndex==="style"?(e.openBlock(),e.createBlock(s,{key:0,onChange:w=>t.changeRenderBool(y,w),checked:y.style},null,8,["onChange","checked"])):f.dataIndex==="width"?(e.openBlock(),e.createBlock(c,{key:1,value:y.width,"onUpdate:value":w=>y.width=w,valueModifiers:{trim:!0}},null,8,["value","onUpdate:value"])):f.dataIndex==="renderText"?(e.openBlock(),e.createElementBlock(e.Fragment,{key:2},[y.style?(e.openBlock(),e.createBlock(c,{key:1,value:y.renderText,"onUpdate:value":w=>y.renderText=w,readOnly:!0,onClick:w=>t.renderSave(y,"renderText","列自定义函数")},null,8,["value","onUpdate:value","onClick"])):(e.openBlock(),e.createElementBlock(e.Fragment,{key:0},[e.createTextVNode(e.toDisplayString(h),1)],64))],64)):f.dataIndex==="headerTemplate"?(e.openBlock(),e.createElementBlock(e.Fragment,{key:3},[y.style?(e.openBlock(),e.createBlock(c,{key:1,value:y.headerTemplate,"onUpdate:value":w=>y.headerTemplate=w,readOnly:!0,onClick:w=>t.renderSave(y,"headerTemplate","列表头自定义函数")},null,8,["value","onUpdate:value","onClick"])):(e.openBlock(),e.createElementBlock(e.Fragment,{key:0},[e.createTextVNode(e.toDisplayString(h),1)],64))],64)):f.dataIndex==="headerAlign"?(e.openBlock(),e.createBlock(d,{key:4,style:{width:"100%"},size:"small",value:y.headerAlign,"onUpdate:value":w=>y.headerAlign=w},{default:e.withCtx(()=>[e.createVNode(i,{value:"left"},{default:e.withCtx(()=>[e.createTextVNode("左对齐")]),_:1}),e.createVNode(i,{value:"center"},{default:e.withCtx(()=>[e.createTextVNode("居中")]),_:1}),e.createVNode(i,{value:"right"},{default:e.withCtx(()=>[e.createTextVNode("右对齐")]),_:1})]),_:2},1032,["value","onUpdate:value"])):f.dataIndex==="align"?(e.openBlock(),e.createBlock(d,{key:5,style:{width:"100%"},size:"small",value:y.align,"onUpdate:value":w=>y.align=w},{default:e.withCtx(()=>[e.createVNode(i,{value:"left"},{default:e.withCtx(()=>[e.createTextVNode("左对齐")]),_:1}),e.createVNode(i,{value:"center"},{default:e.withCtx(()=>[e.createTextVNode("居中")]),_:1}),e.createVNode(i,{value:"right"},{default:e.withCtx(()=>[e.createTextVNode("右对齐")]),_:1})]),_:2},1032,["value","onUpdate:value"])):f.dataIndex==="fixed"?(e.openBlock(),e.createBlock(d,{key:6,style:{width:"100%"},size:"small",value:y.fixed,"onUpdate:value":w=>y.fixed=w},{default:e.withCtx(()=>[e.createVNode(i,{value:""},{default:e.withCtx(()=>[e.createTextVNode("不固定")]),_:1}),e.createVNode(i,{value:"left"},{default:e.withCtx(()=>[e.createTextVNode("靠左")]),_:1}),e.createVNode(i,{value:"right"},{default:e.withCtx(()=>[e.createTextVNode("靠右")]),_:1})]),_:2},1032,["value","onUpdate:value"])):f.dataIndex==="dataFormat"?(e.openBlock(),e.createBlock(d,{key:7,value:y.dataFormat,"onUpdate:value":w=>y.dataFormat=w,style:{width:"100%"},mode:"multiple",allowClear:"",maxTagCount:1},{default:e.withCtx(()=>[e.createVNode(i,{value:"#,000"},{default:e.withCtx(()=>[e.createTextVNode("千分位")]),_:1}),e.createVNode(i,{value:"#.00"},{default:e.withCtx(()=>[e.createTextVNode("保留小数")]),_:1}),e.createVNode(i,{value:"#"},{default:e.withCtx(()=>[e.createTextVNode("保留有效位")]),_:1})]),_:2},1032,["value","onUpdate:value"])):f.dataIndex==="retentiondigit"?(e.openBlock(),e.createElementBlock(e.Fragment,{key:8},[y.dataFormat&&y.dataFormat.includes("#.00")?(e.openBlock(),e.createBlock(p,{key:0,value:y.retentiondigit,"onUpdate:value":w=>y.retentiondigit=w,min:0,max:10},null,8,["value","onUpdate:value"])):e.createCommentVNode("",!0)],64)):f.dataIndex==="calculateShow"?(e.openBlock(),e.createElementBlock(e.Fragment,{key:9},[e.createVNode(s,{checked:y.calculateShow.sum,"onUpdate:checked":w=>y.calculateShow.sum=w},{default:e.withCtx(()=>[e.createTextVNode("合计")]),_:2},1032,["checked","onUpdate:checked"]),e.createVNode(s,{checked:y.calculateShow.avg,"onUpdate:checked":w=>y.calculateShow.avg=w},{default:e.withCtx(()=>[e.createTextVNode("平均")]),_:2},1032,["checked","onUpdate:checked"])],64)):f.dataIndex==="conditions"?(e.openBlock(),e.createBlock(u,{key:10,class:"icon",onClick:e.withModifiers(w=>t.openConditions(N),["stop"])},null,8,["onClick"])):e.createCommentVNode("",!0)]),_:1},8,["columns","data-source"]),e.createVNode(g,{title:t.editorTitle,visible:t.editorVisible,"onUpdate:visible":o[0]||(o[0]=f=>t.editorVisible=f),"destroy-on-close":"",width:"700px",bodyStyle:{height:"500px",overflow:"auto"},centered:"",zIndex:1020,okText:"保存",cancelText:"取消",onOk:t.handleOk},{default:e.withCtx(()=>[e.createVNode(C,{class:"option-editor",language:"javascript",options:{fontSize:16,lineHeight:18},valueData:t.optionCode,onChange:t.onEditorChange},null,8,["valueData","onChange"])]),_:1},8,["title","visible","onOk"]),e.createVNode(b,{onConfirm:t.confirmConditions,ref:"conditionsTableRef"},null,8,["onConfirm"])])}const bb=ae(fb,[["render",hb],["__scopeId","data-v-bb095396"]]),yb=[{title:"列名",dataIndex:"label",fixed:"left",ellipsis:!0,width:135},{title:"参数",dataIndex:"label",fixed:"left",ellipsis:!0,width:135},{title:"数据格式化",dataIndex:"dataFormat",ellipsis:!0,width:225},{title:"保留小数位数",dataIndex:"retentiondigit",ellipsis:!0,width:135}],gb=e.defineComponent({name:"TableColumnConfig",components:{ATable:j.Table,AInputNumber:j.InputNumber,ASelect:j.Select,ASelectOption:j.SelectOption,ACollapse:j.Collapse,ACollapsePanel:j.CollapsePanel},setup(){const t=e.inject(ve),o=e.inject(ge),n=e.ref(["cardFormat"]),a=()=>{var d;const r=((d=e.unref(o))==null?void 0:d.indicators)||[],s=t.value.columnsConfigMap||{},c={dataFormat:[],retentiondigit:""},i=r.reduce((p,u)=>({...p,[u.label]:{...c,...s[u.label]||{}}}),{});t.value.columnsConfigMap=i};e.watch(o,()=>{a()},{deep:!0,flush:"post"}),e.onMounted(()=>{a()});const l=e.computed(()=>t.value.columnsConfigMap||{});return{selectedComponent:t,configColumns:yb,graphicConfig:o,columnsConfigMap:l,activePanel:n}}}),ug="";function Cb(t,o,n,a,l,r){const s=e.resolveComponent("a-select-option"),c=e.resolveComponent("a-select"),i=e.resolveComponent("a-input-number"),d=e.resolveComponent("a-table"),p=e.resolveComponent("a-collapse-panel"),u=e.resolveComponent("a-collapse");return e.openBlock(),e.createBlock(u,{activeKey:t.activePanel,"onUpdate:activeKey":o[0]||(o[0]=m=>t.activePanel=m)},{default:e.withCtx(()=>[e.createVNode(p,{key:"cardFormat",header:"数据格式化"},{default:e.withCtx(()=>[e.createVNode(d,{class:"column-table",columns:t.configColumns,"data-source":t.graphicConfig.indicators||[],scroll:{x:"100%",y:400},pagination:!1,bordered:""},{bodyCell:e.withCtx(({column:m,record:C})=>[m.dataIndex==="dataFormat"&&t.columnsConfigMap[C.label]?(e.openBlock(),e.createBlock(c,{key:0,value:t.columnsConfigMap[C.label].dataFormat,"onUpdate:value":g=>t.columnsConfigMap[C.label].dataFormat=g,style:{width:"100%"},mode:"multiple",allowClear:"",maxTagCount:1},{default:e.withCtx(()=>[e.createVNode(s,{value:"#,000"},{default:e.withCtx(()=>[e.createTextVNode("千分位")]),_:1}),e.createVNode(s,{value:"#.00"},{default:e.withCtx(()=>[e.createTextVNode("保留小数")]),_:1}),e.createVNode(s,{value:"#"},{default:e.withCtx(()=>[e.createTextVNode("保留有效位")]),_:1})]),_:2},1032,["value","onUpdate:value"])):m.dataIndex==="retentiondigit"&&t.columnsConfigMap[C.label]?(e.openBlock(),e.createElementBlock(e.Fragment,{key:1},[t.columnsConfigMap[C.label].dataFormat&&t.columnsConfigMap[C.label].dataFormat.includes("#.00")?(e.openBlock(),e.createBlock(i,{key:0,value:t.columnsConfigMap[C.label].retentiondigit,"onUpdate:value":g=>t.columnsConfigMap[C.label].retentiondigit=g,min:0,max:10},null,8,["value","onUpdate:value"])):e.createCommentVNode("",!0)],64)):e.createCommentVNode("",!0)]),_:1},8,["columns","data-source"])]),_:1})]),_:1},8,["activeKey"])}const wb=ae(gb,[["render",Cb],["__scopeId","data-v-72761110"]]),kb=e.defineComponent({name:"StyleConfigGroup",props:{componentType:{type:String,default:""},isGroupTable:{type:Boolean,default:!1}},components:{PropsToForm:Oh,TableColumnConfig:bb,Editor:Wr,AFormItem:j.FormItem,ASelect:j.Select,ASelectOption:j.SelectOption,ACollapse:j.Collapse,ACollapsePanel:j.CollapsePanel,ASwitch:j.Switch,IndicatorContainer:wb},setup(t){const o=e.ref([]),n=e.ref(["表格"]),a=e.inject(wo),l=e.inject(ma),r=e.inject(Ko),s=e.inject(Xo),c=e.inject(fa),i=e.inject(ve),d=S=>{r({...Jo[S]},!1),e.unref(i).type=e.unref(p),c()},p=e.computed(()=>{var S;return(S=e.unref(a))==null?void 0:S.type}),u=["showTotalBool","totalName","expandAll"],m=e.computed(()=>Cf.map(S=>{const{props:A,title:v,enableProps:D,onlyType:T,excludeType:R}=S,$=[];A.forEach(B=>{typeof B=="string"&&(u.includes(B)?t.isGroupTable&&$.push(B):$.push(B))});let F,_;return t.componentType==="table"&&(T!=null&&T.includes(t.componentType))?(F=typeof D=="string"&&l.value?l.value[D]:void 0,_=ee.pick(e.unref(l),$)):(F=typeof D=="string"&&a.value?a.value[D]:void 0,_=ee.pick(e.unref(a),$)),{title:v,enableProps:F,enablePropsName:D,onlyType:T,excludeType:R,props:_}}).filter(({props:S})=>Object.keys(S).length>0)),C=(S,A)=>{const{onlyType:v,excludeType:D}=S;return v==null&&D==null?!0:v?ue(A,v):D?!ue(A,D):!1},g=(S,A)=>(A==null||A.stopPropagation(),S),b=(S,A)=>{A!=null&&r({[A]:S})},f=e.computed(()=>JSON.stringify(e.unref(a),null,2)),h=S=>{try{const A=JSON.parse(S||"{}");r(A,!1)}catch(A){console.error(A)}},y=e.ref(""),N=S=>{try{y.value=S}catch(A){console.error(A)}},w=(S,A)=>{try{s({[A]:S})}catch(v){console.error(v)}},x=e.computed(()=>{var S;return["customGraph"].includes((S=e.unref(a))==null?void 0:S.type)});return{type:p,handleChangeType:d,activePanel:o,tablePanel:n,ComponentString:f,updateComponentOptions:h,tableOptions:l,optionCode:y,onEditorChange:N,tableEditorChange:w,onSwitchClick:g,onSwitchChange:b,detailPropsGroups:m,isRenderForm:C,isShowOptionEditor:x}}}),fg="",mg="",xb={class:"style-group"};function _b(t,o,n,a,l,r){const s=e.resolveComponent("a-select-option"),c=e.resolveComponent("a-select"),i=e.resolveComponent("a-form-item"),d=e.resolveComponent("a-switch"),p=e.resolveComponent("props-to-form"),u=e.resolveComponent("a-collapse-panel"),m=e.resolveComponent("editor"),C=e.resolveComponent("a-collapse"),g=e.resolveComponent("table-column-config"),b=e.resolveComponent("indicator-container");return e.openBlock(),e.createElementBlock("div",xb,[t.componentType!=="table"&&t.componentType!=="card"?(e.openBlock(),e.createElementBlock(e.Fragment,{key:0},[e.createVNode(i,{label:"图表类型"},{default:e.withCtx(()=>[e.createVNode(c,{value:t.type,"onUpdate:value":o[0]||(o[0]=f=>t.type=f),style:{width:"100%"},onChange:t.handleChangeType},{default:e.withCtx(()=>[e.createVNode(s,{value:"line"},{default:e.withCtx(()=>[e.createTextVNode("折线图")]),_:1}),e.createVNode(s,{value:"bar"},{default:e.withCtx(()=>[e.createTextVNode("柱状图")]),_:1}),e.createVNode(s,{value:"pie"},{default:e.withCtx(()=>[e.createTextVNode("饼图")]),_:1}),e.createVNode(s,{value:"comboGraph"},{default:e.withCtx(()=>[e.createTextVNode("组合图表")]),_:1}),e.createVNode(s,{value:"customGraph"},{default:e.withCtx(()=>[e.createTextVNode("自定义图表")]),_:1})]),_:1},8,["value","onChange"])]),_:1}),e.createVNode(C,{activeKey:t.activePanel,"onUpdate:activeKey":o[1]||(o[1]=f=>t.activePanel=f)},{default:e.withCtx(()=>[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(t.detailPropsGroups,f=>(e.openBlock(),e.createElementBlock(e.Fragment,{key:f.title},[t.isRenderForm(f,t.type)?(e.openBlock(),e.createElementBlock(e.Fragment,{key:0},[f.title?(e.openBlock(),e.createBlock(u,{header:f.title,key:f.title},{extra:e.withCtx(()=>[typeof f.enableProps=="boolean"?(e.openBlock(),e.createBlock(d,{key:0,checked:f.enableProps,onChange:h=>t.onSwitchChange(h,f.enablePropsName),onClick:t.onSwitchClick},null,8,["checked","onChange","onClick"])):e.createCommentVNode("",!0)]),default:e.withCtx(()=>[e.createVNode(p,{props:f.props,disabled:typeof f.enableProps=="boolean"?!f.enableProps:!1},null,8,["props","disabled"])]),_:2},1032,["header"])):e.createCommentVNode("",!0)],64)):e.createCommentVNode("",!0)],64))),128)),t.isShowOptionEditor?(e.openBlock(),e.createBlock(u,{key:"custom-option",header:"自定义option配置"},{default:e.withCtx(()=>[e.createVNode(m,{class:"option-editor",language:"typescript",valueData:t.optionCode,onChange:t.onEditorChange},null,8,["valueData","onChange"])]),_:1})):e.createCommentVNode("",!0)]),_:1},8,["activeKey"])],64)):e.createCommentVNode("",!0),t.componentType==="table"?(e.openBlock(),e.createBlock(C,{key:1,activeKey:t.tablePanel,"onUpdate:activeKey":o[4]||(o[4]=f=>t.tablePanel=f)},{default:e.withCtx(()=>[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(t.detailPropsGroups,f=>{var h;return e.openBlock(),e.createElementBlock(e.Fragment,{key:f.title},[f.title&&((h=f.onlyType)!=null&&h.includes(t.componentType))?(e.openBlock(),e.createBlock(u,{header:f.title,key:f.title},{default:e.withCtx(()=>[e.createVNode(p,{componentType:t.componentType,props:f.props,disabled:typeof f.enableProps=="boolean"?!f.enableProps:!1},null,8,["componentType","props","disabled"])]),_:2},1032,["header"])):e.createCommentVNode("",!0)],64)}),128)),e.createVNode(u,{key:"tableColumn",header:"表格列配置"},{default:e.withCtx(()=>[e.createVNode(g)]),_:1}),e.createVNode(u,{key:"headerCellStyleMethod",header:"表头单元格样式"},{default:e.withCtx(()=>[e.createVNode(m,{class:"option-editor",language:"javascript",options:{fontSize:16,lineHeight:18},valueData:t.tableOptions.headerCellStyleMethod,onChange:o[2]||(o[2]=f=>t.tableEditorChange(f,"headerCellStyleMethod"))},null,8,["valueData"])]),_:1}),e.createVNode(u,{key:"rowStyleMethod",header:"行样式"},{default:e.withCtx(()=>[e.createVNode(m,{class:"option-editor",language:"javascript",options:{fontSize:16,lineHeight:18},valueData:t.tableOptions.rowStyleMethod,onChange:o[3]||(o[3]=f=>t.tableEditorChange(f,"rowStyleMethod"))},null,8,["valueData"])]),_:1})]),_:1},8,["activeKey"])):e.createCommentVNode("",!0),t.componentType==="card"?(e.openBlock(),e.createBlock(b,{key:2})):e.createCommentVNode("",!0)])}const Sb=ae(kb,[["render",_b],["__scopeId","data-v-9a2fa8f5"]]),Tb=e.defineComponent({name:"Card",components:{CloseOutlined:Zt,AInput:j.Input,ASelect:j.Select,MenuOutlined:Sn,ADropdown:j.Dropdown,AMenu:j.Menu,AMenuItem:j.MenuItem},props:{index:{type:Number,require:!0},control:{type:Object,default:()=>({})},conditionOptions:{type:Array,default:()=>[]},path:{type:String,default:""}},emits:["delete","update"],setup(t){const o=e.inject(ze),n=e.inject(xo),a=e.inject(ya),l=e.inject(Qo),{onUpdateControl:r,onDeleteControl:s,onAddMenuControl:c}=e.inject("CHANGE_CONTROL",{onUpdateControl:k=>{},onDeleteControl:k=>{},onAddMenuControl:(k,L,M)=>{}}),i=e.computed(()=>{var k;return(k=e.unref(o))==null?void 0:k.filter(L=>L.keyName!=="")}),d=e.computed(()=>{const k=[];return e.unref(l)||k.push({keyName:"父页面",id:"PARENT"}),[...k,...e.unref(i)]}),p=e.computed(()=>{var M,U;const k=[],L=(M=e.unref(i))==null?void 0:M.find(z=>{var q;return z.id===((q=t.control)==null?void 0:q.id)});if(L){const z=L.type,q=ee.pick(L,["value","startTime","endTime"]);(U=Object.keys(q))!=null&&U.length||(q.value="");for(const X in q)if(Object.prototype.hasOwnProperty.call(q,X)){const J=e.unref(a)[X];if(Array.isArray(J)){const oe=J.find(le=>ue(z,le.onlyType));oe&&k.push({label:oe.label,value:X})}else k.push({label:J.label,value:X})}}return k}),u=()=>{s({index:t.index,path:t.path}),C(t.control.id)},m=({key:k})=>{c(t.path,t.index,k==="2"?"||":"&&")};function C(k){const L=e.unref(i).find(M=>M.id===k);if(L){const{type:M,id:U,events:z=[]}=L,q=Vo(M),X=z.findIndex(J=>{var oe;return J.on===q&&J.target===((oe=e.unref(A))==null?void 0:oe.id)&&J.emit==="refreshData"});X!==-1&&(z.splice(X,1),n({id:U,events:z}))}}const g=k=>{const L={...t.control};if(L.id=k,L.customValue="",k){const M=e.unref(i).find(U=>U.id===k);M&&(L.keyName=M.keyName,D(M,k))}delete L.prop,r({control:L,index:t.index,path:t.path})},b=e.ref(""),f=()=>{b.value=t.control.id},h=k=>{r({control:{...t.control,prop:k},index:t.index,path:t.path})},y=k=>{r({control:{...t.control,prop:k.target.value},index:t.index,path:t.path})},N=k=>{r({control:{...t.control,rule:k},index:t.index,path:t.path})},w=k=>{const L={...t.control};L.modelKey&&(L.modelKey=""),L.prop&&(L.prop=""),L.format&&(L.format=""),r({control:{...L,dataType:k,customValue:"",id:"",keyName:""},index:t.index,path:t.path})},x=k=>{r({control:{...t.control,customValue:k.target.value},index:t.index,path:t.path})},S=k=>{const L={...t.control};k==null?delete L.mode:L.mode=k,delete L.conditionLabel,delete L.conditionName,delete L.conditionKey,delete L.conditionValueType,r({control:L,index:t.index,path:t.path})},A=e.inject(ve),v=e.inject(ge);function D(k,L){var X,J;const{type:M,id:U,events:z=[]}=k,q=Vo(M);e.unref(b)&&L!==e.unref(b)&&(ut(((X=e.unref(v))==null?void 0:X.controlList)||[]).find(le=>le.id===e.unref(b))||C(e.unref(b))),z.find(oe=>{var le;return oe.on===q&&oe.target===((le=e.unref(A))==null?void 0:le.id)&&oe.emit==="refreshData"})||n({id:U,events:[...z,{on:q,target:(J=e.unref(A))==null?void 0:J.id,emit:"refreshData"}].reverse()})}const T=(k,L)=>{if(k){const{label:M,name:U,id:z,genericType:q,indexCode:X,typeGuid:J,indexCodeNum:oe}=L||{},le={...t.control,conditionKey:z,conditionLabel:M,conditionName:U,conditionValueType:q,indexCode:X,typeGuid:J,indexCodeNum:oe};Ye(le,"rule")||(le.rule="EQUAL"),Ye(le,"dataType")||(le.dataType="component"),r({control:le,index:t.index,path:t.path})}else{const M={...t.control};delete M.conditionLabel,delete M.conditionName,delete M.conditionKey,delete M.conditionValueType,r({control:M,index:t.index,path:t.path})}},R=(k,L)=>{var M;return(M=L==null?void 0:L.keyName)==null?void 0:M.toLowerCase().includes(k==null?void 0:k.toLowerCase())},$=(k,L)=>{var M;return(M=L==null?void 0:L.label)==null?void 0:M.toLowerCase().includes(k==null?void 0:k.toLowerCase())},F=e.computed(()=>{const k=t.conditionOptions.find(M=>M.id===t.control.conditionKey);let L="";return k&&(L=(k==null?void 0:k.genericType)||""),L==="TEXT"||L==="0"?[{label:"属于",value:"IN"},{label:"不属于",value:"NOT_IN"},{label:"包含",value:"LIKE"},{label:"不包含",value:"NOT_LIKE"},{label:"开头是",value:"LIKE%"},{label:"结尾是",value:"%LIKE"},{label:"等于",value:"EQUAL"},{label:"小于",value:"LESS"},{label:"小于等于",value:"LESS_EQUAL"},{label:"大于",value:"GREATER"},{label:"大于等于",value:"GREATER_EQUAL"}]:L==="NUMBER"||L==="1"?[{label:"小于",value:"LESS"},{label:"小于等于",value:"LESS_EQUAL"},{label:"大于",value:"GREATER"},{label:"大于等于",value:"GREATER_EQUAL"},{label:"等于",value:"EQUAL"},{label:"不等于",value:"NOT_EQUAL"}]:L==="DATE"||L==="2"?[{label:"属于",value:"IN"},{label:"不属于",value:"NOT_IN"},{label:"小于",value:"LESS"},{label:"小于等于",value:"LESS_EQUAL"},{label:"大于",value:"GREATER"},{label:"大于等于",value:"GREATER_EQUAL"},{label:"等于",value:"EQUAL"},{label:"不等于",value:"NOT_EQUAL"}]:[]}),_=[{label:"自定义值",value:""},{label:"组件值",value:"component"}],B=e.computed(()=>{let k=!1;const{id:L="",dataType:M="component"}=t.control;if(L&&M==="component"){const U=e.unref(i).find(q=>q.id===L),z=["table","bar","combograph","line","pie","radar","scatter","list","circulate"];ue(U==null?void 0:U.type,z)&&(k=!0)}return L==="PARENT"&&(k=!0),k}),E=e.computed(()=>{let k=!1;const{id:L="",dataType:M="component"}=t.control;if(L&&M==="component"){const U=e.unref(i).find(z=>z.id===L);ue((U==null?void 0:U.type)||"","range")&&(k=!0)}return L==="PARENT"&&(k=!0),k}),P=e.computed(()=>{let k=!1;const{id:L="",dataType:M="component"}=t.control;if(L&&M==="component"){const U=e.unref(i).find(z=>z.id===L);ue((U==null?void 0:U.type)||"",["date","range"])&&(k=!0)}return k});return{propOptions:p,usedComponentList:i,onDelete:u,onIdChange:g,onIdFocus:f,onPropChange:h,onParentPropChange:y,onModeChange:S,onRuleChange:N,onDataTypeChange:w,onCustomValueChange:x,onConditionKeyChange:T,idFilterOption:R,filterOption:$,onFormatChange:k=>{r({control:{...t.control,format:k},index:t.index,path:t.path})},onModelPropChange:k=>{r({control:{...t.control,modelKey:k.target.value},index:t.index,path:t.path})},clickConditionMenu:m,ruleOption:F,dataTypeOption:_,isShowProp:E,isShowFormat:P,isShowModelProp:B,formatOptions:[{label:"年",value:"YYYY"},{label:"年月",value:"YYYY-MM"},{label:"年月日",value:"YYYY-MM-DD"},{label:"年月日时",value:"YYYY-MM-DD HH"},{label:"年月日时分",value:"YYYY-MM-DD HH:mm"},{label:"年月日时分秒",value:"YYYY-MM-DD HH:mm:ss"}],keyNameOptions:d}}}),hg="",bg="",Nb={class:"control-card"};function Ab(t,o,n,a,l,r){const s=e.resolveComponent("a-select"),c=e.resolveComponent("a-input"),i=e.resolveComponent("menu-outlined"),d=e.resolveComponent("a-menu-item"),p=e.resolveComponent("a-menu"),u=e.resolveComponent("a-dropdown"),m=e.resolveComponent("close-outlined");return e.openBlock(),e.createElementBlock("div",Nb,[e.createVNode(s,{class:"field-name",value:t.control.conditionKey,options:t.conditionOptions,fieldNames:{value:"id"},"allow-clear":"","show-search":"",onChange:t.onConditionKeyChange,"filter-option":t.filterOption},null,8,["value","options","onChange","filter-option"]),e.createVNode(s,{class:"field-name",value:t.control.rule,options:t.ruleOption,style:{"max-width":"100px"},onChange:t.onRuleChange},null,8,["value","options","onChange"]),e.createVNode(s,{class:"field-name",value:t.control.dataType,options:t.dataTypeOption,style:{"max-width":"100px"},onChange:t.onDataTypeChange},null,8,["value","options","onChange"]),t.control.dataType===""?(e.openBlock(),e.createBlock(c,{key:0,class:"field-name",value:t.control.customValue,style:{"max-width":"180px"},onInput:t.onCustomValueChange},null,8,["value","onInput"])):e.createCommentVNode("",!0),t.control.dataType==="component"?(e.openBlock(),e.createBlock(s,{key:1,class:"field-name",value:t.control.id,options:t.keyNameOptions,fieldNames:{label:"keyName",value:"id"},"show-search":"","filter-option":t.idFilterOption,style:{"max-width":"180px"},onChange:t.onIdChange,onClick:t.onIdFocus},null,8,["value","options","filter-option","onChange","onClick"])):e.createCommentVNode("",!0),t.isShowModelProp?(e.openBlock(),e.createBlock(c,{key:2,class:"field-name",value:t.control.modelKey,onInput:t.onModelPropChange,placeholder:t.control.id==="PARENT"?"请输入组件别名":""},null,8,["value","onInput","placeholder"])):e.createCommentVNode("",!0),t.isShowProp?(e.openBlock(),e.createElementBlock(e.Fragment,{key:3},[t.control.id==="PARENT"?(e.openBlock(),e.createBlock(c,{key:0,class:"field-name",value:t.control.prop,onInput:t.onParentPropChange,placeholder:"请输入属性名"},null,8,["value","onInput"])):(e.openBlock(),e.createBlock(s,{key:1,class:"field-name",value:t.control.prop,options:t.propOptions,onChange:t.onPropChange},null,8,["value","options","onChange"]))],64)):e.createCommentVNode("",!0),t.isShowFormat?(e.openBlock(),e.createBlock(s,{key:4,class:"field-name",value:t.control.format,options:t.formatOptions,onChange:t.onFormatChange},null,8,["value","options","onChange"])):e.createCommentVNode("",!0),e.createVNode(u,{trigger:["click"]},{overlay:e.withCtx(()=>[e.createVNode(p,{onClick:t.clickConditionMenu},{default:e.withCtx(()=>[e.createVNode(d,{key:"1"},{default:e.withCtx(()=>[e.createTextVNode("添加且条件")]),_:1}),e.createVNode(d,{key:"2"},{default:e.withCtx(()=>[e.createTextVNode("添加或条件")]),_:1})]),_:1},8,["onClick"])]),default:e.withCtx(()=>[e.createVNode(i,{class:"more-icon"})]),_:1}),e.createVNode(m,{class:"delete-icon",onClick:t.onDelete},null,8,["onClick"])])}const Eb=ae(Tb,[["render",Ab],["__scopeId","data-v-f2a646f1"]]),Ob=e.defineComponent({name:"ControlList",props:{list:{type:Array,default:()=>[]},level:{type:Number,default:0},path:{type:String,default:""},conditionOptions:{type:Array,default:()=>[]}},components:{ControlCard:Eb}}),yg="",Bb={key:0,class:"condition-list"},Vb={key:0,class:"condition-container"},Lb={key:0,class:"condition-text"},Fb={key:1,class:"condition-text"},$b={class:"conditions"};function Ib(t,o,n,a,l,r){const s=e.resolveComponent("control-list",!0),c=e.resolveComponent("control-card");return Array.isArray(t.list)?(e.openBlock(),e.createElementBlock("div",Bb,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(t.list,(i,d)=>(e.openBlock(),e.createElementBlock(e.Fragment,{key:d},[i.join&&i.conditions&&Array.isArray(i.conditions)?(e.openBlock(),e.createElementBlock("div",Vb,[i.conditions.length>1?(e.openBlock(),e.createElementBlock(e.Fragment,{key:0},[i.join==="||"?(e.openBlock(),e.createElementBlock("div",Lb,"或")):e.createCommentVNode("",!0),i.join==="&&"?(e.openBlock(),e.createElementBlock("div",Fb,"且")):e.createCommentVNode("",!0)],64)):e.createCommentVNode("",!0),e.createElementVNode("div",$b,[i.conditions.length>0?(e.openBlock(),e.createBlock(s,{key:0,level:t.level+1,path:`${t.path?t.path+"-":""}${d}`,list:i.conditions,conditionOptions:t.conditionOptions},null,8,["level","path","list","conditionOptions"])):e.createCommentVNode("",!0)])])):(e.openBlock(),e.createBlock(c,{class:"condition",key:i.keyValue||`${t.level}-${d}`,control:i,index:d,path:t.path||"",conditionOptions:t.conditionOptions},null,8,["control","index","path","conditionOptions"]))],64))),128))])):e.createCommentVNode("",!0)}const vb=ae(Ob,[["render",Ib],["__scopeId","data-v-2588920e"]]),Db=e.defineComponent({name:"ControlGroup",props:{conditionOptions:{type:Array,default:()=>[]}},components:{ControlList:vb,AButton:j.Button,ASelect:j.Select,APopover:j.Popover},setup(){const t=e.ref(!1),o=e.ref([]),n=e.inject(ze),a=e.inject(ge),l=e.inject(Ae),r=e.inject(ba),s=e.computed(()=>{var h,y;const f=((h=e.unref(a))==null?void 0:h.controlList)||[];for(const N of f)N.conditionKey&&(Ye(N,"rule")||(N.prop==="startTime"?N.rule="GREATER_EQUAL":N.prop==="endTime"?N.rule="LESS_EQUAL":N.rule="EQUAL"),Ye(N,"dataType")||(N.dataType="component"));return(f==null?void 0:f.length)>1&&!((y=f[0])!=null&&y.join)?[{join:"&&",conditions:f}]:f}),c=e.ref(null),i=f=>{const h={...e.unref(a),...f,sqlConditions:Kl({...e.unref(a),...f},e.unref(n))};l(h)},d=f=>{var y;const h=(y=e.unref(s))==null?void 0:y.slice();h==null||(h==null?void 0:h.length)===0?i({controlList:[{keyValue:ye()}]}):h[0]!=null&&(h[0].conditions==null||h[0].join!==f?i({controlList:[{join:f,conditions:[h[0],{keyValue:ye()}]}]}):h[0].conditions.length>1&&h[0].join===f&&(h[0].conditions.push({keyValue:ye()}),i({controlList:h})))},p=f=>{var S,A,v,D;const{index:h,path:y}=f;let N=ee.cloneDeep((S=e.unref(s))==null?void 0:S.slice()),w=N;const x=y.split("-");if(x!=null&&x.length){for(const T of x)if(w[T])w=(A=w[T])==null?void 0:A.conditions;else break;if(Array.isArray(w)&&w[h])if(w.splice(h,1),w.length===1){if(x.length>0){const T=x.length-1,R=x[T],$=x.slice(0,T);let F=N,_="";for(const B of $)if(F[B])_=(v=F[B])==null?void 0:v.join,F=(D=F[B])==null?void 0:D.conditions;else break;if(_===w[0].join){if(Array.isArray(w[0].conditions)){const B=ee.cloneDeep(w[0].conditions);F.splice(+R,1),F.splice(+R,0,...B)}}else F[R]=w[0]}}else w.length===0&&(N=[]);i({controlList:N})}},u=f=>{var A,v;const{control:h,index:y,path:N}=f,w=ee.cloneDeep((A=e.unref(s))==null?void 0:A.slice());let x=w;const S=N.split("-");if(S!=null&&S.length)for(const D of S)if(x[D])x=(v=x[D])==null?void 0:v.conditions;else break;Array.isArray(x)&&x[y]&&(x[y]=h),i({controlList:w})},m=(f,h,y)=>{var A,v,D;const N=ee.cloneDeep((A=e.unref(s))==null?void 0:A.slice());let w=N,x="";const S=f.split("-");if(S!=null&&S.length){for(const T of S)if(w[T])x=(v=w[T])==null?void 0:v.join,w=(D=w[T])==null?void 0:D.conditions;else break;if(x===y)w.splice(h+1,0,{keyValue:ye()});else{const T=ee.cloneDeep(w[h]);w[h]={join:y,conditions:[T,{keyValue:ye()}]}}i({controlList:N})}},C=(f,h)=>{var y;return(y=h==null?void 0:h.label)==null?void 0:y.toLowerCase().includes(f==null?void 0:f.toLowerCase())},g=e.computed(()=>e.unref(n).filter(f=>f.dataType==="indicator"&&f.graphicConfig.source==="INDICATOR_LIB").map(f=>({label:f.keyName,value:f.id}))),b=()=>{var f;try{(f=e.unref(o))!=null&&f.length&&(r(e.unref(o),e.unref(s)),j.message.success("应用成功")),t.value=!1}catch(h){console.error(h)}};return e.watch(t,f=>{f||(o.value=[])}),e.provide("CHANGE_CONTROL",{onDeleteControl:p,onUpdateControl:u,onAddMenuControl:m}),{isVisible:t,selectedIds:o,controlList:s,bindComponentId:c,indicatorComponents:g,onAddControl:d,filterOption:C,handleConfirmSync:b}}}),gg="",Mb=t=>(e.pushScopeId("data-v-c0d80844"),t=t(),e.popScopeId(),t),Pb={class:"control-group"},jb={class:"control-group-header"},Rb={class:"sync-wrap"},Ub=Mb(()=>e.createElementVNode("div",{class:"title"}," 将此全局过滤条件配置同步至选中组件的指标库配置中。若被选中组件已有全局过滤条件将会被覆盖! ",-1)),zb={key:0,class:"selected-total"},Gb={class:"operate-container"},Hb={class:"control-group-content"};function Wb(t,o,n,a,l,r){const s=e.resolveComponent("a-button"),c=e.resolveComponent("a-select"),i=e.resolveComponent("a-popover"),d=e.resolveComponent("control-list");return e.openBlock(),e.createElementBlock("div",Pb,[e.createElementVNode("div",jb,[Array.isArray(t.controlList)&&t.controlList.length>0?(e.openBlock(),e.createElementBlock(e.Fragment,{key:0},[e.createVNode(s,{onClick:o[0]||(o[0]=p=>t.onAddControl("&&"))},{default:e.withCtx(()=>[e.createTextVNode("添加且条件")]),_:1}),e.createVNode(s,{onClick:o[1]||(o[1]=p=>t.onAddControl("||")),style:{"margin-left":"15px"}},{default:e.withCtx(()=>[e.createTextVNode("添加或条件")]),_:1})],64)):(e.openBlock(),e.createBlock(s,{key:1,onClick:o[2]||(o[2]=p=>t.onAddControl())},{default:e.withCtx(()=>[e.createTextVNode("添加条件")]),_:1})),e.createVNode(i,{visible:t.isVisible,"onUpdate:visible":o[4]||(o[4]=p=>t.isVisible=p),title:"选择组件",placement:"bottomRight",trigger:"click"},{content:e.withCtx(()=>{var p;return[e.createElementVNode("div",Rb,[Ub,t.indicatorComponents.length?(e.openBlock(),e.createElementBlock("div",zb,e.toDisplayString(t.selectedIds.length)+" / "+e.toDisplayString(t.indicatorComponents.length)+" 项 ",1)):e.createCommentVNode("",!0),e.createElementVNode("div",Gb,[e.createVNode(c,{style:{flex:"1"},value:t.selectedIds,"onUpdate:value":o[3]||(o[3]=u=>t.selectedIds=u),"show-search":"",mode:"multiple",placeholder:"请选择","filter-option":t.filterOption,options:t.indicatorComponents},null,8,["value","filter-option","options"]),e.createVNode(s,{style:{"margin-left":"10px"},type:"primary",disabled:!((p=t.selectedIds)!=null&&p.length),onClick:t.handleConfirmSync},{default:e.withCtx(()=>[e.createTextVNode(" 确定 ")]),_:1},8,["disabled","onClick"])])])]}),default:e.withCtx(()=>[Array.isArray(t.controlList)&&t.controlList.length>0?(e.openBlock(),e.createBlock(s,{key:0,type:"primary",ghost:"",style:{float:"right"}},{default:e.withCtx(()=>[e.createTextVNode(" 应用到其他组件 ")]),_:1})):e.createCommentVNode("",!0)]),_:1},8,["visible"])]),e.createElementVNode("div",Hb,[e.createVNode(d,{class:"condition-list",list:t.controlList,level:0,conditionOptions:t.conditionOptions},null,8,["list","conditionOptions"])])])}const Yb=ae(Db,[["render",Wb],["__scopeId","data-v-c0d80844"]]),qb=e.defineComponent({name:"VariableCard",props:{item:{type:Object,default:()=>({})},index:{type:Number,require:!0},label:String},components:{CloseOutlined:Zt,AppstoreAddOutlined:un,ASelect:j.Select,ASelectOption:j.SelectOption,AInput:j.Input,APopover:j.Popover,ATabs:j.Tabs,ATabPane:j.TabPane,AInputNumber:j.InputNumber},setup(t,{emit:o}){const n=e.ref(!1),a=e.inject(ze),l=e.computed(()=>{var w;return(w=e.unref(a))==null?void 0:w.filter(x=>x.keyName!=="")}),r=[{label:"TEXT",value:"TEXT"},{label:"NUMBER",value:"NUMBER"},{label:"DATE",value:"DATE"}],s=[{label:"自定义值",value:""},{label:"组件值",value:"component"}],c=[{label:"间隔值",value:"rangeValue"},{label:"开始时间",value:"startTime"},{label:"结束时间",value:"endTime"}],i=e.ref(ee.cloneDeep(t.item));e.watch(i,w=>{o("update",{...w,label:t.label},t.index)},{deep:!0});const d=e.computed(()=>{var x;let w=null;if(((x=e.unref(i))==null?void 0:x.dataType)==="component"){const S=e.unref(l).find(A=>{var v;return A.id===((v=e.unref(i))==null?void 0:v.id)});S&&(w=S)}return w}),p=e.computed(()=>{var x;let w=!1;return((x=e.unref(i))==null?void 0:x.variableType)==="DATE"&&(w=!0),w}),u=e.computed(()=>{let w=!1;return e.unref(d)&&(w=ue(e.unref(d).type,"range")),w}),m=e.computed(()=>{let w=!1;return e.unref(d)&&(ue(e.unref(d).type,"range")?["startTime","endTime"].includes(e.unref(i).dateTypeValue)&&(w=!0):ue(e.unref(d).type,"date")&&(w=!0)),w}),C=(w,x)=>{w&&(e.unref(i).keyName=x.keyName)},g=()=>{o("delete",t.index)},b=e.computed(()=>e.unref(p)?[{label:"年",value:"YYYY"},{label:"年月",value:"YYYY-MM"},{label:"年月日",value:"YYYY-MM-DD"},{label:"年月日时",value:"YYYY-MM-DD HH"},{label:"年月日时分",value:"YYYY-MM-DD HH:mm"},{label:"年月日时分秒",value:"YYYY-MM-DD HH:mm:ss"}]:[]),f=()=>{e.unref(i).id=null,e.unref(i).keyName="",e.unref(i).dateTypeValue=null,e.unref(i).variableValue=""},h=()=>{e.unref(i).format=null},y=(w,x)=>{var S;return(S=x==null?void 0:x.keyName)==null?void 0:S.toLowerCase().includes(w==null?void 0:w.toLowerCase())};return e.watch(m,w=>{w&&(e.unref(i).operateType||(e.unref(i).operateType="add"),e.unref(i).operateMode||(e.unref(i).operateMode="year"),e.unref(i).operateValue||(e.unref(i).operateValue=0),e.unref(i).activeOperateKey||(e.unref(i).activeOperateKey=1))},{immediate:!0}),{variableData:i,typeOption:r,dataTypeOption:s,usedComponentList:l,formatOptions:b,rangeTypeOptions:c,isShowFormat:p,isDateRangeComponent:u,isShowDateOperate:m,popoverVisible:n,idFilterOption:y,onChangeComponent:C,onDelete:g,onChangeDataType:f,onChangeVariableType:h,changeTab:w=>{e.unref(i).activeOperateKey=w,w===1?e.unref(i).operateValue=0:w===2&&(e.unref(i).operateValue="rangeValue")}}}}),Cg="",Kb={class:"variable-item"},Xb=["title"],Qb={class:"popover-content-wrap"},Jb={style:{display:"flex"}};function Zb(t,o,n,a,l,r){const s=e.resolveComponent("a-input"),c=e.resolveComponent("a-select"),i=e.resolveComponent("a-select-option"),d=e.resolveComponent("a-input-number"),p=e.resolveComponent("a-tab-pane"),u=e.resolveComponent("a-tabs"),m=e.resolveComponent("appstore-add-outlined"),C=e.resolveComponent("a-popover"),g=e.resolveComponent("close-outlined");return e.openBlock(),e.createElementBlock("div",Kb,[t.variableData.randomKey?(e.openBlock(),e.createElementBlock("div",{key:0,class:"var-indicator",title:t.label},e.toDisplayString(t.label),9,Xb)):e.createCommentVNode("",!0),e.createVNode(s,{class:"field-name",value:t.variableData.variableName,"onUpdate:value":o[0]||(o[0]=b=>t.variableData.variableName=b),placeholder:"请输入变量名",disabled:!!t.variableData.randomKey},null,8,["value","disabled"]),e.createVNode(c,{class:"field-name",value:t.variableData.variableType,"onUpdate:value":o[1]||(o[1]=b=>t.variableData.variableType=b),options:t.typeOption,disabled:t.variableData.disabled,style:{"max-width":"120px"},placeholder:"请选择变量类型",onChange:t.onChangeVariableType},null,8,["value","options","disabled","onChange"]),e.createVNode(c,{class:"field-name",value:t.variableData.dataType,"onUpdate:value":o[2]||(o[2]=b=>t.variableData.dataType=b),options:t.dataTypeOption,style:{"max-width":"120px"},onChange:t.onChangeDataType},null,8,["value","options","onChange"]),t.variableData.dataType==="component"?(e.openBlock(),e.createBlock(c,{key:1,class:"field-name",value:t.variableData.id,"onUpdate:value":o[3]||(o[3]=b=>t.variableData.id=b),options:t.usedComponentList,fieldNames:{label:"keyName",value:"id"},"show-search":"","filter-option":t.idFilterOption,style:{"max-width":"180px"},placeholder:"请选择组件",onChange:t.onChangeComponent},null,8,["value","options","filter-option","onChange"])):(e.openBlock(),e.createBlock(s,{key:2,class:"field-name",style:{"max-width":"180px"},value:t.variableData.variableValue,"onUpdate:value":o[4]||(o[4]=b=>t.variableData.variableValue=b),placeholder:"请输入变量值"},null,8,["value"])),t.isDateRangeComponent?(e.openBlock(),e.createBlock(c,{key:3,class:"field-name",value:t.variableData.dateTypeValue,"onUpdate:value":o[5]||(o[5]=b=>t.variableData.dateTypeValue=b),options:t.rangeTypeOptions,placeholder:"请选择取值类型"},null,8,["value","options"])):e.createCommentVNode("",!0),e.createVNode(c,{class:"field-name",value:t.variableData.format,"onUpdate:value":o[6]||(o[6]=b=>t.variableData.format=b),options:t.formatOptions,placeholder:"请选择值格式"},null,8,["value","options"]),t.isShowDateOperate?(e.openBlock(),e.createBlock(C,{key:4,visible:t.popoverVisible,"onUpdate:visible":o[14]||(o[14]=b=>t.popoverVisible=b),trigger:"click",placement:"bottomRight"},{content:e.withCtx(()=>[e.createElementVNode("div",Qb,[e.createVNode(u,{defaultActiveKey:t.variableData.activeOperateKey,onChange:t.changeTab},{default:e.withCtx(()=>[(e.openBlock(),e.createBlock(p,{tab:"日期偏移",key:1},{default:e.withCtx(()=>[e.createVNode(d,{class:"field-name",min:"0",value:t.variableData.operateValue,"onUpdate:value":o[9]||(o[9]=b=>t.variableData.operateValue=b),style:{"max-width":"180px",flex:"auto"}},{addonBefore:e.withCtx(()=>[e.createVNode(c,{value:t.variableData.operateType,"onUpdate:value":o[7]||(o[7]=b=>t.variableData.operateType=b),style:{width:"60px"}},{default:e.withCtx(()=>[e.createVNode(i,{value:"add"},{default:e.withCtx(()=>[e.createTextVNode("加")]),_:1}),e.createVNode(i,{value:"minus"},{default:e.withCtx(()=>[e.createTextVNode("减")]),_:1})]),_:1},8,["value"])]),addonAfter:e.withCtx(()=>[e.createVNode(c,{value:t.variableData.operateMode,"onUpdate:value":o[8]||(o[8]=b=>t.variableData.operateMode=b),style:{width:"60px"}},{default:e.withCtx(()=>[e.createVNode(i,{value:"year"},{default:e.withCtx(()=>[e.createTextVNode("年")]),_:1}),e.createVNode(i,{value:"month"},{default:e.withCtx(()=>[e.createTextVNode("月")]),_:1}),e.createVNode(i,{value:"week"},{default:e.withCtx(()=>[e.createTextVNode("周")]),_:1}),e.createVNode(i,{value:"day"},{default:e.withCtx(()=>[e.createTextVNode("日")]),_:1}),e.createVNode(i,{value:"hour"},{default:e.withCtx(()=>[e.createTextVNode("时")]),_:1}),e.createVNode(i,{value:"minute"},{default:e.withCtx(()=>[e.createTextVNode("分")]),_:1})]),_:1},8,["value"])]),_:1},8,["value"])]),_:1})),t.isDateRangeComponent?(e.openBlock(),e.createBlock(p,{tab:"自定义",key:2},{default:e.withCtx(()=>[e.createElementVNode("div",Jb,[e.createVNode(c,{value:t.variableData.operateValue,"onUpdate:value":o[10]||(o[10]=b=>t.variableData.operateValue=b),allowClear:"",style:{width:"120px","margin-right":"10px"}},{default:e.withCtx(()=>[e.createVNode(i,{value:"rangeValue"},{default:e.withCtx(()=>[e.createTextVNode("范围差值")]),_:1})]),_:1},8,["value"]),e.createVNode(c,{value:t.variableData.operateMode,"onUpdate:value":o[11]||(o[11]=b=>t.variableData.operateMode=b),style:{"margin-right":"10px"}},{default:e.withCtx(()=>[e.createVNode(i,{value:"year"},{default:e.withCtx(()=>[e.createTextVNode("年")]),_:1}),e.createVNode(i,{value:"month"},{default:e.withCtx(()=>[e.createTextVNode("月")]),_:1}),e.createVNode(i,{value:"week"},{default:e.withCtx(()=>[e.createTextVNode("周")]),_:1}),e.createVNode(i,{value:"day"},{default:e.withCtx(()=>[e.createTextVNode("日")]),_:1}),e.createVNode(i,{value:"hour"},{default:e.withCtx(()=>[e.createTextVNode("时")]),_:1}),e.createVNode(i,{value:"minute"},{default:e.withCtx(()=>[e.createTextVNode("分")]),_:1})]),_:1},8,["value"]),e.createVNode(c,{value:t.variableData.operateType,"onUpdate:value":o[12]||(o[12]=b=>t.variableData.operateType=b)},{default:e.withCtx(()=>[e.createVNode(i,{value:"minus"},{default:e.withCtx(()=>[e.createTextVNode("前")]),_:1}),e.createVNode(i,{value:"add"},{default:e.withCtx(()=>[e.createTextVNode("后")]),_:1})]),_:1},8,["value"])])]),_:1})):e.createCommentVNode("",!0)]),_:1},8,["defaultActiveKey","onChange"])])]),default:e.withCtx(()=>[e.createElementVNode("div",{class:"calendar-wrap",onClick:o[13]||(o[13]=b=>{t.popoverVisible=!0})},[e.createVNode(m)])]),_:1},8,["visible"])):e.createCommentVNode("",!0),t.variableData.randomKey?e.createCommentVNode("",!0):(e.openBlock(),e.createBlock(g,{key:5,class:"delete-icon",onClick:t.onDelete},null,8,["onClick"]))])}const ey=ae(qb,[["render",Zb],["__scopeId","data-v-0d77395a"]]),ty=e.defineComponent({name:"VariableGroup",components:{VariableItem:ey},setup(){const t=e.inject(ge),o=e.inject(Ae),n=e.inject(ze),a=e.computed(()=>{var d;return((d=e.unref(t))==null?void 0:d.variableList)||[]}),l=i=>{o({...e.unref(t),variableConditions:ro(i,n),variableList:i})};return{variableList:a,onAddVariable:()=>{const i=ee.cloneDeep(e.unref(a));i.push({keyValue:ye(),variableType:"TEXT",dataType:"",id:null,dateTypeValue:null,format:null,operateType:"add",operateMode:"year",operateValue:0,activeOperateKey:1}),l(i)},onUpdateItem:(i,d)=>{if(d>=0){const p=ee.cloneDeep(e.unref(a));p[d]=i,l(p)}},onDeleteItem:i=>{if(i>=0){const d=ee.cloneDeep(e.unref(a));d.splice(i,1),l(d)}}}}}),wg="",oy={class:"variable-group"},ny={class:"variable-group-header"},ay={class:"variable-group-content"};function ly(t,o,n,a,l,r){const s=e.resolveComponent("a-button"),c=e.resolveComponent("variable-item");return e.openBlock(),e.createElementBlock(e.Fragment,null,[e.createElementVNode("div",oy,[e.createElementVNode("div",ny,[e.createVNode(s,{onClick:t.onAddVariable},{default:e.withCtx(()=>[e.createTextVNode("添加变量")]),_:1},8,["onClick"])])]),e.createElementVNode("div",ay,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(t.variableList,(i,d)=>(e.openBlock(),e.createBlock(c,{key:i.keyValue,item:i,index:d,label:i.label,onUpdate:t.onUpdateItem,onDelete:t.onDeleteItem},null,8,["item","index","label","onUpdate","onDelete"]))),128))])],64)}const ry=ae(ty,[["render",ly],["__scopeId","data-v-fd60cd09"]]),Yr=(t={})=>{const o=(r={})=>{const{label:s,name:c,location:i,show:d,indexCode:p,typeGuid:u}=r;return{label:s,columnName:c,location:i,show:d,calcType:"COLUMN",hrpIndexCode:p,typeGuid:u}},n=r=>{Ye(r,"dataType")&&(r.fieldType==="DATE"&&(r.label=r.fieldName,r.dataType==="component"&&(r.fieldValue="${"+r.fieldValue+"}")),delete r.dataType),Ye(r,"activeKey")&&delete r.activeKey,Ye(r,"radioValue")&&delete r.radioValue},a=r=>{const s=[];return r!=null&&r.length&&r.forEach(c=>{if(c.join&&c.conditions){const i=!c.conditions.some(d=>d.join&&d.conditions);c.conditions.forEach((d,p)=>{n(d),i?p<c.conditions.length-1?s.push({join:c.join,...d}):s.push(d):d.join&&d.conditions?s.push({conditions:a([d]),join:c.join}):s.push(d)})}else n(c),s.push(c)}),s},l=(r={})=>{const{label:s,name:c,location:i,show:d,indexCode:p,calcType:u="COLUMN",builtInFormula:m,builtInValueSource:C,builtInCalcWay:g,formula:b,conditions:f,aggregate:h}=r;let y;return f&&(y=a(f)),{label:s.trim(),columnName:c,location:i,show:d,calcType:u,hrpIndexCode:p,aggregate:h,builtInFormula:m,builtInValueSource:C,builtInCalcWay:g,formula:b,conditions:y}};return async()=>{const{graphicConfig:r,type:s,request:c,isGroupTable:i}=t;let{source:d,dataViewId:p,plugin:u="1",layer:m,chartType:C,classificationList:g=[],seriesList:b=[],leftAxisList:f=[],rightAxisList:h=[],queryColumnList:y=[],indicators:N=[],dataSourceId:w,idxLibMode:x,preview:S=!1,sqlConditions:A=[],rowHeaderList:v=[]}=r||{};m==null&&(ue(s,["table","card"])?m="1":m="2");let D;if(Array.isArray(g)&&g.length>0){const _=g.length;for(let B=0;B<_;B++){const E=g[B]||{},{label:P="",name:I="",show:O=!1,sort:V,customGroup:k,conditions:L,typeGuid:M}=E;if(O||_===1){D={label:P.trim(),columnName:I,show:O,sort:V,customGroup:k,typeGuid:M,conditions:a(L)};break}}}let T;if(Array.isArray(b)&&b.length>0){const _=b.length;for(let B=0;B<_;B++){const E=b[B]||{},{label:P="",name:I="",show:O=!1,sort:V,customGroup:k,conditions:L,typeGuid:M}=E;if(O||_===1){T={label:P.trim(),columnName:I,show:O,sort:V,customGroup:k,conditions:a(L),typeGuid:M};break}}}const R=[];if(Array.isArray(v)&&v.length>0){const _=v.length;for(let B=0;B<_;B++){const E=v[B]||{},{label:P="",name:I="",show:O=!1,sort:V,customGroup:k,conditions:L,typeGuid:M}=E;R.push({typeGuid:M,label:P.trim(),columnName:I,show:O,sort:V,customGroup:k,conditions:a(L)})}}const $=[];y==null||y.forEach(_=>{$.push(o(_))});const F=[];if(f==null||f.forEach(_=>{_.location="LEFT",F.push(l(_))}),h==null||h.forEach(_=>{_.location="RIGHT",F.push(l(_))}),N==null||N.forEach(_=>{_.location="LEFT",F.push(l(_))}),i||s==="card"){if(C="grouptable",F.length===0||R.length===0)return}else{if(m==="1"&&$.length===0)return;if(m==="2"&&F.length===0)return}try{return await c.post(`${Se}/diagram`,{source:d,dataViewId:p,plugin:u,layer:m,chartType:C,classification:D,series:T,indicatorList:F,queryColumns:$,pageFlag:!0,sqlConditions:A,rowHeaders:R,dataSourceId:w,idxLibMode:x,preview:S})}catch(_){console.error(_)}}},iy=e.defineComponent({name:"ChartGraph",components:{ASpin:j.Spin},props:{graphicConfig:{type:Object,default:()=>{}},chartsOptions:{type:Object,default:()=>{}}},setup(t,{expose:o}){const n=e.computed(()=>t.chartsOptions?e.unref(t.chartsOptions):i),a=e.computed(()=>t.graphicConfig?e.unref(t.graphicConfig):c),l=e.inject(Be);let r=null;const s=e.inject(Ve)||"",c=e.inject(ge)||{},i=e.inject(wo)||{},d=e.ref(null),p=e.ref(null),u=e.ref(),m=e.ref(!1),C=e.ref(!1),g=e.computed(()=>C.value?ni:12),b=e.ref({}),f=e.ref(),h=e.computed(()=>{const D=e.unref(n.value);return(D==null?void 0:D.type)==="customGraph"?f.value:ed(D,e.unref(b),g.value)}),y=(D=[],T,R=!1)=>{const $=R?T:null;b.value=Yc(D,$)},N=(D=[],T)=>{b.value=qc(D,T)},w=async()=>{var D,T,R;try{const $=Yr({graphicConfig:e.unref(a.value),type:(D=e.unref(n.value))==null?void 0:D.type,request:l,indicatorToken:s});m.value=!0;const F=await $(),{columns:_=[],rows:B=[]}=((T=F==null?void 0:F.data)==null?void 0:T.data)??{};if(((R=e.unref(n.value))==null?void 0:R.type)==="pie"){let E=[];if(_.length>0){const P=_[0],I=_[1];E=B.map(O=>({name:O[P],value:O[I]}))}N(E)}else{let E;_.length>0&&(E={name:_[0],types:_.slice(1).map(P=>({label:P,value:P}))}),y(B,E,!0)}}catch($){console.error($)}finally{m.value=!1}},x={title:{text:"暂无数据",x:"center",y:"center",textStyle:{fontSize:14,fontWeight:"normal"}}},S=()=>{e.unref(b).dataset.length===0?u.value.setOption(x,!0):u.value.setOption(h.value,!0)},A=()=>{e.unref(n.value).type!=="customGraph"&&w()},v=()=>{var D;(D=u.value)==null||D.resize()};return e.watch(h,()=>{S()},{deep:!0}),e.watch(()=>e.unref(n.value).optionCode,D=>{try{const T=eval;f.value=T(D)}catch(T){console.error(T)}},{immediate:!0}),e.onMounted(()=>{p.value&&(r=new ResizeObserver(v),r.observe(p.value)),u.value=oi.init(d.value)}),e.onBeforeUnmount(()=>{u.value.dispose(),r&&(r.disconnect(),r=null)}),o({refreshData:A}),{echartRef:d,loading:m}}}),kg="",sy={class:"ecan-chart-graph",ref:"chartWrapRef"},cy={style:{width:"100%",height:"100%"},ref:"echartRef"};function dy(t,o,n,a,l,r){const s=e.resolveComponent("a-spin");return e.openBlock(),e.createElementBlock("div",sy,[e.createVNode(s,{spinning:t.loading,wrapperClassName:"chart-spin",tip:"数据加载中..."},{default:e.withCtx(()=>[e.createElementVNode("div",cy,null,512)]),_:1},8,["spinning"])],512)}const qr=ae(iy,[["render",dy],["__scopeId","data-v-845f7ab1"]]),py=e.defineComponent({name:"TableGraph",components:{ATable:j.Table},props:{graphicConfig:{type:Object,default:()=>{}},type:{type:String},pagination:{type:Object,default:()=>({})}},setup(t){const o=e.inject(ve),n=e.ref([]),a=e.ref([]),l=e.inject(Be),r=e.inject(Ve)||"",s=async()=>{var c;try{const d=await Yr({graphicConfig:t.graphicConfig,type:t.type,request:l,indicatorToken:r})(),{columns:p=[],rows:u=[]}=((c=d==null?void 0:d.data)==null?void 0:c.data)??{},m=e.unref(o).columnsConfigMap;a.value=p.map(C=>({title:C,dataIndex:C,label:C,...m[C]})),n.value=u}catch(i){console.error(i)}};return e.watch([()=>t.graphicConfig,()=>e.unref(o).columnsConfigMap],()=>{s()},{deep:!0,immediate:!0}),{tableData:n,tableColumns:a,handleFormat:nd,columnsConfigMap:e.unref(o).columnsConfigMap}}}),uy={key:0};function fy(t,o,n,a,l,r){const s=e.resolveComponent("a-table");return e.openBlock(),e.createBlock(s,{style:{width:"100%"},scroll:{y:280},columns:t.tableColumns,"data-source":t.tableData,size:"small",pagination:t.pagination},{bodyCell:e.withCtx(({column:c,record:i})=>[c.retentiondigit!==void 0?(e.openBlock(),e.createElementBlock("span",uy,e.toDisplayString(t.handleFormat(i,c)),1)):e.createCommentVNode("",!0)]),_:1},8,["columns","data-source","pagination"])}const my=ae(py,[["render",fy]]),hy=e.defineComponent({name:"DataConfig",components:{DataGroup:gf,StyleGroup:Sb,ChartGraph:qr,ATabs:j.Tabs,ATabPane:j.TabPane,ControlGroup:Yb,VariableGroup:ry,AButton:j.Button,ReloadOutlined:cc,TableGraph:my},setup(t,{expose:o}){var P;const n=e.ref(),a=e.ref("1"),l=e.ref([0,1,2]),r=e.ref(),s=e.ref(),c=e.inject(ve),i=e.inject(ua),d=e.inject(ge),p=e.inject(ze),u=e.inject(ga),m=e.inject(Qo),C=e.inject(Ca),g=["text","proportion","select","checkbox","radio","radar","circulate"],b=e.computed(()=>{const I=ee.cloneDeep(e.unref(c));h(I);const O=ee.pick(I,ee.without(Object.keys(I),"position","top","left","width","height"));ue(I.type,g)?(O.height=I.height,O.width=I.width):O.height="290px";const V=ee.cloneDeep(e.unref(d));return V.pageMode="design",V.componentList=p,V.preview=!0,V.pageConfig=u,ue(I.type,"pivottable")&&(e.unref(n)&&(O.height=e.unref(n).$el.clientHeight-20+"px",O.width=e.unref(n).$el.clientWidth+"px"),O.fullMode=!0,V.preview=!1,delete V.pageMode),{...O,graphicConfig:V,toolboxShow:!1,sourceLeft:I.left,sourceTop:I.top}}),f=e.computed(()=>{var L,M;const{token:I,context:O}=e.unref(c),V=(((L=e.unref(s))==null?void 0:L.clientWidth)||0)+"px",k=(((M=e.unref(s))==null?void 0:M.clientHeight)||0)+"px";return{id:e.unref(c).componentId,name:e.unref(c).name,keyName:e.unref(c).keyName,type:"pivotTable",width:V,height:k,graphicConfig:e.unref(c).graphicConfig,dimensionList:e.unref(c).dimensionList||[],fullMode:!0,globalModel:new Map,indicatorUrl:"/api",indicatorToken:I,context:O}});function h(I){var O,V,k,L;["#ffffff","#fff"].includes((O=I==null?void 0:I.color)==null?void 0:O.toLowerCase())&&(I.color="#000"),["#ffffff","#fff"].includes((V=I==null?void 0:I.variableColor)==null?void 0:V.toLowerCase())&&(I.variableColor="#000"),["#ffffff","#fff"].includes((k=I==null?void 0:I.increaseColor)==null?void 0:k.toLowerCase())&&(I.increaseColor="#000"),["#ffffff","#fff"].includes((L=I==null?void 0:I.declineColor)==null?void 0:L.toLowerCase())&&(I.declineColor="#000")}const y=e.computed(()=>{let I=!0;return ue(e.unref(b).type,g)&&(I=!1),I}),N=e.computed(()=>{var I;return(I=e.unref(b))==null?void 0:I.type}),w=e.computed(()=>{var I;return!!((I=e.unref(b))!=null&&I.isGroupTable)}),x=I=>{const O=I==="1";O&&N.value==="table"&&$(),window.changeShowTable&&window.changeShowTable(O),I==="3"&&T()},S=e.ref([]),A=e.inject(Be),v=e.unref(e.inject(Ve)),D=(P=window==null?void 0:window.config)==null?void 0:P.pageId;function T(){var z;const{leftAxisList:I=[],rightAxisList:O=[],queryColumnList:V=[],indicators:k=[],dataSourceId:L=""}=e.unref(d),M=[...I,...O,...V,...k],U={};for(const q of M){const{id:X="",indexCode:J=""}=q;X&&!Ye(q,"calcType")&&!U[X]&&(U[X]=J)}if((z=Object.keys(U))!=null&&z.length){const q=[];for(const X in U)q.push(new Promise((J,oe)=>{A.post(`${Se}/diagram/hrpIndexWithComplex`,{pageId:D,indexGuid:X,indexCode:U[X],dataSourceId:L},{headers:{Authentication:v,operateContext:"ygt"}}).then(le=>{var we;const{success:Ce,data:ie=[]}=le.data;Ce&&((we=ie==null?void 0:ie.dataViewColumns)!=null&&we.length)?J(ie.dataViewColumns):oe(ie)}).catch(le=>{oe(le)})}));Promise.all(q).then(X=>{if(X!=null&&X.length){const J=X.reduce((oe,le)=>oe.filter(Ce=>le.find(ie=>ie.typeGuid===Ce.typeGuid)));R(J.filter(oe=>oe.typeGuid))}})}}function R(I){var Ce;const{classificationList:O=[],seriesList:V=[],leftAxisList:k=[],rightAxisList:L=[],indicators:M=[],rowHeaderList:U=[],queryColumnList:z=[]}=e.unref(d),q=ee.cloneDeep([...O,...V,...k,...L,...M,...U,...z]);if(q!=null&&q.length)for(const ie of q)ie.id=ie.name;const X=[{label:"日期",name:"日期",id:"the_date",genericType:"DATE",typeGuid:"the_date",indexCode:null},{label:"HRP单位编号",name:"HRP单位编号",id:"hbdwbh",genericType:"TEXT",typeGuid:"hbdwbh",indexCode:null},{label:"HRP单位名称",name:"HRP单位名称",id:"hbdwbh_name",genericType:"TEXT",typeGuid:"hbdwbh_name",indexCode:null},...I.map(ie=>({...ie,id:ie.name,label:ie.title||ie.label})),...q];if(((Ce=e.unref(c))==null?void 0:Ce.type)==="ecanSelect"){const{selectFieldOptions:ie=[]}=e.unref(d);if(X.unshift({label:"上级编码",name:"上级编码",id:"parentCode",genericType:"TEXT"}),ie!=null&&ie.length)for(const we of ie)X.unshift({label:we.label,name:we.value,id:we.value,genericType:"TEXT"})}const J=new Map,oe=X.length;for(let ie=0;ie<oe;ie++){const we=X[ie],{id:at}=we||{};J.set(at,we)}const le=[...J];S.value=le.map(([ie,we])=>we)}const $=()=>{var O;let I;i&&N.value==="table"?I=window.updateConfig:I=(O=e.unref(r))==null?void 0:O.refreshData,typeof I=="function"&&I()},F=e.inject(Ae),_=()=>{var I;F({variableConditions:ro(((I=e.unref(d))==null?void 0:I.variableList)||[],p)})};e.provide(fa,$),e.watch(d,()=>{$()},{deep:!0,flush:"post"}),e.onMounted(()=>{m.value&&$()});const B=()=>e.unref(r).getSaveData(),E=({type:I,data:O})=>{if(I==="10"){const{dimensions:V,indicators:k}=ee.cloneDeep(O),L=[];if(V){for(const M of V)M.showTitle&&(M.label=M.showTitle),L.push({key:M.name,label:M.showTitle,width:null,position:M.positionType||"rows"});for(const M of k)M.showTitle&&(M.label=M.showTitle)}F({dimensionList:L,queryColumnList:V,indicators:k}),b.value.dimensionList=L}};return o({getSaveData:B}),{isShowStyleConfig:i,activeKey:a,activePanel:l,componentRef:r,pivotTableWrapRef:s,type:N,isGroupTable:w,isPivotTable:m,isIframeMode:C,component:b,fullWidth:y,renderUsedComponents:p,conditionOptions:S,tableProps:f,dataConfigPaneRef:n,refreshData:$,refreshAction:_,onChange:x,onPivotTableChange:E}}}),xg="",by={key:0,class:"ecan-pivot-table",ref:"pivotTableWrapRef"},yy={key:0,id:"table-wrap",class:"chart-component",ref:"tableWrapRef",style:{width:"100%",height:"290px"}};function gy(t,o,n,a,l,r){const s=e.resolveComponent("pivot-table"),c=e.resolveComponent("data-group"),i=e.resolveComponent("a-tab-pane"),d=e.resolveComponent("style-group"),p=e.resolveComponent("control-group"),u=e.resolveComponent("variable-group"),m=e.resolveComponent("reload-outlined"),C=e.resolveComponent("a-button"),g=e.resolveComponent("a-tabs"),b=e.resolveComponent("table-graph"),f=e.resolveComponent("chart-graph");return e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(["data-config",t.isPivotTable?"pivot-table-wrap":""])},[e.createVNode(g,{activeKey:t.activeKey,"onUpdate:activeKey":o[0]||(o[0]=h=>t.activeKey=h),onChange:t.onChange},{rightExtra:e.withCtx(()=>[e.createVNode(C,{onClick:t.refreshAction},{icon:e.withCtx(()=>[e.createVNode(m)]),default:e.withCtx(()=>[e.createTextVNode(" 刷新 ")]),_:1},8,["onClick"])]),default:e.withCtx(()=>[e.createVNode(i,{key:"1",tab:"数据配置",ref:"dataConfigPaneRef"},{default:e.withCtx(()=>[t.isPivotTable&&t.isIframeMode?(e.openBlock(),e.createElementBlock("div",by,[e.createVNode(s,e.mergeProps({ref:"componentRef"},t.tableProps),null,16)],512)):(e.openBlock(),e.createElementBlock(e.Fragment,{key:1},[t.isPivotTable?e.createCommentVNode("",!0):(e.openBlock(),e.createBlock(c,{key:0,ref:"dataGroupRef"},null,512)),t.isShowStyleConfig?e.createCommentVNode("",!0):(e.openBlock(),e.createBlock(e.resolveDynamicComponent(t.type),e.mergeProps({key:1,class:["chart-component",t.fullWidth?"full-width":""]},t.component,{ref:"componentRef",onTableChange:t.onPivotTableChange}),null,16,["class","onTableChange"]))],64))]),_:1},512),t.isShowStyleConfig?(e.openBlock(),e.createBlock(i,{key:"2",tab:"样式配置","force-render":""},{default:e.withCtx(()=>[e.createVNode(d,{componentType:t.type,isGroupTable:t.isGroupTable},null,8,["componentType","isGroupTable"])]),_:1})):e.createCommentVNode("",!0),(!t.isIframeMode||t.isPivotTable)&&t.renderUsedComponents?(e.openBlock(),e.createBlock(i,{key:"3",tab:"全局过滤","force-render":""},{default:e.withCtx(()=>[e.createVNode(p,{ref:"controlGroup",conditionOptions:t.conditionOptions},null,8,["conditionOptions"])]),_:1})):e.createCommentVNode("",!0),t.isIframeMode?e.createCommentVNode("",!0):(e.openBlock(),e.createBlock(i,{key:"4",tab:"全局变量","force-render":""},{default:e.withCtx(()=>[e.createVNode(u)]),_:1}))]),_:1},8,["activeKey","onChange"]),t.isShowStyleConfig&&!t.isPivotTable?(e.openBlock(),e.createElementBlock(e.Fragment,{key:0},[t.type==="table"&&t.activeKey==="1"?(e.openBlock(),e.createElementBlock("div",yy,null,512)):t.type==="card"?e.withDirectives((e.openBlock(),e.createBlock(b,e.mergeProps({key:1,class:"chart-component"},t.component),null,16)),[[e.vShow,t.activeKey==="1"]]):e.withDirectives((e.openBlock(),e.createBlock(f,{key:2,class:e.normalizeClass(["chart-component",t.fullWidth?"full-width":""]),ref:"componentRef",style:{width:"100%",height:"290px"}},null,8,["class"])),[[e.vShow,t.activeKey==="1"]])],64)):e.createCommentVNode("",!0)],2)}const Cy=ae(hy,[["render",gy],["__scopeId","data-v-6e6b2139"]]),wy=e.defineComponent({name:"IndicatorLibrary",components:{DataList:Dd,DataConfig:Cy},props:{isShowStyleConfig:{type:Boolean,default:!1},sourceType:{type:String,default:""},indicatorToken:{type:String,default:""},selectedComponent:{type:Object,default:()=>{}},request:{default:null},renderUsedComponentList:{type:Array,default:()=>[]},mapAttributeProps:{type:Object,default:()=>({startTime:{label:"开始时间值",component:"time-pick"},endTime:{label:"结束时间值",component:"time-pick"}})},pageConfig:{type:Object,default:()=>{}},isIframeMode:{type:Boolean,default:!1}},setup(t,{expose:o,emit:n}){const a=e.ref(),l=e.ref(!1),r=e.computed(()=>t.sourceType),s=e.computed(()=>t.indicatorToken||""),c=e.computed(()=>t.selectedComponent),i=e.computed(()=>t.renderUsedComponentList),d=e.computed(()=>{var T;return((T=e.unref(c))==null?void 0:T.tableColumns)||[]}),p=e.computed(()=>t.isShowStyleConfig),u=e.computed(()=>{var T,R;return(R=(T=e.unref(c))==null?void 0:T.type)==null?void 0:R.includes("PivotTable")});let m=e.unref(c).graphicConfig?ee.cloneDeep(e.unref(c).graphicConfig):e.ref({});m=e.ref(m);let C=e.unref(c).chartsOptions?ee.cloneDeep(e.unref(c).chartsOptions):e.ref(ee.cloneDeep(Jo.line));C=e.ref(C);let g=e.unref(c).tableOptions?ee.cloneDeep(e.unref(c).tableOptions):e.ref(ee.cloneDeep(ai));g=e.ref(g);const b=e.ref([]),f=T=>{b.value=T},h=T=>{m.value={...e.unref(m),...e.unref(T)}},y=(T,R=!0)=>{R?C.value={...e.unref(C),...e.unref(T)}:C.value={...e.unref(T)}},N=T=>{g.value={...e.unref(g),...e.unref(T)}},w=()=>b,x=()=>{l.value=!0,e.unref(c).graphicConfig&&(m.value=ee.cloneDeep(e.unref(c).graphicConfig)),e.unref(c).chartsOptions&&(C.value=ee.cloneDeep(e.unref(c).chartsOptions||Jo.line)),e.nextTick(()=>{l.value=!1})},S=()=>({graphicConfig:e.unref(m),chartsOptions:e.unref(C),tableOptions:e.unref(g),tableColumns:e.unref(d),columnsConfigMap:e.unref(c).columnsConfigMap}),A=()=>({...e.unref(a).getSaveData(),graphicConfig:e.unref(m)});window.getIndicatorData=S,window.getPivotGraphicData=A,t.request&&e.provide(Be,t.request),e.provide(pa,{setDataList:f,getDataList:w});const v=T=>{n("updateUsedComponent",T)},D=(T,R)=>{n("updateComponentsConfig",T,{controlList:R})};return e.provide(Qo,u),e.provide(Ca,t.isIframeMode),e.provide(ve,c),e.provide(ge,m),e.provide(wo,C),e.provide(ma,g),e.provide(Kt,r),e.provide(ua,p),e.provide(Ve,s),e.provide(Ae,h),e.provide(Ko,y),e.provide(Xo,N),e.provide(ze,i),e.provide(xo,v),e.provide(ba,D),e.provide(ya,t.mapAttributeProps),e.provide(ga,t.pageConfig),o({graphicConfig:m,chartsOptions:C,updateIndicatorData:x}),{isUpdate:l,isPivotTable:u,dataConfigRef:a}}}),_g="",ky={key:0,class:"config-modal"},xy={key:0,class:"config-modal-left"};function _y(t,o,n,a,l,r){const s=e.resolveComponent("data-list"),c=e.resolveComponent("data-config");return t.isUpdate?e.createCommentVNode("",!0):(e.openBlock(),e.createElementBlock("div",ky,[t.isPivotTable?e.createCommentVNode("",!0):(e.openBlock(),e.createElementBlock("div",xy,[e.createVNode(s)])),e.createElementVNode("div",{class:e.normalizeClass(["config-modal-right",t.isPivotTable?"full":""])},[e.createVNode(c,{ref:"dataConfigRef"},null,512)],2)]))}const Kr=da(ae(wy,[["render",_y],["__scopeId","data-v-e77110fb"]])),Xr=da(qr),Qr=Object.freeze(Object.defineProperty({__proto__:null,EcanChartGraph:Xr,EcanIndicatorLibrary:Kr},Symbol.toStringTag,{value:"Module"})),Sy={install:(t,o)=>{const{request:n}=o;t.provide("$request",n),Object.keys(Qr).forEach(a=>{const l=Qr[a];l.install&&t.use(l)})}};he.EcanChartGraph=Xr,he.EcanIndicatorLibrary=Kr,he.default=Sy,Object.defineProperties(he,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}})});
|
|
74
|
+
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}()}function Fr(t,o){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(t);o&&(a=a.filter(function(l){return Object.getOwnPropertyDescriptor(t,l).enumerable})),n.push.apply(n,a)}return n}function Re(t){for(var o=1;o<arguments.length;o++){var n=arguments[o]!=null?arguments[o]:{};o%2?Fr(Object(n),!0).forEach(function(a){aa(t,a,n[a])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):Fr(Object(n)).forEach(function(a){Object.defineProperty(t,a,Object.getOwnPropertyDescriptor(n,a))})}return t}nt(".input[data-v-d52a4d02]{display:inline-block;font-size:12px}.label[data-v-d52a4d02]{align-items:center;background:#e7e8e9;color:#999;display:flex;float:left;font-weight:500;height:30px;justify-content:center;width:45px}[pick-colors-theme=dark] .label[data-v-d52a4d02]{background:#252930;color:#999}.value[data-v-d52a4d02]{background:#eceef0;border:1px solid #eceef0;box-sizing:border-box;color:#666;flex:1;height:30px;text-align:center}[pick-colors-theme=dark] .value[data-v-d52a4d02]{background:#2e333a;border:1px solid #2e333a;color:#fff}.value[data-v-d52a4d02]:focus{border:1px solid #1890ff;outline:none}"),Ro.render=function(t,o,n,a,l,r){return e.openBlock(),e.createElementBlock("div",Ym,[e.createElementVNode("span",qm,e.toDisplayString(t.label),1),e.createElementVNode("input",{class:"value",style:e.normalizeStyle(t.valueStyle),".value":t.value,onFocus:o[0]||(o[0]=function(){return t.onFocus&&t.onFocus.apply(t,arguments)}),onInput:o[1]||(o[1]=function(){return t.onInput&&t.onInput.apply(t,arguments)}),onBlur:o[2]||(o[2]=function(){return t.onBlur&&t.onBlur.apply(t,arguments)}),onKeydown:o[3]||(o[3]=e.withKeys(function(){return t.onEnter&&t.onEnter.apply(t,arguments)},["enter"]))},null,44,Km)])},Ro.__scopeId="data-v-d52a4d02",Ro.__file="src/picker/InputValue.vue";var $r=function(t,o,n){return[t,o*n/((t=(2-o)*n)<1?t:2-t)||0,t/2]},Ir={10:"A",11:"B",12:"C",13:"D",14:"E",15:"F"},Uo=function(t){t=Math.min(Math.round(t),255);var o=Math.floor(t/16),n=t%16;return"".concat(Ir[o]||o).concat(Ir[n]||n)},vr=function(t){var o=t.r,n=t.g,a=t.b;return isNaN(o)||isNaN(n)||isNaN(a)?"":"#".concat(Uo(o)).concat(Uo(n)).concat(Uo(a))},zt=function(t,o){var n;typeof(n=t)=="string"&&n.indexOf(".")!==-1&&parseFloat(n)===1&&(t="100%");var a=function(l){return typeof l=="string"&&l.indexOf("%")!==-1}(t);return t=Math.min(o,Math.max(0,parseFloat("".concat(t)))),a&&(t=parseInt("".concat(t*o),10)/100),Math.abs(t-o)<1e-6?1:t%o/parseFloat(o)},bo=function(t,o,n){t=6*zt(t,360),o=zt(o,100),n=zt(n,100);var a=Math.floor(t),l=t-a,r=n*(1-o),s=n*(1-l*o),c=n*(1-(1-l)*o),i=a%6,d=[n,s,r,r,c,n][i],p=[c,n,n,s,r,r][i],u=[r,r,c,n,n,s][i];return{r:Math.round(255*d),g:Math.round(255*p),b:Math.round(255*u)}},Dr=function(t,o,n){var a=t.h,l=t.s,r=t.v,s=t.a;if(n)switch(o){case"hsl":var c=$r(a,l/100,r/100);return"hsla(".concat(a.toFixed(0),", ").concat(Math.round(100*c[1]),"%, ").concat(Math.round(100*c[2]),"%, ").concat(s,")");case"hsv":return"hsva(".concat(a.toFixed(0),", ").concat(Math.round(l),"%, ").concat(Math.round(r),"%, ").concat(s,")");case"rgb":var i=bo(a,l,r),d=i.r,p=i.g,u=i.b;return"rgba(".concat(d,", ").concat(p,", ").concat(u,", ").concat(s,")");default:return"".concat(vr(bo(a,l,r))).concat(Uo(255*s))}else switch(o){case"hsl":var m=$r(a,l/100,r/100);return"hsl(".concat(a.toFixed(0),", ").concat(Math.round(100*m[1]),"%, ").concat(Math.round(100*m[2]),"%)");case"hsv":return"hsv(".concat(a.toFixed(0),", ").concat(Math.round(l),"%, ").concat(Math.round(r),"%)");case"rgb":var C=bo(a,l,r),g=C.r,b=C.g,f=C.b;return"rgb(".concat(g,", ").concat(b,", ").concat(f,")");default:return vr(bo(a,l,r))}},zo=function(t){var o=t.r,n=t.g,a=t.b;o=zt(o,255),n=zt(n,255),a=zt(a,255);var l,r=Math.max(o,n,a),s=Math.min(o,n,a),c=r,i=r-s,d=r===0?0:i/r;if(r===s)l=0;else{switch(r){case o:l=(n-a)/i+(n<a?6:0);break;case n:l=(a-o)/i+2;break;case a:l=(o-n)/i+4}l/=6}return{h:360*l,s:100*d,v:100*c}},Mr=function(t){var o=t.h,n=t.s,a=t.l;a/=100;var l=n/=100,r=Math.max(a,.01);return n*=(a*=2)<=1?a:2-a,l*=r<=1?r:2-r,{h:+o,s:100*(a===0?2*l/(r+l):2*n/(a+n)),v:100*((a+n)/2)}},Pr=function(t){var o=[];if(t.match(/^#([0-9a-fA-f]{3,4})$/g))for(var n=1;n<t.length;n++)o.push(parseInt("0x"+t[n].repeat(2)));else if(t.match(/^#([0-9a-fA-f]{6}|[0-9a-fA-f]{8})$/g))for(var a=1;a<t.length;a+=2)o.push(parseInt("0x"+t.slice(a,a+2)));return{r:o[0],g:o[1],b:o[2],a:o[3]}},la=function(t,o,n){if(typeof t=="string"&&t!==""){var a=ra(t,ia(t),n),l=zr(a);return Dr(l,o,n)}return""},jr=function(t){var o=ho(t.match(/(\d(\.\d+)?)+/g),4);return{r:o[0],g:o[1],b:o[2],a:o[3]}},Rr=function(t){var o=ho(t.match(/(\d(\.\d+)?)+/g),4),n=o[0],a=o[1],l=o[2],r=o[3];return{h:n,s:parseFloat(a),l:parseFloat(l),a:r}},Ur=function(t){var o=ho(t.match(/(\d(\.\d+)?)+/g),4),n=o[0],a=o[1],l=o[2],r=o[3];return{h:parseFloat(n),s:parseFloat(a),v:parseFloat(l),a:parseFloat(r)}},ra=function(t,o){if(!(arguments.length>2&&arguments[2]!==void 0)||arguments[2])switch(o){case"rgb":var n=jr(t),a=n.r,l=n.g,r=n.b,s=n.a;return Re(Re({},zo({r:a,g:l,b:r})),{},{a:+s});case"hsv":var c=Ur(t);return{h:c.h,s:c.s,v:c.v,a:c.a};case"hsl":var i=Rr(t),d=i.h,p=i.s,u=i.l,m=i.a;return Re(Re({},Mr({h:d,s:p,l:u})),{},{a:+m});default:var C=Pr(t),g=C.r,b=C.g,f=C.b,h=C.a;return Re(Re({},zo({r:g,g:b,b:f})),{},{a:h/255})}else switch(o){case"rgb":return Re(Re({},zo(jr(t))),{},{a:1});case"hsv":var y=Ur(t);return{h:y.h,s:y.s,v:y.v,a:1};case"hsl":return Re(Re({},Mr(Rr(t))),{},{a:1});default:return Re(Re({},zo(Pr(t))),{},{a:1})}},ia=function(t){return t.match(/^#/)?"hex":t.match(/^rgb/)?"rgb":t.match(/^hsl/)?"hsl":t.match(/^hsv/)?"hsv":"hex"},zr=function(t){var o=t.h,n=t.s,a=t.v,l=t.a;return isNaN(o)&&(o=0),isNaN(n)&&(n=0),isNaN(a)&&(a=0),isNaN(l)&&(l=1),{h:o,s:n,v:a,a:l}},yo=e.defineComponent({name:"ColorItem",props:{size:{type:[Number,String],default:20},width:{type:[Number,String]},height:{type:[Number,String]},value:{type:String,default:""},border:{type:Boolean,default:!0},borderRadius:{type:Number,default:5},selected:{type:Boolean,default:!1},draggable:{type:Boolean,default:!1}},emits:["select"],setup:function(t){var o=e.ref(),n=e.inject("theme",{theme:"light"}).theme,a=e.computed(function(){return parseFloat((t.width||t.size)+"")}),l=e.computed(function(){return parseFloat((t.height||t.size)+"")}),r=e.computed(function(){return{width:"".concat(e.unref(a),"px"),height:"".concat(e.unref(l),"px"),border:t.border?"1px solid ".concat(e.unref(n)==="dark"?"#434345":"#d9d9d9"):"",borderRadius:"".concat(t.borderRadius,"px"),boxShadow:t.selected?"0 0 3px 2px ".concat(e.unref(n)==="dark"?"#2681ff":"#1890ff"):""}}),s=function(){var c=o.value.getContext("2d");o.value.width=e.unref(a),o.value.height=e.unref(l);var i=function(d){var p=document.createElement("canvas"),u=p.getContext("2d"),m=2*d;return p.width=m,p.height=m,u.fillStyle="#ffffff",u.fillRect(0,0,m,m),u.fillStyle="#ccd5db",u.fillRect(0,0,d,d),u.fillRect(d,d,d,d),p}(5);c.fillStyle=c.createPattern(i,"repeat"),c.fillRect(0,0,e.unref(a),e.unref(l)),c.fillStyle=t.value,c.fillRect(0,0,e.unref(a),e.unref(l))};return e.watch(function(){return t.value},function(){s()}),e.onMounted(function(){s()}),{canvas:o,colorItemStyle:r}}}),Xm=["draggable"];nt(".color-item[data-v-02da71fd]{display:inline-block;vertical-align:top}"),yo.render=function(t,o,n,a,l,r){return e.openBlock(),e.createElementBlock("canvas",{class:"color-item",style:e.normalizeStyle(t.colorItemStyle),ref:"canvas",draggable:t.draggable},null,12,Xm)},yo.__scopeId="data-v-02da71fd",yo.__file="src/color-item/ColorItem.vue";var Go=e.defineComponent({name:"Colors",components:{ColorItem:yo},props:{colors:{type:Array,default:function(){return[]}},selectedIndex:{type:Number,default:-1}},emits:["change"],setup:function(t,o){var n=o.emit;return{onSelectColor:function(a,l){n("change",a,l)},useColors:e.computed(function(){return t.colors.map(function(a){return la(a,"hex",!0)})})}}}),Qm={class:"colors"};function Gr(t,o){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(t);o&&(a=a.filter(function(l){return Object.getOwnPropertyDescriptor(t,l).enumerable})),n.push.apply(n,a)}return n}function Xe(t){for(var o=1;o<arguments.length;o++){var n=arguments[o]!=null?arguments[o]:{};o%2?Gr(Object(n),!0).forEach(function(a){aa(t,a,n[a])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):Gr(Object(n)).forEach(function(a){Object.defineProperty(t,a,Object.getOwnPropertyDescriptor(n,a))})}return t}nt(".colors[data-v-0f8b52a8]{align-items:center;display:flex;flex-wrap:wrap;margin-top:5px}.color-item[data-v-0f8b52a8]{margin:5px}"),Go.render=function(t,o,n,a,l,r){var s=e.resolveComponent("color-item");return e.openBlock(),e.createElementBlock("div",Qm,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(t.useColors,function(c,i){return e.openBlock(),e.createBlock(s,{key:i,class:"color-item",size:16,value:c,border:!1,"border-radius":3,selected:t.selectedIndex===i,onClick:e.withModifiers(function(d){return t.onSelectColor(c,+i)},["stop","prevent"])},null,8,["value","selected","onClick"])}),128))])},Go.__scopeId="data-v-0f8b52a8",Go.__file="src/picker/Colors.vue";var Ho=e.defineComponent({name:"Picker",components:{Colors:Go,Saturation:Mo,Hue:Po,Alpha:jo,InputValue:Ro},props:{format:{type:String,default:"hex"},showAlpha:{type:Boolean,default:!1},value:{type:String,default:""},colors:{type:Array,default:function(){return[]}},style:{type:Object,default:function(){return{}}}},emits:["change","update:value"],setup:function(t,o){var n=o.emit,a=e.computed(function(){return Xe(Xe({},t.style),{},{width:t.showAlpha?"230px":"205px"})}),l=e.computed(function(){return t.showAlpha?165:140}),r=e.ref(),s=e.ref(),c=e.ref(),i=function(){var y,N=(y=t.value)===null||y===void 0?void 0:y.trim();if(N!=null&&N!==""){var w=ia(N);return zr(ra(N,w,t.showAlpha))}return null};e.watch(function(){return t.value},function(){t.value!==e.unref(c)&&(r.value=i())},{immediate:!0}),e.watch(r,function(y,N){var w="";y!=null?(w=Dr(Xe({},y),t.format,t.showAlpha),s.value=Xe({},y)):s.value=null,c.value=w;var x=i();JSON.stringify(y)!==JSON.stringify(x)&&JSON.stringify(y)!==JSON.stringify(N)&&n("change",w)},{immediate:!0});var d=e.computed(function(){var y;return((y=e.unref(r))===null||y===void 0?void 0:y.h)||0}),p=e.computed(function(){var y;return((y=e.unref(r))===null||y===void 0?void 0:y.s)||0}),u=e.computed(function(){var y;return((y=e.unref(r))===null||y===void 0?void 0:y.v)||0}),m=e.computed(function(){var y,N;return((y=e.unref(r))===null||y===void 0?void 0:y.a)!=null?(N=e.unref(r))===null||N===void 0?void 0:N.a:1}),C=e.computed(function(){return bo(e.unref(d),e.unref(p),e.unref(u))}),g=e.computed(function(){return"rgb(".concat(e.unref(C).r,", ").concat(e.unref(C).g,", ").concat(e.unref(C).b,")")}),b=e.computed(function(){var y=t.format;if(t.showAlpha)switch(y){case"hsv":return"HSVA";case"hsl":return"HSLA";case"rgb":return"RGBA";default:return"HEX"}else switch(y){case"hsv":return"HSV";case"hsl":return"HSL";case"rgb":return"RGB";default:return"HEX"}}),f=e.ref(-1),h=function(y,N,w){if(y.length!==0){var x=ra(y,N,w),S=x.h,A=x.s,v=x.v;if(!(isNaN(S)||isNaN(A)||isNaN(v))){var D=1,T=x.a;isNaN(T)||(D=T),r.value={h:S,s:A,v,a:D}}}};return{h:d,s:p,v:u,a:m,rgbStr:g,onSelectSaturation:function(y,N){f.value=-1,e.unref(r)==null?r.value={h:e.unref(d),s:y,v:N,a:e.unref(m)}:r.value=Xe(Xe({},e.unref(r)),{},{s:y,v:N})},onSelectHue:function(y){f.value=-1,e.unref(r)==null&&(r.value={h:y,s:e.unref(p),v:e.unref(u),a:e.unref(m)}),r.value=Xe(Xe({},e.unref(r)),{},{h:y})},onSelectAlpha:function(y){f.value=-1,e.unref(r)==null?r.value={h:e.unref(d),s:e.unref(p),v:e.unref(u),a:y}:r.value=Xe(Xe({},e.unref(r)),{},{a:y})},label:b,colorValue:c,pickerStyle:a,inputWidth:l,onInputChange:function(y){f.value=-1,c.value=y},handleChange:function(){var y,N=(y=e.unref(c))===null||y===void 0?void 0:y.trim();if(N!==""){var w=t.showAlpha,x=t.format,S=function(A,v,D){if(D)switch(v){case"rgb":return/^[rR][gG][Bb][Aa][(]([\s]*(2[0-4][0-9]|25[0-5]|[01]?[0-9][0-9]?)[\s]*,){3}[\s]*(1|1.0|0|0.[0-9]|0.[0-9][0-9])[\s]*[)]{1}$/.test(A);case"hsv":return/^[hH][Ss][Vv][Aa][(]([\s]*(2[0-9][0-9]|360|3[0-5][0-9]|[01]?[0-9][0-9]?)[\s]*,)([\s]*((100|[0-9][0-9]?)%|0)[\s]*,){2}([\s]*(1|1.0|0|0.[0-9]|0.[0-9][0-9])[\s]*)[)]$/.test(A);case"hsl":return/^[hH][Ss][Ll][Aa][(]([\s]*(2[0-9][0-9]|360|3[0-5][0-9]|[01]?[0-9][0-9]?)[\s]*,)([\s]*((100|[0-9][0-9]?)%|0)[\s]*,){2}([\s]*(1|1.0|0|0.[0-9]|0.[0-9][0-9])[\s]*)[)]$/.test(A);default:return/^#([0-9a-fA-f]{4}|[0-9a-fA-F]{8})$/g.test(A)}else switch(v){case"rgb":return/^[rR][gG][Bb][(]([\s]*(2[0-4][0-9]|25[0-5]|[01]?[0-9][0-9]?)[\s]*,){2}[\s]*(2[0-4]\d|25[0-5]|[01]?\d\d?)[\s]*[)]{1}$/.test(A);case"hsv":return/^[hH][Ss][Vv][(]([\s]*(2[0-9][0-9]|360|3[0-5][0-9]|[01]?[0-9][0-9]?)[\s]*,)([\s]*((100|[0-9][0-9]?)%|0)[\s]*,)([\s]*((100|[0-9][0-9]?)%|0)[\s]*)[)]$/.test(A);case"hsl":return/^[hH][Ss][Ll][(]([\s]*(2[0-9][0-9]|360|3[0-5][0-9]|[01]?[0-9][0-9]?)[\s]*,)([\s]*((100|[0-9][0-9]?)%|0)[\s]*,)([\s]*((100|[0-9][0-9]?)%|0)[\s]*)[)]$/.test(A);default:return/^#([0-9a-fA-f]{3}|[0-9a-fA-F]{6})$/g.test(A)}}(N,x,w);S?h(N,x,w):e.unref(s)!=null?r.value=e.unref(s):c.value=""}else r.value=null},selectColorIndex:f,onSelectColor:function(y,N){if(f.value=N,(y=y.trim())==="")r.value=null;else{var w=ia(y);w?h(y,w,!0):r.value=null}}}}}),Jm={class:"picker-inner"},Zm={class:"picker-header"};nt(".picker[data-v-6ceadec6]{background:#f7f8f9;border-radius:4px;box-shadow:0 0 16px 0 rgba(0,0,0,.16)}.picker-inner[data-v-6ceadec6]{padding:10px}[pick-colors-theme=dark] .picker-inner[data-v-6ceadec6]{background:#1d2024;box-shadow:0 0 16px 0 rgba(0,0,0,.16)}.picker-header[data-v-6ceadec6]{display:flex;margin-bottom:5px}.alpha[data-v-6ceadec6],.hue[data-v-6ceadec6]{margin-left:10px}.colors[data-v-6ceadec6]{margin-top:5px}"),Ho.render=function(t,o,n,a,l,r){var s=e.resolveComponent("saturation"),c=e.resolveComponent("hue"),i=e.resolveComponent("alpha"),d=e.resolveComponent("input-value"),p=e.resolveComponent("Colors");return e.openBlock(),e.createElementBlock("div",{class:"picker",style:e.normalizeStyle(t.pickerStyle)},[e.createElementVNode("div",Jm,[e.createElementVNode("div",Zm,[e.createVNode(s,{class:"saturation",hue:t.h,saturation:t.s,value:t.v,onChange:t.onSelectSaturation},null,8,["hue","saturation","value","onChange"]),e.createVNode(c,{class:"hue",hue:t.h,onChange:t.onSelectHue},null,8,["hue","onChange"]),t.showAlpha?(e.openBlock(),e.createBlock(i,{key:0,class:"alpha",alpha:t.a,color:t.rgbStr,onChange:t.onSelectAlpha},null,8,["alpha","color","onChange"])):e.createCommentVNode("v-if",!0)]),e.createVNode(d,{label:t.label,value:t.colorValue,width:t.inputWidth,onChange:t.onInputChange,onBlur:t.handleChange,onEnter:t.handleChange},null,8,["label","value","width","onChange","onBlur","onEnter"]),t.colors.length>0?(e.openBlock(),e.createBlock(p,{key:0,class:"colors",colors:t.colors,"selected-index":t.selectColorIndex,onChange:t.onSelectColor},null,8,["colors","selected-index","onChange"])):e.createCommentVNode("v-if",!0)])],4)},Ho.__scopeId="data-v-6ceadec6",Ho.__file="src/picker/Picker.vue";var Wo=e.defineComponent({name:"AddColorItem",props:{size:{type:Number,default:20},selected:{type:Boolean,default:!1}},setup:function(t){var o=e.inject("theme",{theme:"light"}).theme;return{addColorItemStyle:e.computed(function(){return{width:"".concat(t.size,"px"),height:"".concat(t.size,"px"),lineHeight:"".concat(t.size,"px"),boxShadow:t.selected?"0 0 3px 2px ".concat(e.unref(o)==="dark"?"#2681ff":"#1890ff"):""}})}}}),eh=[function(t){return e.pushScopeId("data-v-ceb1719c"),t=t(),e.popScopeId(),t}(function(){return e.createElementVNode("g",{class:"container"},[e.createElementVNode("path",{d:"M544 464V160h-80v304H160v80h304v304h80V544h304v-80z"})],-1)})];function Hr(t,o){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(t);o&&(a=a.filter(function(l){return Object.getOwnPropertyDescriptor(t,l).enumerable})),n.push.apply(n,a)}return n}function sa(t){for(var o=1;o<arguments.length;o++){var n=arguments[o]!=null?arguments[o]:{};o%2?Hr(Object(n),!0).forEach(function(a){aa(t,a,n[a])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):Hr(Object(n)).forEach(function(a){Object.defineProperty(t,a,Object.getOwnPropertyDescriptor(n,a))})}return t}nt(".add-color-item[data-v-ceb1719c]{background:#fff;border:1px solid #d9d9d9;border-radius:5px;vertical-align:top}.container[data-v-ceb1719c]{pointer-events:none;transform:scale(.9);transform-origin:center}[pick-colors-theme=dark] .add-color-item[data-v-ceb1719c]{background:#141414;border:1px solid #434343}path[data-v-ceb1719c]{fill:#000}[pick-colors-theme=dark] path[data-v-ceb1719c]{fill:#fff}"),Wo.render=function(t,o,n,a,l,r){return e.openBlock(),e.createElementBlock("svg",{style:e.normalizeStyle(t.addColorItemStyle),class:"add-color-item",viewBox:"0 0 1024 1024",xmlns:"http://www.w3.org/2000/svg"},[].concat(eh),4)},Wo.__scopeId="data-v-ceb1719c",Wo.__file="src/add-color-item/AddColorItem.vue";var _t=null,St=e.defineComponent({name:"ColorPicker",components:{ColorItem:yo,Picker:Ho,AddColorItem:Wo},props:{value:{type:[String,Array]},theme:{type:String,default:"light"},size:{type:[Number,String],default:20},width:{type:[Number,String]},height:{type:[Number,String]},format:{type:String,default:"hex"},showPicker:{type:Boolean,default:void 0},showAlpha:{type:Boolean,default:!1},addColor:{type:Boolean,default:!1},deleteColor:{type:Boolean,default:!0},max:{type:Number,default:13},popupContainer:{type:[String,Object,Boolean]},zIndex:{type:Number,default:1e3},colors:{type:Array,default:function(){return["#ff4500","#ff8c00","#ffd700","#90ee90","#00ced1","#1e90ff","#c71585","#ff4500","#ff7d4d","#00babd","#1f93ff","#fa64c3"]}}},emits:["change","update:value","update:showPicker","overflowMax","closePicker"],setup:function(t,o){var n=o.emit,a=e.ref([]),l=e.computed(function(){return e.unref(a).map(function(_){return la(_,"hex",t.showAlpha)})});e.watch(function(){return t.value},function(){var _=t.value||"",B=Array.isArray(_)?_:[_];a.value=B.map(function(E){return la(E,t.format,t.showAlpha)})},{immediate:!0});var r=e.ref(void 0),s=e.computed(function(){return e.unref(a)[e.unref(r)]}),c=e.ref(!1);e.watch(function(){return t.showPicker},function(){c.value=t.showPicker},{immediate:!0});var i,d,p,u,m,C,g,b=e.ref(null),f=e.ref(null),h=(i=b,d=f,p={zIndex:t.zIndex},u=e.ref({}),m={strategy:"absolute",placement:"auto",onFirstUpdate:function(){_t.update()},modifiers:[{name:"offset",options:{offset:[0,5]}},{name:"computeStyles",options:{gpuAcceleration:!1,adaptive:!0}},{name:"flip",options:{fallbackPlacements:["top"],allowedAutoPlacements:["top","bottom"]}},{name:"applyStyles",enabled:!1},{name:"updateState",enabled:!0,phase:"write",requires:["computeStyles"],fn:function(_){var B=_.state,E=B.styles,P=B.placement,I=E.popper;u.value=sa(sa(sa({},I),p),{},{transformOrigin:P==="top"?"center bottom":""})}}]},e.watch(function(){return[e.unref(i),e.unref(d)]},function(_,B){var E,P=ho(_,2),I=P[0],O=P[1],V=ho(B,2),k=V[0],L=V[1];if(I&&O&&(k!==I||L!==k)){(E=_t)===null||E===void 0||E.destroy();var M=I.$el||I,U=O.$el||O;e.nextTick(function(){_t=jm(M,U,m)})}}),e.onBeforeUnmount(function(){var _;_t&&((_=_t)===null||_===void 0||_.destroy(),_t=null)}),{instance:_t,style:u}),y=h.style,N=function(){e.unref(b)==null&&(b.value=e.unref(F)[0],r.value=0),t.showPicker===void 0?c.value=!0:n("update:showPicker",!0)},w=function(){r.value=void 0,t.showPicker===void 0?c.value=!1:n("update:showPicker",!1),n("closePicker",e.toRaw(Array.isArray(t.value)||t.addColor?e.unref(a):e.unref(a)[0]))},x=e.ref(),S=function(){var _=Or(Do.mark(function B(E){var P,I,O,V;return Do.wrap(function(k){for(;;)switch(k.prev=k.next){case 0:if(I=E.target,(O=(P=I.dataset)===null||P===void 0?void 0:P.index)!=null&&O!==""){k.next=4;break}return k.abrupt("return");case 4:if(V=+O,e.unref(r)!==V){k.next=7;break}return k.abrupt("return");case 7:e.unref(r)!=null&&e.unref(r)!==V?(w(),C&&clearTimeout(C),C=setTimeout(function(){N(),clearTimeout(C)},100)):N(),r.value=V,b.value=I;case 10:case"end":return k.stop()}},B)}));return function(B){return _.apply(this,arguments)}}(),A=function(){var _=Or(Do.mark(function B(E){var P,I,O,V,k;return Do.wrap(function(L){for(;;)switch(L.prev=L.next){case 0:if(V=E.target,!(!((P=e.unref(x))!==null&&P!==void 0&&P.isEqualNode(V))&&(!((I=e.unref(x))===null||I===void 0)&&I.contains(V)))){L.next=4;break}return L.abrupt("return");case 4:if(k=(O=e.unref(f))===null||O===void 0?void 0:O.$el,!(k!=null&&k.contains(V))){L.next=8;break}return L.abrupt("return");case 8:g&&clearTimeout(g),g=setTimeout(function(){e.unref(c)&&w()},0);case 10:case"end":return L.stop()}},B)}));return function(B){return _.apply(this,arguments)}}();e.watch(c,function(){e.unref(c)&&(N(),clearTimeout(g))});var v,D=e.ref(t.max>e.unref(a).length),T=e.computed(function(){return typeof t.popupContainer=="string"||Ut(t.popupContainer)==="object"&&t.popupContainer!=null?t.popupContainer:"body"}),R=e.computed(function(){return typeof t.popupContainer=="boolean"&&t.popupContainer===!1}),$=e.computed(function(){return t.theme});e.watch(function(){return[t.theme,e.unref(f)]},function(){e.nextTick(function(){var _,B;(_=e.unref(x))===null||_===void 0||_.setAttribute("pick-colors-theme",e.unref($)),(B=e.unref(f))===null||B===void 0||(B=B.$el)===null||B===void 0||B.setAttribute("pick-colors-theme",e.unref($))})},{immediate:!0}),e.provide("theme",{theme:$});var F=e.ref([]);return e.onMounted(function(){document.addEventListener("mouseup",A,!1),t.showPicker&&N()}),e.onUnmounted(function(){document.removeEventListener("mouseup",A,!1),C&&(clearTimeout(C),C=null),g&&(clearTimeout(g),g=null)}),{valueList:a,colorItemSelected:function(_){return(t.addColor?e.unref(a).length>0:e.unref(a).length>1)&&e.unref(r)===_},selectedColor:s,selectedIndex:r,isShowPicker:c,addColorItemShow:D,onPickerChange:function(_){var B=e.unref(r),E=e.unref(a).slice(),P=e.unref(a).length;if(B!=null){B>=0?E[B]=_:(r.value=P,E.push(_));var I="";I=Array.isArray(t.value)||t.addColor?E:_,t.value===void 0?a.value=Array.isArray(I)?I:[I]:(n("update:value",I),n("change",I,_,B)),t.addColor&&P>=t.max&&(D.value=!1,n("overflowMax"))}},colorPicker:x,onColorClick:S,pickerRef:f,onColorItemDragStart:function(_){_.dataTransfer.effectAllowed="move";var B=_.target;v=+B.dataset.index},onColorItemDragOver:function(_){},onColorItemDrop:function(_){var B=+_.target.dataset.index,E=Rm(e.unref(a)),P=E[v];E.splice(v,1);var I=E.slice(0,B),O=E.splice(B),V=I.concat([P]).concat(O);n("update:value",V),n("change",V,V[v],v)},colorItemsRef:F,pickerStyle:y,values:l,teleportDisabled:R,toPopupContainer:T}}});nt(".color-picker[data-v-3c43ade8]{display:inline-block}.color-item[data-v-3c43ade8]{margin:5px}.add-color-item[data-v-3c43ade8]{display:inline-block;margin:5px}.picker[data-v-3c43ade8]{overflow:hidden}.v-enter-active[data-v-3c43ade8],.v-leave-active[data-v-3c43ade8]{opacity:1;transform:scaleY(1);transform-origin:center top;transition:opacity .2s ease-in-out,transform .2s ease-in-out}.v-enter-from[data-v-3c43ade8],.v-leave-to[data-v-3c43ade8]{opacity:0;transform:scaleY(0)}"),St.render=function(t,o,n,a,l,r){var s=e.resolveComponent("color-item"),c=e.resolveComponent("add-color-item"),i=e.resolveComponent("picker");return e.openBlock(),e.createElementBlock("div",{class:"color-picker",ref:"colorPicker",onDragstart:o[0]||(o[0]=e.withModifiers(function(){return t.onColorItemDragStart&&t.onColorItemDragStart.apply(t,arguments)},["stop"])),onDragover:o[1]||(o[1]=e.withModifiers(function(){return t.onColorItemDragOver&&t.onColorItemDragOver.apply(t,arguments)},["prevent","stop"])),onDrop:o[2]||(o[2]=e.withModifiers(function(){return t.onColorItemDrop&&t.onColorItemDrop.apply(t,arguments)},["prevent","stop"])),onClick:o[3]||(o[3]=e.withModifiers(function(){return t.onColorClick&&t.onColorClick.apply(t,arguments)},["stop"]))},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(t.values,function(d,p){return e.openBlock(),e.createBlock(s,{class:"color-item",key:p,ref_for:!0,ref:function(u){return t.colorItemsRef[p]=u},size:t.size,width:t.width,height:t.height,value:d,selected:t.colorItemSelected(p),"data-index":p,draggable:t.valueList.length>1,format:t.format},null,8,["size","width","height","value","selected","data-index","draggable","format"])}),128)),t.addColor&&t.addColorItemShow?(e.openBlock(),e.createBlock(c,{key:0,class:"add-color-item",ref:"addColorItem",selected:t.colorItemSelected(-1),"data-index":-1},null,8,["selected"])):e.createCommentVNode("v-if",!0),(e.openBlock(),e.createBlock(e.Teleport,{to:t.toPopupContainer,disabled:t.teleportDisabled},[e.createVNode(e.Transition,null,{default:e.withCtx(function(){return[t.isShowPicker?(e.openBlock(),e.createBlock(i,{key:0,class:"picker",style:e.normalizeStyle(t.pickerStyle),ref:"pickerRef",value:t.selectedColor,format:t.format,"show-alpha":t.showAlpha,colors:t.colors,onChange:t.onPickerChange},null,8,["style","value","format","show-alpha","colors","onChange"])):e.createCommentVNode("v-if",!0)]}),_:1})],8,["to","disabled"]))],544)},St.__scopeId="data-v-3c43ade8",St.__file="src/ColorPicker.vue";const th=e.defineComponent({name:"ColorPick",components:{PickColors:St,AInput:j.Input},props:{value:{type:String,require:!0}},emits:["change"],setup(t,o){const n=e.computed({get:()=>t.value,set:l=>{o.emit("change",l)}});return{colorValue:n,onChangColor:l=>{n.value=l.hex}}}}),ng="",oh={class:"color-pick"};function nh(t,o,n,a,l,r){const s=e.resolveComponent("a-input"),c=e.resolveComponent("pick-colors");return e.openBlock(),e.createElementBlock("div",oh,[e.createVNode(s,{class:"input",value:t.colorValue,"onUpdate:value":o[0]||(o[0]=i=>t.colorValue=i)},null,8,["value"]),e.createVNode(c,{class:"pick-colors",value:t.colorValue,"onUpdate:value":o[1]||(o[1]=i=>t.colorValue=i),size:25,showAlpha:!0},null,8,["value"])])}const ah=ae(th,[["render",nh],["__scopeId","data-v-2ee2749b"]]),lh=e.defineComponent({name:"ColorGroupPick",components:{PickColors:St},props:{value:{type:Array,default:()=>[]}},emits:["change"],setup(t,{emit:o}){const n=r=>{o("change",r)},a=e.ref(13);return{onColorsChange:n,max:a,onOverflowMax:()=>{j.message.warn(`已经超出最大添加个数:${a.value}`)}}}}),ag="",rh={class:"color-group-pick"};function ih(t,o,n,a,l,r){const s=e.resolveComponent("pick-colors");return e.openBlock(),e.createElementBlock("div",rh,[e.createVNode(s,{value:t.value,"add-color":"",max:t.max,onChange:t.onColorsChange,onOverflowMax:t.onOverflowMax},null,8,["value","max","onChange","onOverflowMax"])])}const sh=ae(lh,[["render",ih],["__scopeId","data-v-b2be8322"]]),ch=e.defineComponent({name:"FormGroup",components:{Draggable:Et,AppstoreAddOutlined:un,MinusCircleOutlined:Ys,PickColors:St,InputNumber:sr,PlusCircleOutlined:Qs},props:{value:{type:Array,default:()=>[]},format:{type:Array,default:()=>[]},useLabelIndex:{type:Boolean,default:!1},max:{type:Number,default:-1}},emits:["change"],setup(t,{emit:o}){const n=e.computed({get:()=>t.value,set:d=>{o("change",d)}});return{myValue:n,onAdd:()=>{var u;const d=(u=t.value)==null?void 0:u.slice();if(!Array.isArray(d))return;const p=d.length;if(t.max===-1||t.max>p){const m=d[0];if(Object.prototype.toString.call(m)==="[object Object]"){const C=Object.keys(m),g={};C.forEach(b=>{g[b]=""}),d.push(g)}else typeof m=="string"&&d.push(m);n.value=d}else j.message.warn("已达到最大上限")},useComponentType:d=>({input:"aInput",select:"aSelect",color:"pickColors","input-number":"inputNumber",switch:"aSwitch"})[d],onValueChange:(d,p,u)=>{var C;const m=(C=t.value)==null?void 0:C.slice();if(Array.isArray(m)){const g=d==null?void 0:d.target,b=(g==null?void 0:g.value)!=null?g==null?void 0:g.value:d;u?m[p][u]=b:m[p]=b,n.value=m}},onDelete:d=>{var u;const p=(u=t.value)==null?void 0:u.slice();if(Array.isArray(p)){if(p.length===1){j.message.warn("已经是最后一条数据,无法删除");return}p.splice(d,1),n.value=p}},theme:"light",formatTypeValue:d=>d||"value"}}}),lg="",dh={class:"form-group"},ph={class:"form-row"},uh={key:0,class:"label"},fh={key:1,class:"label"},mh={class:"icon-group"};function hh(t,o,n,a,l,r){const s=e.resolveComponent("appstore-add-outlined"),c=e.resolveComponent("draggable"),i=e.resolveComponent("minus-circle-outlined");return e.openBlock(),e.createElementBlock("div",dh,[e.createVNode(s,{class:"icon add",onClick:t.onAdd},null,8,["onClick"]),e.createVNode(c,{class:"form",modelValue:t.myValue,"onUpdate:modelValue":o[0]||(o[0]=d=>t.myValue=d),"item-key":"id"},{item:e.withCtx(({element:d,index:p})=>[e.createElementVNode("div",ph,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(t.format,(u,m)=>(e.openBlock(),e.createElementBlock("div",{class:"form-item",key:m},[Array.isArray(u.label)?(e.openBlock(),e.createElementBlock("span",uh,e.toDisplayString(u.useLabelIndex?u.label[p]+(p+1):u.label[p]),1)):(e.openBlock(),e.createElementBlock("span",fh,e.toDisplayString(u.useLabelIndex?u.label+(p+1):u.label),1)),(e.openBlock(),e.createBlock(e.resolveDynamicComponent(t.useComponentType(u.type)),e.mergeProps({class:"value",[t.formatTypeValue(u.typeValue)||""]:typeof d=="string"?d:d[u.value]??u.defaultValue,style:{width:!["color","switch"].includes(u.type)&&t.format.length>1?"110px":""}},u.props,{theme:t.theme,"use-blur-event":!1,onChange:C=>t.onValueChange(C,p,u.value)}),null,16,["style","theme","onChange"]))]))),128))])]),_:1},8,["modelValue"]),e.createElementVNode("div",mh,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(t.myValue,(d,p)=>(e.openBlock(),e.createElementBlock("div",{class:"icon-item",key:p},[e.createVNode(i,{class:"icon delete",onClick:u=>t.onDelete(p)},null,8,["onClick"])]))),128))])])}const bh=ae(ch,[["render",hh],["__scopeId","data-v-f0c0ab4d"]]),yh=e.defineComponent({name:"Textarea",props:{value:{type:String,default:""},disabled:{type:Boolean,default:!1}},components:{ATextarea:j.Textarea},emits:["change"],setup(t,{emit:o}){return{onTextareaChange:a=>{o("change",a.target.value)}}}});function gh(t,o,n,a,l,r){const s=e.resolveComponent("a-textarea");return e.openBlock(),e.createBlock(s,{value:t.value,disabled:t.disabled,autoSize:{minRows:3},onChange:t.onTextareaChange},null,8,["value","disabled","onChange"])}const Ch=ae(yh,[["render",gh]]),wh=e.defineComponent({name:"Slider",components:{ASlider:j.Slider,AInputNumber:j.InputNumber},props:{value:{type:Number,default:1}},emits:["change"],setup(t,{emit:o}){return{onChange:a=>{o("change",a)}}}});function kh(t,o,n,a,l,r){const s=e.resolveComponent("a-slider"),c=e.resolveComponent("a-col"),i=e.resolveComponent("a-input-number"),d=e.resolveComponent("a-row");return e.openBlock(),e.createBlock(d,null,{default:e.withCtx(()=>[e.createVNode(c,{span:16},{default:e.withCtx(()=>[e.createVNode(s,{value:t.value,min:0,max:1,step:.1,onChange:t.onChange},null,8,["value","onChange"])]),_:1}),e.createVNode(c,{span:8,style:{"padding-left":"10px"}},{default:e.withCtx(()=>[e.createVNode(i,{value:t.value,min:0,max:1,step:.1,style:{width:"100%"},onChange:t.onChange},null,8,["value","onChange"])]),_:1})]),_:1})}const xh=ae(wh,[["render",kh]]),_h=e.defineComponent({name:"PropsToForm",components:{Input:_f,InputNumber:sr,RadioGroup:Ef,Select:Vf,Switch:$f,ColorPick:ah,ColorGroupPick:sh,FormGroup:bh,Textarea:Ch,Slider:xh},props:{props:{type:Object,require:!0},disabled:{type:Boolean,default:!1},componentType:{type:String,default:""}},setup(t){const o=e.inject(wo),n=e.inject(ge),a=e.inject(Ko),l=e.inject(Xo),r=e.computed(()=>{var m;return(m=e.unref(o))==null?void 0:m.type}),s=m=>{t.componentType&&t.componentType==="table"?l(m):a(m)},c=m=>{const{result:C,mapAttributeProp:g,key:b,value:f}=m;if(C==null||typeof C!="object")return;const{valueProp:h="value",changeValueEventName:y="change",events:N,effect:w,effectVal:x,props:S}=g;C[b]={...g,valueProp:h,value:f,events:{[y]:(A,v=!0)=>{v?(s({[b]:A}),x&&x(b,A,s,e.unref(n))):s({})},...N},...d(w),props:{...S,...u(S,e.unref(n))}}},i=e.computed(()=>{const m=t.props;return m==null||typeof m!="object"?{}:ee.reduce(m,(C,g,b)=>{const f=wf[b];if(Array.isArray(f)){const h=f.find(y=>{const{onlyType:N,excludeType:w}=y;return N==null&&w==null?!0:N?ue(e.unref(r),N):w?!ue(e.unref(r),w):!1});h&&c({result:C,value:g,key:b,mapAttributeProp:h})}else c({result:C,value:g,key:b,mapAttributeProp:f});return C},{})}),d=m=>{const C={};for(const g in m)C[g]=ee.reduce(m[g].props,(b,f)=>m[g].joinType==="&&"?b&&p(f):b||p(f),!!m[g].default);return C},p=m=>{const C=t.props[m.props];let g;switch(m.rule){case"!==":g=C!==m.value;break;case"includes":g=C.includes(m.value);break;case"action":g=m.value(m,t.props);break;default:g=C===m.value}return g};function u(m={},C){const g={};for(const b in m)typeof m[b]=="function"&&(g[b]=m[b](C));return g}return{formProps:i,lowerCaseIncludes:ue}}}),rg="",Sh={class:"props-to-form"},Th={key:0,class:"prop-item"},Nh={class:"label"},Ah={class:"component-wrapper"};function Eh(t,o,n,a,l,r){return e.openBlock(),e.createElementBlock("div",Sh,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(t.formProps,(s,c)=>(e.openBlock(),e.createElementBlock(e.Fragment,{key:c},[s.hide!==!0?(e.openBlock(),e.createElementBlock("div",Th,[e.createElementVNode("span",Nh,e.toDisplayString(s.label),1),e.createElementVNode("div",Ah,[Array.isArray(s)?(e.openBlock(!0),e.createElementBlock(e.Fragment,{key:0},e.renderList(s,(i,d)=>(e.openBlock(),e.createBlock(e.resolveDynamicComponent(i.component),e.mergeProps({key:d,class:"component",style:i.style,disabled:t.disabled||i.disabled},i.props,e.toHandlers(i.events)),null,16,["style","disabled"]))),128)):e.createCommentVNode("",!0),Array.isArray(s)?e.createCommentVNode("",!0):(e.openBlock(),e.createElementBlock(e.Fragment,{key:1},[s.component?(e.openBlock(),e.createBlock(e.resolveDynamicComponent(s.component),e.mergeProps({key:0,class:"component",[s.valueProp||""]:s.value,style:s.style,disabled:t.disabled||s.disabled},s.props,e.toHandlers(s.events)),null,16,["style","disabled"])):e.createCommentVNode("",!0)],64))])])):e.createCommentVNode("",!0)],64))),128))])}const Oh=ae(_h,[["render",Eh],["__scopeId","data-v-62456472"]]);function Bh(){return new Worker("/assets/editor.worker-02df2e61.js")}function Vh(){return new Worker("/assets/json.worker-867823a6.js")}function Lh(){return new Worker("/assets/ts.worker-7254b425.js")}const Fh=e.defineComponent({name:"Editor",props:{valueData:{type:String,default:""},options:{type:Object,default:()=>({})},language:{type:String,default:"json"},isUseMinimap:{type:Boolean,default:!1},UseSuggestions:{type:Boolean,default:!1},autoFormat:{type:Boolean,default:!1},readonly:{type:Boolean,default:!1}},emits:["change","update:valueData"],setup(t,{emit:o}){window.MonacoEnvironment={getWorker(r,s){return s==="json"?new Vh:s==="typescript"||s==="javascript"?new Lh:new Bh}};const n=e.ref();let a=null;const l={light:"vs",dark:"vs-dark"};return e.onMounted(()=>{a=Zr.editor.create(n.value,{language:t.language,tabSize:2,automaticLayout:!0,scrollBeyondLastLine:!1,theme:l.light,wordWrap:"off",lineDecorationsWidth:3,lineHeight:15,lineNumbersMinChars:3,formatOnPaste:!0,formatOnType:!0,wordBasedSuggestions:!1,quickSuggestions:t.UseSuggestions,snippetSuggestions:"none",suggestOnTriggerCharacters:!1,scrollbar:{verticalScrollbarSize:6,horizontalScrollbarSize:6,alwaysConsumeMouseWheel:!1,arrowSize:0},autoIndent:"advanced",glyphMargin:!1,fontSize:13,contextmenu:!1,minimap:{enabled:t.isUseMinimap},readOnly:t.readonly,...t.options}),a==null||a.setValue(t.valueData),t.autoFormat&&setTimeout(()=>{a==null||a.getAction("editor.action.formatDocument").run()},200),a.onDidChangeModelContent(ee.debounce(()=>{const r=a==null?void 0:a.getValue();o("change",r)},300)),a.onDidBlurEditorText(()=>{const r=a==null?void 0:a.getValue();o("update:valueData",r)})}),e.watch(()=>t.valueData,r=>{if(a){const s=a.getPosition();a.setValue(r),t.autoFormat&&a.getAction("editor.action.formatDocument").run(),s!=null&&a.setPosition(s)}}),e.onUnmounted(()=>{a==null||a.dispose()}),{dom:n}}}),ig="",$h={class:"editor",ref:"dom"};function Ih(t,o,n,a,l,r){return e.openBlock(),e.createElementBlock("div",$h,null,512)}const Wr=ae(Fh,[["render",Ih],["__scopeId","data-v-71e88372"]]),vh=e.defineComponent({name:"Condition",components:{CloseOutlined:Zt,MenuOutlined:Sn,AMenu:j.Menu,AMenuItem:j.MenuItem,AInput:j.Input,ASelect:j.Select,ADropdown:j.Dropdown},props:{data:{type:Object,default:()=>({})},level:{type:Number,default:0},index:{type:Number,default:0},path:{type:String,default:""}},setup(t){const o=[{label:"大于",value:">"},{label:"大于等于",value:">="},{label:"小于",value:"<"},{label:"小于等于",value:"<="},{label:"等于",value:"=="},{label:"不等于",value:"!="}],n=e.ref({rule:"==",value:"",key:""}),{updateCondition:a,deleteCondition:l,addCondition:r}=e.inject(ko,{updateCondition:(d,p,u)=>{},deleteCondition:(d,p)=>{},addCondition:(d,p,u)=>{}});e.watch(n,d=>{a(ee.cloneDeep(d),t.index,t.path)},{deep:!0});const s=()=>{},c=d=>{r(t.path,t.index,d.key==="2"?"||":"&&")},i=()=>{l(t.index,t.path)};return e.onMounted(()=>{var d,p,u;e.unref(n).rule=((d=t.data)==null?void 0:d.rule)||"",e.unref(n).value=((p=t.data)==null?void 0:p.value)||"",e.unref(n).key=((u=t.data)==null?void 0:u.key)||ye()}),{ruleOptions:o,condition:n,onRuleChange:s,clickConditionMenu:c,onDelete:i}}}),sg="",Dh={class:"condition"};function Mh(t,o,n,a,l,r){const s=e.resolveComponent("a-select"),c=e.resolveComponent("a-input"),i=e.resolveComponent("menu-outlined"),d=e.resolveComponent("a-menu-item"),p=e.resolveComponent("a-menu"),u=e.resolveComponent("a-dropdown"),m=e.resolveComponent("close-outlined");return e.openBlock(),e.createElementBlock("div",Dh,[e.createVNode(s,{class:"field-name",value:t.condition.rule,"onUpdate:value":o[0]||(o[0]=C=>t.condition.rule=C),options:t.ruleOptions,onChange:t.onRuleChange},null,8,["value","options","onChange"]),e.createVNode(c,{class:"field-value",value:t.condition.value,"onUpdate:value":o[1]||(o[1]=C=>t.condition.value=C),placeholder:"请输入值"},null,8,["value"]),e.createVNode(u,{trigger:["click"]},{overlay:e.withCtx(()=>[e.createVNode(p,{onClick:t.clickConditionMenu},{default:e.withCtx(()=>[e.createVNode(d,{key:"1"},{default:e.withCtx(()=>[e.createTextVNode("添加且条件")]),_:1}),e.createVNode(d,{key:"2"},{default:e.withCtx(()=>[e.createTextVNode("添加或条件")]),_:1})]),_:1},8,["onClick"])]),default:e.withCtx(()=>[e.createVNode(i,{class:"more-icon"})]),_:1}),e.createVNode(m,{class:"delete-icon",onClick:t.onDelete},null,8,["onClick"])])}const Ph=ae(vh,[["render",Mh],["__scopeId","data-v-9fcdf54d"]]),jh=e.defineComponent({name:"ConditionList",props:{list:{type:Array,default:()=>[]},level:{type:Number,default:0},path:{type:String,default:""}},components:{Condition:Ph}}),cg="",Rh={key:0,class:"condition-list"},Uh={key:0,class:"condition-container"},zh={key:0,class:"condition-text"},Gh={key:1,class:"condition-text"},Hh={class:"conditions"};function Wh(t,o,n,a,l,r){const s=e.resolveComponent("condition-list",!0),c=e.resolveComponent("condition");return Array.isArray(t.list)?(e.openBlock(),e.createElementBlock("div",Rh,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(t.list,(i,d)=>(e.openBlock(),e.createElementBlock(e.Fragment,{key:d},[i.join&&i.conditions&&Array.isArray(i.conditions)?(e.openBlock(),e.createElementBlock("div",Uh,[i.conditions.length>1?(e.openBlock(),e.createElementBlock(e.Fragment,{key:0},[i.join==="||"?(e.openBlock(),e.createElementBlock("div",zh,"或")):e.createCommentVNode("",!0),i.join==="&&"?(e.openBlock(),e.createElementBlock("div",Gh,"且")):e.createCommentVNode("",!0)],64)):e.createCommentVNode("",!0),e.createElementVNode("div",Hh,[i.conditions.length>0?(e.openBlock(),e.createBlock(s,{key:0,level:t.level+1,path:`${t.path?t.path+"-":""}${d}`,list:i.conditions},null,8,["level","path","list"])):e.createCommentVNode("",!0)])])):(e.openBlock(),e.createBlock(c,{class:"condition",key:i.key||`${t.level}-${d}`,data:i,level:t.level,index:d,path:t.path||""},null,8,["data","level","index","path"]))],64))),128))])):e.createCommentVNode("",!0)}const Yh=ae(jh,[["render",Wh],["__scopeId","data-v-49c6481f"]]),qh=e.defineComponent({components:{ConditionList:Yh,PickColors:St,AButton:j.Button,AModal:j.Modal,ASelect:j.Select},props:{data:{type:Object,default:()=>({})},index:{type:Number,default:-1}},setup(t,{emit:o,expose:n}){const a=e.ref(!1),l=e.ref([]),r=e.ref({}),s=e.computed(()=>({pageId:e.unref("pageId")})),c=b=>{const f=[];for(const h of b)h.conditions?f.push(...c(h.conditions)):f.push(h);return f},i=()=>{if(c(e.unref(l)).find(f=>!f.value||!f.rule)){j.message.error("条件值或规则不能为空");return}o("save",{conditions:e.unref(l),attribute:e.unref(r)}),a.value=!1},d=b=>{var f;for(const h of b)(f=h.conditions)!=null&&f.length?d(h.conditions):h.key=ye()};e.watch(a,b=>{var f,h,y;if(b){if(Array.isArray((f=t.data)==null?void 0:f.conditions)){const N=ee.cloneDeep(((h=t.data)==null?void 0:h.conditions)||[]);d(N),l.value=N}r.value=ee.cloneDeep(((y=t.data)==null?void 0:y.attribute)||{}),e.unref(r).color||(r.value.color=""),e.unref(r).iconColor||(r.value.iconColor="")}else l.value=[],r.value={}},{flush:"post"});const p=()=>{a.value=!0},u=b=>{var f;e.unref(l)==null||((f=e.unref(l))==null?void 0:f.length)===0?l.value=[{key:ye()}]:e.unref(l)[0]!=null&&(e.unref(l)[0].conditions==null||e.unref(l)[0].join!==b?l.value=[{join:b,conditions:[e.unref(l)[0],{key:ye()}]}]:e.unref(l)[0].conditions.length>1&&e.unref(l)[0].join===b&&l.value[0].conditions.push({key:ye()}))};e.provide(ko,{updateCondition(b,f,h){var w;let y=l.value;const N=h.split("-");if(h&&(N!=null&&N.length))for(const x of N)if(y[+x])y=(w=y[+x])==null?void 0:w.conditions;else break;Array.isArray(y)&&y[f]&&(y[f]=b)},deleteCondition(b,f){var N,w,x;if(!f){l.value=[];return}let h=e.unref(l);const y=f.split("-");if(y!=null&&y.length){for(const S of y)if(h[+S])h=(N=h[+S])==null?void 0:N.conditions;else break;if(Array.isArray(h)&&h[b])if(h.splice(b,1),h.length===1){if(y.length>0){const S=y.length-1,A=y[S],v=y.slice(0,S);let D=e.unref(l),T="";for(const R of v)if(D[+R])T=(w=D[+R])==null?void 0:w.join,D=(x=D[+R])==null?void 0:x.conditions;else break;if(T===h[0].join){if(Array.isArray(h[0].conditions)){const R=ee.cloneDeep(h[0].conditions);D.splice(+A,1),D.splice(+A,0,...R)}}else D[+A]=h[0]}}else h.length===0&&(l.value=[])}},addCondition(b,f,h){var x,S;let y=e.unref(l),N="";const w=b.split("-");if(b&&(w!=null&&w.length))for(const A of w)if(y[+A])N=(x=y[+A])==null?void 0:x.join,y=(S=y[+A])==null?void 0:S.conditions;else break;if(N===h)y.splice(f+1,0,{key:ye()});else{const A=ee.cloneDeep(y[f]);y[f]={join:h,conditions:[A,{key:ye()}]}}}});const m=b=>{r.value.icon=b},C=e.computed(()=>window.config.imgBaseUrl),g=e.ref([{label:"向下箭头",value:"/static/img/indicator-icon/arrow-down.svg"},{label:"向上箭头",value:"/static/img/indicator-icon/arrow-up.svg"}]);return n({showModal:p}),{params:s,visible:a,conditionList:l,attribute:r,handleOk:i,addCondition:u,onUploadChange:m,imgBaseUrl:C,iconOptions:g}}}),dg="",ca=t=>(e.pushScopeId("data-v-a29d848a"),t=t(),e.popScopeId(),t),Kh={class:"config-wrap"},Xh={class:"wrap-item left"},Qh={class:"title"},Jh={class:"border"},Zh={class:"wrap-item right"},eb=ca(()=>e.createElementVNode("div",{class:"title"},"属性配置",-1)),tb={class:"border"},ob={class:"row"},nb=ca(()=>e.createElementVNode("div",null,"字体颜色:",-1)),ab={class:"row"},lb=ca(()=>e.createElementVNode("div",null,"图标:",-1)),rb={style:{display:"flex","align-items":"center","justify-items":"center"}};function ib(t,o,n,a,l,r){const s=e.resolveComponent("a-button"),c=e.resolveComponent("condition-list"),i=e.resolveComponent("pick-colors"),d=e.resolveComponent("a-select"),p=e.resolveComponent("a-modal");return e.openBlock(),e.createBlock(p,{width:"60%",visible:t.visible,"onUpdate:visible":o[6]||(o[6]=u=>t.visible=u),title:"条件设置",destroyOnClose:!0,maskClosable:!1,bodyStyle:{height:"500px",overflow:"auto"},onOk:t.handleOk},{default:e.withCtx(()=>[e.createElementVNode("div",Kh,[e.createElementVNode("div",Xh,[e.createElementVNode("div",Qh,[e.createTextVNode(" 条件配置 "),Array.isArray(t.conditionList)&&t.conditionList.length>0?(e.openBlock(),e.createElementBlock(e.Fragment,{key:0},[e.createVNode(s,{class:"add-and-condition",onClick:o[0]||(o[0]=u=>t.addCondition("&&"))},{default:e.withCtx(()=>[e.createTextVNode(" 添加且条件 ")]),_:1}),e.createVNode(s,{class:"add-or-condition",onClick:o[1]||(o[1]=u=>t.addCondition("||"))},{default:e.withCtx(()=>[e.createTextVNode(" 添加或条件 ")]),_:1})],64)):(e.openBlock(),e.createBlock(s,{key:1,style:{"margin-left":"15px"},onClick:o[2]||(o[2]=u=>t.addCondition())},{default:e.withCtx(()=>[e.createTextVNode(" 添加条件 ")]),_:1}))]),e.createElementVNode("div",Jh,[e.createVNode(c,{class:"condition-list",list:t.conditionList,level:0},null,8,["list"])])]),e.createElementVNode("div",Zh,[eb,e.createElementVNode("div",tb,[e.createElementVNode("div",ob,[nb,e.createVNode(i,{class:"pick-colors",value:t.attribute.color,"onUpdate:value":o[3]||(o[3]=u=>t.attribute.color=u),size:25},null,8,["value"])]),e.createElementVNode("div",ab,[lb,e.createElementVNode("div",rb,[e.createVNode(d,{value:t.attribute.icon,"onUpdate:value":o[4]||(o[4]=u=>t.attribute.icon=u),options:t.iconOptions,style:{width:"160px"}},null,8,["value","options"]),e.createVNode(i,{class:"pick-colors",value:t.attribute.iconColor,"onUpdate:value":o[5]||(o[5]=u=>t.attribute.iconColor=u),size:25},null,8,["value"])])])])])])]),_:1},8,["visible","onOk"])}const sb=ae(qh,[["render",ib],["__scopeId","data-v-a29d848a"]]),cb=e.defineComponent({components:{AModal:j.Modal,AButton:j.Button,ATable:j.Table,ConditionWrap:sb,AInput:j.Input},setup(t,{expose:o,emit:n}){console.log(t);const a=e.ref(!1),l=e.ref(),r=e.ref(),s=e.ref(0),c=[{title:"条件标题",dataIndex:"name",align:"center",ellipsis:!0,width:100},{title:"条件内容",dataIndex:"conditionCode",align:"center",ellipsis:!0,width:250},{title:"条件设置",dataIndex:"operation",ellipsis:!0,width:160}],i=e.ref([]),d=e.ref(),p=(h,y="")=>{let N="";return h.forEach((w,x)=>{const{value:S,rule:A}=w;w.conditions?N+=`(${p(w.conditions,w.join)})`:S&&A&&(N+=`value ${A} '${S}'`),N+=`${x===h.length-1?"":y?" "+y+" ":""}`}),N},u=h=>{i.value=[],d.value=h;const{rules:y,conditionCode:N,conditions:w,attribute:x}=h;if(y)i.value=ee.cloneDeep(y);else if(N){const S={conditionCode:N,conditions:w,attribute:x,name:"新条件"};i.value.push(ee.cloneDeep(S)),delete h.conditionCode,delete h.conditions,delete h.attribute}a.value=!0},m=()=>{a.value=!1;for(const h of i.value)if(h.conditionCode==="")return"不能条件为空!";n("confirm",e.unref(i))},C=()=>{i.value.push({conditionCode:"",name:"新条件",condition:[],attribute:{}})},g=h=>{h.conditionCode=p(h.conditions),Object.assign(i.value[s.value],h)},b=(h,y)=>{e.unref(l).showModal(),r.value=ee.cloneDeep(h),s.value=y},f=h=>{i.value.splice(h,1)};return o({open:u}),{visible:a,currentData:r,currentIndex:s,configColumns:c,conditionsRef:l,rules:i,open:u,close:m,addRule:C,openRuleModal:b,closeRuleModal:g,deleteRule:f}}});function db(t,o,n,a,l,r){const s=e.resolveComponent("a-button"),c=e.resolveComponent("a-input"),i=e.resolveComponent("a-table"),d=e.resolveComponent("a-modal"),p=e.resolveComponent("condition-wrap");return e.openBlock(),e.createElementBlock(e.Fragment,null,[e.createVNode(d,{width:"60%",visible:t.visible,"onUpdate:visible":o[0]||(o[0]=u=>t.visible=u),title:"条件列表",destroyOnClose:!0,maskClosable:!1,bodyStyle:{height:"500px",overflow:"auto"},onOk:t.close},{default:e.withCtx(()=>[e.createVNode(s,{onClick:t.addRule},{default:e.withCtx(()=>[e.createTextVNode("新增条件")]),_:1},8,["onClick"]),e.createVNode(i,{class:"column-table",size:"small",columns:t.configColumns,"data-source":t.rules,scroll:{x:"100%",y:400},pagination:!1,bordered:""},{bodyCell:e.withCtx(({column:u,record:m,index:C})=>[u.dataIndex==="name"?(e.openBlock(),e.createBlock(c,{key:0,size:"small",value:m.name,"onUpdate:value":g=>m.name=g},null,8,["value","onUpdate:value"])):e.createCommentVNode("",!0),u.dataIndex==="operation"?(e.openBlock(),e.createElementBlock(e.Fragment,{key:1},[e.createVNode(s,{size:"small",onClick:g=>t.openRuleModal(m,C)},{default:e.withCtx(()=>[e.createTextVNode("编辑")]),_:2},1032,["onClick"]),e.createVNode(s,{size:"small",onClick:g=>t.deleteRule(C),style:{"margin-left":"6px"}},{default:e.withCtx(()=>[e.createTextVNode("删除")]),_:2},1032,["onClick"])],64)):e.createCommentVNode("",!0)]),_:1},8,["columns","data-source"])]),_:1},8,["visible","onOk"]),e.createVNode(p,{ref:"conditionsRef",data:t.currentData,index:t.currentIndex,onSave:t.closeRuleModal},null,8,["data","index","onSave"])],64)}const pb=ae(cb,[["render",db]]),ub=[{title:"列名",dataIndex:"label",fixed:"left",ellipsis:!0,width:135},{title:"参数",dataIndex:"label",fixed:"left",ellipsis:!0,width:135},{title:"列自定义",dataIndex:"style",align:"center",ellipsis:!0,width:100},{title:"列宽度(px/%)",dataIndex:"width",ellipsis:!0,width:135},{title:"列自定义函数",dataIndex:"renderText",ellipsis:!0,width:170},{title:"列表头自定义函数",dataIndex:"headerTemplate",ellipsis:!0,width:170},{title:"数据格式化",dataIndex:"dataFormat",ellipsis:!0,width:225},{title:"保留小数位数",dataIndex:"retentiondigit",ellipsis:!0,width:135},{title:"表头/表尾列对齐方式",dataIndex:"headerAlign",ellipsis:!0,width:170},{title:"内容列对齐方式",dataIndex:"align",ellipsis:!0,width:170},{title:"固定当前列",dataIndex:"fixed",ellipsis:!0,width:170},{title:"计算行",dataIndex:"calculateShow",ellipsis:!0,width:180},{title:"条件设置",dataIndex:"conditions",ellipsis:!0,width:120}],fb=e.defineComponent({name:"TableColumnConfig",components:{ATable:j.Table,AModal:j.Modal,ACheckbox:j.Checkbox,AInput:j.Input,AInputNumber:j.InputNumber,ASelect:j.Select,ASelectOption:j.SelectOption,Editor:Wr,CodeOutlined:ys,ConditionsTable:pb},setup(){const t=e.inject(ve),o=e.inject(ge),n=e.computed(()=>{var w;return!!((w=e.unref(t))!=null&&w.isGroupTable)}),a=e.computed(()=>{var w;return((w=e.unref(t))==null?void 0:w.tableColumns)||[]}),l=e.ref([]);let r=null,s="";const c=e.ref(""),i=e.ref(""),d=e.ref(!1);e.watch(o,()=>{p()},{deep:!0,flush:"post"});const p=()=>{var x,S,A,v;let w=[];if(l.value=[],n.value){const D=((A=e.unref(o))==null?void 0:A.rowHeaderList)||[],T=((v=e.unref(o))==null?void 0:v.indicators)||[];w=[...D,...T]}else{const D=((x=e.unref(o))==null?void 0:x.queryColumnList)||[],T=((S=e.unref(o))==null?void 0:S.indicators)||[];w=[...D,...T]}console.log("columns",w,a),w.forEach(D=>{var R;let T=(R=e.unref(a))==null?void 0:R.find($=>$.label===D.label);T||(T={label:D.label,prop:D.label,style:!1,width:"",renderText:"",headerTemplate:"",headerAlign:"left",align:"left",fixed:"",dataFormat:[],retentiondigit:null,calculateShow:{sum:!1,avg:!1},conditions:[],attribute:{}}),T.calculateShow||(T.calculateShow={sum:!1,avg:!1}),l.value.push(T)}),t.value.tableColumns=l.value};e.onMounted(()=>{p()});const u=(w,x)=>{w.style=x.target.checked,w.style?w.renderBool===void 0&&(w.renderBool=!1):delete w.renderBool},m=(w,x,S)=>{w&&x&&(r=w,s=x,c.value=w[x]||"",d.value=!0,i.value=S)},C=w=>{try{c.value=w}catch(x){console.error(x)}},g=()=>{r&&s&&(r[s]=c.value),c.value="",d.value=!1},b=e.ref(),f=e.ref(0),h=e.ref();return{configColumns:ub,configData:l,editorTitle:i,editorVisible:d,optionCode:c,handleOk:g,renderSave:m,onEditorChange:C,changeRenderBool:u,openConditions:w=>{f.value=w,b.value=l.value[w],e.unref(h).open(l.value[w])},confirmConditions:w=>{b.value.rules=w},conditionsTableRef:h}}}),pg="",mb={class:"table-column-config"};function hb(t,o,n,a,l,r){const s=e.resolveComponent("a-checkbox"),c=e.resolveComponent("a-input"),i=e.resolveComponent("a-select-option"),d=e.resolveComponent("a-select"),p=e.resolveComponent("a-input-number"),u=e.resolveComponent("code-outlined"),m=e.resolveComponent("a-table"),C=e.resolveComponent("editor"),g=e.resolveComponent("a-modal"),b=e.resolveComponent("conditions-table");return e.openBlock(),e.createElementBlock("div",mb,[e.createVNode(m,{class:"column-table",columns:t.configColumns,"data-source":t.configData,scroll:{x:"100%",y:400},pagination:!1,bordered:""},{bodyCell:e.withCtx(({column:f,text:h,record:y,index:N})=>[f.dataIndex==="style"?(e.openBlock(),e.createBlock(s,{key:0,onChange:w=>t.changeRenderBool(y,w),checked:y.style},null,8,["onChange","checked"])):f.dataIndex==="width"?(e.openBlock(),e.createBlock(c,{key:1,value:y.width,"onUpdate:value":w=>y.width=w,valueModifiers:{trim:!0}},null,8,["value","onUpdate:value"])):f.dataIndex==="renderText"?(e.openBlock(),e.createElementBlock(e.Fragment,{key:2},[y.style?(e.openBlock(),e.createBlock(c,{key:1,value:y.renderText,"onUpdate:value":w=>y.renderText=w,readOnly:!0,onClick:w=>t.renderSave(y,"renderText","列自定义函数")},null,8,["value","onUpdate:value","onClick"])):(e.openBlock(),e.createElementBlock(e.Fragment,{key:0},[e.createTextVNode(e.toDisplayString(h),1)],64))],64)):f.dataIndex==="headerTemplate"?(e.openBlock(),e.createElementBlock(e.Fragment,{key:3},[y.style?(e.openBlock(),e.createBlock(c,{key:1,value:y.headerTemplate,"onUpdate:value":w=>y.headerTemplate=w,readOnly:!0,onClick:w=>t.renderSave(y,"headerTemplate","列表头自定义函数")},null,8,["value","onUpdate:value","onClick"])):(e.openBlock(),e.createElementBlock(e.Fragment,{key:0},[e.createTextVNode(e.toDisplayString(h),1)],64))],64)):f.dataIndex==="headerAlign"?(e.openBlock(),e.createBlock(d,{key:4,style:{width:"100%"},size:"small",value:y.headerAlign,"onUpdate:value":w=>y.headerAlign=w},{default:e.withCtx(()=>[e.createVNode(i,{value:"left"},{default:e.withCtx(()=>[e.createTextVNode("左对齐")]),_:1}),e.createVNode(i,{value:"center"},{default:e.withCtx(()=>[e.createTextVNode("居中")]),_:1}),e.createVNode(i,{value:"right"},{default:e.withCtx(()=>[e.createTextVNode("右对齐")]),_:1})]),_:2},1032,["value","onUpdate:value"])):f.dataIndex==="align"?(e.openBlock(),e.createBlock(d,{key:5,style:{width:"100%"},size:"small",value:y.align,"onUpdate:value":w=>y.align=w},{default:e.withCtx(()=>[e.createVNode(i,{value:"left"},{default:e.withCtx(()=>[e.createTextVNode("左对齐")]),_:1}),e.createVNode(i,{value:"center"},{default:e.withCtx(()=>[e.createTextVNode("居中")]),_:1}),e.createVNode(i,{value:"right"},{default:e.withCtx(()=>[e.createTextVNode("右对齐")]),_:1})]),_:2},1032,["value","onUpdate:value"])):f.dataIndex==="fixed"?(e.openBlock(),e.createBlock(d,{key:6,style:{width:"100%"},size:"small",value:y.fixed,"onUpdate:value":w=>y.fixed=w},{default:e.withCtx(()=>[e.createVNode(i,{value:""},{default:e.withCtx(()=>[e.createTextVNode("不固定")]),_:1}),e.createVNode(i,{value:"left"},{default:e.withCtx(()=>[e.createTextVNode("靠左")]),_:1}),e.createVNode(i,{value:"right"},{default:e.withCtx(()=>[e.createTextVNode("靠右")]),_:1})]),_:2},1032,["value","onUpdate:value"])):f.dataIndex==="dataFormat"?(e.openBlock(),e.createBlock(d,{key:7,value:y.dataFormat,"onUpdate:value":w=>y.dataFormat=w,style:{width:"100%"},mode:"multiple",allowClear:"",maxTagCount:1},{default:e.withCtx(()=>[e.createVNode(i,{value:"#,000"},{default:e.withCtx(()=>[e.createTextVNode("千分位")]),_:1}),e.createVNode(i,{value:"#.00"},{default:e.withCtx(()=>[e.createTextVNode("保留小数")]),_:1}),e.createVNode(i,{value:"#"},{default:e.withCtx(()=>[e.createTextVNode("保留有效位")]),_:1})]),_:2},1032,["value","onUpdate:value"])):f.dataIndex==="retentiondigit"?(e.openBlock(),e.createElementBlock(e.Fragment,{key:8},[y.dataFormat&&y.dataFormat.includes("#.00")?(e.openBlock(),e.createBlock(p,{key:0,value:y.retentiondigit,"onUpdate:value":w=>y.retentiondigit=w,min:0,max:10},null,8,["value","onUpdate:value"])):e.createCommentVNode("",!0)],64)):f.dataIndex==="calculateShow"?(e.openBlock(),e.createElementBlock(e.Fragment,{key:9},[e.createVNode(s,{checked:y.calculateShow.sum,"onUpdate:checked":w=>y.calculateShow.sum=w},{default:e.withCtx(()=>[e.createTextVNode("合计")]),_:2},1032,["checked","onUpdate:checked"]),e.createVNode(s,{checked:y.calculateShow.avg,"onUpdate:checked":w=>y.calculateShow.avg=w},{default:e.withCtx(()=>[e.createTextVNode("平均")]),_:2},1032,["checked","onUpdate:checked"])],64)):f.dataIndex==="conditions"?(e.openBlock(),e.createBlock(u,{key:10,class:"icon",onClick:e.withModifiers(w=>t.openConditions(N),["stop"])},null,8,["onClick"])):e.createCommentVNode("",!0)]),_:1},8,["columns","data-source"]),e.createVNode(g,{title:t.editorTitle,visible:t.editorVisible,"onUpdate:visible":o[0]||(o[0]=f=>t.editorVisible=f),"destroy-on-close":"",width:"700px",bodyStyle:{height:"500px",overflow:"auto"},centered:"",zIndex:1020,okText:"保存",cancelText:"取消",onOk:t.handleOk},{default:e.withCtx(()=>[e.createVNode(C,{class:"option-editor",language:"javascript",options:{fontSize:16,lineHeight:18},valueData:t.optionCode,onChange:t.onEditorChange},null,8,["valueData","onChange"])]),_:1},8,["title","visible","onOk"]),e.createVNode(b,{onConfirm:t.confirmConditions,ref:"conditionsTableRef"},null,8,["onConfirm"])])}const bb=ae(fb,[["render",hb],["__scopeId","data-v-bb095396"]]),yb=[{title:"列名",dataIndex:"label",fixed:"left",ellipsis:!0,width:135},{title:"参数",dataIndex:"label",fixed:"left",ellipsis:!0,width:135},{title:"数据格式化",dataIndex:"dataFormat",ellipsis:!0,width:225},{title:"保留小数位数",dataIndex:"retentiondigit",ellipsis:!0,width:135}],gb=e.defineComponent({name:"TableColumnConfig",components:{ATable:j.Table,AInputNumber:j.InputNumber,ASelect:j.Select,ASelectOption:j.SelectOption,ACollapse:j.Collapse,ACollapsePanel:j.CollapsePanel},setup(){const t=e.inject(ve),o=e.inject(ge),n=e.ref(["cardFormat"]),a=()=>{var d;const r=((d=e.unref(o))==null?void 0:d.indicators)||[],s=t.value.columnsConfigMap||{},c={dataFormat:[],retentiondigit:""},i=r.reduce((p,u)=>({...p,[u.label]:{...c,...s[u.label]||{}}}),{});t.value.columnsConfigMap=i};e.watch(o,()=>{a()},{deep:!0,flush:"post"}),e.onMounted(()=>{a()});const l=e.computed(()=>t.value.columnsConfigMap||{});return{selectedComponent:t,configColumns:yb,graphicConfig:o,columnsConfigMap:l,activePanel:n}}}),ug="";function Cb(t,o,n,a,l,r){const s=e.resolveComponent("a-select-option"),c=e.resolveComponent("a-select"),i=e.resolveComponent("a-input-number"),d=e.resolveComponent("a-table"),p=e.resolveComponent("a-collapse-panel"),u=e.resolveComponent("a-collapse");return e.openBlock(),e.createBlock(u,{activeKey:t.activePanel,"onUpdate:activeKey":o[0]||(o[0]=m=>t.activePanel=m)},{default:e.withCtx(()=>[e.createVNode(p,{key:"cardFormat",header:"数据格式化"},{default:e.withCtx(()=>[e.createVNode(d,{class:"column-table",columns:t.configColumns,"data-source":t.graphicConfig.indicators||[],scroll:{x:"100%",y:400},pagination:!1,bordered:""},{bodyCell:e.withCtx(({column:m,record:C})=>[m.dataIndex==="dataFormat"&&t.columnsConfigMap[C.label]?(e.openBlock(),e.createBlock(c,{key:0,value:t.columnsConfigMap[C.label].dataFormat,"onUpdate:value":g=>t.columnsConfigMap[C.label].dataFormat=g,style:{width:"100%"},mode:"multiple",allowClear:"",maxTagCount:1},{default:e.withCtx(()=>[e.createVNode(s,{value:"#,000"},{default:e.withCtx(()=>[e.createTextVNode("千分位")]),_:1}),e.createVNode(s,{value:"#.00"},{default:e.withCtx(()=>[e.createTextVNode("保留小数")]),_:1}),e.createVNode(s,{value:"#"},{default:e.withCtx(()=>[e.createTextVNode("保留有效位")]),_:1})]),_:2},1032,["value","onUpdate:value"])):m.dataIndex==="retentiondigit"&&t.columnsConfigMap[C.label]?(e.openBlock(),e.createElementBlock(e.Fragment,{key:1},[t.columnsConfigMap[C.label].dataFormat&&t.columnsConfigMap[C.label].dataFormat.includes("#.00")?(e.openBlock(),e.createBlock(i,{key:0,value:t.columnsConfigMap[C.label].retentiondigit,"onUpdate:value":g=>t.columnsConfigMap[C.label].retentiondigit=g,min:0,max:10},null,8,["value","onUpdate:value"])):e.createCommentVNode("",!0)],64)):e.createCommentVNode("",!0)]),_:1},8,["columns","data-source"])]),_:1})]),_:1},8,["activeKey"])}const wb=ae(gb,[["render",Cb],["__scopeId","data-v-72761110"]]),kb=e.defineComponent({name:"StyleConfigGroup",props:{componentType:{type:String,default:""},isGroupTable:{type:Boolean,default:!1}},components:{PropsToForm:Oh,TableColumnConfig:bb,Editor:Wr,AFormItem:j.FormItem,ASelect:j.Select,ASelectOption:j.SelectOption,ACollapse:j.Collapse,ACollapsePanel:j.CollapsePanel,ASwitch:j.Switch,IndicatorContainer:wb},setup(t){const o=e.ref([]),n=e.ref(["表格"]),a=e.inject(wo),l=e.inject(ma),r=e.inject(Ko),s=e.inject(Xo),c=e.inject(fa),i=e.inject(ve),d=S=>{r({...Jo[S]},!1),e.unref(i).type=e.unref(p),c()},p=e.computed(()=>{var S;return(S=e.unref(a))==null?void 0:S.type}),u=["showTotalBool","totalName","expandAll"],m=e.computed(()=>Cf.map(S=>{const{props:A,title:v,enableProps:D,onlyType:T,excludeType:R}=S,$=[];A.forEach(B=>{typeof B=="string"&&(u.includes(B)?t.isGroupTable&&$.push(B):$.push(B))});let F,_;return t.componentType==="table"&&(T!=null&&T.includes(t.componentType))?(F=typeof D=="string"&&l.value?l.value[D]:void 0,_=ee.pick(e.unref(l),$)):(F=typeof D=="string"&&a.value?a.value[D]:void 0,_=ee.pick(e.unref(a),$)),{title:v,enableProps:F,enablePropsName:D,onlyType:T,excludeType:R,props:_}}).filter(({props:S})=>Object.keys(S).length>0)),C=(S,A)=>{const{onlyType:v,excludeType:D}=S;return v==null&&D==null?!0:v?ue(A,v):D?!ue(A,D):!1},g=(S,A)=>(A==null||A.stopPropagation(),S),b=(S,A)=>{A!=null&&r({[A]:S})},f=e.computed(()=>JSON.stringify(e.unref(a),null,2)),h=S=>{try{const A=JSON.parse(S||"{}");r(A,!1)}catch(A){console.error(A)}},y=e.ref(""),N=S=>{try{y.value=S}catch(A){console.error(A)}},w=(S,A)=>{try{s({[A]:S})}catch(v){console.error(v)}},x=e.computed(()=>{var S;return["customGraph"].includes((S=e.unref(a))==null?void 0:S.type)});return{type:p,handleChangeType:d,activePanel:o,tablePanel:n,ComponentString:f,updateComponentOptions:h,tableOptions:l,optionCode:y,onEditorChange:N,tableEditorChange:w,onSwitchClick:g,onSwitchChange:b,detailPropsGroups:m,isRenderForm:C,isShowOptionEditor:x}}}),fg="",mg="",xb={class:"style-group"};function _b(t,o,n,a,l,r){const s=e.resolveComponent("a-select-option"),c=e.resolveComponent("a-select"),i=e.resolveComponent("a-form-item"),d=e.resolveComponent("a-switch"),p=e.resolveComponent("props-to-form"),u=e.resolveComponent("a-collapse-panel"),m=e.resolveComponent("editor"),C=e.resolveComponent("a-collapse"),g=e.resolveComponent("table-column-config"),b=e.resolveComponent("indicator-container");return e.openBlock(),e.createElementBlock("div",xb,[t.componentType!=="table"&&t.componentType!=="card"?(e.openBlock(),e.createElementBlock(e.Fragment,{key:0},[e.createVNode(i,{label:"图表类型"},{default:e.withCtx(()=>[e.createVNode(c,{value:t.type,"onUpdate:value":o[0]||(o[0]=f=>t.type=f),style:{width:"100%"},onChange:t.handleChangeType},{default:e.withCtx(()=>[e.createVNode(s,{value:"line"},{default:e.withCtx(()=>[e.createTextVNode("折线图")]),_:1}),e.createVNode(s,{value:"bar"},{default:e.withCtx(()=>[e.createTextVNode("柱状图")]),_:1}),e.createVNode(s,{value:"pie"},{default:e.withCtx(()=>[e.createTextVNode("饼图")]),_:1}),e.createVNode(s,{value:"comboGraph"},{default:e.withCtx(()=>[e.createTextVNode("组合图表")]),_:1}),e.createVNode(s,{value:"customGraph"},{default:e.withCtx(()=>[e.createTextVNode("自定义图表")]),_:1})]),_:1},8,["value","onChange"])]),_:1}),e.createVNode(C,{activeKey:t.activePanel,"onUpdate:activeKey":o[1]||(o[1]=f=>t.activePanel=f)},{default:e.withCtx(()=>[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(t.detailPropsGroups,f=>(e.openBlock(),e.createElementBlock(e.Fragment,{key:f.title},[t.isRenderForm(f,t.type)?(e.openBlock(),e.createElementBlock(e.Fragment,{key:0},[f.title?(e.openBlock(),e.createBlock(u,{header:f.title,key:f.title},{extra:e.withCtx(()=>[typeof f.enableProps=="boolean"?(e.openBlock(),e.createBlock(d,{key:0,checked:f.enableProps,onChange:h=>t.onSwitchChange(h,f.enablePropsName),onClick:t.onSwitchClick},null,8,["checked","onChange","onClick"])):e.createCommentVNode("",!0)]),default:e.withCtx(()=>[e.createVNode(p,{props:f.props,disabled:typeof f.enableProps=="boolean"?!f.enableProps:!1},null,8,["props","disabled"])]),_:2},1032,["header"])):e.createCommentVNode("",!0)],64)):e.createCommentVNode("",!0)],64))),128)),t.isShowOptionEditor?(e.openBlock(),e.createBlock(u,{key:"custom-option",header:"自定义option配置"},{default:e.withCtx(()=>[e.createVNode(m,{class:"option-editor",language:"typescript",valueData:t.optionCode,onChange:t.onEditorChange},null,8,["valueData","onChange"])]),_:1})):e.createCommentVNode("",!0)]),_:1},8,["activeKey"])],64)):e.createCommentVNode("",!0),t.componentType==="table"?(e.openBlock(),e.createBlock(C,{key:1,activeKey:t.tablePanel,"onUpdate:activeKey":o[4]||(o[4]=f=>t.tablePanel=f)},{default:e.withCtx(()=>[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(t.detailPropsGroups,f=>{var h;return e.openBlock(),e.createElementBlock(e.Fragment,{key:f.title},[f.title&&((h=f.onlyType)!=null&&h.includes(t.componentType))?(e.openBlock(),e.createBlock(u,{header:f.title,key:f.title},{default:e.withCtx(()=>[e.createVNode(p,{componentType:t.componentType,props:f.props,disabled:typeof f.enableProps=="boolean"?!f.enableProps:!1},null,8,["componentType","props","disabled"])]),_:2},1032,["header"])):e.createCommentVNode("",!0)],64)}),128)),e.createVNode(u,{key:"tableColumn",header:"表格列配置"},{default:e.withCtx(()=>[e.createVNode(g)]),_:1}),e.createVNode(u,{key:"headerCellStyleMethod",header:"表头单元格样式"},{default:e.withCtx(()=>[e.createVNode(m,{class:"option-editor",language:"javascript",options:{fontSize:16,lineHeight:18},valueData:t.tableOptions.headerCellStyleMethod,onChange:o[2]||(o[2]=f=>t.tableEditorChange(f,"headerCellStyleMethod"))},null,8,["valueData"])]),_:1}),e.createVNode(u,{key:"rowStyleMethod",header:"行样式"},{default:e.withCtx(()=>[e.createVNode(m,{class:"option-editor",language:"javascript",options:{fontSize:16,lineHeight:18},valueData:t.tableOptions.rowStyleMethod,onChange:o[3]||(o[3]=f=>t.tableEditorChange(f,"rowStyleMethod"))},null,8,["valueData"])]),_:1})]),_:1},8,["activeKey"])):e.createCommentVNode("",!0),t.componentType==="card"?(e.openBlock(),e.createBlock(b,{key:2})):e.createCommentVNode("",!0)])}const Sb=ae(kb,[["render",_b],["__scopeId","data-v-9a2fa8f5"]]),Tb=e.defineComponent({name:"Card",components:{CloseOutlined:Zt,AInput:j.Input,ASelect:j.Select,MenuOutlined:Sn,ADropdown:j.Dropdown,AMenu:j.Menu,AMenuItem:j.MenuItem},props:{index:{type:Number,require:!0},control:{type:Object,default:()=>({})},conditionOptions:{type:Array,default:()=>[]},path:{type:String,default:""}},emits:["delete","update"],setup(t){const o=e.inject(ze),n=e.inject(xo),a=e.inject(ya),l=e.inject(Qo),{onUpdateControl:r,onDeleteControl:s,onAddMenuControl:c}=e.inject("CHANGE_CONTROL",{onUpdateControl:k=>{},onDeleteControl:k=>{},onAddMenuControl:(k,L,M)=>{}}),i=e.computed(()=>{var k;return(k=e.unref(o))==null?void 0:k.filter(L=>L.keyName!=="")}),d=e.computed(()=>{const k=[];return e.unref(l)||k.push({keyName:"父页面",id:"PARENT"}),[...k,...e.unref(i)]}),p=e.computed(()=>{var M,U;const k=[],L=(M=e.unref(i))==null?void 0:M.find(z=>{var q;return z.id===((q=t.control)==null?void 0:q.id)});if(L){const z=L.type,q=ee.pick(L,["value","startTime","endTime"]);(U=Object.keys(q))!=null&&U.length||(q.value="");for(const X in q)if(Object.prototype.hasOwnProperty.call(q,X)){const J=e.unref(a)[X];if(Array.isArray(J)){const oe=J.find(le=>ue(z,le.onlyType));oe&&k.push({label:oe.label,value:X})}else k.push({label:J.label,value:X})}}return k}),u=()=>{s({index:t.index,path:t.path}),C(t.control.id)},m=({key:k})=>{c(t.path,t.index,k==="2"?"||":"&&")};function C(k){const L=e.unref(i).find(M=>M.id===k);if(L){const{type:M,id:U,events:z=[]}=L,q=Vo(M),X=z.findIndex(J=>{var oe;return J.on===q&&J.target===((oe=e.unref(A))==null?void 0:oe.id)&&J.emit==="refreshData"});X!==-1&&(z.splice(X,1),n({id:U,events:z}))}}const g=k=>{const L={...t.control};if(L.id=k,L.customValue="",k){const M=e.unref(i).find(U=>U.id===k);M&&(L.keyName=M.keyName,D(M,k))}delete L.prop,r({control:L,index:t.index,path:t.path})},b=e.ref(""),f=()=>{b.value=t.control.id},h=k=>{r({control:{...t.control,prop:k},index:t.index,path:t.path})},y=k=>{r({control:{...t.control,prop:k.target.value},index:t.index,path:t.path})},N=k=>{r({control:{...t.control,rule:k},index:t.index,path:t.path})},w=k=>{const L={...t.control};L.modelKey&&(L.modelKey=""),L.prop&&(L.prop=""),L.format&&(L.format=""),r({control:{...L,dataType:k,customValue:"",id:"",keyName:""},index:t.index,path:t.path})},x=k=>{r({control:{...t.control,customValue:k.target.value},index:t.index,path:t.path})},S=k=>{const L={...t.control};k==null?delete L.mode:L.mode=k,delete L.conditionLabel,delete L.conditionName,delete L.conditionKey,delete L.conditionValueType,r({control:L,index:t.index,path:t.path})},A=e.inject(ve),v=e.inject(ge);function D(k,L){var X,J;const{type:M,id:U,events:z=[]}=k,q=Vo(M);e.unref(b)&&L!==e.unref(b)&&(ut(((X=e.unref(v))==null?void 0:X.controlList)||[]).find(le=>le.id===e.unref(b))||C(e.unref(b))),z.find(oe=>{var le;return oe.on===q&&oe.target===((le=e.unref(A))==null?void 0:le.id)&&oe.emit==="refreshData"})||n({id:U,events:[...z,{on:q,target:(J=e.unref(A))==null?void 0:J.id,emit:"refreshData"}].reverse()})}const T=(k,L)=>{if(k){const{label:M,name:U,id:z,genericType:q,indexCode:X,typeGuid:J,indexCodeNum:oe}=L||{},le={...t.control,conditionKey:z,conditionLabel:M,conditionName:U,conditionValueType:q,indexCode:X,typeGuid:J,indexCodeNum:oe};Ye(le,"rule")||(le.rule="EQUAL"),Ye(le,"dataType")||(le.dataType="component"),r({control:le,index:t.index,path:t.path})}else{const M={...t.control};delete M.conditionLabel,delete M.conditionName,delete M.conditionKey,delete M.conditionValueType,r({control:M,index:t.index,path:t.path})}},R=(k,L)=>{var M;return(M=L==null?void 0:L.keyName)==null?void 0:M.toLowerCase().includes(k==null?void 0:k.toLowerCase())},$=(k,L)=>{var M;return(M=L==null?void 0:L.label)==null?void 0:M.toLowerCase().includes(k==null?void 0:k.toLowerCase())},F=e.computed(()=>{const k=t.conditionOptions.find(M=>M.id===t.control.conditionKey);let L="";return k&&(L=(k==null?void 0:k.genericType)||""),L==="TEXT"||L==="0"?[{label:"属于",value:"IN"},{label:"不属于",value:"NOT_IN"},{label:"包含",value:"LIKE"},{label:"不包含",value:"NOT_LIKE"},{label:"开头是",value:"LIKE%"},{label:"结尾是",value:"%LIKE"},{label:"等于",value:"EQUAL"},{label:"小于",value:"LESS"},{label:"小于等于",value:"LESS_EQUAL"},{label:"大于",value:"GREATER"},{label:"大于等于",value:"GREATER_EQUAL"}]:L==="NUMBER"||L==="1"?[{label:"小于",value:"LESS"},{label:"小于等于",value:"LESS_EQUAL"},{label:"大于",value:"GREATER"},{label:"大于等于",value:"GREATER_EQUAL"},{label:"等于",value:"EQUAL"},{label:"不等于",value:"NOT_EQUAL"}]:L==="DATE"||L==="2"?[{label:"属于",value:"IN"},{label:"不属于",value:"NOT_IN"},{label:"小于",value:"LESS"},{label:"小于等于",value:"LESS_EQUAL"},{label:"大于",value:"GREATER"},{label:"大于等于",value:"GREATER_EQUAL"},{label:"等于",value:"EQUAL"},{label:"不等于",value:"NOT_EQUAL"}]:[]}),_=[{label:"自定义值",value:""},{label:"组件值",value:"component"}],B=e.computed(()=>{let k=!1;const{id:L="",dataType:M="component"}=t.control;if(L&&M==="component"){const U=e.unref(i).find(q=>q.id===L),z=["table","bar","combograph","line","pie","radar","scatter","list","circulate"];ue(U==null?void 0:U.type,z)&&(k=!0)}return L==="PARENT"&&(k=!0),k}),E=e.computed(()=>{let k=!1;const{id:L="",dataType:M="component"}=t.control;if(L&&M==="component"){const U=e.unref(i).find(z=>z.id===L);ue((U==null?void 0:U.type)||"","range")&&(k=!0)}return L==="PARENT"&&(k=!0),k}),P=e.computed(()=>{let k=!1;const{id:L="",dataType:M="component"}=t.control;if(L&&M==="component"){const U=e.unref(i).find(z=>z.id===L);ue((U==null?void 0:U.type)||"",["date","range"])&&(k=!0)}return k});return{propOptions:p,usedComponentList:i,onDelete:u,onIdChange:g,onIdFocus:f,onPropChange:h,onParentPropChange:y,onModeChange:S,onRuleChange:N,onDataTypeChange:w,onCustomValueChange:x,onConditionKeyChange:T,idFilterOption:R,filterOption:$,onFormatChange:k=>{r({control:{...t.control,format:k},index:t.index,path:t.path})},onModelPropChange:k=>{r({control:{...t.control,modelKey:k.target.value},index:t.index,path:t.path})},clickConditionMenu:m,ruleOption:F,dataTypeOption:_,isShowProp:E,isShowFormat:P,isShowModelProp:B,formatOptions:[{label:"年",value:"YYYY"},{label:"年月",value:"YYYY-MM"},{label:"年月日",value:"YYYY-MM-DD"},{label:"年月日时",value:"YYYY-MM-DD HH"},{label:"年月日时分",value:"YYYY-MM-DD HH:mm"},{label:"年月日时分秒",value:"YYYY-MM-DD HH:mm:ss"}],keyNameOptions:d}}}),hg="",bg="",Nb={class:"control-card"};function Ab(t,o,n,a,l,r){const s=e.resolveComponent("a-select"),c=e.resolveComponent("a-input"),i=e.resolveComponent("menu-outlined"),d=e.resolveComponent("a-menu-item"),p=e.resolveComponent("a-menu"),u=e.resolveComponent("a-dropdown"),m=e.resolveComponent("close-outlined");return e.openBlock(),e.createElementBlock("div",Nb,[e.createVNode(s,{class:"field-name",value:t.control.conditionKey,options:t.conditionOptions,fieldNames:{value:"id"},"allow-clear":"","show-search":"",onChange:t.onConditionKeyChange,"filter-option":t.filterOption},null,8,["value","options","onChange","filter-option"]),e.createVNode(s,{class:"field-name",value:t.control.rule,options:t.ruleOption,style:{"max-width":"100px"},onChange:t.onRuleChange},null,8,["value","options","onChange"]),e.createVNode(s,{class:"field-name",value:t.control.dataType,options:t.dataTypeOption,style:{"max-width":"100px"},onChange:t.onDataTypeChange},null,8,["value","options","onChange"]),t.control.dataType===""?(e.openBlock(),e.createBlock(c,{key:0,class:"field-name",value:t.control.customValue,style:{"max-width":"180px"},onInput:t.onCustomValueChange},null,8,["value","onInput"])):e.createCommentVNode("",!0),t.control.dataType==="component"?(e.openBlock(),e.createBlock(s,{key:1,class:"field-name",value:t.control.id,options:t.keyNameOptions,fieldNames:{label:"keyName",value:"id"},"show-search":"","filter-option":t.idFilterOption,style:{"max-width":"180px"},onChange:t.onIdChange,onClick:t.onIdFocus},null,8,["value","options","filter-option","onChange","onClick"])):e.createCommentVNode("",!0),t.isShowModelProp?(e.openBlock(),e.createBlock(c,{key:2,class:"field-name",value:t.control.modelKey,onInput:t.onModelPropChange,placeholder:t.control.id==="PARENT"?"请输入组件别名":""},null,8,["value","onInput","placeholder"])):e.createCommentVNode("",!0),t.isShowProp?(e.openBlock(),e.createElementBlock(e.Fragment,{key:3},[t.control.id==="PARENT"?(e.openBlock(),e.createBlock(c,{key:0,class:"field-name",value:t.control.prop,onInput:t.onParentPropChange,placeholder:"请输入属性名"},null,8,["value","onInput"])):(e.openBlock(),e.createBlock(s,{key:1,class:"field-name",value:t.control.prop,options:t.propOptions,onChange:t.onPropChange},null,8,["value","options","onChange"]))],64)):e.createCommentVNode("",!0),t.isShowFormat?(e.openBlock(),e.createBlock(s,{key:4,class:"field-name",value:t.control.format,options:t.formatOptions,onChange:t.onFormatChange},null,8,["value","options","onChange"])):e.createCommentVNode("",!0),e.createVNode(u,{trigger:["click"]},{overlay:e.withCtx(()=>[e.createVNode(p,{onClick:t.clickConditionMenu},{default:e.withCtx(()=>[e.createVNode(d,{key:"1"},{default:e.withCtx(()=>[e.createTextVNode("添加且条件")]),_:1}),e.createVNode(d,{key:"2"},{default:e.withCtx(()=>[e.createTextVNode("添加或条件")]),_:1})]),_:1},8,["onClick"])]),default:e.withCtx(()=>[e.createVNode(i,{class:"more-icon"})]),_:1}),e.createVNode(m,{class:"delete-icon",onClick:t.onDelete},null,8,["onClick"])])}const Eb=ae(Tb,[["render",Ab],["__scopeId","data-v-f2a646f1"]]),Ob=e.defineComponent({name:"ControlList",props:{list:{type:Array,default:()=>[]},level:{type:Number,default:0},path:{type:String,default:""},conditionOptions:{type:Array,default:()=>[]}},components:{ControlCard:Eb}}),yg="",Bb={key:0,class:"condition-list"},Vb={key:0,class:"condition-container"},Lb={key:0,class:"condition-text"},Fb={key:1,class:"condition-text"},$b={class:"conditions"};function Ib(t,o,n,a,l,r){const s=e.resolveComponent("control-list",!0),c=e.resolveComponent("control-card");return Array.isArray(t.list)?(e.openBlock(),e.createElementBlock("div",Bb,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(t.list,(i,d)=>(e.openBlock(),e.createElementBlock(e.Fragment,{key:d},[i.join&&i.conditions&&Array.isArray(i.conditions)?(e.openBlock(),e.createElementBlock("div",Vb,[i.conditions.length>1?(e.openBlock(),e.createElementBlock(e.Fragment,{key:0},[i.join==="||"?(e.openBlock(),e.createElementBlock("div",Lb,"或")):e.createCommentVNode("",!0),i.join==="&&"?(e.openBlock(),e.createElementBlock("div",Fb,"且")):e.createCommentVNode("",!0)],64)):e.createCommentVNode("",!0),e.createElementVNode("div",$b,[i.conditions.length>0?(e.openBlock(),e.createBlock(s,{key:0,level:t.level+1,path:`${t.path?t.path+"-":""}${d}`,list:i.conditions,conditionOptions:t.conditionOptions},null,8,["level","path","list","conditionOptions"])):e.createCommentVNode("",!0)])])):(e.openBlock(),e.createBlock(c,{class:"condition",key:i.keyValue||`${t.level}-${d}`,control:i,index:d,path:t.path||"",conditionOptions:t.conditionOptions},null,8,["control","index","path","conditionOptions"]))],64))),128))])):e.createCommentVNode("",!0)}const vb=ae(Ob,[["render",Ib],["__scopeId","data-v-2588920e"]]),Db=e.defineComponent({name:"ControlGroup",props:{conditionOptions:{type:Array,default:()=>[]}},components:{ControlList:vb,AButton:j.Button,ASelect:j.Select,APopover:j.Popover},setup(){const t=e.ref(!1),o=e.ref([]),n=e.inject(ze),a=e.inject(ge),l=e.inject(Ae),r=e.inject(ba),s=e.computed(()=>{var h,y;const f=((h=e.unref(a))==null?void 0:h.controlList)||[];for(const N of f)N.conditionKey&&(Ye(N,"rule")||(N.prop==="startTime"?N.rule="GREATER_EQUAL":N.prop==="endTime"?N.rule="LESS_EQUAL":N.rule="EQUAL"),Ye(N,"dataType")||(N.dataType="component"));return(f==null?void 0:f.length)>1&&!((y=f[0])!=null&&y.join)?[{join:"&&",conditions:f}]:f}),c=e.ref(null),i=f=>{const h={...e.unref(a),...f,sqlConditions:Kl({...e.unref(a),...f},e.unref(n))};l(h)},d=f=>{var y;const h=(y=e.unref(s))==null?void 0:y.slice();h==null||(h==null?void 0:h.length)===0?i({controlList:[{keyValue:ye()}]}):h[0]!=null&&(h[0].conditions==null||h[0].join!==f?i({controlList:[{join:f,conditions:[h[0],{keyValue:ye()}]}]}):h[0].conditions.length>1&&h[0].join===f&&(h[0].conditions.push({keyValue:ye()}),i({controlList:h})))},p=f=>{var S,A,v,D;const{index:h,path:y}=f;let N=ee.cloneDeep((S=e.unref(s))==null?void 0:S.slice()),w=N;const x=y.split("-");if(x!=null&&x.length){for(const T of x)if(w[T])w=(A=w[T])==null?void 0:A.conditions;else break;if(Array.isArray(w)&&w[h])if(w.splice(h,1),w.length===1){if(x.length>0){const T=x.length-1,R=x[T],$=x.slice(0,T);let F=N,_="";for(const B of $)if(F[B])_=(v=F[B])==null?void 0:v.join,F=(D=F[B])==null?void 0:D.conditions;else break;if(_===w[0].join){if(Array.isArray(w[0].conditions)){const B=ee.cloneDeep(w[0].conditions);F.splice(+R,1),F.splice(+R,0,...B)}}else F[R]=w[0]}}else w.length===0&&(N=[]);i({controlList:N})}},u=f=>{var A,v;const{control:h,index:y,path:N}=f,w=ee.cloneDeep((A=e.unref(s))==null?void 0:A.slice());let x=w;const S=N.split("-");if(S!=null&&S.length)for(const D of S)if(x[D])x=(v=x[D])==null?void 0:v.conditions;else break;Array.isArray(x)&&x[y]&&(x[y]=h),i({controlList:w})},m=(f,h,y)=>{var A,v,D;const N=ee.cloneDeep((A=e.unref(s))==null?void 0:A.slice());let w=N,x="";const S=f.split("-");if(S!=null&&S.length){for(const T of S)if(w[T])x=(v=w[T])==null?void 0:v.join,w=(D=w[T])==null?void 0:D.conditions;else break;if(x===y)w.splice(h+1,0,{keyValue:ye()});else{const T=ee.cloneDeep(w[h]);w[h]={join:y,conditions:[T,{keyValue:ye()}]}}i({controlList:N})}},C=(f,h)=>{var y;return(y=h==null?void 0:h.label)==null?void 0:y.toLowerCase().includes(f==null?void 0:f.toLowerCase())},g=e.computed(()=>e.unref(n).filter(f=>f.dataType==="indicator"&&f.graphicConfig.source==="INDICATOR_LIB").map(f=>({label:f.keyName,value:f.id}))),b=()=>{var f;try{(f=e.unref(o))!=null&&f.length&&(r(e.unref(o),e.unref(s)),j.message.success("应用成功")),t.value=!1}catch(h){console.error(h)}};return e.watch(t,f=>{f||(o.value=[])}),e.provide("CHANGE_CONTROL",{onDeleteControl:p,onUpdateControl:u,onAddMenuControl:m}),{isVisible:t,selectedIds:o,controlList:s,bindComponentId:c,indicatorComponents:g,onAddControl:d,filterOption:C,handleConfirmSync:b}}}),gg="",Mb=t=>(e.pushScopeId("data-v-c0d80844"),t=t(),e.popScopeId(),t),Pb={class:"control-group"},jb={class:"control-group-header"},Rb={class:"sync-wrap"},Ub=Mb(()=>e.createElementVNode("div",{class:"title"}," 将此全局过滤条件配置同步至选中组件的指标库配置中。若被选中组件已有全局过滤条件将会被覆盖! ",-1)),zb={key:0,class:"selected-total"},Gb={class:"operate-container"},Hb={class:"control-group-content"};function Wb(t,o,n,a,l,r){const s=e.resolveComponent("a-button"),c=e.resolveComponent("a-select"),i=e.resolveComponent("a-popover"),d=e.resolveComponent("control-list");return e.openBlock(),e.createElementBlock("div",Pb,[e.createElementVNode("div",jb,[Array.isArray(t.controlList)&&t.controlList.length>0?(e.openBlock(),e.createElementBlock(e.Fragment,{key:0},[e.createVNode(s,{onClick:o[0]||(o[0]=p=>t.onAddControl("&&"))},{default:e.withCtx(()=>[e.createTextVNode("添加且条件")]),_:1}),e.createVNode(s,{onClick:o[1]||(o[1]=p=>t.onAddControl("||")),style:{"margin-left":"15px"}},{default:e.withCtx(()=>[e.createTextVNode("添加或条件")]),_:1})],64)):(e.openBlock(),e.createBlock(s,{key:1,onClick:o[2]||(o[2]=p=>t.onAddControl())},{default:e.withCtx(()=>[e.createTextVNode("添加条件")]),_:1})),e.createVNode(i,{visible:t.isVisible,"onUpdate:visible":o[4]||(o[4]=p=>t.isVisible=p),title:"选择组件",placement:"bottomRight",trigger:"click"},{content:e.withCtx(()=>{var p;return[e.createElementVNode("div",Rb,[Ub,t.indicatorComponents.length?(e.openBlock(),e.createElementBlock("div",zb,e.toDisplayString(t.selectedIds.length)+" / "+e.toDisplayString(t.indicatorComponents.length)+" 项 ",1)):e.createCommentVNode("",!0),e.createElementVNode("div",Gb,[e.createVNode(c,{style:{flex:"1"},value:t.selectedIds,"onUpdate:value":o[3]||(o[3]=u=>t.selectedIds=u),"show-search":"",mode:"multiple",placeholder:"请选择","filter-option":t.filterOption,options:t.indicatorComponents},null,8,["value","filter-option","options"]),e.createVNode(s,{style:{"margin-left":"10px"},type:"primary",disabled:!((p=t.selectedIds)!=null&&p.length),onClick:t.handleConfirmSync},{default:e.withCtx(()=>[e.createTextVNode(" 确定 ")]),_:1},8,["disabled","onClick"])])])]}),default:e.withCtx(()=>[Array.isArray(t.controlList)&&t.controlList.length>0?(e.openBlock(),e.createBlock(s,{key:0,type:"primary",ghost:"",style:{float:"right"}},{default:e.withCtx(()=>[e.createTextVNode(" 应用到其他组件 ")]),_:1})):e.createCommentVNode("",!0)]),_:1},8,["visible"])]),e.createElementVNode("div",Hb,[e.createVNode(d,{class:"condition-list",list:t.controlList,level:0,conditionOptions:t.conditionOptions},null,8,["list","conditionOptions"])])])}const Yb=ae(Db,[["render",Wb],["__scopeId","data-v-c0d80844"]]),qb=e.defineComponent({name:"VariableCard",props:{item:{type:Object,default:()=>({})},index:{type:Number,require:!0},label:String},components:{CloseOutlined:Zt,AppstoreAddOutlined:un,ASelect:j.Select,ASelectOption:j.SelectOption,AInput:j.Input,APopover:j.Popover,ATabs:j.Tabs,ATabPane:j.TabPane,AInputNumber:j.InputNumber},setup(t,{emit:o}){const n=e.ref(!1),a=e.inject(ze),l=e.computed(()=>{var w;return(w=e.unref(a))==null?void 0:w.filter(x=>x.keyName!=="")}),r=[{label:"TEXT",value:"TEXT"},{label:"NUMBER",value:"NUMBER"},{label:"DATE",value:"DATE"}],s=[{label:"自定义值",value:""},{label:"组件值",value:"component"}],c=[{label:"间隔值",value:"rangeValue"},{label:"开始时间",value:"startTime"},{label:"结束时间",value:"endTime"}],i=e.ref(ee.cloneDeep(t.item));e.watch(i,w=>{o("update",{...w,label:t.label},t.index)},{deep:!0});const d=e.computed(()=>{var x;let w=null;if(((x=e.unref(i))==null?void 0:x.dataType)==="component"){const S=e.unref(l).find(A=>{var v;return A.id===((v=e.unref(i))==null?void 0:v.id)});S&&(w=S)}return w}),p=e.computed(()=>{var x;let w=!1;return((x=e.unref(i))==null?void 0:x.variableType)==="DATE"&&(w=!0),w}),u=e.computed(()=>{let w=!1;return e.unref(d)&&(w=ue(e.unref(d).type,"range")),w}),m=e.computed(()=>{let w=!1;return e.unref(d)&&(ue(e.unref(d).type,"range")?["startTime","endTime"].includes(e.unref(i).dateTypeValue)&&(w=!0):ue(e.unref(d).type,"date")&&(w=!0)),w}),C=(w,x)=>{w&&(e.unref(i).keyName=x.keyName)},g=()=>{o("delete",t.index)},b=e.computed(()=>e.unref(p)?[{label:"年",value:"YYYY"},{label:"年月",value:"YYYY-MM"},{label:"年月日",value:"YYYY-MM-DD"},{label:"年月日时",value:"YYYY-MM-DD HH"},{label:"年月日时分",value:"YYYY-MM-DD HH:mm"},{label:"年月日时分秒",value:"YYYY-MM-DD HH:mm:ss"}]:[]),f=()=>{e.unref(i).id=null,e.unref(i).keyName="",e.unref(i).dateTypeValue=null,e.unref(i).variableValue=""},h=()=>{e.unref(i).format=null},y=(w,x)=>{var S;return(S=x==null?void 0:x.keyName)==null?void 0:S.toLowerCase().includes(w==null?void 0:w.toLowerCase())};return e.watch(m,w=>{w&&(e.unref(i).operateType||(e.unref(i).operateType="add"),e.unref(i).operateMode||(e.unref(i).operateMode="year"),e.unref(i).operateValue||(e.unref(i).operateValue=0),e.unref(i).activeOperateKey||(e.unref(i).activeOperateKey=1))},{immediate:!0}),{variableData:i,typeOption:r,dataTypeOption:s,usedComponentList:l,formatOptions:b,rangeTypeOptions:c,isShowFormat:p,isDateRangeComponent:u,isShowDateOperate:m,popoverVisible:n,idFilterOption:y,onChangeComponent:C,onDelete:g,onChangeDataType:f,onChangeVariableType:h,changeTab:w=>{e.unref(i).activeOperateKey=w,w===1?e.unref(i).operateValue=0:w===2&&(e.unref(i).operateValue="rangeValue")}}}}),Cg="",Kb={class:"variable-item"},Xb=["title"],Qb={class:"popover-content-wrap"},Jb={style:{display:"flex"}};function Zb(t,o,n,a,l,r){const s=e.resolveComponent("a-input"),c=e.resolveComponent("a-select"),i=e.resolveComponent("a-select-option"),d=e.resolveComponent("a-input-number"),p=e.resolveComponent("a-tab-pane"),u=e.resolveComponent("a-tabs"),m=e.resolveComponent("appstore-add-outlined"),C=e.resolveComponent("a-popover"),g=e.resolveComponent("close-outlined");return e.openBlock(),e.createElementBlock("div",Kb,[t.variableData.randomKey?(e.openBlock(),e.createElementBlock("div",{key:0,class:"var-indicator",title:t.label},e.toDisplayString(t.label),9,Xb)):e.createCommentVNode("",!0),e.createVNode(s,{class:"field-name",value:t.variableData.variableName,"onUpdate:value":o[0]||(o[0]=b=>t.variableData.variableName=b),placeholder:"请输入变量名",disabled:!!t.variableData.randomKey},null,8,["value","disabled"]),e.createVNode(c,{class:"field-name",value:t.variableData.variableType,"onUpdate:value":o[1]||(o[1]=b=>t.variableData.variableType=b),options:t.typeOption,disabled:t.variableData.disabled,style:{"max-width":"120px"},placeholder:"请选择变量类型",onChange:t.onChangeVariableType},null,8,["value","options","disabled","onChange"]),e.createVNode(c,{class:"field-name",value:t.variableData.dataType,"onUpdate:value":o[2]||(o[2]=b=>t.variableData.dataType=b),options:t.dataTypeOption,style:{"max-width":"120px"},onChange:t.onChangeDataType},null,8,["value","options","onChange"]),t.variableData.dataType==="component"?(e.openBlock(),e.createBlock(c,{key:1,class:"field-name",value:t.variableData.id,"onUpdate:value":o[3]||(o[3]=b=>t.variableData.id=b),options:t.usedComponentList,fieldNames:{label:"keyName",value:"id"},"show-search":"","filter-option":t.idFilterOption,style:{"max-width":"180px"},placeholder:"请选择组件",onChange:t.onChangeComponent},null,8,["value","options","filter-option","onChange"])):(e.openBlock(),e.createBlock(s,{key:2,class:"field-name",style:{"max-width":"180px"},value:t.variableData.variableValue,"onUpdate:value":o[4]||(o[4]=b=>t.variableData.variableValue=b),placeholder:"请输入变量值"},null,8,["value"])),t.isDateRangeComponent?(e.openBlock(),e.createBlock(c,{key:3,class:"field-name",value:t.variableData.dateTypeValue,"onUpdate:value":o[5]||(o[5]=b=>t.variableData.dateTypeValue=b),options:t.rangeTypeOptions,placeholder:"请选择取值类型"},null,8,["value","options"])):e.createCommentVNode("",!0),e.createVNode(c,{class:"field-name",value:t.variableData.format,"onUpdate:value":o[6]||(o[6]=b=>t.variableData.format=b),options:t.formatOptions,placeholder:"请选择值格式"},null,8,["value","options"]),t.isShowDateOperate?(e.openBlock(),e.createBlock(C,{key:4,visible:t.popoverVisible,"onUpdate:visible":o[14]||(o[14]=b=>t.popoverVisible=b),trigger:"click",placement:"bottomRight"},{content:e.withCtx(()=>[e.createElementVNode("div",Qb,[e.createVNode(u,{defaultActiveKey:t.variableData.activeOperateKey,onChange:t.changeTab},{default:e.withCtx(()=>[(e.openBlock(),e.createBlock(p,{tab:"日期偏移",key:1},{default:e.withCtx(()=>[e.createVNode(d,{class:"field-name",min:"0",value:t.variableData.operateValue,"onUpdate:value":o[9]||(o[9]=b=>t.variableData.operateValue=b),style:{"max-width":"180px",flex:"auto"}},{addonBefore:e.withCtx(()=>[e.createVNode(c,{value:t.variableData.operateType,"onUpdate:value":o[7]||(o[7]=b=>t.variableData.operateType=b),style:{width:"60px"}},{default:e.withCtx(()=>[e.createVNode(i,{value:"add"},{default:e.withCtx(()=>[e.createTextVNode("加")]),_:1}),e.createVNode(i,{value:"minus"},{default:e.withCtx(()=>[e.createTextVNode("减")]),_:1})]),_:1},8,["value"])]),addonAfter:e.withCtx(()=>[e.createVNode(c,{value:t.variableData.operateMode,"onUpdate:value":o[8]||(o[8]=b=>t.variableData.operateMode=b),style:{width:"60px"}},{default:e.withCtx(()=>[e.createVNode(i,{value:"year"},{default:e.withCtx(()=>[e.createTextVNode("年")]),_:1}),e.createVNode(i,{value:"month"},{default:e.withCtx(()=>[e.createTextVNode("月")]),_:1}),e.createVNode(i,{value:"week"},{default:e.withCtx(()=>[e.createTextVNode("周")]),_:1}),e.createVNode(i,{value:"day"},{default:e.withCtx(()=>[e.createTextVNode("日")]),_:1}),e.createVNode(i,{value:"hour"},{default:e.withCtx(()=>[e.createTextVNode("时")]),_:1}),e.createVNode(i,{value:"minute"},{default:e.withCtx(()=>[e.createTextVNode("分")]),_:1})]),_:1},8,["value"])]),_:1},8,["value"])]),_:1})),t.isDateRangeComponent?(e.openBlock(),e.createBlock(p,{tab:"自定义",key:2},{default:e.withCtx(()=>[e.createElementVNode("div",Jb,[e.createVNode(c,{value:t.variableData.operateValue,"onUpdate:value":o[10]||(o[10]=b=>t.variableData.operateValue=b),allowClear:"",style:{width:"120px","margin-right":"10px"}},{default:e.withCtx(()=>[e.createVNode(i,{value:"rangeValue"},{default:e.withCtx(()=>[e.createTextVNode("范围差值")]),_:1})]),_:1},8,["value"]),e.createVNode(c,{value:t.variableData.operateMode,"onUpdate:value":o[11]||(o[11]=b=>t.variableData.operateMode=b),style:{"margin-right":"10px"}},{default:e.withCtx(()=>[e.createVNode(i,{value:"year"},{default:e.withCtx(()=>[e.createTextVNode("年")]),_:1}),e.createVNode(i,{value:"month"},{default:e.withCtx(()=>[e.createTextVNode("月")]),_:1}),e.createVNode(i,{value:"week"},{default:e.withCtx(()=>[e.createTextVNode("周")]),_:1}),e.createVNode(i,{value:"day"},{default:e.withCtx(()=>[e.createTextVNode("日")]),_:1}),e.createVNode(i,{value:"hour"},{default:e.withCtx(()=>[e.createTextVNode("时")]),_:1}),e.createVNode(i,{value:"minute"},{default:e.withCtx(()=>[e.createTextVNode("分")]),_:1})]),_:1},8,["value"]),e.createVNode(c,{value:t.variableData.operateType,"onUpdate:value":o[12]||(o[12]=b=>t.variableData.operateType=b)},{default:e.withCtx(()=>[e.createVNode(i,{value:"minus"},{default:e.withCtx(()=>[e.createTextVNode("前")]),_:1}),e.createVNode(i,{value:"add"},{default:e.withCtx(()=>[e.createTextVNode("后")]),_:1})]),_:1},8,["value"])])]),_:1})):e.createCommentVNode("",!0)]),_:1},8,["defaultActiveKey","onChange"])])]),default:e.withCtx(()=>[e.createElementVNode("div",{class:"calendar-wrap",onClick:o[13]||(o[13]=b=>{t.popoverVisible=!0})},[e.createVNode(m)])]),_:1},8,["visible"])):e.createCommentVNode("",!0),t.variableData.randomKey?e.createCommentVNode("",!0):(e.openBlock(),e.createBlock(g,{key:5,class:"delete-icon",onClick:t.onDelete},null,8,["onClick"]))])}const ey=ae(qb,[["render",Zb],["__scopeId","data-v-0d77395a"]]),ty=e.defineComponent({name:"VariableGroup",components:{VariableItem:ey},setup(){const t=e.inject(ge),o=e.inject(Ae),n=e.inject(ze),a=e.computed(()=>{var d;return((d=e.unref(t))==null?void 0:d.variableList)||[]}),l=i=>{o({...e.unref(t),variableConditions:ro(i,n),variableList:i})};return{variableList:a,onAddVariable:()=>{const i=ee.cloneDeep(e.unref(a));i.push({keyValue:ye(),variableType:"TEXT",dataType:"",id:null,dateTypeValue:null,format:null,operateType:"add",operateMode:"year",operateValue:0,activeOperateKey:1}),l(i)},onUpdateItem:(i,d)=>{if(d>=0){const p=ee.cloneDeep(e.unref(a));p[d]=i,l(p)}},onDeleteItem:i=>{if(i>=0){const d=ee.cloneDeep(e.unref(a));d.splice(i,1),l(d)}}}}}),wg="",oy={class:"variable-group"},ny={class:"variable-group-header"},ay={class:"variable-group-content"};function ly(t,o,n,a,l,r){const s=e.resolveComponent("a-button"),c=e.resolveComponent("variable-item");return e.openBlock(),e.createElementBlock(e.Fragment,null,[e.createElementVNode("div",oy,[e.createElementVNode("div",ny,[e.createVNode(s,{onClick:t.onAddVariable},{default:e.withCtx(()=>[e.createTextVNode("添加变量")]),_:1},8,["onClick"])])]),e.createElementVNode("div",ay,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(t.variableList,(i,d)=>(e.openBlock(),e.createBlock(c,{key:i.keyValue,item:i,index:d,label:i.label,onUpdate:t.onUpdateItem,onDelete:t.onDeleteItem},null,8,["item","index","label","onUpdate","onDelete"]))),128))])],64)}const ry=ae(ty,[["render",ly],["__scopeId","data-v-fd60cd09"]]),Yr=(t={})=>{const o=(r={})=>{const{label:s,name:c,location:i,show:d,indexCode:p,typeGuid:u}=r;return{label:s,columnName:c,location:i,show:d,calcType:"COLUMN",hrpIndexCode:p,typeGuid:u}},n=r=>{Ye(r,"dataType")&&(r.fieldType==="DATE"&&(r.label=r.fieldName,r.dataType==="component"&&(r.fieldValue="${"+r.fieldValue+"}")),delete r.dataType),Ye(r,"activeKey")&&delete r.activeKey,Ye(r,"radioValue")&&delete r.radioValue},a=r=>{const s=[];return r!=null&&r.length&&r.forEach(c=>{if(c.join&&c.conditions){const i=!c.conditions.some(d=>d.join&&d.conditions);c.conditions.forEach((d,p)=>{n(d),i?p<c.conditions.length-1?s.push({join:c.join,...d}):s.push(d):d.join&&d.conditions?s.push({conditions:a([d]),join:c.join}):s.push(d)})}else n(c),s.push(c)}),s},l=(r={})=>{const{label:s,name:c,location:i,show:d,indexCode:p,calcType:u="COLUMN",builtInFormula:m,builtInValueSource:C,builtInCalcWay:g,formula:b,conditions:f,aggregate:h}=r;let y;return f&&(y=a(f)),{label:s.trim(),columnName:c,location:i,show:d,calcType:u,hrpIndexCode:p,aggregate:h,builtInFormula:m,builtInValueSource:C,builtInCalcWay:g,formula:b,conditions:y}};return async()=>{const{graphicConfig:r,type:s,request:c,isGroupTable:i}=t;let{source:d,dataViewId:p,plugin:u="1",layer:m,chartType:C,classificationList:g=[],seriesList:b=[],leftAxisList:f=[],rightAxisList:h=[],queryColumnList:y=[],indicators:N=[],dataSourceId:w,idxLibMode:x,preview:S=!1,sqlConditions:A=[],rowHeaderList:v=[]}=r||{};m==null&&(ue(s,["table","card"])?m="1":m="2");let D;if(Array.isArray(g)&&g.length>0){const _=g.length;for(let B=0;B<_;B++){const E=g[B]||{},{label:P="",name:I="",show:O=!1,sort:V,customGroup:k,conditions:L,typeGuid:M}=E;if(O||_===1){D={label:P.trim(),columnName:I,show:O,sort:V,customGroup:k,typeGuid:M,conditions:a(L)};break}}}let T;if(Array.isArray(b)&&b.length>0){const _=b.length;for(let B=0;B<_;B++){const E=b[B]||{},{label:P="",name:I="",show:O=!1,sort:V,customGroup:k,conditions:L,typeGuid:M}=E;if(O||_===1){T={label:P.trim(),columnName:I,show:O,sort:V,customGroup:k,conditions:a(L),typeGuid:M};break}}}const R=[];if(Array.isArray(v)&&v.length>0){const _=v.length;for(let B=0;B<_;B++){const E=v[B]||{},{label:P="",name:I="",show:O=!1,sort:V,customGroup:k,conditions:L,typeGuid:M}=E;R.push({typeGuid:M,label:P.trim(),columnName:I,show:O,sort:V,customGroup:k,conditions:a(L)})}}const $=[];y==null||y.forEach(_=>{$.push(o(_))});const F=[];if(f==null||f.forEach(_=>{_.location="LEFT",F.push(l(_))}),h==null||h.forEach(_=>{_.location="RIGHT",F.push(l(_))}),N==null||N.forEach(_=>{_.location="LEFT",F.push(l(_))}),i||s==="card"){if(C="grouptable",F.length===0||R.length===0)return}else{if(m==="1"&&$.length===0)return;if(m==="2"&&F.length===0)return}try{return await c.post(`${Se}/diagram`,{source:d,dataViewId:p,plugin:u,layer:m,chartType:C,classification:D,series:T,indicatorList:F,queryColumns:$,pageFlag:!0,sqlConditions:A,rowHeaders:R,dataSourceId:w,idxLibMode:x,preview:S})}catch(_){console.error(_)}}},iy=e.defineComponent({name:"ChartGraph",components:{ASpin:j.Spin},props:{graphicConfig:{type:Object,default:()=>{}},chartsOptions:{type:Object,default:()=>{}}},setup(t,{expose:o}){const n=e.computed(()=>t.chartsOptions?e.unref(t.chartsOptions):i),a=e.computed(()=>t.graphicConfig?e.unref(t.graphicConfig):c),l=e.inject(Be);let r=null;const s=e.inject(Ve)||"",c=e.inject(ge)||{},i=e.inject(wo)||{},d=e.ref(null),p=e.ref(null),u=e.ref(),m=e.ref(!1),C=e.ref(!1),g=e.computed(()=>C.value?ni:12),b=e.ref({}),f=e.ref(),h=e.computed(()=>{const D=e.unref(n.value);return(D==null?void 0:D.type)==="customGraph"?f.value:ed(D,e.unref(b),g.value)}),y=(D=[],T,R=!1)=>{const $=R?T:null;b.value=Yc(D,$)},N=(D=[],T)=>{b.value=qc(D,T)},w=async()=>{var D,T,R;try{const $=Yr({graphicConfig:e.unref(a.value),type:(D=e.unref(n.value))==null?void 0:D.type,request:l,indicatorToken:s});m.value=!0;const F=await $(),{columns:_=[],rows:B=[]}=((T=F==null?void 0:F.data)==null?void 0:T.data)??{};if(((R=e.unref(n.value))==null?void 0:R.type)==="pie"){let E=[];if(_.length>0){const P=_[0],I=_[1];E=B.map(O=>({name:O[P],value:O[I]}))}N(E)}else{let E;_.length>0&&(E={name:_[0],types:_.slice(1).map(P=>({label:P,value:P}))}),y(B,E,!0)}}catch($){console.error($)}finally{m.value=!1}},x={title:{text:"暂无数据",x:"center",y:"center",textStyle:{fontSize:14,fontWeight:"normal"}}},S=()=>{e.unref(b).dataset.length===0?u.value.setOption(x,!0):u.value.setOption(h.value,!0)},A=()=>{e.unref(n.value).type!=="customGraph"&&w()},v=()=>{var D;(D=u.value)==null||D.resize()};return e.watch(h,()=>{S()},{deep:!0}),e.watch(()=>e.unref(n.value).optionCode,D=>{try{const T=eval;f.value=T(D)}catch(T){console.error(T)}},{immediate:!0}),e.onMounted(()=>{p.value&&(r=new ResizeObserver(v),r.observe(p.value)),u.value=oi.init(d.value)}),e.onBeforeUnmount(()=>{u.value.dispose(),r&&(r.disconnect(),r=null)}),o({refreshData:A}),{echartRef:d,loading:m}}}),kg="",sy={class:"ecan-chart-graph",ref:"chartWrapRef"},cy={style:{width:"100%",height:"100%"},ref:"echartRef"};function dy(t,o,n,a,l,r){const s=e.resolveComponent("a-spin");return e.openBlock(),e.createElementBlock("div",sy,[e.createVNode(s,{spinning:t.loading,wrapperClassName:"chart-spin",tip:"数据加载中..."},{default:e.withCtx(()=>[e.createElementVNode("div",cy,null,512)]),_:1},8,["spinning"])],512)}const qr=ae(iy,[["render",dy],["__scopeId","data-v-845f7ab1"]]),py=e.defineComponent({name:"TableGraph",components:{ATable:j.Table},props:{graphicConfig:{type:Object,default:()=>{}},type:{type:String},pagination:{type:Object,default:()=>({})}},setup(t){const o=e.inject(ve),n=e.ref([]),a=e.ref([]),l=e.inject(Be),r=e.inject(Ve)||"",s=async()=>{var c;try{const d=await Yr({graphicConfig:t.graphicConfig,type:t.type,request:l,indicatorToken:r})(),{columns:p=[],rows:u=[]}=((c=d==null?void 0:d.data)==null?void 0:c.data)??{},m=e.unref(o).columnsConfigMap;a.value=p.map(C=>({title:C,dataIndex:C,label:C,...m[C]})),n.value=u}catch(i){console.error(i)}};return e.watch([()=>t.graphicConfig,()=>e.unref(o).columnsConfigMap],()=>{s()},{deep:!0,immediate:!0}),{tableData:n,tableColumns:a,handleFormat:nd,columnsConfigMap:e.unref(o).columnsConfigMap}}}),uy={key:0};function fy(t,o,n,a,l,r){const s=e.resolveComponent("a-table");return e.openBlock(),e.createBlock(s,{style:{width:"100%"},scroll:{y:280},columns:t.tableColumns,"data-source":t.tableData,size:"small",pagination:t.pagination},{bodyCell:e.withCtx(({column:c,record:i})=>[c.retentiondigit!==void 0?(e.openBlock(),e.createElementBlock("span",uy,e.toDisplayString(t.handleFormat(i,c)),1)):e.createCommentVNode("",!0)]),_:1},8,["columns","data-source","pagination"])}const my=ae(py,[["render",fy]]),hy=e.defineComponent({name:"DataConfig",components:{DataGroup:gf,StyleGroup:Sb,ChartGraph:qr,ATabs:j.Tabs,ATabPane:j.TabPane,ControlGroup:Yb,VariableGroup:ry,AButton:j.Button,ReloadOutlined:cc,TableGraph:my},setup(t,{expose:o}){var P;const n=e.ref(),a=e.ref("1"),l=e.ref([0,1,2]),r=e.ref(),s=e.ref(),c=e.inject(ve),i=e.inject(ua),d=e.inject(ge),p=e.inject(ze),u=e.inject(ga),m=e.inject(Qo),C=e.inject(Ca),g=["text","proportion","select","checkbox","radio","radar","circulate"],b=e.computed(()=>{const I=ee.cloneDeep(e.unref(c));h(I);const O=ee.pick(I,ee.without(Object.keys(I),"position","top","left","width","height"));ue(I.type,g)?(O.height=I.height,O.width=I.width):O.height="290px";const V=ee.cloneDeep(e.unref(d));return V.pageMode="design",V.componentList=p,V.preview=!0,V.pageConfig=u,ue(I.type,"pivottable")&&(e.unref(n)&&(O.height=e.unref(n).$el.clientHeight-20+"px",O.width=e.unref(n).$el.clientWidth+"px"),O.fullMode=!0,V.preview=!1,delete V.pageMode),{...O,graphicConfig:V,toolboxShow:!1,sourceLeft:I.left,sourceTop:I.top}}),f=e.computed(()=>{var L,M;const{token:I,context:O}=e.unref(c),V=(((L=e.unref(s))==null?void 0:L.clientWidth)||0)+"px",k=(((M=e.unref(s))==null?void 0:M.clientHeight)||0)+"px";return{id:e.unref(c).componentId,name:e.unref(c).name,keyName:e.unref(c).keyName,type:"pivotTable",width:V,height:k,graphicConfig:e.unref(c).graphicConfig,dimensionList:e.unref(c).dimensionList||[],fullMode:!0,globalModel:new Map,indicatorUrl:"/api",indicatorToken:I,context:O}});function h(I){var O,V,k,L;["#ffffff","#fff"].includes((O=I==null?void 0:I.color)==null?void 0:O.toLowerCase())&&(I.color="#000"),["#ffffff","#fff"].includes((V=I==null?void 0:I.variableColor)==null?void 0:V.toLowerCase())&&(I.variableColor="#000"),["#ffffff","#fff"].includes((k=I==null?void 0:I.increaseColor)==null?void 0:k.toLowerCase())&&(I.increaseColor="#000"),["#ffffff","#fff"].includes((L=I==null?void 0:I.declineColor)==null?void 0:L.toLowerCase())&&(I.declineColor="#000")}const y=e.computed(()=>{let I=!0;return ue(e.unref(b).type,g)&&(I=!1),I}),N=e.computed(()=>{var I;return(I=e.unref(b))==null?void 0:I.type}),w=e.computed(()=>{var I;return!!((I=e.unref(b))!=null&&I.isGroupTable)}),x=I=>{const O=I==="1";O&&N.value==="table"&&$(),window.changeShowTable&&window.changeShowTable(O),I==="3"&&T()},S=e.ref([]),A=e.inject(Be),v=e.unref(e.inject(Ve)),D=(P=window==null?void 0:window.config)==null?void 0:P.pageId;function T(){var z;const{leftAxisList:I=[],rightAxisList:O=[],queryColumnList:V=[],indicators:k=[],dataSourceId:L=""}=e.unref(d),M=[...I,...O,...V,...k],U={};for(const q of M){const{id:X="",indexCode:J=""}=q;X&&!Ye(q,"calcType")&&!U[X]&&(U[X]=J)}if((z=Object.keys(U))!=null&&z.length){const q=[];for(const X in U)q.push(new Promise((J,oe)=>{A.post(`${Se}/diagram/hrpIndexWithComplex`,{pageId:D,indexGuid:X,indexCode:U[X],dataSourceId:L},{headers:{Authentication:v,operateContext:"ygt"}}).then(le=>{var we;const{success:Ce,data:ie=[]}=le.data;Ce&&((we=ie==null?void 0:ie.dataViewColumns)!=null&&we.length)?J(ie.dataViewColumns):oe(ie)}).catch(le=>{oe(le)})}));Promise.all(q).then(X=>{if(X!=null&&X.length){const J=X.reduce((oe,le)=>oe.filter(Ce=>le.find(ie=>ie.typeGuid===Ce.typeGuid)));R(J.filter(oe=>oe.typeGuid))}})}else R([])}function R(I){var Ce;const{classificationList:O=[],seriesList:V=[],leftAxisList:k=[],rightAxisList:L=[],indicators:M=[],rowHeaderList:U=[],queryColumnList:z=[]}=e.unref(d),q=ee.cloneDeep([...O,...V,...k,...L,...M,...U,...z]);if(q!=null&&q.length)for(const ie of q)ie.id=ie.name;const X=[{label:"日期(内置)",name:"日期(内置)",id:"the_date",genericType:"DATE",typeGuid:"the_date",indexCode:null},{label:"单位编号(内置)",name:"单位编号(内置)",id:"hbdwbh",genericType:"TEXT",typeGuid:"hbdwbh",indexCode:null},{label:"单位名称(内置)",name:"单位名称(内置)",id:"hbdwbh_name",genericType:"TEXT",typeGuid:"hbdwbh_name",indexCode:null},{label:"年(内置)",name:"年(内置)",id:"the_year",genericType:"TEXT",typeGuid:"the_year",indexCode:null},{label:"月(内置)",name:"月(内置)",id:"the_month",genericType:"TEXT",typeGuid:"the_month",indexCode:null},{label:"日(内置)",name:"日(内置)",id:"the_day",genericType:"TEXT",typeGuid:"the_day",indexCode:null},...I.map(ie=>({...ie,id:ie.name,label:ie.title||ie.label})),...q];if(((Ce=e.unref(c))==null?void 0:Ce.type)==="ecanSelect"){const{selectFieldOptions:ie=[]}=e.unref(d);if(X.unshift({label:"上级编码",name:"上级编码",id:"parentCode",genericType:"TEXT"}),ie!=null&&ie.length)for(const we of ie)X.unshift({label:we.label,name:we.value,id:we.value,genericType:"TEXT"})}const J=new Map,oe=X.length;for(let ie=0;ie<oe;ie++){const we=X[ie],{id:at}=we||{};J.set(at,we)}const le=[...J];S.value=le.map(([ie,we])=>we)}const $=()=>{var O;let I;i&&N.value==="table"?I=window.updateConfig:I=(O=e.unref(r))==null?void 0:O.refreshData,typeof I=="function"&&I()},F=e.inject(Ae),_=()=>{var I;F({variableConditions:ro(((I=e.unref(d))==null?void 0:I.variableList)||[],p)})};e.provide(fa,$),e.watch(d,()=>{$()},{deep:!0,flush:"post"}),e.onMounted(()=>{m.value&&$()});const B=()=>e.unref(r).getSaveData(),E=({type:I,data:O})=>{if(I==="10"){const{dimensions:V,indicators:k}=ee.cloneDeep(O),L=[];if(V){for(const M of V)M.showTitle&&(M.label=M.showTitle),L.push({key:M.name,label:M.showTitle,width:null,position:M.positionType||"rows"});for(const M of k)M.showTitle&&(M.label=M.showTitle)}F({dimensionList:L,queryColumnList:V,indicators:k}),b.value.dimensionList=L}};return o({getSaveData:B}),{isShowStyleConfig:i,activeKey:a,activePanel:l,componentRef:r,pivotTableWrapRef:s,type:N,isGroupTable:w,isPivotTable:m,isIframeMode:C,component:b,fullWidth:y,renderUsedComponents:p,conditionOptions:S,tableProps:f,dataConfigPaneRef:n,refreshData:$,refreshAction:_,onChange:x,onPivotTableChange:E}}}),xg="",by={key:0,class:"ecan-pivot-table",ref:"pivotTableWrapRef"},yy={key:0,id:"table-wrap",class:"chart-component",ref:"tableWrapRef",style:{width:"100%",height:"290px"}};function gy(t,o,n,a,l,r){const s=e.resolveComponent("pivot-table"),c=e.resolveComponent("data-group"),i=e.resolveComponent("a-tab-pane"),d=e.resolveComponent("style-group"),p=e.resolveComponent("control-group"),u=e.resolveComponent("variable-group"),m=e.resolveComponent("reload-outlined"),C=e.resolveComponent("a-button"),g=e.resolveComponent("a-tabs"),b=e.resolveComponent("table-graph"),f=e.resolveComponent("chart-graph");return e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(["data-config",t.isPivotTable?"pivot-table-wrap":""])},[e.createVNode(g,{activeKey:t.activeKey,"onUpdate:activeKey":o[0]||(o[0]=h=>t.activeKey=h),onChange:t.onChange},{rightExtra:e.withCtx(()=>[e.createVNode(C,{onClick:t.refreshAction},{icon:e.withCtx(()=>[e.createVNode(m)]),default:e.withCtx(()=>[e.createTextVNode(" 刷新 ")]),_:1},8,["onClick"])]),default:e.withCtx(()=>[e.createVNode(i,{key:"1",tab:"数据配置",ref:"dataConfigPaneRef"},{default:e.withCtx(()=>[t.isPivotTable&&t.isIframeMode?(e.openBlock(),e.createElementBlock("div",by,[e.createVNode(s,e.mergeProps({ref:"componentRef"},t.tableProps),null,16)],512)):(e.openBlock(),e.createElementBlock(e.Fragment,{key:1},[t.isPivotTable?e.createCommentVNode("",!0):(e.openBlock(),e.createBlock(c,{key:0,ref:"dataGroupRef"},null,512)),t.isShowStyleConfig?e.createCommentVNode("",!0):(e.openBlock(),e.createBlock(e.resolveDynamicComponent(t.type),e.mergeProps({key:1,class:["chart-component",t.fullWidth?"full-width":""]},t.component,{ref:"componentRef",onTableChange:t.onPivotTableChange}),null,16,["class","onTableChange"]))],64))]),_:1},512),t.isShowStyleConfig?(e.openBlock(),e.createBlock(i,{key:"2",tab:"样式配置","force-render":""},{default:e.withCtx(()=>[e.createVNode(d,{componentType:t.type,isGroupTable:t.isGroupTable},null,8,["componentType","isGroupTable"])]),_:1})):e.createCommentVNode("",!0),(!t.isIframeMode||t.isPivotTable)&&t.renderUsedComponents?(e.openBlock(),e.createBlock(i,{key:"3",tab:"全局过滤","force-render":""},{default:e.withCtx(()=>[e.createVNode(p,{ref:"controlGroup",conditionOptions:t.conditionOptions},null,8,["conditionOptions"])]),_:1})):e.createCommentVNode("",!0),t.isIframeMode?e.createCommentVNode("",!0):(e.openBlock(),e.createBlock(i,{key:"4",tab:"全局变量","force-render":""},{default:e.withCtx(()=>[e.createVNode(u)]),_:1}))]),_:1},8,["activeKey","onChange"]),t.isShowStyleConfig&&!t.isPivotTable?(e.openBlock(),e.createElementBlock(e.Fragment,{key:0},[t.type==="table"&&t.activeKey==="1"?(e.openBlock(),e.createElementBlock("div",yy,null,512)):t.type==="card"?e.withDirectives((e.openBlock(),e.createBlock(b,e.mergeProps({key:1,class:"chart-component"},t.component),null,16)),[[e.vShow,t.activeKey==="1"]]):e.withDirectives((e.openBlock(),e.createBlock(f,{key:2,class:e.normalizeClass(["chart-component",t.fullWidth?"full-width":""]),ref:"componentRef",style:{width:"100%",height:"290px"}},null,8,["class"])),[[e.vShow,t.activeKey==="1"]])],64)):e.createCommentVNode("",!0)],2)}const Cy=ae(hy,[["render",gy],["__scopeId","data-v-41131686"]]),wy=e.defineComponent({name:"IndicatorLibrary",components:{DataList:Dd,DataConfig:Cy},props:{isShowStyleConfig:{type:Boolean,default:!1},sourceType:{type:String,default:""},indicatorToken:{type:String,default:""},selectedComponent:{type:Object,default:()=>{}},request:{default:null},renderUsedComponentList:{type:Array,default:()=>[]},mapAttributeProps:{type:Object,default:()=>({startTime:{label:"开始时间值",component:"time-pick"},endTime:{label:"结束时间值",component:"time-pick"}})},pageConfig:{type:Object,default:()=>{}},isIframeMode:{type:Boolean,default:!1}},setup(t,{expose:o,emit:n}){const a=e.ref(),l=e.ref(!1),r=e.computed(()=>t.sourceType),s=e.computed(()=>t.indicatorToken||""),c=e.computed(()=>t.selectedComponent),i=e.computed(()=>t.renderUsedComponentList),d=e.computed(()=>{var T;return((T=e.unref(c))==null?void 0:T.tableColumns)||[]}),p=e.computed(()=>t.isShowStyleConfig),u=e.computed(()=>{var T,R;return(R=(T=e.unref(c))==null?void 0:T.type)==null?void 0:R.includes("PivotTable")});let m=e.unref(c).graphicConfig?ee.cloneDeep(e.unref(c).graphicConfig):e.ref({});m=e.ref(m);let C=e.unref(c).chartsOptions?ee.cloneDeep(e.unref(c).chartsOptions):e.ref(ee.cloneDeep(Jo.line));C=e.ref(C);let g=e.unref(c).tableOptions?ee.cloneDeep(e.unref(c).tableOptions):e.ref(ee.cloneDeep(ai));g=e.ref(g);const b=e.ref([]),f=T=>{b.value=T},h=T=>{m.value={...e.unref(m),...e.unref(T)}},y=(T,R=!0)=>{R?C.value={...e.unref(C),...e.unref(T)}:C.value={...e.unref(T)}},N=T=>{g.value={...e.unref(g),...e.unref(T)}},w=()=>b,x=()=>{l.value=!0,e.unref(c).graphicConfig&&(m.value=ee.cloneDeep(e.unref(c).graphicConfig)),e.unref(c).chartsOptions&&(C.value=ee.cloneDeep(e.unref(c).chartsOptions||Jo.line)),e.nextTick(()=>{l.value=!1})},S=()=>({graphicConfig:e.unref(m),chartsOptions:e.unref(C),tableOptions:e.unref(g),tableColumns:e.unref(d),columnsConfigMap:e.unref(c).columnsConfigMap}),A=()=>({...e.unref(a).getSaveData(),graphicConfig:e.unref(m)});window.getIndicatorData=S,window.getPivotGraphicData=A,t.request&&e.provide(Be,t.request),e.provide(pa,{setDataList:f,getDataList:w});const v=T=>{n("updateUsedComponent",T)},D=(T,R)=>{n("updateComponentsConfig",T,{controlList:R})};return e.provide(Qo,u),e.provide(Ca,t.isIframeMode),e.provide(ve,c),e.provide(ge,m),e.provide(wo,C),e.provide(ma,g),e.provide(Kt,r),e.provide(ua,p),e.provide(Ve,s),e.provide(Ae,h),e.provide(Ko,y),e.provide(Xo,N),e.provide(ze,i),e.provide(xo,v),e.provide(ba,D),e.provide(ya,t.mapAttributeProps),e.provide(ga,t.pageConfig),o({graphicConfig:m,chartsOptions:C,updateIndicatorData:x}),{isUpdate:l,isPivotTable:u,dataConfigRef:a}}}),_g="",ky={key:0,class:"config-modal"},xy={key:0,class:"config-modal-left"};function _y(t,o,n,a,l,r){const s=e.resolveComponent("data-list"),c=e.resolveComponent("data-config");return t.isUpdate?e.createCommentVNode("",!0):(e.openBlock(),e.createElementBlock("div",ky,[t.isPivotTable?e.createCommentVNode("",!0):(e.openBlock(),e.createElementBlock("div",xy,[e.createVNode(s)])),e.createElementVNode("div",{class:e.normalizeClass(["config-modal-right",t.isPivotTable?"full":""])},[e.createVNode(c,{ref:"dataConfigRef"},null,512)],2)]))}const Kr=da(ae(wy,[["render",_y],["__scopeId","data-v-e77110fb"]])),Xr=da(qr),Qr=Object.freeze(Object.defineProperty({__proto__:null,EcanChartGraph:Xr,EcanIndicatorLibrary:Kr},Symbol.toStringTag,{value:"Module"})),Sy={install:(t,o)=>{const{request:n}=o;t.provide("$request",n),Object.keys(Qr).forEach(a=>{const l=Qr[a];l.install&&t.use(l)})}};he.EcanChartGraph=Xr,he.EcanIndicatorLibrary=Kr,he.default=Sy,Object.defineProperties(he,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}})});
|
|
75
75
|
//# sourceMappingURL=index.umd.js.map
|