ace-component-lib 0.0.18 → 0.0.19
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/ace-component-lib.umd.js +1 -1
- package/dist/style.css +1 -1
- package/package.json +1 -1
|
@@ -875,7 +875,7 @@ ${u} div ,${u} span,${u} a,${u} * {
|
|
|
875
875
|
<body>
|
|
876
876
|
${(y=document.getElementById("preview-content"))==null?void 0:y.innerHTML}
|
|
877
877
|
</body>
|
|
878
|
-
</html>`,m=new Blob([h],{type:"application/msword;charset=utf-8"});JD.saveAs(m,`${e.unref(s).filename}.doc`),l.value=!1},f=e.ref(""),u=async()=>{await new Promise(async h=>{var m;f.value=document.title,document.title=e.unref(s).filename,(m=document.getElementById("printButton"))==null||m.click(),l.value=!1,h(!0)})};return r({init:async(h,m)=>{const y=E.ElLoading.service({lock:!0,text:"数据处理中",background:"rgba(0, 0, 0, 1)",customClass:"preview-loading"});s.value={type:h,content:m.reportContent,filename:m.reportName},await new Promise(b=>{setTimeout(()=>{l.value=!0,b(!0)},100)});const g=[];e.nextTick(async()=>{const b=document.getElementById("preview-content");(function v(V){V.forEach($=>{g.push($),$.childNodes&&v($.childNodes)})})(b.childNodes);const w=await De(n).listIndicatorsApply({reportId:m.id},!1),_=g.filter(v=>v.className==="editor-indicator"),C=[...new Set(_.map(v=>v.dataset.id))],S=await De(n).mapEchartsData(C.toString(),!1),x=[];for(let v=0;v<_.length;v+=1){const V=_[v],$=w.data.find(T=>T.id==V.dataset.id);if(V.dataset.charttype==7){$.indicatorsType=="MODEL_INDICATORS"?(await o($.indicatorsId??$.id,$.echartsType,$.formConfJson),_[v].innerHTML=a(_[v].getAttribute("data-singleValueKey"))):_[v].innerHTML=S.data[V.dataset.id].config;const T=_[v].getAttribute("data-fontsize"),z=_[v].getAttribute("data-bold"),O=_[v].getAttribute("data-color");T&&(_[v].style.fontSize=T),z&&(_[v].style.fontWeight=z=="true"?"bold":"normal"),O&&(_[v].style.color=O)}else{const T=_[v].getAttribute("data-width")||400;let z=i(($==null?void 0:$.coverUrl)||_[v].getAttribute("data-src"));if(x.includes(z))continue;z&&await new Promise(O=>{const N=new Image;N.src=z,N.crossOrigin="anonymous",N.onload=()=>{const k=document.createElement("canvas");k.width=N.width,k.height=N.height,k.getContext("2d").drawImage(N,0,0,N.width,N.height),x.push(z),z=k.toDataURL("image/png"),O(!0)},N.onerror=()=>{O(!0)}}),_[v].innerHTML=`<img width=${T} src="${z}" crossorigin="anonymous" />`}}h==="DOWNLOAD_WORD"&&c(),h==="DOWNLOAD_PDF"&&await u(),setTimeout(()=>y.close(),100)})}}),(h,m)=>{const y=e.resolveComponent("AppDrawer"),g=e.resolveDirective("print");return e.openBlock(),e.createBlock(y,{modelValue:e.unref(l),"onUpdate:modelValue":m[1]||(m[1]=b=>e.isRef(l)?l.value=b:null),withHeader:!1,size:"100%"},{default:e.withCtx(()=>[e.createElementVNode("div",{id:"preview-content",class:e.normalizeClass(e.unref(s).type),innerHTML:e.unref(s).content},null,10,KD),e.createElementVNode("i",{class:"ri-close-line ri-2x fixed right-5 top-5 text-color-danger cursor-pointer",onClick:m[0]||(m[0]=b=>l.value=!1)}),e.unref(s).type=="DOWNLOAD_PDF"?e.withDirectives((e.openBlock(),e.createBlock(e.unref(E.ElButton),{key:0,id:"printButton",type:"primary"},{default:e.withCtx(()=>[e.createTextVNode(" 导出PDF ")]),_:1})),[[g,e.unref(d)]]):e.createCommentVNode("",!0)]),_:1},8,["modelValue"])}}}),$R="",ZD={class:"mt-3"},QD={class:"mt-3"},eB={class:"menu-title"},tB={key:0,class:"badge"},rB=e.defineComponent({__name:"designLeft",emits:["click","success"],setup(t,{expose:r,emit:n}){const o=e.ref([]),a=e.ref(""),i=n,{proxy:l}=e.getCurrentInstance();De(l).listReportIndicatorsMenu({}).then(f=>{o.value=Object.keys(f.data).map(u=>({name:u,children:f.data[u]})),i("success")});const s=(f,u)=>{i("click",f,u)},d=f=>{f.id&&s("add",f)},c=(f,u)=>f?u.name.includes(f):!0;return r({list:o}),(f,u)=>{const p=e.resolveComponent("AppHeader");return e.openBlock(),e.createElementBlock(e.Fragment,null,[e.createVNode(p,{title:"指标库"}),e.createElementVNode("div",ZD,[e.createVNode(e.unref(E.ElInput),{modelValue:e.unref(a),"onUpdate:modelValue":u[0]||(u[0]=h=>e.isRef(a)?a.value=h:null),placeholder:"请输入指标名称"},null,8,["modelValue"])]),e.createElementVNode("div",QD,[e.createVNode(e.unref(E.ElTree),{ref:"tree",data:e.unref(o),"default-expand-all":"","highlight-current":!0,"filter-node-method":c,indent:0,onNodeClick:d},{default:e.withCtx(({node:h,data:m})=>[e.createElementVNode("div",eB,[m.count?(e.openBlock(),e.createElementBlock("span",tB,[e.createTextVNode(e.toDisplayString(m.title||m.name)+" ",1),e.createElementVNode("span",null,e.toDisplayString(m.count),1)])):(e.openBlock(),e.createElementBlock("span",{key:1,class:e.normalizeClass({"font-bold":h.level==1})},e.toDisplayString(m.title||m.name),3)),m.children?e.createCommentVNode("",!0):(e.openBlock(),e.createBlock(e.unref(E.ElLink),{key:2,type:"primary",onClick:e.withModifiers(y=>s("add",m),["stop"])},{default:e.withCtx(()=>[e.createTextVNode(" 配置 ")]),_:2},1032,["onClick"]))])]),_:1},8,["data"])])],64)}}}),DR="",nB=Be(rB,[["__scopeId","data-v-07266c39"]]),_r=t=>(e.pushScopeId("data-v-884e5eeb"),t=t(),e.popScopeId(),t),oB={class:"p-3 overflow-hidden h-full w-full flex-col flex items-start"},aB={class:"mt-3 mb-3 flex items-center whitespace-nowrap w-full"},iB=_r(()=>e.createElementVNode("span",{class:"mr-3"},"报告名称:",-1)),lB={class:"w-80"},sB={class:"flex-1 items-center justify-end flex"},cB=_r(()=>e.createElementVNode("i",{class:"ri-book-open-line mr-2"},null,-1)),dB=_r(()=>e.createElementVNode("i",{class:"ri-file-pdf-line ml-3 mr-2"},null,-1)),fB=_r(()=>e.createElementVNode("i",{class:"ri-file-word-line ml-3 mr-2"},null,-1)),uB={class:"editor flex-1 w-full h-full overflow-hidden relative",style:{border:"1px solid #eee"}},pB={key:0,class:"indicator-toolbar"},hB=_r(()=>e.createElementVNode("span",{class:"mr-2"},"字体大小:",-1)),mB=_r(()=>e.createElementVNode("span",{class:"ml-2 mr-2 text-color-info"},"|",-1)),gB=_r(()=>e.createElementVNode("span",{class:"ml-2"},"加粗:",-1)),yB={class:"ml-2 cursor-pointer"},bB=_r(()=>e.createElementVNode("span",{class:"ml-2 mr-2 text-color-info"},"|",-1)),_B=_r(()=>e.createElementVNode("span",{class:"ml-2"},"字体颜色:",-1)),wB={class:"ml-2"},um="simple",CB=e.defineComponent({__name:"designMain",props:{reportObj:{default:{}},editorRef:{default:null},modelValue:{default:""}},emits:["update:modelValue","editor-success"],setup(t,{emit:r}){const n=t,o=r,{proxy:a}=e.getCurrentInstance(),i=e.ref({fontSize:"",bold:!1,color:""}),l=e.ref({}),s=[{value:"12px"},{value:"14px"},{value:"16px"},{value:"18px"},{value:"20px"},{value:"22px"},{value:"24px"}],d={excludeKeys:["code","codeSelectLang","codeBlock","insertVideo","uploadVideo","editVideoSize","insertImage","header3","fullScreen"],insertKeys:{index:5,keys:["fontSize"]}},c={placeholder:"请输入内容...",EXTEND_CONF:{indicatorConfig:{clickIndicator:(p,h)=>{o("update:modelValue",p),l.value=h,i.value={fontSize:h.fontSize,bold:h.bold=="true",color:h.color||""};const m=document.getElementById(p);m&&(document.getElementById("useReportcontainer").scrollTop=m.offsetTop-20)}}}},f=(p,h)=>{const m={[p]:String(h)};tt.SlateTransforms.setNodes(n.editorRef,m,{at:tt.DomEditor.findPath(n.editorRef,e.unref(l))})},u=p=>{o("editor-success",p)};return(p,h)=>{var y;const m=e.resolveComponent("AppHeader");return e.openBlock(),e.createElementBlock("div",oB,[e.createVNode(m,{title:"指标报告撰写",class:"w-full"},{default:e.withCtx(()=>[e.renderSlot(p.$slots,"default",{},void 0,!0)]),_:3}),e.createElementVNode("div",aB,[iB,e.createElementVNode("div",lB,[e.createVNode(e.unref(E.ElInput),{modelValue:p.reportObj.reportName,"onUpdate:modelValue":h[0]||(h[0]=g=>p.reportObj.reportName=g),placeholder:"请输入报告名称"},null,8,["modelValue"])]),e.createElementVNode("div",sB,[e.createVNode(e.unref(E.ElLink),{type:"primary",onClick:h[1]||(h[1]=g=>e.unref(a).$baseEventBus.emit("editor","PREVIEW"))},{default:e.withCtx(()=>[cB,e.createTextVNode(" 预览 ")]),_:1}),e.createVNode(e.unref(E.ElLink),{type:"primary",onClick:h[2]||(h[2]=g=>e.unref(a).$baseEventBus.emit("editor","DOWNLOAD_PDF"))},{default:e.withCtx(()=>[dB,e.createTextVNode(" 导出pdf ")]),_:1}),e.createVNode(e.unref(E.ElLink),{type:"primary",onClick:h[3]||(h[3]=g=>e.unref(a).$baseEventBus.emit("editor","DOWNLOAD_WORD"))},{default:e.withCtx(()=>[fB,e.createTextVNode(" 导出word ")]),_:1})])]),e.createElementVNode("div",uB,[e.createVNode(e.unref(sc.Toolbar),{class:"w-full",editor:p.editorRef,defaultConfig:d,mode:um},null,8,["editor"]),e.createVNode(e.unref(sc.Editor),{style:{height:"90%","overflow-y":"hidden","border-top":"1px solid #eee"},modelValue:p.reportObj.reportContent,"onUpdate:modelValue":h[4]||(h[4]=g=>p.reportObj.reportContent=g),defaultConfig:c,mode:um,onOnCreated:u},null,8,["modelValue"]),p.modelValue&&((y=e.unref(l))==null?void 0:y.chartType)=="7"?(e.openBlock(),e.createElementBlock("div",pB,[hB,e.createVNode(e.unref(E.ElSelect),{size:"small",style:{width:"80px"},modelValue:e.unref(i).fontSize,"onUpdate:modelValue":h[5]||(h[5]=g=>e.unref(i).fontSize=g),teleported:!1,clearable:!1,onChange:h[6]||(h[6]=g=>f("fontSize",g))},{default:e.withCtx(()=>[(e.openBlock(),e.createElementBlock(e.Fragment,null,e.renderList(s,g=>e.createVNode(e.unref(E.ElOption),{label:g.value,value:g.value,key:g.value},null,8,["label","value"])),64))]),_:1},8,["modelValue"]),mB,gB,e.createElementVNode("div",yB,[e.createVNode(e.unref(E.ElRadioGroup),{modelValue:e.unref(i).bold,"onUpdate:modelValue":h[7]||(h[7]=g=>e.unref(i).bold=g),onChange:h[8]||(h[8]=g=>f("bold",g))},{default:e.withCtx(()=>[e.createVNode(e.unref(E.ElRadio),{value:!0,label:!0},{default:e.withCtx(()=>[e.createTextVNode("是")]),_:1}),e.createVNode(e.unref(E.ElRadio),{value:!1,label:!0},{default:e.withCtx(()=>[e.createTextVNode("否")]),_:1})]),_:1},8,["modelValue"])]),bB,_B,e.createElementVNode("div",wB,[e.createVNode(e.unref(E.ElColorPicker),{predefine:e.unref(a).$globalPreColor,onChange:h[9]||(h[9]=g=>f("color",g)),modelValue:e.unref(i).color,"onUpdate:modelValue":h[10]||(h[10]=g=>e.unref(i).color=g)},null,8,["predefine","modelValue"])])])):e.createCommentVNode("",!0)])])}}}),BR="",SB=Be(CB,[["__scopeId","data-v-884e5eeb"]]),xB={class:"mt-3"},vB=["id"],EB={class:"flex justify-between"},VB={class:"title"},kB=["onClick"],NB=["onClick"],$B={class:"text-color-warning text-xs mt-3"},DB=e.defineComponent({__name:"designRight",props:{reportObj:{default:{}},editorRef:{default:null},indicatorsId:{default:""}},emits:["click","success"],setup(t,{expose:r,emit:n}){const o=t,{proxy:a}=e.getCurrentInstance(),{getModelIndicatorsData:i,setSingleValue:l}=mt(),s=n,d=e.ref([]),c=e.ref(!0),f=async()=>{c.value=!0;const p=await De(a).listIndicatorsApply({reportId:o.reportObj.id},!1);d.value=p.data,c.value=!1,s("success"),e.nextTick(()=>{(async function h(m){for(let y=0;y<m.length;y+=1){const g=m[y];if(g.type=="indicator"){const b=p.data.find(_=>_.id==g.id);if(!b)return;const w={subtitle:b.title,content:b.indicatorsName};b.coverUrl&&(w.src=w$(b.coverUrl)),b.echartsType=="7"&&(b.indicatorsType=="MODEL_INDICATORS"?(await i(b.indicatorsId??b.id,b.echartsType,b.formConfJson),w.singleValue=l(g.singleValueKey??"")):w.singleValue=b.singleValue),tt.SlateTransforms.setNodes(o.editorRef,w,{at:tt.DomEditor.findPath(o.editorRef,g)})}g.children&&await h(g.children)}})(o.editorRef.children)})},u=async(p,h)=>{s("click",p,h)};return f(),r({init:f,list:d}),(p,h)=>{const m=e.resolveComponent("AppHeader");return e.openBlock(),e.createElementBlock(e.Fragment,null,[e.createVNode(m,{title:"指标使用库"}),e.createElementVNode("div",xB,[e.createVNode(e.unref(E.ElSkeleton),{loading:e.unref(c),animated:""},{default:e.withCtx(()=>[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(e.unref(d),y=>(e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(["item",{active:p.indicatorsId==y.id}]),id:y.id,key:y.id},[e.createElementVNode("div",EB,[e.createVNode(e.unref(E.ElTooltip),{effect:"dark",content:y.indicatorsName,placement:"bottom"},{default:e.withCtx(()=>[e.createElementVNode("div",VB,e.toDisplayString(y.indicatorsName),1)]),_:2},1032,["content"]),e.createElementVNode("div",null,[e.createElementVNode("button",{onClick:e.withModifiers(g=>u("edit",y),["stop"])},"编辑",8,kB),e.createElementVNode("button",{onClick:e.withModifiers(g=>u("insert",y),["stop"])},"插入光标",8,NB)])]),e.createElementVNode("div",$B,e.toDisplayString(y.title),1)],10,vB))),128))]),_:1},8,["loading"])])],64)}}}),TR="",BB=Be(DB,[["__scopeId","data-v-83f04927"]]),TB=e.defineComponent({__name:"designForm",props:{reportObj:{default:{}}},emits:["success"],setup(t,{expose:r,emit:n}){const o=t,a=Re(),{proxy:i}=e.getCurrentInstance(),{dynamicSearchForm:l,dynamicSearchFormat:s,dynamicSearchParams:d,dynamicSearchParamsTitle:c}=i.$globalHooks.useDynamicSearch(),{base64ToBlob:f,chartJsonFormat:u,echartsTypeList:p}=i.$globalUtils,h=n,{option:m,formatChart:y}=mt(),g=e.ref(!1),b=e.ref(""),w=e.ref(null),_=e.ref(""),C=e.ref(""),S=e.ref([]),x=e.ref({}),v=e.ref({type:"",value:""}),V=e.ref(!1),$=async()=>{if(V.value=!0,e.unref(T)=="MODEL_INDICATORS"){a.getChartData.params.params=d(l.value);const k=e.unref(z).find(D=>D.type==e.unref(_));await y(k==null?void 0:k.code),V.value=!1,e.unref(v).type=_.value,e.unref(v).value=m.value}else{const k=d(e.unref(l)),D=await De(i).pullEchartsDataVO({indicatorsId:e.unref(x).indicatorsId??e.unref(x).id,params:k,echartsType:e.unref(_),targetClient:"WEB"});if(!D)return;V.value=!1,e.unref(v).type=_.value;try{e.unref(v).value=u(D.data.config)}catch{e.unref(v).value=D.data.config}}},T=e.ref(""),z=e.ref({}),O=async(k,D)=>{var R,I;C.value=k,S.value=[];let B;if(T.value=D.indicatorsType??D.type??"INDICATORS",e.unref(T)=="MODEL_INDICATORS"){B=await i.$baseHttp.get(`/api/ace-data-center/model-indicators/detail?id=${D.indicatorsId??D.id}`);const M=JSON.parse(B.data.sortArgsJson??"{}"),j=Object.keys(e.unref(M)).map(F=>({field:F,type:M[F]=="ascending"?"asc":"desc"}));a.setChartData({x:JSON.parse(B.data.groupArgsJson),y:JSON.parse(B.data.aggArgsJson),params:{aggArgsJson:B.data.aggArgsJson,groupArgsJson:B.data.groupArgsJson,sortArgsJson:JSON.stringify(j),modelIndicatorsId:D.indicatorsId??D.id,params:d(s(JSON.parse(D.formConfJson??((R=e.unref(B))==null?void 0:R.formConfJson)??"[]"))),pageSize:B.data.pageSize,modelId:B.data.modelId}})}else B=await De(i).getIndicatorsPanelConf(D.indicatorsId??D.id);B&&(g.value=!0,x.value=D,e.unref(T)=="MODEL_INDICATORS"?(z.value=B.data.echarts,S.value=B.data.echarts.map(M=>M.type)):S.value=B.data.views,_.value=k=="add"?S.value[0]:D.echartsType,b.value=D.indicatorsName??D.name,l.value=k=="add"?s(JSON.parse(((I=B.data)==null?void 0:I.formConfJson)??"[]")):JSON.parse(D.formConfJson),$())},N=async()=>{var R;const k=e.unref(w).$refs.echart;if(k&&!k.getDataURL()){i.$message.warning("图片未生成完毕,请重新保存");return}const D={echartsType:e.unref(v).type,indicatorsId:e.unref(x).indicatorsId??e.unref(x).id,reportId:o.reportObj.id,paramsJson:JSON.stringify(d(e.unref(l))),formConfJson:JSON.stringify(e.unref(l)),title:`${(R=p[e.unref(_)])==null?void 0:R.name} ${c({showTitle:!1})}`,indicatorsType:e.unref(T)};if(e.unref(C)=="edit"&&(D.id=e.unref(x).id),!!await De(i).saveIndicatorsApply(D)){if(e.unref(C)=="edit"&&k){const I=E.ElLoading.service({lock:!0,text:"数据处理中",background:"rgba(0, 0, 0, 0.7)",customClass:"ajax-loading"});await new Promise(M=>{e.nextTick(async()=>{const j=f(k.getDataURL());await De(i).updateIndicatorsApplyImage(j,D.id),M(!0)})}),I.close()}i.$message.success("操作成功"),g.value=!1,h("success")}};return r({init:O}),(k,D)=>{const B=e.resolveComponent("AppDynamicSearch"),R=e.resolveComponent("AppChart"),I=e.resolveComponent("AppDrawer");return e.openBlock(),e.createBlock(I,{modelValue:e.unref(g),"onUpdate:modelValue":D[2]||(D[2]=M=>e.isRef(g)?g.value=M:null),title:e.unref(b),size:"632px"},{footer:e.withCtx(()=>[e.createVNode(e.unref(E.ElButton),{class:"ml-3",type:"primary",onClick:N},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(C)=="add"?"生成报告使用指标":"完成"),1)]),_:1}),e.createVNode(e.unref(E.ElButton),{class:"ml-3",onClick:D[1]||(D[1]=M=>g.value=!1)},{default:e.withCtx(()=>[e.createTextVNode("取消")]),_:1})]),default:e.withCtx(()=>[e.unref(l).length>0?(e.openBlock(),e.createBlock(B,{key:0,form:e.unref(l),onSuccess:$},null,8,["form"])):e.createCommentVNode("",!0),e.createVNode(e.unref(E.ElRadioGroup),{onChange:$,modelValue:e.unref(_),"onUpdate:modelValue":D[0]||(D[0]=M=>e.isRef(_)?_.value=M:null),class:"mb-2"},{default:e.withCtx(()=>[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(e.unref(S),M=>(e.openBlock(),e.createBlock(e.unref(E.ElRadio),{key:M,value:M,label:M,class:"mr-3"},{default:e.withCtx(()=>{var j;return[e.createTextVNode(e.toDisplayString((j=e.unref(p)[M])==null?void 0:j.name),1)]}),_:2},1032,["value","label"]))),128))]),_:1},8,["modelValue"]),e.createVNode(R,{ref_key:"appChartRef",ref:w,type:e.unref(v).type,options:e.unref(v).value,loading:e.unref(V)},null,8,["type","options","loading"])]),_:1},8,["modelValue","title"])}}}),OB={key:0,class:"chart"},IB=e.defineComponent({__name:"design",emits:["success"],setup(t,{expose:r,emit:n}){const{proxy:o}=e.getCurrentInstance(),{base64ToBlob:a,chartJsonFormat:i,resetUrl:l}=o.$globalUtils,s=e.ref(!1),d=e.ref({reportContent:""}),c=e.ref(""),f=e.ref(null),u=e.ref(null),p=e.ref(!1),h=e.ref(null),m=e.ref(null),y=e.ref(null),g=e.ref(null),b=e.ref(null),w=e.ref(null),_=n,{option:C,getModelIndicatorsData:S,setSingleValue:x}=mt(),v=O=>{const N=[];(function D(B){var R,I,M;B&&(N.push((B==null?void 0:B.className)??((R=B==null?void 0:B.target)==null?void 0:R.className)??""),(B!=null&&B.parentNode||(I=B.target)!=null&&I.parentNode)&&D((B==null?void 0:B.parentNode)||((M=B.target)==null?void 0:M.parentNode)))})(O);const k=N.toString();k.indexOf("indicator")==-1&&k.indexOf("el-color")==-1&&(c.value="")};e.watch(s,O=>{var N;O||(document.removeEventListener("click",v),f&&((N=f.value)==null||N.destroy()),f.value=null,p.value=!1)});const V=async O=>{f.value=null,s.value=!0,d.value=JSON.parse(JSON.stringify(O)),setTimeout(()=>{p.value=!0},100)},$=async(O,N)=>{switch(O){case"add":case"edit":e.unref(g).init(O,N);break;case"insert":{u.value={};let k;switch(N.indicatorsType=="MODEL_INDICATORS"?(await S(N.indicatorsId??N.id,N.echartsType,N.formConfJson),k={data:{[N.id]:{config:C.value,dataList:JSON.stringify(C.value.dataset.source)}}}):k=await De(o).mapEchartsData(N.id),String(N.echartsType)){case"8":{const D=JSON.parse(k.data[N.id].dataList);if(D.length==0){o.$message.warning("暂无数据");return}const B={type:"table",width:"100%",children:[]};if(N.indicatorsType=="MODEL_INDICATORS"){const R=k.data[N.id].config;B.children.push(...R.dataset.dimensions.map(I=>({type:"table-cell",isHeader:!0,children:[{text:I}]}))),B.children.push(...D.map(I=>({type:"table-row",children:R.dataset.dimensions.map(M=>{let j=I[M];const F=R.customSeriesData[M];if(F){const{prefix:G,toFixed:X,suffix:Y}=F;j=`${G}${isNaN(j)?j:Number(j).toFixed(X)}${Y}`}return{type:"table-cell",children:[{text:j,color:(F==null?void 0:F.color)??""}]}})})))}else B.children=[{type:"table-row",children:Object.keys(D[0]).map(R=>({type:"table-cell",isHeader:!0,children:[{text:R}]}))},...D.map(R=>({type:"table-row",children:Object.keys(R).map(I=>({type:"table-cell",children:[{text:R[I]}]}))}))];tt.DomEditor.isSelectedEmptyParagraph(f.value)&&tt.SlateTransforms.removeNodes(f.value,{mode:"highest"}),tt.SlateTransforms.insertNodes(f.value,B,{mode:"highest"}),f.value.deselect()}break;case"7":{const D=k.data[N.id].config,B={type:"indicator",content:N.indicatorsName,singleValue:D,id:N.id,indicatorsType:N.indicatorsType||"INDICATORS",chartType:N.echartsType,subtitle:N.title,children:[{text:""}]};if(N.indicatorsType=="MODEL_INDICATORS"){const R=e.ref("");e.unref(C).dataset.dimensions.length==1?R.value=e.unref(C).dataset.dimensions[0]:await new Promise(I=>{E.ElMessageBox({title:"选择数据",showConfirmButton:!1,message:()=>e.h("div",{style:{width:"396px"}},[e.h(E.ElSelect,{class:"w-full mt-5",modelValue:R.value,placeholder:"请选择数据","onUpdate:modelValue":M=>{R.value=M}},{default:()=>e.unref(C).dataset.dimensions.map(M=>e.h(E.ElOption,{label:M,value:M,key:M}))}),e.h("div",{class:"mt-5 flex justify-end"},[e.h(E.ElButton,{type:"primary",onclick:async()=>{if(e.unref(R)==""){o.$message.warning("请选择数据");return}I(!0),E.ElMessageBox.close()}},{default:()=>"提交"}),e.h(E.ElButton,{onclick:async()=>E.ElMessageBox.close()},{default:()=>"关闭"})])])})}),B.singleValueKey=R.value,B.singleValue=x(R.value)}f.value.restoreSelection(),f.value.insertNode(B)}break;default:{const D=E.ElLoading.service({lock:!0,text:"数据处理中",background:"rgba(0, 0, 0, 0.7)",customClass:"ajax-loading"});let B=l(N.coverUrl||"");if(!B){try{u.value=i(k.data[N.id].config)}catch{u.value=k.data[N.id].config}await new Promise(R=>{e.nextTick(()=>{e.unref(w).chart.on("finished",async()=>{const I=a(e.unref(w).getDataURL()),M=await De(o).updateIndicatorsApplyImage(I,N.id);B=l(M.data),R(!0)})})})}f.value.insertNode({type:"indicator",content:N.indicatorsName,indicatorsType:N.indicatorsType||"INDICATORS",id:N.id,chartType:N.echartsType,subtitle:N.title,src:B,children:[{text:""}]}),N.coverUrl=B,u.value=null,D.close()}break}}break;case"submit":{if(!await De(o).reportSubmit({id:e.unref(d).id,reportContent:f.value.getHtml(),reportName:e.unref(d).reportName,indicatorsNum:e.unref(y).list.length}))return;window.frames.length==parent.frames.length&&o.$message.success("操作成功"),_("success"),s.value=!1}break;case"close":s.value=!1;break}},T=O=>{f.value=Object.seal(O),document.addEventListener("click",v,!0)},z=()=>{const O=e.unref(m),N=e.unref(y);O.list.length>0&&N.list.length>0&&O.list.forEach(k=>{k.value=N.list.filter(D=>D.indicatorsId==k.indicatorsId).length})};return o.$baseEventBus.on("editor",O=>{e.nextTick(()=>{e.unref(b).init(O,e.unref(d))})}),r({init:V}),(O,N)=>{const k=e.resolveComponent("v-chart"),D=e.resolveComponent("AppDrawer");return e.openBlock(),e.createBlock(D,{modelValue:e.unref(s),"onUpdate:modelValue":N[4]||(N[4]=B=>e.isRef(s)?s.value=B:null),withHeader:!1,size:"100%"},{default:e.withCtx(()=>[e.createVNode(e.unref(E.ElContainer),{class:"designBody"},{default:e.withCtx(()=>[e.createVNode(e.unref(E.ElAside),{width:"310px",class:"p-3"},{default:e.withCtx(()=>[e.createVNode(nB,{ref_key:"designLeftRef",ref:m,onClick:$,onSuccess:z},null,512)]),_:1}),e.createVNode(e.unref(E.ElMain),null,{default:e.withCtx(()=>[e.unref(p)?(e.openBlock(),e.createBlock(SB,{key:0,ref_key:"designMainRef",ref:h,onEditorSuccess:T,editorRef:e.unref(f),reportObj:e.unref(d),modelValue:e.unref(c),"onUpdate:modelValue":N[2]||(N[2]=B=>e.isRef(c)?c.value=B:null)},{default:e.withCtx(()=>[e.createElementVNode("div",null,[e.createVNode(e.unref(E.ElButton),{type:"primary",onClick:N[0]||(N[0]=B=>$("submit",{}))},{default:e.withCtx(()=>[e.createTextVNode("保存报告")]),_:1}),e.createVNode(e.unref(E.ElButton),{type:"warning",onClick:N[1]||(N[1]=B=>$("close",{}))},{default:e.withCtx(()=>[e.createTextVNode("关闭")]),_:1})])]),_:1},8,["editorRef","reportObj","modelValue"])):e.createCommentVNode("",!0)]),_:1}),e.createVNode(e.unref(E.ElAside),{width:"310px",id:"useReportcontainer",class:"p-3",style:{"border-left":"1px solid #ebeef5"}},{default:e.withCtx(()=>[e.unref(f)?(e.openBlock(),e.createBlock(BB,{key:0,ref_key:"designRightRef",ref:y,onClick:$,reportObj:e.unref(d),editorRef:e.unref(f),onSuccess:z,indicatorsId:e.unref(c)},null,8,["reportObj","editorRef","indicatorsId"])):e.createCommentVNode("",!0)]),_:1})]),_:1}),e.unref(u)?(e.openBlock(),e.createElementBlock("div",OB,[e.createVNode(k,{ref_key:"echartsRef",ref:w,option:e.unref(u),autoresize:""},null,8,["option"])])):e.createCommentVNode("",!0),e.createVNode(TB,{ref_key:"designFormRef",ref:g,reportObj:e.unref(d),onSuccess:N[3]||(N[3]=B=>e.unref(y).init())},null,8,["reportObj"]),e.createVNode(fm,{ref_key:"previewRef",ref:b,type:"design"},null,512)]),_:1},8,["modelValue"])}}}),OR="",zB=Be(IB,[["__scopeId","data-v-6a7e6dec"]]),RB=t=>(e.pushScopeId("data-v-6a766735"),t=t(),e.popScopeId(),t),MB={key:1,class:"flex flex-wrap pt-3 pb-7"},AB={class:"reportName line-clamp-2"},LB={class:"auth"},FB={class:"times"},jB=["onClick"],PB={class:"w-full flex justify-center mt-5"},UB=RB(()=>e.createElementVNode("div",{class:"h-px bg-gray-200 w-full mt-2"},null,-1)),WB={class:"flex w-full justify-center mt-2"},GB=e.defineComponent({__name:"index",setup(t){const{proxy:r}=e.getCurrentInstance(),n=e.ref(null),o=e.ref(null),a=e.ref(null),i=e.ref(null),l=e.reactive([]),s=e.reactive([{name:"报告名称",type:Rr.Text,fieldName:"reportName",value:""}]),d=e.ref([{label:"预览",icon:"ri-eye-line",type:"primary",key:"PREVIEW",show:!1},{label:"编辑",icon:"ri-edit-line",type:"primary",key:"EDIT",show:!1},{label:"PDF",icon:"ri-file-pdf-line",type:"warning",key:"DOWNLOAD_PDF",show:!1},{label:"WORD",icon:"ri-file-word-2-line",type:"primary",key:"DOWNLOAD_WORD",show:!1},{label:"复制",icon:"ri-file-copy-line",type:"primary",key:"COPY",show:!1},{label:"删除",icon:"ri-delete-bin-line",type:"danger",key:"DEL",show:!1}]),c=e.ref([]);De(r).getCurrFunc("INDICATORS_REPORT").then(p=>{c.value=p.data,p.data.includes("CREATE")&&l.push({name:"新增报告",key:"add",type:"primary",icon:"ri-add-line"}),e.unref(d).forEach(h=>{h.show=p.data.includes(h.key)})});const f=e.reactive([{label:"报告名称",prop:"reportName"},{label:"报告使用库",prop:"indicatorsNum",slot:!0},{label:"撰写人",prop:"createUserName"},{label:"撰写时间",prop:"createTime"},{label:"操作",prop:"action",slot:!0,width:"410px"}]),u=async p=>{const{type:h,row:m}=p;switch(h){case"zb":e.unref(o).init(m);break;case"add":r.$basePrompt({content:"新增指标报告",placeholder:"请输入报告名称",inputType:"input",beforeCloseFunc:async(y,g,b)=>{if(y!="confirm"){b();return}const w=await De(r).reportSubmit({reportName:g.inputValue});w&&(r.$message.success("操作成功"),e.unref(n).getData(),e.unref(a).init({id:w.data,reportName:g.inputValue,reportContent:""}),b())}});break;case"DEL":r.$baseConfirm({content:"是否确定删除",callConfirm:async()=>{await De(r).reportRemove(m.id)&&(r.$message.success("删除成功"),e.unref(n).getData())}});break;case"COPY":r.$baseConfirm({content:"是否确定复制",callConfirm:async()=>{await De(r).reportCopy(m.id)&&(r.$message.success("操作成功"),e.unref(n).getData())}});break;case"EDIT":e.unref(a).init(m);break;case"DOWNLOAD_PDF":case"PREVIEW":case"DOWNLOAD_WORD":e.nextTick(()=>{e.unref(i).init(h,m)});break}};return(p,h)=>{const m=e.resolveComponent("AppEmpty"),y=e.resolveComponent("AppList");return e.openBlock(),e.createElementBlock("div",null,[e.createVNode(y,{url:`/api/ace-data-center/indicators-report/list?descs=create_time&projectId=${e.unref(r).$baseGetCurrentProjectId}`,tableData:e.unref(f),searchForm:e.unref(s),searchBtns:e.unref(l),listType:"custom",onBtnClick:u,ref_key:"appListRef",ref:n},{"list-slot":e.withCtx(({list:g,loading:b})=>[e.createVNode(e.unref(E.ElSkeleton),{loading:b,animated:""},{default:e.withCtx(()=>[g.length==0?(e.openBlock(),e.createBlock(m,{key:0,description:"暂无数据"})):(e.openBlock(),e.createElementBlock("div",MB,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(g,w=>(e.openBlock(),e.createElementBlock("div",{key:w.id,class:"items"},[e.createElementVNode("div",AB,e.toDisplayString(w.reportName),1),e.createElementVNode("div",LB,"作者:"+e.toDisplayString(w.createUserName),1),e.createElementVNode("div",FB,e.toDisplayString(w.createTime),1),e.unref(c).includes("VIEW_INDICATOR")?(e.openBlock(),e.createElementBlock("div",{key:0,class:"tags",onClick:e.withModifiers(_=>u({type:"zb",row:w,index:-1}),["stop"])},[e.createTextVNode(" 查看指标库: "),e.createElementVNode("span",null,e.toDisplayString(w.indicatorsNum||0),1)],8,jB)):e.createCommentVNode("",!0),e.createElementVNode("div",PB,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(e.unref(d).filter(_=>["EDIT","COPY"].includes(_.key)),_=>(e.openBlock(),e.createElementBlock(e.Fragment,{key:_.icon},[_.show?(e.openBlock(),e.createBlock(e.unref(E.ElLink),{key:0,class:"inline-flex items-center ml-3 mr-3",type:_.type,onClick:e.withModifiers(C=>u({type:_.key,row:w,index:-1}),["stop"])},{default:e.withCtx(()=>[e.createElementVNode("i",{class:e.normalizeClass([_.icon,"mr-1 text-base"])},null,2),e.createTextVNode(" "+e.toDisplayString(_.label),1)]),_:2},1032,["type","onClick"])):e.createCommentVNode("",!0)],64))),128))]),UB,e.createElementVNode("footer",WB,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(e.unref(d).filter(_=>!["EDIT","COPY"].includes(_.key)),_=>(e.openBlock(),e.createElementBlock(e.Fragment,null,[_.show?(e.openBlock(),e.createBlock(e.unref(E.ElTooltip),{content:_.label,key:_.icon},{default:e.withCtx(()=>[e.createVNode(e.unref(E.ElLink),{class:"inline-flex items-center",type:_.type,onClick:e.withModifiers(C=>u({type:_.key,row:w,index:-1}),["stop"])},{default:e.withCtx(()=>[e.createElementVNode("i",{class:e.normalizeClass([_.icon,"mr-2 ml-2 text-lg"])},null,2)]),_:2},1032,["type","onClick"])]),_:2},1032,["content"])):e.createCommentVNode("",!0)],64))),256))])]))),128))]))]),_:2},1032,["loading"])]),_:1},8,["url","tableData","searchForm","searchBtns"]),e.createVNode(qD,{ref_key:"useIndicatorsRef",ref:o},null,512),e.createVNode(zB,{ref_key:"designRef",ref:a,onSuccess:h[0]||(h[0]=g=>e.unref(n).getData())},null,512),e.createVNode(fm,{ref_key:"previewRef",ref:i},null,512)])}}}),IR="",HB=Be(GB,[["__scopeId","data-v-6a766735"]]);function pm(t,r,n,o,a){const i=r===void 0?void 0:r.key;return{sel:t,data:r,children:n,text:o,elm:a,key:i}}const hm=Array.isArray;function Qs(t){return typeof t=="string"||typeof t=="number"||t instanceof String||t instanceof Number}function mm(t,r,n){if(t.ns="http://www.w3.org/2000/svg",n!=="foreignObject"&&r!==void 0)for(let o=0;o<r.length;++o){const a=r[o];if(typeof a=="string")continue;const i=a.data;i!==void 0&&mm(i,a.children,a.sel)}}function nn(t,r,n){let o={},a,i,l;if(n!==void 0?(r!==null&&(o=r),hm(n)?a=n:Qs(n)?i=n.toString():n&&n.sel&&(a=[n])):r!=null&&(hm(r)?a=r:Qs(r)?i=r.toString():r&&r.sel?a=[r]:o=r),a!==void 0)for(l=0;l<a.length;++l)Qs(a[l])&&(a[l]=pm(void 0,void 0,void 0,a[l],void 0));return t.startsWith("svg")&&(t.length===3||t[3]==="."||t[3]==="#")&&mm(o,a,t),pm(t,o,a,i,void 0)}const YB=(t,r,n)=>{const o=tt.DomEditor.isNodeSelected(n,t),{id:a}=tt.DomEditor.findKey(n,t),{content:i="",chartType:l="",id:s="",singleValue:d="",singleValueKey:c="",subtitle:f="",src:u="",fontSize:p="16px",bold:h="",color:m="",indicatorsType:y="INDICATORS",width:g=400}=t,{EXTEND_CONF:{indicatorConfig:b}}=n.getConfig(),{clickIndicator:w}=b,_=[];return u?(_.push(nn("img.editor-indicator-img",{props:{src:u},style:{},dataset:{id:s}})),o&&_.push(nn("input.indicator-img-range",{type:"range",style:{position:"fixed",bottom:"20px",left:"50%",transform:"translateX(-50%)",zIndex:"99"},min:300,max:550,value:g,on:{input(C){const S={id:s,chartType:l,subtitle:f,singleValue:d,singleValueKey:c,width:C.target.value};tt.SlateTransforms.setNodes(n,S,{at:tt.DomEditor.findPath(n,t)})}}}))):_.push(d||i),_.push(nn("span.indicator-tooltip",{style:{position:"absolute",background:"#fff",border:"1px solid var(--g-border-color)",lineHeight:"25px",padding:"0 5px",color:"orange",fontSize:"12px",left:"0px",top:"-30px",zIndex:"88",display:"none",whiteSpace:"nowrap",fontWeight:"normal"},dataset:{id:s}},[nn("span",{style:{color:"#000",fontWeight:"bold"}},`${i}:`),nn("span",{},f),nn("span",{style:{color:"#000"}},c?`(${c})`:"")])),nn("span.editor-indicator",{id:`editor-indicator-${a}`,props:{contentEditable:!1},dataset:{id:s,chartType:l,subtitle:f,width:g,singleValue:d,singleValueKey:c,src:u,fontSize:p,color:m,indicatorsType:y,bold:h},style:{width:`${l=="7"?null:g}px`,marginLeft:"3px",marginRight:"3px",display:"inline-block",cursor:"pointer",backgroundColor:"var(--w-e-textarea-slight-bg-color)",border:o?"2px solid var(--w-e-textarea-selected-border-color)":"2px solid transparent",borderRadius:"3px",padding:"0 3px",fontSize:p,fontWeight:h=="true"?"bold":"normal",color:m},on:{click(C){C.preventDefault(),w&&w(s,t)}}},_)},XB=t=>{const{chartType:r="",id:n="",type:o,subtitle:a,singleValue:i="",singleValueKey:l="",content:s="",src:d="",fontSize:c="16px",bold:f=!1,color:u="",indicatorsType:p="INDICATORS",width:h=400}=t;return`<span
|
|
878
|
+
</html>`,m=new Blob([h],{type:"application/msword;charset=utf-8"});JD.saveAs(m,`${e.unref(s).filename}.doc`),l.value=!1},f=e.ref(""),u=async()=>{await new Promise(async h=>{var m;f.value=document.title,document.title=e.unref(s).filename,(m=document.getElementById("printButton"))==null||m.click(),l.value=!1,h(!0)})};return r({init:async(h,m)=>{const y=E.ElLoading.service({lock:!0,text:"数据处理中",background:"rgba(0, 0, 0, 1)",customClass:"preview-loading"});s.value={type:h,content:m.reportContent,filename:m.reportName},await new Promise(b=>{setTimeout(()=>{l.value=!0,b(!0)},100)});const g=[];e.nextTick(async()=>{const b=document.getElementById("preview-content");(function v(V){V.forEach($=>{g.push($),$.childNodes&&v($.childNodes)})})(b.childNodes);const w=await De(n).listIndicatorsApply({reportId:m.id},!1),_=g.filter(v=>v.className==="editor-indicator"),C=[...new Set(_.map(v=>v.dataset.id))],S=await De(n).mapEchartsData(C.toString(),!1),x=[];for(let v=0;v<_.length;v+=1){const V=_[v],$=w.data.find(T=>T.id==V.dataset.id);if(V.dataset.charttype==7){$.indicatorsType=="MODEL_INDICATORS"?(await o($.indicatorsId??$.id,$.echartsType,$.formConfJson),_[v].innerHTML=a(_[v].getAttribute("data-singleValueKey"))):_[v].innerHTML=S.data[V.dataset.id].config;const T=_[v].getAttribute("data-fontsize"),z=_[v].getAttribute("data-bold"),O=_[v].getAttribute("data-color");T&&(_[v].style.fontSize=T),z&&(_[v].style.fontWeight=z=="true"?"bold":"normal"),O&&(_[v].style.color=O)}else{const T=_[v].getAttribute("data-width")||400;let z=i(($==null?void 0:$.coverUrl)||_[v].getAttribute("data-src"));if(x.includes(z))continue;z&&await new Promise(O=>{const N=new Image;N.src=z,N.crossOrigin="anonymous",N.onload=()=>{const k=document.createElement("canvas");k.width=N.width,k.height=N.height,k.getContext("2d").drawImage(N,0,0,N.width,N.height),x.push(z),z=k.toDataURL("image/png"),O(!0)},N.onerror=()=>{O(!0)}}),_[v].innerHTML=`<img width=${T} src="${z}" crossorigin="anonymous" />`}}h==="DOWNLOAD_WORD"&&c(),h==="DOWNLOAD_PDF"&&await u(),setTimeout(()=>y.close(),100)})}}),(h,m)=>{const y=e.resolveComponent("AppDrawer"),g=e.resolveDirective("print");return e.openBlock(),e.createBlock(y,{modelValue:e.unref(l),"onUpdate:modelValue":m[1]||(m[1]=b=>e.isRef(l)?l.value=b:null),withHeader:!1,size:"100%"},{default:e.withCtx(()=>[e.createElementVNode("div",{id:"preview-content",class:e.normalizeClass(e.unref(s).type),innerHTML:e.unref(s).content},null,10,KD),e.createElementVNode("i",{class:"ri-close-line ri-2x fixed right-5 top-5 text-color-danger cursor-pointer",onClick:m[0]||(m[0]=b=>l.value=!1)}),e.unref(s).type=="DOWNLOAD_PDF"?e.withDirectives((e.openBlock(),e.createBlock(e.unref(E.ElButton),{key:0,id:"printButton",type:"primary"},{default:e.withCtx(()=>[e.createTextVNode(" 导出PDF ")]),_:1})),[[g,e.unref(d)]]):e.createCommentVNode("",!0)]),_:1},8,["modelValue"])}}}),$R="",ZD={class:"mt-3"},QD={class:"mt-3"},eB={class:"menu-title"},tB={key:0,class:"badge"},rB=e.defineComponent({__name:"designLeft",emits:["click","success"],setup(t,{expose:r,emit:n}){const o=e.ref([]),a=e.ref(""),i=n,{proxy:l}=e.getCurrentInstance();De(l).listReportIndicatorsMenu({}).then(f=>{o.value=Object.keys(f.data).map(u=>({name:u,children:f.data[u]})),i("success")});const s=(f,u)=>{i("click",f,u)},d=f=>{f.id&&s("add",f)},c=(f,u)=>f?u.name.includes(f):!0;return r({list:o}),(f,u)=>{const p=e.resolveComponent("AppHeader");return e.openBlock(),e.createElementBlock(e.Fragment,null,[e.createVNode(p,{title:"指标库"}),e.createElementVNode("div",ZD,[e.createVNode(e.unref(E.ElInput),{modelValue:e.unref(a),"onUpdate:modelValue":u[0]||(u[0]=h=>e.isRef(a)?a.value=h:null),placeholder:"请输入指标名称"},null,8,["modelValue"])]),e.createElementVNode("div",QD,[e.createVNode(e.unref(E.ElTree),{ref:"tree",data:e.unref(o),"default-expand-all":"","highlight-current":!0,"filter-node-method":c,indent:0,onNodeClick:d},{default:e.withCtx(({node:h,data:m})=>[e.createElementVNode("div",eB,[m.count?(e.openBlock(),e.createElementBlock("span",tB,[e.createTextVNode(e.toDisplayString(m.title||m.name)+" ",1),e.createElementVNode("span",null,e.toDisplayString(m.count),1)])):(e.openBlock(),e.createElementBlock("span",{key:1,class:e.normalizeClass({"font-bold":h.level==1})},e.toDisplayString(m.title||m.name),3)),m.children?e.createCommentVNode("",!0):(e.openBlock(),e.createBlock(e.unref(E.ElLink),{key:2,type:"primary",onClick:e.withModifiers(y=>s("add",m),["stop"])},{default:e.withCtx(()=>[e.createTextVNode(" 配置 ")]),_:2},1032,["onClick"]))])]),_:1},8,["data"])])],64)}}}),DR="",nB=Be(rB,[["__scopeId","data-v-07266c39"]]),_r=t=>(e.pushScopeId("data-v-884e5eeb"),t=t(),e.popScopeId(),t),oB={class:"p-3 overflow-hidden h-full w-full flex-col flex items-start"},aB={class:"mt-3 mb-3 flex items-center whitespace-nowrap w-full"},iB=_r(()=>e.createElementVNode("span",{class:"mr-3"},"报告名称:",-1)),lB={class:"w-80"},sB={class:"flex-1 items-center justify-end flex"},cB=_r(()=>e.createElementVNode("i",{class:"ri-book-open-line mr-2"},null,-1)),dB=_r(()=>e.createElementVNode("i",{class:"ri-file-pdf-line ml-3 mr-2"},null,-1)),fB=_r(()=>e.createElementVNode("i",{class:"ri-file-word-line ml-3 mr-2"},null,-1)),uB={class:"editor flex-1 w-full h-full overflow-hidden relative",style:{border:"1px solid #eee"}},pB={key:0,class:"indicator-toolbar"},hB=_r(()=>e.createElementVNode("span",{class:"mr-2"},"字体大小:",-1)),mB=_r(()=>e.createElementVNode("span",{class:"ml-2 mr-2 text-color-info"},"|",-1)),gB=_r(()=>e.createElementVNode("span",{class:"ml-2"},"加粗:",-1)),yB={class:"ml-2 cursor-pointer"},bB=_r(()=>e.createElementVNode("span",{class:"ml-2 mr-2 text-color-info"},"|",-1)),_B=_r(()=>e.createElementVNode("span",{class:"ml-2"},"字体颜色:",-1)),wB={class:"ml-2"},um="simple",CB=e.defineComponent({__name:"designMain",props:{reportObj:{default:{}},editorRef:{default:null},modelValue:{default:""}},emits:["update:modelValue","editor-success"],setup(t,{emit:r}){const n=t,o=r,{proxy:a}=e.getCurrentInstance(),i=e.ref({fontSize:"",bold:!1,color:""}),l=e.ref({}),s=[{value:"12px"},{value:"14px"},{value:"16px"},{value:"18px"},{value:"20px"},{value:"22px"},{value:"24px"}],d={excludeKeys:["code","codeSelectLang","codeBlock","insertVideo","uploadVideo","editVideoSize","insertImage","header3","fullScreen"],insertKeys:{index:5,keys:["fontSize"]}},c={placeholder:"请输入内容...",EXTEND_CONF:{indicatorConfig:{clickIndicator:(p,h)=>{o("update:modelValue",p),l.value=h,i.value={fontSize:h.fontSize,bold:h.bold=="true",color:h.color||""};const m=document.getElementById(p);m&&(document.getElementById("useReportcontainer").scrollTop=m.offsetTop-20)}}}},f=(p,h)=>{const m={[p]:String(h)};tt.SlateTransforms.setNodes(n.editorRef,m,{at:tt.DomEditor.findPath(n.editorRef,e.unref(l))})},u=p=>{o("editor-success",p)};return(p,h)=>{var y;const m=e.resolveComponent("AppHeader");return e.openBlock(),e.createElementBlock("div",oB,[e.createVNode(m,{title:"指标报告撰写",class:"w-full"},{default:e.withCtx(()=>[e.renderSlot(p.$slots,"default",{},void 0,!0)]),_:3}),e.createElementVNode("div",aB,[iB,e.createElementVNode("div",lB,[e.createVNode(e.unref(E.ElInput),{modelValue:p.reportObj.reportName,"onUpdate:modelValue":h[0]||(h[0]=g=>p.reportObj.reportName=g),placeholder:"请输入报告名称"},null,8,["modelValue"])]),e.createElementVNode("div",sB,[e.createVNode(e.unref(E.ElLink),{type:"primary",onClick:h[1]||(h[1]=g=>e.unref(a).$baseEventBus.emit("editor","PREVIEW"))},{default:e.withCtx(()=>[cB,e.createTextVNode(" 预览 ")]),_:1}),e.createVNode(e.unref(E.ElLink),{type:"primary",onClick:h[2]||(h[2]=g=>e.unref(a).$baseEventBus.emit("editor","DOWNLOAD_PDF"))},{default:e.withCtx(()=>[dB,e.createTextVNode(" 导出pdf ")]),_:1}),e.createVNode(e.unref(E.ElLink),{type:"primary",onClick:h[3]||(h[3]=g=>e.unref(a).$baseEventBus.emit("editor","DOWNLOAD_WORD"))},{default:e.withCtx(()=>[fB,e.createTextVNode(" 导出word ")]),_:1})])]),e.createElementVNode("div",uB,[e.createVNode(e.unref(sc.Toolbar),{class:"w-full",editor:p.editorRef,defaultConfig:d,mode:um},null,8,["editor"]),e.createVNode(e.unref(sc.Editor),{style:{height:"90%","overflow-y":"hidden","border-top":"1px solid #eee"},modelValue:p.reportObj.reportContent,"onUpdate:modelValue":h[4]||(h[4]=g=>p.reportObj.reportContent=g),defaultConfig:c,mode:um,onOnCreated:u},null,8,["modelValue"]),p.modelValue&&((y=e.unref(l))==null?void 0:y.chartType)=="7"?(e.openBlock(),e.createElementBlock("div",pB,[hB,e.createVNode(e.unref(E.ElSelect),{size:"small",style:{width:"80px"},modelValue:e.unref(i).fontSize,"onUpdate:modelValue":h[5]||(h[5]=g=>e.unref(i).fontSize=g),teleported:!1,clearable:!1,onChange:h[6]||(h[6]=g=>f("fontSize",g))},{default:e.withCtx(()=>[(e.openBlock(),e.createElementBlock(e.Fragment,null,e.renderList(s,g=>e.createVNode(e.unref(E.ElOption),{label:g.value,value:g.value,key:g.value},null,8,["label","value"])),64))]),_:1},8,["modelValue"]),mB,gB,e.createElementVNode("div",yB,[e.createVNode(e.unref(E.ElRadioGroup),{modelValue:e.unref(i).bold,"onUpdate:modelValue":h[7]||(h[7]=g=>e.unref(i).bold=g),onChange:h[8]||(h[8]=g=>f("bold",g))},{default:e.withCtx(()=>[e.createVNode(e.unref(E.ElRadio),{value:!0,label:!0},{default:e.withCtx(()=>[e.createTextVNode("是")]),_:1}),e.createVNode(e.unref(E.ElRadio),{value:!1,label:!0},{default:e.withCtx(()=>[e.createTextVNode("否")]),_:1})]),_:1},8,["modelValue"])]),bB,_B,e.createElementVNode("div",wB,[e.createVNode(e.unref(E.ElColorPicker),{predefine:e.unref(a).$globalPreColor,onChange:h[9]||(h[9]=g=>f("color",g)),modelValue:e.unref(i).color,"onUpdate:modelValue":h[10]||(h[10]=g=>e.unref(i).color=g)},null,8,["predefine","modelValue"])])])):e.createCommentVNode("",!0)])])}}}),BR="",SB=Be(CB,[["__scopeId","data-v-884e5eeb"]]),xB={class:"mt-3"},vB=["id"],EB={class:"flex justify-between"},VB={class:"title"},kB=["onClick"],NB=["onClick"],$B={class:"text-color-warning text-xs mt-3"},DB=e.defineComponent({__name:"designRight",props:{reportObj:{default:{}},editorRef:{default:null},indicatorsId:{default:""}},emits:["click","success"],setup(t,{expose:r,emit:n}){const o=t,{proxy:a}=e.getCurrentInstance(),{getModelIndicatorsData:i,setSingleValue:l}=mt(),s=n,d=e.ref([]),c=e.ref(!0),f=async()=>{c.value=!0;const p=await De(a).listIndicatorsApply({reportId:o.reportObj.id},!1);d.value=p.data,c.value=!1,s("success"),e.nextTick(()=>{(async function h(m){for(let y=0;y<m.length;y+=1){const g=m[y];if(g.type=="indicator"){const b=p.data.find(_=>_.id==g.id);if(!b)return;const w={subtitle:b.title,content:b.indicatorsName};b.coverUrl&&(w.src=w$(b.coverUrl)),b.echartsType=="7"&&(b.indicatorsType=="MODEL_INDICATORS"?(await i(b.indicatorsId??b.id,b.echartsType,b.formConfJson),w.singleValue=l(g.singleValueKey??"")):w.singleValue=b.singleValue),tt.SlateTransforms.setNodes(o.editorRef,w,{at:tt.DomEditor.findPath(o.editorRef,g)})}g.children&&await h(g.children)}})(o.editorRef.children)})},u=async(p,h)=>{s("click",p,h)};return f(),r({init:f,list:d}),(p,h)=>{const m=e.resolveComponent("AppHeader");return e.openBlock(),e.createElementBlock(e.Fragment,null,[e.createVNode(m,{title:"指标使用库"}),e.createElementVNode("div",xB,[e.createVNode(e.unref(E.ElSkeleton),{loading:e.unref(c),animated:""},{default:e.withCtx(()=>[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(e.unref(d),y=>(e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(["item",{active:p.indicatorsId==y.id}]),id:y.id,key:y.id},[e.createElementVNode("div",EB,[e.createVNode(e.unref(E.ElTooltip),{effect:"dark",content:y.indicatorsName,placement:"bottom"},{default:e.withCtx(()=>[e.createElementVNode("div",VB,e.toDisplayString(y.indicatorsName),1)]),_:2},1032,["content"]),e.createElementVNode("div",null,[e.createElementVNode("button",{onClick:e.withModifiers(g=>u("edit",y),["stop"])},"编辑",8,kB),e.createElementVNode("button",{onClick:e.withModifiers(g=>u("insert",y),["stop"])},"插入光标",8,NB)])]),e.createElementVNode("div",$B,e.toDisplayString(y.title),1)],10,vB))),128))]),_:1},8,["loading"])])],64)}}}),TR="",BB=Be(DB,[["__scopeId","data-v-83f04927"]]),TB=e.defineComponent({__name:"designForm",props:{reportObj:{default:{}}},emits:["success"],setup(t,{expose:r,emit:n}){const o=t,a=Re(),{proxy:i}=e.getCurrentInstance(),{dynamicSearchForm:l,dynamicSearchFormat:s,dynamicSearchParams:d,dynamicSearchParamsTitle:c}=i.$globalHooks.useDynamicSearch(),{base64ToBlob:f,chartJsonFormat:u,echartsTypeList:p}=i.$globalUtils,h=n,{option:m,formatChart:y}=mt(),g=e.ref(!1),b=e.ref(""),w=e.ref(null),_=e.ref(""),C=e.ref(""),S=e.ref([]),x=e.ref({}),v=e.ref({type:"",value:""}),V=e.ref(!1),$=async()=>{if(V.value=!0,e.unref(T)=="MODEL_INDICATORS"){a.getChartData.params.params=d(l.value);const k=e.unref(z).find(D=>D.type==e.unref(_));await y(k==null?void 0:k.code),V.value=!1,e.unref(v).type=_.value,e.unref(v).value=m.value}else{const k=d(e.unref(l)),D=await De(i).pullEchartsDataVO({indicatorsId:e.unref(x).indicatorsId??e.unref(x).id,params:k,echartsType:e.unref(_),targetClient:"WEB"});if(!D)return;V.value=!1,e.unref(v).type=_.value;try{e.unref(v).value=u(D.data.config)}catch{e.unref(v).value=D.data.config}}},T=e.ref(""),z=e.ref({}),O=async(k,D)=>{var R,I;C.value=k,S.value=[];let B;if(T.value=D.indicatorsType??D.type??"INDICATORS",e.unref(T)=="MODEL_INDICATORS"){B=await i.$baseHttp.get(`/api/ace-data-center/model-indicators/detail?id=${D.indicatorsId??D.id}`);const M=JSON.parse(B.data.sortArgsJson??"{}"),j=Object.keys(e.unref(M)).map(F=>({field:F,type:M[F]=="ascending"?"asc":"desc"}));a.setChartData({x:JSON.parse(B.data.groupArgsJson),y:JSON.parse(B.data.aggArgsJson),params:{aggArgsJson:B.data.aggArgsJson,groupArgsJson:B.data.groupArgsJson,sortArgsJson:JSON.stringify(j),modelIndicatorsId:D.indicatorsId??D.id,params:d(s(JSON.parse(D.formConfJson??((R=e.unref(B))==null?void 0:R.formConfJson)??"[]"))),pageSize:B.data.pageSize,modelId:B.data.modelId}})}else B=await De(i).getIndicatorsPanelConf(D.indicatorsId??D.id);B&&(g.value=!0,x.value=D,e.unref(T)=="MODEL_INDICATORS"?(z.value=B.data.echarts,S.value=B.data.echarts.map(M=>M.type)):S.value=B.data.views,_.value=k=="add"?S.value[0]:D.echartsType,b.value=D.indicatorsName??D.name,l.value=k=="add"?s(JSON.parse(((I=B.data)==null?void 0:I.formConfJson)??"[]")):JSON.parse(D.formConfJson),$())},N=async()=>{var R;const k=e.unref(w).$refs.echart;if(k&&!k.getDataURL()){i.$message.warning("图片未生成完毕,请重新保存");return}const D={echartsType:e.unref(v).type,indicatorsId:e.unref(x).indicatorsId??e.unref(x).id,reportId:o.reportObj.id,paramsJson:JSON.stringify(d(e.unref(l))),formConfJson:JSON.stringify(e.unref(l)),title:`${(R=p[e.unref(_)])==null?void 0:R.name} ${c({showTitle:!1})}`,indicatorsType:e.unref(T)};if(e.unref(C)=="edit"&&(D.id=e.unref(x).id),!!await De(i).saveIndicatorsApply(D)){if(e.unref(C)=="edit"&&k){const I=E.ElLoading.service({lock:!0,text:"数据处理中",background:"rgba(0, 0, 0, 0.7)",customClass:"ajax-loading"});await new Promise(M=>{e.nextTick(async()=>{const j=f(k.getDataURL());await De(i).updateIndicatorsApplyImage(j,D.id),M(!0)})}),I.close()}i.$message.success("操作成功"),g.value=!1,h("success")}};return r({init:O}),(k,D)=>{const B=e.resolveComponent("AppDynamicSearch"),R=e.resolveComponent("AppChart"),I=e.resolveComponent("AppDrawer");return e.openBlock(),e.createBlock(I,{modelValue:e.unref(g),"onUpdate:modelValue":D[2]||(D[2]=M=>e.isRef(g)?g.value=M:null),title:e.unref(b),size:"632px"},{footer:e.withCtx(()=>[e.createVNode(e.unref(E.ElButton),{class:"ml-3",type:"primary",onClick:N},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(C)=="add"?"生成报告使用指标":"完成"),1)]),_:1}),e.createVNode(e.unref(E.ElButton),{class:"ml-3",onClick:D[1]||(D[1]=M=>g.value=!1)},{default:e.withCtx(()=>[e.createTextVNode("取消")]),_:1})]),default:e.withCtx(()=>[e.unref(l).length>0?(e.openBlock(),e.createBlock(B,{key:0,form:e.unref(l),onSuccess:$},null,8,["form"])):e.createCommentVNode("",!0),e.createVNode(e.unref(E.ElRadioGroup),{onChange:$,modelValue:e.unref(_),"onUpdate:modelValue":D[0]||(D[0]=M=>e.isRef(_)?_.value=M:null),class:"mb-2"},{default:e.withCtx(()=>[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(e.unref(S),M=>(e.openBlock(),e.createBlock(e.unref(E.ElRadio),{key:M,value:M,label:M,class:"mr-3"},{default:e.withCtx(()=>{var j;return[e.createTextVNode(e.toDisplayString((j=e.unref(p)[M])==null?void 0:j.name),1)]}),_:2},1032,["value","label"]))),128))]),_:1},8,["modelValue"]),e.createVNode(R,{ref_key:"appChartRef",ref:w,type:e.unref(v).type,options:e.unref(v).value,loading:e.unref(V)},null,8,["type","options","loading"])]),_:1},8,["modelValue","title"])}}}),OB={key:0,class:"chart"},IB=e.defineComponent({__name:"design",emits:["success"],setup(t,{expose:r,emit:n}){const{proxy:o}=e.getCurrentInstance(),{base64ToBlob:a,chartJsonFormat:i,resetUrl:l}=o.$globalUtils,s=e.ref(!1),d=e.ref({reportContent:""}),c=e.ref(""),f=e.ref(null),u=e.ref(null),p=e.ref(!1),h=e.ref(null),m=e.ref(null),y=e.ref(null),g=e.ref(null),b=e.ref(null),w=e.ref(null),_=n,{option:C,getModelIndicatorsData:S,setSingleValue:x}=mt(),v=O=>{const N=[];(function D(B){var R,I,M;B&&(N.push((B==null?void 0:B.className)??((R=B==null?void 0:B.target)==null?void 0:R.className)??""),(B!=null&&B.parentNode||(I=B.target)!=null&&I.parentNode)&&D((B==null?void 0:B.parentNode)||((M=B.target)==null?void 0:M.parentNode)))})(O);const k=N.toString();k.indexOf("indicator")==-1&&k.indexOf("el-color")==-1&&(c.value="")};e.watch(s,O=>{var N;O||(document.removeEventListener("click",v),f&&((N=f.value)==null||N.destroy()),f.value=null,p.value=!1)});const V=async O=>{f.value=null,s.value=!0,d.value=JSON.parse(JSON.stringify(O)),setTimeout(()=>{p.value=!0},100)},$=async(O,N)=>{switch(O){case"add":case"edit":e.unref(g).init(O,N);break;case"insert":{u.value={};let k;switch(N.indicatorsType=="MODEL_INDICATORS"?(await S(N.indicatorsId??N.id,N.echartsType,N.formConfJson),k={data:{[N.id]:{config:C.value,dataList:JSON.stringify(C.value.dataset.source)}}}):k=await De(o).mapEchartsData(N.id),String(N.echartsType)){case"8":{const D=JSON.parse(k.data[N.id].dataList);if(D.length==0){o.$message.warning("暂无数据");return}const B={type:"table",width:"100%",children:[]};if(N.indicatorsType=="MODEL_INDICATORS"){const R=k.data[N.id].config;B.children.push(...R.dataset.dimensions.map(I=>({type:"table-cell",isHeader:!0,children:[{text:I}]}))),B.children.push(...D.map(I=>({type:"table-row",children:R.dataset.dimensions.map(M=>{let j=I[M];const F=R.customSeriesData[M];if(F){const{prefix:G,toFixed:X,suffix:Y}=F;j=`${G}${isNaN(j)?j:Number(j).toFixed(X)}${Y}`}return{type:"table-cell",children:[{text:j,color:(F==null?void 0:F.color)??""}]}})})))}else B.children=[{type:"table-row",children:Object.keys(D[0]).map(R=>({type:"table-cell",isHeader:!0,children:[{text:R}]}))},...D.map(R=>({type:"table-row",children:Object.keys(R).map(I=>({type:"table-cell",children:[{text:R[I]}]}))}))];tt.DomEditor.isSelectedEmptyParagraph(f.value)&&tt.SlateTransforms.removeNodes(f.value,{mode:"highest"}),tt.SlateTransforms.insertNodes(f.value,B,{mode:"highest"}),f.value.deselect()}break;case"7":{const D=k.data[N.id].config,B={type:"indicator",content:N.indicatorsName,singleValue:D,id:N.id,indicatorsType:N.indicatorsType||"INDICATORS",chartType:N.echartsType,subtitle:N.title,children:[{text:""}]};if(N.indicatorsType=="MODEL_INDICATORS"){const R=e.ref("");e.unref(C).dataset.dimensions.length==1?R.value=e.unref(C).dataset.dimensions[0]:await new Promise(I=>{E.ElMessageBox({title:"选择数据",showConfirmButton:!1,message:()=>e.h("div",{style:{width:"396px"}},[e.h(E.ElSelect,{class:"w-full mt-5",modelValue:R.value,placeholder:"请选择数据","onUpdate:modelValue":M=>{R.value=M}},{default:()=>e.unref(C).dataset.dimensions.map(M=>e.h(E.ElOption,{label:M,value:M,key:M}))}),e.h("div",{class:"mt-5 flex justify-end"},[e.h(E.ElButton,{type:"primary",onclick:async()=>{if(e.unref(R)==""){o.$message.warning("请选择数据");return}I(!0),E.ElMessageBox.close()}},{default:()=>"提交"}),e.h(E.ElButton,{onclick:async()=>E.ElMessageBox.close()},{default:()=>"关闭"})])])})}),B.singleValueKey=R.value,B.singleValue=x(R.value)}f.value.restoreSelection(),f.value.insertNode(B)}break;default:{const D=E.ElLoading.service({lock:!0,text:"数据处理中",background:"rgba(0, 0, 0, 0.7)",customClass:"ajax-loading"});let B=l(N.coverUrl||"");if(!B){try{u.value=i(k.data[N.id].config)}catch{u.value=k.data[N.id].config}await new Promise(R=>{e.nextTick(()=>{e.unref(w).chart.on("finished",async()=>{const I=a(e.unref(w).getDataURL()),M=await De(o).updateIndicatorsApplyImage(I,N.id);B=l(M.data),R(!0)})})})}f.value.insertNode({type:"indicator",content:N.indicatorsName,indicatorsType:N.indicatorsType||"INDICATORS",id:N.id,chartType:N.echartsType,subtitle:N.title,src:B,children:[{text:""}]}),N.coverUrl=B,u.value=null,D.close()}break}}break;case"submit":{if(!await De(o).reportSubmit({id:e.unref(d).id,reportContent:f.value.getHtml(),reportName:e.unref(d).reportName,indicatorsNum:e.unref(y).list.length}))return;window.frames.length==parent.frames.length&&o.$message.success("操作成功"),_("success"),s.value=!1}break;case"close":s.value=!1;break}},T=O=>{f.value=Object.seal(O),document.addEventListener("click",v,!0)},z=()=>{const O=e.unref(m),N=e.unref(y);O.list.length>0&&N.list.length>0&&O.list.forEach(k=>{k.value=N.list.filter(D=>D.indicatorsId==k.indicatorsId).length})};return o.$baseEventBus.on("editor",O=>{e.nextTick(()=>{e.unref(b).init(O,e.unref(d))})}),r({init:V}),(O,N)=>{const k=e.resolveComponent("v-chart"),D=e.resolveComponent("AppDrawer");return e.openBlock(),e.createBlock(D,{modelValue:e.unref(s),"onUpdate:modelValue":N[4]||(N[4]=B=>e.isRef(s)?s.value=B:null),withHeader:!1,size:"100%",modalClass:"ace-modal-drawer"},{default:e.withCtx(()=>[e.createVNode(e.unref(E.ElContainer),{class:"designBody"},{default:e.withCtx(()=>[e.createVNode(e.unref(E.ElAside),{width:"310px",class:"p-3"},{default:e.withCtx(()=>[e.createVNode(nB,{ref_key:"designLeftRef",ref:m,onClick:$,onSuccess:z},null,512)]),_:1}),e.createVNode(e.unref(E.ElMain),null,{default:e.withCtx(()=>[e.unref(p)?(e.openBlock(),e.createBlock(SB,{key:0,ref_key:"designMainRef",ref:h,onEditorSuccess:T,editorRef:e.unref(f),reportObj:e.unref(d),modelValue:e.unref(c),"onUpdate:modelValue":N[2]||(N[2]=B=>e.isRef(c)?c.value=B:null)},{default:e.withCtx(()=>[e.createElementVNode("div",null,[e.createVNode(e.unref(E.ElButton),{type:"primary",onClick:N[0]||(N[0]=B=>$("submit",{}))},{default:e.withCtx(()=>[e.createTextVNode("保存报告")]),_:1}),e.createVNode(e.unref(E.ElButton),{type:"warning",onClick:N[1]||(N[1]=B=>$("close",{}))},{default:e.withCtx(()=>[e.createTextVNode("关闭")]),_:1})])]),_:1},8,["editorRef","reportObj","modelValue"])):e.createCommentVNode("",!0)]),_:1}),e.createVNode(e.unref(E.ElAside),{width:"310px",id:"useReportcontainer",class:"p-3",style:{"border-left":"1px solid #ebeef5"}},{default:e.withCtx(()=>[e.unref(f)?(e.openBlock(),e.createBlock(BB,{key:0,ref_key:"designRightRef",ref:y,onClick:$,reportObj:e.unref(d),editorRef:e.unref(f),onSuccess:z,indicatorsId:e.unref(c)},null,8,["reportObj","editorRef","indicatorsId"])):e.createCommentVNode("",!0)]),_:1})]),_:1}),e.unref(u)?(e.openBlock(),e.createElementBlock("div",OB,[e.createVNode(k,{ref_key:"echartsRef",ref:w,option:e.unref(u),autoresize:""},null,8,["option"])])):e.createCommentVNode("",!0),e.createVNode(TB,{ref_key:"designFormRef",ref:g,reportObj:e.unref(d),onSuccess:N[3]||(N[3]=B=>e.unref(y).init())},null,8,["reportObj"]),e.createVNode(fm,{ref_key:"previewRef",ref:b,type:"design"},null,512)]),_:1},8,["modelValue"])}}}),OR="",zB=Be(IB,[["__scopeId","data-v-a5619b8c"]]),RB=t=>(e.pushScopeId("data-v-6a766735"),t=t(),e.popScopeId(),t),MB={key:1,class:"flex flex-wrap pt-3 pb-7"},AB={class:"reportName line-clamp-2"},LB={class:"auth"},FB={class:"times"},jB=["onClick"],PB={class:"w-full flex justify-center mt-5"},UB=RB(()=>e.createElementVNode("div",{class:"h-px bg-gray-200 w-full mt-2"},null,-1)),WB={class:"flex w-full justify-center mt-2"},GB=e.defineComponent({__name:"index",setup(t){const{proxy:r}=e.getCurrentInstance(),n=e.ref(null),o=e.ref(null),a=e.ref(null),i=e.ref(null),l=e.reactive([]),s=e.reactive([{name:"报告名称",type:Rr.Text,fieldName:"reportName",value:""}]),d=e.ref([{label:"预览",icon:"ri-eye-line",type:"primary",key:"PREVIEW",show:!1},{label:"编辑",icon:"ri-edit-line",type:"primary",key:"EDIT",show:!1},{label:"PDF",icon:"ri-file-pdf-line",type:"warning",key:"DOWNLOAD_PDF",show:!1},{label:"WORD",icon:"ri-file-word-2-line",type:"primary",key:"DOWNLOAD_WORD",show:!1},{label:"复制",icon:"ri-file-copy-line",type:"primary",key:"COPY",show:!1},{label:"删除",icon:"ri-delete-bin-line",type:"danger",key:"DEL",show:!1}]),c=e.ref([]);De(r).getCurrFunc("INDICATORS_REPORT").then(p=>{c.value=p.data,p.data.includes("CREATE")&&l.push({name:"新增报告",key:"add",type:"primary",icon:"ri-add-line"}),e.unref(d).forEach(h=>{h.show=p.data.includes(h.key)})});const f=e.reactive([{label:"报告名称",prop:"reportName"},{label:"报告使用库",prop:"indicatorsNum",slot:!0},{label:"撰写人",prop:"createUserName"},{label:"撰写时间",prop:"createTime"},{label:"操作",prop:"action",slot:!0,width:"410px"}]),u=async p=>{const{type:h,row:m}=p;switch(h){case"zb":e.unref(o).init(m);break;case"add":r.$basePrompt({content:"新增指标报告",placeholder:"请输入报告名称",inputType:"input",beforeCloseFunc:async(y,g,b)=>{if(y!="confirm"){b();return}const w=await De(r).reportSubmit({reportName:g.inputValue});w&&(r.$message.success("操作成功"),e.unref(n).getData(),e.unref(a).init({id:w.data,reportName:g.inputValue,reportContent:""}),b())}});break;case"DEL":r.$baseConfirm({content:"是否确定删除",callConfirm:async()=>{await De(r).reportRemove(m.id)&&(r.$message.success("删除成功"),e.unref(n).getData())}});break;case"COPY":r.$baseConfirm({content:"是否确定复制",callConfirm:async()=>{await De(r).reportCopy(m.id)&&(r.$message.success("操作成功"),e.unref(n).getData())}});break;case"EDIT":e.unref(a).init(m);break;case"DOWNLOAD_PDF":case"PREVIEW":case"DOWNLOAD_WORD":e.nextTick(()=>{e.unref(i).init(h,m)});break}};return(p,h)=>{const m=e.resolveComponent("AppEmpty"),y=e.resolveComponent("AppList");return e.openBlock(),e.createElementBlock("div",null,[e.createVNode(y,{url:`/api/ace-data-center/indicators-report/list?descs=create_time&projectId=${e.unref(r).$baseGetCurrentProjectId}`,tableData:e.unref(f),searchForm:e.unref(s),searchBtns:e.unref(l),listType:"custom",onBtnClick:u,ref_key:"appListRef",ref:n},{"list-slot":e.withCtx(({list:g,loading:b})=>[e.createVNode(e.unref(E.ElSkeleton),{loading:b,animated:""},{default:e.withCtx(()=>[g.length==0?(e.openBlock(),e.createBlock(m,{key:0,description:"暂无数据"})):(e.openBlock(),e.createElementBlock("div",MB,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(g,w=>(e.openBlock(),e.createElementBlock("div",{key:w.id,class:"items"},[e.createElementVNode("div",AB,e.toDisplayString(w.reportName),1),e.createElementVNode("div",LB,"作者:"+e.toDisplayString(w.createUserName),1),e.createElementVNode("div",FB,e.toDisplayString(w.createTime),1),e.unref(c).includes("VIEW_INDICATOR")?(e.openBlock(),e.createElementBlock("div",{key:0,class:"tags",onClick:e.withModifiers(_=>u({type:"zb",row:w,index:-1}),["stop"])},[e.createTextVNode(" 查看指标库: "),e.createElementVNode("span",null,e.toDisplayString(w.indicatorsNum||0),1)],8,jB)):e.createCommentVNode("",!0),e.createElementVNode("div",PB,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(e.unref(d).filter(_=>["EDIT","COPY"].includes(_.key)),_=>(e.openBlock(),e.createElementBlock(e.Fragment,{key:_.icon},[_.show?(e.openBlock(),e.createBlock(e.unref(E.ElLink),{key:0,class:"inline-flex items-center ml-3 mr-3",type:_.type,onClick:e.withModifiers(C=>u({type:_.key,row:w,index:-1}),["stop"])},{default:e.withCtx(()=>[e.createElementVNode("i",{class:e.normalizeClass([_.icon,"mr-1 text-base"])},null,2),e.createTextVNode(" "+e.toDisplayString(_.label),1)]),_:2},1032,["type","onClick"])):e.createCommentVNode("",!0)],64))),128))]),UB,e.createElementVNode("footer",WB,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(e.unref(d).filter(_=>!["EDIT","COPY"].includes(_.key)),_=>(e.openBlock(),e.createElementBlock(e.Fragment,null,[_.show?(e.openBlock(),e.createBlock(e.unref(E.ElTooltip),{content:_.label,key:_.icon},{default:e.withCtx(()=>[e.createVNode(e.unref(E.ElLink),{class:"inline-flex items-center",type:_.type,onClick:e.withModifiers(C=>u({type:_.key,row:w,index:-1}),["stop"])},{default:e.withCtx(()=>[e.createElementVNode("i",{class:e.normalizeClass([_.icon,"mr-2 ml-2 text-lg"])},null,2)]),_:2},1032,["type","onClick"])]),_:2},1032,["content"])):e.createCommentVNode("",!0)],64))),256))])]))),128))]))]),_:2},1032,["loading"])]),_:1},8,["url","tableData","searchForm","searchBtns"]),e.createVNode(qD,{ref_key:"useIndicatorsRef",ref:o},null,512),e.createVNode(zB,{ref_key:"designRef",ref:a,onSuccess:h[0]||(h[0]=g=>e.unref(n).getData())},null,512),e.createVNode(fm,{ref_key:"previewRef",ref:i},null,512)])}}}),IR="",HB=Be(GB,[["__scopeId","data-v-6a766735"]]);function pm(t,r,n,o,a){const i=r===void 0?void 0:r.key;return{sel:t,data:r,children:n,text:o,elm:a,key:i}}const hm=Array.isArray;function Qs(t){return typeof t=="string"||typeof t=="number"||t instanceof String||t instanceof Number}function mm(t,r,n){if(t.ns="http://www.w3.org/2000/svg",n!=="foreignObject"&&r!==void 0)for(let o=0;o<r.length;++o){const a=r[o];if(typeof a=="string")continue;const i=a.data;i!==void 0&&mm(i,a.children,a.sel)}}function nn(t,r,n){let o={},a,i,l;if(n!==void 0?(r!==null&&(o=r),hm(n)?a=n:Qs(n)?i=n.toString():n&&n.sel&&(a=[n])):r!=null&&(hm(r)?a=r:Qs(r)?i=r.toString():r&&r.sel?a=[r]:o=r),a!==void 0)for(l=0;l<a.length;++l)Qs(a[l])&&(a[l]=pm(void 0,void 0,void 0,a[l],void 0));return t.startsWith("svg")&&(t.length===3||t[3]==="."||t[3]==="#")&&mm(o,a,t),pm(t,o,a,i,void 0)}const YB=(t,r,n)=>{const o=tt.DomEditor.isNodeSelected(n,t),{id:a}=tt.DomEditor.findKey(n,t),{content:i="",chartType:l="",id:s="",singleValue:d="",singleValueKey:c="",subtitle:f="",src:u="",fontSize:p="16px",bold:h="",color:m="",indicatorsType:y="INDICATORS",width:g=400}=t,{EXTEND_CONF:{indicatorConfig:b}}=n.getConfig(),{clickIndicator:w}=b,_=[];return u?(_.push(nn("img.editor-indicator-img",{props:{src:u},style:{},dataset:{id:s}})),o&&_.push(nn("input.indicator-img-range",{type:"range",style:{position:"fixed",bottom:"20px",left:"50%",transform:"translateX(-50%)",zIndex:"99"},min:300,max:550,value:g,on:{input(C){const S={id:s,chartType:l,subtitle:f,singleValue:d,singleValueKey:c,width:C.target.value};tt.SlateTransforms.setNodes(n,S,{at:tt.DomEditor.findPath(n,t)})}}}))):_.push(d||i),_.push(nn("span.indicator-tooltip",{style:{position:"absolute",background:"#fff",border:"1px solid var(--g-border-color)",lineHeight:"25px",padding:"0 5px",color:"orange",fontSize:"12px",left:"0px",top:"-30px",zIndex:"88",display:"none",whiteSpace:"nowrap",fontWeight:"normal"},dataset:{id:s}},[nn("span",{style:{color:"#000",fontWeight:"bold"}},`${i}:`),nn("span",{},f),nn("span",{style:{color:"#000"}},c?`(${c})`:"")])),nn("span.editor-indicator",{id:`editor-indicator-${a}`,props:{contentEditable:!1},dataset:{id:s,chartType:l,subtitle:f,width:g,singleValue:d,singleValueKey:c,src:u,fontSize:p,color:m,indicatorsType:y,bold:h},style:{width:`${l=="7"?null:g}px`,marginLeft:"3px",marginRight:"3px",display:"inline-block",cursor:"pointer",backgroundColor:"var(--w-e-textarea-slight-bg-color)",border:o?"2px solid var(--w-e-textarea-selected-border-color)":"2px solid transparent",borderRadius:"3px",padding:"0 3px",fontSize:p,fontWeight:h=="true"?"bold":"normal",color:m},on:{click(C){C.preventDefault(),w&&w(s,t)}}},_)},XB=t=>{const{chartType:r="",id:n="",type:o,subtitle:a,singleValue:i="",singleValueKey:l="",content:s="",src:d="",fontSize:c="16px",bold:f=!1,color:u="",indicatorsType:p="INDICATORS",width:h=400}=t;return`<span
|
|
879
879
|
class="editor-indicator"
|
|
880
880
|
data-w-e-type="indicator"
|
|
881
881
|
data-w-e-is-void
|