ace-component-lib 0.0.142 → 0.0.143

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.
@@ -1,4 +1,4 @@
1
- (function(i,n){typeof exports=="object"&&typeof module<"u"?module.exports=n(require("@wangeditor/editor"),require("vue"),require("element-plus"),require("vue-draggable-plus"),require("dayjs"),require("echarts/core"),require("@wangeditor/editor-for-vue"),require("jsoneditor")):typeof define=="function"&&define.amd?define(["@wangeditor/editor","vue","element-plus","vue-draggable-plus","dayjs","echarts/core","@wangeditor/editor-for-vue","jsoneditor"],n):(i=typeof globalThis<"u"?globalThis:i||self,i["ace-component-lib"]=n(i.editor,i.Vue,i.elementPlus,i.vueDraggablePlus,i.dayjs,i.core,i.editorForVue,i.JsonEditor))})(this,function(editor,vue,elementPlus,vueDraggablePlus,dayjs,core,editorForVue,JsonEditor){"use strict";var It=Object.defineProperty;var zt=(i,n,r)=>n in i?It(i,n,{enumerable:!0,configurable:!0,writable:!0,value:r}):i[n]=r;var xt=(i,n,r)=>(zt(i,typeof n!="symbol"?n+"":n,r),r);const version="0.0.142",aceLib="";class e{constructor(n){this.standards={strict:"strict",loose:"loose",html5:"html5"},this.previewBody=null,this.close=null,this.previewBodyUtilPrintBtn=null,this.selectArray=[],this.counter=0,this.settings={standard:this.standards.html5},Object.assign(this.settings,n),this.init()}init(){this.counter++,this.settings.id=`printArea_${this.counter}`;let n="";this.settings.url&&!this.settings.asyncUrl&&(n=this.settings.url);let r=this;if(this.settings.asyncUrl)return void r.settings.asyncUrl(function(a){let l=r.getPrintWindow(a);r.settings.preview?r.previewIfrmaeLoad():r.print(l)},r.settings.vue);let o=this.getPrintWindow(n);this.settings.url||this.write(o.doc),this.settings.preview?this.previewIfrmaeLoad():this.print(o)}addEvent(n,r,o){n.addEventListener?n.addEventListener(r,o,!1):n.attachEvent?n.attachEvent("on"+r,o):n["on"+r]=o}previewIfrmaeLoad(){let n=document.getElementById("vue-pirnt-nb-previewBox");if(n){let r=this,o=n.querySelector("iframe");this.settings.previewBeforeOpenCallback(),this.addEvent(o,"load",function(){r.previewBoxShow(),r.removeCanvasImg(),r.settings.previewOpenCallback()}),this.addEvent(n.querySelector(".previewBodyUtilPrintBtn"),"click",function(){r.settings.beforeOpenCallback(),r.settings.openCallback(),o.contentWindow.print(),r.settings.closeCallback()})}}removeCanvasImg(){let n=this;try{if(n.elsdom){let r=n.elsdom.querySelectorAll(".canvasImg");for(let o=0;o<r.length;o++)r[o].remove()}}catch(r){console.log(r)}}print(n){var r=this;let o=document.getElementById(this.settings.id)||n.f,a=document.getElementById(this.settings.id).contentWindow||n.f.contentWindow;r.settings.beforeOpenCallback(),r.addEvent(o,"load",function(){a.focus(),r.settings.openCallback(),a.print(),o.remove(),r.settings.closeCallback(),r.removeCanvasImg()})}write(n){n.open(),n.write(`${this.docType()}<html>${this.getHead()}${this.getBody()}</html>`),n.close()}docType(){return this.settings.standard===this.standards.html5?"<!DOCTYPE html>":`<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01${this.settings.standard===this.standards.loose?" Transitional":""}//EN" "http://www.w3.org/TR/html4/${this.settings.standard===this.standards.loose?"loose":"strict"}.dtd">`}getHead(){let n="",r="",o="";this.settings.extraHead&&this.settings.extraHead.replace(/([^,]+)/g,l=>{n+=l}),[].forEach.call(document.querySelectorAll("link"),function(l){l.href.indexOf(".css")>=0&&(r+=`<link type="text/css" rel="stylesheet" href="${l.href}" >`)});let a=document.styleSheets;if(a&&a.length>0)for(let l=0;l<a.length;l++)try{if(a[l].cssRules||a[l].rules){let s=a[l].cssRules||a[l].rules;for(let u=0;u<s.length;u++)o+=s[u].cssText}}catch(s){console.log(a[l].href+s)}return this.settings.extraCss&&this.settings.extraCss.replace(/([^,\s]+)/g,l=>{r+=`<link type="text/css" rel="stylesheet" href="${l}">`}),`<head><title>${this.settings.popTitle}</title>${n}${r}<style type="text/css">${o}</style></head>`}getBody(){let n=this.settings.ids;return n=n.replace(new RegExp("#","g"),""),this.elsdom=this.beforeHanler(document.getElementById(n)),"<body>"+this.getFormData(this.elsdom).outerHTML+"</body>"}beforeHanler(n){let r=n.querySelectorAll("canvas");for(let o=0;o<r.length;o++)if(!r[o].style.display){let a=r[o].parentNode,l=r[o].toDataURL("image/png"),s=new Image;s.className="canvasImg",s.style.display="none",s.src=l,a.appendChild(s)}return n}getFormData(n){let r=n.cloneNode(!0),o=r.querySelectorAll("input,select,textarea"),a=r.querySelectorAll(".canvasImg,canvas"),l=-1;for(let s=0;s<a.length;s++){let u=a[s].parentNode,c=a[s];c.tagName.toLowerCase()==="canvas"?u.removeChild(c):c.style.display="block"}for(let s=0;s<o.length;s++){let u=o[s],c=u.getAttribute("type"),d=o[s];if(c||(c=u.tagName==="SELECT"?"select":u.tagName==="TEXTAREA"?"textarea":""),u.tagName==="INPUT")c==="radio"||c==="checkbox"?u.checked&&d.setAttribute("checked",u.checked):(d.value=u.value,d.setAttribute("value",u.value));else if(c==="select"){l++;for(let f=0;f<n.querySelectorAll("select").length;f++){let p=n.querySelectorAll("select")[f];if(!p.getAttribute("newbs")&&p.setAttribute("newbs",f),p.getAttribute("newbs")==l){let v=n.querySelectorAll("select")[l].selectedIndex;u.options[v].setAttribute("selected",!0)}}}else d.innerHTML=u.value,d.setAttribute("html",u.value)}return r}getPrintWindow(n){var r=this.Iframe(n);return{f:r,win:r.contentWindow||r,doc:r.doc}}previewBoxShow(){let n=document.getElementById("vue-pirnt-nb-previewBox");n&&(document.querySelector("html").setAttribute("style","overflow: hidden"),n.style.display="block")}previewBoxHide(){let n=document.getElementById("vue-pirnt-nb-previewBox");n&&(document.querySelector("html").setAttribute("style","overflow: visible;"),n.querySelector("iframe")&&n.querySelector("iframe").remove(),n.style.display="none")}previewBox(){let n=document.getElementById("vue-pirnt-nb-previewBox"),r="previewBody";if(n)return n.querySelector("iframe")&&n.querySelector("iframe").remove(),{close:n.querySelector(".previewClose"),previewBody:n.querySelector(".previewBody")};let o=document.createElement("div");o.setAttribute("id","vue-pirnt-nb-previewBox"),o.setAttribute("style","position: fixed;top: 0px;left: 0px;width: 100%;height: 100%;background: white;display:none"),o.style.zIndex=this.settings.zIndex;let a=document.createElement("div");a.setAttribute("class","previewHeader"),a.setAttribute("style","padding: 5px 20px;"),a.innerHTML=this.settings.previewTitle,o.appendChild(a),this.close=document.createElement("div");let l=this.close;l.setAttribute("class","previewClose"),l.setAttribute("style","position: absolute;top: 5px;right: 20px;width: 25px;height: 20px;cursor: pointer;");let s=document.createElement("div"),u=document.createElement("div");s.setAttribute("class","closeBefore"),s.setAttribute("style","position: absolute;width: 3px;height: 100%;background: #040404;transform: rotate(45deg); top: 0px;left: 50%;"),u.setAttribute("class","closeAfter"),u.setAttribute("style","position: absolute;width: 3px;height: 100%;background: #040404;transform: rotate(-45deg); top: 0px;left: 50%;"),l.appendChild(s),l.appendChild(u),a.appendChild(l),this.previewBody=document.createElement("div");let c=this.previewBody;c.setAttribute("class",r),c.setAttribute("style","display: flex;flex-direction: column; height: 100%;"),o.appendChild(c);let d=document.createElement("div");d.setAttribute("class","previewBodyUtil"),d.setAttribute("style","height: 32px;background: #474747;position: relative;"),c.appendChild(d),this.previewBodyUtilPrintBtn=document.createElement("div");let f=this.previewBodyUtilPrintBtn;return f.setAttribute("class","previewBodyUtilPrintBtn"),f.innerHTML=this.settings.previewPrintBtnLabel,f.setAttribute("style","position: absolute;padding: 2px 10px;margin-top: 3px;left: 24px;font-size: 14px;color: white;cursor: pointer;background-color: rgba(0,0,0,.12);background-image: linear-gradient(hsla(0,0%,100%,.05),hsla(0,0%,100%,0));background-clip: padding-box;border: 1px solid rgba(0,0,0,.35);border-color: rgba(0,0,0,.32) rgba(0,0,0,.38) rgba(0,0,0,.42);box-shadow: inset 0 1px 0 hsla(0,0%,100%,.05), inset 0 0 1px hsla(0,0%,100%,.15), 0 1px 0 hsla(0,0%,100%,.05);"),d.appendChild(f),document.body.appendChild(o),{close:this.close,previewBody:this.previewBody}}iframeBox(n,r){let o=document.createElement("iframe");return o.style.border="0px",o.style.position="absolute",o.style.width="0px",o.style.height="0px",o.style.right="0px",o.style.top="0px",o.setAttribute("id",n),o.setAttribute("src",r),o}Iframe(n){let r=this.settings.id;n=n||new Date().getTime();let o=this,a=this.iframeBox(r,n);try{if(this.settings.preview){a.setAttribute("style","border: 0px;flex: 1;");let l=this.previewBox(),s=l.previewBody,u=l.close;s.appendChild(a),this.addEvent(u,"click",function(){o.previewBoxHide()})}else document.body.appendChild(a);a.doc=null,a.doc=a.contentDocument?a.contentDocument:a.contentWindow?a.contentWindow.document:a.document}catch(l){throw new Error(l+". iframes may not be supported in this browser.")}if(a.doc==null)throw new Error("Cannot find document.");return a}}var t={directiveName:"print",mounted(i,n,r){let o=n.instance,a="";var l,s,u;s="click",u=()=>{if(typeof n.value=="string")a=n.value;else{if(typeof n.value!="object"||!n.value.id)return void window.print();{a=n.value.id;let d=a.replace(new RegExp("#","g"),"");document.getElementById(d)||(console.log("id in Error"),a="")}}c()},(l=i).addEventListener?l.addEventListener(s,u,!1):l.attachEvent?l.attachEvent("on"+s,u):l["on"+s]=u;const c=()=>{new e({ids:a,vue:o,url:n.value.url,standard:"",extraHead:n.value.extraHead,extraCss:n.value.extraCss,zIndex:n.value.zIndex||20002,previewTitle:n.value.previewTitle||"打印预览",previewPrintBtnLabel:n.value.previewPrintBtnLabel||"打印",popTitle:n.value.popTitle,preview:n.value.preview||!1,asyncUrl:n.value.asyncUrl,previewBeforeOpenCallback(){n.value.previewBeforeOpenCallback&&n.value.previewBeforeOpenCallback(o)},previewOpenCallback(){n.value.previewOpenCallback&&n.value.previewOpenCallback(o)},openCallback(){n.value.openCallback&&n.value.openCallback(o)},closeCallback(){n.value.closeCallback&&n.value.closeCallback(o)},beforeOpenCallback(){n.value.beforeOpenCallback&&n.value.beforeOpenCallback(o)}})}},install:function(i){i.directive("print",t)}};const fetch$1=i=>{const n=i.$baseHttp,r=i.$baseGetCurrentProjectId(),o=N=>n.get("/api/ace-data-center/role-permission/get-curr-func",{params:{projectId:r,markName:"FUNC",type:N}}),a=N=>(N.projectId=r,n.post("/api/ace-data-center/indicators-report/submit",N,{headers:{loading:!0}})),l=N=>n.post("/api/ace-data-center/indicators-report/remove",{},{headers:{loading:!0},params:{ids:N}}),s=N=>n.get("/api/ace-data-center/indicators-report/copy",{headers:{loading:!0},params:{id:N}}),u=(N,O=!0)=>n.post("/api/ace-data-center/indicators-apply/mapEchartsData",{},{headers:{loading:O},params:{indicatorsApplyIds:N}}),c=(N,O=!0)=>n.post("/api/ace-data-center/indicators-apply/listIndicatorsApply",{},{headers:{loading:O},params:{projectId:r,...N}}),d=N=>n.get("/api/ace-data-center/indicators/listReportIndicatorsMenu",{params:{projectId:r,...N}}),f=N=>n.get("/api/ace-data-center/model/all",{params:{projectId:r,...N}}),p=N=>n.get("/api/ace-data-center/model-attribute/allModelAttribute",{params:{projectId:r,...N}}),v=N=>n.post("/api/ace-data-center/indicators-echarts/pullEchartsDataVO",N),m=N=>n.get("/api/ace-data-center/indicators/getIndicatorsPanelConf",{params:{indicatorsId:N},headers:{loading:!0}}),g=N=>(N.projectId=r,n.post("/api/ace-data-center/indicators-apply/submit",N,{headers:{loading:!0}})),_=(N,O)=>{const I=new FormData;return I.append("file",N),I.append("indicatorsApplyId",O),n.post("/api/ace-data-center/indicators-apply/updateIndicatorsApplyImage",I,{headers:{"Content-Type":"multipart/form-data"}})},y=()=>n.get("/api/ace-data-center/indicators-relation/tree",{params:{projectId:r}}),b=()=>n.get("/api/ace-data-center/indicators/loadIndicatorsMenu",{params:{projectId:r}}),x=N=>n.get("/api/ace-data-center/rule/list",{params:{projectId:r,...N}}),C=N=>(N.projectId=r,n.get("/api/ace-data-center/model/loadModelMenu",{params:N})),w=N=>n.get(`/api/ace-data-center/indicators/detailAndTask/${N}`),E=N=>n.get("/api/ace-data-center/indicators-echarts/detail",{params:N}),$=N=>n.post(`/api/ace-data-center/model/getFormJsonConfig/${N}`),S=N=>n.get(`/api/ace-data-center/model-attribute/listSimpleColumn/${N}`),V=N=>n.get(`/api/ace-data-center/model-attribute/listColumnInfo/${N}`),k=N=>n.get("/api/ace-api/blade-system/client/param-value",{params:N}),P={loadDataSourceMenu:()=>n.get("/api/ace-data-center/data-source/loadDataSourceMenu",{params:{projectId:r}}),listDataSourceSynchronized:N=>n.get("/api/ace-data-center/data-source/listDataSourceSynchronized",{params:N}),detail:N=>n.get("/api/ace-data-center/data-source/detail",{params:N}),dataSourceSubmit:N=>(N.type=3,N.projectId=r,n.post("/api/ace-data-center/data-source/submit",N,{headers:{loading:!0}})),testConnect:N=>(N.projectId=r,n.post("/api/ace-data-center/data-source/testConnect",N,{headers:{loading:!0}})),createModelSyncRelation:N=>(N.projectId=r,n.post("/api/ace-data-center/model-sync-relation/createModelSyncRelation",N,{headers:{loading:!0}})),createShadowModelSync:N=>(N.projectId=r,n.post("/api/ace-data-center/model-sync-relation/createShadowModelSyncRelation",N,{headers:{loading:!0}})),submitDefaultDbExtract:N=>(N.projectId=r,n.post("/api/ace-data-center/db-extract/submitDefaultDbExtract",N,{headers:{loading:!0}}))},T={getDetail:(N,O=!1)=>n.get("/api/ace-data-center/model/detail",{params:{id:N},headers:{loading:O}}),settingPublishStatus:(N,O)=>n.post(`/api/ace-data-center/model/settingPublishStatus/${N}/${O}`,{},{headers:{loading:!0}}),loadModelMenu:N=>(N.projectId=r,n.get("/api/ace-data-center/model/loadModelMenu",{params:N})),modelDataAction:(N,O="add")=>n.post(`/api/ace-data-center/model-data/${O}`,N,{headers:{loading:!0}}),allModel:N=>(N.projectId=r,n.get("/api/ace-data-center/model/all",{params:N})),allModelAttribute:N=>(N.projectId=r,n.get("/api/ace-data-center/model-attribute/allModelAttribute",{params:N})),allModelMatrix:N=>(N.projectId=r,n.get("/api/ace-data-center/model-matrix/all",{params:N})),queryRows:N=>(N.projectId=r,n.get("/api/ace-data-center/dynamicQuery/queryRows",{params:N})),modelDataDel:N=>n.post("/api/ace-data-center/model-data/delete",N,{headers:{loading:!0}})},B={saveCollaborateFlow:N=>(N.projectId=r,N.collaborateFlowNodes=B.getCollaborateFlowNodes(N.collaborateJson),n.post("/api/ace-data-center/collaborate-flow/save",{...N})),updateCollaborateFlow:N=>(N.projectId=N.projectId=r,N.collaborateFlowNodes=B.getCollaborateFlowNodes(N.collaborateJson),n.post("/api/ace-data-center/collaborate-flow/update",{...N})),detailCollaborateFlow:N=>(N.projectId=r,n.get("/api/ace-data-center/collaborate-flow/detail",{params:N})),collaborateExecRecordFlow:N=>(N.projectId=r,n.get("/api/ace-data-center/collaborate-flow/collaborateExecRecord",{params:N})),getCollaborateFlowNodes:N=>{let I=JSON.parse(N).cells,L=I.filter(M=>M.shape=="Widget"),D=I.filter(M=>M.shape=="edge");return L.map(M=>{var J,te,ae;let R=D.filter(j=>j.target.cell==M.id).map(j=>j.source.cell),z=L.filter(j=>R.includes(j.id)).map(j=>j.data.id),U=D.filter(j=>j.source.cell==M.id).map(j=>j.target.cell),G=L.filter(j=>U.includes(j.id)).map(j=>j.data.id);return{id:M.data.id,modelId:M.data.id,name:M.data.modelName,preIds:(z==null?void 0:z.toString())||"",nextIds:(G==null?void 0:G.toString())||"",triggerEventType:(J=M.data)==null?void 0:J.triggerEventType,selfEventType:(te=M.data)==null?void 0:te.selfEventType,collaborateField:(ae=M.data)==null?void 0:ae.collaborateField}})},recordCollaborateFlow:N=>(N.projectId=r,n.get("/api/ace-data-center/collaborate-flow/collaborateExecRecord",{params:N}))};return{getCurrFunc:o,reportSubmit:a,reportRemove:l,reportCopy:s,mapEchartsData:u,listIndicatorsApply:c,getEchartDetail:E,listReportIndicatorsMenu:d,pullEchartsDataVO:v,detailAndTask:w,getIndicatorsPanelConf:m,saveIndicatorsApply:g,updateIndicatorsApplyImage:_,indicatorsRelationTree:y,loadIndicatorsMenu:b,getRule:x,loadModelMenu:C,getFormJsonConfig:$,getSystemParam:k,listColumnInfo:V,allModel:f,allModelAttribute:p,listSimpleColumn:S,dbImport:P,model:T,collaborateFlow:B}};var FieldRenderType=(i=>(i.String="string",i.Integer="interget",i))(FieldRenderType||{}),DynamicTableType=(i=>(i.Default="default",i.DataForm="dataForm",i))(DynamicTableType||{}),ItableType=(i=>(i.Link="link",i))(ItableType||{}),FieldType=(i=>(i.Text="text",i.Select="select",i.Date="date",i.DateTime="datetime",i.CheckBox="checkbox",i.Switch="switch",i.Radio="radio",i.Textarea="textarea",i.Number="number",i.NumberRange="numberRange",i.Cascader="cascader",i.Daterange="daterange",i.Monthrange="monthrange",i.File="file",i.TreeSelect="treeSelect",i.Year="year",i.Month="month",i.Hr="hr",i.Slot="slot",i.Editor="editor",i.Password="password",i.Json="json",i.Markdown="markdown",i.Rate="rate",i.TimeRange="timerange",i.Time="time",i.DateTimeRange="datetimerange",i))(FieldType||{});let nanoid=(i=21)=>crypto.getRandomValues(new Uint8Array(i)).reduce((n,r)=>(r&=63,r<36?n+=r.toString(36):r<62?n+=(r-26).toString(36).toUpperCase():r>62?n+="-":n+="_",n),"");const theme=vue.ref(localStorage.getItem("design-theme")||""),stageWidth=vue.ref(1920),stageHeight=vue.ref(1080),scale$1=vue.ref(.2),targetsWidget=vue.ref([]),sketchRuleLine=vue.ref({h:[],v:[]}),widgetConfg=vue.ref({config:{backgroundColor:"transparent",backgroundImage:""},list:[]}),widgetHoverIds=vue.ref([]),pasteWidget=vue.ref([]),createLoading=vue.ref(!1),showRightPannel=vue.ref(!1),tempChartData=vue.ref({}),chartData=vue.ref({}),countMap=vue.ref({}),getScale=vue.computed(()=>vue.unref(scale$1)),getStage=vue.computed(()=>({stageWidth:vue.unref(stageWidth),stageHeight:vue.unref(stageHeight)})),getSketchRuleLine=vue.computed(()=>vue.unref(sketchRuleLine)),getTargetWidget=vue.computed(()=>vue.unref(targetsWidget)),getWidgetConfig=vue.computed(()=>{var i;return(i=vue.unref(widgetConfg))==null?void 0:i.config}),getWidgetList=vue.computed(()=>{var i;return(i=vue.unref(widgetConfg))==null?void 0:i.list}),getWidgetHoverIds=vue.computed(()=>vue.unref(widgetHoverIds)),getPasteWidget=vue.computed(()=>vue.unref(pasteWidget)),getCreateLoading=vue.computed(()=>vue.unref(createLoading)),getRightPannel=vue.computed(()=>vue.unref(showRightPannel)),getTheme=vue.computed(()=>vue.unref(theme)),getChartData=vue.computed(()=>vue.unref(chartData)),getCountMap=vue.computed(()=>vue.unref(countMap));function setSacle(i){scale$1.value=i/100}function setSketchRuleLine(i,n){vue.unref(sketchRuleLine).h=i,vue.unref(sketchRuleLine).v=n}function clearSketchRuleLine(){sketchRuleLine.value={h:[],v:[]}}function setTargetWidget(i){targetsWidget.value=i}function setWidgetList(i){vue.unref(widgetConfg).list=i}function setWidgetHoverIds(i){widgetHoverIds.value=i}function delWidgetItem(i){setWidgetList(vue.unref(getWidgetList).filter(n=>!i.includes(n.id))),setTargetWidget(vue.unref(getTargetWidget).filter(n=>!i.includes(n.id)))}function copyWidgetItem(i){pasteWidget.value=[],i.forEach(n=>{const r=vue.unref(getWidgetList).find(o=>o.id==n);r&&vue.unref(pasteWidget).push(r)})}function pasteWidgetItem(){vue.unref(pasteWidget).forEach(r=>{const o=JSON.parse(JSON.stringify(r));let a=o.x,l=o.y;o.x+40>vue.unref(stageWidth)-o.w?a=vue.unref(stageWidth)-o.w-40:a+=40,o.y+40>vue.unref(stageHeight)-o.h?l=vue.unref(stageHeight)-o.h-40:l+=40,vue.unref(widgetConfg).list.unshift({...o,id:nanoid(),x:a,y:l,z:vue.unref(widgetConfg).list.length+1,locked:!1})})}function sortWidgetList(){vue.unref(widgetConfg).list.sort((i,n)=>n.z-i.z)}function setCreateLoading(i){createLoading.value=i,i&&(targetsWidget.value=[],clearSketchRuleLine())}function setRightPannel(i){showRightPannel.value=i}function setStageWidth(i){i&&(stageWidth.value=i,vue.unref(widgetConfg).config.stageWidth=i)}function setStageHeight(i){i&&(stageHeight.value=i,vue.unref(widgetConfg).config.stageHeight=i)}function setTheme(){theme.value=vue.unref(theme)=="dark"?"":"dark",document.getElementsByTagName("html")[0].className=vue.unref(theme),localStorage.setItem("design-theme",vue.unref(theme))}function setChartData(i){chartData.value=i}function setCountMap(i,n){vue.unref(countMap)[i]=n}const useScreenDesign=()=>({theme,stageWidth,stageHeight,scale:scale$1,targetsWidget,sketchRuleLine,widgetConfg,widgetHoverIds,pasteWidget,createLoading,showRightPannel,tempChartData,chartData,countMap,getScale,getStage,getSketchRuleLine,getTargetWidget,getWidgetConfig,getWidgetList,getWidgetHoverIds,getPasteWidget,getCreateLoading,getRightPannel,getTheme,getChartData,getCountMap,setSacle,setSketchRuleLine,clearSketchRuleLine,setTargetWidget,setWidgetList,setWidgetHoverIds,delWidgetItem,copyWidgetItem,pasteWidgetItem,sortWidgetList,setCreateLoading,setRightPannel,setStageWidth,setStageHeight,setTheme,setChartData,setCountMap});/*!
1
+ (function(i,n){typeof exports=="object"&&typeof module<"u"?module.exports=n(require("@wangeditor/editor"),require("vue"),require("element-plus"),require("vue-draggable-plus"),require("dayjs"),require("echarts/core"),require("@wangeditor/editor-for-vue"),require("jsoneditor")):typeof define=="function"&&define.amd?define(["@wangeditor/editor","vue","element-plus","vue-draggable-plus","dayjs","echarts/core","@wangeditor/editor-for-vue","jsoneditor"],n):(i=typeof globalThis<"u"?globalThis:i||self,i["ace-component-lib"]=n(i.editor,i.Vue,i.elementPlus,i.vueDraggablePlus,i.dayjs,i.core,i.editorForVue,i.JsonEditor))})(this,function(editor,vue,elementPlus,vueDraggablePlus,dayjs,core,editorForVue,JsonEditor){"use strict";var It=Object.defineProperty;var zt=(i,n,r)=>n in i?It(i,n,{enumerable:!0,configurable:!0,writable:!0,value:r}):i[n]=r;var xt=(i,n,r)=>(zt(i,typeof n!="symbol"?n+"":n,r),r);const version="0.0.143",aceLib="";class e{constructor(n){this.standards={strict:"strict",loose:"loose",html5:"html5"},this.previewBody=null,this.close=null,this.previewBodyUtilPrintBtn=null,this.selectArray=[],this.counter=0,this.settings={standard:this.standards.html5},Object.assign(this.settings,n),this.init()}init(){this.counter++,this.settings.id=`printArea_${this.counter}`;let n="";this.settings.url&&!this.settings.asyncUrl&&(n=this.settings.url);let r=this;if(this.settings.asyncUrl)return void r.settings.asyncUrl(function(a){let l=r.getPrintWindow(a);r.settings.preview?r.previewIfrmaeLoad():r.print(l)},r.settings.vue);let o=this.getPrintWindow(n);this.settings.url||this.write(o.doc),this.settings.preview?this.previewIfrmaeLoad():this.print(o)}addEvent(n,r,o){n.addEventListener?n.addEventListener(r,o,!1):n.attachEvent?n.attachEvent("on"+r,o):n["on"+r]=o}previewIfrmaeLoad(){let n=document.getElementById("vue-pirnt-nb-previewBox");if(n){let r=this,o=n.querySelector("iframe");this.settings.previewBeforeOpenCallback(),this.addEvent(o,"load",function(){r.previewBoxShow(),r.removeCanvasImg(),r.settings.previewOpenCallback()}),this.addEvent(n.querySelector(".previewBodyUtilPrintBtn"),"click",function(){r.settings.beforeOpenCallback(),r.settings.openCallback(),o.contentWindow.print(),r.settings.closeCallback()})}}removeCanvasImg(){let n=this;try{if(n.elsdom){let r=n.elsdom.querySelectorAll(".canvasImg");for(let o=0;o<r.length;o++)r[o].remove()}}catch(r){console.log(r)}}print(n){var r=this;let o=document.getElementById(this.settings.id)||n.f,a=document.getElementById(this.settings.id).contentWindow||n.f.contentWindow;r.settings.beforeOpenCallback(),r.addEvent(o,"load",function(){a.focus(),r.settings.openCallback(),a.print(),o.remove(),r.settings.closeCallback(),r.removeCanvasImg()})}write(n){n.open(),n.write(`${this.docType()}<html>${this.getHead()}${this.getBody()}</html>`),n.close()}docType(){return this.settings.standard===this.standards.html5?"<!DOCTYPE html>":`<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01${this.settings.standard===this.standards.loose?" Transitional":""}//EN" "http://www.w3.org/TR/html4/${this.settings.standard===this.standards.loose?"loose":"strict"}.dtd">`}getHead(){let n="",r="",o="";this.settings.extraHead&&this.settings.extraHead.replace(/([^,]+)/g,l=>{n+=l}),[].forEach.call(document.querySelectorAll("link"),function(l){l.href.indexOf(".css")>=0&&(r+=`<link type="text/css" rel="stylesheet" href="${l.href}" >`)});let a=document.styleSheets;if(a&&a.length>0)for(let l=0;l<a.length;l++)try{if(a[l].cssRules||a[l].rules){let s=a[l].cssRules||a[l].rules;for(let u=0;u<s.length;u++)o+=s[u].cssText}}catch(s){console.log(a[l].href+s)}return this.settings.extraCss&&this.settings.extraCss.replace(/([^,\s]+)/g,l=>{r+=`<link type="text/css" rel="stylesheet" href="${l}">`}),`<head><title>${this.settings.popTitle}</title>${n}${r}<style type="text/css">${o}</style></head>`}getBody(){let n=this.settings.ids;return n=n.replace(new RegExp("#","g"),""),this.elsdom=this.beforeHanler(document.getElementById(n)),"<body>"+this.getFormData(this.elsdom).outerHTML+"</body>"}beforeHanler(n){let r=n.querySelectorAll("canvas");for(let o=0;o<r.length;o++)if(!r[o].style.display){let a=r[o].parentNode,l=r[o].toDataURL("image/png"),s=new Image;s.className="canvasImg",s.style.display="none",s.src=l,a.appendChild(s)}return n}getFormData(n){let r=n.cloneNode(!0),o=r.querySelectorAll("input,select,textarea"),a=r.querySelectorAll(".canvasImg,canvas"),l=-1;for(let s=0;s<a.length;s++){let u=a[s].parentNode,c=a[s];c.tagName.toLowerCase()==="canvas"?u.removeChild(c):c.style.display="block"}for(let s=0;s<o.length;s++){let u=o[s],c=u.getAttribute("type"),d=o[s];if(c||(c=u.tagName==="SELECT"?"select":u.tagName==="TEXTAREA"?"textarea":""),u.tagName==="INPUT")c==="radio"||c==="checkbox"?u.checked&&d.setAttribute("checked",u.checked):(d.value=u.value,d.setAttribute("value",u.value));else if(c==="select"){l++;for(let f=0;f<n.querySelectorAll("select").length;f++){let p=n.querySelectorAll("select")[f];if(!p.getAttribute("newbs")&&p.setAttribute("newbs",f),p.getAttribute("newbs")==l){let v=n.querySelectorAll("select")[l].selectedIndex;u.options[v].setAttribute("selected",!0)}}}else d.innerHTML=u.value,d.setAttribute("html",u.value)}return r}getPrintWindow(n){var r=this.Iframe(n);return{f:r,win:r.contentWindow||r,doc:r.doc}}previewBoxShow(){let n=document.getElementById("vue-pirnt-nb-previewBox");n&&(document.querySelector("html").setAttribute("style","overflow: hidden"),n.style.display="block")}previewBoxHide(){let n=document.getElementById("vue-pirnt-nb-previewBox");n&&(document.querySelector("html").setAttribute("style","overflow: visible;"),n.querySelector("iframe")&&n.querySelector("iframe").remove(),n.style.display="none")}previewBox(){let n=document.getElementById("vue-pirnt-nb-previewBox"),r="previewBody";if(n)return n.querySelector("iframe")&&n.querySelector("iframe").remove(),{close:n.querySelector(".previewClose"),previewBody:n.querySelector(".previewBody")};let o=document.createElement("div");o.setAttribute("id","vue-pirnt-nb-previewBox"),o.setAttribute("style","position: fixed;top: 0px;left: 0px;width: 100%;height: 100%;background: white;display:none"),o.style.zIndex=this.settings.zIndex;let a=document.createElement("div");a.setAttribute("class","previewHeader"),a.setAttribute("style","padding: 5px 20px;"),a.innerHTML=this.settings.previewTitle,o.appendChild(a),this.close=document.createElement("div");let l=this.close;l.setAttribute("class","previewClose"),l.setAttribute("style","position: absolute;top: 5px;right: 20px;width: 25px;height: 20px;cursor: pointer;");let s=document.createElement("div"),u=document.createElement("div");s.setAttribute("class","closeBefore"),s.setAttribute("style","position: absolute;width: 3px;height: 100%;background: #040404;transform: rotate(45deg); top: 0px;left: 50%;"),u.setAttribute("class","closeAfter"),u.setAttribute("style","position: absolute;width: 3px;height: 100%;background: #040404;transform: rotate(-45deg); top: 0px;left: 50%;"),l.appendChild(s),l.appendChild(u),a.appendChild(l),this.previewBody=document.createElement("div");let c=this.previewBody;c.setAttribute("class",r),c.setAttribute("style","display: flex;flex-direction: column; height: 100%;"),o.appendChild(c);let d=document.createElement("div");d.setAttribute("class","previewBodyUtil"),d.setAttribute("style","height: 32px;background: #474747;position: relative;"),c.appendChild(d),this.previewBodyUtilPrintBtn=document.createElement("div");let f=this.previewBodyUtilPrintBtn;return f.setAttribute("class","previewBodyUtilPrintBtn"),f.innerHTML=this.settings.previewPrintBtnLabel,f.setAttribute("style","position: absolute;padding: 2px 10px;margin-top: 3px;left: 24px;font-size: 14px;color: white;cursor: pointer;background-color: rgba(0,0,0,.12);background-image: linear-gradient(hsla(0,0%,100%,.05),hsla(0,0%,100%,0));background-clip: padding-box;border: 1px solid rgba(0,0,0,.35);border-color: rgba(0,0,0,.32) rgba(0,0,0,.38) rgba(0,0,0,.42);box-shadow: inset 0 1px 0 hsla(0,0%,100%,.05), inset 0 0 1px hsla(0,0%,100%,.15), 0 1px 0 hsla(0,0%,100%,.05);"),d.appendChild(f),document.body.appendChild(o),{close:this.close,previewBody:this.previewBody}}iframeBox(n,r){let o=document.createElement("iframe");return o.style.border="0px",o.style.position="absolute",o.style.width="0px",o.style.height="0px",o.style.right="0px",o.style.top="0px",o.setAttribute("id",n),o.setAttribute("src",r),o}Iframe(n){let r=this.settings.id;n=n||new Date().getTime();let o=this,a=this.iframeBox(r,n);try{if(this.settings.preview){a.setAttribute("style","border: 0px;flex: 1;");let l=this.previewBox(),s=l.previewBody,u=l.close;s.appendChild(a),this.addEvent(u,"click",function(){o.previewBoxHide()})}else document.body.appendChild(a);a.doc=null,a.doc=a.contentDocument?a.contentDocument:a.contentWindow?a.contentWindow.document:a.document}catch(l){throw new Error(l+". iframes may not be supported in this browser.")}if(a.doc==null)throw new Error("Cannot find document.");return a}}var t={directiveName:"print",mounted(i,n,r){let o=n.instance,a="";var l,s,u;s="click",u=()=>{if(typeof n.value=="string")a=n.value;else{if(typeof n.value!="object"||!n.value.id)return void window.print();{a=n.value.id;let d=a.replace(new RegExp("#","g"),"");document.getElementById(d)||(console.log("id in Error"),a="")}}c()},(l=i).addEventListener?l.addEventListener(s,u,!1):l.attachEvent?l.attachEvent("on"+s,u):l["on"+s]=u;const c=()=>{new e({ids:a,vue:o,url:n.value.url,standard:"",extraHead:n.value.extraHead,extraCss:n.value.extraCss,zIndex:n.value.zIndex||20002,previewTitle:n.value.previewTitle||"打印预览",previewPrintBtnLabel:n.value.previewPrintBtnLabel||"打印",popTitle:n.value.popTitle,preview:n.value.preview||!1,asyncUrl:n.value.asyncUrl,previewBeforeOpenCallback(){n.value.previewBeforeOpenCallback&&n.value.previewBeforeOpenCallback(o)},previewOpenCallback(){n.value.previewOpenCallback&&n.value.previewOpenCallback(o)},openCallback(){n.value.openCallback&&n.value.openCallback(o)},closeCallback(){n.value.closeCallback&&n.value.closeCallback(o)},beforeOpenCallback(){n.value.beforeOpenCallback&&n.value.beforeOpenCallback(o)}})}},install:function(i){i.directive("print",t)}};const fetch$1=i=>{const n=i.$baseHttp,r=i.$baseGetCurrentProjectId(),o=N=>n.get("/api/ace-data-center/role-permission/get-curr-func",{params:{projectId:r,markName:"FUNC",type:N}}),a=N=>(N.projectId=r,n.post("/api/ace-data-center/indicators-report/submit",N,{headers:{loading:!0}})),l=N=>n.post("/api/ace-data-center/indicators-report/remove",{},{headers:{loading:!0},params:{ids:N}}),s=N=>n.get("/api/ace-data-center/indicators-report/copy",{headers:{loading:!0},params:{id:N}}),u=(N,O=!0)=>n.post("/api/ace-data-center/indicators-apply/mapEchartsData",{},{headers:{loading:O},params:{indicatorsApplyIds:N}}),c=(N,O=!0)=>n.post("/api/ace-data-center/indicators-apply/listIndicatorsApply",{},{headers:{loading:O},params:{projectId:r,...N}}),d=N=>n.get("/api/ace-data-center/indicators/listReportIndicatorsMenu",{params:{projectId:r,...N}}),f=N=>n.get("/api/ace-data-center/model/all",{params:{projectId:r,...N}}),p=N=>n.get("/api/ace-data-center/model-attribute/allModelAttribute",{params:{projectId:r,...N}}),v=N=>n.post("/api/ace-data-center/indicators-echarts/pullEchartsDataVO",N),m=N=>n.get("/api/ace-data-center/indicators/getIndicatorsPanelConf",{params:{indicatorsId:N},headers:{loading:!0}}),g=N=>(N.projectId=r,n.post("/api/ace-data-center/indicators-apply/submit",N,{headers:{loading:!0}})),_=(N,O)=>{const I=new FormData;return I.append("file",N),I.append("indicatorsApplyId",O),n.post("/api/ace-data-center/indicators-apply/updateIndicatorsApplyImage",I,{headers:{"Content-Type":"multipart/form-data"}})},y=()=>n.get("/api/ace-data-center/indicators-relation/tree",{params:{projectId:r}}),b=()=>n.get("/api/ace-data-center/indicators/loadIndicatorsMenu",{params:{projectId:r}}),x=N=>n.get("/api/ace-data-center/rule/list",{params:{projectId:r,...N}}),C=N=>(N.projectId=r,n.get("/api/ace-data-center/model/loadModelMenu",{params:N})),w=N=>n.get(`/api/ace-data-center/indicators/detailAndTask/${N}`),E=N=>n.get("/api/ace-data-center/indicators-echarts/detail",{params:N}),$=N=>n.post(`/api/ace-data-center/model/getFormJsonConfig/${N}`),S=N=>n.get(`/api/ace-data-center/model-attribute/listSimpleColumn/${N}`),V=N=>n.get(`/api/ace-data-center/model-attribute/listColumnInfo/${N}`),k=N=>n.get("/api/ace-api/blade-system/client/param-value",{params:N}),P={loadDataSourceMenu:()=>n.get("/api/ace-data-center/data-source/loadDataSourceMenu",{params:{projectId:r}}),listDataSourceSynchronized:N=>n.get("/api/ace-data-center/data-source/listDataSourceSynchronized",{params:N}),detail:N=>n.get("/api/ace-data-center/data-source/detail",{params:N}),dataSourceSubmit:N=>(N.type=3,N.projectId=r,n.post("/api/ace-data-center/data-source/submit",N,{headers:{loading:!0}})),testConnect:N=>(N.projectId=r,n.post("/api/ace-data-center/data-source/testConnect",N,{headers:{loading:!0}})),createModelSyncRelation:N=>(N.projectId=r,n.post("/api/ace-data-center/model-sync-relation/createModelSyncRelation",N,{headers:{loading:!0}})),createShadowModelSync:N=>(N.projectId=r,n.post("/api/ace-data-center/model-sync-relation/createShadowModelSyncRelation",N,{headers:{loading:!0}})),submitDefaultDbExtract:N=>(N.projectId=r,n.post("/api/ace-data-center/db-extract/submitDefaultDbExtract",N,{headers:{loading:!0}}))},T={getDetail:(N,O=!1)=>n.get("/api/ace-data-center/model/detail",{params:{id:N},headers:{loading:O}}),settingPublishStatus:(N,O)=>n.post(`/api/ace-data-center/model/settingPublishStatus/${N}/${O}`,{},{headers:{loading:!0}}),loadModelMenu:N=>(N.projectId=r,n.get("/api/ace-data-center/model/loadModelMenu",{params:N})),modelDataAction:(N,O="add")=>n.post(`/api/ace-data-center/model-data/${O}`,N,{headers:{loading:!0}}),allModel:N=>(N.projectId=r,n.get("/api/ace-data-center/model/all",{params:N})),allModelAttribute:N=>(N.projectId=r,n.get("/api/ace-data-center/model-attribute/allModelAttribute",{params:N})),allModelMatrix:N=>(N.projectId=r,n.get("/api/ace-data-center/model-matrix/all",{params:N})),queryRows:N=>(N.projectId=r,n.get("/api/ace-data-center/dynamicQuery/queryRows",{params:N})),modelDataDel:N=>n.post("/api/ace-data-center/model-data/delete",N,{headers:{loading:!0}})},B={saveCollaborateFlow:N=>(N.projectId=r,N.collaborateFlowNodes=B.getCollaborateFlowNodes(N.collaborateJson),n.post("/api/ace-data-center/collaborate-flow/save",{...N})),updateCollaborateFlow:N=>(N.projectId=N.projectId=r,N.collaborateFlowNodes=B.getCollaborateFlowNodes(N.collaborateJson),n.post("/api/ace-data-center/collaborate-flow/update",{...N})),detailCollaborateFlow:N=>(N.projectId=r,n.get("/api/ace-data-center/collaborate-flow/detail",{params:N})),collaborateExecRecordFlow:N=>(N.projectId=r,n.get("/api/ace-data-center/collaborate-flow/collaborateExecRecord",{params:N})),getCollaborateFlowNodes:N=>{let I=JSON.parse(N).cells,L=I.filter(M=>M.shape=="Widget"),D=I.filter(M=>M.shape=="edge");return L.map(M=>{var J,te,ae;let R=D.filter(j=>j.target.cell==M.id).map(j=>j.source.cell),z=L.filter(j=>R.includes(j.id)).map(j=>j.data.id),U=D.filter(j=>j.source.cell==M.id).map(j=>j.target.cell),G=L.filter(j=>U.includes(j.id)).map(j=>j.data.id);return{id:M.data.id,modelId:M.data.id,name:M.data.modelName,preIds:(z==null?void 0:z.toString())||"",nextIds:(G==null?void 0:G.toString())||"",triggerEventType:(J=M.data)==null?void 0:J.triggerEventType,selfEventType:(te=M.data)==null?void 0:te.selfEventType,collaborateField:(ae=M.data)==null?void 0:ae.collaborateField}})},recordCollaborateFlow:N=>(N.projectId=r,n.get("/api/ace-data-center/collaborate-flow/collaborateExecRecord",{params:N}))};return{getCurrFunc:o,reportSubmit:a,reportRemove:l,reportCopy:s,mapEchartsData:u,listIndicatorsApply:c,getEchartDetail:E,listReportIndicatorsMenu:d,pullEchartsDataVO:v,detailAndTask:w,getIndicatorsPanelConf:m,saveIndicatorsApply:g,updateIndicatorsApplyImage:_,indicatorsRelationTree:y,loadIndicatorsMenu:b,getRule:x,loadModelMenu:C,getFormJsonConfig:$,getSystemParam:k,listColumnInfo:V,allModel:f,allModelAttribute:p,listSimpleColumn:S,dbImport:P,model:T,collaborateFlow:B}};var FieldRenderType=(i=>(i.String="string",i.Integer="interget",i))(FieldRenderType||{}),DynamicTableType=(i=>(i.Default="default",i.DataForm="dataForm",i))(DynamicTableType||{}),ItableType=(i=>(i.Link="link",i))(ItableType||{}),FieldType=(i=>(i.Text="text",i.Select="select",i.Date="date",i.DateTime="datetime",i.CheckBox="checkbox",i.Switch="switch",i.Radio="radio",i.Textarea="textarea",i.Number="number",i.NumberRange="numberRange",i.Cascader="cascader",i.Daterange="daterange",i.Monthrange="monthrange",i.File="file",i.TreeSelect="treeSelect",i.Year="year",i.Month="month",i.Hr="hr",i.Slot="slot",i.Editor="editor",i.Password="password",i.Json="json",i.Markdown="markdown",i.Rate="rate",i.TimeRange="timerange",i.Time="time",i.DateTimeRange="datetimerange",i))(FieldType||{});let nanoid=(i=21)=>crypto.getRandomValues(new Uint8Array(i)).reduce((n,r)=>(r&=63,r<36?n+=r.toString(36):r<62?n+=(r-26).toString(36).toUpperCase():r>62?n+="-":n+="_",n),"");const theme=vue.ref(localStorage.getItem("design-theme")||""),stageWidth=vue.ref(1920),stageHeight=vue.ref(1080),scale$1=vue.ref(.2),targetsWidget=vue.ref([]),sketchRuleLine=vue.ref({h:[],v:[]}),widgetConfg=vue.ref({config:{backgroundColor:"transparent",backgroundImage:""},list:[]}),widgetHoverIds=vue.ref([]),pasteWidget=vue.ref([]),createLoading=vue.ref(!1),showRightPannel=vue.ref(!1),tempChartData=vue.ref({}),chartData=vue.ref({}),countMap=vue.ref({}),getScale=vue.computed(()=>vue.unref(scale$1)),getStage=vue.computed(()=>({stageWidth:vue.unref(stageWidth),stageHeight:vue.unref(stageHeight)})),getSketchRuleLine=vue.computed(()=>vue.unref(sketchRuleLine)),getTargetWidget=vue.computed(()=>vue.unref(targetsWidget)),getWidgetConfig=vue.computed(()=>{var i;return(i=vue.unref(widgetConfg))==null?void 0:i.config}),getWidgetList=vue.computed(()=>{var i;return(i=vue.unref(widgetConfg))==null?void 0:i.list}),getWidgetHoverIds=vue.computed(()=>vue.unref(widgetHoverIds)),getPasteWidget=vue.computed(()=>vue.unref(pasteWidget)),getCreateLoading=vue.computed(()=>vue.unref(createLoading)),getRightPannel=vue.computed(()=>vue.unref(showRightPannel)),getTheme=vue.computed(()=>vue.unref(theme)),getChartData=vue.computed(()=>vue.unref(chartData)),getCountMap=vue.computed(()=>vue.unref(countMap));function setSacle(i){scale$1.value=i/100}function setSketchRuleLine(i,n){vue.unref(sketchRuleLine).h=i,vue.unref(sketchRuleLine).v=n}function clearSketchRuleLine(){sketchRuleLine.value={h:[],v:[]}}function setTargetWidget(i){targetsWidget.value=i}function setWidgetList(i){vue.unref(widgetConfg).list=i}function setWidgetHoverIds(i){widgetHoverIds.value=i}function delWidgetItem(i){setWidgetList(vue.unref(getWidgetList).filter(n=>!i.includes(n.id))),setTargetWidget(vue.unref(getTargetWidget).filter(n=>!i.includes(n.id)))}function copyWidgetItem(i){pasteWidget.value=[],i.forEach(n=>{const r=vue.unref(getWidgetList).find(o=>o.id==n);r&&vue.unref(pasteWidget).push(r)})}function pasteWidgetItem(){vue.unref(pasteWidget).forEach(r=>{const o=JSON.parse(JSON.stringify(r));let a=o.x,l=o.y;o.x+40>vue.unref(stageWidth)-o.w?a=vue.unref(stageWidth)-o.w-40:a+=40,o.y+40>vue.unref(stageHeight)-o.h?l=vue.unref(stageHeight)-o.h-40:l+=40,vue.unref(widgetConfg).list.unshift({...o,id:nanoid(),x:a,y:l,z:vue.unref(widgetConfg).list.length+1,locked:!1})})}function sortWidgetList(){vue.unref(widgetConfg).list.sort((i,n)=>n.z-i.z)}function setCreateLoading(i){createLoading.value=i,i&&(targetsWidget.value=[],clearSketchRuleLine())}function setRightPannel(i){showRightPannel.value=i}function setStageWidth(i){i&&(stageWidth.value=i,vue.unref(widgetConfg).config.stageWidth=i)}function setStageHeight(i){i&&(stageHeight.value=i,vue.unref(widgetConfg).config.stageHeight=i)}function setTheme(){theme.value=vue.unref(theme)=="dark"?"":"dark",document.getElementsByTagName("html")[0].className=vue.unref(theme),localStorage.setItem("design-theme",vue.unref(theme))}function setChartData(i){chartData.value=i}function setCountMap(i,n){vue.unref(countMap)[i]=n}const useScreenDesign=()=>({theme,stageWidth,stageHeight,scale:scale$1,targetsWidget,sketchRuleLine,widgetConfg,widgetHoverIds,pasteWidget,createLoading,showRightPannel,tempChartData,chartData,countMap,getScale,getStage,getSketchRuleLine,getTargetWidget,getWidgetConfig,getWidgetList,getWidgetHoverIds,getPasteWidget,getCreateLoading,getRightPannel,getTheme,getChartData,getCountMap,setSacle,setSketchRuleLine,clearSketchRuleLine,setTargetWidget,setWidgetList,setWidgetHoverIds,delWidgetItem,copyWidgetItem,pasteWidgetItem,sortWidgetList,setCreateLoading,setRightPannel,setStageWidth,setStageHeight,setTheme,setChartData,setCountMap});/*!
2
2
  * Compressor.js v1.2.1
3
3
  * https://fengyuanchen.github.io/compressorjs
4
4
  *
@@ -612,7 +612,7 @@ ${p} div ,${p} span,${p} a,${p} * {
612
612
  * https://clipboardjs.com/
613
613
  *
614
614
  * Licensed MIT © Zeno Rocha
615
- */(function(i,n){(function(o,a){i.exports=a()})(commonjsGlobal,function(){return function(){var r={686:function(l,s,u){u.d(s,{default:function(){return z}});var c=u(279),d=u.n(c),f=u(370),p=u.n(f),v=u(817),m=u.n(v);function g(U){try{return document.execCommand(U)}catch{return!1}}var _=function(G){var J=m()(G);return g("cut"),J},y=_;function b(U){var G=document.documentElement.getAttribute("dir")==="rtl",J=document.createElement("textarea");J.style.fontSize="12pt",J.style.border="0",J.style.padding="0",J.style.margin="0",J.style.position="absolute",J.style[G?"right":"left"]="-9999px";var te=window.pageYOffset||document.documentElement.scrollTop;return J.style.top="".concat(te,"px"),J.setAttribute("readonly",""),J.value=U,J}var x=function(G,J){var te=b(G);J.container.appendChild(te);var ae=m()(te);return g("copy"),te.remove(),ae},C=function(G){var J=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{container:document.body},te="";return typeof G=="string"?te=x(G,J):G instanceof HTMLInputElement&&!["text","search","url","tel","password"].includes(G==null?void 0:G.type)?te=x(G.value,J):(te=m()(G),g("copy")),te},w=C;function E(U){"@babel/helpers - typeof";return typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?E=function(J){return typeof J}:E=function(J){return J&&typeof Symbol=="function"&&J.constructor===Symbol&&J!==Symbol.prototype?"symbol":typeof J},E(U)}var $=function(){var G=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},J=G.action,te=J===void 0?"copy":J,ae=G.container,j=G.target,ee=G.text;if(te!=="copy"&&te!=="cut")throw new Error('Invalid "action" value, use either "copy" or "cut"');if(j!==void 0)if(j&&E(j)==="object"&&j.nodeType===1){if(te==="copy"&&j.hasAttribute("disabled"))throw new Error('Invalid "target" attribute. Please use "readonly" instead of "disabled" attribute');if(te==="cut"&&(j.hasAttribute("readonly")||j.hasAttribute("disabled")))throw new Error(`Invalid "target" attribute. You can't cut text from elements with "readonly" or "disabled" attributes`)}else throw new Error('Invalid "target" value, use a valid Element');if(ee)return w(ee,{container:ae});if(j)return te==="cut"?y(j):w(j,{container:ae})},S=$;function V(U){"@babel/helpers - typeof";return typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?V=function(J){return typeof J}:V=function(J){return J&&typeof Symbol=="function"&&J.constructor===Symbol&&J!==Symbol.prototype?"symbol":typeof J},V(U)}function k(U,G){if(!(U instanceof G))throw new TypeError("Cannot call a class as a function")}function P(U,G){for(var J=0;J<G.length;J++){var te=G[J];te.enumerable=te.enumerable||!1,te.configurable=!0,"value"in te&&(te.writable=!0),Object.defineProperty(U,te.key,te)}}function T(U,G,J){return G&&P(U.prototype,G),J&&P(U,J),U}function B(U,G){if(typeof G!="function"&&G!==null)throw new TypeError("Super expression must either be null or a function");U.prototype=Object.create(G&&G.prototype,{constructor:{value:U,writable:!0,configurable:!0}}),G&&N(U,G)}function N(U,G){return N=Object.setPrototypeOf||function(te,ae){return te.__proto__=ae,te},N(U,G)}function O(U){var G=D();return function(){var te=F(U),ae;if(G){var j=F(this).constructor;ae=Reflect.construct(te,arguments,j)}else ae=te.apply(this,arguments);return I(this,ae)}}function I(U,G){return G&&(V(G)==="object"||typeof G=="function")?G:L(U)}function L(U){if(U===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return U}function D(){if(typeof Reflect>"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],function(){})),!0}catch{return!1}}function F(U){return F=Object.setPrototypeOf?Object.getPrototypeOf:function(J){return J.__proto__||Object.getPrototypeOf(J)},F(U)}function M(U,G){var J="data-clipboard-".concat(U);if(G.hasAttribute(J))return G.getAttribute(J)}var R=function(U){B(J,U);var G=O(J);function J(te,ae){var j;return k(this,J),j=G.call(this),j.resolveOptions(ae),j.listenClick(te),j}return T(J,[{key:"resolveOptions",value:function(){var ae=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};this.action=typeof ae.action=="function"?ae.action:this.defaultAction,this.target=typeof ae.target=="function"?ae.target:this.defaultTarget,this.text=typeof ae.text=="function"?ae.text:this.defaultText,this.container=V(ae.container)==="object"?ae.container:document.body}},{key:"listenClick",value:function(ae){var j=this;this.listener=p()(ae,"click",function(ee){return j.onClick(ee)})}},{key:"onClick",value:function(ae){var j=ae.delegateTarget||ae.currentTarget,ee=this.action(j)||"copy",le=S({action:ee,container:this.container,target:this.target(j),text:this.text(j)});this.emit(le?"success":"error",{action:ee,text:le,trigger:j,clearSelection:function(){j&&j.focus(),window.getSelection().removeAllRanges()}})}},{key:"defaultAction",value:function(ae){return M("action",ae)}},{key:"defaultTarget",value:function(ae){var j=M("target",ae);if(j)return document.querySelector(j)}},{key:"defaultText",value:function(ae){return M("text",ae)}},{key:"destroy",value:function(){this.listener.destroy()}}],[{key:"copy",value:function(ae){var j=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{container:document.body};return w(ae,j)}},{key:"cut",value:function(ae){return y(ae)}},{key:"isSupported",value:function(){var ae=arguments.length>0&&arguments[0]!==void 0?arguments[0]:["copy","cut"],j=typeof ae=="string"?[ae]:ae,ee=!!document.queryCommandSupported;return j.forEach(function(le){ee=ee&&!!document.queryCommandSupported(le)}),ee}}]),J}(d()),z=R},828:function(l){var s=9;if(typeof Element<"u"&&!Element.prototype.matches){var u=Element.prototype;u.matches=u.matchesSelector||u.mozMatchesSelector||u.msMatchesSelector||u.oMatchesSelector||u.webkitMatchesSelector}function c(d,f){for(;d&&d.nodeType!==s;){if(typeof d.matches=="function"&&d.matches(f))return d;d=d.parentNode}}l.exports=c},438:function(l,s,u){var c=u(828);function d(v,m,g,_,y){var b=p.apply(this,arguments);return v.addEventListener(g,b,y),{destroy:function(){v.removeEventListener(g,b,y)}}}function f(v,m,g,_,y){return typeof v.addEventListener=="function"?d.apply(null,arguments):typeof g=="function"?d.bind(null,document).apply(null,arguments):(typeof v=="string"&&(v=document.querySelectorAll(v)),Array.prototype.map.call(v,function(b){return d(b,m,g,_,y)}))}function p(v,m,g,_){return function(y){y.delegateTarget=c(y.target,m),y.delegateTarget&&_.call(v,y)}}l.exports=f},879:function(l,s){s.node=function(u){return u!==void 0&&u instanceof HTMLElement&&u.nodeType===1},s.nodeList=function(u){var c=Object.prototype.toString.call(u);return u!==void 0&&(c==="[object NodeList]"||c==="[object HTMLCollection]")&&"length"in u&&(u.length===0||s.node(u[0]))},s.string=function(u){return typeof u=="string"||u instanceof String},s.fn=function(u){var c=Object.prototype.toString.call(u);return c==="[object Function]"}},370:function(l,s,u){var c=u(879),d=u(438);function f(g,_,y){if(!g&&!_&&!y)throw new Error("Missing required arguments");if(!c.string(_))throw new TypeError("Second argument must be a String");if(!c.fn(y))throw new TypeError("Third argument must be a Function");if(c.node(g))return p(g,_,y);if(c.nodeList(g))return v(g,_,y);if(c.string(g))return m(g,_,y);throw new TypeError("First argument must be a String, HTMLElement, HTMLCollection, or NodeList")}function p(g,_,y){return g.addEventListener(_,y),{destroy:function(){g.removeEventListener(_,y)}}}function v(g,_,y){return Array.prototype.forEach.call(g,function(b){b.addEventListener(_,y)}),{destroy:function(){Array.prototype.forEach.call(g,function(b){b.removeEventListener(_,y)})}}}function m(g,_,y){return d(document.body,g,_,y)}l.exports=f},817:function(l){function s(u){var c;if(u.nodeName==="SELECT")u.focus(),c=u.value;else if(u.nodeName==="INPUT"||u.nodeName==="TEXTAREA"){var d=u.hasAttribute("readonly");d||u.setAttribute("readonly",""),u.select(),u.setSelectionRange(0,u.value.length),d||u.removeAttribute("readonly"),c=u.value}else{u.hasAttribute("contenteditable")&&u.focus();var f=window.getSelection(),p=document.createRange();p.selectNodeContents(u),f.removeAllRanges(),f.addRange(p),c=f.toString()}return c}l.exports=s},279:function(l){function s(){}s.prototype={on:function(u,c,d){var f=this.e||(this.e={});return(f[u]||(f[u]=[])).push({fn:c,ctx:d}),this},once:function(u,c,d){var f=this;function p(){f.off(u,p),c.apply(d,arguments)}return p._=c,this.on(u,p,d)},emit:function(u){var c=[].slice.call(arguments,1),d=((this.e||(this.e={}))[u]||[]).slice(),f=0,p=d.length;for(f;f<p;f++)d[f].fn.apply(d[f].ctx,c);return this},off:function(u,c){var d=this.e||(this.e={}),f=d[u],p=[];if(f&&c)for(var v=0,m=f.length;v<m;v++)f[v].fn!==c&&f[v].fn._!==c&&p.push(f[v]);return p.length?d[u]=p:delete d[u],this}},l.exports=s,l.exports.TinyEmitter=s}},o={};function a(l){if(o[l])return o[l].exports;var s=o[l]={exports:{}};return r[l](s,s.exports,a),s.exports}return function(){a.n=function(l){var s=l&&l.__esModule?function(){return l.default}:function(){return l};return a.d(s,{a:s}),s}}(),function(){a.d=function(l,s){for(var u in s)a.o(s,u)&&!a.o(l,u)&&Object.defineProperty(l,u,{enumerable:!0,get:s[u]})}}(),function(){a.o=function(l,s){return Object.prototype.hasOwnProperty.call(l,s)}}(),a(686)}().default})})(clipboard);var clipboardExports=clipboard.exports;const Clipboard$1=getDefaultExportFromCjs(clipboardExports),useClipboard=i=>{const n=(i==null?void 0:i.appendToBody)===void 0?!0:i.appendToBody;return{toClipboard(r,o){return new Promise((a,l)=>{const s=document.createElement("button"),u=new Clipboard$1(s,{text:()=>r,action:()=>"copy",container:o!==void 0?o:document.body});u.on("success",c=>{u.destroy(),a(c)}),u.on("error",c=>{u.destroy(),l(c)}),n&&document.body.appendChild(s),s.click(),n&&document.body.removeChild(s)})}}},_hoisted_1$1e={class:"mb-2"},_hoisted_2$12=vue.createElementVNode("div",{class:"mb-2 font-bold"},"显示名称",-1),_hoisted_3$V={class:"relative mt-4 mb-4 flex flex-col gap-2.5"},_hoisted_4$T={class:"flex gap-2.5 items-center"},_hoisted_5$K=vue.createElementVNode("span",{class:"font-bold"},"SQL计算公式",-1),_hoisted_6$E={class:"flex items-center gap-1.5"},_hoisted_7$A=vue.createElementVNode("i",{class:"ri-lightbulb-line"},null,-1),_hoisted_8$x=vue.createElementVNode("span",{class:"text-xs"},"使用规范SQL函数和计算公式,以下表达式将嵌入到SELECT语句中",-1),_hoisted_9$t={class:"flex gap-2.5 items-center"},_hoisted_10$p=vue.createElementVNode("span",null,"字段列表",-1),_hoisted_11$j={class:"flex items-center gap-1.5"},_hoisted_12$g={class:"flex items-center gap-2.5 flex-wrap"},_hoisted_13$e=["onClick"],_hoisted_14$d={class:"text-black"},_sfc_main$1v=vue.defineComponent({__name:"model-sql",props:{options:{default:()=>[]}},emits:["success"],setup(i,{expose:n,emit:r}){const{proxy:o}=vue.getCurrentInstance(),{toClipboard:a}=useClipboard(),l=vue.ref(!1),s=i,u=r,c=vue.ref(""),d=vue.ref(""),f=vue.ref(null),p=g=>{if(c.value="",d.value="",l.value=!0,g){const _=JSON.parse(JSON.stringify(g.data));d.value=_.exp??"",c.value=_.comment}},v=async g=>{try{await a(g),o.$message({type:"success",message:"复制成功",plain:!0})}catch{o.$message({type:"warning",message:"复制失败",plain:!0})}},m=()=>{var g;if(!vue.unref(d)){o.$message({type:"warning",message:"请输入SQL语句",plain:!0});return}if(vue.unref(c)==""){o.$message({type:"warning",message:"请输入显示名称",plain:!0});return}u("success",{aggType:"applySql",exp:vue.unref(d),comment:vue.unref(c),showLabel:vue.unref(c)},((g=vue.unref(f))==null?void 0:g.index)??""),l.value=!1};return n({init:p}),(g,_)=>{const y=vue.resolveComponent("AppDialog");return vue.openBlock(),vue.createBlock(y,{modelValue:vue.unref(l),"onUpdate:modelValue":_[3]||(_[3]=b=>vue.isRef(l)?l.value=b:null),title:"SQL计算",size:800},{footer:vue.withCtx(()=>[vue.createVNode(vue.unref(elementPlus.ElButton),{class:"ml-3",type:"primary",onClick:m},{default:vue.withCtx(()=>[vue.createTextVNode("保存")]),_:1}),vue.createVNode(vue.unref(elementPlus.ElButton),{class:"ml-3",onClick:_[2]||(_[2]=b=>l.value=!1)},{default:vue.withCtx(()=>[vue.createTextVNode("取消")]),_:1})]),default:vue.withCtx(()=>[vue.createElementVNode("div",_hoisted_1$1e,[_hoisted_2$12,vue.createVNode(vue.unref(elementPlus.ElInput),{modelValue:vue.unref(c),"onUpdate:modelValue":_[0]||(_[0]=b=>vue.isRef(c)?c.value=b:null),placeholder:"请输入显示名称"},null,8,["modelValue"])]),vue.createElementVNode("div",_hoisted_3$V,[vue.createElementVNode("div",_hoisted_4$T,[_hoisted_5$K,vue.createElementVNode("span",_hoisted_6$E,[vue.createVNode(vue.unref(elementPlus.ElText),{type:"warning"},{default:vue.withCtx(()=>[_hoisted_7$A]),_:1}),vue.createVNode(vue.unref(elementPlus.ElText),{type:"info"},{default:vue.withCtx(()=>[_hoisted_8$x]),_:1})])]),vue.createElementVNode("div",null,[vue.createVNode(vue.unref(elementPlus.ElInput),{modelValue:vue.unref(d),"onUpdate:modelValue":_[1]||(_[1]=b=>vue.isRef(d)?d.value=b:null),placeholder:"请输入SQL语句,例如:max(tbValue+isVal)+max(tbValue)",type:"textarea"},null,8,["modelValue"])]),vue.createElementVNode("div",_hoisted_9$t,[_hoisted_10$p,vue.createElementVNode("span",_hoisted_11$j,[vue.createVNode(vue.unref(elementPlus.ElText),{type:"warning"},{default:vue.withCtx(()=>[vue.createTextVNode("点击可复制")]),_:1})])]),vue.createElementVNode("div",_hoisted_12$g,[(vue.openBlock(!0),vue.createElementBlock(vue.Fragment,null,vue.renderList(s.options,b=>(vue.openBlock(),vue.createElementBlock("div",{style:{border:"1px solid #eee"},onClick:x=>v(b.identifier),class:"bg-gray-100 flex flex-col p-2.5 justify-center items-center rounded gap-0.5 cursor-pointer",key:b.identifier},[vue.createElementVNode("div",_hoisted_14$d,vue.toDisplayString(b.columnComment),1),vue.createVNode(vue.unref(elementPlus.ElText),{type:"info"},{default:vue.withCtx(()=>[vue.createTextVNode(vue.toDisplayString(b.identifier),1)]),_:2},1024)],8,_hoisted_13$e))),128))])])]),_:1},8,["modelValue"])}}}),_withScopeId$v=i=>(vue.pushScopeId("data-v-bc5d6e29"),i=i(),vue.popScopeId(),i),_hoisted_1$1d={key:0},_hoisted_2$11=_withScopeId$v(()=>vue.createElementVNode("div",{class:"mb-2 text-sm indicators-title"},[vue.createElementVNode("i",{class:"mr-1 ri-table-line"}),vue.createTextVNode(" 基本指标 ")],-1)),_hoisted_3$U=["onClick"],_hoisted_4$S=_withScopeId$v(()=>vue.createElementVNode("i",{class:"ri-lightbulb-line"},null,-1)),_hoisted_5$J={key:1},_hoisted_6$D={class:"flex items-center mb-2 text-sm indicators-title"},_hoisted_7$z={class:"overflow-y-auto max-h-96"},_hoisted_8$w=["onClick"],_hoisted_9$s={class:"field-label"},_hoisted_10$o=_withScopeId$v(()=>vue.createElementVNode("i",{class:"ri-add-fill"},null,-1)),_sfc_main$1u=vue.defineComponent({__name:"model-table-summary",props:{modelValue:{default:()=>[]},iconMap:{default:()=>{}},list:{default:()=>[]}},emits:["update:modelValue"],setup(i,{emit:n}){const r=i,o=n,{proxy:a}=vue.getCurrentInstance();vue.inject("chartList");const l=vue.ref(!1),s=vue.ref(1),u=vue.ref(null),c=vue.ref(null),d=vue.ref([{label:"总数",value:"count",tip:"数据的总行数"},{label:"总和",value:"sum",tip:"列的所有值的总和"},{label:"平均值",value:"avg",tip:"列的所有值的平均值"},{label:"最少",value:"min",tip:"列的最小值"},{label:"最大",value:"max",tip:"列的最大值"},{label:"计算公式",value:"exp",tip:"可手动输入计算公式"},{label:"SQL计算",value:"applySql",tip:"可手动输入sql语句"}]);vue.watch(l,_=>{_&&(v.value={},s.value=1)});const f=_=>{o("update:modelValue",r.modelValue.filter(y=>y.showLabel!==_.showLabel))},p=(_,y)=>{_.aggType=="applySql"&&vue.unref(c).init({data:_,index:y}),_.aggType=="exp"&&vue.unref(u).init({data:_,index:y})},v=vue.ref({}),m=_=>{if(_.value==="count"){if(r.modelValue.some(y=>y.aggType==_.value)){a.$message({type:"warning",message:"存在重复数据",plain:!0});return}o("update:modelValue",[...r.modelValue,{identifier:1,aggType:_.value,showLabel:_.label}]),l.value=!1;return}if(_.value=="exp"){vue.unref(u).init();return}if(_.value=="applySql"){vue.unref(c).init();return}s.value=2,v.value=_},g=_=>{var y,b;if(r.modelValue.some(x=>{var C;return x.identifier==_.identifier&&x.aggType==((C=vue.unref(v))==null?void 0:C.value)})){a.$message({type:"warning",message:"存在重复数据",plain:!0});return}l.value=!1,o("update:modelValue",[...r.modelValue,{identifier:_.identifier,comment:_.columnComment,aggType:(y=vue.unref(v))==null?void 0:y.value,showLabel:_.columnComment+((b=vue.unref(v))==null?void 0:b.label)}])};return(_,y)=>{const b=vue.resolveComponent("aceHeader");return vue.openBlock(),vue.createElementBlock(vue.Fragment,null,[vue.createVNode(b,{title:"汇总方式",class:"mb-2"}),vue.createElementVNode("div",null,[(vue.openBlock(!0),vue.createElementBlock(vue.Fragment,null,vue.renderList(_.modelValue,(x,C)=>(vue.openBlock(),vue.createBlock(vue.unref(elementPlus.ElTag),{key:x.value,class:vue.normalizeClass(["m-1",[x.aggType=="exp"?"cursor-pointer":""]]),closable:!0,onClick:w=>p(x,C),onClose:w=>f(x),type:"primary"},{default:vue.withCtx(()=>[vue.createTextVNode(vue.toDisplayString(x.showLabel),1)]),_:2},1032,["onClick","class","onClose"]))),128)),vue.createVNode(vue.unref(elementPlus.ElPopover),{trigger:"click",width:"300px",placement:"top-start",visible:vue.unref(l),"onUpdate:visible":y[1]||(y[1]=x=>vue.isRef(l)?l.value=x:null)},{reference:vue.withCtx(()=>[vue.createVNode(vue.unref(elementPlus.ElButton),{type:"primary",class:"ml-1",size:"small"},{default:vue.withCtx(()=>[_hoisted_10$o,vue.createTextVNode(" "+vue.toDisplayString(_.modelValue.length?"":"添加度量"),1)]),_:1})]),default:vue.withCtx(()=>[vue.unref(s)==1?(vue.openBlock(),vue.createElementBlock("div",_hoisted_1$1d,[_hoisted_2$11,(vue.openBlock(!0),vue.createElementBlock(vue.Fragment,null,vue.renderList(vue.unref(d),x=>(vue.openBlock(),vue.createElementBlock("div",{onClick:C=>m(x),key:x.value,class:vue.normalizeClass([{active:vue.unref(v).value==x.value},"indicators-item"])},[vue.createTextVNode(vue.toDisplayString(x.label)+" ",1),vue.createVNode(vue.unref(elementPlus.ElTooltip),{effect:"dark",content:x.tip,placement:"top"},{default:vue.withCtx(()=>[_hoisted_4$S]),_:2},1032,["content"])],10,_hoisted_3$U))),128))])):vue.createCommentVNode("",!0),vue.unref(s)==2?(vue.openBlock(),vue.createElementBlock("div",_hoisted_5$J,[vue.createElementVNode("div",_hoisted_6$D,[vue.createElementVNode("i",{class:"mr-1 text-xl cursor-pointer ri-arrow-left-s-line",onClick:y[0]||(y[0]=x=>s.value=1)}),vue.createTextVNode(" "+vue.toDisplayString(vue.unref(v).label),1)]),vue.createElementVNode("div",_hoisted_7$z,[(vue.openBlock(!0),vue.createElementBlock(vue.Fragment,null,vue.renderList(_.list,x=>(vue.openBlock(),vue.createElementBlock("div",{onClick:C=>g(x),key:x.identifier,class:"indicators-item"},[vue.createElementVNode("div",null,[vue.createElementVNode("i",{class:vue.normalizeClass([_.iconMap[x.dataType],"mr-2"])},null,2),vue.createElementVNode("span",_hoisted_9$s,vue.toDisplayString(x.columnComment),1)])],8,_hoisted_8$w))),128))])])):vue.createCommentVNode("",!0)]),_:1},8,["visible"]),vue.createVNode(ModelExp,{ref_key:"modelPercentRef",ref:u,options:r.list,onSuccess:y[2]||(y[2]=(x,C)=>C!==""?r.modelValue[C]=x:o("update:modelValue",[...r.modelValue,x]))},null,8,["options"]),vue.createVNode(_sfc_main$1v,{ref_key:"modelSqlRef",ref:c,options:r.list,onSuccess:y[3]||(y[3]=(x,C)=>C!==""?r.modelValue[C]=x:o("update:modelValue",[...r.modelValue,x]))},null,8,["options"])])],64)}}}),modelTableSummary_vue_vue_type_style_index_0_scoped_bc5d6e29_lang="",modelTableSunmary=_export_sfc$2(_sfc_main$1u,[["__scopeId","data-v-bc5d6e29"]]),_sfc_main$1t=vue.defineComponent({__name:"chart-list-widget",props:{type:{default:""}},setup(i){const{proxy:n}=vue.getCurrentInstance(),r=vue.inject("chartList"),o=a=>{n.$baseEventBus.emit("model-chart-click",a)};return(a,l)=>(vue.openBlock(!0),vue.createElementBlock(vue.Fragment,null,vue.renderList(vue.unref(r),s=>(vue.openBlock(),vue.createBlock(vue.unref(elementPlus.ElButton),{type:a.type==s.type?"primary":"",key:s.type,onClick:u=>o(s)},{default:vue.withCtx(()=>{var u;return[vue.createElementVNode("i",{class:vue.normalizeClass((u=vue.unref(echartsTypeList)[s.type])==null?void 0:u.icon)},null,2)]}),_:2},1032,["type","onClick"]))),128))}}),_withScopeId$u=i=>(vue.pushScopeId("data-v-b71f07d1"),i=i(),vue.popScopeId(),i),_hoisted_1$1c={class:"overflow-y-auto max-h-96"},_hoisted_2$10=["onClick"],_hoisted_3$T={class:"field-label"},_hoisted_4$R=_withScopeId$u(()=>vue.createElementVNode("i",{class:"ri-add-fill"},null,-1)),_sfc_main$1s=vue.defineComponent({__name:"model-table-other-summary",props:{modelValue:{default:()=>[]},iconMap:{default:()=>{}},list:{default:()=>[]}},emits:["update:modelValue"],setup(i,{emit:n}){const r=i,o=n,{proxy:a}=vue.getCurrentInstance();vue.inject("chartList");const l=vue.ref(!1);vue.ref(null);const s=c=>{o("update:modelValue",r.modelValue.filter(d=>d.showLabel!==c.showLabel))},u=c=>{if(r.modelValue.some(d=>d.identifier==c.identifier)){a.$message({type:"warning",message:"存在重复数据",plain:!0});return}l.value=!1,o("update:modelValue",[...r.modelValue,{identifier:c.identifier,comment:c.columnComment,aggType:"other",showLabel:c.columnComment}])};return(c,d)=>{const f=vue.resolveComponent("aceHeader");return vue.openBlock(),vue.createElementBlock(vue.Fragment,null,[vue.createVNode(f,{title:"显示其他列",class:"mt-2 mb-2"}),vue.createElementVNode("div",null,[(vue.openBlock(!0),vue.createElementBlock(vue.Fragment,null,vue.renderList(c.modelValue,(p,v)=>(vue.openBlock(),vue.createBlock(vue.unref(elementPlus.ElTag),{key:p.value,class:"m-1",closable:!0,onClose:m=>s(p),type:"primary"},{default:vue.withCtx(()=>[vue.createTextVNode(vue.toDisplayString(p.showLabel),1)]),_:2},1032,["onClose"]))),128)),vue.createVNode(vue.unref(elementPlus.ElPopover),{trigger:"click",width:"300px",placement:"top-start","popper-class":"ace-select",visible:vue.unref(l),"onUpdate:visible":d[0]||(d[0]=p=>vue.isRef(l)?l.value=p:null)},{reference:vue.withCtx(()=>[vue.createVNode(vue.unref(elementPlus.ElButton),{type:"primary",class:"ml-1",size:"small"},{default:vue.withCtx(()=>[_hoisted_4$R]),_:1})]),default:vue.withCtx(()=>[vue.createElementVNode("div",_hoisted_1$1c,[(vue.openBlock(!0),vue.createElementBlock(vue.Fragment,null,vue.renderList(c.list,p=>(vue.openBlock(),vue.createElementBlock("div",{onClick:v=>u(p),key:p.identifier,class:"indicators-item"},[vue.createElementVNode("div",null,[vue.createElementVNode("i",{class:vue.normalizeClass([c.iconMap[p.dataType],"mr-2"])},null,2),vue.createElementVNode("span",_hoisted_3$T,vue.toDisplayString(p.columnComment),1)])],8,_hoisted_2$10))),128))])]),_:1},8,["visible"])])],64)}}}),modelTableOtherSummary_vue_vue_type_style_index_0_scoped_b71f07d1_lang="",ModelTableOtherSummary=_export_sfc$2(_sfc_main$1s,[["__scopeId","data-v-b71f07d1"]]),_withScopeId$t=i=>(vue.pushScopeId("data-v-cc2f18dc"),i=i(),vue.popScopeId(),i),_hoisted_1$1b={class:"flex w-full h-full"},_hoisted_2$$={class:"flex flex-col flex-1 overflow-hidden"},_hoisted_3$S={class:"flex flex-col flex-1 pb-3 pr-3 overflow-y-auto"},_hoisted_4$Q={key:0,class:"relative flex items-center justify-center pannel h-14"},_hoisted_5$I={class:"absolute left-5 top-3"},_hoisted_6$C=_withScopeId$t(()=>vue.createElementVNode("i",{class:"ml-1 ri-settings-2-line"},null,-1)),_hoisted_7$y=_withScopeId$t(()=>vue.createElementVNode("i",{class:"ri-table-line"},null,-1)),_hoisted_8$v={class:"absolute flex items-center right-5 top-4"},_hoisted_9$r=_withScopeId$t(()=>vue.createElementVNode("i",{class:"mr-1 ri-settings-2-line"},null,-1)),_hoisted_10$n={class:"ml-2 mr-2"},_hoisted_11$i={class:"flex flex-col"},_hoisted_12$f={class:"flex-1 overflow-y-auto"},_hoisted_13$d={key:0,class:"flex items-center justify-center pannel h-14"},_hoisted_14$c=_withScopeId$t(()=>vue.createElementVNode("i",{class:"mr-1 ri-save-line"},null,-1)),_sfc_main$1r=vue.defineComponent({__name:"table-widget",props:{modelValue:{default:""},title:{default:""},sortHtml:{default:""},indicatorsId:{default:""},resultTitle:{default:""},dynamicSearchForm:{default:()=>[]}},emits:["update:modelValue","update:title","update:sortHtml","update:resultTitle","update:indicatorsId","update:dynamicSearchForm","success"],setup(i,{expose:n,emit:r}){const o=i,a=r,l=useScreenDesign(),{proxy:s}=vue.getCurrentInstance(),{setFormValue:u,getFormValue:c}=s.$globalHooks.useForm(),{dynamicSearchForm:d,dynamicSearchFormat:f,dynamicSearchParams:p}=s.$aceDynamicSearch(s),v=vue.inject("modelEle"),m=vue.inject("getListModelIndicators");vue.inject("chartList");const g={varchar:"ri-text",date:"ri-calendar-2-line",datetime:"ri-calendar-2-line",int:"ri-hashtag",decimal:"ri-hashtag"},_={day:"按日",week:"按周",month:"按月",quarter:"按季度",year:"按年","":"按时分秒"},y=vue.ref(!1),b=vue.ref(!0),x=vue.ref(0),C=vue.ref([]),w=vue.ref([]),E=vue.ref([]),$=vue.ref([]),S=vue.ref([]),V=vue.ref(!0),k=vue.ref(!0),P=async j=>{var se,Z;V.value=!0,k.value=!1;const ee=JSON.parse((j==null?void 0:j.groupArgsJson)??"[]"),le=JSON.parse((j==null?void 0:j.aggArgsJson)??JSON.stringify([{identifier:1,aggType:"count",showLabel:"总数"}]));$.value=le.filter(K=>K.aggType!="other"),S.value=le.filter(K=>K.aggType=="other"),ee.length||(V.value=!1),x.value=(j==null?void 0:j.pageSize)??20,F.value=JSON.parse((j==null?void 0:j.sortArgsJson)??"{}"),j!=null&&j.formConfJson?(d.value=f(JSON.parse(j.formConfJson??"[]")),a("update:dynamicSearchForm",d.value)):await fetch$1(s).getFormJsonConfig((se=vue.unref(v))==null?void 0:se.id).then(K=>{var q;d.value=f(JSON.parse(((q=K.data)==null?void 0:q.formConfJson)??"[]"))}),a("update:dynamicSearchForm",d.value),u(j,z),s.$baseHttp.post("/api/ace-data-center/aidc/modelAnalysis",{projectId:s.$baseGetCurrentProjectId(),modelId:(Z=vue.unref(v))==null?void 0:Z.id,serialId:new Date().getTime()}).then(K=>{b.value=!1,C.value=K.data.filter(q=>!["创建时间","创建人","所属项目","创建部门","标签"].includes(q.columnComment)).map(q=>({...q,dateFormatType:["date","datetime"].includes(q.dataType)?"day":""})),E.value=K.data.filter(q=>["ADDABLE","SEMIADDABLE"].includes(q.quantityType)),ee.forEach(q=>{const Y=C.value.find(X=>X.identifier==q.identifier);Y&&(w.value.push({...Y,dataType:q.dataType,dateFormatType:q.dateFormatType}),Y.dateFormatType=q.dateFormatType)}),V.value=!1,setTimeout(()=>{k.value=!0},1e3)})};vue.watch([$,w,S],()=>{vue.unref(k)&&(F.value={}),L()},{deep:!0});let T=null;const B=vue.ref(null),N=vue.ref(!1),O=vue.ref([]),I=vue.ref([]),L=async()=>{clearTimeout(T),T=setTimeout(async()=>{var Z,K;I.value=[],l.setChartData([]);const j=D(),ee=Object.keys(vue.unref(F)).map(q=>({field:q,type:vue.unref(F)[q]=="ascending"?"asc":"desc"})),le={aggArgsJson:JSON.stringify([...vue.unref($),...vue.unref(S)]),groupArgsJson:JSON.stringify(j),sortArgsJson:JSON.stringify(ee),params:p(vue.unref(d)),pageSize:vue.unref(x),modelId:(Z=vue.unref(v))==null?void 0:Z.id,formConfJson:JSON.stringify(vue.unref(d))};if(o.indicatorsId&&(le.modelIndicatorsId=o.indicatorsId),a("update:title",`${vue.unref($).length}个指标:${vue.unref($).length?"根据":""}${j.map(q=>q.showLabel).toString()}${vue.unref($).length?"分组的":""}${vue.unref($).filter((q,Y)=>Y<3).map(q=>q.showLabel).toString()}${vue.unref($).length>3?"...":""}`),!vue.unref($).length||vue.unref(V)){O.value=[];return}N.value=!0;const se=await s.$baseHttp.post("/api/ace-data-center/model-indicators/debug",le);B.value=le,N.value=!1,se&&(O.value=((K=se.data)==null?void 0:K.records)??[],l.setChartData({x:j,y:[...vue.unref($),...vue.unref(S)],params:le}),vue.unref(O).length&&Object.keys(vue.unref(O)[0]).forEach(q=>{I.value.push({label:q,prop:q,sortable:"custom"})}))})},D=()=>vue.unref(w).map(j=>({identifier:j.identifier,comment:j.columnComment,showLabel:j.columnComment+(_[j.dateFormatType]??""),dateFormatType:j.dateFormatType||null})),F=vue.ref({}),M=({column:j})=>{vue.unref(F)[j.property]&&(j.order=vue.unref(F)[j.property])};vue.watch(F,j=>{const ee=Object.keys(j).map(le=>`${le}${j[le]=="descending"?"降序":"升序"}`);a("update:sortHtml",ee.length?`<span class="text-color-warning">排序:${ee.toString()}</span>`:"")},{deep:!0});const R=j=>{const{prop:ee,order:le}=j;!le||vue.unref(F)[ee]===le?delete vue.unref(F)[ee]:vue.unref(F)[ee]=le,L()};fetch$1(s).loadIndicatorsMenu().then(j=>{z.find(ee=>ee.fieldName=="tags").options=Object.keys(j.data).map(ee=>({label:ee,value:ee}))});const z=vue.reactive([{name:"名称",type:FieldType.Text,fieldName:"name",value:"",required:!0},{name:"描述",type:FieldType.Textarea,fieldName:"remark",value:""},{name:"标签",type:FieldType.Select,fieldName:"tags",value:"",options:[],multiple:!0,allowCreate:!0,required:!0,placeholder:"请选择标签或输入标签"},{name:"code",type:FieldType.Text,fieldName:"code",value:"",hide:!0}]),U=vue.ref(!1),G=()=>{z.find(j=>j.fieldName=="remark").value=o.title,U.value=!0},J=async()=>{var Z;const{params:j,error:ee}=c(z);if(ee.length>0)return;const le=D();if(!le.length||!vue.unref($).length){s.$message({type:"warning",message:"计算维度或汇总方式不能为空",plain:!0});return}j.code||(j.code=nanoid()),j.groupArgsJson=JSON.stringify(le),j.aggArgsJson=JSON.stringify([...vue.unref($),...vue.unref(S)]),j.modelId=(Z=vue.unref(v))==null?void 0:Z.id,j.projectId=s.$baseGetCurrentProjectId(),j.pageSize=vue.unref(x),j.formConfJson=JSON.stringify(vue.unref(d)),j.sortArgsJson=JSON.stringify(vue.unref(F)),o.indicatorsId&&(j.id=o.indicatorsId),U.value=!1;const se=await s.$baseHttp.post(`/api/ace-data-center/model-indicators/${o.indicatorsId?"update":"save"}`,j,{header:{loading:!0}});se&&(o.indicatorsId||a("update:indicatorsId",se.data),a("update:resultTitle",j.name),s.$message({type:"success",message:"操作成功",plain:!0}),u(j,z),m())},te=()=>{a("update:modelValue","chart")},ae=()=>{s.$baseExportExcel({title:o.title,url:"/api/ace-data-center/model-indicators/debug",header:vue.unref(I),customParams:vue.unref(B)})};return n({init:P,dynamicSearchForm:d,handlePopupForm:G,handleSubmit:J}),(j,ee)=>{var X,oe;const le=vue.resolveComponent("aceDynamicSearch"),se=vue.resolveComponent("AppTable"),Z=vue.resolveComponent("AppEmpty"),K=vue.resolveComponent("aceDynamicList"),q=vue.resolveComponent("AppForm"),Y=vue.resolveComponent("AppDialog");return vue.openBlock(),vue.createElementBlock("div",_hoisted_1$1b,[vue.createElementVNode("div",_hoisted_2$$,[vue.createElementVNode("div",_hoisted_3$S,[vue.unref($).length?(vue.openBlock(),vue.createElementBlock(vue.Fragment,{key:0},[vue.createVNode(le,{form:vue.unref(d),onSuccess:ee[0]||(ee[0]=W=>L())},null,8,["form"]),vue.createVNode(vue.unref(elementPlus.ElSkeleton),{loading:vue.unref(N),animated:""},{default:vue.withCtx(()=>[vue.unref(I).length?(vue.openBlock(),vue.createBlock(se,{key:0,tableData:vue.unref(I),list:vue.unref(O),loading:!1,headerCellClassName:M,onSortChange:R},null,8,["tableData","list"])):(vue.openBlock(),vue.createBlock(Z,{key:1,description:"暂无数据",class:"mt-4"}))]),_:1},8,["loading"])],64)):(vue.openBlock(),vue.createBlock(K,{key:1,id:(X=vue.unref(v))==null?void 0:X.id,title:(oe=vue.unref(v))==null?void 0:oe.modelName,showPageIndex:!0},null,8,["id","title"]))]),vue.unref($).length?(vue.openBlock(),vue.createElementBlock("div",_hoisted_4$Q,[vue.createElementVNode("div",_hoisted_5$I,[vue.createVNode(vue.unref(elementPlus.ElTooltip),{effect:"dark",content:"保存汇总配置后可设置",placement:"top",visible:vue.unref(y)},{default:vue.withCtx(()=>[vue.createVNode(vue.unref(elementPlus.ElButton),{disabled:j.indicatorsId=="",type:"warning",style:{padding:"0 10px"},onMouseenter:ee[1]||(ee[1]=W=>{j.indicatorsId||(y.value=!0)}),onMouseleave:ee[2]||(ee[2]=W=>y.value=!1),onClick:te},{default:vue.withCtx(()=>[vue.createTextVNode(" 图表配置 "),_hoisted_6$C]),_:1},8,["disabled"])]),_:1},8,["visible"])]),vue.createVNode(vue.unref(elementPlus.ElButtonGroup),null,{default:vue.withCtx(()=>[vue.createVNode(vue.unref(elementPlus.ElButton),{type:"primary"},{default:vue.withCtx(()=>[_hoisted_7$y]),_:1}),vue.createVNode(_sfc_main$1t)]),_:1}),vue.createElementVNode("div",_hoisted_8$v,[vue.createVNode(vue.unref(elementPlus.ElLink),{type:"primary"},{default:vue.withCtx(()=>[_hoisted_9$r,vue.createTextVNode(" 显示前 "),vue.createElementVNode("div",_hoisted_10$n,[vue.createVNode(vue.unref(elementPlus.ElInputNumber),{size:"small",style:{width:"100px"},modelValue:vue.unref(x),"onUpdate:modelValue":ee[3]||(ee[3]=W=>vue.isRef(x)?x.value=W:null),onChange:ee[4]||(ee[4]=W=>L()),min:1,max:9999999},null,8,["modelValue"])]),vue.createTextVNode(" 条聚合数据 ")]),_:1}),vue.unref(I).length?(vue.openBlock(),vue.createElementBlock("i",{key:0,class:"ml-2 cursor-pointer ri-download-2-line text-color-warning",onClick:ae})):vue.createCommentVNode("",!0)])])):vue.createCommentVNode("",!0)]),vue.createElementVNode("aside",_hoisted_11$i,[vue.createElementVNode("div",_hoisted_12$f,[vue.createVNode(modelTableSunmary,{list:vue.unref(E),modelValue:vue.unref($),"onUpdate:modelValue":ee[5]||(ee[5]=W=>vue.isRef($)?$.value=W:null),iconMap:g},null,8,["list","modelValue"]),vue.createVNode(ModelTableOtherSummary,{iconMap:g,list:vue.unref(C),modelValue:vue.unref(S),"onUpdate:modelValue":ee[6]||(ee[6]=W=>vue.isRef(S)?S.value=W:null)},null,8,["list","modelValue"]),vue.withDirectives(vue.createElementVNode("div",null,[vue.createVNode(modelTableDimension,{loading:vue.unref(b),list:vue.unref(C),iconMap:g,calendarType:_,modelValue:vue.unref(w),"onUpdate:modelValue":ee[7]||(ee[7]=W=>vue.isRef(w)?w.value=W:null)},null,8,["loading","list","modelValue"])],512),[[vue.vShow,vue.unref($).length]])]),vue.unref($).length?(vue.openBlock(),vue.createElementBlock("div",_hoisted_13$d,[vue.createVNode(vue.unref(elementPlus.ElButton),{type:"primary",onClick:G},{default:vue.withCtx(()=>[_hoisted_14$c,vue.createTextVNode(" 完 成 ")]),_:1})])):vue.createCommentVNode("",!0),vue.createVNode(Y,{modelValue:vue.unref(U),"onUpdate:modelValue":ee[9]||(ee[9]=W=>vue.isRef(U)?U.value=W:null),title:"保存指标",size:800},{footer:vue.withCtx(()=>[vue.createVNode(vue.unref(elementPlus.ElButton),{class:"ml-3",type:"primary",onClick:J},{default:vue.withCtx(()=>[vue.createTextVNode("保存")]),_:1}),vue.createVNode(vue.unref(elementPlus.ElButton),{class:"ml-3",onClick:ee[8]||(ee[8]=W=>U.value=!1)},{default:vue.withCtx(()=>[vue.createTextVNode("取消")]),_:1})]),default:vue.withCtx(()=>[vue.createVNode(q,{form:vue.unref(z),col:1},null,8,["form"])]),_:1},8,["modelValue"])])])}}}),tableWidget_vue_vue_type_style_index_0_scoped_cc2f18dc_lang="",tableWidget=_export_sfc$2(_sfc_main$1r,[["__scopeId","data-v-cc2f18dc"]]),_withScopeId$s=i=>(vue.pushScopeId("data-v-6fadb38d"),i=i(),vue.popScopeId(),i),_hoisted_1$1a={class:"flex flex-wrap chart-container"},_hoisted_2$_=["onClick"],_hoisted_3$R=["onClick"],_hoisted_4$P=_withScopeId$s(()=>vue.createElementVNode("i",{class:"ml-1 ri-settings-2-line"},null,-1)),_hoisted_5$H=[_hoisted_4$P],_hoisted_6$B={key:0,class:"success setting"},_hoisted_7$x=_withScopeId$s(()=>vue.createElementVNode("i",{class:"ml-1 ri-check-line"},null,-1)),_hoisted_8$u=[_hoisted_7$x],_hoisted_9$q={class:"label"},_sfc_main$1q=vue.defineComponent({__name:"model-chart-menu",props:{modelValue:{default:""}},emits:["click-chart-setting","update:modelValue"],setup(i,{emit:n}){vue.getCurrentInstance();const r=[{...echartsTypeList[3],key:"3"},...Object.keys(echartsTypeList).filter(u=>u!="3").map(u=>({...echartsTypeList[u],key:u}))],o=vue.inject("chartList"),a=n,l=u=>{a("update:modelValue",String(u))},s=u=>{a("update:modelValue",String(u)),a("click-chart-setting")};return(u,c)=>(vue.openBlock(),vue.createElementBlock("div",_hoisted_1$1a,[(vue.openBlock(),vue.createElementBlock(vue.Fragment,null,vue.renderList(r,d=>{var f;return vue.createElementVNode("div",{class:"items",key:d.key,onClick:p=>l(d.key)},[vue.createElementVNode("div",{class:vue.normalizeClass(["icon",{active:u.modelValue==d.key}])},[vue.createElementVNode("i",{class:vue.normalizeClass(d.icon)},null,2),vue.createElementVNode("div",{class:"setting",onClick:vue.withModifiers(p=>s(d.key),["stop"])},_hoisted_5$H,8,_hoisted_3$R),(f=vue.unref(o))!=null&&f.some(p=>p.type==d.key)?(vue.openBlock(),vue.createElementBlock("div",_hoisted_6$B,_hoisted_8$u)):vue.createCommentVNode("",!0)],2),vue.createElementVNode("div",_hoisted_9$q,vue.toDisplayString(d.name),1)],8,_hoisted_2$_)}),64))]))}}),modelChartMenu_vue_vue_type_style_index_0_scoped_6fadb38d_lang="",modelChartMenu=_export_sfc$2(_sfc_main$1q,[["__scopeId","data-v-6fadb38d"]]),_sfc_main$1p=vue.defineComponent({__name:"model-chart-setting",props:{option:{default:{}},type:{default:""}},emits:["close"],setup(i,{expose:n,emit:r}){const o=i,a=r,{proxy:l}=vue.getCurrentInstance(),s=vue.ref(""),u=vue.inject("indicatorsId"),c=vue.inject("getListModelIndicators"),d=vue.inject("getChartWidgetList"),f=vue.computed(()=>({3:_sfc_main$1X,2:_sfc_main$1V,1:_sfc_main$1W,4:_sfc_main$1S,5:_sfc_main$1U,6:_sfc_main$1T,7:_sfc_main$1R,8:_sfc_main$1Q,9:_sfc_main$1P,10:_sfc_main$1O,11:_sfc_main$1N})[o.type]??null),p=vue.ref(!1),v=()=>{s.value="data",p.value=!0},m=async()=>{o.option.tooltip&&(delete o.option.tooltip.valueFormatter,delete o.option.tooltip.formatter),o.type=="9"&&delete o.option.series[2].label.formatter,await l.$baseHttp.post("/api/ace-data-center/model-indicators-echarts/save",{modelIndicatorsId:vue.unref(u),echartsType:o.type,echartsConfig:chartJsonToStringFormat({...o.option,customSeriesData:window.customSeriesData,dataset:{...o.option.dataset,source:[]}})},{headers:{loading:!0}})&&(l.$message({type:"success",message:"操作成功",plain:!0}),await d(),await c(),p.value=!1,a("close"))},g=()=>{p.value=!1};return n({init:v,handleSubmit:m}),(_,y)=>{const b=vue.resolveComponent("AppDrawer");return vue.openBlock(),vue.createBlock(b,{modelValue:vue.unref(p),"onUpdate:modelValue":y[3]||(y[3]=x=>vue.isRef(p)?p.value=x:null),withHeader:!1,modal:!1,direction:"ltr",size:"350px",modalClass:"ace-modal-drawer"},{footer:vue.withCtx(()=>[vue.createVNode(vue.unref(elementPlus.ElButton),{type:"primary",onClick:y[1]||(y[1]=x=>m())},{default:vue.withCtx(()=>[vue.createTextVNode("保存")]),_:1}),vue.createVNode(vue.unref(elementPlus.ElButton),{class:"ml-3",onClick:y[2]||(y[2]=x=>g())},{default:vue.withCtx(()=>[vue.createTextVNode("关闭")]),_:1})]),default:vue.withCtx(()=>[vue.createVNode(vue.unref(elementPlus.ElCollapse),{accordion:"",modelValue:vue.unref(s),"onUpdate:modelValue":y[0]||(y[0]=x=>vue.isRef(s)?s.value=x:null)},{default:vue.withCtx(()=>[vue.unref(f)?(vue.openBlock(),vue.createBlock(vue.unref(f),{key:0,option:o.option,type:_.type},null,8,["option","type"])):vue.createCommentVNode("",!0)]),_:1},8,["modelValue"])]),_:1},8,["modelValue"])}}}),modelChartSetting_vue_vue_type_style_index_0_scoped_71b96102_lang="",modelChartSetting=_export_sfc$2(_sfc_main$1p,[["__scopeId","data-v-71b96102"]]),_withScopeId$r=i=>(vue.pushScopeId("data-v-85f16186"),i=i(),vue.popScopeId(),i),_hoisted_1$19={class:"flex w-full h-full"},_hoisted_2$Z={class:"flex-1"},_hoisted_3$Q={key:0,class:"flex items-center justify-center pannel h-14"},_hoisted_4$O=_withScopeId$r(()=>vue.createElementVNode("i",{class:"mr-1 ri-save-line"},null,-1)),_hoisted_5$G={class:"flex flex-col flex-1 overflow-hidden"},_hoisted_6$A={class:"relative flex flex-col flex-1 pb-3 pl-3"},_hoisted_7$w={class:"mb-2.5"},_hoisted_8$t={class:"relative flex items-center justify-center pannel h-14"},_hoisted_9$p={key:0,class:"absolute left-5 top-3"},_hoisted_10$m=_withScopeId$r(()=>vue.createElementVNode("i",{class:"ml-1 ri-settings-2-line"},null,-1)),_hoisted_11$h=_withScopeId$r(()=>vue.createElementVNode("i",{class:"ri-table-line"},null,-1)),_sfc_main$1o=vue.defineComponent({__name:"chart-widget",props:{modelValue:{default:""},dynamicSearchForm:{default:()=>[]}},emits:["update:modelValue"],setup(i,{expose:n,emit:r}){const o=r,{proxy:a}=vue.getCurrentInstance(),l=vue.inject("chartList"),{option:s,formatChart:u}=useCustomChart(),c=vue.ref(""),d=vue.ref(null),f=vue.ref(!1),p=()=>{if(vue.unref(c)==""){a.$message({type:"warning",message:"请选择图表",plain:!0});return}const y=setInterval(()=>{vue.unref(f)&&(vue.unref(d).init(),clearInterval(y))},20)};vue.watch(c,async y=>{var x;if(s.value={},f.value=!1,y==""){f.value=!0;return}const b=(x=vue.unref(l))==null?void 0:x.find(C=>C.type==y);await u((b==null?void 0:b.code)??"",y),f.value=!0});const v=vue.ref(!1);a.$baseEventBus.on("model-chart-click",async y=>{v.value=!0,o("update:modelValue","chart"),c.value=y.type,setTimeout(()=>{v.value=!1},100)});const m=()=>{if(vue.unref(l).length>0){vue.unref(v)||(c.value=vue.unref(l)[0].type),f.value=!0;return}c.value="3"},g=()=>{const y=c.value;c.value="",setTimeout(()=>{c.value=y},10)},_=()=>{c.value="",o("update:modelValue","table")};return n({init:m}),(y,b)=>{var w;const x=vue.resolveComponent("aceDynamicSearch"),C=vue.resolveComponent("aceCustomChart");return vue.openBlock(),vue.createElementBlock("div",_hoisted_1$19,[vue.createElementVNode("aside",null,[vue.createElementVNode("div",_hoisted_2$Z,[vue.createVNode(modelChartMenu,{modelValue:vue.unref(c),"onUpdate:modelValue":b[0]||(b[0]=E=>vue.isRef(c)?c.value=E:null),onClickChartSetting:p},null,8,["modelValue"])]),(w=vue.unref(l))!=null&&w.some(E=>E.type==vue.unref(c))?vue.createCommentVNode("",!0):(vue.openBlock(),vue.createElementBlock("div",_hoisted_3$Q,[vue.createVNode(vue.unref(elementPlus.ElButton),{type:"primary",onClick:b[1]||(b[1]=E=>vue.unref(d).handleSubmit())},{default:vue.withCtx(()=>[_hoisted_4$O,vue.createTextVNode(" 保 存 ")]),_:1})]))]),vue.createElementVNode("div",_hoisted_5$G,[vue.createElementVNode("div",_hoisted_6$A,[vue.createVNode(vue.unref(elementPlus.ElSkeleton),{loading:!vue.unref(f),animated:""},{default:vue.withCtx(()=>[vue.createElementVNode("div",_hoisted_7$w,[vue.createVNode(x,{form:y.dynamicSearchForm,search:!1,disabled:""},null,8,["form"])]),vue.createVNode(C,{option:vue.unref(s),chartType:vue.unref(c),isCheckClick:!1},null,8,["option","chartType"])]),_:1},8,["loading"])]),vue.createElementVNode("div",_hoisted_8$t,[vue.unref(s)?(vue.openBlock(),vue.createElementBlock("div",_hoisted_9$p,[vue.createVNode(vue.unref(elementPlus.ElButtonGroup),null,{default:vue.withCtx(()=>[vue.createVNode(vue.unref(elementPlus.ElButton),{type:"primary",style:{padding:"0 10px"}},{default:vue.withCtx(()=>[vue.createTextVNode("可视化")]),_:1}),vue.createVNode(vue.unref(elementPlus.ElButton),{type:"",style:{padding:"0 10px"},onClick:p},{default:vue.withCtx(()=>[_hoisted_10$m]),_:1})]),_:1})])):vue.createCommentVNode("",!0),vue.createVNode(vue.unref(elementPlus.ElButtonGroup),null,{default:vue.withCtx(()=>[vue.createVNode(vue.unref(elementPlus.ElButton),{type:"",onClick:_},{default:vue.withCtx(()=>[_hoisted_11$h]),_:1}),vue.createVNode(_sfc_main$1t,{type:vue.unref(c)},null,8,["type"])]),_:1})])]),vue.unref(c)?(vue.openBlock(),vue.createBlock(modelChartSetting,{key:0,ref_key:"modelChartSettingRef",ref:d,option:vue.unref(s),type:vue.unref(c),onClose:g},null,8,["option","type"])):vue.createCommentVNode("",!0)])}}}),chartWidget_vue_vue_type_style_index_0_scoped_85f16186_lang="",chartWidget=_export_sfc$2(_sfc_main$1o,[["__scopeId","data-v-85f16186"]]),_withScopeId$q=i=>(vue.pushScopeId("data-v-51646426"),i=i(),vue.popScopeId(),i),_hoisted_1$18={class:"design"},_hoisted_2$Y={class:"design-header"},_hoisted_3$P={class:"flex-1"},_hoisted_4$N={class:"mt-2 text-xs text-color-info"},_hoisted_5$F=["innerHTML"],_hoisted_6$z={class:"flex"},_hoisted_7$v={class:"mr-2"},_hoisted_8$s=_withScopeId$q(()=>vue.createElementVNode("i",{class:"mr-1 ri-settings-2-line"},null,-1)),_hoisted_9$o=_withScopeId$q(()=>vue.createElementVNode("i",{class:"mr-1 ri-close-line"},null,-1)),_hoisted_10$l={class:"flex flex-1 p-3 overflow-hidden design-container"},_sfc_main$1n=vue.defineComponent({__name:"index",emits:["close"],setup(i,{expose:n,emit:r}){const{proxy:o}=vue.getCurrentInstance(),a=vue.ref(!1),l=vue.ref(!1),s=vue.ref(),u=vue.ref(null),c=vue.ref(null),d=vue.ref(null),f=vue.ref([]),p=vue.ref("0个指标"),v=vue.ref(""),m=vue.ref(""),g=vue.ref([]),_=r;vue.watch(a,S=>{S||o.$baseEventBus.off("model-chart-click")}),vue.provide("indicatorsId",m);const y=vue.inject("modelEle"),b=vue.ref(""),x=async S=>{var k;let V={};s.value="table",m.value=S,g.value=[],f.value=[],vue.unref(m)&&(V=await C(),w()),a.value=!0,b.value=(k=V==null?void 0:V.data)==null?void 0:k.name,vue.nextTick(()=>{vue.unref(u).init((V==null?void 0:V.data)??{})})};vue.watch(s,S=>{S=="chart"&&vue.unref(c).init()});const C=async()=>await o.$baseHttp.get(`/api/ace-data-center/model-indicators/detail?id=${vue.unref(m)}`,{headers:{loading:!0}}),w=async()=>{const S=await o.$baseHttp.post(`/api/ace-data-center/model-indicators-echarts/getEchartsTypes/${vue.unref(m)}`);g.value=S.data};vue.provide("getChartWidgetList",w),vue.provide("chartList",g);const E=()=>{o.$baseConfirm({content:"是否确定关闭",callConfirm:async()=>{a.value=!1,vue.unref(m)&&_("close")}})},$=S=>{f.value=S,vue.unref(u).dynamicSearchForm=S,vue.unref(u).handleSubmit()};return n({init:x}),(S,V)=>{const k=vue.resolveComponent("aceHeader"),P=vue.resolveComponent("AppDrawer");return vue.openBlock(),vue.createBlock(P,{modelValue:vue.unref(a),"onUpdate:modelValue":V[11]||(V[11]=T=>vue.isRef(a)?a.value=T:null),withHeader:!1,size:"100%",modalClass:"ace-modal-drawer"},{default:vue.withCtx(()=>{var T,B;return[vue.createElementVNode("div",_hoisted_1$18,[vue.createElementVNode("div",_hoisted_2$Y,[vue.createElementVNode("div",_hoisted_3$P,[vue.createVNode(k,{title:vue.unref(s)=="table"?vue.unref(p):`${vue.unref(b)}【${vue.unref(p)}】`},vue.createSlots({_:2},[vue.unref(g).length?{name:"left",fn:vue.withCtx(()=>[vue.createElementVNode("i",{onClick:V[0]||(V[0]=N=>vue.unref(u).handlePopupForm()),class:"ml-2 text-base cursor-pointer ri-edit-box-line text-color-primary"})]),key:"0"}:void 0]),1032,["title"]),vue.createElementVNode("div",_hoisted_4$N,[vue.createTextVNode(" 模型数据 / "+vue.toDisplayString((T=vue.unref(y))==null?void 0:T.modelName)+" ["+vue.toDisplayString((B=vue.unref(y))==null?void 0:B.modelCode)+"] ",1),vue.createElementVNode("span",{class:"ml-2",innerHTML:vue.unref(v)},null,8,_hoisted_5$F)])]),vue.createElementVNode("div",_hoisted_6$z,[vue.withDirectives(vue.createElementVNode("div",_hoisted_7$v,[vue.createVNode(vue.unref(elementPlus.ElPopover),{placement:"bottom",visible:vue.unref(l),"onUpdate:visible":V[2]||(V[2]=N=>vue.isRef(l)?l.value=N:null),trigger:"click",width:"900px","popper-class":"ace-select"},{reference:vue.withCtx(()=>[vue.createVNode(vue.unref(elementPlus.ElButton),{type:"warning"},{default:vue.withCtx(()=>[_hoisted_8$s,vue.createTextVNode(" 筛选配置 ")]),_:1})]),default:vue.withCtx(()=>[vue.createVNode(aceIndicatorCustomSearch,{ref_key:"customSearchRef",ref:d,customSearchVisible:vue.unref(l),"onUpdate:customSearchVisible":V[1]||(V[1]=N=>vue.isRef(l)?l.value=N:null),onDynamicSearchFormUpdate:$,dynamicSearchForm:vue.unref(f)},null,8,["customSearchVisible","dynamicSearchForm"])]),_:1},8,["visible"])],512),[[vue.vShow,vue.unref(s)=="table"&&vue.unref(p)!="0个指标:"]]),vue.createVNode(vue.unref(elementPlus.ElButton),{onClick:E},{default:vue.withCtx(()=>[_hoisted_9$o,vue.createTextVNode(" 关闭 ")]),_:1})])]),vue.createElementVNode("div",_hoisted_10$l,[vue.withDirectives(vue.createVNode(tableWidget,{ref_key:"tableWidgetRef",ref:u,modelValue:vue.unref(s),"onUpdate:modelValue":V[3]||(V[3]=N=>vue.isRef(s)?s.value=N:null),indicatorsId:vue.unref(m),"onUpdate:indicatorsId":V[4]||(V[4]=N=>vue.isRef(m)?m.value=N:null),title:vue.unref(p),"onUpdate:title":V[5]||(V[5]=N=>vue.isRef(p)?p.value=N:null),resultTitle:vue.unref(b),"onUpdate:resultTitle":V[6]||(V[6]=N=>vue.isRef(b)?b.value=N:null),sortHtml:vue.unref(v),"onUpdate:sortHtml":V[7]||(V[7]=N=>vue.isRef(v)?v.value=N:null),dynamicSearchForm:vue.unref(f),"onUpdate:dynamicSearchForm":V[8]||(V[8]=N=>vue.isRef(f)?f.value=N:null)},null,8,["modelValue","indicatorsId","title","resultTitle","sortHtml","dynamicSearchForm"]),[[vue.vShow,vue.unref(s)=="table"]]),vue.withDirectives(vue.createVNode(chartWidget,{ref_key:"chartWidgetRef",ref:c,dynamicSearchForm:vue.unref(f),"onUpdate:dynamicSearchForm":V[9]||(V[9]=N=>vue.isRef(f)?f.value=N:null),modelValue:vue.unref(s),"onUpdate:modelValue":V[10]||(V[10]=N=>vue.isRef(s)?s.value=N:null)},null,8,["dynamicSearchForm","modelValue"]),[[vue.vShow,vue.unref(s)=="chart"]])])])]}),_:1},8,["modelValue"])}}}),index_vue_vue_type_style_index_0_scoped_51646426_lang="",aceIndicatorDesign=_export_sfc$2(_sfc_main$1n,[["__scopeId","data-v-51646426"]]),_hoisted_1$17={class:"flex items-center"},_hoisted_2$X=vue.createElementVNode("i",{class:"ri-search-line"},null,-1),_hoisted_3$O={class:"mt-3"},_hoisted_4$M={class:"flex items-center w-full overflow-hidden"},_hoisted_5$E={class:"overflow-hidden text-ellipsis whitespace-nowrap"},_hoisted_6$y={key:0,class:"mr-1 text-base ri-checkbox-circle-fill text-color-success"},_hoisted_7$u={key:1,class:"mr-1 text-base ri-progress-1-fill text-color-warning"},_hoisted_8$r={key:0,class:"flex items-center justify-end flex-1"},_sfc_main$1m=vue.defineComponent({__name:"menu",props:{tempId:{default:""}},emits:["node-click"],setup(i,{expose:n,emit:r}){const o=i,{proxy:a}=vue.getCurrentInstance(),l=vue.ref(""),s=vue.ref(null),u=vue.ref(null),c=r;vue.watch(l,m=>{vue.unref(u).filter(m)});const d=(m,g)=>m?g.name.includes(m):!0,f=vue.ref(!1),p=()=>{s.value=[],f.value=!0,fetch$1(a).loadIndicatorsMenu().then(m=>{s.value=Object.keys(m.data).map(_=>({name:_,id:_,children:m.data[_]}));let g;f.value=!1,vue.unref(s).length&&vue.nextTick(()=>{var _;o.tempId?g=vue.unref(u).getNode(o.tempId):g=vue.unref(u).getNode((_=vue.unref(s)[0].children[0])==null?void 0:_.id),g&&(v(g==null?void 0:g.data),vue.unref(u).setCurrentKey(g==null?void 0:g.data.id))})})};p();const v=m=>{Array.isArray(m.children)||c("node-click",m)};return n({init:p}),(m,g)=>{const _=vue.resolveComponent("AppEmpty");return vue.openBlock(),vue.createElementBlock(vue.Fragment,null,[vue.createElementVNode("div",_hoisted_1$17,[vue.createVNode(vue.unref(elementPlus.ElInput),{placeholder:"请输入内容",clearable:"",modelValue:vue.unref(l),"onUpdate:modelValue":g[0]||(g[0]=y=>vue.isRef(l)?l.value=y:null)},{prefix:vue.withCtx(()=>[_hoisted_2$X]),_:1},8,["modelValue"]),vue.renderSlot(m.$slots,"search")]),vue.createElementVNode("div",_hoisted_3$O,[vue.unref(f)?(vue.openBlock(),vue.createBlock(vue.unref(elementPlus.ElSkeleton),{key:0,animated:"",count:2})):(vue.openBlock(),vue.createBlock(vue.unref(elementPlus.ElTree),{key:1,class:"animated fadeIn",ref_key:"treeRef",ref:u,data:vue.unref(s),"empty-text":"暂无数据","node-key":"id","default-expand-all":"",indent:0,"highlight-current":"","filter-node-method":d,onNodeClick:v},{default:vue.withCtx(({node:y,data:b})=>[vue.createElementVNode("div",_hoisted_4$M,[vue.createElementVNode("div",_hoisted_5$E,[Array.isArray(b.children)?vue.createCommentVNode("",!0):(vue.openBlock(),vue.createElementBlock(vue.Fragment,{key:0},[b.normal?(vue.openBlock(),vue.createElementBlock("i",_hoisted_6$y)):(vue.openBlock(),vue.createElementBlock("i",_hoisted_7$u))],64)),vue.createElementVNode("span",{class:vue.normalizeClass(["flex-1 overflow-hidden whitespace-nowrap text-ellipsis",{"font-bold":y.level==1}])},vue.toDisplayString(b.name),3)]),Array.isArray(b.children)?vue.createCommentVNode("",!0):(vue.openBlock(),vue.createElementBlock("div",_hoisted_8$r,[vue.renderSlot(m.$slots,"menu-item",{data:b})]))])]),empty:vue.withCtx(()=>[vue.createVNode(_,{description:"暂无数据"})]),_:3},8,["data"]))])],64)}}}),_hoisted_1$16={class:"rule-list"},_hoisted_2$W={key:0,class:"flex items-center"},_hoisted_3$N=vue.createElementVNode("i",{class:"ri-error-warning-fill text-2xl text-color-warning mr-2"},null,-1),_hoisted_4$L={key:1,class:"flex items-center"},_hoisted_5$D=vue.createElementVNode("i",{class:"ri-checkbox-circle-fill text-2xl text-color-success mr-2"},null,-1),_sfc_main$1l=vue.defineComponent({__name:"rule",props:{ruleList:{default:()=>[]}},setup(i){const{proxy:n}=vue.getCurrentInstance(),r=vue.ref(!1),o=vue.ref(""),a=vue.ref([]),l=c=>{o.value=`/api/ace-data-center/rule/ruleDataView?ruleId=${c}`,r.value=!0},s=c=>{vue.unref(a).length==0&&Object.keys(c.data[0]).forEach(d=>{if(d==="pageIndex"){a.value.unshift({label:"序号",prop:"pageIndex",width:"80px"});return}a.value.push({label:d,prop:d})})},u=()=>{n.$baseExportExcel({title:"数据列表",url:vue.unref(o),method:"get",header:vue.unref(a)})};return(c,d)=>{const f=vue.resolveComponent("aceHeader"),p=vue.resolveComponent("AppList"),v=vue.resolveComponent("AppDrawer");return vue.openBlock(),vue.createElementBlock(vue.Fragment,null,[vue.createElementVNode("div",_hoisted_1$16,[c.ruleList.length>0?(vue.openBlock(),vue.createElementBlock(vue.Fragment,{key:0},[vue.createVNode(f,{title:"智能诊断",class:"mb-5"}),vue.createVNode(vue.unref(elementPlus.ElAlert),{type:"warning",closable:!1},{default:vue.withCtx(()=>[(vue.openBlock(!0),vue.createElementBlock(vue.Fragment,null,vue.renderList(c.ruleList,m=>(vue.openBlock(),vue.createElementBlock("div",{key:m.id,class:"mt-0 text-sm"},[+m.rows>0?(vue.openBlock(),vue.createElementBlock("div",_hoisted_2$W,[_hoisted_3$N,vue.createTextVNode(" "+vue.toDisplayString(m.ruleName)+" 【异常数据"+vue.toDisplayString(m.rows>99?"99+":m.rows)+"】 ",1),vue.createVNode(vue.unref(elementPlus.ElLink),{class:"ml-2",type:"primary",onClick:g=>l(m.id)},{default:vue.withCtx(()=>[vue.createTextVNode("查看明细")]),_:2},1032,["onClick"])])):(vue.openBlock(),vue.createElementBlock("div",_hoisted_4$L,[_hoisted_5$D,vue.createTextVNode(" "+vue.toDisplayString(m.ruleName)+" 【未检测到异常数据】 ",1)]))]))),128))]),_:1})],64)):vue.createCommentVNode("",!0)]),vue.createVNode(v,{modelValue:vue.unref(r),"onUpdate:modelValue":d[1]||(d[1]=m=>vue.isRef(r)?r.value=m:null),title:"数据列表"},{footer:vue.withCtx(()=>[vue.createVNode(vue.unref(elementPlus.ElButton),{type:"primary",class:"ml-3",onClick:u},{default:vue.withCtx(()=>[vue.createTextVNode("导 出")]),_:1}),vue.createVNode(vue.unref(elementPlus.ElButton),{class:"ml-3",onClick:d[0]||(d[0]=m=>r.value=!1)},{default:vue.withCtx(()=>[vue.createTextVNode("关 闭")]),_:1})]),default:vue.withCtx(()=>[vue.createVNode(p,{tableData:vue.unref(a),url:vue.unref(o),onSuccess:s},null,8,["tableData","url"])]),_:1},8,["modelValue"])],64)}}}),_hoisted_1$15={key:1,class:"animated fadeIn"},_hoisted_2$V={class:"flex items-center mt-5 mb-5 ml-2 moudle-1"},_hoisted_3$M={key:0,class:"mr-1 text-xl ri-error-warning-fill text-color-warning"},_hoisted_4$K={key:1,class:"mr-1 text-xl ri-checkbox-circle-fill text-color-success"},_hoisted_5$C={class:"ml-1"},_hoisted_6$x={class:"flex items-center select-type"},_hoisted_7$t=["onClick"],_hoisted_8$q={class:"mt-5 mb-5"},_hoisted_9$n={class:"mt-4"},_sfc_main$1k=vue.defineComponent({__name:"analysis",props:{indicatorsId:{default:""}},emits:["rule-success"],setup(i,{emit:n}){const r=i;vue.watch(()=>r.indicatorsId,()=>p());const o=n,{proxy:a}=vue.getCurrentInstance(),{dynamicSearchForm:l,dynamicSearchFormat:s,dynamicSearchParams:u}=a.$aceDynamicSearch(a),c=vue.ref(!0),d=vue.ref([]),f=vue.ref(null),p=async()=>{var w,E,$;c.value=!0,l.value=[],_.value={type:"",value:""},v.value=[],m.value="",x();const C=await fetch$1(a).detailAndTask(r.indicatorsId);f.value=C.data,(E=(w=C.data)==null?void 0:w.echartsDataVO)!=null&&E.config&&g(),($=C==null?void 0:C.data)!=null&&$.formConfJson&&(l.value=s(JSON.parse(C==null?void 0:C.data.formConfJson))),c.value=!1},v=vue.ref([]),m=vue.ref(""),g=async()=>{var w;v.value=[],m.value="";const C=await fetch$1(a).getEchartDetail({indicatorsId:r.indicatorsId});C&&(Object.keys(((w=C.data)==null?void 0:w.clientEchartsType)??{}).forEach(E=>{var $;Object.values(($=C.data)==null?void 0:$.clientEchartsType[E]).forEach(S=>{var V,k;v.value.push({client:E,label:(V=echartsTypeList[S])==null?void 0:V.name,icon:(k=echartsTypeList[S])==null?void 0:k.icon,value:`${E}_${S}`})})}),vue.unref(v).length>0&&(m.value=vue.unref(v)[0].value,b(vue.unref(m))))},_=vue.ref({type:"",value:""}),y=vue.ref(!1),b=async(C,w=!1)=>{var V;m.value=C,w&&(y.value=!0);const E=u(vue.unref(l)),$=C.split("_"),S=await fetch$1(a).pullEchartsDataVO({indicatorsId:r.indicatorsId,loadType:((V=vue.unref(f))==null?void 0:V.loadType)??3,params:E,targetClient:$[0],echartsType:$[1]});if(S){y.value=!1,vue.unref(_).type=$[1];try{vue.unref(_).value=chartJsonFormat(S.data.config)}catch{vue.unref(_).value=S.data.config}}},x=async()=>{var w;d.value=[];const C=await fetch$1(a).getRule({current:1,size:100,businessType:"indicators",businessId:r.indicatorsId});d.value=((w=C.data)==null?void 0:w.records)??[],o("rule-success",d.value)};return p(),(C,w)=>{const E=vue.resolveComponent("AppResourceVisitor"),$=vue.resolveComponent("aceHeader"),S=vue.resolveComponent("aceDynamicSearch"),V=vue.resolveComponent("aceChart");return vue.unref(c)?(vue.openBlock(),vue.createBlock(vue.unref(elementPlus.ElSkeleton),{key:0,animated:""})):(vue.openBlock(),vue.createElementBlock("div",_hoisted_1$15,[vue.createVNode($,{title:"指标计算"},{default:vue.withCtx(()=>[vue.createVNode(E,{businessType:"INDICATORS",businessld:r.indicatorsId},null,8,["businessld"])]),_:1}),vue.createElementVNode("div",_hoisted_2$V,[vue.unref(d).some(k=>k.rows>0)?(vue.openBlock(),vue.createElementBlock("i",_hoisted_3$M)):(vue.openBlock(),vue.createElementBlock("i",_hoisted_4$K)),vue.createElementVNode("span",_hoisted_5$C,vue.toDisplayString(vue.unref(f).remark),1)]),vue.createVNode($,{title:"指标数据"},{default:vue.withCtx(()=>[vue.createElementVNode("div",_hoisted_6$x,[(vue.openBlock(!0),vue.createElementBlock(vue.Fragment,null,vue.renderList(vue.unref(v),k=>(vue.openBlock(),vue.createElementBlock("span",{onClick:P=>b(k.value,!0),class:vue.normalizeClass(["flex items-center cursor-pointer",[k.value==vue.unref(m)?"text-color-primary":"text-gray-600"]]),key:k.value},[vue.createElementVNode("i",{class:vue.normalizeClass([k.icon,"mr-1"])},null,2),vue.createTextVNode(" "+vue.toDisplayString(k.label),1)],10,_hoisted_7$t))),128))])]),_:1}),vue.createElementVNode("div",_hoisted_8$q,[vue.unref(l).length>0?(vue.openBlock(),vue.createBlock(S,{key:0,form:vue.unref(l),onSuccess:w[0]||(w[0]=k=>b(vue.unref(m),!0)),class:"mb-0"},null,8,["form"])):vue.createCommentVNode("",!0),vue.createElementVNode("div",_hoisted_9$n,[vue.createVNode(V,{type:vue.unref(_).type,options:vue.unref(_).value,loading:vue.unref(y)},null,8,["type","options","loading"])])]),vue.createVNode(_sfc_main$1l,{ruleList:vue.unref(d)},null,8,["ruleList"])]))}}}),analysis_vue_vue_type_style_index_0_scoped_bf2d49fa_lang="",aceIndicatorSystemPreview=_export_sfc$2(_sfc_main$1k,[["__scopeId","data-v-bf2d49fa"]]),_hoisted_1$14={class:"h-full"},_sfc_main$1j=vue.defineComponent({__name:"relation",setup(i){const{proxy:n}=vue.getCurrentInstance(),r=vue.ref(null),o=vue.ref(!0),a=["#00ADD0","#FFA12F","#B62AFF","#604BFF","#6E35FF","#002AFF","#20C0F4","#95F300","#04FDB8","#AF5AFF"],l=(s,u,c="#00f6ff")=>s.map((d,f)=>{switch(d&&d.title&&(d.name=d.title),u==1&&(c=a.find((p,v)=>v==f%10)),(u===0||u===1)&&(d.label={position:"inside"}),u){case 0:d.symbolSize=70;break;case 1:d.symbolSize=50;break;default:d.symbolSize=10;break}return d.lineStyle={color:c},d.children?(d.itemStyle={borderColor:c,color:c},d.children=l(d.children,u+1,c)):d.itemStyle={color:"transparent",borderColor:c},d});return fetch$1(n).indicatorsRelationTree().then(s=>{if(o.value=!1,!s.data.length){r.value={};return}r.value={type:"tree",toolbox:{show:!0,iconStyle:{borderColor:"#03ceda"},feature:{restore:{}}},tooltip:{trigger:"item",triggerOn:"mousemove",backgroundColor:"rgba(0,0,0,.8)",borderWidth:.5,textStyle:{fontSize:10,color:"#fff"}},series:[{type:"tree",hoverAnimation:!0,data:l([s==null?void 0:s.data[0]],0),top:10,bottom:10,left:10,right:10,layout:"radial",symbol:"circle",symbolSize:10,nodePadding:20,animationDurationUpdate:750,expandAndCollapse:!0,initialTreeDepth:2,roam:!0,focusNodeAdjacency:!0,itemStyle:{borderWidth:1},label:{color:"#000",fontSize:10,fontFamily:"SourceHanSansCN",position:"inside",rotate:0},lineStyle:{width:1,curveness:.5}}]}}),(s,u)=>{const c=vue.resolveComponent("v-chart");return vue.withDirectives((vue.openBlock(),vue.createElementBlock("div",_hoisted_1$14,[vue.createVNode(c,{option:vue.unref(r),autoresize:""},null,8,["option"])])),[[vue.unref(elementPlus.vLoading),vue.unref(o)]])}}}),_hoisted_1$13={key:0,class:"flex items-center gap-x-2.5"},_hoisted_2$U=vue.createElementVNode("div",{class:"font-bold"},"数据分析",-1),_sfc_main$1i=vue.defineComponent({__name:"yoy",props:{search:{default:()=>[]},originSearch:{default:()=>[]},chartType:{default:""},option:{default:null},chartData:{default:null}},setup(i,{expose:n}){const r=i,{proxy:o}=vue.getCurrentInstance(),{dynamicSearchForm:a,dynamicSearchFormat:l,dynamicSearchParams:s}=o.$aceDynamicSearch(o),u=["yySingle","yymmSingle","yymmddSingle"],{seriesItem:c}=useLineCommon(),d=vue.computed(()=>r.search.find(g=>u.includes(g.type))),f=vue.computed(()=>{const g=vue.unref(d)?Object.values(s([vue.unref(d)])).every(_=>_==""):!1;return r.search.filter(_=>u.includes(_.type)).length==1&&!g}),p=vue.ref("");vue.watch(p,()=>v());const v=async()=>{var B;if(!vue.unref(f)||vue.unref(p)=="")return;const g=JSON.parse(JSON.stringify((B=r.chartData)==null?void 0:B.params)),_=JSON.parse(JSON.stringify(r.search)),y=_.find(N=>u.includes(N.type)),b=r.originSearch.find(N=>u.includes(N.type)),C=JSON.parse((g==null?void 0:g.groupArgsJson)??"[]").find(N=>N.comment==r.option.dataShow.x);g.groupArgsJson=JSON.stringify([C]);const w=C.dateFormatType;switch(y.type){case"yymmSingle":y.value=dayjs(y.value).subtract(1,vue.unref(p)=="TB"?"year":"month").format("YYYY-MM");break;case"yymmddSingle":y.value=dayjs(y.value).subtract(1,vue.unref(p)=="TB"?"year":"day").format("YYYY-MM-DD");break;case"yySingle":y.value=dayjs(y.value).subtract(1,"year").format("YYYY");break}g.params=s(_);const $=r.option.dataset.dimensions;$.length>=3&&r.option.dataset.dimensions.pop();const S=await o.$baseHttp.post("/api/ace-data-center/model-indicators/debug",g),V=$[0],k=r.option.dataShow.y.filter(N=>!r.option.dataShow.hide.includes(N));vue.unref(y.type).includes("Range")?(r.option.dataset.dimensions[1]=`${b!=null&&b.minValue?`${b==null?void 0:b.minValue}~`:""}${(b==null?void 0:b.maxValue)??""}${k}`,r.option.dataset.dimensions.push(`${y.minValue?`${y.minValue}~`:""}${(y==null?void 0:y.maxValue)??""}${k}`)):(r.option.dataset.dimensions[1]=`${b==null?void 0:b.value}${k}`,r.option.dataset.dimensions[2]=`${y.value}${k}`,r.option.dataset.dimensions[3]="增长率");const P=r.option.series[0];r.option.series=[],S.data.records.forEach(N=>{m(N,V,w)});const T=JSON.parse(JSON.stringify(r.option.dataset.temp_source));T.forEach((N,O)=>{m(N,V,w);let I=null;N[r.option.dataset.dimensions[1]]=N[k],w?(I=S.data.records.find(F=>F[V]==N[V]),I||(["year"].includes(w)&&(I=S.data.records.find(F=>F[V].indexOf(y.value)>=0),N[V]=V),["day","month"].includes(w)&&(I=S.data.records.find(F=>F[V].split("-").at(-1)==N[V].split("-").at(-1))))):I=S.data.records.find(F=>F[V]==N[V]),I||(I={[k]:0}),I&&(N[r.option.dataset.dimensions[2]]=I[k]);const L=N[r.option.dataset.dimensions[1]]??0,D=N[r.option.dataset.dimensions[2]]??0;N.增长率=!L||!D?0:((L-D)/D*100).toFixed(2)}),r.option.dataset.source=T,setTimeout(()=>{const{yAxis:N,xAxis:O}=r.option;let I="yAxis";!Array.isArray(N)&&N.type!="value"&&(I="xAxis"),r.option.series=[P,{...P,itemStyle:{...(P==null?void 0:P.itemStyle)??{},color:null}},{...c,name:"增长率",[`${I}Index`]:1}],r.option[I]=[Array.isArray(r.option[I])?r.option[I][0]:r.option[I],{type:"value",name:"增长率",nameGap:20,splitLine:!1,nameLocation:I=="xAxis"?"start":"end"}]})},m=(g,_,y)=>{if(!(!y||(g[_]??"")=="")&&["day"].includes(y)){const b=g[_].split("-").filter((x,C)=>C==0?"":x);g[_]=b.join("-")}};return n({init:v,type:p}),(g,_)=>vue.unref(f)&&g.option?(vue.openBlock(),vue.createElementBlock("div",_hoisted_1$13,[_hoisted_2$U,vue.createElementVNode("div",null,[vue.createVNode(vue.unref(elementPlus.ElRadioGroup),{modelValue:vue.unref(p),"onUpdate:modelValue":_[0]||(_[0]=y=>vue.isRef(p)?p.value=y:null)},{default:vue.withCtx(()=>{var y;return[vue.createVNode(vue.unref(elementPlus.ElRadio),{label:"TB",value:"TB"},{default:vue.withCtx(()=>[vue.createTextVNode("同比")]),_:1}),vue.createVNode(vue.unref(elementPlus.ElRadio),{label:"HB",value:"HB",disabled:!["yymmSingle","yymmddSingle"].includes((y=vue.unref(d))==null?void 0:y.type)},{default:vue.withCtx(()=>[vue.createTextVNode(" 环比 ")]),_:1},8,["disabled"])]}),_:1},8,["modelValue"])])])):vue.createCommentVNode("",!0)}}),_withScopeId$p=i=>(vue.pushScopeId("data-v-3923290f"),i=i(),vue.popScopeId(),i),_hoisted_1$12={key:2,class:"flex flex-col chart-preview"},_hoisted_2$T={class:"flex mb-2.5"},_hoisted_3$L={key:0,class:"flex-1"},_hoisted_4$J={class:"flex items-center gap-x-2.5"},_hoisted_5$B=_withScopeId$p(()=>vue.createElementVNode("div",{class:"font-bold"},"计算指标",-1)),_hoisted_6$w={key:0,class:"flex items-center gap-x-2.5"},_hoisted_7$s=_withScopeId$p(()=>vue.createElementVNode("div",{class:"font-bold"},"分组维度",-1)),_hoisted_8$p={class:"flex flex-col flex-1 overflow-hidden"},_hoisted_9$m={class:"relative flex-1"},_hoisted_10$k={class:"flex justify-center change-btns"},_sfc_main$1h=vue.defineComponent({__name:"IndicatorsView",props:{dynamicSearchForm:{default:()=>[]},result:{default:()=>{}},chartData:{default:null}},emits:["search-success"],setup(i,{emit:n}){const r=i,o=n,{proxy:a}=vue.getCurrentInstance(),{dynamicSearchForm:l,dynamicSearchFormat:s,dynamicSearchParams:u}=a.$aceDynamicSearch(a),c=vue.computed(()=>r.chartData),d=vue.ref(null),f=vue.ref(""),p=vue.ref([]),v=vue.ref(r.dynamicSearchForm),m=vue.ref(!1),{option:g,formatChart:_,chartType:y,setChartData:b,changeChartSeries:x,chartDataParams:C}=useCustomChart(),w={day:"按日",week:"按周",month:"按月",quarter:"按季度",year:"按年","":"按时分秒"};vue.onMounted(async()=>{await a.$baseHttp.post(`/api/ace-data-center/model-indicators-echarts/getEchartsTypes/${r.result.id}`).then(P=>{p.value=P.data,P.data.length&&(f.value=P.data[0].code,y.value=P.data[0].type)})}),vue.watch(f,async()=>{V()});const E=P=>{f.value!=P.code&&(g.value={},y.value=P.type,f.value=P.code,vue.unref(d)&&(vue.unref(d).type=""))},$=vue.ref(""),S=vue.ref(""),V=async()=>{var P,T,B,N,O,I,L;v.value=JSON.parse(JSON.stringify(r.dynamicSearchForm)),m.value=!0,g.value={},$.value="",S.value=["2","11"].includes(vue.unref(y))?"":[],r.chartData&&(C.value=r.chartData),await _(vue.unref(f)),$.value=(T=(P=vue.unref(g))==null?void 0:P.dataShow)==null?void 0:T.x,Array.isArray((N=(B=vue.unref(g))==null?void 0:B.dataShow)==null?void 0:N.y)?S.value=(O=vue.unref(g))==null?void 0:O.dataShow.y.filter(D=>{var F;return!(((F=vue.unref(g))==null?void 0:F.dataShow.hide)??[]).includes(D)}):S.value=(L=(I=vue.unref(g))==null?void 0:I.dataShow)==null?void 0:L.y,isMobile&&["1","3","5"].includes(vue.unref(y))&&!vue.unref(g).dataZoom&&(g.value.grid.bottom="10%",g.value.dataZoom=[{type:"slider",backgroundColor:"#eef8fd",fillerColor:"#14b1f8",borderColor:"#eef8fd",startValue:0,endValue:3,filterMode:"",showDetail:!1,width:"90%",height:10,handleSize:30,left:"5%",bottom:25},{type:"inside",zoomOnMouseWheel:!1,moveOnMouseWheel:!0,moveOnMouseMove:!0}]),setTimeout(()=>{m.value=!1},10)};vue.watch([$,S],async([P,T],[B,N])=>{var O;vue.unref(m)||(vue.unref(g).dataShow.x=P,vue.unref(g).dataShow.y=T,Array.isArray(T)&&(vue.unref(g).dataShow.hide=(O=vue.unref(g))==null?void 0:O.dataShow.y.filter(I=>vue.unref(c).y.includes(I.showLabel))),(P!=B||["2","7"].includes(vue.unref(y)))&&(g.value.dataset.source=await b(vue.unref(y),P,["2","7"].includes(vue.unref(y))?T:null),g.value.dataset.temp_source=JSON.parse(JSON.stringify(g.value.dataset.source)),v.value=JSON.parse(JSON.stringify(r.dynamicSearchForm)),vue.unref(d)&&(vue.unref(d).type="")),["xAxis","yAxis"].forEach(I=>{Array.isArray(g.value[I])&&(g.value[I]=g.value[I].filter(L=>L.name!="增长率"))}),x())},{deep:!0});const k=()=>{vue.unref(c).params.params=u(r.dynamicSearchForm),V(),o("search-success",vue.unref(c).params.params)};return(P,T)=>{var I;const B=vue.resolveComponent("aceDynamicSearch"),N=vue.resolveComponent("AppEmpty"),O=vue.resolveComponent("aceCustomChart");return vue.openBlock(),vue.createElementBlock("div",null,[r.dynamicSearchForm.length?(vue.openBlock(),vue.createBlock(B,{key:0,form:r.dynamicSearchForm,onSuccess:k},null,8,["form"])):vue.createCommentVNode("",!0),vue.unref(p).length?(vue.openBlock(),vue.createElementBlock("div",_hoisted_1$12,[vue.createElementVNode("div",_hoisted_2$T,[["9"].includes(vue.unref(y))?vue.createCommentVNode("",!0):(vue.openBlock(),vue.createElementBlock("div",_hoisted_3$L,[vue.createVNode(vue.unref(elementPlus.ElSkeleton),{loading:!((I=vue.unref(g))!=null&&I.dataShow),animated:""},{default:vue.withCtx(()=>[vue.createElementVNode("div",_hoisted_4$J,[_hoisted_5$B,vue.createElementVNode("div",null,[["2","11"].includes(vue.unref(y))?(vue.openBlock(),vue.createBlock(vue.unref(elementPlus.ElRadioGroup),{key:0,modelValue:vue.unref(S),"onUpdate:modelValue":T[0]||(T[0]=L=>vue.isRef(S)?S.value=L:null)},{default:vue.withCtx(()=>{var L;return[(vue.openBlock(!0),vue.createElementBlock(vue.Fragment,null,vue.renderList((((L=vue.unref(c))==null?void 0:L.y)??[]).filter(D=>D.aggType!="other"),D=>(vue.openBlock(),vue.createBlock(vue.unref(elementPlus.ElRadio),{key:D.showLabel,label:D.showLabel,value:D.showLabel},null,8,["label","value"]))),128))]}),_:1},8,["modelValue"])):["8"].includes(vue.unref(y))?(vue.openBlock(),vue.createBlock(vue.unref(elementPlus.ElCheckboxGroup),{key:1,modelValue:vue.unref(S),"onUpdate:modelValue":T[1]||(T[1]=L=>vue.isRef(S)?S.value=L:null)},{default:vue.withCtx(()=>{var L,D;return[(vue.openBlock(!0),vue.createElementBlock(vue.Fragment,null,vue.renderList([...((L=vue.unref(c))==null?void 0:L.y)??[],...(((D=vue.unref(c))==null?void 0:D.x)??[]).map(F=>({...F,showLabel:F.comment}))],F=>(vue.openBlock(),vue.createBlock(vue.unref(elementPlus.ElCheckbox),{key:F.showLabel,label:F.showLabel,value:F.showLabel},null,8,["label","value"]))),128))]}),_:1},8,["modelValue"])):(vue.openBlock(),vue.createBlock(vue.unref(elementPlus.ElCheckboxGroup),{key:2,modelValue:vue.unref(S),"onUpdate:modelValue":T[2]||(T[2]=L=>vue.isRef(S)?S.value=L:null)},{default:vue.withCtx(()=>{var L;return[(vue.openBlock(!0),vue.createElementBlock(vue.Fragment,null,vue.renderList((((L=vue.unref(c))==null?void 0:L.y)??[]).filter(D=>D.aggType!="other"),D=>(vue.openBlock(),vue.createBlock(vue.unref(elementPlus.ElCheckbox),{key:D.showLabel,label:D.showLabel,value:D.showLabel},null,8,["label","value"]))),128))]}),_:1},8,["modelValue"]))])]),["8"].includes(vue.unref(y))?vue.createCommentVNode("",!0):(vue.openBlock(),vue.createElementBlock("div",_hoisted_6$w,[_hoisted_7$s,vue.createElementVNode("div",null,[vue.createVNode(vue.unref(elementPlus.ElRadioGroup),{modelValue:vue.unref($),"onUpdate:modelValue":T[3]||(T[3]=L=>vue.isRef($)?$.value=L:null)},{default:vue.withCtx(()=>[(vue.openBlock(!0),vue.createElementBlock(vue.Fragment,null,vue.renderList(vue.unref(c).x,L=>(vue.openBlock(),vue.createBlock(vue.unref(elementPlus.ElRadio),{key:L.comment,label:L.comment,value:L.comment},{default:vue.withCtx(()=>[vue.createTextVNode(vue.toDisplayString(L.comment)+" ",1),w[L.dateFormatType]?(vue.openBlock(),vue.createElementBlock(vue.Fragment,{key:0},[vue.createTextVNode(" ("+vue.toDisplayString(w[L.dateFormatType])+") ",1)],64)):vue.createCommentVNode("",!0)]),_:2},1032,["label","value"]))),128))]),_:1},8,["modelValue"])])])),["3","1"].includes(vue.unref(y))&&vue.unref(g).dataShow.y.filter(L=>!vue.unref(g).dataShow.hide.includes(L)).length==1?(vue.openBlock(),vue.createBlock(_sfc_main$1i,{key:1,ref_key:"yoyRef",ref:d,chartData:P.chartData,option:vue.unref(g),search:vue.unref(v),originSearch:r.dynamicSearchForm,chartType:vue.unref(y)},null,8,["chartData","option","search","originSearch","chartType"])):vue.createCommentVNode("",!0)]),_:1},8,["loading"])]))]),vue.createElementVNode("div",_hoisted_8$p,[vue.createElementVNode("div",_hoisted_9$m,[vue.createVNode(vue.unref(elementPlus.ElSkeleton),{loading:vue.unref(m),animated:""},{default:vue.withCtx(()=>[vue.createVNode(O,{option:vue.unref(g),chartType:vue.unref(y),indicatorsId:r.result.id},null,8,["option","chartType","indicatorsId"])]),_:1},8,["loading"])]),vue.createElementVNode("div",_hoisted_10$k,[vue.createVNode(vue.unref(elementPlus.ElButtonGroup),null,{default:vue.withCtx(()=>[(vue.openBlock(!0),vue.createElementBlock(vue.Fragment,null,vue.renderList(vue.unref(p),L=>(vue.openBlock(),vue.createBlock(vue.unref(elementPlus.ElButton),{type:vue.unref(f)==L.code?"primary":"",key:L.type,onClick:D=>E(L)},{default:vue.withCtx(()=>{var D;return[vue.createElementVNode("i",{class:vue.normalizeClass((D=vue.unref(echartsTypeList)[L.type])==null?void 0:D.icon)},null,2)]}),_:2},1032,["type","onClick"]))),128))]),_:1})])])])):(vue.openBlock(),vue.createBlock(N,{key:1,description:"暂无数据"}))])}}}),IndicatorsView_vue_vue_type_style_index_0_scoped_3923290f_lang="",IndicatorsView=_export_sfc$2(_sfc_main$1h,[["__scopeId","data-v-3923290f"]]),_hoisted_1$11=["hidden"],_hoisted_2$S={class:"flex items-center w-full mb-4"},_hoisted_3$K={class:"flex justify-end flex-1"},_hoisted_4$I={class:"mb-4"},_hoisted_5$A={class:"flex mb-5 moudle-1"},_hoisted_6$v={class:"flex-1"},_hoisted_7$r={class:"flex items-center mt-2"},_hoisted_8$o={key:0,class:"mr-1 text-xl ri-error-warning-fill text-color-warning"},_hoisted_9$l={key:1,class:"mr-1 text-xl ri-checkbox-circle-fill text-color-success"},_hoisted_10$j={class:"ml-1"},_hoisted_11$g=vue.createElementVNode("div",{class:"w-10"},null,-1),_hoisted_12$e={class:"flex-1"},_hoisted_13$c={class:"items-center mt-2"},_hoisted_14$b=vue.createElementVNode("i",{class:"mr-1 text-xl ri-database-2-fill text-color-primary"},null,-1),_hoisted_15$5={key:1,class:"w-full"},_sfc_main$1g=vue.defineComponent({__name:"modelIndicators",props:{indicatorsId:{default:""},modelIndicatorsRules:{default:()=>[]}},emits:["click-design","rule-success"],setup(i,{expose:n,emit:r}){const o=i,a=r;vue.watch(()=>o.indicatorsId,()=>w());const{proxy:l}=vue.getCurrentInstance(),{dynamicSearchForm:s,dynamicSearchFormat:u,dynamicSearchParams:c}=l.$aceDynamicSearch(l),d=vue.ref(!0),f=vue.ref("basic"),p=vue.ref(!1),v=vue.ref(!1),m=vue.ref([]),g=vue.ref({}),_=vue.ref(null),y=vue.ref([]),b=vue.ref([]),x=vue.ref({}),C=({column:F})=>{vue.unref(x)[F.property]&&(F.order=vue.unref(x)[F.property])},w=async()=>{d.value=!0,f.value="basic",g.value={},k();const F=await l.$baseHttp.get(`/api/ace-data-center/model-indicators/detail?id=${o.indicatorsId}`);_.value=F.data,d.value=!1,x.value=JSON.parse(F.data.sortArgsJson??"{}"),s.value=u(JSON.parse(F.data.formConfJson??"[]")),S()},E=vue.ref(!1),$=vue.ref(!1),S=async(F="")=>{var U,G,J,te,ae,j,ee,le,se;F!="sort"&&(b.value=[],E.value=!0),$.value=!0;const M=Object.keys(vue.unref(x)).map(Z=>({field:Z,type:vue.unref(x)[Z]=="ascending"?"asc":"desc"})),R={aggArgsJson:(U=vue.unref(_))==null?void 0:U.aggArgsJson,groupArgsJson:(G=vue.unref(_))==null?void 0:G.groupArgsJson,sortArgsJson:JSON.stringify(M),params:vue.unref(O)??c(u(JSON.parse(((J=vue.unref(_))==null?void 0:J.formConfJson)??"[]"))),modelIndicatorsId:(te=vue.unref(_))==null?void 0:te.id,pageSize:(ae=vue.unref(_))==null?void 0:ae.pageSize,modelId:(j=vue.unref(_))==null?void 0:j.modelId},z=await l.$baseHttp.post("/api/ace-data-center/model-indicators/debug",R);z&&(y.value=((ee=z.data)==null?void 0:ee.records)??[],E.value=!1,$.value=!1,g.value={x:JSON.parse((le=vue.unref(_))==null?void 0:le.groupArgsJson),y:JSON.parse((se=vue.unref(_))==null?void 0:se.aggArgsJson),params:R},vue.unref(y).length&&F!="sort"&&(Object.keys(vue.unref(y)[0]).forEach(Z=>{b.value.push({label:Z,prop:Z,sortable:"custom"})}),b.value.push({label:"操作",prop:"button",width:"120px",fixed:"right",slot:!0})))},V=F=>{const{prop:M,order:R}=F;!R||vue.unref(x)[M]===R?delete vue.unref(x)[M]:vue.unref(x)[M]=R,S("sort")},k=async()=>{var M;m.value=[];const F=await fetch$1(l).getRule({current:1,size:100,businessType:"indicators",businessId:o.indicatorsId});m.value=((M=F.data)==null?void 0:M.records)??[],a("rule-success",m.value)},P=vue.ref(null),T=F=>{P.value=F,p.value=!0},B=F=>(F.modelIndicatorsId=vue.unref(_).id,F.row=vue.unref(P),F),N=()=>{v.value=!0},O=vue.ref(null),I=F=>{O.value=F,S()};vue.watch(p,F=>D(F)),vue.watch(v,F=>D(F));const L=vue.ref(!1),D=F=>{self!=top&&(L.value=F,window.parent.postMessage(F?"model-indicators-open":"model-indicators-close","*"))};return w(),n({init:w,result:_}),(F,M)=>{const R=vue.resolveComponent("AppResourceVisitor"),z=vue.resolveComponent("aceHeader"),U=vue.resolveComponent("AppTable"),G=vue.resolveComponent("AppEmpty"),J=vue.resolveComponent("aceDynamicList"),te=vue.resolveComponent("AppDrawer");return vue.unref(d)?(vue.openBlock(),vue.createBlock(vue.unref(elementPlus.ElSkeleton),{key:0,animated:""})):(vue.openBlock(),vue.createElementBlock("div",{key:1,class:"animated fadeIn",hidden:vue.unref(L)},[vue.createElementVNode("div",_hoisted_2$S,[vue.createElementVNode("div",null,[vue.createVNode(vue.unref(elementPlus.ElButtonGroup),null,{default:vue.withCtx(()=>[vue.createVNode(vue.unref(elementPlus.ElButton),{onClick:M[0]||(M[0]=ae=>f.value="basic"),type:vue.unref(f)=="basic"?"primary":""},{default:vue.withCtx(()=>[vue.createTextVNode(" 指标图表 ")]),_:1},8,["type"]),vue.createVNode(vue.unref(elementPlus.ElButton),{onClick:M[1]||(M[1]=ae=>f.value="data"),type:vue.unref(f)=="data"?"primary":""},{default:vue.withCtx(()=>[vue.createTextVNode(" 指标数据 ")]),_:1},8,["type"])]),_:1})]),vue.createElementVNode("div",_hoisted_3$K,[vue.createVNode(R,{businessType:"MODEL_INDICATORS",businessld:o.indicatorsId},null,8,["businessld"])])]),vue.withDirectives(vue.createElementVNode("div",null,[vue.createElementVNode("div",_hoisted_4$I,[vue.createVNode(vue.unref(elementPlus.ElSkeleton),{loading:vue.unref($),animated:""},{default:vue.withCtx(()=>[vue.createVNode(IndicatorsView,{dynamicSearchForm:vue.unref(s),result:vue.unref(_),chartData:vue.unref(g),onSearchSuccess:I},null,8,["dynamicSearchForm","result","chartData"])]),_:1},8,["loading"])])],512),[[vue.vShow,vue.unref(f)=="basic"]]),vue.withDirectives(vue.createElementVNode("div",null,[vue.createElementVNode("div",_hoisted_5$A,[vue.createElementVNode("div",_hoisted_6$v,[vue.createVNode(z,{title:"指标计算"}),vue.createElementVNode("div",_hoisted_7$r,[vue.unref(m).some(ae=>ae.rows>0)?(vue.openBlock(),vue.createElementBlock("i",_hoisted_8$o)):(vue.openBlock(),vue.createElementBlock("i",_hoisted_9$l)),vue.createElementVNode("span",_hoisted_10$j,vue.toDisplayString(vue.unref(_).remark),1)])]),_hoisted_11$g,vue.createElementVNode("div",_hoisted_12$e,[vue.createVNode(z,{title:"数据来源"}),vue.createElementVNode("div",_hoisted_13$c,[_hoisted_14$b,vue.createTextVNode(" 重构仓模型数据 | "+vue.toDisplayString(vue.unref(_).modelName)+"【 ",1),vue.createElementVNode("span",{class:"cursor-pointer text-color-primary",onClick:N},vue.toDisplayString(vue.unref(_).modelCode),1),vue.createTextVNode(" 】 ")])])]),vue.createVNode(vue.unref(elementPlus.ElSkeleton),{loading:vue.unref(E),animated:""},{default:vue.withCtx(()=>[vue.unref(b).length?(vue.openBlock(),vue.createBlock(U,{key:0,maxHeight:"400px",tableData:vue.unref(b),list:vue.unref(y),loading:!1,headerCellClassName:C,onSortChange:V},{button:vue.withCtx(({row:ae})=>[vue.createVNode(vue.unref(elementPlus.ElLink),{type:"primary",onClick:j=>T(ae)},{default:vue.withCtx(()=>[vue.createTextVNode("查看明细")]),_:2},1032,["onClick"])]),_:1},8,["tableData","list"])):(vue.openBlock(),vue.createElementBlock("div",_hoisted_15$5,[vue.createVNode(G,{description:"暂无数据",class:"mt-4"})]))]),_:1},8,["loading"])],512),[[vue.vShow,vue.unref(f)=="data"]]),vue.createVNode(_sfc_main$1l,{ruleList:vue.unref(m)},null,8,["ruleList"]),vue.createVNode(te,{modelValue:vue.unref(p),"onUpdate:modelValue":M[2]||(M[2]=ae=>vue.isRef(p)?p.value=ae:null),title:"查看明细",size:"90%"},{default:vue.withCtx(()=>[vue.createVNode(z,{title:"统计:",class:"mb-2"}),vue.createVNode(U,{height:null,tableData:Object.keys(vue.unref(P)).map(ae=>({label:ae,prop:ae})),list:[vue.unref(P)],loading:!1},null,8,["tableData","list"]),vue.createVNode(z,{title:"钻取明细:",class:"mt-4 mb-2"}),vue.createVNode(J,{id:vue.unref(_).modelId,keyName:"modelIndicatorsId",title:vue.unref(_).modelName,isDownLoad:vue.unref(isMobile),url:"/api/ace-data-center/model-indicators/drilling",formatParamsFunc:B},null,8,["id","title","isDownLoad"])]),_:1},8,["modelValue"]),vue.createVNode(te,{modelValue:vue.unref(v),"onUpdate:modelValue":M[3]||(M[3]=ae=>vue.isRef(v)?v.value=ae:null),title:"模型数据",size:"90%"},{default:vue.withCtx(()=>[vue.createVNode(J,{id:vue.unref(_).modelId,title:vue.unref(_).modelName},null,8,["id","title"])]),_:1},8,["modelValue"])],8,_hoisted_1$11))}}}),_hoisted_1$10=vue.createElementVNode("i",{class:"ri-search-line"},null,-1),_hoisted_2$R={class:"mt-3"},_hoisted_3$J={key:1,class:"mr-1 -ml-5 text-base ri-edit-circle-fill text-color-primary"},_sfc_main$1f=vue.defineComponent({__name:"modelMenu",props:{type:{default:""}},emits:["node-click","change-type"],setup(i,{expose:n,emit:r}){const o=i,{proxy:a}=vue.getCurrentInstance(),l=vue.ref(""),s=vue.ref(null),u=r;vue.watch(l,y=>{vue.unref(s).filter(y)});const c=(y,b)=>y?b.modelName.includes(y):!0,d=vue.ref([]),f=vue.ref([]),p=vue.ref([]),v=vue.ref(!0),m=vue.computed(()=>o.type=="ODS"?vue.unref(d):o.type=="DWD"?vue.unref(f):vue.unref(p)),g=()=>{Promise.all([fetch$1(a).loadModelMenu({modelLayer:"ODS"}),fetch$1(a).loadModelMenu({modelLayer:"DWD"}),fetch$1(a).loadModelMenu({modelLayer:"ODSVIEW"})]).then(y=>{const b=y[0].data,x=y[1].data,C=y[2].data;d.value=Object.keys(b).map(w=>({modelName:w,id:w,children:b[w]})),f.value=Object.keys(x).map(w=>({modelName:w,id:w,children:x[w]})),p.value=Object.keys(C).map(w=>({modelName:w,id:w,children:C[w]})),v.value=!1})};g();const _=y=>{if(y.modelCode){if(o.type=="ODS"){u("node-click",y);return}Array.isArray(y.children)||u("node-click",y)}};return n({init:g}),(y,b)=>{const x=vue.resolveComponent("AppEmpty");return vue.openBlock(),vue.createElementBlock(vue.Fragment,null,[vue.createVNode(vue.unref(elementPlus.ElInput),{placeholder:"请输入内容",clearable:"",modelValue:vue.unref(l),"onUpdate:modelValue":b[0]||(b[0]=C=>vue.isRef(l)?l.value=C:null)},{prefix:vue.withCtx(()=>[_hoisted_1$10]),_:1},8,["modelValue"]),vue.createElementVNode("div",_hoisted_2$R,[vue.unref(v)?(vue.openBlock(),vue.createBlock(vue.unref(elementPlus.ElSkeleton),{key:0,animated:"",count:2})):(vue.openBlock(),vue.createBlock(vue.unref(elementPlus.ElTree),{key:1,class:"animated fadeIn",ref_key:"treeRef",ref:s,data:vue.unref(m),"empty-text":"暂无数据","default-expand-all":"","node-key":"id","highlight-current":"","filter-node-method":c,onNodeClick:_},{default:vue.withCtx(({node:C,data:w})=>[C.level!=1||y.type=="ODS"?(vue.openBlock(),vue.createElementBlock(vue.Fragment,{key:0},[w.modelCode&&w.openForm!=2?(vue.openBlock(),vue.createElementBlock("i",{key:0,class:vue.normalizeClass(["mr-1 -ml-5 text-base ri-checkbox-circle-fill",[w.publishStatus==2?"text-color-success":"text-color-info"]])},null,2)):vue.createCommentVNode("",!0)],64)):vue.createCommentVNode("",!0),w.openForm==2?(vue.openBlock(),vue.createElementBlock("i",_hoisted_3$J)):vue.createCommentVNode("",!0),vue.createElementVNode("span",{class:vue.normalizeClass({"font-bold":C.level==1})},vue.toDisplayString(w.modelName),3),vue.renderSlot(y.$slots,"default",{element:w})]),empty:vue.withCtx(()=>[vue.createVNode(x,{description:"暂无数据"})]),_:3},8,["data"]))])],64)}}}),_hoisted_1$$={class:"mb-3"},_hoisted_2$Q={style:{height:"calc(100vh - 100px)"},class:"overflow-y-auto"},_sfc_main$1e=vue.defineComponent({__name:"modelIndicatorsAdd",emits:["click-node"],setup(i,{expose:n,emit:r}){const o=r,{proxy:a}=vue.getCurrentInstance(),l=vue.ref(!1),s=vue.ref(),u=vue.ref([{label:"源数据",value:"ODS",rule:"VIEW_ODS",disabled:!0},{label:"源视图",value:"ODSVIEW",rule:"VIEW_ODSVIEW",disabled:!0},{label:"整合数据",value:"DWD",rule:"VIEW_DWD",disabled:!0}]);fetch$1(a).getCurrFunc("MODEL").then(p=>{vue.unref(u).forEach(v=>{v.disabled=!p.data.includes(v.rule),!vue.unref(s)&&!v.disabled&&(s.value=v.value)})});const c=p=>{s.value=p},d=()=>{l.value=!0},f=p=>{o("click-node",p),l.value=!1};return n({init:d}),(p,v)=>{const m=vue.resolveComponent("AppDrawer");return vue.openBlock(),vue.createBlock(m,{modelValue:vue.unref(l),"onUpdate:modelValue":v[0]||(v[0]=g=>vue.isRef(l)?l.value=g:null),title:"选择要分析的数据",size:"400px"},{default:vue.withCtx(()=>[vue.createElementVNode("div",_hoisted_1$$,[vue.createVNode(vue.unref(elementPlus.ElButtonGroup),null,{default:vue.withCtx(()=>[(vue.openBlock(!0),vue.createElementBlock(vue.Fragment,null,vue.renderList(vue.unref(u),g=>(vue.openBlock(),vue.createBlock(vue.unref(elementPlus.ElButton),{type:vue.unref(s)==g.value?"primary":"",key:g.value,disabled:g.disabled,onClick:_=>c(g.value)},{default:vue.withCtx(()=>[vue.createTextVNode(vue.toDisplayString(g.label),1)]),_:2},1032,["type","disabled","onClick"]))),128))]),_:1})]),vue.createElementVNode("div",_hoisted_2$Q,[vue.createVNode(_sfc_main$1f,{ref:"menuRef",type:vue.unref(s),onNodeClick:f},null,8,["type"])])]),_:1},8,["modelValue"])}}}),_hoisted_1$_=vue.createElementVNode("div",{class:"flex justify-end flex-1"},null,-1),_hoisted_2$P={class:"whitespace-nowrap ml-2.5"},_hoisted_3$I=vue.createElementVNode("i",{class:"mr-1 ri-add-circle-line"},null,-1),_hoisted_4$H=["onClick"],_hoisted_5$z=vue.createElementVNode("i",{class:"ri-edit-box-line"},null,-1),_hoisted_6$u={key:0,class:"flex items-center justify-center h-full"},_sfc_main$1d=vue.defineComponent({__name:"index",props:{isCustom:{type:Boolean,default:!1},element:{default:null},tempId:{default:""}},emits:["close-design"],setup(i,{emit:n}){var C,w;const r=i,o=n,{proxy:a}=vue.getCurrentInstance();vue.inject("local");const l=vue.ref(null),s=vue.ref(null),u=vue.ref(null),c=vue.ref(null),d=vue.ref(r.element??{});vue.provide("modelEle",d),vue.provide("getListModelIndicators",()=>{});const f=vue.ref([{label:"指标分析",value:"zbfx"},{label:"指标全景",value:"zbqj",disabled:!0}]),p=vue.ref(vue.unref(f)[0].value),v=vue.ref(((C=r==null?void 0:r.element)==null?void 0:C.id)??"");fetch$1(a).getCurrFunc("INDICATORS").then(E=>{vue.unref(f).find($=>$.value=="zbqj").disabled=!E.data.includes("INDICATORS_VIEW")});const m=vue.ref([]);fetch$1(a).getCurrFunc("MODEL_INDICATORS").then(E=>{m.value=E.data});const g=vue.ref(((w=r==null?void 0:r.element)==null?void 0:w.businessType)??""),_=E=>{v.value="",g.value=E.type,setTimeout(()=>{v.value=E.id},100)},y=E=>{d.value=E,vue.unref(l).init()},b=async E=>{const $=await a.$baseHttp.get(`/api/ace-data-center/model-indicators/detail?id=${E}`);$&&vue.nextTick(()=>{setTimeout(()=>{const{modelId:S,modelName:V,modelCode:k}=$.data;d.value={id:S,modelName:V,modelCode:k},vue.unref(l).init(E)},300)})},x=()=>{vue.unref(v)&&(o("close-design",vue.unref(v)),vue.unref(u)&&vue.unref(u).init()),vue.unref(s)&&vue.unref(s).init()};return(E,$)=>{const S=vue.resolveComponent("AppEmpty");return vue.openBlock(),vue.createBlock(vue.unref(elementPlus.ElContainer),{class:"h-full"},{default:vue.withCtx(()=>[vue.createVNode(vue.unref(elementPlus.ElHeader),{style:{height:"auto",padding:"0"},class:"flex items-center w-full mb-3"},{default:vue.withCtx(()=>[E.isCustom?vue.createCommentVNode("",!0):(vue.openBlock(),vue.createBlock(vue.unref(elementPlus.ElButtonGroup),{key:0},{default:vue.withCtx(()=>[(vue.openBlock(!0),vue.createElementBlock(vue.Fragment,null,vue.renderList(vue.unref(f),V=>(vue.openBlock(),vue.createBlock(vue.unref(elementPlus.ElButton),{type:vue.unref(p)==V.value?"primary":"",key:V.value,disabled:V.disabled,onClick:k=>p.value=V.value},{default:vue.withCtx(()=>[vue.createTextVNode(vue.toDisplayString(V.label),1)]),_:2},1032,["type","disabled","onClick"]))),128))]),_:1})),_hoisted_1$_]),_:1}),vue.withDirectives(vue.createVNode(vue.unref(elementPlus.ElContainer),{class:"overflow-hidden"},{default:vue.withCtx(()=>[E.isCustom?vue.createCommentVNode("",!0):(vue.openBlock(),vue.createBlock(vue.unref(elementPlus.ElAside),{key:0,class:"pr-5 mr-5"},{default:vue.withCtx(()=>[vue.createVNode(_sfc_main$1m,{onNodeClick:_,tempId:E.tempId||vue.unref(v),ref_key:"menuRef",ref:s},{search:vue.withCtx(()=>[vue.createElementVNode("div",_hoisted_2$P,[vue.unref(m).includes("STATISTICAL_ANALYSIS")?(vue.openBlock(),vue.createBlock(vue.unref(elementPlus.ElButton),{key:0,type:"primary",onClick:$[0]||($[0]=V=>vue.unref(c).init())},{default:vue.withCtx(()=>[_hoisted_3$I,vue.createTextVNode(" 新增指标 ")]),_:1})):vue.createCommentVNode("",!0)])]),"menu-item":vue.withCtx(({data:V})=>[vue.unref(m).includes("RELATED_INDICATORS")&&V.type!="INDICATORS"?(vue.openBlock(),vue.createElementBlock("div",{key:0,class:"ml-4 mr-2 cursor-pointer text-color-warning",onClick:vue.withModifiers(k=>b(V.id),["stop"])},[_hoisted_5$z,vue.createTextVNode(" 编辑 ")],8,_hoisted_4$H)):vue.createCommentVNode("",!0)]),_:1},8,["tempId"])]),_:1})),vue.createVNode(vue.unref(elementPlus.ElMain),null,{default:vue.withCtx(()=>[vue.unref(v)?(vue.openBlock(),vue.createElementBlock(vue.Fragment,{key:1},[vue.unref(g)=="INDICATORS"?(vue.openBlock(),vue.createBlock(aceIndicatorSystemPreview,{key:0,indicatorsId:vue.unref(v)},null,8,["indicatorsId"])):vue.createCommentVNode("",!0),vue.unref(g)=="MODEL_INDICATORS"?(vue.openBlock(),vue.createBlock(_sfc_main$1g,{key:1,onClickDesign:b,modelIndicatorsRules:vue.unref(m),indicatorsId:vue.unref(v),ref_key:"modelIndicatorsRef",ref:u},null,8,["modelIndicatorsRules","indicatorsId"])):vue.createCommentVNode("",!0)],64)):(vue.openBlock(),vue.createElementBlock("div",_hoisted_6$u,[vue.createVNode(S,{description:"请选择对应指标"})]))]),_:1})]),_:1},512),[[vue.vShow,vue.unref(p)=="zbfx"]]),vue.unref(p)=="zbqj"?(vue.openBlock(),vue.createBlock(vue.unref(elementPlus.ElMain),{key:0},{default:vue.withCtx(()=>[vue.createVNode(_sfc_main$1j)]),_:1})):vue.createCommentVNode("",!0),vue.createVNode(aceIndicatorDesign,{ref_key:"designRef",ref:l,onClose:x},null,512),vue.createVNode(_sfc_main$1e,{ref_key:"modelIndicatorsAddRef",ref:c,onClickNode:y},null,512)]),_:1})}}}),_withScopeId$o=i=>(vue.pushScopeId("data-v-e52b7096"),i=i(),vue.popScopeId(),i),_hoisted_1$Z={class:"flex flex-col h-full"},_hoisted_2$O=_withScopeId$o(()=>vue.createElementVNode("i",{class:"mr-1 ri-add-circle-line"},null,-1)),_hoisted_3$H={class:"flex-1 mt-3 overflow-y-auto card-container"},_hoisted_4$G={key:0,class:"flex items-center justify-center h-full"},_hoisted_5$y=["onClick"],_hoisted_6$t={class:"flex items-center"},_hoisted_7$q=_withScopeId$o(()=>vue.createElementVNode("i",{class:"mr-1 ri-database-line"},null,-1)),_hoisted_8$n={class:"font-bold"},_hoisted_9$k={class:"flex items-center justify-between w-4/5 mt-3 ml-auto mr-auto"},_hoisted_10$i={class:"flex items-center"},_hoisted_11$f=_withScopeId$o(()=>vue.createElementVNode("i",{class:"mr-1 ri-checkbox-circle-fill text-color-success"},null,-1)),_hoisted_12$d=_withScopeId$o(()=>vue.createElementVNode("div",{class:"text-color-info"},"|",-1)),_hoisted_13$b={class:"flex justify-end mt-3 text-xs text-color-info pb"},_hoisted_14$a={class:"w-4/5 overflow-hidden whitespace-nowrap text-ellipsis"},_sfc_main$1c=vue.defineComponent({__name:"menu",emits:["node-click"],setup(i,{expose:n,emit:r}){const{proxy:o}=vue.getCurrentInstance(),{dataSourceSubmit:a,testConnect:l,loadDataSourceMenu:s}=fetch$1(o).dbImport,{setFormValue:u,getFormValue:c}=o.$globalHooks.useForm(),{openMessage:d}=o.$globalHooks.useMessage(),f=o.$globalDict,p=r,v=vue.ref([]),m=vue.ref(!0),g=()=>{v.value=[],m.value=!0,s().then(S=>{m.value=!1,v.value=S.data??[],S.data.length&&vue.unref(E)==""&&$(S.data[0])})};g();const _=vue.reactive([{name:"数据源名称",type:FieldType.Text,fieldName:"name",value:"",required:!0},{name:"数据源类型",type:FieldType.Select,fieldName:"dataSourceType",value:"",dict:"storeType",required:!0,changeFunc:S=>{if(!S.value)return;let V=f.dataSourceUrlDemo.find(k=>k.label.toLowerCase()===S.value.toLowerCase());_.find(k=>k.fieldName==="dataSourceUrlDemo").value=(V==null?void 0:V.value)??""}},{name:"数据源链接地址",type:FieldType.Textarea,fieldName:"dataSourceUrl",value:"",required:!0},{name:"链接示例",type:FieldType.Slot,fieldName:"dataSourceUrlDemo",value:""},{name:"数据库用户名",type:FieldType.Text,fieldName:"connectUserName",value:"",required:!0},{name:"数据库用密码",type:FieldType.Password,fieldName:"connectPassword",value:"",required:!0}]),y=vue.ref(!1),b=()=>{u({},_),y.value=!0},x=S=>{_.find(V=>V.fieldName==="dataSourceUrl").value=S.value},C=async()=>{const{params:S,error:V}=c(_);V.length>0||!await a(S)||(y.value=!1,d({type:"success",message:"操作成功"}),g())},w=async()=>{const{params:S,error:V}=c(_);V.length>0||!await l(S)||d({type:"success",message:"数据库链接成功"})},E=vue.ref(""),$=S=>{vue.unref(E)!=S.dataSourceId&&(E.value=S.dataSourceId,p("node-click",S))};return n({initMenu:g}),(S,V)=>{const k=vue.resolveComponent("aceHeader"),P=vue.resolveComponent("AppEmpty"),T=vue.resolveComponent("AppForm"),B=vue.resolveComponent("AppDialog");return vue.openBlock(),vue.createElementBlock("div",_hoisted_1$Z,[vue.createVNode(k,{title:"数据源"},{default:vue.withCtx(()=>[vue.createVNode(vue.unref(elementPlus.ElButton),{type:"primary",size:"small",onClick:b},{default:vue.withCtx(()=>[_hoisted_2$O,vue.createTextVNode(" 新增 ")]),_:1})]),_:1}),vue.createElementVNode("div",_hoisted_3$H,[vue.createVNode(vue.unref(elementPlus.ElSkeleton),{loading:vue.unref(m),animated:""},{default:vue.withCtx(()=>[vue.unref(v).length?(vue.openBlock(!0),vue.createElementBlock(vue.Fragment,{key:1},vue.renderList(vue.unref(v),N=>(vue.openBlock(),vue.createElementBlock("div",{key:N.id,class:vue.normalizeClass(["item",{active:vue.unref(E)==N.dataSourceId}]),onClick:O=>$(N)},[vue.createElementVNode("div",_hoisted_6$t,[_hoisted_7$q,vue.createElementVNode("span",_hoisted_8$n,vue.toDisplayString(N.dataSourceComment),1)]),vue.createElementVNode("div",_hoisted_9$k,[vue.createElementVNode("div",_hoisted_10$i,[_hoisted_11$f,vue.createTextVNode(" 已同步 "),vue.createElementVNode("strong",null,vue.toDisplayString(N.synchronizedTableCount),1)]),_hoisted_12$d,vue.createElementVNode("div",null,[vue.createTextVNode(" 总表数 "),vue.createElementVNode("strong",null,vue.toDisplayString(N.tableCount),1)])]),vue.createElementVNode("div",_hoisted_13$b,vue.toDisplayString(N.version),1)],10,_hoisted_5$y))),128)):(vue.openBlock(),vue.createElementBlock("div",_hoisted_4$G,[vue.createVNode(P,{description:"暂无数据源"})]))]),_:1},8,["loading"])]),vue.createVNode(B,{modelValue:vue.unref(y),"onUpdate:modelValue":V[1]||(V[1]=N=>vue.isRef(y)?y.value=N:null),title:"新增接入数据源",size:700},{footer:vue.withCtx(()=>[vue.createVNode(vue.unref(elementPlus.ElButton),{style:{"margin-right":"auto"},type:"success",onClick:w},{default:vue.withCtx(()=>[vue.createTextVNode(" 测试链接 ")]),_:1}),vue.createVNode(vue.unref(elementPlus.ElButton),{class:"ml-3",type:"primary",onClick:C},{default:vue.withCtx(()=>[vue.createTextVNode("保存")]),_:1}),vue.createVNode(vue.unref(elementPlus.ElButton),{class:"ml-3",onClick:V[0]||(V[0]=N=>y.value=!1)},{default:vue.withCtx(()=>[vue.createTextVNode("取消")]),_:1})]),default:vue.withCtx(()=>[vue.createVNode(T,{form:vue.unref(_),col:1,labelWidth:120},{dataSourceUrlDemo:vue.withCtx(({element:N})=>[vue.createVNode(vue.unref(elementPlus.ElTooltip),{content:N.value},{default:vue.withCtx(()=>[vue.createElementVNode("div",_hoisted_14$a,vue.toDisplayString(N.value),1)]),_:2},1032,["content"]),vue.createVNode(vue.unref(elementPlus.ElButton),{type:"primary",onClick:O=>x(N)},{default:vue.withCtx(()=>[vue.createTextVNode("复制")]),_:2},1032,["onClick"])]),_:1},8,["form"])]),_:1},8,["modelValue"])])}}}),menu_vue_vue_type_style_index_0_scoped_e52b7096_lang="",Menu$2=_export_sfc$2(_sfc_main$1c,[["__scopeId","data-v-e52b7096"]]),_sfc_main$1b=vue.defineComponent({__name:"sourceTableData",setup(i,{expose:n}){const r=vue.ref(!1),o=vue.ref(null),a=vue.ref(""),l=vue.ref([]),s=f=>{l.value=[],(f==null?void 0:f.data.length)>0&&(l.value=Object.keys(f.data[0]).filter(p=>p!="pageIndex").map(p=>({label:p,prop:p})))},u=vue.ref({}),c=f=>Object.assign(f,vue.unref(u));return n({init:(f,p)=>{vue.unref(u).dataSourceId=f,vue.unref(u).sourceTableCode=p,r.value=!0,a.value="/api/ace-data-center/data-source/sourceDataPage"}}),(f,p)=>{const v=vue.resolveComponent("AppList"),m=vue.resolveComponent("AppDrawer");return vue.openBlock(),vue.createBlock(m,{modelValue:vue.unref(r),"onUpdate:modelValue":p[0]||(p[0]=g=>vue.isRef(r)?r.value=g:null),title:"数据源明细",size:"90%"},{default:vue.withCtx(()=>[vue.createVNode(v,{tableData:vue.unref(l),url:vue.unref(a),ref_key:"appList",ref:o,formatParamsFunc:c,onSuccess:s,methods:"post"},null,8,["tableData","url"])]),_:1},8,["modelValue"])}}}),_hoisted_1$Y={class:"mt-2"},_sfc_main$1a=vue.defineComponent({__name:"setting",emits:["refresh"],setup(i,{expose:n,emit:r}){const{proxy:o}=vue.getCurrentInstance(),{setFormValue:a,getFormValue:l}=o.$globalHooks.useForm(),{openMessage:s}=o.$globalHooks.useMessage(),{submitDefaultDbExtract:u}=fetch$1(o).dbImport,c=r,d=vue.ref(!1),f=vue.ref(!1),p=vue.ref(null),v=vue.reactive([{name:"方案名称",type:FieldType.Text,fieldName:"extractName",value:"",required:!0},{name:"抽取方式",type:FieldType.Radio,fieldName:"extractType",value:"",required:!0,options:[{label:"全量抽取",value:"1"},{label:"增量抽取",value:"2"}],changeFunc:b=>{v.find(C=>C.fieldName=="incrementalField").hide=b.value!=2;const x=v.find(C=>C.fieldName=="clearBeforeExt");x.hide=b.value!=1,b.isChange&&b.value!=1&&(x.value="0")}},{name:"清空历史数据",type:FieldType.Radio,fieldName:"clearBeforeExt",value:"",required:!0,options:[{label:"是",value:"1"},{label:"否",value:"0"}],defVal:"0"},{name:"增量字段",type:FieldType.Select,fieldName:"incrementalField",value:"",required:!0,tip:"该字段必须为本模型字段,并且是SQL结果集中存在的字段"},{name:"taskDefinedId",type:FieldType.Text,fieldName:"taskDefinedId",hide:!0},{name:"id",type:FieldType.Text,fieldName:"id",hide:!0}]),m=vue.ref(null),g=vue.ref({}),_=async b=>{g.value=b,f.value=!1;const x=await o.$baseHttp.get("/api/ace-data-center/model-attribute/allModelAttribute",{params:{modelId:b.modelId,projectId:o.$baseGetCurrentProjectId()},headers:{loading:!0}});v.find(C=>C.fieldName=="incrementalField").options=x.data.map(C=>({...C,label:`${C.attributeCode}(${C.attributeComment||C.attributeCode})`,value:C.attributeCode})),d.value=!0,vue.nextTick(()=>{a({...b,extractName:b.extractName??"增量抽取"},v),b!=null&&b.taskDefined&&(f.value=!0),vue.unref(p).init((b==null?void 0:b.taskDefined)??{}),m.value=(b==null?void 0:b.taskDefined)??null})},y=async()=>{const{params:b,error:x}=l(v);if(x.length>0)return;if(vue.unref(f)){const{params:w,error:E}=vue.unref(p).getForm();if(E.length>0)return;b.taskDefined={...vue.unref(m)??{},...w}}b.dataSourceId=vue.unref(g).dataSourceId,b.modelId=vue.unref(g).modelId,b.streamType="STANDARD",await u(b)&&(s({type:"success",message:"操作成功"}),d.value=!1,c("refresh"))};return n({init:_}),(b,x)=>{const C=vue.resolveComponent("AppForm"),w=vue.resolveComponent("aceHeader"),E=vue.resolveComponent("AppTaskDesign"),$=vue.resolveComponent("AppDialog");return vue.openBlock(),vue.createBlock($,{modelValue:vue.unref(d),"onUpdate:modelValue":x[2]||(x[2]=S=>vue.isRef(d)?d.value=S:null),title:"配置",size:800},{footer:vue.withCtx(()=>[vue.createVNode(vue.unref(elementPlus.ElButton),{class:"ml-3",type:"primary",onClick:y},{default:vue.withCtx(()=>[vue.createTextVNode("保存")]),_:1}),vue.createVNode(vue.unref(elementPlus.ElButton),{class:"ml-3",onClick:x[1]||(x[1]=S=>d.value=!1)},{default:vue.withCtx(()=>[vue.createTextVNode("取消")]),_:1})]),default:vue.withCtx(()=>[vue.createVNode(C,{form:vue.unref(v)},null,8,["form"]),vue.createElementVNode("div",_hoisted_1$Y,[vue.createVNode(w,{title:"作业配置",class:"mb-2"},{left:vue.withCtx(()=>[vue.createVNode(vue.unref(elementPlus.ElCheckbox),{class:"ml-2",modelValue:vue.unref(f),"onUpdate:modelValue":x[0]||(x[0]=S=>vue.isRef(f)?f.value=S:null)},{default:vue.withCtx(()=>[vue.createTextVNode("作业配置")]),_:1},8,["modelValue"])]),_:1}),vue.withDirectives(vue.createElementVNode("div",null,[vue.createVNode(E,{ref_key:"taskDesignRef",ref:p},null,512)],512),[[vue.vShow,vue.unref(f)]])])]),_:1},8,["modelValue"])}}}),_hoisted_1$X=vue.createElementVNode("i",{class:"mr-2 ri-exchange-line"},null,-1),_hoisted_2$N=vue.createElementVNode("i",{class:"mr-2 ri-refresh-line"},null,-1),_hoisted_3$G=vue.createElementVNode("div",null,null,-1),_hoisted_4$F=vue.createElementVNode("i",{class:"mr-2 ri-delete-bin-line"},null,-1),_sfc_main$19=vue.defineComponent({__name:"model-extract-log",emits:["success"],setup(i,{expose:n,emit:r}){const{proxy:o}=vue.getCurrentInstance(),{openMessage:a}=o.$globalHooks.useMessage(),l=r,s=vue.ref(!1),u=vue.ref(null),c=vue.ref(""),d=vue.ref([]),f=v=>{const{businessId:m,businessType:g="file_extract",ajaxUrl:_="",table:y}=v;d.value=y||[{label:"批次号",prop:"batchNo"},{label:"日期",prop:"createTime"},{label:"文件名",prop:"file",slot:!0},{label:"抽取方式",prop:"createTime",func:b=>{var x;return((x=JSON.parse(b.businessSnapshot||"{}"))==null?void 0:x.extractType)==2?"覆盖":"追加"}},{label:"数据总数",prop:"totalNum"},{label:"成功数",prop:"successNum"},{label:"失败数",prop:"failNum"},{label:"协同参数",prop:"collaborateValue"},{label:"操作",prop:"action",slot:!0,fixed:"right"}],c.value=_||`/api/ace-data-center/extract-log/list?descs=create_time&businessId=${m}&businessType=${g}`,s.value=!0},p=async(v,m)=>{switch(v){case"refresh":{if(!await o.$baseHttp.post(`/api/ace-data-center/extract-log/updateSuccessTotal/${m.id}`,{},{headers:{loading:!0}}))return;a({type:"success",message:"操作成功"}),vue.unref(u).getData(),l("success")}break;case"delete":o.$baseConfirm({content:"删除数据可能影响指标统计,是否确认删除?",callConfirm:async()=>{await o.$baseHttp.post(`/api/ace-data-center/extract-log/deleteModelData/${m.id}`,{},{headers:{loading:!0}})&&(a({type:"success",message:"操作成功"}),vue.unref(u).getData(),l("success"))}});break;case"run":o.$baseConfirm({content:"重跑数据会先删除本批次数据,然后新建立一个批次任务执行,是否继续执行?",callConfirm:async()=>{await o.$baseHttp.post(`/api/ace-data-center/extract-log/reRunTeamworkDbExtractBy/${m.id}`,{},{headers:{loading:!0}})&&(a({type:"success",message:"操作成功"}),vue.unref(u).getData(),l("success"))}});break;case"download":{const g=JSON.parse((m==null?void 0:m.businessSnapshot)??"{}");window.open(g.fileUrl)}break}};return n({init:f}),(v,m)=>{const g=vue.resolveComponent("AppList"),_=vue.resolveComponent("AppDrawer");return vue.openBlock(),vue.createBlock(_,{modelValue:vue.unref(s),"onUpdate:modelValue":m[0]||(m[0]=y=>vue.isRef(s)?s.value=y:null),title:"抽取日志",size:"90%"},{default:vue.withCtx(()=>[vue.createVNode(g,{tableData:vue.unref(d),url:vue.unref(c),ref_key:"appList",ref:u},{file:vue.withCtx(({row:y})=>[vue.createVNode(vue.unref(elementPlus.ElLink),{type:"primary",onClick:b=>p("download",y)},{default:vue.withCtx(()=>{var b;return[vue.createTextVNode(vue.toDisplayString((b=JSON.parse(y.businessSnapshot??"{}"))==null?void 0:b.fileName),1)]}),_:2},1032,["onClick"])]),action:vue.withCtx(({row:y})=>{var b;return[((b=JSON.parse(y.businessSnapshot||"{}"))==null?void 0:b.extractType)==3?(vue.openBlock(),vue.createBlock(vue.unref(elementPlus.ElLink),{key:0,type:"primary",class:"mr-2",onClick:x=>p("run",y)},{default:vue.withCtx(()=>[_hoisted_1$X,vue.createTextVNode(" 重跑 ")]),_:2},1032,["onClick"])):vue.createCommentVNode("",!0),vue.createVNode(vue.unref(elementPlus.ElLink),{type:"primary",onClick:x=>p("refresh",y)},{default:vue.withCtx(()=>[_hoisted_2$N,vue.createTextVNode(" 刷新 ")]),_:2},1032,["onClick"]),_hoisted_3$G,vue.createVNode(vue.unref(elementPlus.ElLink),{type:"danger",onClick:x=>p("delete",y)},{default:vue.withCtx(()=>[_hoisted_4$F,vue.createTextVNode(" 删除本批次数据 ")]),_:2},1032,["onClick"])]}),_:1},8,["tableData","url"])]),_:1},8,["modelValue"])}}}),_hoisted_1$W={class:"flex flex-col h-full overflow-hidden"},_hoisted_2$M={class:"flex flex-col flex-1 mt-3 overflow-hidden"},_hoisted_3$F={class:"app-search"},_hoisted_4$E=vue.createElementVNode("i",{class:"mr-1 ri-search-line"},null,-1),_hoisted_5$x={class:"flex flex-1 overflow-hidden"},_hoisted_6$s=["onClick"],_hoisted_7$p={class:"flex justify-end mt-3"},_hoisted_8$m={class:"flex justify-end mb-2"},_hoisted_9$j=vue.createElementVNode("i",{class:"mr-1 ri-add-line"},null,-1),_sfc_main$18=vue.defineComponent({__name:"view",emits:["refresh"],setup(i,{expose:n,emit:r}){const{proxy:o}=vue.getCurrentInstance(),a=vue.inject("modelEle"),{setFormValue:l,getFormValue:s}=o.$globalHooks.useForm(),{openMessage:u}=o.$globalHooks.useMessage(),{createModelSyncRelation:c,listDataSourceSynchronized:d}=fetch$1(o).dbImport,f=vue.ref(null),p=vue.ref(null),v=vue.ref(null),m=vue.ref(null),g=r,{originlist:_,list:y,pageLoading:b,page:x,pageSize:C,getData:w,handleSizeChange:E,handleCurrentChange:$}=o.$globalHooks.usePage(),S=vue.reactive([{name:"源表名",type:FieldType.Text,fieldName:"sourceTableComment",value:""},{name:"同步状态",type:FieldType.Select,fieldName:"related",value:"",options:[{label:"已同步",value:!0},{label:"未同步",value:!1}]},{name:"同步结果",type:FieldType.Select,fieldName:"synchronizeResult",value:"",options:[{label:"正常",value:2},{label:"异常",value:1}]},{name:"源数据量",type:FieldType.Select,fieldName:"existSourceTableData",value:"",options:[{label:"源数据量 >0",value:!0},{label:"源数据量 =0",value:!1}]}]),V=vue.reactive([{label:"源表",prop:"sourceTableCode"},{label:"源表名",prop:"sourceTableComment"},{label:"源数据",prop:"sourceTableDataCount",slot:!0},{label:"列数",prop:"sourceColumnCount"},{label:"同步状态",prop:"related",slot:!0},{label:"同步结果",prop:"synchronizeResult",tag:!0,tagFunc:D=>D==2?"success":"danger",func:D=>{var F,M;return((F=D.modelSyncDetail)==null?void 0:F.synchronizeResult)=="2"?"正常":((M=D.modelSyncDetail)==null?void 0:M.synchronizeResult)=="1"?"异常":"-"}},{label:"目标表",prop:"relationTableCode"},{label:"目标数据",prop:"relationTableDataCount"},{label:"主键",prop:"primaryKeyColumn",func:D=>{var F;return((F=D==null?void 0:D.modelSyncDetail)==null?void 0:F.primaryKeyColumn)??"-"}},{label:"增量字段",prop:"incrColumn",func:D=>{var F;return((F=D==null?void 0:D.modelSyncDetail)==null?void 0:F.incrColumn)??"-"}},{label:"上次同步",prop:"lastSyncTime",func:D=>{var F;return((F=D==null?void 0:D.modelSyncDetail)==null?void 0:F.lastSyncTime)??"-"}},{label:"操作",prop:"htmlButton",fixed:"right",width:"120px"}]),k=async(D=!0)=>{D&&(l({},S),x.value=1),b.value=!0;const{params:F}=s(S,!1,!0),M=await d({dataSourceId:vue.unref(a).dataSourceId,...F});if(b.value=!1,!M){_.value=[];return}M.data.forEach(R=>{var z;(z=R==null?void 0:R.modelSyncDetail)!=null&&z.modelId&&(R.htmlButton=[{name:"配置",key:"setting",type:"primary"},{name:"历史",key:"history",type:"primary"}])}),_.value=M.data,w()},P=async D=>{await c({sourceId:D.dataSourceId,sourceTableCode:D.sourceTableCode})&&(u({type:"success",message:"操作成功"}),g("refresh"),k(!1))},T=vue.ref(!1),B=vue.ref(""),N=vue.reactive([{label:"抽取方案名称",prop:"extractName"},{label:"抽取类型",prop:"extractType",props:{url:"/api/ace-api/blade-system/dict-biz/dictionary?code=extractType",label:"dictValue",value:"dictKey"}},{label:"操作",prop:"htmlButton",fixed:"right",width:"200px"}]),O=D=>{D.data.forEach(F=>{F.htmlButton=[],F.htmlButton.push({name:"编辑",key:"EDIT",type:"primary",icon:"ri-edit-line"}),F.htmlButton.push({name:"抽取记录",key:"LOG",type:"primary",icon:"ri-file-line"}),[1,2].includes(F.extractType)&&F.htmlButton.push({name:"抽取",key:"PUSH",type:"primary",icon:"ri-pushpin-line"}),F.htmlButton.push({name:"删除",key:"DEL",type:"danger",icon:"ri-delete-bin-6-line"})})},I=vue.ref({}),L=async D=>{var z;const{type:F,row:M,index:R}=D;switch(F){case"history":vue.unref(v).init({ajaxUrl:`/api/ace-data-center/extract-log/modelSyncHistory?descs=create_time&modelId=${M.modelSyncDetail.modelId}`,table:[{label:"日期",prop:"createTime"},{label:"数据总数",prop:"totalNum"},{label:"成功数",prop:"successNum"},{label:"失败数",prop:"failNum"},{label:"协同参数",prop:"collaborateValue"},{label:"操作",prop:"action",slot:!0,fixed:"right"}]});break;case"LOG":vue.unref(v).init({businessId:M.id,businessType:"db_extract",table:[{label:"日期",prop:"createTime"},{label:"数据总数",prop:"totalNum"},{label:"成功数",prop:"successNum"},{label:"失败数",prop:"failNum"},{label:"协同参数",prop:"collaborateValue"},{label:"操作",prop:"action",slot:!0,fixed:"right"}]});break;case"PUSH":o.$baseConfirm({content:"是否抽取?",callConfirm:async()=>{await o.$baseHttp.post(`/api/ace-data-center/db-extract/extract/${M.id}`,{},{headers:{loading:!0}})&&u({type:"success",message:"操作成功"})}});break;case"DEL":o.$baseConfirm({content:"是否删除?",callConfirm:async()=>{await o.$baseHttp.post(`/api/ace-data-center/db-extract/removeById/${M.id}`,{},{headers:{loading:!0}})&&(u({type:"success",message:"操作成功"}),vue.unref(f).getData())}});break;case"EDIT":const U=await o.$baseHttp.get(`/api/ace-data-center/db-extract/detailAndTask?dbExtractId=${M.id}`);if(!U)return;vue.unref(p).init(U.data);break;case"ADD":vue.unref(p).init({dataSourceId:vue.unref(I).dataSourceId,modelId:(z=vue.unref(I))==null?void 0:z.modelSyncDetail.modelId});break;case"setting":T.value=!0,I.value=M,B.value=`/api/ace-data-center/db-extract/list?modelId=${M.modelSyncDetail.modelId}&projectId=${o.$baseGetCurrentProjectId()}`;break;case"source-table-data":vue.unref(m).init(M.dataSourceId,M.sourceTableCode);break}};return n({init:k}),(D,F)=>{const M=vue.resolveComponent("aceHeader"),R=vue.resolveComponent("AppForm"),z=vue.resolveComponent("AppTable"),U=vue.resolveComponent("AppList"),G=vue.resolveComponent("AppDrawer");return vue.openBlock(),vue.createElementBlock("div",_hoisted_1$W,[vue.createVNode(M,{title:vue.unref(a).dataSourceComment},null,8,["title"]),vue.createElementVNode("div",_hoisted_2$M,[vue.createElementVNode("div",_hoisted_3$F,[vue.createVNode(R,{form:vue.unref(S)},{default:vue.withCtx(()=>[vue.createVNode(vue.unref(elementPlus.ElButton),{type:"primary",class:"ml-1",onClick:F[0]||(F[0]=J=>k(!1))},{default:vue.withCtx(()=>[_hoisted_4$E,vue.createTextVNode(" 查询 ")]),_:1})]),_:1},8,["form"])]),vue.createElementVNode("div",_hoisted_5$x,[vue.createVNode(z,{tableData:vue.unref(V),list:vue.unref(y),loading:vue.unref(b),onTableBtnClick:L},{related:vue.withCtx(({row:J})=>[J.related?(vue.openBlock(),vue.createBlock(vue.unref(elementPlus.ElTag),{key:0,type:"primary"},{default:vue.withCtx(()=>[vue.createTextVNode("已同步")]),_:1})):(vue.openBlock(),vue.createBlock(vue.unref(elementPlus.ElPopconfirm),{key:1,title:"您确定要同步吗?",onConfirm:te=>P(J)},{reference:vue.withCtx(()=>[vue.createVNode(vue.unref(elementPlus.ElButton),{size:"small",type:"primary"},{default:vue.withCtx(()=>[vue.createTextVNode("立即同步")]),_:1})]),_:2},1032,["onConfirm"]))]),sourceTableDataCount:vue.withCtx(({row:J})=>[J.sourceTableDataCount==0?(vue.openBlock(),vue.createElementBlock(vue.Fragment,{key:0},[vue.createTextVNode(vue.toDisplayString(J.sourceTableDataCount),1)],64)):(vue.openBlock(),vue.createElementBlock("div",{key:1,class:"flex justify-between",onClick:te=>L({type:"source-table-data",row:J,index:-1})},[vue.createVNode(vue.unref(elementPlus.ElLink),{type:"primary"},{default:vue.withCtx(()=>[vue.createTextVNode(vue.toDisplayString(J.sourceTableDataCount),1)]),_:2},1024),vue.createVNode(vue.unref(elementPlus.ElLink),{type:"primary"},{default:vue.withCtx(()=>[vue.createTextVNode("查看")]),_:1})],8,_hoisted_6$s))]),_:1},8,["tableData","list","loading"])]),vue.createElementVNode("div",_hoisted_7$p,[vue.createVNode(vue.unref(elementPlus.ElPagination),{"current-page":vue.unref(x),"onUpdate:currentPage":F[1]||(F[1]=J=>vue.isRef(x)?x.value=J:null),"page-size":vue.unref(C),"onUpdate:pageSize":F[2]||(F[2]=J=>vue.isRef(C)?C.value=J:null),"page-sizes":[10,20,40,60,80,100],background:!0,layout:"total, sizes, prev, pager, next, jumper",total:vue.unref(_).length,onCurrentChange:vue.unref($),onSizeChange:vue.unref(E)},null,8,["current-page","page-size","total","onCurrentChange","onSizeChange"])])]),vue.createVNode(G,{modelValue:vue.unref(T),"onUpdate:modelValue":F[4]||(F[4]=J=>vue.isRef(T)?T.value=J:null),title:"数据同步方案",size:"1000px"},{default:vue.withCtx(()=>[vue.createElementVNode("div",_hoisted_8$m,[vue.createVNode(vue.unref(elementPlus.ElButton),{type:"primary",onClick:F[3]||(F[3]=J=>L({type:"ADD",row:{},index:0}))},{default:vue.withCtx(()=>[_hoisted_9$j,vue.createTextVNode(" 新增 ")]),_:1})]),vue.createVNode(U,{tableData:vue.unref(N),url:vue.unref(B),ref_key:"appListRef",ref:f,onBtnClick:L,onSuccess:O},null,8,["tableData","url"])]),_:1},8,["modelValue"]),vue.createVNode(_sfc_main$1a,{ref_key:"settingRef",ref:p,onRefresh:F[5]||(F[5]=J=>vue.unref(f).getData({clear:!0}))},null,512),vue.createVNode(_sfc_main$19,{ref_key:"extractLogRef",ref:v},null,512),vue.createVNode(_sfc_main$1b,{ref_key:"sourceTableDataRef",ref:m},null,512)])}}}),_hoisted_1$V={key:0,class:"flex items-center justify-center h-full"},_sfc_main$17=vue.defineComponent({__name:"index",setup(i){const n=vue.ref(null),r=vue.ref(null),o=vue.ref({});vue.provide("modelEle",o);const a=vue.inject("local"),l=s=>{o.value=s,vue.nextTick(()=>{vue.unref(n).init()})};return(s,u)=>{const c=vue.resolveComponent("AppEmpty");return vue.openBlock(),vue.createBlock(vue.unref(elementPlus.ElContainer),{class:"overflow-hidden app-basic-container"},{default:vue.withCtx(()=>[vue.createVNode(vue.unref(elementPlus.ElConfigProvider),{locale:vue.unref(a)},{default:vue.withCtx(()=>[vue.createVNode(vue.unref(elementPlus.ElAside),{class:"pr-5 mr-5"},{default:vue.withCtx(()=>[vue.createVNode(Menu$2,{ref_key:"menuRef",ref:r,onNodeClick:l},null,512)]),_:1}),vue.createVNode(vue.unref(elementPlus.ElMain),null,{default:vue.withCtx(()=>[vue.unref(o).dataSourceId?(vue.openBlock(),vue.createBlock(_sfc_main$18,{key:1,ref_key:"viewRef",ref:n,onRefresh:u[0]||(u[0]=d=>vue.unref(r).initMenu())},null,512)):(vue.openBlock(),vue.createElementBlock("div",_hoisted_1$V,[vue.createVNode(c,{description:"请选择数据源"})]))]),_:1})]),_:1},8,["locale"])]),_:1})}}}),_withScopeId$n=i=>(vue.pushScopeId("data-v-cabcba66"),i=i(),vue.popScopeId(),i),_hoisted_1$U={class:"flex flex-col h-full"},_hoisted_2$L=_withScopeId$n(()=>vue.createElementVNode("i",{class:"mr-1 ri-add-circle-line"},null,-1)),_hoisted_3$E={class:"flex-1 mt-3 overflow-y-auto card-container"},_hoisted_4$D={key:0,class:"flex items-center justify-center h-full"},_hoisted_5$w=["onClick"],_hoisted_6$r={class:"flex items-center justify-between"},_hoisted_7$o={class:"flex-1 mr-2.5"},_hoisted_8$l=_withScopeId$n(()=>vue.createElementVNode("i",{class:"mr-1 ri-database-line"},null,-1)),_hoisted_9$i={class:"font-bold"},_hoisted_10$h=_withScopeId$n(()=>vue.createElementVNode("i",{class:"mr-1 ri-edit-circle-line"},null,-1)),_hoisted_11$e={class:"flex items-center justify-between w-4/5 mt-3 ml-auto mr-auto"},_hoisted_12$c={class:"flex items-center"},_hoisted_13$a=_withScopeId$n(()=>vue.createElementVNode("i",{class:"mr-1 ri-checkbox-circle-fill text-color-success"},null,-1)),_hoisted_14$9=_withScopeId$n(()=>vue.createElementVNode("div",{class:"text-color-info"},"|",-1)),_hoisted_15$4={class:"flex justify-end mt-3 text-xs text-color-info pb"},_hoisted_16$4={class:"w-4/5 overflow-hidden whitespace-nowrap text-ellipsis"},_sfc_main$16=vue.defineComponent({__name:"menu",emits:["node-click"],setup(i,{expose:n,emit:r}){const{proxy:o}=vue.getCurrentInstance(),{dataSourceSubmit:a,testConnect:l,loadDataSourceMenu:s,detail:u}=fetch$1(o).dbImport,{setFormValue:c,getFormValue:d}=o.$globalHooks.useForm(),{openMessage:f}=o.$globalHooks.useMessage(),p=o.$globalDict,v=r,m=vue.ref([]),g=vue.ref(!0),_=()=>{m.value=[],g.value=!0,s().then(k=>{g.value=!1,m.value=k.data??[],k.data.length&&vue.unref(S)==""&&V(k.data[0])})};_();const y=vue.reactive([{name:"数据源名称",type:FieldType.Text,fieldName:"name",value:"",required:!0},{name:"数据源类型",type:FieldType.Select,fieldName:"dataSourceType",value:"",dict:"storeType",required:!0,changeFunc:k=>{if(!k.value)return;let P=p.dataSourceUrlDemo.find(T=>T.label.toLowerCase()===k.value.toLowerCase());y.find(T=>T.fieldName==="dataSourceUrlDemo").value=(P==null?void 0:P.value)??""}},{name:"数据源链接地址",type:FieldType.Textarea,fieldName:"dataSourceUrl",value:"",required:!0},{name:"链接示例",type:FieldType.Slot,fieldName:"dataSourceUrlDemo",value:""},{name:"数据库用户名",type:FieldType.Text,fieldName:"connectUserName",value:"",required:!0},{name:"数据库用密码",type:FieldType.Password,fieldName:"connectPassword",value:"",required:!0},{name:"id",type:FieldType.Text,fieldName:"id",value:"",hide:!0}]),b=vue.ref(!1),x=()=>{c({},y),b.value=!0},C=async k=>{const P=await u({id:k.dataSourceId});c(P.data,y),b.value=!0},w=k=>{y.find(P=>P.fieldName==="dataSourceUrl").value=k.value},E=async()=>{const{params:k,error:P}=d(y);P.length>0||(k.id||delete k.id,!await a(k))||(b.value=!1,f({type:"success",message:"操作成功"}),_())},$=async()=>{const{params:k,error:P}=d(y);P.length>0||!await l(k)||f({type:"success",message:"数据库链接成功"})},S=vue.ref(""),V=k=>{vue.unref(S)!=k.dataSourceId&&(S.value=k.dataSourceId,v("node-click",k))};return n({initMenu:_}),(k,P)=>{const T=vue.resolveComponent("aceHeader"),B=vue.resolveComponent("AppEmpty"),N=vue.resolveComponent("AppForm"),O=vue.resolveComponent("AppDialog");return vue.openBlock(),vue.createElementBlock("div",_hoisted_1$U,[vue.createVNode(T,{title:"数据源"},{default:vue.withCtx(()=>[vue.createVNode(vue.unref(elementPlus.ElButton),{type:"primary",size:"small",onClick:x},{default:vue.withCtx(()=>[_hoisted_2$L,vue.createTextVNode(" 新增 ")]),_:1})]),_:1}),vue.createElementVNode("div",_hoisted_3$E,[vue.createVNode(vue.unref(elementPlus.ElSkeleton),{loading:vue.unref(g),animated:""},{default:vue.withCtx(()=>[vue.unref(m).length?(vue.openBlock(!0),vue.createElementBlock(vue.Fragment,{key:1},vue.renderList(vue.unref(m),I=>(vue.openBlock(),vue.createElementBlock("div",{key:I.id,class:vue.normalizeClass(["item",{active:vue.unref(S)==I.dataSourceId}]),onClick:L=>V(I)},[vue.createElementVNode("div",_hoisted_6$r,[vue.createElementVNode("div",_hoisted_7$o,[_hoisted_8$l,vue.createElementVNode("span",_hoisted_9$i,vue.toDisplayString(I.dataSourceComment),1)]),vue.createVNode(vue.unref(elementPlus.ElLink),{type:"primary",onClick:vue.withModifiers(L=>C(I),["stop"])},{default:vue.withCtx(()=>[_hoisted_10$h,vue.createTextVNode(" 修改 ")]),_:2},1032,["onClick"])]),vue.createElementVNode("div",_hoisted_11$e,[vue.createElementVNode("div",_hoisted_12$c,[_hoisted_13$a,vue.createTextVNode(" 已同步 "),vue.createElementVNode("strong",null,vue.toDisplayString(I.synchronizedShadowTableCount),1)]),_hoisted_14$9,vue.createElementVNode("div",null,[vue.createTextVNode(" 总表数 "),vue.createElementVNode("strong",null,vue.toDisplayString(I.tableCount),1)])]),vue.createElementVNode("div",_hoisted_15$4,vue.toDisplayString(I.version),1)],10,_hoisted_5$w))),128)):(vue.openBlock(),vue.createElementBlock("div",_hoisted_4$D,[vue.createVNode(B,{description:"暂无数据源"})]))]),_:1},8,["loading"])]),vue.createVNode(O,{modelValue:vue.unref(b),"onUpdate:modelValue":P[1]||(P[1]=I=>vue.isRef(b)?b.value=I:null),title:"新增接入数据源",size:700},{footer:vue.withCtx(()=>[vue.createVNode(vue.unref(elementPlus.ElButton),{style:{"margin-right":"auto"},type:"success",onClick:$},{default:vue.withCtx(()=>[vue.createTextVNode(" 测试链接 ")]),_:1}),vue.createVNode(vue.unref(elementPlus.ElButton),{class:"ml-3",type:"primary",onClick:E},{default:vue.withCtx(()=>[vue.createTextVNode("保存")]),_:1}),vue.createVNode(vue.unref(elementPlus.ElButton),{class:"ml-3",onClick:P[0]||(P[0]=I=>b.value=!1)},{default:vue.withCtx(()=>[vue.createTextVNode("取消")]),_:1})]),default:vue.withCtx(()=>[vue.createVNode(N,{form:vue.unref(y),col:1,labelWidth:120},{dataSourceUrlDemo:vue.withCtx(({element:I})=>[vue.createVNode(vue.unref(elementPlus.ElTooltip),{content:I.value},{default:vue.withCtx(()=>[vue.createElementVNode("div",_hoisted_16$4,vue.toDisplayString(I.value),1)]),_:2},1032,["content"]),vue.createVNode(vue.unref(elementPlus.ElButton),{type:"primary",onClick:L=>w(I)},{default:vue.withCtx(()=>[vue.createTextVNode("复制")]),_:2},1032,["onClick"])]),_:1},8,["form"])]),_:1},8,["modelValue"])])}}}),menu_vue_vue_type_style_index_0_scoped_cabcba66_lang="",Menu$1=_export_sfc$2(_sfc_main$16,[["__scopeId","data-v-cabcba66"]]),_sfc_main$15=vue.defineComponent({__name:"sourceTableData",setup(i,{expose:n}){const r=vue.ref(!1),o=vue.ref(null),a=vue.ref(""),l=vue.ref([]),s=f=>{l.value=[],(f==null?void 0:f.data.length)>0&&(l.value=Object.keys(f.data[0]).filter(p=>p!="pageIndex").map(p=>({label:p,prop:p})))},u=vue.ref({}),c=f=>Object.assign(f,vue.unref(u));return n({init:(f,p)=>{vue.unref(u).dataSourceId=f,vue.unref(u).sourceTableCode=p,r.value=!0,a.value="/api/ace-data-center/data-source/sourceDataPage"}}),(f,p)=>{const v=vue.resolveComponent("AppList"),m=vue.resolveComponent("AppDrawer");return vue.openBlock(),vue.createBlock(m,{modelValue:vue.unref(r),"onUpdate:modelValue":p[0]||(p[0]=g=>vue.isRef(r)?r.value=g:null),title:"数据源明细",size:"90%"},{default:vue.withCtx(()=>[vue.createVNode(v,{tableData:vue.unref(l),url:vue.unref(a),ref_key:"appList",ref:o,formatParamsFunc:c,onSuccess:s,methods:"post"},null,8,["tableData","url"])]),_:1},8,["modelValue"])}}}),_withScopeId$m=i=>(vue.pushScopeId("data-v-e0af972d"),i=i(),vue.popScopeId(),i),_hoisted_1$T={class:"mt-3"},_hoisted_2$K=_withScopeId$m(()=>vue.createElementVNode("thead",null,[vue.createElementVNode("tr",null,[vue.createElementVNode("td",null,"字段名称"),vue.createElementVNode("td",null,"字段描述"),vue.createElementVNode("td",null,"映射字段"),vue.createElementVNode("td",null,"数据类型"),vue.createElementVNode("td",null,"数据长度"),vue.createElementVNode("td",null,"数据标度"),vue.createElementVNode("td",null,"是否主键"),vue.createElementVNode("td",null,"唯一校验")])],-1)),_hoisted_3$D={class:"sort-target"},_hoisted_4$C={key:0},_sfc_main$14=vue.defineComponent({__name:"model-normal",emits:["success"],setup(i,{expose:n,emit:r}){const{proxy:o}=vue.getCurrentInstance(),{setFormValue:a,getFormValue:l}=o.$globalHooks.useForm(),s=r,u=vue.ref(!1),c=vue.ref(""),d=vue.ref([]);vue.ref("");const f=vue.ref([]),p=vue.reactive([{name:"项目名称",type:FieldType.Select,fieldName:"projectId",value:"",required:!0,props:{url:"/api/ace-data-center/project/options",label:"label",value:"code"},disabled:!0,hide:!0},{name:"数据源类型",type:FieldType.Select,fieldName:"modelStore",value:"",required:!0,dict:"storeType",disabled:!0},{name:"模型层级",type:FieldType.Select,fieldName:"modelLayer",value:"",required:!0,props:{url:"/api/ace-api/blade-system/dict-biz/dictionary?code=modelLayer",label:"dictValue",value:"dictKey"},changeFunc:g=>{},disabled:!0},{name:"模型名称",type:FieldType.Text,fieldName:"modelName",value:"",required:!0},{name:"模型表名",type:FieldType.Text,fieldName:"modelCode",value:"",required:!0,disabled:!0},{name:"模型类型",type:FieldType.Select,fieldName:"modelType",value:"",props:{url:"/api/ace-api/blade-system/dict-biz/dictionary?code=modelType",label:"dictValue",value:"dictKey"},hide:!0},{name:"标签",type:FieldType.Text,fieldName:"tags",value:""},{name:"分区字段",type:FieldType.Text,fieldName:"partitionColumn",value:"",hide:!0},{name:"模型描述",type:FieldType.Textarea,fieldName:"modelDesc",value:""},{name:"id",type:FieldType.Text,fieldName:"id",value:"",hide:!0}]),v=g=>{u.value=!0,c.value="",d.value=[],f.value=(g?(g==null?void 0:g.listModelAttribute)??[]:[{nanoid:nanoid()}]).map(_=>{const y=((_==null?void 0:_.attributeCode)??"").split("");return _.nanoid=nanoid(),y[0]=="_"&&(_.hide=!0),_}),a({...g??{},projectId:o.$baseGetCurrentProjectId()},p)},m=async()=>{const{params:g,error:_}=l(p);if(_.length>0)return;const y="/api/ace-data-center/model/editModelDetail";await o.$baseHttp.post(y,{...g,projectId:String(o.$baseGetCurrentProjectId()),listModelAttribute:vue.unref(f)},{headers:{loading:!0}})&&(u.value=!1,o.$message.success("操作成功"),s("success"))};return n({init:v}),(g,_)=>{const y=vue.resolveComponent("AppForm"),b=vue.resolveComponent("aceHeader"),x=vue.resolveComponent("AppDrawer");return vue.openBlock(),vue.createBlock(x,{modelValue:vue.unref(u),"onUpdate:modelValue":_[1]||(_[1]=C=>vue.isRef(u)?u.value=C:null),title:"影子模型",size:"100%"},{footer:vue.withCtx(()=>[vue.createVNode(vue.unref(elementPlus.ElButton),{class:"ml-3",type:"primary",onClick:m},{default:vue.withCtx(()=>[vue.createTextVNode("提交")]),_:1}),vue.renderSlot(g.$slots,"formFooter",{},void 0,!0),vue.createVNode(vue.unref(elementPlus.ElButton),{class:"ml-3",onClick:_[0]||(_[0]=C=>u.value=!1)},{default:vue.withCtx(()=>[vue.createTextVNode("取消")]),_:1})]),default:vue.withCtx(()=>[vue.createVNode(vue.unref(elementPlus.ElContainer),{class:"h-full overflow-hidden"},{default:vue.withCtx(()=>[vue.createVNode(vue.unref(elementPlus.ElAside),{class:"pr-5 mr-5"},{default:vue.withCtx(()=>[vue.createVNode(y,{form:vue.unref(p)},null,8,["form"])]),_:1}),vue.createVNode(vue.unref(elementPlus.ElMain),null,{default:vue.withCtx(()=>[vue.createVNode(b,{title:"影子模型属性"}),vue.createElementVNode("table",_hoisted_1$T,[_hoisted_2$K,vue.createElementVNode("tbody",_hoisted_3$D,[(vue.openBlock(!0),vue.createElementBlock(vue.Fragment,null,vue.renderList(vue.unref(f),(C,w)=>(vue.openBlock(),vue.createElementBlock(vue.Fragment,{key:C.nanoid},[C.hide?vue.createCommentVNode("",!0):(vue.openBlock(),vue.createElementBlock("tr",_hoisted_4$C,[vue.createElementVNode("td",null,vue.toDisplayString(C.attributeCode),1),vue.createElementVNode("td",null,[vue.createVNode(vue.unref(elementPlus.ElInput),{modelValue:C.attributeComment,"onUpdate:modelValue":E=>C.attributeComment=E,maxlength:"30",showWordLimit:"",placeholder:"字段描述"},null,8,["modelValue","onUpdate:modelValue"])]),vue.createElementVNode("td",null,vue.toDisplayString(C.mapCode),1),vue.createElementVNode("td",null,[vue.createVNode(vue.unref(elementPlus.ElSelect),{modelValue:C.dataType,"onUpdate:modelValue":E=>C.dataType=E,placeholder:"数据类型","popper-class":"ace-select",style:{width:"100%"},disabled:""},{default:vue.withCtx(()=>[(vue.openBlock(!0),vue.createElementBlock(vue.Fragment,null,vue.renderList(vue.unref(commonDataType),E=>(vue.openBlock(),vue.createBlock(vue.unref(elementPlus.ElOption),{key:E.value,label:E.label,value:E.value},null,8,["label","value"]))),128))]),_:2},1032,["modelValue","onUpdate:modelValue"])]),vue.createElementVNode("td",null,vue.toDisplayString(C.dataLength),1),vue.createElementVNode("td",null,vue.toDisplayString(C.dataScale??"-"),1),vue.createElementVNode("td",null,[vue.createVNode(vue.unref(elementPlus.ElSwitch),{modelValue:C.primaryKey,"onUpdate:modelValue":E=>C.primaryKey=E,"inline-prompt":"","active-text":"是","inactive-text":"否","active-value":"2","inactive-value":"1",disabled:""},null,8,["modelValue","onUpdate:modelValue"])]),vue.createElementVNode("td",null,[vue.createVNode(vue.unref(elementPlus.ElSwitch),{modelValue:C.uniqueKey,"onUpdate:modelValue":E=>C.uniqueKey=E,"inline-prompt":"","active-text":"是","inactive-text":"否","active-value":"2","inactive-value":"1",disabled:""},null,8,["modelValue","onUpdate:modelValue"])])]))],64))),128))])])]),_:1})]),_:1})]),_:3},8,["modelValue"])}}}),modelNormal_vue_vue_type_style_index_0_scoped_e0af972d_lang="",ModelNormal=_export_sfc$2(_sfc_main$14,[["__scopeId","data-v-e0af972d"]]),_hoisted_1$S={class:"flex flex-col h-full overflow-hidden"},_hoisted_2$J={class:"flex flex-col flex-1 mt-3 overflow-hidden"},_hoisted_3$C={class:"app-search"},_hoisted_4$B=vue.createElementVNode("i",{class:"mr-1 ri-search-line"},null,-1),_hoisted_5$v={class:"flex flex-1 overflow-hidden"},_hoisted_6$q=["onClick"],_hoisted_7$n={class:"flex justify-end mt-3"},_sfc_main$13=vue.defineComponent({__name:"view",emits:["refresh"],setup(i,{expose:n,emit:r}){const{proxy:o}=vue.getCurrentInstance(),a=vue.inject("modelEle"),{setFormValue:l,getFormValue:s}=o.$globalHooks.useForm(),{openMessage:u}=o.$globalHooks.useMessage(),{createShadowModelSync:c,listDataSourceSynchronized:d}=fetch$1(o).dbImport,f=vue.ref(null),p=vue.ref(null),v=r,{originlist:m,list:g,pageLoading:_,page:y,pageSize:b,getData:x,handleSizeChange:C,handleCurrentChange:w}=o.$globalHooks.usePage(),E=vue.reactive([{name:"源表",type:FieldType.Text,fieldName:"sourceTableCode",value:""},{name:"源表名",type:FieldType.Text,fieldName:"sourceTableComment",value:""}]),$=vue.reactive([{label:"源表",prop:"sourceTableCode"},{label:"源表名",prop:"sourceTableComment"},{label:"源数据",prop:"sourceTableDataCount",slot:!0},{label:"列数",prop:"sourceColumnCount"},{label:"影子模型",prop:"shadowModelId",slot:!0},{label:"操作",prop:"htmlButton",fixed:"right",width:"120px"}]),S=async(k=!0)=>{k&&(l({},E),y.value=1),_.value=!0;const{params:P}=s(E,!1,!0),T=await d({dataSourceId:vue.unref(a).dataSourceId,...P});if(_.value=!1,!T){m.value=[];return}T.data.forEach(B=>{B.shadowModelId?B.htmlButton=[{name:"编辑",key:"EDIT",type:"primary"}]:B.htmlButton=[{name:"创建影子模型",key:"CREATE",type:"primary"}]}),m.value=T.data,x()},V=async k=>{const{type:P,row:T,index:B}=k;switch(P){case"EDIT":{const N=await o.$baseHttp.get(`/api/ace-data-center/model/detail?id=${T==null?void 0:T.shadowModelId}`);if(!N)return;o.$refs.normalRef.init(N.data)}break;case"CREATE":o.$baseConfirm({content:"是否创建影子模型?",callConfirm:async()=>{await c({sourceId:T.dataSourceId,sourceTableCode:T.sourceTableCode})&&(u({type:"success",message:"操作成功"}),v("refresh"),S(!1))}});break;case"source-table-data":vue.unref(p).init(T.dataSourceId,T.sourceTableCode);break}};return n({init:S}),(k,P)=>{const T=vue.resolveComponent("aceHeader"),B=vue.resolveComponent("AppForm"),N=vue.resolveComponent("AppTable");return vue.openBlock(),vue.createElementBlock("div",_hoisted_1$S,[vue.createVNode(T,{title:vue.unref(a).dataSourceComment},null,8,["title"]),vue.createElementVNode("div",_hoisted_2$J,[vue.createElementVNode("div",_hoisted_3$C,[vue.createVNode(B,{form:vue.unref(E)},{default:vue.withCtx(()=>[vue.createVNode(vue.unref(elementPlus.ElButton),{type:"primary",class:"ml-1",onClick:P[0]||(P[0]=O=>S(!1))},{default:vue.withCtx(()=>[_hoisted_4$B,vue.createTextVNode(" 查询 ")]),_:1})]),_:1},8,["form"])]),vue.createElementVNode("div",_hoisted_5$v,[vue.createVNode(N,{tableData:vue.unref($),list:vue.unref(g),loading:vue.unref(_),onTableBtnClick:V},{shadowModelId:vue.withCtx(({row:O})=>[O.shadowModelId?(vue.openBlock(),vue.createBlock(vue.unref(elementPlus.ElTag),{key:0,type:"primary"},{default:vue.withCtx(()=>[vue.createTextVNode("已创建")]),_:1})):(vue.openBlock(),vue.createBlock(vue.unref(elementPlus.ElTag),{key:1,type:"warning"},{default:vue.withCtx(()=>[vue.createTextVNode("未创建")]),_:1}))]),sourceTableDataCount:vue.withCtx(({row:O})=>[O.sourceTableDataCount==0?(vue.openBlock(),vue.createElementBlock(vue.Fragment,{key:0},[vue.createTextVNode(vue.toDisplayString(O.sourceTableDataCount),1)],64)):(vue.openBlock(),vue.createElementBlock("div",{key:1,class:"flex justify-between",onClick:I=>V({type:"source-table-data",row:O,index:-1})},[vue.createVNode(vue.unref(elementPlus.ElLink),{type:"primary"},{default:vue.withCtx(()=>[vue.createTextVNode(vue.toDisplayString(O.sourceTableDataCount),1)]),_:2},1024),vue.createVNode(vue.unref(elementPlus.ElLink),{type:"primary"},{default:vue.withCtx(()=>[vue.createTextVNode("查看")]),_:1})],8,_hoisted_6$q))]),_:1},8,["tableData","list","loading"])]),vue.createElementVNode("div",_hoisted_7$n,[vue.createVNode(vue.unref(elementPlus.ElPagination),{"current-page":vue.unref(y),"onUpdate:currentPage":P[1]||(P[1]=O=>vue.isRef(y)?y.value=O:null),"page-size":vue.unref(b),"onUpdate:pageSize":P[2]||(P[2]=O=>vue.isRef(b)?b.value=O:null),"page-sizes":[10,20,40,60,80,100],background:!0,layout:"total, sizes, prev, pager, next, jumper",total:vue.unref(m).length,onCurrentChange:vue.unref(w),onSizeChange:vue.unref(C)},null,8,["current-page","page-size","total","onCurrentChange","onSizeChange"])])]),vue.createVNode(ModelNormal,{ref_key:"normalRef",ref:f},null,512),vue.createVNode(_sfc_main$15,{ref_key:"sourceTableDataRef",ref:p},null,512)])}}}),_hoisted_1$R={key:0,class:"flex items-center justify-center h-full"},_sfc_main$12=vue.defineComponent({__name:"index",setup(i){const n=vue.ref(null),r=vue.ref(null),o=vue.ref({});vue.provide("modelEle",o);const a=vue.inject("local"),l=s=>{o.value=s,vue.nextTick(()=>{vue.unref(n).init()})};return(s,u)=>{const c=vue.resolveComponent("AppEmpty");return vue.openBlock(),vue.createBlock(vue.unref(elementPlus.ElContainer),{class:"overflow-hidden app-basic-container"},{default:vue.withCtx(()=>[vue.createVNode(vue.unref(elementPlus.ElConfigProvider),{locale:vue.unref(a)},{default:vue.withCtx(()=>[vue.createVNode(vue.unref(elementPlus.ElAside),{class:"pr-5 mr-5"},{default:vue.withCtx(()=>[vue.createVNode(Menu$1,{ref_key:"menuRef",ref:r,onNodeClick:l},null,512)]),_:1}),vue.createVNode(vue.unref(elementPlus.ElMain),null,{default:vue.withCtx(()=>[vue.unref(o).dataSourceId?(vue.openBlock(),vue.createBlock(_sfc_main$13,{key:1,ref_key:"viewRef",ref:n,onRefresh:u[0]||(u[0]=d=>vue.unref(r).initMenu())},null,512)):(vue.openBlock(),vue.createElementBlock("div",_hoisted_1$R,[vue.createVNode(c,{description:"请选择数据源"})]))]),_:1})]),_:1},8,["locale"])]),_:1})}}}),_hoisted_1$Q=vue.createElementVNode("i",{class:"ri-search-line"},null,-1),_hoisted_2$I={class:"mt-3"},_hoisted_3$B={class:"mt-3"},_hoisted_4$A={key:1,class:"mr-1 -ml-5 text-base ri-edit-circle-fill text-color-primary"},_sfc_main$11=vue.defineComponent({__name:"menu",emits:["node-click"],setup(i,{expose:n,emit:r}){const o=vue.ref(""),a=vue.ref(null),l=vue.ref([{label:"源视图表",value:"ODSVIEW"},{label:"整合数据表",value:"DWD"}]),s=vue.ref(vue.unref(l)[0].value),{proxy:u}=vue.getCurrentInstance(),c=r;vue.watch(o,_=>{vue.unref(a).filter(_)});const d=(_,y)=>_?y.name.includes(_):!0,f=vue.ref([]),p=vue.ref([]),v=vue.ref(!0),m=()=>{v.value=!0,Promise.all([fetch$1(u).loadModelMenu({modelLayer:"ODSVIEW"}),fetch$1(u).loadModelMenu({modelLayer:"DWD"})]).then(_=>{f.value=Object.keys(_[0].data).map(y=>({modelName:y,id:y,children:_[0].data[y]})),p.value=Object.keys(_[1].data).map(y=>({modelName:y,id:y,children:_[1].data[y]})),v.value=!1})};m();const g=_=>{Array.isArray(_.children)||c("node-click",_)};return n({init:m}),(_,y)=>{const b=vue.resolveComponent("aceHeader");return vue.openBlock(),vue.createElementBlock(vue.Fragment,null,[vue.createVNode(b,{title:"整合数据",class:"mb-2"},{default:vue.withCtx(()=>[vue.renderSlot(_.$slots,"top")]),_:3}),vue.createVNode(vue.unref(elementPlus.ElInput),{placeholder:"请输入内容",clearable:"",modelValue:vue.unref(o),"onUpdate:modelValue":y[0]||(y[0]=x=>vue.isRef(o)?o.value=x:null)},{prefix:vue.withCtx(()=>[_hoisted_1$Q]),_:1},8,["modelValue"]),vue.createElementVNode("div",_hoisted_2$I,[vue.createVNode(vue.unref(elementPlus.ElButtonGroup),null,{default:vue.withCtx(()=>[(vue.openBlock(!0),vue.createElementBlock(vue.Fragment,null,vue.renderList(vue.unref(l),x=>(vue.openBlock(),vue.createBlock(vue.unref(elementPlus.ElButton),{type:vue.unref(s)==x.value?"primary":"",key:x.value,onClick:C=>s.value=x.value},{default:vue.withCtx(()=>[vue.createTextVNode(vue.toDisplayString(x.label),1)]),_:2},1032,["type","onClick"]))),128))]),_:1})]),vue.createElementVNode("div",_hoisted_3$B,[vue.createVNode(vue.unref(elementPlus.ElSkeleton),{animated:"",loading:vue.unref(v),count:2},{default:vue.withCtx(()=>[vue.createVNode(vue.unref(elementPlus.ElTree),{class:"animated fadeIn",ref_key:"treeRef",ref:a,data:vue.unref(s)=="DWD"?vue.unref(p):vue.unref(f),"node-key":"id","empty-text":"暂无数据","default-expand-all":"","highlight-current":"","filter-node-method":d,onNodeClick:g},{default:vue.withCtx(({node:x,data:C})=>[x.level!=1?(vue.openBlock(),vue.createElementBlock(vue.Fragment,{key:0},[C.modelCode&&C.openForm!=2?(vue.openBlock(),vue.createElementBlock("i",{key:0,class:vue.normalizeClass(["mr-1 -ml-5 text-base ri-checkbox-circle-fill",[C.publishStatus==2?"text-color-success":"text-color-info"]])},null,2)):vue.createCommentVNode("",!0)],64)):vue.createCommentVNode("",!0),C.openForm==2?(vue.openBlock(),vue.createElementBlock("i",_hoisted_4$A)):vue.createCommentVNode("",!0),vue.createElementVNode("span",{class:vue.normalizeClass({"font-bold":x.level==1})},vue.toDisplayString(C.modelName),3)]),_:1},8,["data"])]),_:1},8,["loading"])])],64)}}}),_withScopeId$l=i=>(vue.pushScopeId("data-v-8dbf5661"),i=i(),vue.popScopeId(),i),_hoisted_1$P={class:"mt-3"},_hoisted_2$H=_withScopeId$l(()=>vue.createElementVNode("td",null,"字段名称",-1)),_hoisted_3$A=_withScopeId$l(()=>vue.createElementVNode("td",null,"字段描述",-1)),_hoisted_4$z=_withScopeId$l(()=>vue.createElementVNode("td",null,"映射字段",-1)),_hoisted_5$u=_withScopeId$l(()=>vue.createElementVNode("td",{width:"120px"},"数据类型",-1)),_hoisted_6$p=_withScopeId$l(()=>vue.createElementVNode("td",null,"数据长度",-1)),_hoisted_7$m=_withScopeId$l(()=>vue.createElementVNode("td",null,"数据标度",-1)),_hoisted_8$k=_withScopeId$l(()=>vue.createElementVNode("td",null,"是否主键",-1)),_hoisted_9$h=_withScopeId$l(()=>vue.createElementVNode("td",null,"唯一校验",-1)),_hoisted_10$g=_withScopeId$l(()=>vue.createElementVNode("td",{style:{width:"50px"}},null,-1)),_hoisted_11$d={class:"sort-target"},_hoisted_12$b={key:0},_hoisted_13$9=["onClick"],_hoisted_14$8=_withScopeId$l(()=>vue.createElementVNode("td",null,[vue.createElementVNode("i",{class:"text-lg cursor-move ri-mouse-line handle text-color-warning"})],-1)),_sfc_main$10=vue.defineComponent({__name:"attribute",props:vue.mergeModels({isRequired:{default:1}},{modelValue:{},modelModifiers:{}}),emits:["update:modelValue"],setup(i,{expose:n}){const r=vue.useModel(i,"modelValue");vue.getCurrentInstance();const o=vue.ref(null),a=vue.ref({attributeCode:[{required:!0,message:"请输入字段名称"},{pattern:/^[A-Za-z]\w*$/,message:"只能以字母开头,由字母/数字/下划线组成",trigger:"blur"}],attributeComment:[{required:!0,message:"请输入字段描述"}],mapCode:[{required:!0,message:"请输入映射字段"}],dataType:[{required:!0,message:"请选择数据类型"}],dataLength:[{required:!0,message:"请输入数据长度"}],dataScale:[{required:!0,message:"请输入数据标度"}],primaryKey:[{required:!0,message:"请选择是否为主键"}]}),l=p=>{const v=p.dataType;v!=="decimal"&&(p.dataScale=0),["autoIncrement","date","time","datetime","int","bigint","double","text"].includes(v)&&(p.dataLength=0),v==="decimal"&&(p.dataLength=10,p.dataScale=6),v==="varchar"&&(p.dataLength=255)},s=(p,v)=>{p.primaryKey==2&&vue.unref(r).forEach((g,_)=>{_!=v&&(g.primaryKey=1)})},u=()=>{vue.unref(r).push({nanoid:nanoid()})},c=p=>{vue.unref(r).splice(p,1)};return n({validate:async()=>await vue.unref(o).validate(p=>p),isRepeat:()=>{const p=new Map;let v="";for(let m=0;m<vue.unref(r).length;m++){let g=vue.unref(r)[m],_=p.get(g.attributeCode);_!=null&&(v+="字段名称 <strong>"+g.attributeCode+"</strong> 重复(<i>第"+(_+1)+"行和第"+(m+1)+"行</i>);<br>"),p.set(vue.unref(r)[m].attributeCode,m)}return v}}),(p,v)=>(vue.openBlock(),vue.createBlock(vue.unref(elementPlus.ElForm),{"label-width":"0",model:{modelValue:r.value},size:"small",ref_key:"elFormRef",ref:o,rules:vue.unref(a)},{default:vue.withCtx(()=>[vue.createVNode(vue.unref(vueDraggablePlus.VueDraggable),{modelValue:r.value,"onUpdate:modelValue":v[0]||(v[0]=m=>r.value=m),target:".sort-target",animation:150,handle:".handle"},{default:vue.withCtx(()=>[vue.createElementVNode("table",_hoisted_1$P,[vue.createElementVNode("tr",null,[vue.createElementVNode("td",{style:{width:"50px"}},[vue.createElementVNode("i",{class:"text-lg cursor-pointer ri-add-circle-line text-color-primary",onClick:u})]),_hoisted_2$H,_hoisted_3$A,_hoisted_4$z,_hoisted_5$u,_hoisted_6$p,_hoisted_7$m,_hoisted_8$k,_hoisted_9$h,_hoisted_10$g]),vue.createElementVNode("tbody",_hoisted_11$d,[(vue.openBlock(!0),vue.createElementBlock(vue.Fragment,null,vue.renderList(r.value,(m,g)=>(vue.openBlock(),vue.createElementBlock(vue.Fragment,{key:m.nanoid},[m.hide?vue.createCommentVNode("",!0):(vue.openBlock(),vue.createElementBlock("tr",_hoisted_12$b,[vue.createElementVNode("td",null,[vue.createElementVNode("i",{class:"text-lg cursor-pointer ri-indeterminate-circle-line text-color-danger",onClick:_=>c(g)},null,8,_hoisted_13$9)]),vue.createElementVNode("td",null,[vue.createVNode(vue.unref(elementPlus.ElFormItem),{prop:"modelValue."+g+".attributeCode",rules:vue.unref(a).attributeCode},{default:vue.withCtx(()=>[vue.createVNode(vue.unref(elementPlus.ElInput),{modelValue:m.attributeCode,"onUpdate:modelValue":_=>m.attributeCode=_,maxlength:"30",showWordLimit:"",placeholder:"字段名称"},null,8,["modelValue","onUpdate:modelValue"])]),_:2},1032,["prop","rules"])]),vue.createElementVNode("td",null,[vue.createVNode(vue.unref(elementPlus.ElFormItem),{prop:"modelValue."+g+".attributeComment",rules:vue.unref(a).attributeComment},{default:vue.withCtx(()=>[vue.createVNode(vue.unref(elementPlus.ElInput),{modelValue:m.attributeComment,"onUpdate:modelValue":_=>m.attributeComment=_,maxlength:"30",showWordLimit:"",placeholder:"字段描述"},null,8,["modelValue","onUpdate:modelValue"])]),_:2},1032,["prop","rules"])]),vue.createElementVNode("td",null,[vue.createVNode(vue.unref(elementPlus.ElFormItem),{prop:"modelValue."+g+".mapCode",rules:vue.unref(a).mapCode},{default:vue.withCtx(()=>[vue.createVNode(vue.unref(elementPlus.ElInput),{modelValue:m.mapCode,"onUpdate:modelValue":_=>m.mapCode=_,maxlength:"30",showWordLimit:"",placeholder:"映射字段"},null,8,["modelValue","onUpdate:modelValue"])]),_:2},1032,["prop","rules"])]),vue.createElementVNode("td",null,[vue.createVNode(vue.unref(elementPlus.ElFormItem),{prop:"modelValue."+g+".dataType",rules:vue.unref(a).dataType},{default:vue.withCtx(()=>[vue.createVNode(vue.unref(elementPlus.ElSelect),{modelValue:m.dataType,"onUpdate:modelValue":_=>m.dataType=_,placeholder:"数据类型",class:"w-full",teleported:!1,onChange:()=>l(m)},{default:vue.withCtx(()=>[(vue.openBlock(!0),vue.createElementBlock(vue.Fragment,null,vue.renderList(vue.unref(commonDataType),_=>(vue.openBlock(),vue.createBlock(vue.unref(elementPlus.ElOption),{key:_.value,label:_.label,value:_.value},null,8,["label","value"]))),128))]),_:2},1032,["modelValue","onUpdate:modelValue","onChange"])]),_:2},1032,["prop","rules"])]),vue.createElementVNode("td",null,[vue.createVNode(vue.unref(elementPlus.ElFormItem),{prop:"modelValue."+g+".dataLength",rules:vue.unref(a).dataLength},{default:vue.withCtx(()=>[vue.createVNode(vue.unref(elementPlus.ElInputNumber),{min:0,max:2048,"value-on-clear":0,"controls-position":"right",modelValue:m.dataLength,"onUpdate:modelValue":_=>m.dataLength=_,disabled:["autoIncrement","date","time","datetime","int","bigint","double","text"].includes(m.dataType),placeholder:"长度",style:{width:"100%"}},null,8,["modelValue","onUpdate:modelValue","disabled"])]),_:2},1032,["prop","rules"])]),vue.createElementVNode("td",null,[vue.createVNode(vue.unref(elementPlus.ElFormItem),{prop:"modelValue."+g+".dataScale",rules:vue.unref(a).dataScale},{default:vue.withCtx(()=>[vue.createVNode(vue.unref(elementPlus.ElInputNumber),{modelValue:m.dataScale,"onUpdate:modelValue":_=>m.dataScale=_,min:0,max:2048,"value-on-clear":0,"controls-position":"right",disabled:!["decimal"].includes(m.dataType),placeholder:"标度",style:{width:"100%"}},null,8,["modelValue","onUpdate:modelValue","disabled"])]),_:2},1032,["prop","rules"])]),vue.createElementVNode("td",null,[vue.createVNode(vue.unref(elementPlus.ElSwitch),{modelValue:m.primaryKey,"onUpdate:modelValue":_=>m.primaryKey=_,"inline-prompt":"","active-text":"是","inactive-text":"否","active-value":"2","inactive-value":"1",onChange:()=>s(m,g)},null,8,["modelValue","onUpdate:modelValue","onChange"])]),vue.createElementVNode("td",null,[vue.createVNode(vue.unref(elementPlus.ElSwitch),{modelValue:m.uniqueKey,"onUpdate:modelValue":_=>m.uniqueKey=_,"inline-prompt":"","active-text":"是","inactive-text":"否","active-value":"2","inactive-value":"1"},null,8,["modelValue","onUpdate:modelValue"])]),_hoisted_14$8]))],64))),128))])])]),_:1},8,["modelValue"])]),_:1},8,["model","rules"]))}}),attribute_vue_vue_type_style_index_0_scoped_8dbf5661_lang="",Attribute=_export_sfc$2(_sfc_main$10,[["__scopeId","data-v-8dbf5661"]]),_withScopeId$k=i=>(vue.pushScopeId("data-v-a3938966"),i=i(),vue.popScopeId(),i),_hoisted_1$O={class:"flex flex-col h-full"},_hoisted_2$G={class:"flex flex-1 overflow-hidden"},_hoisted_3$z={class:"flex flex-col flex-1 mr-3 overflow-hidden"},_hoisted_4$y={class:"h"},_hoisted_5$t=["onClick"],_hoisted_6$o={class:"mr-1 text-base"},_hoisted_7$l={class:"ml-2 text-xs text-color-info"},_hoisted_8$j={class:"text-color-warning"},_hoisted_9$g={class:"flex justify-end flex-1"},_hoisted_10$f=_withScopeId$k(()=>vue.createElementVNode("i",{class:"mr-1 ri-play-mini-fill"},null,-1)),_hoisted_11$c={class:"flex-1 overflow-hidden b"},_hoisted_12$a={class:"flex flex-col flex-1 overflow-hidden"},_hoisted_13$8={class:"h"},_hoisted_14$7=["onClick"],_hoisted_15$3={class:"flex-1 overflow-hidden b"},_hoisted_16$3={class:"flex flex-1 mt-3 overflow-hidden"},_hoisted_17$3={class:"flex flex-col flex-1 mr-3 overflow-hidden"},_hoisted_18$3={class:"flex h"},_hoisted_19$3=["onClick"],_hoisted_20$3={key:0,class:"mr-1 text-color-danger"},_hoisted_21$3={class:"mr-1 text-base"},_hoisted_22$3={key:0,class:"flex justify-end flex-1"},_hoisted_23$3=_withScopeId$k(()=>vue.createElementVNode("i",{class:"mr-1 ri-play-mini-fill"},null,-1)),_hoisted_24$2={class:"flex-1 overflow-hidden b"},_hoisted_25$2={key:0,class:"flex items-center justify-center h-full"},_hoisted_26$2=_withScopeId$k(()=>vue.createElementVNode("i",{class:"ri-table-fill"},null,-1)),_hoisted_27$1=_withScopeId$k(()=>vue.createElementVNode("i",{class:"ri-database-2-fill"},null,-1)),_hoisted_28$1={class:"h-full mt-2 overflow-y-auto"},_hoisted_29$1={class:"overflow-y-auto max-h-96",style:{"min-height":"300px"}},_hoisted_30$1=_withScopeId$k(()=>vue.createElementVNode("span",{class:"mr-1 text-color-danger"},"*",-1)),_hoisted_31$1={class:"h-full mt-2 overflow-y-auto"},_hoisted_32$1={class:"mt-2"},_hoisted_33$1={key:0,class:"flex flex-col flex-1 overflow-hidden"},_hoisted_34$1={class:"h"},_hoisted_35$1=["onClick"],_hoisted_36$1={class:"flex-1 overflow-hidden b"},_sfc_main$$=vue.defineComponent({__name:"design",props:{widgetType:{default:""}},emits:["success"],setup(i,{expose:n,emit:r}){const o=i,a=r,{proxy:l}=vue.getCurrentInstance(),{setFormValue:s,getFormValue:u}=l.$globalHooks.useForm(),{openMessage:c}=l.$globalHooks.useMessage(),d=vue.inject("projectList"),f=vue.computed(()=>{var j,ee;return((ee=(j=(vue.unref(d)??[]).find(le=>le.value==l.$baseGetCurrentProjectId()))==null?void 0:j.ext)==null?void 0:ee.storeType)??"-"}),p=[{label:"SQL编写",value:"1",num:"①"}],v=vue.ref("1"),m=[{label:"SQL执行结果",value:"1"},{label:"SQL执行结果(JSON)",value:"2"}],g=vue.ref("1"),_=vue.ref([]),y=vue.ref(""),b=vue.ref("1"),x=[{label:"插件执行结果",value:"1"},{label:"插件执行结果(JSON)",value:"2"}],C=vue.ref("1"),w=vue.ref(!1),E=vue.ref(null),$=vue.ref(""),S=vue.ref([]),V=vue.ref(""),k=vue.ref([]),P=vue.ref(`function plugin(item){
615
+ */(function(i,n){(function(o,a){i.exports=a()})(commonjsGlobal,function(){return function(){var r={686:function(l,s,u){u.d(s,{default:function(){return z}});var c=u(279),d=u.n(c),f=u(370),p=u.n(f),v=u(817),m=u.n(v);function g(U){try{return document.execCommand(U)}catch{return!1}}var _=function(G){var J=m()(G);return g("cut"),J},y=_;function b(U){var G=document.documentElement.getAttribute("dir")==="rtl",J=document.createElement("textarea");J.style.fontSize="12pt",J.style.border="0",J.style.padding="0",J.style.margin="0",J.style.position="absolute",J.style[G?"right":"left"]="-9999px";var te=window.pageYOffset||document.documentElement.scrollTop;return J.style.top="".concat(te,"px"),J.setAttribute("readonly",""),J.value=U,J}var x=function(G,J){var te=b(G);J.container.appendChild(te);var ae=m()(te);return g("copy"),te.remove(),ae},C=function(G){var J=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{container:document.body},te="";return typeof G=="string"?te=x(G,J):G instanceof HTMLInputElement&&!["text","search","url","tel","password"].includes(G==null?void 0:G.type)?te=x(G.value,J):(te=m()(G),g("copy")),te},w=C;function E(U){"@babel/helpers - typeof";return typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?E=function(J){return typeof J}:E=function(J){return J&&typeof Symbol=="function"&&J.constructor===Symbol&&J!==Symbol.prototype?"symbol":typeof J},E(U)}var $=function(){var G=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},J=G.action,te=J===void 0?"copy":J,ae=G.container,j=G.target,ee=G.text;if(te!=="copy"&&te!=="cut")throw new Error('Invalid "action" value, use either "copy" or "cut"');if(j!==void 0)if(j&&E(j)==="object"&&j.nodeType===1){if(te==="copy"&&j.hasAttribute("disabled"))throw new Error('Invalid "target" attribute. Please use "readonly" instead of "disabled" attribute');if(te==="cut"&&(j.hasAttribute("readonly")||j.hasAttribute("disabled")))throw new Error(`Invalid "target" attribute. You can't cut text from elements with "readonly" or "disabled" attributes`)}else throw new Error('Invalid "target" value, use a valid Element');if(ee)return w(ee,{container:ae});if(j)return te==="cut"?y(j):w(j,{container:ae})},S=$;function V(U){"@babel/helpers - typeof";return typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?V=function(J){return typeof J}:V=function(J){return J&&typeof Symbol=="function"&&J.constructor===Symbol&&J!==Symbol.prototype?"symbol":typeof J},V(U)}function k(U,G){if(!(U instanceof G))throw new TypeError("Cannot call a class as a function")}function P(U,G){for(var J=0;J<G.length;J++){var te=G[J];te.enumerable=te.enumerable||!1,te.configurable=!0,"value"in te&&(te.writable=!0),Object.defineProperty(U,te.key,te)}}function T(U,G,J){return G&&P(U.prototype,G),J&&P(U,J),U}function B(U,G){if(typeof G!="function"&&G!==null)throw new TypeError("Super expression must either be null or a function");U.prototype=Object.create(G&&G.prototype,{constructor:{value:U,writable:!0,configurable:!0}}),G&&N(U,G)}function N(U,G){return N=Object.setPrototypeOf||function(te,ae){return te.__proto__=ae,te},N(U,G)}function O(U){var G=D();return function(){var te=F(U),ae;if(G){var j=F(this).constructor;ae=Reflect.construct(te,arguments,j)}else ae=te.apply(this,arguments);return I(this,ae)}}function I(U,G){return G&&(V(G)==="object"||typeof G=="function")?G:L(U)}function L(U){if(U===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return U}function D(){if(typeof Reflect>"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],function(){})),!0}catch{return!1}}function F(U){return F=Object.setPrototypeOf?Object.getPrototypeOf:function(J){return J.__proto__||Object.getPrototypeOf(J)},F(U)}function M(U,G){var J="data-clipboard-".concat(U);if(G.hasAttribute(J))return G.getAttribute(J)}var R=function(U){B(J,U);var G=O(J);function J(te,ae){var j;return k(this,J),j=G.call(this),j.resolveOptions(ae),j.listenClick(te),j}return T(J,[{key:"resolveOptions",value:function(){var ae=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};this.action=typeof ae.action=="function"?ae.action:this.defaultAction,this.target=typeof ae.target=="function"?ae.target:this.defaultTarget,this.text=typeof ae.text=="function"?ae.text:this.defaultText,this.container=V(ae.container)==="object"?ae.container:document.body}},{key:"listenClick",value:function(ae){var j=this;this.listener=p()(ae,"click",function(ee){return j.onClick(ee)})}},{key:"onClick",value:function(ae){var j=ae.delegateTarget||ae.currentTarget,ee=this.action(j)||"copy",le=S({action:ee,container:this.container,target:this.target(j),text:this.text(j)});this.emit(le?"success":"error",{action:ee,text:le,trigger:j,clearSelection:function(){j&&j.focus(),window.getSelection().removeAllRanges()}})}},{key:"defaultAction",value:function(ae){return M("action",ae)}},{key:"defaultTarget",value:function(ae){var j=M("target",ae);if(j)return document.querySelector(j)}},{key:"defaultText",value:function(ae){return M("text",ae)}},{key:"destroy",value:function(){this.listener.destroy()}}],[{key:"copy",value:function(ae){var j=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{container:document.body};return w(ae,j)}},{key:"cut",value:function(ae){return y(ae)}},{key:"isSupported",value:function(){var ae=arguments.length>0&&arguments[0]!==void 0?arguments[0]:["copy","cut"],j=typeof ae=="string"?[ae]:ae,ee=!!document.queryCommandSupported;return j.forEach(function(le){ee=ee&&!!document.queryCommandSupported(le)}),ee}}]),J}(d()),z=R},828:function(l){var s=9;if(typeof Element<"u"&&!Element.prototype.matches){var u=Element.prototype;u.matches=u.matchesSelector||u.mozMatchesSelector||u.msMatchesSelector||u.oMatchesSelector||u.webkitMatchesSelector}function c(d,f){for(;d&&d.nodeType!==s;){if(typeof d.matches=="function"&&d.matches(f))return d;d=d.parentNode}}l.exports=c},438:function(l,s,u){var c=u(828);function d(v,m,g,_,y){var b=p.apply(this,arguments);return v.addEventListener(g,b,y),{destroy:function(){v.removeEventListener(g,b,y)}}}function f(v,m,g,_,y){return typeof v.addEventListener=="function"?d.apply(null,arguments):typeof g=="function"?d.bind(null,document).apply(null,arguments):(typeof v=="string"&&(v=document.querySelectorAll(v)),Array.prototype.map.call(v,function(b){return d(b,m,g,_,y)}))}function p(v,m,g,_){return function(y){y.delegateTarget=c(y.target,m),y.delegateTarget&&_.call(v,y)}}l.exports=f},879:function(l,s){s.node=function(u){return u!==void 0&&u instanceof HTMLElement&&u.nodeType===1},s.nodeList=function(u){var c=Object.prototype.toString.call(u);return u!==void 0&&(c==="[object NodeList]"||c==="[object HTMLCollection]")&&"length"in u&&(u.length===0||s.node(u[0]))},s.string=function(u){return typeof u=="string"||u instanceof String},s.fn=function(u){var c=Object.prototype.toString.call(u);return c==="[object Function]"}},370:function(l,s,u){var c=u(879),d=u(438);function f(g,_,y){if(!g&&!_&&!y)throw new Error("Missing required arguments");if(!c.string(_))throw new TypeError("Second argument must be a String");if(!c.fn(y))throw new TypeError("Third argument must be a Function");if(c.node(g))return p(g,_,y);if(c.nodeList(g))return v(g,_,y);if(c.string(g))return m(g,_,y);throw new TypeError("First argument must be a String, HTMLElement, HTMLCollection, or NodeList")}function p(g,_,y){return g.addEventListener(_,y),{destroy:function(){g.removeEventListener(_,y)}}}function v(g,_,y){return Array.prototype.forEach.call(g,function(b){b.addEventListener(_,y)}),{destroy:function(){Array.prototype.forEach.call(g,function(b){b.removeEventListener(_,y)})}}}function m(g,_,y){return d(document.body,g,_,y)}l.exports=f},817:function(l){function s(u){var c;if(u.nodeName==="SELECT")u.focus(),c=u.value;else if(u.nodeName==="INPUT"||u.nodeName==="TEXTAREA"){var d=u.hasAttribute("readonly");d||u.setAttribute("readonly",""),u.select(),u.setSelectionRange(0,u.value.length),d||u.removeAttribute("readonly"),c=u.value}else{u.hasAttribute("contenteditable")&&u.focus();var f=window.getSelection(),p=document.createRange();p.selectNodeContents(u),f.removeAllRanges(),f.addRange(p),c=f.toString()}return c}l.exports=s},279:function(l){function s(){}s.prototype={on:function(u,c,d){var f=this.e||(this.e={});return(f[u]||(f[u]=[])).push({fn:c,ctx:d}),this},once:function(u,c,d){var f=this;function p(){f.off(u,p),c.apply(d,arguments)}return p._=c,this.on(u,p,d)},emit:function(u){var c=[].slice.call(arguments,1),d=((this.e||(this.e={}))[u]||[]).slice(),f=0,p=d.length;for(f;f<p;f++)d[f].fn.apply(d[f].ctx,c);return this},off:function(u,c){var d=this.e||(this.e={}),f=d[u],p=[];if(f&&c)for(var v=0,m=f.length;v<m;v++)f[v].fn!==c&&f[v].fn._!==c&&p.push(f[v]);return p.length?d[u]=p:delete d[u],this}},l.exports=s,l.exports.TinyEmitter=s}},o={};function a(l){if(o[l])return o[l].exports;var s=o[l]={exports:{}};return r[l](s,s.exports,a),s.exports}return function(){a.n=function(l){var s=l&&l.__esModule?function(){return l.default}:function(){return l};return a.d(s,{a:s}),s}}(),function(){a.d=function(l,s){for(var u in s)a.o(s,u)&&!a.o(l,u)&&Object.defineProperty(l,u,{enumerable:!0,get:s[u]})}}(),function(){a.o=function(l,s){return Object.prototype.hasOwnProperty.call(l,s)}}(),a(686)}().default})})(clipboard);var clipboardExports=clipboard.exports;const Clipboard$1=getDefaultExportFromCjs(clipboardExports),useClipboard=i=>{const n=(i==null?void 0:i.appendToBody)===void 0?!0:i.appendToBody;return{toClipboard(r,o){return new Promise((a,l)=>{const s=document.createElement("button"),u=new Clipboard$1(s,{text:()=>r,action:()=>"copy",container:o!==void 0?o:document.body});u.on("success",c=>{u.destroy(),a(c)}),u.on("error",c=>{u.destroy(),l(c)}),n&&document.body.appendChild(s),s.click(),n&&document.body.removeChild(s)})}}},_hoisted_1$1e={class:"mb-2"},_hoisted_2$12=vue.createElementVNode("div",{class:"mb-2 font-bold"},"显示名称",-1),_hoisted_3$V={class:"relative mt-4 mb-4 flex flex-col gap-2.5"},_hoisted_4$T={class:"flex gap-2.5 items-center"},_hoisted_5$K=vue.createElementVNode("span",{class:"font-bold"},"SQL计算公式",-1),_hoisted_6$E={class:"flex items-center gap-1.5"},_hoisted_7$A=vue.createElementVNode("i",{class:"ri-lightbulb-line"},null,-1),_hoisted_8$x=vue.createElementVNode("span",{class:"text-xs"},"使用规范SQL函数和计算公式,以下表达式将嵌入到SELECT语句中",-1),_hoisted_9$t={class:"flex gap-2.5 items-center"},_hoisted_10$p=vue.createElementVNode("span",null,"字段列表",-1),_hoisted_11$j={class:"flex items-center gap-1.5"},_hoisted_12$g={class:"flex items-center gap-2.5 flex-wrap"},_hoisted_13$e=["onClick"],_hoisted_14$d={class:"text-black"},_sfc_main$1v=vue.defineComponent({__name:"model-sql",props:{options:{default:()=>[]}},emits:["success"],setup(i,{expose:n,emit:r}){const{proxy:o}=vue.getCurrentInstance(),{toClipboard:a}=useClipboard(),l=vue.ref(!1),s=i,u=r,c=vue.ref(""),d=vue.ref(""),f=vue.ref(null),p=g=>{if(c.value="",d.value="",l.value=!0,g){const _=JSON.parse(JSON.stringify(g.data));d.value=_.identifier??"",c.value=_.comment}},v=async g=>{try{await a(g),o.$message({type:"success",message:"复制成功",plain:!0})}catch{o.$message({type:"warning",message:"复制失败",plain:!0})}},m=()=>{var g;if(!vue.unref(d)){o.$message({type:"warning",message:"请输入SQL语句",plain:!0});return}if(vue.unref(c)==""){o.$message({type:"warning",message:"请输入显示名称",plain:!0});return}u("success",{aggType:"applySql",identifier:vue.unref(d),comment:vue.unref(c),showLabel:vue.unref(c)},((g=vue.unref(f))==null?void 0:g.index)??""),l.value=!1};return n({init:p}),(g,_)=>{const y=vue.resolveComponent("AppDialog");return vue.openBlock(),vue.createBlock(y,{modelValue:vue.unref(l),"onUpdate:modelValue":_[3]||(_[3]=b=>vue.isRef(l)?l.value=b:null),title:"SQL计算",size:800},{footer:vue.withCtx(()=>[vue.createVNode(vue.unref(elementPlus.ElButton),{class:"ml-3",type:"primary",onClick:m},{default:vue.withCtx(()=>[vue.createTextVNode("保存")]),_:1}),vue.createVNode(vue.unref(elementPlus.ElButton),{class:"ml-3",onClick:_[2]||(_[2]=b=>l.value=!1)},{default:vue.withCtx(()=>[vue.createTextVNode("取消")]),_:1})]),default:vue.withCtx(()=>[vue.createElementVNode("div",_hoisted_1$1e,[_hoisted_2$12,vue.createVNode(vue.unref(elementPlus.ElInput),{modelValue:vue.unref(c),"onUpdate:modelValue":_[0]||(_[0]=b=>vue.isRef(c)?c.value=b:null),placeholder:"请输入显示名称"},null,8,["modelValue"])]),vue.createElementVNode("div",_hoisted_3$V,[vue.createElementVNode("div",_hoisted_4$T,[_hoisted_5$K,vue.createElementVNode("span",_hoisted_6$E,[vue.createVNode(vue.unref(elementPlus.ElText),{type:"warning"},{default:vue.withCtx(()=>[_hoisted_7$A]),_:1}),vue.createVNode(vue.unref(elementPlus.ElText),{type:"info"},{default:vue.withCtx(()=>[_hoisted_8$x]),_:1})])]),vue.createElementVNode("div",null,[vue.createVNode(vue.unref(elementPlus.ElInput),{modelValue:vue.unref(d),"onUpdate:modelValue":_[1]||(_[1]=b=>vue.isRef(d)?d.value=b:null),placeholder:"请输入SQL语句,例如:max(tbValue+isVal)+max(tbValue)",type:"textarea"},null,8,["modelValue"])]),vue.createElementVNode("div",_hoisted_9$t,[_hoisted_10$p,vue.createElementVNode("span",_hoisted_11$j,[vue.createVNode(vue.unref(elementPlus.ElText),{type:"warning"},{default:vue.withCtx(()=>[vue.createTextVNode("点击可复制")]),_:1})])]),vue.createElementVNode("div",_hoisted_12$g,[(vue.openBlock(!0),vue.createElementBlock(vue.Fragment,null,vue.renderList(s.options,b=>(vue.openBlock(),vue.createElementBlock("div",{style:{border:"1px solid #eee"},onClick:x=>v(b.identifier),class:"bg-gray-100 flex flex-col p-2.5 justify-center items-center rounded gap-0.5 cursor-pointer",key:b.identifier},[vue.createElementVNode("div",_hoisted_14$d,vue.toDisplayString(b.columnComment),1),vue.createVNode(vue.unref(elementPlus.ElText),{type:"info"},{default:vue.withCtx(()=>[vue.createTextVNode(vue.toDisplayString(b.identifier),1)]),_:2},1024)],8,_hoisted_13$e))),128))])])]),_:1},8,["modelValue"])}}}),_withScopeId$v=i=>(vue.pushScopeId("data-v-d0ae7404"),i=i(),vue.popScopeId(),i),_hoisted_1$1d={key:0},_hoisted_2$11=_withScopeId$v(()=>vue.createElementVNode("div",{class:"mb-2 text-sm indicators-title"},[vue.createElementVNode("i",{class:"mr-1 ri-table-line"}),vue.createTextVNode(" 基本指标 ")],-1)),_hoisted_3$U=["onClick"],_hoisted_4$S=_withScopeId$v(()=>vue.createElementVNode("i",{class:"ri-lightbulb-line"},null,-1)),_hoisted_5$J={key:1},_hoisted_6$D={class:"flex items-center mb-2 text-sm indicators-title"},_hoisted_7$z={class:"overflow-y-auto max-h-96"},_hoisted_8$w=["onClick"],_hoisted_9$s={class:"field-label"},_hoisted_10$o=_withScopeId$v(()=>vue.createElementVNode("i",{class:"ri-add-fill"},null,-1)),_sfc_main$1u=vue.defineComponent({__name:"model-table-summary",props:{modelValue:{default:()=>[]},iconMap:{default:()=>{}},aggArgsList:{default:()=>[]},groupArgsList:{default:()=>[]}},emits:["update:modelValue"],setup(i,{emit:n}){const r=i,o=n,{proxy:a}=vue.getCurrentInstance();vue.inject("chartList");const l=vue.ref(!1),s=vue.ref(1),u=vue.ref(null),c=vue.ref(null),d=vue.ref([{label:"总数",value:"count",tip:"数据的总行数"},{label:"总和",value:"sum",tip:"列的所有值的总和"},{label:"平均值",value:"avg",tip:"列的所有值的平均值"},{label:"最少",value:"min",tip:"列的最小值"},{label:"最大",value:"max",tip:"列的最大值"},{label:"计算公式",value:"exp",tip:"可手动输入计算公式"},{label:"SQL计算",value:"applySql",tip:"可手动输入sql语句"}]);vue.watch(l,_=>{_&&(v.value={},s.value=1)});const f=_=>{o("update:modelValue",r.modelValue.filter(y=>y.showLabel!==_.showLabel))},p=(_,y)=>{_.aggType=="applySql"&&vue.unref(c).init({data:_,index:y}),_.aggType=="exp"&&vue.unref(u).init({data:_,index:y})},v=vue.ref({}),m=_=>{if(_.value==="count"){if(r.modelValue.some(y=>y.aggType==_.value)){a.$message({type:"warning",message:"存在重复数据",plain:!0});return}o("update:modelValue",[...r.modelValue,{identifier:1,aggType:_.value,showLabel:_.label}]),l.value=!1;return}if(_.value=="exp"){vue.unref(u).init();return}if(_.value=="applySql"){vue.unref(c).init();return}s.value=2,v.value=_},g=_=>{var y,b;if(r.modelValue.some(x=>{var C;return x.identifier==_.identifier&&x.aggType==((C=vue.unref(v))==null?void 0:C.value)})){a.$message({type:"warning",message:"存在重复数据",plain:!0});return}l.value=!1,o("update:modelValue",[...r.modelValue,{identifier:_.identifier,comment:_.columnComment,aggType:(y=vue.unref(v))==null?void 0:y.value,showLabel:_.columnComment+((b=vue.unref(v))==null?void 0:b.label)}])};return(_,y)=>{const b=vue.resolveComponent("aceHeader");return vue.openBlock(),vue.createElementBlock(vue.Fragment,null,[vue.createVNode(b,{title:"汇总方式",class:"mb-2"}),vue.createElementVNode("div",null,[(vue.openBlock(!0),vue.createElementBlock(vue.Fragment,null,vue.renderList(_.modelValue,(x,C)=>(vue.openBlock(),vue.createBlock(vue.unref(elementPlus.ElTag),{key:x.value,class:vue.normalizeClass(["m-1",[x.aggType=="exp"?"cursor-pointer":""]]),closable:!0,onClick:w=>p(x,C),onClose:w=>f(x),type:"primary"},{default:vue.withCtx(()=>[vue.createTextVNode(vue.toDisplayString(x.showLabel),1)]),_:2},1032,["onClick","class","onClose"]))),128)),vue.createVNode(vue.unref(elementPlus.ElPopover),{trigger:"click",width:"300px",placement:"top-start",visible:vue.unref(l),"onUpdate:visible":y[1]||(y[1]=x=>vue.isRef(l)?l.value=x:null)},{reference:vue.withCtx(()=>[vue.createVNode(vue.unref(elementPlus.ElButton),{type:"primary",class:"ml-1",size:"small"},{default:vue.withCtx(()=>[_hoisted_10$o,vue.createTextVNode(" "+vue.toDisplayString(_.modelValue.length?"":"添加度量"),1)]),_:1})]),default:vue.withCtx(()=>[vue.unref(s)==1?(vue.openBlock(),vue.createElementBlock("div",_hoisted_1$1d,[_hoisted_2$11,(vue.openBlock(!0),vue.createElementBlock(vue.Fragment,null,vue.renderList(vue.unref(d),x=>(vue.openBlock(),vue.createElementBlock("div",{onClick:C=>m(x),key:x.value,class:vue.normalizeClass([{active:vue.unref(v).value==x.value},"indicators-item"])},[vue.createTextVNode(vue.toDisplayString(x.label)+" ",1),vue.createVNode(vue.unref(elementPlus.ElTooltip),{effect:"dark",content:x.tip,placement:"top"},{default:vue.withCtx(()=>[_hoisted_4$S]),_:2},1032,["content"])],10,_hoisted_3$U))),128))])):vue.createCommentVNode("",!0),vue.unref(s)==2?(vue.openBlock(),vue.createElementBlock("div",_hoisted_5$J,[vue.createElementVNode("div",_hoisted_6$D,[vue.createElementVNode("i",{class:"mr-1 text-xl cursor-pointer ri-arrow-left-s-line",onClick:y[0]||(y[0]=x=>s.value=1)}),vue.createTextVNode(" "+vue.toDisplayString(vue.unref(v).label),1)]),vue.createElementVNode("div",_hoisted_7$z,[(vue.openBlock(!0),vue.createElementBlock(vue.Fragment,null,vue.renderList(r.aggArgsList,x=>(vue.openBlock(),vue.createElementBlock("div",{onClick:C=>g(x),key:x.identifier,class:"indicators-item"},[vue.createElementVNode("div",null,[vue.createElementVNode("i",{class:vue.normalizeClass([_.iconMap[x.dataType],"mr-2"])},null,2),vue.createElementVNode("span",_hoisted_9$s,vue.toDisplayString(x.columnComment),1)])],8,_hoisted_8$w))),128))])])):vue.createCommentVNode("",!0)]),_:1},8,["visible"]),vue.createVNode(ModelExp,{ref_key:"modelPercentRef",ref:u,options:r.aggArgsList,onSuccess:y[2]||(y[2]=(x,C)=>C!==""?r.modelValue[C]=x:o("update:modelValue",[...r.modelValue,x]))},null,8,["options"]),vue.createVNode(_sfc_main$1v,{ref_key:"modelSqlRef",ref:c,options:r.groupArgsList,onSuccess:y[3]||(y[3]=(x,C)=>C!==""?r.modelValue[C]=x:o("update:modelValue",[...r.modelValue,x]))},null,8,["options"])])],64)}}}),modelTableSummary_vue_vue_type_style_index_0_scoped_d0ae7404_lang="",modelTableSunmary=_export_sfc$2(_sfc_main$1u,[["__scopeId","data-v-d0ae7404"]]),_sfc_main$1t=vue.defineComponent({__name:"chart-list-widget",props:{type:{default:""}},setup(i){const{proxy:n}=vue.getCurrentInstance(),r=vue.inject("chartList"),o=a=>{n.$baseEventBus.emit("model-chart-click",a)};return(a,l)=>(vue.openBlock(!0),vue.createElementBlock(vue.Fragment,null,vue.renderList(vue.unref(r),s=>(vue.openBlock(),vue.createBlock(vue.unref(elementPlus.ElButton),{type:a.type==s.type?"primary":"",key:s.type,onClick:u=>o(s)},{default:vue.withCtx(()=>{var u;return[vue.createElementVNode("i",{class:vue.normalizeClass((u=vue.unref(echartsTypeList)[s.type])==null?void 0:u.icon)},null,2)]}),_:2},1032,["type","onClick"]))),128))}}),_withScopeId$u=i=>(vue.pushScopeId("data-v-b71f07d1"),i=i(),vue.popScopeId(),i),_hoisted_1$1c={class:"overflow-y-auto max-h-96"},_hoisted_2$10=["onClick"],_hoisted_3$T={class:"field-label"},_hoisted_4$R=_withScopeId$u(()=>vue.createElementVNode("i",{class:"ri-add-fill"},null,-1)),_sfc_main$1s=vue.defineComponent({__name:"model-table-other-summary",props:{modelValue:{default:()=>[]},iconMap:{default:()=>{}},list:{default:()=>[]}},emits:["update:modelValue"],setup(i,{emit:n}){const r=i,o=n,{proxy:a}=vue.getCurrentInstance();vue.inject("chartList");const l=vue.ref(!1);vue.ref(null);const s=c=>{o("update:modelValue",r.modelValue.filter(d=>d.showLabel!==c.showLabel))},u=c=>{if(r.modelValue.some(d=>d.identifier==c.identifier)){a.$message({type:"warning",message:"存在重复数据",plain:!0});return}l.value=!1,o("update:modelValue",[...r.modelValue,{identifier:c.identifier,comment:c.columnComment,aggType:"other",showLabel:c.columnComment}])};return(c,d)=>{const f=vue.resolveComponent("aceHeader");return vue.openBlock(),vue.createElementBlock(vue.Fragment,null,[vue.createVNode(f,{title:"显示其他列",class:"mt-2 mb-2"}),vue.createElementVNode("div",null,[(vue.openBlock(!0),vue.createElementBlock(vue.Fragment,null,vue.renderList(c.modelValue,(p,v)=>(vue.openBlock(),vue.createBlock(vue.unref(elementPlus.ElTag),{key:p.value,class:"m-1",closable:!0,onClose:m=>s(p),type:"primary"},{default:vue.withCtx(()=>[vue.createTextVNode(vue.toDisplayString(p.showLabel),1)]),_:2},1032,["onClose"]))),128)),vue.createVNode(vue.unref(elementPlus.ElPopover),{trigger:"click",width:"300px",placement:"top-start","popper-class":"ace-select",visible:vue.unref(l),"onUpdate:visible":d[0]||(d[0]=p=>vue.isRef(l)?l.value=p:null)},{reference:vue.withCtx(()=>[vue.createVNode(vue.unref(elementPlus.ElButton),{type:"primary",class:"ml-1",size:"small"},{default:vue.withCtx(()=>[_hoisted_4$R]),_:1})]),default:vue.withCtx(()=>[vue.createElementVNode("div",_hoisted_1$1c,[(vue.openBlock(!0),vue.createElementBlock(vue.Fragment,null,vue.renderList(c.list,p=>(vue.openBlock(),vue.createElementBlock("div",{onClick:v=>u(p),key:p.identifier,class:"indicators-item"},[vue.createElementVNode("div",null,[vue.createElementVNode("i",{class:vue.normalizeClass([c.iconMap[p.dataType],"mr-2"])},null,2),vue.createElementVNode("span",_hoisted_3$T,vue.toDisplayString(p.columnComment),1)])],8,_hoisted_2$10))),128))])]),_:1},8,["visible"])])],64)}}}),modelTableOtherSummary_vue_vue_type_style_index_0_scoped_b71f07d1_lang="",ModelTableOtherSummary=_export_sfc$2(_sfc_main$1s,[["__scopeId","data-v-b71f07d1"]]),_withScopeId$t=i=>(vue.pushScopeId("data-v-c1a63796"),i=i(),vue.popScopeId(),i),_hoisted_1$1b={class:"flex w-full h-full"},_hoisted_2$$={class:"flex flex-col flex-1 overflow-hidden"},_hoisted_3$S={class:"flex flex-col flex-1 pb-3 pr-3 overflow-y-auto"},_hoisted_4$Q={key:0,class:"relative flex items-center justify-center pannel h-14"},_hoisted_5$I={class:"absolute left-5 top-3"},_hoisted_6$C=_withScopeId$t(()=>vue.createElementVNode("i",{class:"ml-1 ri-settings-2-line"},null,-1)),_hoisted_7$y=_withScopeId$t(()=>vue.createElementVNode("i",{class:"ri-table-line"},null,-1)),_hoisted_8$v={class:"absolute flex items-center right-5 top-4"},_hoisted_9$r=_withScopeId$t(()=>vue.createElementVNode("i",{class:"mr-1 ri-settings-2-line"},null,-1)),_hoisted_10$n={class:"ml-2 mr-2"},_hoisted_11$i={class:"flex flex-col"},_hoisted_12$f={class:"flex-1 overflow-y-auto"},_hoisted_13$d={key:0,class:"flex items-center justify-center pannel h-14"},_hoisted_14$c=_withScopeId$t(()=>vue.createElementVNode("i",{class:"mr-1 ri-save-line"},null,-1)),_sfc_main$1r=vue.defineComponent({__name:"table-widget",props:{modelValue:{default:""},title:{default:""},sortHtml:{default:""},indicatorsId:{default:""},resultTitle:{default:""},dynamicSearchForm:{default:()=>[]}},emits:["update:modelValue","update:title","update:sortHtml","update:resultTitle","update:indicatorsId","update:dynamicSearchForm","success"],setup(i,{expose:n,emit:r}){const o=i,a=r,l=useScreenDesign(),{proxy:s}=vue.getCurrentInstance(),{setFormValue:u,getFormValue:c}=s.$globalHooks.useForm(),{dynamicSearchForm:d,dynamicSearchFormat:f,dynamicSearchParams:p}=s.$aceDynamicSearch(s),v=vue.inject("modelEle"),m=vue.inject("getListModelIndicators");vue.inject("chartList");const g={varchar:"ri-text",date:"ri-calendar-2-line",datetime:"ri-calendar-2-line",int:"ri-hashtag",decimal:"ri-hashtag"},_={day:"按日",week:"按周",month:"按月",quarter:"按季度",year:"按年","":"按时分秒"},y=vue.ref(!1),b=vue.ref(!0),x=vue.ref(0),C=vue.ref([]),w=vue.ref([]),E=vue.ref([]),$=vue.ref([]),S=vue.ref([]),V=vue.ref(!0),k=vue.ref(!0),P=async j=>{var se,Z;V.value=!0,k.value=!1;const ee=JSON.parse((j==null?void 0:j.groupArgsJson)??"[]"),le=JSON.parse((j==null?void 0:j.aggArgsJson)??JSON.stringify([{identifier:1,aggType:"count",showLabel:"总数"}]));$.value=le.filter(K=>K.aggType!="other"),S.value=le.filter(K=>K.aggType=="other"),ee.length||(V.value=!1),x.value=(j==null?void 0:j.pageSize)??20,F.value=JSON.parse((j==null?void 0:j.sortArgsJson)??"{}"),j!=null&&j.formConfJson?(d.value=f(JSON.parse(j.formConfJson??"[]")),a("update:dynamicSearchForm",d.value)):await fetch$1(s).getFormJsonConfig((se=vue.unref(v))==null?void 0:se.id).then(K=>{var q;d.value=f(JSON.parse(((q=K.data)==null?void 0:q.formConfJson)??"[]"))}),a("update:dynamicSearchForm",d.value),u(j,z),s.$baseHttp.post("/api/ace-data-center/aidc/modelAnalysis",{projectId:s.$baseGetCurrentProjectId(),modelId:(Z=vue.unref(v))==null?void 0:Z.id,serialId:new Date().getTime()}).then(K=>{b.value=!1,C.value=K.data.filter(q=>!["创建时间","创建人","所属项目","创建部门","标签"].includes(q.columnComment)).map(q=>({...q,dateFormatType:["date","datetime"].includes(q.dataType)?"day":""})),E.value=K.data.filter(q=>["ADDABLE","SEMIADDABLE"].includes(q.quantityType)),ee.forEach(q=>{const Y=C.value.find(X=>X.identifier==q.identifier);Y&&(w.value.push({...Y,dataType:q.dataType,dateFormatType:q.dateFormatType}),Y.dateFormatType=q.dateFormatType)}),V.value=!1,setTimeout(()=>{k.value=!0},1e3)})};vue.watch([$,w,S],()=>{vue.unref(k)&&(F.value={}),L()},{deep:!0});let T=null;const B=vue.ref(null),N=vue.ref(!1),O=vue.ref([]),I=vue.ref([]),L=async()=>{clearTimeout(T),T=setTimeout(async()=>{var Z,K;I.value=[],l.setChartData([]);const j=D(),ee=Object.keys(vue.unref(F)).map(q=>({field:q,type:vue.unref(F)[q]=="ascending"?"asc":"desc"})),le={aggArgsJson:JSON.stringify([...vue.unref($),...vue.unref(S)]),groupArgsJson:JSON.stringify(j),sortArgsJson:JSON.stringify(ee),params:p(vue.unref(d)),pageSize:vue.unref(x),modelId:(Z=vue.unref(v))==null?void 0:Z.id,formConfJson:JSON.stringify(vue.unref(d))};if(o.indicatorsId&&(le.modelIndicatorsId=o.indicatorsId),a("update:title",`${vue.unref($).length}个指标:${vue.unref($).length?"根据":""}${j.map(q=>q.showLabel).toString()}${vue.unref($).length?"分组的":""}${vue.unref($).filter((q,Y)=>Y<3).map(q=>q.showLabel).toString()}${vue.unref($).length>3?"...":""}`),!vue.unref($).length||vue.unref(V)){O.value=[];return}N.value=!0;const se=await s.$baseHttp.post("/api/ace-data-center/model-indicators/debug",le);B.value=le,N.value=!1,se&&(O.value=((K=se.data)==null?void 0:K.records)??[],l.setChartData({x:j,y:[...vue.unref($),...vue.unref(S)],params:le}),vue.unref(O).length&&Object.keys(vue.unref(O)[0]).forEach(q=>{I.value.push({label:q,prop:q,sortable:"custom"})}))})},D=()=>vue.unref(w).map(j=>({identifier:j.identifier,comment:j.columnComment,showLabel:j.columnComment+(_[j.dateFormatType]??""),dateFormatType:j.dateFormatType||null})),F=vue.ref({}),M=({column:j})=>{vue.unref(F)[j.property]&&(j.order=vue.unref(F)[j.property])};vue.watch(F,j=>{const ee=Object.keys(j).map(le=>`${le}${j[le]=="descending"?"降序":"升序"}`);a("update:sortHtml",ee.length?`<span class="text-color-warning">排序:${ee.toString()}</span>`:"")},{deep:!0});const R=j=>{const{prop:ee,order:le}=j;!le||vue.unref(F)[ee]===le?delete vue.unref(F)[ee]:vue.unref(F)[ee]=le,L()};fetch$1(s).loadIndicatorsMenu().then(j=>{z.find(ee=>ee.fieldName=="tags").options=Object.keys(j.data).map(ee=>({label:ee,value:ee}))});const z=vue.reactive([{name:"名称",type:FieldType.Text,fieldName:"name",value:"",required:!0},{name:"描述",type:FieldType.Textarea,fieldName:"remark",value:""},{name:"标签",type:FieldType.Select,fieldName:"tags",value:"",options:[],multiple:!0,allowCreate:!0,required:!0,placeholder:"请选择标签或输入标签"},{name:"code",type:FieldType.Text,fieldName:"code",value:"",hide:!0}]),U=vue.ref(!1),G=()=>{z.find(j=>j.fieldName=="remark").value=o.title,U.value=!0},J=async()=>{var Z;const{params:j,error:ee}=c(z);if(ee.length>0)return;const le=D();if(!le.length||!vue.unref($).length){s.$message({type:"warning",message:"计算维度或汇总方式不能为空",plain:!0});return}j.code||(j.code=nanoid()),j.groupArgsJson=JSON.stringify(le),j.aggArgsJson=JSON.stringify([...vue.unref($),...vue.unref(S)]),j.modelId=(Z=vue.unref(v))==null?void 0:Z.id,j.projectId=s.$baseGetCurrentProjectId(),j.pageSize=vue.unref(x),j.formConfJson=JSON.stringify(vue.unref(d)),j.sortArgsJson=JSON.stringify(vue.unref(F)),o.indicatorsId&&(j.id=o.indicatorsId),U.value=!1;const se=await s.$baseHttp.post(`/api/ace-data-center/model-indicators/${o.indicatorsId?"update":"save"}`,j,{header:{loading:!0}});se&&(o.indicatorsId||a("update:indicatorsId",se.data),a("update:resultTitle",j.name),s.$message({type:"success",message:"操作成功",plain:!0}),u(j,z),m())},te=()=>{a("update:modelValue","chart")},ae=()=>{s.$baseExportExcel({title:o.title,url:"/api/ace-data-center/model-indicators/debug",header:vue.unref(I),customParams:vue.unref(B)})};return n({init:P,dynamicSearchForm:d,handlePopupForm:G,handleSubmit:J}),(j,ee)=>{var X,oe;const le=vue.resolveComponent("aceDynamicSearch"),se=vue.resolveComponent("AppTable"),Z=vue.resolveComponent("AppEmpty"),K=vue.resolveComponent("aceDynamicList"),q=vue.resolveComponent("AppForm"),Y=vue.resolveComponent("AppDialog");return vue.openBlock(),vue.createElementBlock("div",_hoisted_1$1b,[vue.createElementVNode("div",_hoisted_2$$,[vue.createElementVNode("div",_hoisted_3$S,[vue.unref($).length?(vue.openBlock(),vue.createElementBlock(vue.Fragment,{key:0},[vue.createVNode(le,{form:vue.unref(d),onSuccess:ee[0]||(ee[0]=W=>L())},null,8,["form"]),vue.createVNode(vue.unref(elementPlus.ElSkeleton),{loading:vue.unref(N),animated:""},{default:vue.withCtx(()=>[vue.unref(I).length?(vue.openBlock(),vue.createBlock(se,{key:0,tableData:vue.unref(I),list:vue.unref(O),loading:!1,headerCellClassName:M,onSortChange:R},null,8,["tableData","list"])):(vue.openBlock(),vue.createBlock(Z,{key:1,description:"暂无数据",class:"mt-4"}))]),_:1},8,["loading"])],64)):(vue.openBlock(),vue.createBlock(K,{key:1,id:(X=vue.unref(v))==null?void 0:X.id,title:(oe=vue.unref(v))==null?void 0:oe.modelName,showPageIndex:!0},null,8,["id","title"]))]),vue.unref($).length?(vue.openBlock(),vue.createElementBlock("div",_hoisted_4$Q,[vue.createElementVNode("div",_hoisted_5$I,[vue.createVNode(vue.unref(elementPlus.ElTooltip),{effect:"dark",content:"保存汇总配置后可设置",placement:"top",visible:vue.unref(y)},{default:vue.withCtx(()=>[vue.createVNode(vue.unref(elementPlus.ElButton),{disabled:j.indicatorsId=="",type:"warning",style:{padding:"0 10px"},onMouseenter:ee[1]||(ee[1]=W=>{j.indicatorsId||(y.value=!0)}),onMouseleave:ee[2]||(ee[2]=W=>y.value=!1),onClick:te},{default:vue.withCtx(()=>[vue.createTextVNode(" 图表配置 "),_hoisted_6$C]),_:1},8,["disabled"])]),_:1},8,["visible"])]),vue.createVNode(vue.unref(elementPlus.ElButtonGroup),null,{default:vue.withCtx(()=>[vue.createVNode(vue.unref(elementPlus.ElButton),{type:"primary"},{default:vue.withCtx(()=>[_hoisted_7$y]),_:1}),vue.createVNode(_sfc_main$1t)]),_:1}),vue.createElementVNode("div",_hoisted_8$v,[vue.createVNode(vue.unref(elementPlus.ElLink),{type:"primary"},{default:vue.withCtx(()=>[_hoisted_9$r,vue.createTextVNode(" 显示前 "),vue.createElementVNode("div",_hoisted_10$n,[vue.createVNode(vue.unref(elementPlus.ElInputNumber),{size:"small",style:{width:"100px"},modelValue:vue.unref(x),"onUpdate:modelValue":ee[3]||(ee[3]=W=>vue.isRef(x)?x.value=W:null),onChange:ee[4]||(ee[4]=W=>L()),min:1,max:9999999},null,8,["modelValue"])]),vue.createTextVNode(" 条聚合数据 ")]),_:1}),vue.unref(I).length?(vue.openBlock(),vue.createElementBlock("i",{key:0,class:"ml-2 cursor-pointer ri-download-2-line text-color-warning",onClick:ae})):vue.createCommentVNode("",!0)])])):vue.createCommentVNode("",!0)]),vue.createElementVNode("aside",_hoisted_11$i,[vue.createElementVNode("div",_hoisted_12$f,[vue.createVNode(modelTableSunmary,{aggArgsList:vue.unref(E),groupArgsList:vue.unref(C),modelValue:vue.unref($),"onUpdate:modelValue":ee[5]||(ee[5]=W=>vue.isRef($)?$.value=W:null),iconMap:g},null,8,["aggArgsList","groupArgsList","modelValue"]),vue.createVNode(ModelTableOtherSummary,{iconMap:g,list:vue.unref(C),modelValue:vue.unref(S),"onUpdate:modelValue":ee[6]||(ee[6]=W=>vue.isRef(S)?S.value=W:null)},null,8,["list","modelValue"]),vue.withDirectives(vue.createElementVNode("div",null,[vue.createVNode(modelTableDimension,{loading:vue.unref(b),list:vue.unref(C),iconMap:g,calendarType:_,modelValue:vue.unref(w),"onUpdate:modelValue":ee[7]||(ee[7]=W=>vue.isRef(w)?w.value=W:null)},null,8,["loading","list","modelValue"])],512),[[vue.vShow,vue.unref($).length]])]),vue.unref($).length?(vue.openBlock(),vue.createElementBlock("div",_hoisted_13$d,[vue.createVNode(vue.unref(elementPlus.ElButton),{type:"primary",onClick:G},{default:vue.withCtx(()=>[_hoisted_14$c,vue.createTextVNode(" 完 成 ")]),_:1})])):vue.createCommentVNode("",!0),vue.createVNode(Y,{modelValue:vue.unref(U),"onUpdate:modelValue":ee[9]||(ee[9]=W=>vue.isRef(U)?U.value=W:null),title:"保存指标",size:800},{footer:vue.withCtx(()=>[vue.createVNode(vue.unref(elementPlus.ElButton),{class:"ml-3",type:"primary",onClick:J},{default:vue.withCtx(()=>[vue.createTextVNode("保存")]),_:1}),vue.createVNode(vue.unref(elementPlus.ElButton),{class:"ml-3",onClick:ee[8]||(ee[8]=W=>U.value=!1)},{default:vue.withCtx(()=>[vue.createTextVNode("取消")]),_:1})]),default:vue.withCtx(()=>[vue.createVNode(q,{form:vue.unref(z),col:1},null,8,["form"])]),_:1},8,["modelValue"])])])}}}),tableWidget_vue_vue_type_style_index_0_scoped_c1a63796_lang="",tableWidget=_export_sfc$2(_sfc_main$1r,[["__scopeId","data-v-c1a63796"]]),_withScopeId$s=i=>(vue.pushScopeId("data-v-6fadb38d"),i=i(),vue.popScopeId(),i),_hoisted_1$1a={class:"flex flex-wrap chart-container"},_hoisted_2$_=["onClick"],_hoisted_3$R=["onClick"],_hoisted_4$P=_withScopeId$s(()=>vue.createElementVNode("i",{class:"ml-1 ri-settings-2-line"},null,-1)),_hoisted_5$H=[_hoisted_4$P],_hoisted_6$B={key:0,class:"success setting"},_hoisted_7$x=_withScopeId$s(()=>vue.createElementVNode("i",{class:"ml-1 ri-check-line"},null,-1)),_hoisted_8$u=[_hoisted_7$x],_hoisted_9$q={class:"label"},_sfc_main$1q=vue.defineComponent({__name:"model-chart-menu",props:{modelValue:{default:""}},emits:["click-chart-setting","update:modelValue"],setup(i,{emit:n}){vue.getCurrentInstance();const r=[{...echartsTypeList[3],key:"3"},...Object.keys(echartsTypeList).filter(u=>u!="3").map(u=>({...echartsTypeList[u],key:u}))],o=vue.inject("chartList"),a=n,l=u=>{a("update:modelValue",String(u))},s=u=>{a("update:modelValue",String(u)),a("click-chart-setting")};return(u,c)=>(vue.openBlock(),vue.createElementBlock("div",_hoisted_1$1a,[(vue.openBlock(),vue.createElementBlock(vue.Fragment,null,vue.renderList(r,d=>{var f;return vue.createElementVNode("div",{class:"items",key:d.key,onClick:p=>l(d.key)},[vue.createElementVNode("div",{class:vue.normalizeClass(["icon",{active:u.modelValue==d.key}])},[vue.createElementVNode("i",{class:vue.normalizeClass(d.icon)},null,2),vue.createElementVNode("div",{class:"setting",onClick:vue.withModifiers(p=>s(d.key),["stop"])},_hoisted_5$H,8,_hoisted_3$R),(f=vue.unref(o))!=null&&f.some(p=>p.type==d.key)?(vue.openBlock(),vue.createElementBlock("div",_hoisted_6$B,_hoisted_8$u)):vue.createCommentVNode("",!0)],2),vue.createElementVNode("div",_hoisted_9$q,vue.toDisplayString(d.name),1)],8,_hoisted_2$_)}),64))]))}}),modelChartMenu_vue_vue_type_style_index_0_scoped_6fadb38d_lang="",modelChartMenu=_export_sfc$2(_sfc_main$1q,[["__scopeId","data-v-6fadb38d"]]),_sfc_main$1p=vue.defineComponent({__name:"model-chart-setting",props:{option:{default:{}},type:{default:""}},emits:["close"],setup(i,{expose:n,emit:r}){const o=i,a=r,{proxy:l}=vue.getCurrentInstance(),s=vue.ref(""),u=vue.inject("indicatorsId"),c=vue.inject("getListModelIndicators"),d=vue.inject("getChartWidgetList"),f=vue.computed(()=>({3:_sfc_main$1X,2:_sfc_main$1V,1:_sfc_main$1W,4:_sfc_main$1S,5:_sfc_main$1U,6:_sfc_main$1T,7:_sfc_main$1R,8:_sfc_main$1Q,9:_sfc_main$1P,10:_sfc_main$1O,11:_sfc_main$1N})[o.type]??null),p=vue.ref(!1),v=()=>{s.value="data",p.value=!0},m=async()=>{o.option.tooltip&&(delete o.option.tooltip.valueFormatter,delete o.option.tooltip.formatter),o.type=="9"&&delete o.option.series[2].label.formatter,await l.$baseHttp.post("/api/ace-data-center/model-indicators-echarts/save",{modelIndicatorsId:vue.unref(u),echartsType:o.type,echartsConfig:chartJsonToStringFormat({...o.option,customSeriesData:window.customSeriesData,dataset:{...o.option.dataset,source:[]}})},{headers:{loading:!0}})&&(l.$message({type:"success",message:"操作成功",plain:!0}),await d(),await c(),p.value=!1,a("close"))},g=()=>{p.value=!1};return n({init:v,handleSubmit:m}),(_,y)=>{const b=vue.resolveComponent("AppDrawer");return vue.openBlock(),vue.createBlock(b,{modelValue:vue.unref(p),"onUpdate:modelValue":y[3]||(y[3]=x=>vue.isRef(p)?p.value=x:null),withHeader:!1,modal:!1,direction:"ltr",size:"350px",modalClass:"ace-modal-drawer"},{footer:vue.withCtx(()=>[vue.createVNode(vue.unref(elementPlus.ElButton),{type:"primary",onClick:y[1]||(y[1]=x=>m())},{default:vue.withCtx(()=>[vue.createTextVNode("保存")]),_:1}),vue.createVNode(vue.unref(elementPlus.ElButton),{class:"ml-3",onClick:y[2]||(y[2]=x=>g())},{default:vue.withCtx(()=>[vue.createTextVNode("关闭")]),_:1})]),default:vue.withCtx(()=>[vue.createVNode(vue.unref(elementPlus.ElCollapse),{accordion:"",modelValue:vue.unref(s),"onUpdate:modelValue":y[0]||(y[0]=x=>vue.isRef(s)?s.value=x:null)},{default:vue.withCtx(()=>[vue.unref(f)?(vue.openBlock(),vue.createBlock(vue.unref(f),{key:0,option:o.option,type:_.type},null,8,["option","type"])):vue.createCommentVNode("",!0)]),_:1},8,["modelValue"])]),_:1},8,["modelValue"])}}}),modelChartSetting_vue_vue_type_style_index_0_scoped_71b96102_lang="",modelChartSetting=_export_sfc$2(_sfc_main$1p,[["__scopeId","data-v-71b96102"]]),_withScopeId$r=i=>(vue.pushScopeId("data-v-85f16186"),i=i(),vue.popScopeId(),i),_hoisted_1$19={class:"flex w-full h-full"},_hoisted_2$Z={class:"flex-1"},_hoisted_3$Q={key:0,class:"flex items-center justify-center pannel h-14"},_hoisted_4$O=_withScopeId$r(()=>vue.createElementVNode("i",{class:"mr-1 ri-save-line"},null,-1)),_hoisted_5$G={class:"flex flex-col flex-1 overflow-hidden"},_hoisted_6$A={class:"relative flex flex-col flex-1 pb-3 pl-3"},_hoisted_7$w={class:"mb-2.5"},_hoisted_8$t={class:"relative flex items-center justify-center pannel h-14"},_hoisted_9$p={key:0,class:"absolute left-5 top-3"},_hoisted_10$m=_withScopeId$r(()=>vue.createElementVNode("i",{class:"ml-1 ri-settings-2-line"},null,-1)),_hoisted_11$h=_withScopeId$r(()=>vue.createElementVNode("i",{class:"ri-table-line"},null,-1)),_sfc_main$1o=vue.defineComponent({__name:"chart-widget",props:{modelValue:{default:""},dynamicSearchForm:{default:()=>[]}},emits:["update:modelValue"],setup(i,{expose:n,emit:r}){const o=r,{proxy:a}=vue.getCurrentInstance(),l=vue.inject("chartList"),{option:s,formatChart:u}=useCustomChart(),c=vue.ref(""),d=vue.ref(null),f=vue.ref(!1),p=()=>{if(vue.unref(c)==""){a.$message({type:"warning",message:"请选择图表",plain:!0});return}const y=setInterval(()=>{vue.unref(f)&&(vue.unref(d).init(),clearInterval(y))},20)};vue.watch(c,async y=>{var x;if(s.value={},f.value=!1,y==""){f.value=!0;return}const b=(x=vue.unref(l))==null?void 0:x.find(C=>C.type==y);await u((b==null?void 0:b.code)??"",y),f.value=!0});const v=vue.ref(!1);a.$baseEventBus.on("model-chart-click",async y=>{v.value=!0,o("update:modelValue","chart"),c.value=y.type,setTimeout(()=>{v.value=!1},100)});const m=()=>{if(vue.unref(l).length>0){vue.unref(v)||(c.value=vue.unref(l)[0].type),f.value=!0;return}c.value="3"},g=()=>{const y=c.value;c.value="",setTimeout(()=>{c.value=y},10)},_=()=>{c.value="",o("update:modelValue","table")};return n({init:m}),(y,b)=>{var w;const x=vue.resolveComponent("aceDynamicSearch"),C=vue.resolveComponent("aceCustomChart");return vue.openBlock(),vue.createElementBlock("div",_hoisted_1$19,[vue.createElementVNode("aside",null,[vue.createElementVNode("div",_hoisted_2$Z,[vue.createVNode(modelChartMenu,{modelValue:vue.unref(c),"onUpdate:modelValue":b[0]||(b[0]=E=>vue.isRef(c)?c.value=E:null),onClickChartSetting:p},null,8,["modelValue"])]),(w=vue.unref(l))!=null&&w.some(E=>E.type==vue.unref(c))?vue.createCommentVNode("",!0):(vue.openBlock(),vue.createElementBlock("div",_hoisted_3$Q,[vue.createVNode(vue.unref(elementPlus.ElButton),{type:"primary",onClick:b[1]||(b[1]=E=>vue.unref(d).handleSubmit())},{default:vue.withCtx(()=>[_hoisted_4$O,vue.createTextVNode(" 保 存 ")]),_:1})]))]),vue.createElementVNode("div",_hoisted_5$G,[vue.createElementVNode("div",_hoisted_6$A,[vue.createVNode(vue.unref(elementPlus.ElSkeleton),{loading:!vue.unref(f),animated:""},{default:vue.withCtx(()=>[vue.createElementVNode("div",_hoisted_7$w,[vue.createVNode(x,{form:y.dynamicSearchForm,search:!1,disabled:""},null,8,["form"])]),vue.createVNode(C,{option:vue.unref(s),chartType:vue.unref(c),isCheckClick:!1},null,8,["option","chartType"])]),_:1},8,["loading"])]),vue.createElementVNode("div",_hoisted_8$t,[vue.unref(s)?(vue.openBlock(),vue.createElementBlock("div",_hoisted_9$p,[vue.createVNode(vue.unref(elementPlus.ElButtonGroup),null,{default:vue.withCtx(()=>[vue.createVNode(vue.unref(elementPlus.ElButton),{type:"primary",style:{padding:"0 10px"}},{default:vue.withCtx(()=>[vue.createTextVNode("可视化")]),_:1}),vue.createVNode(vue.unref(elementPlus.ElButton),{type:"",style:{padding:"0 10px"},onClick:p},{default:vue.withCtx(()=>[_hoisted_10$m]),_:1})]),_:1})])):vue.createCommentVNode("",!0),vue.createVNode(vue.unref(elementPlus.ElButtonGroup),null,{default:vue.withCtx(()=>[vue.createVNode(vue.unref(elementPlus.ElButton),{type:"",onClick:_},{default:vue.withCtx(()=>[_hoisted_11$h]),_:1}),vue.createVNode(_sfc_main$1t,{type:vue.unref(c)},null,8,["type"])]),_:1})])]),vue.unref(c)?(vue.openBlock(),vue.createBlock(modelChartSetting,{key:0,ref_key:"modelChartSettingRef",ref:d,option:vue.unref(s),type:vue.unref(c),onClose:g},null,8,["option","type"])):vue.createCommentVNode("",!0)])}}}),chartWidget_vue_vue_type_style_index_0_scoped_85f16186_lang="",chartWidget=_export_sfc$2(_sfc_main$1o,[["__scopeId","data-v-85f16186"]]),_withScopeId$q=i=>(vue.pushScopeId("data-v-51646426"),i=i(),vue.popScopeId(),i),_hoisted_1$18={class:"design"},_hoisted_2$Y={class:"design-header"},_hoisted_3$P={class:"flex-1"},_hoisted_4$N={class:"mt-2 text-xs text-color-info"},_hoisted_5$F=["innerHTML"],_hoisted_6$z={class:"flex"},_hoisted_7$v={class:"mr-2"},_hoisted_8$s=_withScopeId$q(()=>vue.createElementVNode("i",{class:"mr-1 ri-settings-2-line"},null,-1)),_hoisted_9$o=_withScopeId$q(()=>vue.createElementVNode("i",{class:"mr-1 ri-close-line"},null,-1)),_hoisted_10$l={class:"flex flex-1 p-3 overflow-hidden design-container"},_sfc_main$1n=vue.defineComponent({__name:"index",emits:["close"],setup(i,{expose:n,emit:r}){const{proxy:o}=vue.getCurrentInstance(),a=vue.ref(!1),l=vue.ref(!1),s=vue.ref(),u=vue.ref(null),c=vue.ref(null),d=vue.ref(null),f=vue.ref([]),p=vue.ref("0个指标"),v=vue.ref(""),m=vue.ref(""),g=vue.ref([]),_=r;vue.watch(a,S=>{S||o.$baseEventBus.off("model-chart-click")}),vue.provide("indicatorsId",m);const y=vue.inject("modelEle"),b=vue.ref(""),x=async S=>{var k;let V={};s.value="table",m.value=S,g.value=[],f.value=[],vue.unref(m)&&(V=await C(),w()),a.value=!0,b.value=(k=V==null?void 0:V.data)==null?void 0:k.name,vue.nextTick(()=>{vue.unref(u).init((V==null?void 0:V.data)??{})})};vue.watch(s,S=>{S=="chart"&&vue.unref(c).init()});const C=async()=>await o.$baseHttp.get(`/api/ace-data-center/model-indicators/detail?id=${vue.unref(m)}`,{headers:{loading:!0}}),w=async()=>{const S=await o.$baseHttp.post(`/api/ace-data-center/model-indicators-echarts/getEchartsTypes/${vue.unref(m)}`);g.value=S.data};vue.provide("getChartWidgetList",w),vue.provide("chartList",g);const E=()=>{o.$baseConfirm({content:"是否确定关闭",callConfirm:async()=>{a.value=!1,vue.unref(m)&&_("close")}})},$=S=>{f.value=S,vue.unref(u).dynamicSearchForm=S,vue.unref(u).handleSubmit()};return n({init:x}),(S,V)=>{const k=vue.resolveComponent("aceHeader"),P=vue.resolveComponent("AppDrawer");return vue.openBlock(),vue.createBlock(P,{modelValue:vue.unref(a),"onUpdate:modelValue":V[11]||(V[11]=T=>vue.isRef(a)?a.value=T:null),withHeader:!1,size:"100%",modalClass:"ace-modal-drawer"},{default:vue.withCtx(()=>{var T,B;return[vue.createElementVNode("div",_hoisted_1$18,[vue.createElementVNode("div",_hoisted_2$Y,[vue.createElementVNode("div",_hoisted_3$P,[vue.createVNode(k,{title:vue.unref(s)=="table"?vue.unref(p):`${vue.unref(b)}【${vue.unref(p)}】`},vue.createSlots({_:2},[vue.unref(g).length?{name:"left",fn:vue.withCtx(()=>[vue.createElementVNode("i",{onClick:V[0]||(V[0]=N=>vue.unref(u).handlePopupForm()),class:"ml-2 text-base cursor-pointer ri-edit-box-line text-color-primary"})]),key:"0"}:void 0]),1032,["title"]),vue.createElementVNode("div",_hoisted_4$N,[vue.createTextVNode(" 模型数据 / "+vue.toDisplayString((T=vue.unref(y))==null?void 0:T.modelName)+" ["+vue.toDisplayString((B=vue.unref(y))==null?void 0:B.modelCode)+"] ",1),vue.createElementVNode("span",{class:"ml-2",innerHTML:vue.unref(v)},null,8,_hoisted_5$F)])]),vue.createElementVNode("div",_hoisted_6$z,[vue.withDirectives(vue.createElementVNode("div",_hoisted_7$v,[vue.createVNode(vue.unref(elementPlus.ElPopover),{placement:"bottom",visible:vue.unref(l),"onUpdate:visible":V[2]||(V[2]=N=>vue.isRef(l)?l.value=N:null),trigger:"click",width:"900px","popper-class":"ace-select"},{reference:vue.withCtx(()=>[vue.createVNode(vue.unref(elementPlus.ElButton),{type:"warning"},{default:vue.withCtx(()=>[_hoisted_8$s,vue.createTextVNode(" 筛选配置 ")]),_:1})]),default:vue.withCtx(()=>[vue.createVNode(aceIndicatorCustomSearch,{ref_key:"customSearchRef",ref:d,customSearchVisible:vue.unref(l),"onUpdate:customSearchVisible":V[1]||(V[1]=N=>vue.isRef(l)?l.value=N:null),onDynamicSearchFormUpdate:$,dynamicSearchForm:vue.unref(f)},null,8,["customSearchVisible","dynamicSearchForm"])]),_:1},8,["visible"])],512),[[vue.vShow,vue.unref(s)=="table"&&vue.unref(p)!="0个指标:"]]),vue.createVNode(vue.unref(elementPlus.ElButton),{onClick:E},{default:vue.withCtx(()=>[_hoisted_9$o,vue.createTextVNode(" 关闭 ")]),_:1})])]),vue.createElementVNode("div",_hoisted_10$l,[vue.withDirectives(vue.createVNode(tableWidget,{ref_key:"tableWidgetRef",ref:u,modelValue:vue.unref(s),"onUpdate:modelValue":V[3]||(V[3]=N=>vue.isRef(s)?s.value=N:null),indicatorsId:vue.unref(m),"onUpdate:indicatorsId":V[4]||(V[4]=N=>vue.isRef(m)?m.value=N:null),title:vue.unref(p),"onUpdate:title":V[5]||(V[5]=N=>vue.isRef(p)?p.value=N:null),resultTitle:vue.unref(b),"onUpdate:resultTitle":V[6]||(V[6]=N=>vue.isRef(b)?b.value=N:null),sortHtml:vue.unref(v),"onUpdate:sortHtml":V[7]||(V[7]=N=>vue.isRef(v)?v.value=N:null),dynamicSearchForm:vue.unref(f),"onUpdate:dynamicSearchForm":V[8]||(V[8]=N=>vue.isRef(f)?f.value=N:null)},null,8,["modelValue","indicatorsId","title","resultTitle","sortHtml","dynamicSearchForm"]),[[vue.vShow,vue.unref(s)=="table"]]),vue.withDirectives(vue.createVNode(chartWidget,{ref_key:"chartWidgetRef",ref:c,dynamicSearchForm:vue.unref(f),"onUpdate:dynamicSearchForm":V[9]||(V[9]=N=>vue.isRef(f)?f.value=N:null),modelValue:vue.unref(s),"onUpdate:modelValue":V[10]||(V[10]=N=>vue.isRef(s)?s.value=N:null)},null,8,["dynamicSearchForm","modelValue"]),[[vue.vShow,vue.unref(s)=="chart"]])])])]}),_:1},8,["modelValue"])}}}),index_vue_vue_type_style_index_0_scoped_51646426_lang="",aceIndicatorDesign=_export_sfc$2(_sfc_main$1n,[["__scopeId","data-v-51646426"]]),_hoisted_1$17={class:"flex items-center"},_hoisted_2$X=vue.createElementVNode("i",{class:"ri-search-line"},null,-1),_hoisted_3$O={class:"mt-3"},_hoisted_4$M={class:"flex items-center w-full overflow-hidden"},_hoisted_5$E={class:"overflow-hidden text-ellipsis whitespace-nowrap"},_hoisted_6$y={key:0,class:"mr-1 text-base ri-checkbox-circle-fill text-color-success"},_hoisted_7$u={key:1,class:"mr-1 text-base ri-progress-1-fill text-color-warning"},_hoisted_8$r={key:0,class:"flex items-center justify-end flex-1"},_sfc_main$1m=vue.defineComponent({__name:"menu",props:{tempId:{default:""}},emits:["node-click"],setup(i,{expose:n,emit:r}){const o=i,{proxy:a}=vue.getCurrentInstance(),l=vue.ref(""),s=vue.ref(null),u=vue.ref(null),c=r;vue.watch(l,m=>{vue.unref(u).filter(m)});const d=(m,g)=>m?g.name.includes(m):!0,f=vue.ref(!1),p=()=>{s.value=[],f.value=!0,fetch$1(a).loadIndicatorsMenu().then(m=>{s.value=Object.keys(m.data).map(_=>({name:_,id:_,children:m.data[_]}));let g;f.value=!1,vue.unref(s).length&&vue.nextTick(()=>{var _;o.tempId?g=vue.unref(u).getNode(o.tempId):g=vue.unref(u).getNode((_=vue.unref(s)[0].children[0])==null?void 0:_.id),g&&(v(g==null?void 0:g.data),vue.unref(u).setCurrentKey(g==null?void 0:g.data.id))})})};p();const v=m=>{Array.isArray(m.children)||c("node-click",m)};return n({init:p}),(m,g)=>{const _=vue.resolveComponent("AppEmpty");return vue.openBlock(),vue.createElementBlock(vue.Fragment,null,[vue.createElementVNode("div",_hoisted_1$17,[vue.createVNode(vue.unref(elementPlus.ElInput),{placeholder:"请输入内容",clearable:"",modelValue:vue.unref(l),"onUpdate:modelValue":g[0]||(g[0]=y=>vue.isRef(l)?l.value=y:null)},{prefix:vue.withCtx(()=>[_hoisted_2$X]),_:1},8,["modelValue"]),vue.renderSlot(m.$slots,"search")]),vue.createElementVNode("div",_hoisted_3$O,[vue.unref(f)?(vue.openBlock(),vue.createBlock(vue.unref(elementPlus.ElSkeleton),{key:0,animated:"",count:2})):(vue.openBlock(),vue.createBlock(vue.unref(elementPlus.ElTree),{key:1,class:"animated fadeIn",ref_key:"treeRef",ref:u,data:vue.unref(s),"empty-text":"暂无数据","node-key":"id","default-expand-all":"",indent:0,"highlight-current":"","filter-node-method":d,onNodeClick:v},{default:vue.withCtx(({node:y,data:b})=>[vue.createElementVNode("div",_hoisted_4$M,[vue.createElementVNode("div",_hoisted_5$E,[Array.isArray(b.children)?vue.createCommentVNode("",!0):(vue.openBlock(),vue.createElementBlock(vue.Fragment,{key:0},[b.normal?(vue.openBlock(),vue.createElementBlock("i",_hoisted_6$y)):(vue.openBlock(),vue.createElementBlock("i",_hoisted_7$u))],64)),vue.createElementVNode("span",{class:vue.normalizeClass(["flex-1 overflow-hidden whitespace-nowrap text-ellipsis",{"font-bold":y.level==1}])},vue.toDisplayString(b.name),3)]),Array.isArray(b.children)?vue.createCommentVNode("",!0):(vue.openBlock(),vue.createElementBlock("div",_hoisted_8$r,[vue.renderSlot(m.$slots,"menu-item",{data:b})]))])]),empty:vue.withCtx(()=>[vue.createVNode(_,{description:"暂无数据"})]),_:3},8,["data"]))])],64)}}}),_hoisted_1$16={class:"rule-list"},_hoisted_2$W={key:0,class:"flex items-center"},_hoisted_3$N=vue.createElementVNode("i",{class:"ri-error-warning-fill text-2xl text-color-warning mr-2"},null,-1),_hoisted_4$L={key:1,class:"flex items-center"},_hoisted_5$D=vue.createElementVNode("i",{class:"ri-checkbox-circle-fill text-2xl text-color-success mr-2"},null,-1),_sfc_main$1l=vue.defineComponent({__name:"rule",props:{ruleList:{default:()=>[]}},setup(i){const{proxy:n}=vue.getCurrentInstance(),r=vue.ref(!1),o=vue.ref(""),a=vue.ref([]),l=c=>{o.value=`/api/ace-data-center/rule/ruleDataView?ruleId=${c}`,r.value=!0},s=c=>{vue.unref(a).length==0&&Object.keys(c.data[0]).forEach(d=>{if(d==="pageIndex"){a.value.unshift({label:"序号",prop:"pageIndex",width:"80px"});return}a.value.push({label:d,prop:d})})},u=()=>{n.$baseExportExcel({title:"数据列表",url:vue.unref(o),method:"get",header:vue.unref(a)})};return(c,d)=>{const f=vue.resolveComponent("aceHeader"),p=vue.resolveComponent("AppList"),v=vue.resolveComponent("AppDrawer");return vue.openBlock(),vue.createElementBlock(vue.Fragment,null,[vue.createElementVNode("div",_hoisted_1$16,[c.ruleList.length>0?(vue.openBlock(),vue.createElementBlock(vue.Fragment,{key:0},[vue.createVNode(f,{title:"智能诊断",class:"mb-5"}),vue.createVNode(vue.unref(elementPlus.ElAlert),{type:"warning",closable:!1},{default:vue.withCtx(()=>[(vue.openBlock(!0),vue.createElementBlock(vue.Fragment,null,vue.renderList(c.ruleList,m=>(vue.openBlock(),vue.createElementBlock("div",{key:m.id,class:"mt-0 text-sm"},[+m.rows>0?(vue.openBlock(),vue.createElementBlock("div",_hoisted_2$W,[_hoisted_3$N,vue.createTextVNode(" "+vue.toDisplayString(m.ruleName)+" 【异常数据"+vue.toDisplayString(m.rows>99?"99+":m.rows)+"】 ",1),vue.createVNode(vue.unref(elementPlus.ElLink),{class:"ml-2",type:"primary",onClick:g=>l(m.id)},{default:vue.withCtx(()=>[vue.createTextVNode("查看明细")]),_:2},1032,["onClick"])])):(vue.openBlock(),vue.createElementBlock("div",_hoisted_4$L,[_hoisted_5$D,vue.createTextVNode(" "+vue.toDisplayString(m.ruleName)+" 【未检测到异常数据】 ",1)]))]))),128))]),_:1})],64)):vue.createCommentVNode("",!0)]),vue.createVNode(v,{modelValue:vue.unref(r),"onUpdate:modelValue":d[1]||(d[1]=m=>vue.isRef(r)?r.value=m:null),title:"数据列表"},{footer:vue.withCtx(()=>[vue.createVNode(vue.unref(elementPlus.ElButton),{type:"primary",class:"ml-3",onClick:u},{default:vue.withCtx(()=>[vue.createTextVNode("导 出")]),_:1}),vue.createVNode(vue.unref(elementPlus.ElButton),{class:"ml-3",onClick:d[0]||(d[0]=m=>r.value=!1)},{default:vue.withCtx(()=>[vue.createTextVNode("关 闭")]),_:1})]),default:vue.withCtx(()=>[vue.createVNode(p,{tableData:vue.unref(a),url:vue.unref(o),onSuccess:s},null,8,["tableData","url"])]),_:1},8,["modelValue"])],64)}}}),_hoisted_1$15={key:1,class:"animated fadeIn"},_hoisted_2$V={class:"flex items-center mt-5 mb-5 ml-2 moudle-1"},_hoisted_3$M={key:0,class:"mr-1 text-xl ri-error-warning-fill text-color-warning"},_hoisted_4$K={key:1,class:"mr-1 text-xl ri-checkbox-circle-fill text-color-success"},_hoisted_5$C={class:"ml-1"},_hoisted_6$x={class:"flex items-center select-type"},_hoisted_7$t=["onClick"],_hoisted_8$q={class:"mt-5 mb-5"},_hoisted_9$n={class:"mt-4"},_sfc_main$1k=vue.defineComponent({__name:"analysis",props:{indicatorsId:{default:""}},emits:["rule-success"],setup(i,{emit:n}){const r=i;vue.watch(()=>r.indicatorsId,()=>p());const o=n,{proxy:a}=vue.getCurrentInstance(),{dynamicSearchForm:l,dynamicSearchFormat:s,dynamicSearchParams:u}=a.$aceDynamicSearch(a),c=vue.ref(!0),d=vue.ref([]),f=vue.ref(null),p=async()=>{var w,E,$;c.value=!0,l.value=[],_.value={type:"",value:""},v.value=[],m.value="",x();const C=await fetch$1(a).detailAndTask(r.indicatorsId);f.value=C.data,(E=(w=C.data)==null?void 0:w.echartsDataVO)!=null&&E.config&&g(),($=C==null?void 0:C.data)!=null&&$.formConfJson&&(l.value=s(JSON.parse(C==null?void 0:C.data.formConfJson))),c.value=!1},v=vue.ref([]),m=vue.ref(""),g=async()=>{var w;v.value=[],m.value="";const C=await fetch$1(a).getEchartDetail({indicatorsId:r.indicatorsId});C&&(Object.keys(((w=C.data)==null?void 0:w.clientEchartsType)??{}).forEach(E=>{var $;Object.values(($=C.data)==null?void 0:$.clientEchartsType[E]).forEach(S=>{var V,k;v.value.push({client:E,label:(V=echartsTypeList[S])==null?void 0:V.name,icon:(k=echartsTypeList[S])==null?void 0:k.icon,value:`${E}_${S}`})})}),vue.unref(v).length>0&&(m.value=vue.unref(v)[0].value,b(vue.unref(m))))},_=vue.ref({type:"",value:""}),y=vue.ref(!1),b=async(C,w=!1)=>{var V;m.value=C,w&&(y.value=!0);const E=u(vue.unref(l)),$=C.split("_"),S=await fetch$1(a).pullEchartsDataVO({indicatorsId:r.indicatorsId,loadType:((V=vue.unref(f))==null?void 0:V.loadType)??3,params:E,targetClient:$[0],echartsType:$[1]});if(S){y.value=!1,vue.unref(_).type=$[1];try{vue.unref(_).value=chartJsonFormat(S.data.config)}catch{vue.unref(_).value=S.data.config}}},x=async()=>{var w;d.value=[];const C=await fetch$1(a).getRule({current:1,size:100,businessType:"indicators",businessId:r.indicatorsId});d.value=((w=C.data)==null?void 0:w.records)??[],o("rule-success",d.value)};return p(),(C,w)=>{const E=vue.resolveComponent("AppResourceVisitor"),$=vue.resolveComponent("aceHeader"),S=vue.resolveComponent("aceDynamicSearch"),V=vue.resolveComponent("aceChart");return vue.unref(c)?(vue.openBlock(),vue.createBlock(vue.unref(elementPlus.ElSkeleton),{key:0,animated:""})):(vue.openBlock(),vue.createElementBlock("div",_hoisted_1$15,[vue.createVNode($,{title:"指标计算"},{default:vue.withCtx(()=>[vue.createVNode(E,{businessType:"INDICATORS",businessld:r.indicatorsId},null,8,["businessld"])]),_:1}),vue.createElementVNode("div",_hoisted_2$V,[vue.unref(d).some(k=>k.rows>0)?(vue.openBlock(),vue.createElementBlock("i",_hoisted_3$M)):(vue.openBlock(),vue.createElementBlock("i",_hoisted_4$K)),vue.createElementVNode("span",_hoisted_5$C,vue.toDisplayString(vue.unref(f).remark),1)]),vue.createVNode($,{title:"指标数据"},{default:vue.withCtx(()=>[vue.createElementVNode("div",_hoisted_6$x,[(vue.openBlock(!0),vue.createElementBlock(vue.Fragment,null,vue.renderList(vue.unref(v),k=>(vue.openBlock(),vue.createElementBlock("span",{onClick:P=>b(k.value,!0),class:vue.normalizeClass(["flex items-center cursor-pointer",[k.value==vue.unref(m)?"text-color-primary":"text-gray-600"]]),key:k.value},[vue.createElementVNode("i",{class:vue.normalizeClass([k.icon,"mr-1"])},null,2),vue.createTextVNode(" "+vue.toDisplayString(k.label),1)],10,_hoisted_7$t))),128))])]),_:1}),vue.createElementVNode("div",_hoisted_8$q,[vue.unref(l).length>0?(vue.openBlock(),vue.createBlock(S,{key:0,form:vue.unref(l),onSuccess:w[0]||(w[0]=k=>b(vue.unref(m),!0)),class:"mb-0"},null,8,["form"])):vue.createCommentVNode("",!0),vue.createElementVNode("div",_hoisted_9$n,[vue.createVNode(V,{type:vue.unref(_).type,options:vue.unref(_).value,loading:vue.unref(y)},null,8,["type","options","loading"])])]),vue.createVNode(_sfc_main$1l,{ruleList:vue.unref(d)},null,8,["ruleList"])]))}}}),analysis_vue_vue_type_style_index_0_scoped_bf2d49fa_lang="",aceIndicatorSystemPreview=_export_sfc$2(_sfc_main$1k,[["__scopeId","data-v-bf2d49fa"]]),_hoisted_1$14={class:"h-full"},_sfc_main$1j=vue.defineComponent({__name:"relation",setup(i){const{proxy:n}=vue.getCurrentInstance(),r=vue.ref(null),o=vue.ref(!0),a=["#00ADD0","#FFA12F","#B62AFF","#604BFF","#6E35FF","#002AFF","#20C0F4","#95F300","#04FDB8","#AF5AFF"],l=(s,u,c="#00f6ff")=>s.map((d,f)=>{switch(d&&d.title&&(d.name=d.title),u==1&&(c=a.find((p,v)=>v==f%10)),(u===0||u===1)&&(d.label={position:"inside"}),u){case 0:d.symbolSize=70;break;case 1:d.symbolSize=50;break;default:d.symbolSize=10;break}return d.lineStyle={color:c},d.children?(d.itemStyle={borderColor:c,color:c},d.children=l(d.children,u+1,c)):d.itemStyle={color:"transparent",borderColor:c},d});return fetch$1(n).indicatorsRelationTree().then(s=>{if(o.value=!1,!s.data.length){r.value={};return}r.value={type:"tree",toolbox:{show:!0,iconStyle:{borderColor:"#03ceda"},feature:{restore:{}}},tooltip:{trigger:"item",triggerOn:"mousemove",backgroundColor:"rgba(0,0,0,.8)",borderWidth:.5,textStyle:{fontSize:10,color:"#fff"}},series:[{type:"tree",hoverAnimation:!0,data:l([s==null?void 0:s.data[0]],0),top:10,bottom:10,left:10,right:10,layout:"radial",symbol:"circle",symbolSize:10,nodePadding:20,animationDurationUpdate:750,expandAndCollapse:!0,initialTreeDepth:2,roam:!0,focusNodeAdjacency:!0,itemStyle:{borderWidth:1},label:{color:"#000",fontSize:10,fontFamily:"SourceHanSansCN",position:"inside",rotate:0},lineStyle:{width:1,curveness:.5}}]}}),(s,u)=>{const c=vue.resolveComponent("v-chart");return vue.withDirectives((vue.openBlock(),vue.createElementBlock("div",_hoisted_1$14,[vue.createVNode(c,{option:vue.unref(r),autoresize:""},null,8,["option"])])),[[vue.unref(elementPlus.vLoading),vue.unref(o)]])}}}),_hoisted_1$13={key:0,class:"flex items-center gap-x-2.5"},_hoisted_2$U=vue.createElementVNode("div",{class:"font-bold"},"数据分析",-1),_sfc_main$1i=vue.defineComponent({__name:"yoy",props:{search:{default:()=>[]},originSearch:{default:()=>[]},chartType:{default:""},option:{default:null},chartData:{default:null}},setup(i,{expose:n}){const r=i,{proxy:o}=vue.getCurrentInstance(),{dynamicSearchForm:a,dynamicSearchFormat:l,dynamicSearchParams:s}=o.$aceDynamicSearch(o),u=["yySingle","yymmSingle","yymmddSingle"],{seriesItem:c}=useLineCommon(),d=vue.computed(()=>r.search.find(g=>u.includes(g.type))),f=vue.computed(()=>{const g=vue.unref(d)?Object.values(s([vue.unref(d)])).every(_=>_==""):!1;return r.search.filter(_=>u.includes(_.type)).length==1&&!g}),p=vue.ref("");vue.watch(p,()=>v());const v=async()=>{var B;if(!vue.unref(f)||vue.unref(p)=="")return;const g=JSON.parse(JSON.stringify((B=r.chartData)==null?void 0:B.params)),_=JSON.parse(JSON.stringify(r.search)),y=_.find(N=>u.includes(N.type)),b=r.originSearch.find(N=>u.includes(N.type)),C=JSON.parse((g==null?void 0:g.groupArgsJson)??"[]").find(N=>N.comment==r.option.dataShow.x);g.groupArgsJson=JSON.stringify([C]);const w=C.dateFormatType;switch(y.type){case"yymmSingle":y.value=dayjs(y.value).subtract(1,vue.unref(p)=="TB"?"year":"month").format("YYYY-MM");break;case"yymmddSingle":y.value=dayjs(y.value).subtract(1,vue.unref(p)=="TB"?"year":"day").format("YYYY-MM-DD");break;case"yySingle":y.value=dayjs(y.value).subtract(1,"year").format("YYYY");break}g.params=s(_);const $=r.option.dataset.dimensions;$.length>=3&&r.option.dataset.dimensions.pop();const S=await o.$baseHttp.post("/api/ace-data-center/model-indicators/debug",g),V=$[0],k=r.option.dataShow.y.filter(N=>!r.option.dataShow.hide.includes(N));vue.unref(y.type).includes("Range")?(r.option.dataset.dimensions[1]=`${b!=null&&b.minValue?`${b==null?void 0:b.minValue}~`:""}${(b==null?void 0:b.maxValue)??""}${k}`,r.option.dataset.dimensions.push(`${y.minValue?`${y.minValue}~`:""}${(y==null?void 0:y.maxValue)??""}${k}`)):(r.option.dataset.dimensions[1]=`${b==null?void 0:b.value}${k}`,r.option.dataset.dimensions[2]=`${y.value}${k}`,r.option.dataset.dimensions[3]="增长率");const P=r.option.series[0];r.option.series=[],S.data.records.forEach(N=>{m(N,V,w)});const T=JSON.parse(JSON.stringify(r.option.dataset.temp_source));T.forEach((N,O)=>{m(N,V,w);let I=null;N[r.option.dataset.dimensions[1]]=N[k],w?(I=S.data.records.find(F=>F[V]==N[V]),I||(["year"].includes(w)&&(I=S.data.records.find(F=>F[V].indexOf(y.value)>=0),N[V]=V),["day","month"].includes(w)&&(I=S.data.records.find(F=>F[V].split("-").at(-1)==N[V].split("-").at(-1))))):I=S.data.records.find(F=>F[V]==N[V]),I||(I={[k]:0}),I&&(N[r.option.dataset.dimensions[2]]=I[k]);const L=N[r.option.dataset.dimensions[1]]??0,D=N[r.option.dataset.dimensions[2]]??0;N.增长率=!L||!D?0:((L-D)/D*100).toFixed(2)}),r.option.dataset.source=T,setTimeout(()=>{const{yAxis:N,xAxis:O}=r.option;let I="yAxis";!Array.isArray(N)&&N.type!="value"&&(I="xAxis"),r.option.series=[P,{...P,itemStyle:{...(P==null?void 0:P.itemStyle)??{},color:null}},{...c,name:"增长率",[`${I}Index`]:1}],r.option[I]=[Array.isArray(r.option[I])?r.option[I][0]:r.option[I],{type:"value",name:"增长率",nameGap:20,splitLine:!1,nameLocation:I=="xAxis"?"start":"end"}]})},m=(g,_,y)=>{if(!(!y||(g[_]??"")=="")&&["day"].includes(y)){const b=g[_].split("-").filter((x,C)=>C==0?"":x);g[_]=b.join("-")}};return n({init:v,type:p}),(g,_)=>vue.unref(f)&&g.option?(vue.openBlock(),vue.createElementBlock("div",_hoisted_1$13,[_hoisted_2$U,vue.createElementVNode("div",null,[vue.createVNode(vue.unref(elementPlus.ElRadioGroup),{modelValue:vue.unref(p),"onUpdate:modelValue":_[0]||(_[0]=y=>vue.isRef(p)?p.value=y:null)},{default:vue.withCtx(()=>{var y;return[vue.createVNode(vue.unref(elementPlus.ElRadio),{label:"TB",value:"TB"},{default:vue.withCtx(()=>[vue.createTextVNode("同比")]),_:1}),vue.createVNode(vue.unref(elementPlus.ElRadio),{label:"HB",value:"HB",disabled:!["yymmSingle","yymmddSingle"].includes((y=vue.unref(d))==null?void 0:y.type)},{default:vue.withCtx(()=>[vue.createTextVNode(" 环比 ")]),_:1},8,["disabled"])]}),_:1},8,["modelValue"])])])):vue.createCommentVNode("",!0)}}),_withScopeId$p=i=>(vue.pushScopeId("data-v-3923290f"),i=i(),vue.popScopeId(),i),_hoisted_1$12={key:2,class:"flex flex-col chart-preview"},_hoisted_2$T={class:"flex mb-2.5"},_hoisted_3$L={key:0,class:"flex-1"},_hoisted_4$J={class:"flex items-center gap-x-2.5"},_hoisted_5$B=_withScopeId$p(()=>vue.createElementVNode("div",{class:"font-bold"},"计算指标",-1)),_hoisted_6$w={key:0,class:"flex items-center gap-x-2.5"},_hoisted_7$s=_withScopeId$p(()=>vue.createElementVNode("div",{class:"font-bold"},"分组维度",-1)),_hoisted_8$p={class:"flex flex-col flex-1 overflow-hidden"},_hoisted_9$m={class:"relative flex-1"},_hoisted_10$k={class:"flex justify-center change-btns"},_sfc_main$1h=vue.defineComponent({__name:"IndicatorsView",props:{dynamicSearchForm:{default:()=>[]},result:{default:()=>{}},chartData:{default:null}},emits:["search-success"],setup(i,{emit:n}){const r=i,o=n,{proxy:a}=vue.getCurrentInstance(),{dynamicSearchForm:l,dynamicSearchFormat:s,dynamicSearchParams:u}=a.$aceDynamicSearch(a),c=vue.computed(()=>r.chartData),d=vue.ref(null),f=vue.ref(""),p=vue.ref([]),v=vue.ref(r.dynamicSearchForm),m=vue.ref(!1),{option:g,formatChart:_,chartType:y,setChartData:b,changeChartSeries:x,chartDataParams:C}=useCustomChart(),w={day:"按日",week:"按周",month:"按月",quarter:"按季度",year:"按年","":"按时分秒"};vue.onMounted(async()=>{await a.$baseHttp.post(`/api/ace-data-center/model-indicators-echarts/getEchartsTypes/${r.result.id}`).then(P=>{p.value=P.data,P.data.length&&(f.value=P.data[0].code,y.value=P.data[0].type)})}),vue.watch(f,async()=>{V()});const E=P=>{f.value!=P.code&&(g.value={},y.value=P.type,f.value=P.code,vue.unref(d)&&(vue.unref(d).type=""))},$=vue.ref(""),S=vue.ref(""),V=async()=>{var P,T,B,N,O,I,L;v.value=JSON.parse(JSON.stringify(r.dynamicSearchForm)),m.value=!0,g.value={},$.value="",S.value=["2","11"].includes(vue.unref(y))?"":[],r.chartData&&(C.value=r.chartData),await _(vue.unref(f)),$.value=(T=(P=vue.unref(g))==null?void 0:P.dataShow)==null?void 0:T.x,Array.isArray((N=(B=vue.unref(g))==null?void 0:B.dataShow)==null?void 0:N.y)?S.value=(O=vue.unref(g))==null?void 0:O.dataShow.y.filter(D=>{var F;return!(((F=vue.unref(g))==null?void 0:F.dataShow.hide)??[]).includes(D)}):S.value=(L=(I=vue.unref(g))==null?void 0:I.dataShow)==null?void 0:L.y,isMobile&&["1","3","5"].includes(vue.unref(y))&&!vue.unref(g).dataZoom&&(g.value.grid.bottom="10%",g.value.dataZoom=[{type:"slider",backgroundColor:"#eef8fd",fillerColor:"#14b1f8",borderColor:"#eef8fd",startValue:0,endValue:3,filterMode:"",showDetail:!1,width:"90%",height:10,handleSize:30,left:"5%",bottom:25},{type:"inside",zoomOnMouseWheel:!1,moveOnMouseWheel:!0,moveOnMouseMove:!0}]),setTimeout(()=>{m.value=!1},10)};vue.watch([$,S],async([P,T],[B,N])=>{var O;vue.unref(m)||(vue.unref(g).dataShow.x=P,vue.unref(g).dataShow.y=T,Array.isArray(T)&&(vue.unref(g).dataShow.hide=(O=vue.unref(g))==null?void 0:O.dataShow.y.filter(I=>vue.unref(c).y.includes(I.showLabel))),(P!=B||["2","7"].includes(vue.unref(y)))&&(g.value.dataset.source=await b(vue.unref(y),P,["2","7"].includes(vue.unref(y))?T:null),g.value.dataset.temp_source=JSON.parse(JSON.stringify(g.value.dataset.source)),v.value=JSON.parse(JSON.stringify(r.dynamicSearchForm)),vue.unref(d)&&(vue.unref(d).type="")),["xAxis","yAxis"].forEach(I=>{Array.isArray(g.value[I])&&(g.value[I]=g.value[I].filter(L=>L.name!="增长率"))}),x())},{deep:!0});const k=()=>{vue.unref(c).params.params=u(r.dynamicSearchForm),V(),o("search-success",vue.unref(c).params.params)};return(P,T)=>{var I;const B=vue.resolveComponent("aceDynamicSearch"),N=vue.resolveComponent("AppEmpty"),O=vue.resolveComponent("aceCustomChart");return vue.openBlock(),vue.createElementBlock("div",null,[r.dynamicSearchForm.length?(vue.openBlock(),vue.createBlock(B,{key:0,form:r.dynamicSearchForm,onSuccess:k},null,8,["form"])):vue.createCommentVNode("",!0),vue.unref(p).length?(vue.openBlock(),vue.createElementBlock("div",_hoisted_1$12,[vue.createElementVNode("div",_hoisted_2$T,[["9"].includes(vue.unref(y))?vue.createCommentVNode("",!0):(vue.openBlock(),vue.createElementBlock("div",_hoisted_3$L,[vue.createVNode(vue.unref(elementPlus.ElSkeleton),{loading:!((I=vue.unref(g))!=null&&I.dataShow),animated:""},{default:vue.withCtx(()=>[vue.createElementVNode("div",_hoisted_4$J,[_hoisted_5$B,vue.createElementVNode("div",null,[["2","11"].includes(vue.unref(y))?(vue.openBlock(),vue.createBlock(vue.unref(elementPlus.ElRadioGroup),{key:0,modelValue:vue.unref(S),"onUpdate:modelValue":T[0]||(T[0]=L=>vue.isRef(S)?S.value=L:null)},{default:vue.withCtx(()=>{var L;return[(vue.openBlock(!0),vue.createElementBlock(vue.Fragment,null,vue.renderList((((L=vue.unref(c))==null?void 0:L.y)??[]).filter(D=>D.aggType!="other"),D=>(vue.openBlock(),vue.createBlock(vue.unref(elementPlus.ElRadio),{key:D.showLabel,label:D.showLabel,value:D.showLabel},null,8,["label","value"]))),128))]}),_:1},8,["modelValue"])):["8"].includes(vue.unref(y))?(vue.openBlock(),vue.createBlock(vue.unref(elementPlus.ElCheckboxGroup),{key:1,modelValue:vue.unref(S),"onUpdate:modelValue":T[1]||(T[1]=L=>vue.isRef(S)?S.value=L:null)},{default:vue.withCtx(()=>{var L,D;return[(vue.openBlock(!0),vue.createElementBlock(vue.Fragment,null,vue.renderList([...((L=vue.unref(c))==null?void 0:L.y)??[],...(((D=vue.unref(c))==null?void 0:D.x)??[]).map(F=>({...F,showLabel:F.comment}))],F=>(vue.openBlock(),vue.createBlock(vue.unref(elementPlus.ElCheckbox),{key:F.showLabel,label:F.showLabel,value:F.showLabel},null,8,["label","value"]))),128))]}),_:1},8,["modelValue"])):(vue.openBlock(),vue.createBlock(vue.unref(elementPlus.ElCheckboxGroup),{key:2,modelValue:vue.unref(S),"onUpdate:modelValue":T[2]||(T[2]=L=>vue.isRef(S)?S.value=L:null)},{default:vue.withCtx(()=>{var L;return[(vue.openBlock(!0),vue.createElementBlock(vue.Fragment,null,vue.renderList((((L=vue.unref(c))==null?void 0:L.y)??[]).filter(D=>D.aggType!="other"),D=>(vue.openBlock(),vue.createBlock(vue.unref(elementPlus.ElCheckbox),{key:D.showLabel,label:D.showLabel,value:D.showLabel},null,8,["label","value"]))),128))]}),_:1},8,["modelValue"]))])]),["8"].includes(vue.unref(y))?vue.createCommentVNode("",!0):(vue.openBlock(),vue.createElementBlock("div",_hoisted_6$w,[_hoisted_7$s,vue.createElementVNode("div",null,[vue.createVNode(vue.unref(elementPlus.ElRadioGroup),{modelValue:vue.unref($),"onUpdate:modelValue":T[3]||(T[3]=L=>vue.isRef($)?$.value=L:null)},{default:vue.withCtx(()=>[(vue.openBlock(!0),vue.createElementBlock(vue.Fragment,null,vue.renderList(vue.unref(c).x,L=>(vue.openBlock(),vue.createBlock(vue.unref(elementPlus.ElRadio),{key:L.comment,label:L.comment,value:L.comment},{default:vue.withCtx(()=>[vue.createTextVNode(vue.toDisplayString(L.comment)+" ",1),w[L.dateFormatType]?(vue.openBlock(),vue.createElementBlock(vue.Fragment,{key:0},[vue.createTextVNode(" ("+vue.toDisplayString(w[L.dateFormatType])+") ",1)],64)):vue.createCommentVNode("",!0)]),_:2},1032,["label","value"]))),128))]),_:1},8,["modelValue"])])])),["3","1"].includes(vue.unref(y))&&vue.unref(g).dataShow.y.filter(L=>!vue.unref(g).dataShow.hide.includes(L)).length==1?(vue.openBlock(),vue.createBlock(_sfc_main$1i,{key:1,ref_key:"yoyRef",ref:d,chartData:P.chartData,option:vue.unref(g),search:vue.unref(v),originSearch:r.dynamicSearchForm,chartType:vue.unref(y)},null,8,["chartData","option","search","originSearch","chartType"])):vue.createCommentVNode("",!0)]),_:1},8,["loading"])]))]),vue.createElementVNode("div",_hoisted_8$p,[vue.createElementVNode("div",_hoisted_9$m,[vue.createVNode(vue.unref(elementPlus.ElSkeleton),{loading:vue.unref(m),animated:""},{default:vue.withCtx(()=>[vue.createVNode(O,{option:vue.unref(g),chartType:vue.unref(y),indicatorsId:r.result.id},null,8,["option","chartType","indicatorsId"])]),_:1},8,["loading"])]),vue.createElementVNode("div",_hoisted_10$k,[vue.createVNode(vue.unref(elementPlus.ElButtonGroup),null,{default:vue.withCtx(()=>[(vue.openBlock(!0),vue.createElementBlock(vue.Fragment,null,vue.renderList(vue.unref(p),L=>(vue.openBlock(),vue.createBlock(vue.unref(elementPlus.ElButton),{type:vue.unref(f)==L.code?"primary":"",key:L.type,onClick:D=>E(L)},{default:vue.withCtx(()=>{var D;return[vue.createElementVNode("i",{class:vue.normalizeClass((D=vue.unref(echartsTypeList)[L.type])==null?void 0:D.icon)},null,2)]}),_:2},1032,["type","onClick"]))),128))]),_:1})])])])):(vue.openBlock(),vue.createBlock(N,{key:1,description:"暂无数据"}))])}}}),IndicatorsView_vue_vue_type_style_index_0_scoped_3923290f_lang="",IndicatorsView=_export_sfc$2(_sfc_main$1h,[["__scopeId","data-v-3923290f"]]),_hoisted_1$11=["hidden"],_hoisted_2$S={class:"flex items-center w-full mb-4"},_hoisted_3$K={class:"flex justify-end flex-1"},_hoisted_4$I={class:"mb-4"},_hoisted_5$A={class:"flex mb-5 moudle-1"},_hoisted_6$v={class:"flex-1"},_hoisted_7$r={class:"flex items-center mt-2"},_hoisted_8$o={key:0,class:"mr-1 text-xl ri-error-warning-fill text-color-warning"},_hoisted_9$l={key:1,class:"mr-1 text-xl ri-checkbox-circle-fill text-color-success"},_hoisted_10$j={class:"ml-1"},_hoisted_11$g=vue.createElementVNode("div",{class:"w-10"},null,-1),_hoisted_12$e={class:"flex-1"},_hoisted_13$c={class:"items-center mt-2"},_hoisted_14$b=vue.createElementVNode("i",{class:"mr-1 text-xl ri-database-2-fill text-color-primary"},null,-1),_hoisted_15$5={key:1,class:"w-full"},_sfc_main$1g=vue.defineComponent({__name:"modelIndicators",props:{indicatorsId:{default:""},modelIndicatorsRules:{default:()=>[]}},emits:["click-design","rule-success"],setup(i,{expose:n,emit:r}){const o=i,a=r;vue.watch(()=>o.indicatorsId,()=>w());const{proxy:l}=vue.getCurrentInstance(),{dynamicSearchForm:s,dynamicSearchFormat:u,dynamicSearchParams:c}=l.$aceDynamicSearch(l),d=vue.ref(!0),f=vue.ref("basic"),p=vue.ref(!1),v=vue.ref(!1),m=vue.ref([]),g=vue.ref({}),_=vue.ref(null),y=vue.ref([]),b=vue.ref([]),x=vue.ref({}),C=({column:F})=>{vue.unref(x)[F.property]&&(F.order=vue.unref(x)[F.property])},w=async()=>{d.value=!0,f.value="basic",g.value={},k();const F=await l.$baseHttp.get(`/api/ace-data-center/model-indicators/detail?id=${o.indicatorsId}`);_.value=F.data,d.value=!1,x.value=JSON.parse(F.data.sortArgsJson??"{}"),s.value=u(JSON.parse(F.data.formConfJson??"[]")),S()},E=vue.ref(!1),$=vue.ref(!1),S=async(F="")=>{var U,G,J,te,ae,j,ee,le,se;F!="sort"&&(b.value=[],E.value=!0),$.value=!0;const M=Object.keys(vue.unref(x)).map(Z=>({field:Z,type:vue.unref(x)[Z]=="ascending"?"asc":"desc"})),R={aggArgsJson:(U=vue.unref(_))==null?void 0:U.aggArgsJson,groupArgsJson:(G=vue.unref(_))==null?void 0:G.groupArgsJson,sortArgsJson:JSON.stringify(M),params:vue.unref(O)??c(u(JSON.parse(((J=vue.unref(_))==null?void 0:J.formConfJson)??"[]"))),modelIndicatorsId:(te=vue.unref(_))==null?void 0:te.id,pageSize:(ae=vue.unref(_))==null?void 0:ae.pageSize,modelId:(j=vue.unref(_))==null?void 0:j.modelId},z=await l.$baseHttp.post("/api/ace-data-center/model-indicators/debug",R);z&&(y.value=((ee=z.data)==null?void 0:ee.records)??[],E.value=!1,$.value=!1,g.value={x:JSON.parse((le=vue.unref(_))==null?void 0:le.groupArgsJson),y:JSON.parse((se=vue.unref(_))==null?void 0:se.aggArgsJson),params:R},vue.unref(y).length&&F!="sort"&&(Object.keys(vue.unref(y)[0]).forEach(Z=>{b.value.push({label:Z,prop:Z,sortable:"custom"})}),b.value.push({label:"操作",prop:"button",width:"120px",fixed:"right",slot:!0})))},V=F=>{const{prop:M,order:R}=F;!R||vue.unref(x)[M]===R?delete vue.unref(x)[M]:vue.unref(x)[M]=R,S("sort")},k=async()=>{var M;m.value=[];const F=await fetch$1(l).getRule({current:1,size:100,businessType:"indicators",businessId:o.indicatorsId});m.value=((M=F.data)==null?void 0:M.records)??[],a("rule-success",m.value)},P=vue.ref(null),T=F=>{P.value=F,p.value=!0},B=F=>(F.modelIndicatorsId=vue.unref(_).id,F.row=vue.unref(P),F),N=()=>{v.value=!0},O=vue.ref(null),I=F=>{O.value=F,S()};vue.watch(p,F=>D(F)),vue.watch(v,F=>D(F));const L=vue.ref(!1),D=F=>{self!=top&&(L.value=F,window.parent.postMessage(F?"model-indicators-open":"model-indicators-close","*"))};return w(),n({init:w,result:_}),(F,M)=>{const R=vue.resolveComponent("AppResourceVisitor"),z=vue.resolveComponent("aceHeader"),U=vue.resolveComponent("AppTable"),G=vue.resolveComponent("AppEmpty"),J=vue.resolveComponent("aceDynamicList"),te=vue.resolveComponent("AppDrawer");return vue.unref(d)?(vue.openBlock(),vue.createBlock(vue.unref(elementPlus.ElSkeleton),{key:0,animated:""})):(vue.openBlock(),vue.createElementBlock("div",{key:1,class:"animated fadeIn",hidden:vue.unref(L)},[vue.createElementVNode("div",_hoisted_2$S,[vue.createElementVNode("div",null,[vue.createVNode(vue.unref(elementPlus.ElButtonGroup),null,{default:vue.withCtx(()=>[vue.createVNode(vue.unref(elementPlus.ElButton),{onClick:M[0]||(M[0]=ae=>f.value="basic"),type:vue.unref(f)=="basic"?"primary":""},{default:vue.withCtx(()=>[vue.createTextVNode(" 指标图表 ")]),_:1},8,["type"]),vue.createVNode(vue.unref(elementPlus.ElButton),{onClick:M[1]||(M[1]=ae=>f.value="data"),type:vue.unref(f)=="data"?"primary":""},{default:vue.withCtx(()=>[vue.createTextVNode(" 指标数据 ")]),_:1},8,["type"])]),_:1})]),vue.createElementVNode("div",_hoisted_3$K,[vue.createVNode(R,{businessType:"MODEL_INDICATORS",businessld:o.indicatorsId},null,8,["businessld"])])]),vue.withDirectives(vue.createElementVNode("div",null,[vue.createElementVNode("div",_hoisted_4$I,[vue.createVNode(vue.unref(elementPlus.ElSkeleton),{loading:vue.unref($),animated:""},{default:vue.withCtx(()=>[vue.createVNode(IndicatorsView,{dynamicSearchForm:vue.unref(s),result:vue.unref(_),chartData:vue.unref(g),onSearchSuccess:I},null,8,["dynamicSearchForm","result","chartData"])]),_:1},8,["loading"])])],512),[[vue.vShow,vue.unref(f)=="basic"]]),vue.withDirectives(vue.createElementVNode("div",null,[vue.createElementVNode("div",_hoisted_5$A,[vue.createElementVNode("div",_hoisted_6$v,[vue.createVNode(z,{title:"指标计算"}),vue.createElementVNode("div",_hoisted_7$r,[vue.unref(m).some(ae=>ae.rows>0)?(vue.openBlock(),vue.createElementBlock("i",_hoisted_8$o)):(vue.openBlock(),vue.createElementBlock("i",_hoisted_9$l)),vue.createElementVNode("span",_hoisted_10$j,vue.toDisplayString(vue.unref(_).remark),1)])]),_hoisted_11$g,vue.createElementVNode("div",_hoisted_12$e,[vue.createVNode(z,{title:"数据来源"}),vue.createElementVNode("div",_hoisted_13$c,[_hoisted_14$b,vue.createTextVNode(" 重构仓模型数据 | "+vue.toDisplayString(vue.unref(_).modelName)+"【 ",1),vue.createElementVNode("span",{class:"cursor-pointer text-color-primary",onClick:N},vue.toDisplayString(vue.unref(_).modelCode),1),vue.createTextVNode(" 】 ")])])]),vue.createVNode(vue.unref(elementPlus.ElSkeleton),{loading:vue.unref(E),animated:""},{default:vue.withCtx(()=>[vue.unref(b).length?(vue.openBlock(),vue.createBlock(U,{key:0,maxHeight:"400px",tableData:vue.unref(b),list:vue.unref(y),loading:!1,headerCellClassName:C,onSortChange:V},{button:vue.withCtx(({row:ae})=>[vue.createVNode(vue.unref(elementPlus.ElLink),{type:"primary",onClick:j=>T(ae)},{default:vue.withCtx(()=>[vue.createTextVNode("查看明细")]),_:2},1032,["onClick"])]),_:1},8,["tableData","list"])):(vue.openBlock(),vue.createElementBlock("div",_hoisted_15$5,[vue.createVNode(G,{description:"暂无数据",class:"mt-4"})]))]),_:1},8,["loading"])],512),[[vue.vShow,vue.unref(f)=="data"]]),vue.createVNode(_sfc_main$1l,{ruleList:vue.unref(m)},null,8,["ruleList"]),vue.createVNode(te,{modelValue:vue.unref(p),"onUpdate:modelValue":M[2]||(M[2]=ae=>vue.isRef(p)?p.value=ae:null),title:"查看明细",size:"90%"},{default:vue.withCtx(()=>[vue.createVNode(z,{title:"统计:",class:"mb-2"}),vue.createVNode(U,{height:null,tableData:Object.keys(vue.unref(P)).map(ae=>({label:ae,prop:ae})),list:[vue.unref(P)],loading:!1},null,8,["tableData","list"]),vue.createVNode(z,{title:"钻取明细:",class:"mt-4 mb-2"}),vue.createVNode(J,{id:vue.unref(_).modelId,keyName:"modelIndicatorsId",title:vue.unref(_).modelName,isDownLoad:vue.unref(isMobile),url:"/api/ace-data-center/model-indicators/drilling",formatParamsFunc:B},null,8,["id","title","isDownLoad"])]),_:1},8,["modelValue"]),vue.createVNode(te,{modelValue:vue.unref(v),"onUpdate:modelValue":M[3]||(M[3]=ae=>vue.isRef(v)?v.value=ae:null),title:"模型数据",size:"90%"},{default:vue.withCtx(()=>[vue.createVNode(J,{id:vue.unref(_).modelId,title:vue.unref(_).modelName},null,8,["id","title"])]),_:1},8,["modelValue"])],8,_hoisted_1$11))}}}),_hoisted_1$10=vue.createElementVNode("i",{class:"ri-search-line"},null,-1),_hoisted_2$R={class:"mt-3"},_hoisted_3$J={key:1,class:"mr-1 -ml-5 text-base ri-edit-circle-fill text-color-primary"},_sfc_main$1f=vue.defineComponent({__name:"modelMenu",props:{type:{default:""}},emits:["node-click","change-type"],setup(i,{expose:n,emit:r}){const o=i,{proxy:a}=vue.getCurrentInstance(),l=vue.ref(""),s=vue.ref(null),u=r;vue.watch(l,y=>{vue.unref(s).filter(y)});const c=(y,b)=>y?b.modelName.includes(y):!0,d=vue.ref([]),f=vue.ref([]),p=vue.ref([]),v=vue.ref(!0),m=vue.computed(()=>o.type=="ODS"?vue.unref(d):o.type=="DWD"?vue.unref(f):vue.unref(p)),g=()=>{Promise.all([fetch$1(a).loadModelMenu({modelLayer:"ODS"}),fetch$1(a).loadModelMenu({modelLayer:"DWD"}),fetch$1(a).loadModelMenu({modelLayer:"ODSVIEW"})]).then(y=>{const b=y[0].data,x=y[1].data,C=y[2].data;d.value=Object.keys(b).map(w=>({modelName:w,id:w,children:b[w]})),f.value=Object.keys(x).map(w=>({modelName:w,id:w,children:x[w]})),p.value=Object.keys(C).map(w=>({modelName:w,id:w,children:C[w]})),v.value=!1})};g();const _=y=>{if(y.modelCode){if(o.type=="ODS"){u("node-click",y);return}Array.isArray(y.children)||u("node-click",y)}};return n({init:g}),(y,b)=>{const x=vue.resolveComponent("AppEmpty");return vue.openBlock(),vue.createElementBlock(vue.Fragment,null,[vue.createVNode(vue.unref(elementPlus.ElInput),{placeholder:"请输入内容",clearable:"",modelValue:vue.unref(l),"onUpdate:modelValue":b[0]||(b[0]=C=>vue.isRef(l)?l.value=C:null)},{prefix:vue.withCtx(()=>[_hoisted_1$10]),_:1},8,["modelValue"]),vue.createElementVNode("div",_hoisted_2$R,[vue.unref(v)?(vue.openBlock(),vue.createBlock(vue.unref(elementPlus.ElSkeleton),{key:0,animated:"",count:2})):(vue.openBlock(),vue.createBlock(vue.unref(elementPlus.ElTree),{key:1,class:"animated fadeIn",ref_key:"treeRef",ref:s,data:vue.unref(m),"empty-text":"暂无数据","default-expand-all":"","node-key":"id","highlight-current":"","filter-node-method":c,onNodeClick:_},{default:vue.withCtx(({node:C,data:w})=>[C.level!=1||y.type=="ODS"?(vue.openBlock(),vue.createElementBlock(vue.Fragment,{key:0},[w.modelCode&&w.openForm!=2?(vue.openBlock(),vue.createElementBlock("i",{key:0,class:vue.normalizeClass(["mr-1 -ml-5 text-base ri-checkbox-circle-fill",[w.publishStatus==2?"text-color-success":"text-color-info"]])},null,2)):vue.createCommentVNode("",!0)],64)):vue.createCommentVNode("",!0),w.openForm==2?(vue.openBlock(),vue.createElementBlock("i",_hoisted_3$J)):vue.createCommentVNode("",!0),vue.createElementVNode("span",{class:vue.normalizeClass({"font-bold":C.level==1})},vue.toDisplayString(w.modelName),3),vue.renderSlot(y.$slots,"default",{element:w})]),empty:vue.withCtx(()=>[vue.createVNode(x,{description:"暂无数据"})]),_:3},8,["data"]))])],64)}}}),_hoisted_1$$={class:"mb-3"},_hoisted_2$Q={style:{height:"calc(100vh - 100px)"},class:"overflow-y-auto"},_sfc_main$1e=vue.defineComponent({__name:"modelIndicatorsAdd",emits:["click-node"],setup(i,{expose:n,emit:r}){const o=r,{proxy:a}=vue.getCurrentInstance(),l=vue.ref(!1),s=vue.ref(),u=vue.ref([{label:"源数据",value:"ODS",rule:"VIEW_ODS",disabled:!0},{label:"源视图",value:"ODSVIEW",rule:"VIEW_ODSVIEW",disabled:!0},{label:"整合数据",value:"DWD",rule:"VIEW_DWD",disabled:!0}]);fetch$1(a).getCurrFunc("MODEL").then(p=>{vue.unref(u).forEach(v=>{v.disabled=!p.data.includes(v.rule),!vue.unref(s)&&!v.disabled&&(s.value=v.value)})});const c=p=>{s.value=p},d=()=>{l.value=!0},f=p=>{o("click-node",p),l.value=!1};return n({init:d}),(p,v)=>{const m=vue.resolveComponent("AppDrawer");return vue.openBlock(),vue.createBlock(m,{modelValue:vue.unref(l),"onUpdate:modelValue":v[0]||(v[0]=g=>vue.isRef(l)?l.value=g:null),title:"选择要分析的数据",size:"400px"},{default:vue.withCtx(()=>[vue.createElementVNode("div",_hoisted_1$$,[vue.createVNode(vue.unref(elementPlus.ElButtonGroup),null,{default:vue.withCtx(()=>[(vue.openBlock(!0),vue.createElementBlock(vue.Fragment,null,vue.renderList(vue.unref(u),g=>(vue.openBlock(),vue.createBlock(vue.unref(elementPlus.ElButton),{type:vue.unref(s)==g.value?"primary":"",key:g.value,disabled:g.disabled,onClick:_=>c(g.value)},{default:vue.withCtx(()=>[vue.createTextVNode(vue.toDisplayString(g.label),1)]),_:2},1032,["type","disabled","onClick"]))),128))]),_:1})]),vue.createElementVNode("div",_hoisted_2$Q,[vue.createVNode(_sfc_main$1f,{ref:"menuRef",type:vue.unref(s),onNodeClick:f},null,8,["type"])])]),_:1},8,["modelValue"])}}}),_hoisted_1$_=vue.createElementVNode("div",{class:"flex justify-end flex-1"},null,-1),_hoisted_2$P={class:"whitespace-nowrap ml-2.5"},_hoisted_3$I=vue.createElementVNode("i",{class:"mr-1 ri-add-circle-line"},null,-1),_hoisted_4$H=["onClick"],_hoisted_5$z=vue.createElementVNode("i",{class:"ri-edit-box-line"},null,-1),_hoisted_6$u={key:0,class:"flex items-center justify-center h-full"},_sfc_main$1d=vue.defineComponent({__name:"index",props:{isCustom:{type:Boolean,default:!1},element:{default:null},tempId:{default:""}},emits:["close-design"],setup(i,{emit:n}){var C,w;const r=i,o=n,{proxy:a}=vue.getCurrentInstance();vue.inject("local");const l=vue.ref(null),s=vue.ref(null),u=vue.ref(null),c=vue.ref(null),d=vue.ref(r.element??{});vue.provide("modelEle",d),vue.provide("getListModelIndicators",()=>{});const f=vue.ref([{label:"指标分析",value:"zbfx"},{label:"指标全景",value:"zbqj",disabled:!0}]),p=vue.ref(vue.unref(f)[0].value),v=vue.ref(((C=r==null?void 0:r.element)==null?void 0:C.id)??"");fetch$1(a).getCurrFunc("INDICATORS").then(E=>{vue.unref(f).find($=>$.value=="zbqj").disabled=!E.data.includes("INDICATORS_VIEW")});const m=vue.ref([]);fetch$1(a).getCurrFunc("MODEL_INDICATORS").then(E=>{m.value=E.data});const g=vue.ref(((w=r==null?void 0:r.element)==null?void 0:w.businessType)??""),_=E=>{v.value="",g.value=E.type,setTimeout(()=>{v.value=E.id},100)},y=E=>{d.value=E,vue.unref(l).init()},b=async E=>{const $=await a.$baseHttp.get(`/api/ace-data-center/model-indicators/detail?id=${E}`);$&&vue.nextTick(()=>{setTimeout(()=>{const{modelId:S,modelName:V,modelCode:k}=$.data;d.value={id:S,modelName:V,modelCode:k},vue.unref(l).init(E)},300)})},x=()=>{vue.unref(v)&&(o("close-design",vue.unref(v)),vue.unref(u)&&vue.unref(u).init()),vue.unref(s)&&vue.unref(s).init()};return(E,$)=>{const S=vue.resolveComponent("AppEmpty");return vue.openBlock(),vue.createBlock(vue.unref(elementPlus.ElContainer),{class:"h-full"},{default:vue.withCtx(()=>[vue.createVNode(vue.unref(elementPlus.ElHeader),{style:{height:"auto",padding:"0"},class:"flex items-center w-full mb-3"},{default:vue.withCtx(()=>[E.isCustom?vue.createCommentVNode("",!0):(vue.openBlock(),vue.createBlock(vue.unref(elementPlus.ElButtonGroup),{key:0},{default:vue.withCtx(()=>[(vue.openBlock(!0),vue.createElementBlock(vue.Fragment,null,vue.renderList(vue.unref(f),V=>(vue.openBlock(),vue.createBlock(vue.unref(elementPlus.ElButton),{type:vue.unref(p)==V.value?"primary":"",key:V.value,disabled:V.disabled,onClick:k=>p.value=V.value},{default:vue.withCtx(()=>[vue.createTextVNode(vue.toDisplayString(V.label),1)]),_:2},1032,["type","disabled","onClick"]))),128))]),_:1})),_hoisted_1$_]),_:1}),vue.withDirectives(vue.createVNode(vue.unref(elementPlus.ElContainer),{class:"overflow-hidden"},{default:vue.withCtx(()=>[E.isCustom?vue.createCommentVNode("",!0):(vue.openBlock(),vue.createBlock(vue.unref(elementPlus.ElAside),{key:0,class:"pr-5 mr-5"},{default:vue.withCtx(()=>[vue.createVNode(_sfc_main$1m,{onNodeClick:_,tempId:E.tempId||vue.unref(v),ref_key:"menuRef",ref:s},{search:vue.withCtx(()=>[vue.createElementVNode("div",_hoisted_2$P,[vue.unref(m).includes("STATISTICAL_ANALYSIS")?(vue.openBlock(),vue.createBlock(vue.unref(elementPlus.ElButton),{key:0,type:"primary",onClick:$[0]||($[0]=V=>vue.unref(c).init())},{default:vue.withCtx(()=>[_hoisted_3$I,vue.createTextVNode(" 新增指标 ")]),_:1})):vue.createCommentVNode("",!0)])]),"menu-item":vue.withCtx(({data:V})=>[vue.unref(m).includes("RELATED_INDICATORS")&&V.type!="INDICATORS"?(vue.openBlock(),vue.createElementBlock("div",{key:0,class:"ml-4 mr-2 cursor-pointer text-color-warning",onClick:vue.withModifiers(k=>b(V.id),["stop"])},[_hoisted_5$z,vue.createTextVNode(" 编辑 ")],8,_hoisted_4$H)):vue.createCommentVNode("",!0)]),_:1},8,["tempId"])]),_:1})),vue.createVNode(vue.unref(elementPlus.ElMain),null,{default:vue.withCtx(()=>[vue.unref(v)?(vue.openBlock(),vue.createElementBlock(vue.Fragment,{key:1},[vue.unref(g)=="INDICATORS"?(vue.openBlock(),vue.createBlock(aceIndicatorSystemPreview,{key:0,indicatorsId:vue.unref(v)},null,8,["indicatorsId"])):vue.createCommentVNode("",!0),vue.unref(g)=="MODEL_INDICATORS"?(vue.openBlock(),vue.createBlock(_sfc_main$1g,{key:1,onClickDesign:b,modelIndicatorsRules:vue.unref(m),indicatorsId:vue.unref(v),ref_key:"modelIndicatorsRef",ref:u},null,8,["modelIndicatorsRules","indicatorsId"])):vue.createCommentVNode("",!0)],64)):(vue.openBlock(),vue.createElementBlock("div",_hoisted_6$u,[vue.createVNode(S,{description:"请选择对应指标"})]))]),_:1})]),_:1},512),[[vue.vShow,vue.unref(p)=="zbfx"]]),vue.unref(p)=="zbqj"?(vue.openBlock(),vue.createBlock(vue.unref(elementPlus.ElMain),{key:0},{default:vue.withCtx(()=>[vue.createVNode(_sfc_main$1j)]),_:1})):vue.createCommentVNode("",!0),vue.createVNode(aceIndicatorDesign,{ref_key:"designRef",ref:l,onClose:x},null,512),vue.createVNode(_sfc_main$1e,{ref_key:"modelIndicatorsAddRef",ref:c,onClickNode:y},null,512)]),_:1})}}}),_withScopeId$o=i=>(vue.pushScopeId("data-v-e52b7096"),i=i(),vue.popScopeId(),i),_hoisted_1$Z={class:"flex flex-col h-full"},_hoisted_2$O=_withScopeId$o(()=>vue.createElementVNode("i",{class:"mr-1 ri-add-circle-line"},null,-1)),_hoisted_3$H={class:"flex-1 mt-3 overflow-y-auto card-container"},_hoisted_4$G={key:0,class:"flex items-center justify-center h-full"},_hoisted_5$y=["onClick"],_hoisted_6$t={class:"flex items-center"},_hoisted_7$q=_withScopeId$o(()=>vue.createElementVNode("i",{class:"mr-1 ri-database-line"},null,-1)),_hoisted_8$n={class:"font-bold"},_hoisted_9$k={class:"flex items-center justify-between w-4/5 mt-3 ml-auto mr-auto"},_hoisted_10$i={class:"flex items-center"},_hoisted_11$f=_withScopeId$o(()=>vue.createElementVNode("i",{class:"mr-1 ri-checkbox-circle-fill text-color-success"},null,-1)),_hoisted_12$d=_withScopeId$o(()=>vue.createElementVNode("div",{class:"text-color-info"},"|",-1)),_hoisted_13$b={class:"flex justify-end mt-3 text-xs text-color-info pb"},_hoisted_14$a={class:"w-4/5 overflow-hidden whitespace-nowrap text-ellipsis"},_sfc_main$1c=vue.defineComponent({__name:"menu",emits:["node-click"],setup(i,{expose:n,emit:r}){const{proxy:o}=vue.getCurrentInstance(),{dataSourceSubmit:a,testConnect:l,loadDataSourceMenu:s}=fetch$1(o).dbImport,{setFormValue:u,getFormValue:c}=o.$globalHooks.useForm(),{openMessage:d}=o.$globalHooks.useMessage(),f=o.$globalDict,p=r,v=vue.ref([]),m=vue.ref(!0),g=()=>{v.value=[],m.value=!0,s().then(S=>{m.value=!1,v.value=S.data??[],S.data.length&&vue.unref(E)==""&&$(S.data[0])})};g();const _=vue.reactive([{name:"数据源名称",type:FieldType.Text,fieldName:"name",value:"",required:!0},{name:"数据源类型",type:FieldType.Select,fieldName:"dataSourceType",value:"",dict:"storeType",required:!0,changeFunc:S=>{if(!S.value)return;let V=f.dataSourceUrlDemo.find(k=>k.label.toLowerCase()===S.value.toLowerCase());_.find(k=>k.fieldName==="dataSourceUrlDemo").value=(V==null?void 0:V.value)??""}},{name:"数据源链接地址",type:FieldType.Textarea,fieldName:"dataSourceUrl",value:"",required:!0},{name:"链接示例",type:FieldType.Slot,fieldName:"dataSourceUrlDemo",value:""},{name:"数据库用户名",type:FieldType.Text,fieldName:"connectUserName",value:"",required:!0},{name:"数据库用密码",type:FieldType.Password,fieldName:"connectPassword",value:"",required:!0}]),y=vue.ref(!1),b=()=>{u({},_),y.value=!0},x=S=>{_.find(V=>V.fieldName==="dataSourceUrl").value=S.value},C=async()=>{const{params:S,error:V}=c(_);V.length>0||!await a(S)||(y.value=!1,d({type:"success",message:"操作成功"}),g())},w=async()=>{const{params:S,error:V}=c(_);V.length>0||!await l(S)||d({type:"success",message:"数据库链接成功"})},E=vue.ref(""),$=S=>{vue.unref(E)!=S.dataSourceId&&(E.value=S.dataSourceId,p("node-click",S))};return n({initMenu:g}),(S,V)=>{const k=vue.resolveComponent("aceHeader"),P=vue.resolveComponent("AppEmpty"),T=vue.resolveComponent("AppForm"),B=vue.resolveComponent("AppDialog");return vue.openBlock(),vue.createElementBlock("div",_hoisted_1$Z,[vue.createVNode(k,{title:"数据源"},{default:vue.withCtx(()=>[vue.createVNode(vue.unref(elementPlus.ElButton),{type:"primary",size:"small",onClick:b},{default:vue.withCtx(()=>[_hoisted_2$O,vue.createTextVNode(" 新增 ")]),_:1})]),_:1}),vue.createElementVNode("div",_hoisted_3$H,[vue.createVNode(vue.unref(elementPlus.ElSkeleton),{loading:vue.unref(m),animated:""},{default:vue.withCtx(()=>[vue.unref(v).length?(vue.openBlock(!0),vue.createElementBlock(vue.Fragment,{key:1},vue.renderList(vue.unref(v),N=>(vue.openBlock(),vue.createElementBlock("div",{key:N.id,class:vue.normalizeClass(["item",{active:vue.unref(E)==N.dataSourceId}]),onClick:O=>$(N)},[vue.createElementVNode("div",_hoisted_6$t,[_hoisted_7$q,vue.createElementVNode("span",_hoisted_8$n,vue.toDisplayString(N.dataSourceComment),1)]),vue.createElementVNode("div",_hoisted_9$k,[vue.createElementVNode("div",_hoisted_10$i,[_hoisted_11$f,vue.createTextVNode(" 已同步 "),vue.createElementVNode("strong",null,vue.toDisplayString(N.synchronizedTableCount),1)]),_hoisted_12$d,vue.createElementVNode("div",null,[vue.createTextVNode(" 总表数 "),vue.createElementVNode("strong",null,vue.toDisplayString(N.tableCount),1)])]),vue.createElementVNode("div",_hoisted_13$b,vue.toDisplayString(N.version),1)],10,_hoisted_5$y))),128)):(vue.openBlock(),vue.createElementBlock("div",_hoisted_4$G,[vue.createVNode(P,{description:"暂无数据源"})]))]),_:1},8,["loading"])]),vue.createVNode(B,{modelValue:vue.unref(y),"onUpdate:modelValue":V[1]||(V[1]=N=>vue.isRef(y)?y.value=N:null),title:"新增接入数据源",size:700},{footer:vue.withCtx(()=>[vue.createVNode(vue.unref(elementPlus.ElButton),{style:{"margin-right":"auto"},type:"success",onClick:w},{default:vue.withCtx(()=>[vue.createTextVNode(" 测试链接 ")]),_:1}),vue.createVNode(vue.unref(elementPlus.ElButton),{class:"ml-3",type:"primary",onClick:C},{default:vue.withCtx(()=>[vue.createTextVNode("保存")]),_:1}),vue.createVNode(vue.unref(elementPlus.ElButton),{class:"ml-3",onClick:V[0]||(V[0]=N=>y.value=!1)},{default:vue.withCtx(()=>[vue.createTextVNode("取消")]),_:1})]),default:vue.withCtx(()=>[vue.createVNode(T,{form:vue.unref(_),col:1,labelWidth:120},{dataSourceUrlDemo:vue.withCtx(({element:N})=>[vue.createVNode(vue.unref(elementPlus.ElTooltip),{content:N.value},{default:vue.withCtx(()=>[vue.createElementVNode("div",_hoisted_14$a,vue.toDisplayString(N.value),1)]),_:2},1032,["content"]),vue.createVNode(vue.unref(elementPlus.ElButton),{type:"primary",onClick:O=>x(N)},{default:vue.withCtx(()=>[vue.createTextVNode("复制")]),_:2},1032,["onClick"])]),_:1},8,["form"])]),_:1},8,["modelValue"])])}}}),menu_vue_vue_type_style_index_0_scoped_e52b7096_lang="",Menu$2=_export_sfc$2(_sfc_main$1c,[["__scopeId","data-v-e52b7096"]]),_sfc_main$1b=vue.defineComponent({__name:"sourceTableData",setup(i,{expose:n}){const r=vue.ref(!1),o=vue.ref(null),a=vue.ref(""),l=vue.ref([]),s=f=>{l.value=[],(f==null?void 0:f.data.length)>0&&(l.value=Object.keys(f.data[0]).filter(p=>p!="pageIndex").map(p=>({label:p,prop:p})))},u=vue.ref({}),c=f=>Object.assign(f,vue.unref(u));return n({init:(f,p)=>{vue.unref(u).dataSourceId=f,vue.unref(u).sourceTableCode=p,r.value=!0,a.value="/api/ace-data-center/data-source/sourceDataPage"}}),(f,p)=>{const v=vue.resolveComponent("AppList"),m=vue.resolveComponent("AppDrawer");return vue.openBlock(),vue.createBlock(m,{modelValue:vue.unref(r),"onUpdate:modelValue":p[0]||(p[0]=g=>vue.isRef(r)?r.value=g:null),title:"数据源明细",size:"90%"},{default:vue.withCtx(()=>[vue.createVNode(v,{tableData:vue.unref(l),url:vue.unref(a),ref_key:"appList",ref:o,formatParamsFunc:c,onSuccess:s,methods:"post"},null,8,["tableData","url"])]),_:1},8,["modelValue"])}}}),_hoisted_1$Y={class:"mt-2"},_sfc_main$1a=vue.defineComponent({__name:"setting",emits:["refresh"],setup(i,{expose:n,emit:r}){const{proxy:o}=vue.getCurrentInstance(),{setFormValue:a,getFormValue:l}=o.$globalHooks.useForm(),{openMessage:s}=o.$globalHooks.useMessage(),{submitDefaultDbExtract:u}=fetch$1(o).dbImport,c=r,d=vue.ref(!1),f=vue.ref(!1),p=vue.ref(null),v=vue.reactive([{name:"方案名称",type:FieldType.Text,fieldName:"extractName",value:"",required:!0},{name:"抽取方式",type:FieldType.Radio,fieldName:"extractType",value:"",required:!0,options:[{label:"全量抽取",value:"1"},{label:"增量抽取",value:"2"}],changeFunc:b=>{v.find(C=>C.fieldName=="incrementalField").hide=b.value!=2;const x=v.find(C=>C.fieldName=="clearBeforeExt");x.hide=b.value!=1,b.isChange&&b.value!=1&&(x.value="0")}},{name:"清空历史数据",type:FieldType.Radio,fieldName:"clearBeforeExt",value:"",required:!0,options:[{label:"是",value:"1"},{label:"否",value:"0"}],defVal:"0"},{name:"增量字段",type:FieldType.Select,fieldName:"incrementalField",value:"",required:!0,tip:"该字段必须为本模型字段,并且是SQL结果集中存在的字段"},{name:"taskDefinedId",type:FieldType.Text,fieldName:"taskDefinedId",hide:!0},{name:"id",type:FieldType.Text,fieldName:"id",hide:!0}]),m=vue.ref(null),g=vue.ref({}),_=async b=>{g.value=b,f.value=!1;const x=await o.$baseHttp.get("/api/ace-data-center/model-attribute/allModelAttribute",{params:{modelId:b.modelId,projectId:o.$baseGetCurrentProjectId()},headers:{loading:!0}});v.find(C=>C.fieldName=="incrementalField").options=x.data.map(C=>({...C,label:`${C.attributeCode}(${C.attributeComment||C.attributeCode})`,value:C.attributeCode})),d.value=!0,vue.nextTick(()=>{a({...b,extractName:b.extractName??"增量抽取"},v),b!=null&&b.taskDefined&&(f.value=!0),vue.unref(p).init((b==null?void 0:b.taskDefined)??{}),m.value=(b==null?void 0:b.taskDefined)??null})},y=async()=>{const{params:b,error:x}=l(v);if(x.length>0)return;if(vue.unref(f)){const{params:w,error:E}=vue.unref(p).getForm();if(E.length>0)return;b.taskDefined={...vue.unref(m)??{},...w}}b.dataSourceId=vue.unref(g).dataSourceId,b.modelId=vue.unref(g).modelId,b.streamType="STANDARD",await u(b)&&(s({type:"success",message:"操作成功"}),d.value=!1,c("refresh"))};return n({init:_}),(b,x)=>{const C=vue.resolveComponent("AppForm"),w=vue.resolveComponent("aceHeader"),E=vue.resolveComponent("AppTaskDesign"),$=vue.resolveComponent("AppDialog");return vue.openBlock(),vue.createBlock($,{modelValue:vue.unref(d),"onUpdate:modelValue":x[2]||(x[2]=S=>vue.isRef(d)?d.value=S:null),title:"配置",size:800},{footer:vue.withCtx(()=>[vue.createVNode(vue.unref(elementPlus.ElButton),{class:"ml-3",type:"primary",onClick:y},{default:vue.withCtx(()=>[vue.createTextVNode("保存")]),_:1}),vue.createVNode(vue.unref(elementPlus.ElButton),{class:"ml-3",onClick:x[1]||(x[1]=S=>d.value=!1)},{default:vue.withCtx(()=>[vue.createTextVNode("取消")]),_:1})]),default:vue.withCtx(()=>[vue.createVNode(C,{form:vue.unref(v)},null,8,["form"]),vue.createElementVNode("div",_hoisted_1$Y,[vue.createVNode(w,{title:"作业配置",class:"mb-2"},{left:vue.withCtx(()=>[vue.createVNode(vue.unref(elementPlus.ElCheckbox),{class:"ml-2",modelValue:vue.unref(f),"onUpdate:modelValue":x[0]||(x[0]=S=>vue.isRef(f)?f.value=S:null)},{default:vue.withCtx(()=>[vue.createTextVNode("作业配置")]),_:1},8,["modelValue"])]),_:1}),vue.withDirectives(vue.createElementVNode("div",null,[vue.createVNode(E,{ref_key:"taskDesignRef",ref:p},null,512)],512),[[vue.vShow,vue.unref(f)]])])]),_:1},8,["modelValue"])}}}),_hoisted_1$X=vue.createElementVNode("i",{class:"mr-2 ri-exchange-line"},null,-1),_hoisted_2$N=vue.createElementVNode("i",{class:"mr-2 ri-refresh-line"},null,-1),_hoisted_3$G=vue.createElementVNode("div",null,null,-1),_hoisted_4$F=vue.createElementVNode("i",{class:"mr-2 ri-delete-bin-line"},null,-1),_sfc_main$19=vue.defineComponent({__name:"model-extract-log",emits:["success"],setup(i,{expose:n,emit:r}){const{proxy:o}=vue.getCurrentInstance(),{openMessage:a}=o.$globalHooks.useMessage(),l=r,s=vue.ref(!1),u=vue.ref(null),c=vue.ref(""),d=vue.ref([]),f=v=>{const{businessId:m,businessType:g="file_extract",ajaxUrl:_="",table:y}=v;d.value=y||[{label:"批次号",prop:"batchNo"},{label:"日期",prop:"createTime"},{label:"文件名",prop:"file",slot:!0},{label:"抽取方式",prop:"createTime",func:b=>{var x;return((x=JSON.parse(b.businessSnapshot||"{}"))==null?void 0:x.extractType)==2?"覆盖":"追加"}},{label:"数据总数",prop:"totalNum"},{label:"成功数",prop:"successNum"},{label:"失败数",prop:"failNum"},{label:"协同参数",prop:"collaborateValue"},{label:"操作",prop:"action",slot:!0,fixed:"right"}],c.value=_||`/api/ace-data-center/extract-log/list?descs=create_time&businessId=${m}&businessType=${g}`,s.value=!0},p=async(v,m)=>{switch(v){case"refresh":{if(!await o.$baseHttp.post(`/api/ace-data-center/extract-log/updateSuccessTotal/${m.id}`,{},{headers:{loading:!0}}))return;a({type:"success",message:"操作成功"}),vue.unref(u).getData(),l("success")}break;case"delete":o.$baseConfirm({content:"删除数据可能影响指标统计,是否确认删除?",callConfirm:async()=>{await o.$baseHttp.post(`/api/ace-data-center/extract-log/deleteModelData/${m.id}`,{},{headers:{loading:!0}})&&(a({type:"success",message:"操作成功"}),vue.unref(u).getData(),l("success"))}});break;case"run":o.$baseConfirm({content:"重跑数据会先删除本批次数据,然后新建立一个批次任务执行,是否继续执行?",callConfirm:async()=>{await o.$baseHttp.post(`/api/ace-data-center/extract-log/reRunTeamworkDbExtractBy/${m.id}`,{},{headers:{loading:!0}})&&(a({type:"success",message:"操作成功"}),vue.unref(u).getData(),l("success"))}});break;case"download":{const g=JSON.parse((m==null?void 0:m.businessSnapshot)??"{}");window.open(g.fileUrl)}break}};return n({init:f}),(v,m)=>{const g=vue.resolveComponent("AppList"),_=vue.resolveComponent("AppDrawer");return vue.openBlock(),vue.createBlock(_,{modelValue:vue.unref(s),"onUpdate:modelValue":m[0]||(m[0]=y=>vue.isRef(s)?s.value=y:null),title:"抽取日志",size:"90%"},{default:vue.withCtx(()=>[vue.createVNode(g,{tableData:vue.unref(d),url:vue.unref(c),ref_key:"appList",ref:u},{file:vue.withCtx(({row:y})=>[vue.createVNode(vue.unref(elementPlus.ElLink),{type:"primary",onClick:b=>p("download",y)},{default:vue.withCtx(()=>{var b;return[vue.createTextVNode(vue.toDisplayString((b=JSON.parse(y.businessSnapshot??"{}"))==null?void 0:b.fileName),1)]}),_:2},1032,["onClick"])]),action:vue.withCtx(({row:y})=>{var b;return[((b=JSON.parse(y.businessSnapshot||"{}"))==null?void 0:b.extractType)==3?(vue.openBlock(),vue.createBlock(vue.unref(elementPlus.ElLink),{key:0,type:"primary",class:"mr-2",onClick:x=>p("run",y)},{default:vue.withCtx(()=>[_hoisted_1$X,vue.createTextVNode(" 重跑 ")]),_:2},1032,["onClick"])):vue.createCommentVNode("",!0),vue.createVNode(vue.unref(elementPlus.ElLink),{type:"primary",onClick:x=>p("refresh",y)},{default:vue.withCtx(()=>[_hoisted_2$N,vue.createTextVNode(" 刷新 ")]),_:2},1032,["onClick"]),_hoisted_3$G,vue.createVNode(vue.unref(elementPlus.ElLink),{type:"danger",onClick:x=>p("delete",y)},{default:vue.withCtx(()=>[_hoisted_4$F,vue.createTextVNode(" 删除本批次数据 ")]),_:2},1032,["onClick"])]}),_:1},8,["tableData","url"])]),_:1},8,["modelValue"])}}}),_hoisted_1$W={class:"flex flex-col h-full overflow-hidden"},_hoisted_2$M={class:"flex flex-col flex-1 mt-3 overflow-hidden"},_hoisted_3$F={class:"app-search"},_hoisted_4$E=vue.createElementVNode("i",{class:"mr-1 ri-search-line"},null,-1),_hoisted_5$x={class:"flex flex-1 overflow-hidden"},_hoisted_6$s=["onClick"],_hoisted_7$p={class:"flex justify-end mt-3"},_hoisted_8$m={class:"flex justify-end mb-2"},_hoisted_9$j=vue.createElementVNode("i",{class:"mr-1 ri-add-line"},null,-1),_sfc_main$18=vue.defineComponent({__name:"view",emits:["refresh"],setup(i,{expose:n,emit:r}){const{proxy:o}=vue.getCurrentInstance(),a=vue.inject("modelEle"),{setFormValue:l,getFormValue:s}=o.$globalHooks.useForm(),{openMessage:u}=o.$globalHooks.useMessage(),{createModelSyncRelation:c,listDataSourceSynchronized:d}=fetch$1(o).dbImport,f=vue.ref(null),p=vue.ref(null),v=vue.ref(null),m=vue.ref(null),g=r,{originlist:_,list:y,pageLoading:b,page:x,pageSize:C,getData:w,handleSizeChange:E,handleCurrentChange:$}=o.$globalHooks.usePage(),S=vue.reactive([{name:"源表名",type:FieldType.Text,fieldName:"sourceTableComment",value:""},{name:"同步状态",type:FieldType.Select,fieldName:"related",value:"",options:[{label:"已同步",value:!0},{label:"未同步",value:!1}]},{name:"同步结果",type:FieldType.Select,fieldName:"synchronizeResult",value:"",options:[{label:"正常",value:2},{label:"异常",value:1}]},{name:"源数据量",type:FieldType.Select,fieldName:"existSourceTableData",value:"",options:[{label:"源数据量 >0",value:!0},{label:"源数据量 =0",value:!1}]}]),V=vue.reactive([{label:"源表",prop:"sourceTableCode"},{label:"源表名",prop:"sourceTableComment"},{label:"源数据",prop:"sourceTableDataCount",slot:!0},{label:"列数",prop:"sourceColumnCount"},{label:"同步状态",prop:"related",slot:!0},{label:"同步结果",prop:"synchronizeResult",tag:!0,tagFunc:D=>D==2?"success":"danger",func:D=>{var F,M;return((F=D.modelSyncDetail)==null?void 0:F.synchronizeResult)=="2"?"正常":((M=D.modelSyncDetail)==null?void 0:M.synchronizeResult)=="1"?"异常":"-"}},{label:"目标表",prop:"relationTableCode"},{label:"目标数据",prop:"relationTableDataCount"},{label:"主键",prop:"primaryKeyColumn",func:D=>{var F;return((F=D==null?void 0:D.modelSyncDetail)==null?void 0:F.primaryKeyColumn)??"-"}},{label:"增量字段",prop:"incrColumn",func:D=>{var F;return((F=D==null?void 0:D.modelSyncDetail)==null?void 0:F.incrColumn)??"-"}},{label:"上次同步",prop:"lastSyncTime",func:D=>{var F;return((F=D==null?void 0:D.modelSyncDetail)==null?void 0:F.lastSyncTime)??"-"}},{label:"操作",prop:"htmlButton",fixed:"right",width:"120px"}]),k=async(D=!0)=>{D&&(l({},S),x.value=1),b.value=!0;const{params:F}=s(S,!1,!0),M=await d({dataSourceId:vue.unref(a).dataSourceId,...F});if(b.value=!1,!M){_.value=[];return}M.data.forEach(R=>{var z;(z=R==null?void 0:R.modelSyncDetail)!=null&&z.modelId&&(R.htmlButton=[{name:"配置",key:"setting",type:"primary"},{name:"历史",key:"history",type:"primary"}])}),_.value=M.data,w()},P=async D=>{await c({sourceId:D.dataSourceId,sourceTableCode:D.sourceTableCode})&&(u({type:"success",message:"操作成功"}),g("refresh"),k(!1))},T=vue.ref(!1),B=vue.ref(""),N=vue.reactive([{label:"抽取方案名称",prop:"extractName"},{label:"抽取类型",prop:"extractType",props:{url:"/api/ace-api/blade-system/dict-biz/dictionary?code=extractType",label:"dictValue",value:"dictKey"}},{label:"操作",prop:"htmlButton",fixed:"right",width:"200px"}]),O=D=>{D.data.forEach(F=>{F.htmlButton=[],F.htmlButton.push({name:"编辑",key:"EDIT",type:"primary",icon:"ri-edit-line"}),F.htmlButton.push({name:"抽取记录",key:"LOG",type:"primary",icon:"ri-file-line"}),[1,2].includes(F.extractType)&&F.htmlButton.push({name:"抽取",key:"PUSH",type:"primary",icon:"ri-pushpin-line"}),F.htmlButton.push({name:"删除",key:"DEL",type:"danger",icon:"ri-delete-bin-6-line"})})},I=vue.ref({}),L=async D=>{var z;const{type:F,row:M,index:R}=D;switch(F){case"history":vue.unref(v).init({ajaxUrl:`/api/ace-data-center/extract-log/modelSyncHistory?descs=create_time&modelId=${M.modelSyncDetail.modelId}`,table:[{label:"日期",prop:"createTime"},{label:"数据总数",prop:"totalNum"},{label:"成功数",prop:"successNum"},{label:"失败数",prop:"failNum"},{label:"协同参数",prop:"collaborateValue"},{label:"操作",prop:"action",slot:!0,fixed:"right"}]});break;case"LOG":vue.unref(v).init({businessId:M.id,businessType:"db_extract",table:[{label:"日期",prop:"createTime"},{label:"数据总数",prop:"totalNum"},{label:"成功数",prop:"successNum"},{label:"失败数",prop:"failNum"},{label:"协同参数",prop:"collaborateValue"},{label:"操作",prop:"action",slot:!0,fixed:"right"}]});break;case"PUSH":o.$baseConfirm({content:"是否抽取?",callConfirm:async()=>{await o.$baseHttp.post(`/api/ace-data-center/db-extract/extract/${M.id}`,{},{headers:{loading:!0}})&&u({type:"success",message:"操作成功"})}});break;case"DEL":o.$baseConfirm({content:"是否删除?",callConfirm:async()=>{await o.$baseHttp.post(`/api/ace-data-center/db-extract/removeById/${M.id}`,{},{headers:{loading:!0}})&&(u({type:"success",message:"操作成功"}),vue.unref(f).getData())}});break;case"EDIT":const U=await o.$baseHttp.get(`/api/ace-data-center/db-extract/detailAndTask?dbExtractId=${M.id}`);if(!U)return;vue.unref(p).init(U.data);break;case"ADD":vue.unref(p).init({dataSourceId:vue.unref(I).dataSourceId,modelId:(z=vue.unref(I))==null?void 0:z.modelSyncDetail.modelId});break;case"setting":T.value=!0,I.value=M,B.value=`/api/ace-data-center/db-extract/list?modelId=${M.modelSyncDetail.modelId}&projectId=${o.$baseGetCurrentProjectId()}`;break;case"source-table-data":vue.unref(m).init(M.dataSourceId,M.sourceTableCode);break}};return n({init:k}),(D,F)=>{const M=vue.resolveComponent("aceHeader"),R=vue.resolveComponent("AppForm"),z=vue.resolveComponent("AppTable"),U=vue.resolveComponent("AppList"),G=vue.resolveComponent("AppDrawer");return vue.openBlock(),vue.createElementBlock("div",_hoisted_1$W,[vue.createVNode(M,{title:vue.unref(a).dataSourceComment},null,8,["title"]),vue.createElementVNode("div",_hoisted_2$M,[vue.createElementVNode("div",_hoisted_3$F,[vue.createVNode(R,{form:vue.unref(S)},{default:vue.withCtx(()=>[vue.createVNode(vue.unref(elementPlus.ElButton),{type:"primary",class:"ml-1",onClick:F[0]||(F[0]=J=>k(!1))},{default:vue.withCtx(()=>[_hoisted_4$E,vue.createTextVNode(" 查询 ")]),_:1})]),_:1},8,["form"])]),vue.createElementVNode("div",_hoisted_5$x,[vue.createVNode(z,{tableData:vue.unref(V),list:vue.unref(y),loading:vue.unref(b),onTableBtnClick:L},{related:vue.withCtx(({row:J})=>[J.related?(vue.openBlock(),vue.createBlock(vue.unref(elementPlus.ElTag),{key:0,type:"primary"},{default:vue.withCtx(()=>[vue.createTextVNode("已同步")]),_:1})):(vue.openBlock(),vue.createBlock(vue.unref(elementPlus.ElPopconfirm),{key:1,title:"您确定要同步吗?",onConfirm:te=>P(J)},{reference:vue.withCtx(()=>[vue.createVNode(vue.unref(elementPlus.ElButton),{size:"small",type:"primary"},{default:vue.withCtx(()=>[vue.createTextVNode("立即同步")]),_:1})]),_:2},1032,["onConfirm"]))]),sourceTableDataCount:vue.withCtx(({row:J})=>[J.sourceTableDataCount==0?(vue.openBlock(),vue.createElementBlock(vue.Fragment,{key:0},[vue.createTextVNode(vue.toDisplayString(J.sourceTableDataCount),1)],64)):(vue.openBlock(),vue.createElementBlock("div",{key:1,class:"flex justify-between",onClick:te=>L({type:"source-table-data",row:J,index:-1})},[vue.createVNode(vue.unref(elementPlus.ElLink),{type:"primary"},{default:vue.withCtx(()=>[vue.createTextVNode(vue.toDisplayString(J.sourceTableDataCount),1)]),_:2},1024),vue.createVNode(vue.unref(elementPlus.ElLink),{type:"primary"},{default:vue.withCtx(()=>[vue.createTextVNode("查看")]),_:1})],8,_hoisted_6$s))]),_:1},8,["tableData","list","loading"])]),vue.createElementVNode("div",_hoisted_7$p,[vue.createVNode(vue.unref(elementPlus.ElPagination),{"current-page":vue.unref(x),"onUpdate:currentPage":F[1]||(F[1]=J=>vue.isRef(x)?x.value=J:null),"page-size":vue.unref(C),"onUpdate:pageSize":F[2]||(F[2]=J=>vue.isRef(C)?C.value=J:null),"page-sizes":[10,20,40,60,80,100],background:!0,layout:"total, sizes, prev, pager, next, jumper",total:vue.unref(_).length,onCurrentChange:vue.unref($),onSizeChange:vue.unref(E)},null,8,["current-page","page-size","total","onCurrentChange","onSizeChange"])])]),vue.createVNode(G,{modelValue:vue.unref(T),"onUpdate:modelValue":F[4]||(F[4]=J=>vue.isRef(T)?T.value=J:null),title:"数据同步方案",size:"1000px"},{default:vue.withCtx(()=>[vue.createElementVNode("div",_hoisted_8$m,[vue.createVNode(vue.unref(elementPlus.ElButton),{type:"primary",onClick:F[3]||(F[3]=J=>L({type:"ADD",row:{},index:0}))},{default:vue.withCtx(()=>[_hoisted_9$j,vue.createTextVNode(" 新增 ")]),_:1})]),vue.createVNode(U,{tableData:vue.unref(N),url:vue.unref(B),ref_key:"appListRef",ref:f,onBtnClick:L,onSuccess:O},null,8,["tableData","url"])]),_:1},8,["modelValue"]),vue.createVNode(_sfc_main$1a,{ref_key:"settingRef",ref:p,onRefresh:F[5]||(F[5]=J=>vue.unref(f).getData({clear:!0}))},null,512),vue.createVNode(_sfc_main$19,{ref_key:"extractLogRef",ref:v},null,512),vue.createVNode(_sfc_main$1b,{ref_key:"sourceTableDataRef",ref:m},null,512)])}}}),_hoisted_1$V={key:0,class:"flex items-center justify-center h-full"},_sfc_main$17=vue.defineComponent({__name:"index",setup(i){const n=vue.ref(null),r=vue.ref(null),o=vue.ref({});vue.provide("modelEle",o);const a=vue.inject("local"),l=s=>{o.value=s,vue.nextTick(()=>{vue.unref(n).init()})};return(s,u)=>{const c=vue.resolveComponent("AppEmpty");return vue.openBlock(),vue.createBlock(vue.unref(elementPlus.ElContainer),{class:"overflow-hidden app-basic-container"},{default:vue.withCtx(()=>[vue.createVNode(vue.unref(elementPlus.ElConfigProvider),{locale:vue.unref(a)},{default:vue.withCtx(()=>[vue.createVNode(vue.unref(elementPlus.ElAside),{class:"pr-5 mr-5"},{default:vue.withCtx(()=>[vue.createVNode(Menu$2,{ref_key:"menuRef",ref:r,onNodeClick:l},null,512)]),_:1}),vue.createVNode(vue.unref(elementPlus.ElMain),null,{default:vue.withCtx(()=>[vue.unref(o).dataSourceId?(vue.openBlock(),vue.createBlock(_sfc_main$18,{key:1,ref_key:"viewRef",ref:n,onRefresh:u[0]||(u[0]=d=>vue.unref(r).initMenu())},null,512)):(vue.openBlock(),vue.createElementBlock("div",_hoisted_1$V,[vue.createVNode(c,{description:"请选择数据源"})]))]),_:1})]),_:1},8,["locale"])]),_:1})}}}),_withScopeId$n=i=>(vue.pushScopeId("data-v-cabcba66"),i=i(),vue.popScopeId(),i),_hoisted_1$U={class:"flex flex-col h-full"},_hoisted_2$L=_withScopeId$n(()=>vue.createElementVNode("i",{class:"mr-1 ri-add-circle-line"},null,-1)),_hoisted_3$E={class:"flex-1 mt-3 overflow-y-auto card-container"},_hoisted_4$D={key:0,class:"flex items-center justify-center h-full"},_hoisted_5$w=["onClick"],_hoisted_6$r={class:"flex items-center justify-between"},_hoisted_7$o={class:"flex-1 mr-2.5"},_hoisted_8$l=_withScopeId$n(()=>vue.createElementVNode("i",{class:"mr-1 ri-database-line"},null,-1)),_hoisted_9$i={class:"font-bold"},_hoisted_10$h=_withScopeId$n(()=>vue.createElementVNode("i",{class:"mr-1 ri-edit-circle-line"},null,-1)),_hoisted_11$e={class:"flex items-center justify-between w-4/5 mt-3 ml-auto mr-auto"},_hoisted_12$c={class:"flex items-center"},_hoisted_13$a=_withScopeId$n(()=>vue.createElementVNode("i",{class:"mr-1 ri-checkbox-circle-fill text-color-success"},null,-1)),_hoisted_14$9=_withScopeId$n(()=>vue.createElementVNode("div",{class:"text-color-info"},"|",-1)),_hoisted_15$4={class:"flex justify-end mt-3 text-xs text-color-info pb"},_hoisted_16$4={class:"w-4/5 overflow-hidden whitespace-nowrap text-ellipsis"},_sfc_main$16=vue.defineComponent({__name:"menu",emits:["node-click"],setup(i,{expose:n,emit:r}){const{proxy:o}=vue.getCurrentInstance(),{dataSourceSubmit:a,testConnect:l,loadDataSourceMenu:s,detail:u}=fetch$1(o).dbImport,{setFormValue:c,getFormValue:d}=o.$globalHooks.useForm(),{openMessage:f}=o.$globalHooks.useMessage(),p=o.$globalDict,v=r,m=vue.ref([]),g=vue.ref(!0),_=()=>{m.value=[],g.value=!0,s().then(k=>{g.value=!1,m.value=k.data??[],k.data.length&&vue.unref(S)==""&&V(k.data[0])})};_();const y=vue.reactive([{name:"数据源名称",type:FieldType.Text,fieldName:"name",value:"",required:!0},{name:"数据源类型",type:FieldType.Select,fieldName:"dataSourceType",value:"",dict:"storeType",required:!0,changeFunc:k=>{if(!k.value)return;let P=p.dataSourceUrlDemo.find(T=>T.label.toLowerCase()===k.value.toLowerCase());y.find(T=>T.fieldName==="dataSourceUrlDemo").value=(P==null?void 0:P.value)??""}},{name:"数据源链接地址",type:FieldType.Textarea,fieldName:"dataSourceUrl",value:"",required:!0},{name:"链接示例",type:FieldType.Slot,fieldName:"dataSourceUrlDemo",value:""},{name:"数据库用户名",type:FieldType.Text,fieldName:"connectUserName",value:"",required:!0},{name:"数据库用密码",type:FieldType.Password,fieldName:"connectPassword",value:"",required:!0},{name:"id",type:FieldType.Text,fieldName:"id",value:"",hide:!0}]),b=vue.ref(!1),x=()=>{c({},y),b.value=!0},C=async k=>{const P=await u({id:k.dataSourceId});c(P.data,y),b.value=!0},w=k=>{y.find(P=>P.fieldName==="dataSourceUrl").value=k.value},E=async()=>{const{params:k,error:P}=d(y);P.length>0||(k.id||delete k.id,!await a(k))||(b.value=!1,f({type:"success",message:"操作成功"}),_())},$=async()=>{const{params:k,error:P}=d(y);P.length>0||!await l(k)||f({type:"success",message:"数据库链接成功"})},S=vue.ref(""),V=k=>{vue.unref(S)!=k.dataSourceId&&(S.value=k.dataSourceId,v("node-click",k))};return n({initMenu:_}),(k,P)=>{const T=vue.resolveComponent("aceHeader"),B=vue.resolveComponent("AppEmpty"),N=vue.resolveComponent("AppForm"),O=vue.resolveComponent("AppDialog");return vue.openBlock(),vue.createElementBlock("div",_hoisted_1$U,[vue.createVNode(T,{title:"数据源"},{default:vue.withCtx(()=>[vue.createVNode(vue.unref(elementPlus.ElButton),{type:"primary",size:"small",onClick:x},{default:vue.withCtx(()=>[_hoisted_2$L,vue.createTextVNode(" 新增 ")]),_:1})]),_:1}),vue.createElementVNode("div",_hoisted_3$E,[vue.createVNode(vue.unref(elementPlus.ElSkeleton),{loading:vue.unref(g),animated:""},{default:vue.withCtx(()=>[vue.unref(m).length?(vue.openBlock(!0),vue.createElementBlock(vue.Fragment,{key:1},vue.renderList(vue.unref(m),I=>(vue.openBlock(),vue.createElementBlock("div",{key:I.id,class:vue.normalizeClass(["item",{active:vue.unref(S)==I.dataSourceId}]),onClick:L=>V(I)},[vue.createElementVNode("div",_hoisted_6$r,[vue.createElementVNode("div",_hoisted_7$o,[_hoisted_8$l,vue.createElementVNode("span",_hoisted_9$i,vue.toDisplayString(I.dataSourceComment),1)]),vue.createVNode(vue.unref(elementPlus.ElLink),{type:"primary",onClick:vue.withModifiers(L=>C(I),["stop"])},{default:vue.withCtx(()=>[_hoisted_10$h,vue.createTextVNode(" 修改 ")]),_:2},1032,["onClick"])]),vue.createElementVNode("div",_hoisted_11$e,[vue.createElementVNode("div",_hoisted_12$c,[_hoisted_13$a,vue.createTextVNode(" 已同步 "),vue.createElementVNode("strong",null,vue.toDisplayString(I.synchronizedShadowTableCount),1)]),_hoisted_14$9,vue.createElementVNode("div",null,[vue.createTextVNode(" 总表数 "),vue.createElementVNode("strong",null,vue.toDisplayString(I.tableCount),1)])]),vue.createElementVNode("div",_hoisted_15$4,vue.toDisplayString(I.version),1)],10,_hoisted_5$w))),128)):(vue.openBlock(),vue.createElementBlock("div",_hoisted_4$D,[vue.createVNode(B,{description:"暂无数据源"})]))]),_:1},8,["loading"])]),vue.createVNode(O,{modelValue:vue.unref(b),"onUpdate:modelValue":P[1]||(P[1]=I=>vue.isRef(b)?b.value=I:null),title:"新增接入数据源",size:700},{footer:vue.withCtx(()=>[vue.createVNode(vue.unref(elementPlus.ElButton),{style:{"margin-right":"auto"},type:"success",onClick:$},{default:vue.withCtx(()=>[vue.createTextVNode(" 测试链接 ")]),_:1}),vue.createVNode(vue.unref(elementPlus.ElButton),{class:"ml-3",type:"primary",onClick:E},{default:vue.withCtx(()=>[vue.createTextVNode("保存")]),_:1}),vue.createVNode(vue.unref(elementPlus.ElButton),{class:"ml-3",onClick:P[0]||(P[0]=I=>b.value=!1)},{default:vue.withCtx(()=>[vue.createTextVNode("取消")]),_:1})]),default:vue.withCtx(()=>[vue.createVNode(N,{form:vue.unref(y),col:1,labelWidth:120},{dataSourceUrlDemo:vue.withCtx(({element:I})=>[vue.createVNode(vue.unref(elementPlus.ElTooltip),{content:I.value},{default:vue.withCtx(()=>[vue.createElementVNode("div",_hoisted_16$4,vue.toDisplayString(I.value),1)]),_:2},1032,["content"]),vue.createVNode(vue.unref(elementPlus.ElButton),{type:"primary",onClick:L=>w(I)},{default:vue.withCtx(()=>[vue.createTextVNode("复制")]),_:2},1032,["onClick"])]),_:1},8,["form"])]),_:1},8,["modelValue"])])}}}),menu_vue_vue_type_style_index_0_scoped_cabcba66_lang="",Menu$1=_export_sfc$2(_sfc_main$16,[["__scopeId","data-v-cabcba66"]]),_sfc_main$15=vue.defineComponent({__name:"sourceTableData",setup(i,{expose:n}){const r=vue.ref(!1),o=vue.ref(null),a=vue.ref(""),l=vue.ref([]),s=f=>{l.value=[],(f==null?void 0:f.data.length)>0&&(l.value=Object.keys(f.data[0]).filter(p=>p!="pageIndex").map(p=>({label:p,prop:p})))},u=vue.ref({}),c=f=>Object.assign(f,vue.unref(u));return n({init:(f,p)=>{vue.unref(u).dataSourceId=f,vue.unref(u).sourceTableCode=p,r.value=!0,a.value="/api/ace-data-center/data-source/sourceDataPage"}}),(f,p)=>{const v=vue.resolveComponent("AppList"),m=vue.resolveComponent("AppDrawer");return vue.openBlock(),vue.createBlock(m,{modelValue:vue.unref(r),"onUpdate:modelValue":p[0]||(p[0]=g=>vue.isRef(r)?r.value=g:null),title:"数据源明细",size:"90%"},{default:vue.withCtx(()=>[vue.createVNode(v,{tableData:vue.unref(l),url:vue.unref(a),ref_key:"appList",ref:o,formatParamsFunc:c,onSuccess:s,methods:"post"},null,8,["tableData","url"])]),_:1},8,["modelValue"])}}}),_withScopeId$m=i=>(vue.pushScopeId("data-v-e0af972d"),i=i(),vue.popScopeId(),i),_hoisted_1$T={class:"mt-3"},_hoisted_2$K=_withScopeId$m(()=>vue.createElementVNode("thead",null,[vue.createElementVNode("tr",null,[vue.createElementVNode("td",null,"字段名称"),vue.createElementVNode("td",null,"字段描述"),vue.createElementVNode("td",null,"映射字段"),vue.createElementVNode("td",null,"数据类型"),vue.createElementVNode("td",null,"数据长度"),vue.createElementVNode("td",null,"数据标度"),vue.createElementVNode("td",null,"是否主键"),vue.createElementVNode("td",null,"唯一校验")])],-1)),_hoisted_3$D={class:"sort-target"},_hoisted_4$C={key:0},_sfc_main$14=vue.defineComponent({__name:"model-normal",emits:["success"],setup(i,{expose:n,emit:r}){const{proxy:o}=vue.getCurrentInstance(),{setFormValue:a,getFormValue:l}=o.$globalHooks.useForm(),s=r,u=vue.ref(!1),c=vue.ref(""),d=vue.ref([]);vue.ref("");const f=vue.ref([]),p=vue.reactive([{name:"项目名称",type:FieldType.Select,fieldName:"projectId",value:"",required:!0,props:{url:"/api/ace-data-center/project/options",label:"label",value:"code"},disabled:!0,hide:!0},{name:"数据源类型",type:FieldType.Select,fieldName:"modelStore",value:"",required:!0,dict:"storeType",disabled:!0},{name:"模型层级",type:FieldType.Select,fieldName:"modelLayer",value:"",required:!0,props:{url:"/api/ace-api/blade-system/dict-biz/dictionary?code=modelLayer",label:"dictValue",value:"dictKey"},changeFunc:g=>{},disabled:!0},{name:"模型名称",type:FieldType.Text,fieldName:"modelName",value:"",required:!0},{name:"模型表名",type:FieldType.Text,fieldName:"modelCode",value:"",required:!0,disabled:!0},{name:"模型类型",type:FieldType.Select,fieldName:"modelType",value:"",props:{url:"/api/ace-api/blade-system/dict-biz/dictionary?code=modelType",label:"dictValue",value:"dictKey"},hide:!0},{name:"标签",type:FieldType.Text,fieldName:"tags",value:""},{name:"分区字段",type:FieldType.Text,fieldName:"partitionColumn",value:"",hide:!0},{name:"模型描述",type:FieldType.Textarea,fieldName:"modelDesc",value:""},{name:"id",type:FieldType.Text,fieldName:"id",value:"",hide:!0}]),v=g=>{u.value=!0,c.value="",d.value=[],f.value=(g?(g==null?void 0:g.listModelAttribute)??[]:[{nanoid:nanoid()}]).map(_=>{const y=((_==null?void 0:_.attributeCode)??"").split("");return _.nanoid=nanoid(),y[0]=="_"&&(_.hide=!0),_}),a({...g??{},projectId:o.$baseGetCurrentProjectId()},p)},m=async()=>{const{params:g,error:_}=l(p);if(_.length>0)return;const y="/api/ace-data-center/model/editModelDetail";await o.$baseHttp.post(y,{...g,projectId:String(o.$baseGetCurrentProjectId()),listModelAttribute:vue.unref(f)},{headers:{loading:!0}})&&(u.value=!1,o.$message.success("操作成功"),s("success"))};return n({init:v}),(g,_)=>{const y=vue.resolveComponent("AppForm"),b=vue.resolveComponent("aceHeader"),x=vue.resolveComponent("AppDrawer");return vue.openBlock(),vue.createBlock(x,{modelValue:vue.unref(u),"onUpdate:modelValue":_[1]||(_[1]=C=>vue.isRef(u)?u.value=C:null),title:"影子模型",size:"100%"},{footer:vue.withCtx(()=>[vue.createVNode(vue.unref(elementPlus.ElButton),{class:"ml-3",type:"primary",onClick:m},{default:vue.withCtx(()=>[vue.createTextVNode("提交")]),_:1}),vue.renderSlot(g.$slots,"formFooter",{},void 0,!0),vue.createVNode(vue.unref(elementPlus.ElButton),{class:"ml-3",onClick:_[0]||(_[0]=C=>u.value=!1)},{default:vue.withCtx(()=>[vue.createTextVNode("取消")]),_:1})]),default:vue.withCtx(()=>[vue.createVNode(vue.unref(elementPlus.ElContainer),{class:"h-full overflow-hidden"},{default:vue.withCtx(()=>[vue.createVNode(vue.unref(elementPlus.ElAside),{class:"pr-5 mr-5"},{default:vue.withCtx(()=>[vue.createVNode(y,{form:vue.unref(p)},null,8,["form"])]),_:1}),vue.createVNode(vue.unref(elementPlus.ElMain),null,{default:vue.withCtx(()=>[vue.createVNode(b,{title:"影子模型属性"}),vue.createElementVNode("table",_hoisted_1$T,[_hoisted_2$K,vue.createElementVNode("tbody",_hoisted_3$D,[(vue.openBlock(!0),vue.createElementBlock(vue.Fragment,null,vue.renderList(vue.unref(f),(C,w)=>(vue.openBlock(),vue.createElementBlock(vue.Fragment,{key:C.nanoid},[C.hide?vue.createCommentVNode("",!0):(vue.openBlock(),vue.createElementBlock("tr",_hoisted_4$C,[vue.createElementVNode("td",null,vue.toDisplayString(C.attributeCode),1),vue.createElementVNode("td",null,[vue.createVNode(vue.unref(elementPlus.ElInput),{modelValue:C.attributeComment,"onUpdate:modelValue":E=>C.attributeComment=E,maxlength:"30",showWordLimit:"",placeholder:"字段描述"},null,8,["modelValue","onUpdate:modelValue"])]),vue.createElementVNode("td",null,vue.toDisplayString(C.mapCode),1),vue.createElementVNode("td",null,[vue.createVNode(vue.unref(elementPlus.ElSelect),{modelValue:C.dataType,"onUpdate:modelValue":E=>C.dataType=E,placeholder:"数据类型","popper-class":"ace-select",style:{width:"100%"},disabled:""},{default:vue.withCtx(()=>[(vue.openBlock(!0),vue.createElementBlock(vue.Fragment,null,vue.renderList(vue.unref(commonDataType),E=>(vue.openBlock(),vue.createBlock(vue.unref(elementPlus.ElOption),{key:E.value,label:E.label,value:E.value},null,8,["label","value"]))),128))]),_:2},1032,["modelValue","onUpdate:modelValue"])]),vue.createElementVNode("td",null,vue.toDisplayString(C.dataLength),1),vue.createElementVNode("td",null,vue.toDisplayString(C.dataScale??"-"),1),vue.createElementVNode("td",null,[vue.createVNode(vue.unref(elementPlus.ElSwitch),{modelValue:C.primaryKey,"onUpdate:modelValue":E=>C.primaryKey=E,"inline-prompt":"","active-text":"是","inactive-text":"否","active-value":"2","inactive-value":"1",disabled:""},null,8,["modelValue","onUpdate:modelValue"])]),vue.createElementVNode("td",null,[vue.createVNode(vue.unref(elementPlus.ElSwitch),{modelValue:C.uniqueKey,"onUpdate:modelValue":E=>C.uniqueKey=E,"inline-prompt":"","active-text":"是","inactive-text":"否","active-value":"2","inactive-value":"1",disabled:""},null,8,["modelValue","onUpdate:modelValue"])])]))],64))),128))])])]),_:1})]),_:1})]),_:3},8,["modelValue"])}}}),modelNormal_vue_vue_type_style_index_0_scoped_e0af972d_lang="",ModelNormal=_export_sfc$2(_sfc_main$14,[["__scopeId","data-v-e0af972d"]]),_hoisted_1$S={class:"flex flex-col h-full overflow-hidden"},_hoisted_2$J={class:"flex flex-col flex-1 mt-3 overflow-hidden"},_hoisted_3$C={class:"app-search"},_hoisted_4$B=vue.createElementVNode("i",{class:"mr-1 ri-search-line"},null,-1),_hoisted_5$v={class:"flex flex-1 overflow-hidden"},_hoisted_6$q=["onClick"],_hoisted_7$n={class:"flex justify-end mt-3"},_sfc_main$13=vue.defineComponent({__name:"view",emits:["refresh"],setup(i,{expose:n,emit:r}){const{proxy:o}=vue.getCurrentInstance(),a=vue.inject("modelEle"),{setFormValue:l,getFormValue:s}=o.$globalHooks.useForm(),{openMessage:u}=o.$globalHooks.useMessage(),{createShadowModelSync:c,listDataSourceSynchronized:d}=fetch$1(o).dbImport,f=vue.ref(null),p=vue.ref(null),v=r,{originlist:m,list:g,pageLoading:_,page:y,pageSize:b,getData:x,handleSizeChange:C,handleCurrentChange:w}=o.$globalHooks.usePage(),E=vue.reactive([{name:"源表",type:FieldType.Text,fieldName:"sourceTableCode",value:""},{name:"源表名",type:FieldType.Text,fieldName:"sourceTableComment",value:""}]),$=vue.reactive([{label:"源表",prop:"sourceTableCode"},{label:"源表名",prop:"sourceTableComment"},{label:"源数据",prop:"sourceTableDataCount",slot:!0},{label:"列数",prop:"sourceColumnCount"},{label:"影子模型",prop:"shadowModelId",slot:!0},{label:"操作",prop:"htmlButton",fixed:"right",width:"120px"}]),S=async(k=!0)=>{k&&(l({},E),y.value=1),_.value=!0;const{params:P}=s(E,!1,!0),T=await d({dataSourceId:vue.unref(a).dataSourceId,...P});if(_.value=!1,!T){m.value=[];return}T.data.forEach(B=>{B.shadowModelId?B.htmlButton=[{name:"编辑",key:"EDIT",type:"primary"}]:B.htmlButton=[{name:"创建影子模型",key:"CREATE",type:"primary"}]}),m.value=T.data,x()},V=async k=>{const{type:P,row:T,index:B}=k;switch(P){case"EDIT":{const N=await o.$baseHttp.get(`/api/ace-data-center/model/detail?id=${T==null?void 0:T.shadowModelId}`);if(!N)return;o.$refs.normalRef.init(N.data)}break;case"CREATE":o.$baseConfirm({content:"是否创建影子模型?",callConfirm:async()=>{await c({sourceId:T.dataSourceId,sourceTableCode:T.sourceTableCode})&&(u({type:"success",message:"操作成功"}),v("refresh"),S(!1))}});break;case"source-table-data":vue.unref(p).init(T.dataSourceId,T.sourceTableCode);break}};return n({init:S}),(k,P)=>{const T=vue.resolveComponent("aceHeader"),B=vue.resolveComponent("AppForm"),N=vue.resolveComponent("AppTable");return vue.openBlock(),vue.createElementBlock("div",_hoisted_1$S,[vue.createVNode(T,{title:vue.unref(a).dataSourceComment},null,8,["title"]),vue.createElementVNode("div",_hoisted_2$J,[vue.createElementVNode("div",_hoisted_3$C,[vue.createVNode(B,{form:vue.unref(E)},{default:vue.withCtx(()=>[vue.createVNode(vue.unref(elementPlus.ElButton),{type:"primary",class:"ml-1",onClick:P[0]||(P[0]=O=>S(!1))},{default:vue.withCtx(()=>[_hoisted_4$B,vue.createTextVNode(" 查询 ")]),_:1})]),_:1},8,["form"])]),vue.createElementVNode("div",_hoisted_5$v,[vue.createVNode(N,{tableData:vue.unref($),list:vue.unref(g),loading:vue.unref(_),onTableBtnClick:V},{shadowModelId:vue.withCtx(({row:O})=>[O.shadowModelId?(vue.openBlock(),vue.createBlock(vue.unref(elementPlus.ElTag),{key:0,type:"primary"},{default:vue.withCtx(()=>[vue.createTextVNode("已创建")]),_:1})):(vue.openBlock(),vue.createBlock(vue.unref(elementPlus.ElTag),{key:1,type:"warning"},{default:vue.withCtx(()=>[vue.createTextVNode("未创建")]),_:1}))]),sourceTableDataCount:vue.withCtx(({row:O})=>[O.sourceTableDataCount==0?(vue.openBlock(),vue.createElementBlock(vue.Fragment,{key:0},[vue.createTextVNode(vue.toDisplayString(O.sourceTableDataCount),1)],64)):(vue.openBlock(),vue.createElementBlock("div",{key:1,class:"flex justify-between",onClick:I=>V({type:"source-table-data",row:O,index:-1})},[vue.createVNode(vue.unref(elementPlus.ElLink),{type:"primary"},{default:vue.withCtx(()=>[vue.createTextVNode(vue.toDisplayString(O.sourceTableDataCount),1)]),_:2},1024),vue.createVNode(vue.unref(elementPlus.ElLink),{type:"primary"},{default:vue.withCtx(()=>[vue.createTextVNode("查看")]),_:1})],8,_hoisted_6$q))]),_:1},8,["tableData","list","loading"])]),vue.createElementVNode("div",_hoisted_7$n,[vue.createVNode(vue.unref(elementPlus.ElPagination),{"current-page":vue.unref(y),"onUpdate:currentPage":P[1]||(P[1]=O=>vue.isRef(y)?y.value=O:null),"page-size":vue.unref(b),"onUpdate:pageSize":P[2]||(P[2]=O=>vue.isRef(b)?b.value=O:null),"page-sizes":[10,20,40,60,80,100],background:!0,layout:"total, sizes, prev, pager, next, jumper",total:vue.unref(m).length,onCurrentChange:vue.unref(w),onSizeChange:vue.unref(C)},null,8,["current-page","page-size","total","onCurrentChange","onSizeChange"])])]),vue.createVNode(ModelNormal,{ref_key:"normalRef",ref:f},null,512),vue.createVNode(_sfc_main$15,{ref_key:"sourceTableDataRef",ref:p},null,512)])}}}),_hoisted_1$R={key:0,class:"flex items-center justify-center h-full"},_sfc_main$12=vue.defineComponent({__name:"index",setup(i){const n=vue.ref(null),r=vue.ref(null),o=vue.ref({});vue.provide("modelEle",o);const a=vue.inject("local"),l=s=>{o.value=s,vue.nextTick(()=>{vue.unref(n).init()})};return(s,u)=>{const c=vue.resolveComponent("AppEmpty");return vue.openBlock(),vue.createBlock(vue.unref(elementPlus.ElContainer),{class:"overflow-hidden app-basic-container"},{default:vue.withCtx(()=>[vue.createVNode(vue.unref(elementPlus.ElConfigProvider),{locale:vue.unref(a)},{default:vue.withCtx(()=>[vue.createVNode(vue.unref(elementPlus.ElAside),{class:"pr-5 mr-5"},{default:vue.withCtx(()=>[vue.createVNode(Menu$1,{ref_key:"menuRef",ref:r,onNodeClick:l},null,512)]),_:1}),vue.createVNode(vue.unref(elementPlus.ElMain),null,{default:vue.withCtx(()=>[vue.unref(o).dataSourceId?(vue.openBlock(),vue.createBlock(_sfc_main$13,{key:1,ref_key:"viewRef",ref:n,onRefresh:u[0]||(u[0]=d=>vue.unref(r).initMenu())},null,512)):(vue.openBlock(),vue.createElementBlock("div",_hoisted_1$R,[vue.createVNode(c,{description:"请选择数据源"})]))]),_:1})]),_:1},8,["locale"])]),_:1})}}}),_hoisted_1$Q=vue.createElementVNode("i",{class:"ri-search-line"},null,-1),_hoisted_2$I={class:"mt-3"},_hoisted_3$B={class:"mt-3"},_hoisted_4$A={key:1,class:"mr-1 -ml-5 text-base ri-edit-circle-fill text-color-primary"},_sfc_main$11=vue.defineComponent({__name:"menu",emits:["node-click"],setup(i,{expose:n,emit:r}){const o=vue.ref(""),a=vue.ref(null),l=vue.ref([{label:"源视图表",value:"ODSVIEW"},{label:"整合数据表",value:"DWD"}]),s=vue.ref(vue.unref(l)[0].value),{proxy:u}=vue.getCurrentInstance(),c=r;vue.watch(o,_=>{vue.unref(a).filter(_)});const d=(_,y)=>_?y.name.includes(_):!0,f=vue.ref([]),p=vue.ref([]),v=vue.ref(!0),m=()=>{v.value=!0,Promise.all([fetch$1(u).loadModelMenu({modelLayer:"ODSVIEW"}),fetch$1(u).loadModelMenu({modelLayer:"DWD"})]).then(_=>{f.value=Object.keys(_[0].data).map(y=>({modelName:y,id:y,children:_[0].data[y]})),p.value=Object.keys(_[1].data).map(y=>({modelName:y,id:y,children:_[1].data[y]})),v.value=!1})};m();const g=_=>{Array.isArray(_.children)||c("node-click",_)};return n({init:m}),(_,y)=>{const b=vue.resolveComponent("aceHeader");return vue.openBlock(),vue.createElementBlock(vue.Fragment,null,[vue.createVNode(b,{title:"整合数据",class:"mb-2"},{default:vue.withCtx(()=>[vue.renderSlot(_.$slots,"top")]),_:3}),vue.createVNode(vue.unref(elementPlus.ElInput),{placeholder:"请输入内容",clearable:"",modelValue:vue.unref(o),"onUpdate:modelValue":y[0]||(y[0]=x=>vue.isRef(o)?o.value=x:null)},{prefix:vue.withCtx(()=>[_hoisted_1$Q]),_:1},8,["modelValue"]),vue.createElementVNode("div",_hoisted_2$I,[vue.createVNode(vue.unref(elementPlus.ElButtonGroup),null,{default:vue.withCtx(()=>[(vue.openBlock(!0),vue.createElementBlock(vue.Fragment,null,vue.renderList(vue.unref(l),x=>(vue.openBlock(),vue.createBlock(vue.unref(elementPlus.ElButton),{type:vue.unref(s)==x.value?"primary":"",key:x.value,onClick:C=>s.value=x.value},{default:vue.withCtx(()=>[vue.createTextVNode(vue.toDisplayString(x.label),1)]),_:2},1032,["type","onClick"]))),128))]),_:1})]),vue.createElementVNode("div",_hoisted_3$B,[vue.createVNode(vue.unref(elementPlus.ElSkeleton),{animated:"",loading:vue.unref(v),count:2},{default:vue.withCtx(()=>[vue.createVNode(vue.unref(elementPlus.ElTree),{class:"animated fadeIn",ref_key:"treeRef",ref:a,data:vue.unref(s)=="DWD"?vue.unref(p):vue.unref(f),"node-key":"id","empty-text":"暂无数据","default-expand-all":"","highlight-current":"","filter-node-method":d,onNodeClick:g},{default:vue.withCtx(({node:x,data:C})=>[x.level!=1?(vue.openBlock(),vue.createElementBlock(vue.Fragment,{key:0},[C.modelCode&&C.openForm!=2?(vue.openBlock(),vue.createElementBlock("i",{key:0,class:vue.normalizeClass(["mr-1 -ml-5 text-base ri-checkbox-circle-fill",[C.publishStatus==2?"text-color-success":"text-color-info"]])},null,2)):vue.createCommentVNode("",!0)],64)):vue.createCommentVNode("",!0),C.openForm==2?(vue.openBlock(),vue.createElementBlock("i",_hoisted_4$A)):vue.createCommentVNode("",!0),vue.createElementVNode("span",{class:vue.normalizeClass({"font-bold":x.level==1})},vue.toDisplayString(C.modelName),3)]),_:1},8,["data"])]),_:1},8,["loading"])])],64)}}}),_withScopeId$l=i=>(vue.pushScopeId("data-v-8dbf5661"),i=i(),vue.popScopeId(),i),_hoisted_1$P={class:"mt-3"},_hoisted_2$H=_withScopeId$l(()=>vue.createElementVNode("td",null,"字段名称",-1)),_hoisted_3$A=_withScopeId$l(()=>vue.createElementVNode("td",null,"字段描述",-1)),_hoisted_4$z=_withScopeId$l(()=>vue.createElementVNode("td",null,"映射字段",-1)),_hoisted_5$u=_withScopeId$l(()=>vue.createElementVNode("td",{width:"120px"},"数据类型",-1)),_hoisted_6$p=_withScopeId$l(()=>vue.createElementVNode("td",null,"数据长度",-1)),_hoisted_7$m=_withScopeId$l(()=>vue.createElementVNode("td",null,"数据标度",-1)),_hoisted_8$k=_withScopeId$l(()=>vue.createElementVNode("td",null,"是否主键",-1)),_hoisted_9$h=_withScopeId$l(()=>vue.createElementVNode("td",null,"唯一校验",-1)),_hoisted_10$g=_withScopeId$l(()=>vue.createElementVNode("td",{style:{width:"50px"}},null,-1)),_hoisted_11$d={class:"sort-target"},_hoisted_12$b={key:0},_hoisted_13$9=["onClick"],_hoisted_14$8=_withScopeId$l(()=>vue.createElementVNode("td",null,[vue.createElementVNode("i",{class:"text-lg cursor-move ri-mouse-line handle text-color-warning"})],-1)),_sfc_main$10=vue.defineComponent({__name:"attribute",props:vue.mergeModels({isRequired:{default:1}},{modelValue:{},modelModifiers:{}}),emits:["update:modelValue"],setup(i,{expose:n}){const r=vue.useModel(i,"modelValue");vue.getCurrentInstance();const o=vue.ref(null),a=vue.ref({attributeCode:[{required:!0,message:"请输入字段名称"},{pattern:/^[A-Za-z]\w*$/,message:"只能以字母开头,由字母/数字/下划线组成",trigger:"blur"}],attributeComment:[{required:!0,message:"请输入字段描述"}],mapCode:[{required:!0,message:"请输入映射字段"}],dataType:[{required:!0,message:"请选择数据类型"}],dataLength:[{required:!0,message:"请输入数据长度"}],dataScale:[{required:!0,message:"请输入数据标度"}],primaryKey:[{required:!0,message:"请选择是否为主键"}]}),l=p=>{const v=p.dataType;v!=="decimal"&&(p.dataScale=0),["autoIncrement","date","time","datetime","int","bigint","double","text"].includes(v)&&(p.dataLength=0),v==="decimal"&&(p.dataLength=10,p.dataScale=6),v==="varchar"&&(p.dataLength=255)},s=(p,v)=>{p.primaryKey==2&&vue.unref(r).forEach((g,_)=>{_!=v&&(g.primaryKey=1)})},u=()=>{vue.unref(r).push({nanoid:nanoid()})},c=p=>{vue.unref(r).splice(p,1)};return n({validate:async()=>await vue.unref(o).validate(p=>p),isRepeat:()=>{const p=new Map;let v="";for(let m=0;m<vue.unref(r).length;m++){let g=vue.unref(r)[m],_=p.get(g.attributeCode);_!=null&&(v+="字段名称 <strong>"+g.attributeCode+"</strong> 重复(<i>第"+(_+1)+"行和第"+(m+1)+"行</i>);<br>"),p.set(vue.unref(r)[m].attributeCode,m)}return v}}),(p,v)=>(vue.openBlock(),vue.createBlock(vue.unref(elementPlus.ElForm),{"label-width":"0",model:{modelValue:r.value},size:"small",ref_key:"elFormRef",ref:o,rules:vue.unref(a)},{default:vue.withCtx(()=>[vue.createVNode(vue.unref(vueDraggablePlus.VueDraggable),{modelValue:r.value,"onUpdate:modelValue":v[0]||(v[0]=m=>r.value=m),target:".sort-target",animation:150,handle:".handle"},{default:vue.withCtx(()=>[vue.createElementVNode("table",_hoisted_1$P,[vue.createElementVNode("tr",null,[vue.createElementVNode("td",{style:{width:"50px"}},[vue.createElementVNode("i",{class:"text-lg cursor-pointer ri-add-circle-line text-color-primary",onClick:u})]),_hoisted_2$H,_hoisted_3$A,_hoisted_4$z,_hoisted_5$u,_hoisted_6$p,_hoisted_7$m,_hoisted_8$k,_hoisted_9$h,_hoisted_10$g]),vue.createElementVNode("tbody",_hoisted_11$d,[(vue.openBlock(!0),vue.createElementBlock(vue.Fragment,null,vue.renderList(r.value,(m,g)=>(vue.openBlock(),vue.createElementBlock(vue.Fragment,{key:m.nanoid},[m.hide?vue.createCommentVNode("",!0):(vue.openBlock(),vue.createElementBlock("tr",_hoisted_12$b,[vue.createElementVNode("td",null,[vue.createElementVNode("i",{class:"text-lg cursor-pointer ri-indeterminate-circle-line text-color-danger",onClick:_=>c(g)},null,8,_hoisted_13$9)]),vue.createElementVNode("td",null,[vue.createVNode(vue.unref(elementPlus.ElFormItem),{prop:"modelValue."+g+".attributeCode",rules:vue.unref(a).attributeCode},{default:vue.withCtx(()=>[vue.createVNode(vue.unref(elementPlus.ElInput),{modelValue:m.attributeCode,"onUpdate:modelValue":_=>m.attributeCode=_,maxlength:"30",showWordLimit:"",placeholder:"字段名称"},null,8,["modelValue","onUpdate:modelValue"])]),_:2},1032,["prop","rules"])]),vue.createElementVNode("td",null,[vue.createVNode(vue.unref(elementPlus.ElFormItem),{prop:"modelValue."+g+".attributeComment",rules:vue.unref(a).attributeComment},{default:vue.withCtx(()=>[vue.createVNode(vue.unref(elementPlus.ElInput),{modelValue:m.attributeComment,"onUpdate:modelValue":_=>m.attributeComment=_,maxlength:"30",showWordLimit:"",placeholder:"字段描述"},null,8,["modelValue","onUpdate:modelValue"])]),_:2},1032,["prop","rules"])]),vue.createElementVNode("td",null,[vue.createVNode(vue.unref(elementPlus.ElFormItem),{prop:"modelValue."+g+".mapCode",rules:vue.unref(a).mapCode},{default:vue.withCtx(()=>[vue.createVNode(vue.unref(elementPlus.ElInput),{modelValue:m.mapCode,"onUpdate:modelValue":_=>m.mapCode=_,maxlength:"30",showWordLimit:"",placeholder:"映射字段"},null,8,["modelValue","onUpdate:modelValue"])]),_:2},1032,["prop","rules"])]),vue.createElementVNode("td",null,[vue.createVNode(vue.unref(elementPlus.ElFormItem),{prop:"modelValue."+g+".dataType",rules:vue.unref(a).dataType},{default:vue.withCtx(()=>[vue.createVNode(vue.unref(elementPlus.ElSelect),{modelValue:m.dataType,"onUpdate:modelValue":_=>m.dataType=_,placeholder:"数据类型",class:"w-full",teleported:!1,onChange:()=>l(m)},{default:vue.withCtx(()=>[(vue.openBlock(!0),vue.createElementBlock(vue.Fragment,null,vue.renderList(vue.unref(commonDataType),_=>(vue.openBlock(),vue.createBlock(vue.unref(elementPlus.ElOption),{key:_.value,label:_.label,value:_.value},null,8,["label","value"]))),128))]),_:2},1032,["modelValue","onUpdate:modelValue","onChange"])]),_:2},1032,["prop","rules"])]),vue.createElementVNode("td",null,[vue.createVNode(vue.unref(elementPlus.ElFormItem),{prop:"modelValue."+g+".dataLength",rules:vue.unref(a).dataLength},{default:vue.withCtx(()=>[vue.createVNode(vue.unref(elementPlus.ElInputNumber),{min:0,max:2048,"value-on-clear":0,"controls-position":"right",modelValue:m.dataLength,"onUpdate:modelValue":_=>m.dataLength=_,disabled:["autoIncrement","date","time","datetime","int","bigint","double","text"].includes(m.dataType),placeholder:"长度",style:{width:"100%"}},null,8,["modelValue","onUpdate:modelValue","disabled"])]),_:2},1032,["prop","rules"])]),vue.createElementVNode("td",null,[vue.createVNode(vue.unref(elementPlus.ElFormItem),{prop:"modelValue."+g+".dataScale",rules:vue.unref(a).dataScale},{default:vue.withCtx(()=>[vue.createVNode(vue.unref(elementPlus.ElInputNumber),{modelValue:m.dataScale,"onUpdate:modelValue":_=>m.dataScale=_,min:0,max:2048,"value-on-clear":0,"controls-position":"right",disabled:!["decimal"].includes(m.dataType),placeholder:"标度",style:{width:"100%"}},null,8,["modelValue","onUpdate:modelValue","disabled"])]),_:2},1032,["prop","rules"])]),vue.createElementVNode("td",null,[vue.createVNode(vue.unref(elementPlus.ElSwitch),{modelValue:m.primaryKey,"onUpdate:modelValue":_=>m.primaryKey=_,"inline-prompt":"","active-text":"是","inactive-text":"否","active-value":"2","inactive-value":"1",onChange:()=>s(m,g)},null,8,["modelValue","onUpdate:modelValue","onChange"])]),vue.createElementVNode("td",null,[vue.createVNode(vue.unref(elementPlus.ElSwitch),{modelValue:m.uniqueKey,"onUpdate:modelValue":_=>m.uniqueKey=_,"inline-prompt":"","active-text":"是","inactive-text":"否","active-value":"2","inactive-value":"1"},null,8,["modelValue","onUpdate:modelValue"])]),_hoisted_14$8]))],64))),128))])])]),_:1},8,["modelValue"])]),_:1},8,["model","rules"]))}}),attribute_vue_vue_type_style_index_0_scoped_8dbf5661_lang="",Attribute=_export_sfc$2(_sfc_main$10,[["__scopeId","data-v-8dbf5661"]]),_withScopeId$k=i=>(vue.pushScopeId("data-v-a3938966"),i=i(),vue.popScopeId(),i),_hoisted_1$O={class:"flex flex-col h-full"},_hoisted_2$G={class:"flex flex-1 overflow-hidden"},_hoisted_3$z={class:"flex flex-col flex-1 mr-3 overflow-hidden"},_hoisted_4$y={class:"h"},_hoisted_5$t=["onClick"],_hoisted_6$o={class:"mr-1 text-base"},_hoisted_7$l={class:"ml-2 text-xs text-color-info"},_hoisted_8$j={class:"text-color-warning"},_hoisted_9$g={class:"flex justify-end flex-1"},_hoisted_10$f=_withScopeId$k(()=>vue.createElementVNode("i",{class:"mr-1 ri-play-mini-fill"},null,-1)),_hoisted_11$c={class:"flex-1 overflow-hidden b"},_hoisted_12$a={class:"flex flex-col flex-1 overflow-hidden"},_hoisted_13$8={class:"h"},_hoisted_14$7=["onClick"],_hoisted_15$3={class:"flex-1 overflow-hidden b"},_hoisted_16$3={class:"flex flex-1 mt-3 overflow-hidden"},_hoisted_17$3={class:"flex flex-col flex-1 mr-3 overflow-hidden"},_hoisted_18$3={class:"flex h"},_hoisted_19$3=["onClick"],_hoisted_20$3={key:0,class:"mr-1 text-color-danger"},_hoisted_21$3={class:"mr-1 text-base"},_hoisted_22$3={key:0,class:"flex justify-end flex-1"},_hoisted_23$3=_withScopeId$k(()=>vue.createElementVNode("i",{class:"mr-1 ri-play-mini-fill"},null,-1)),_hoisted_24$2={class:"flex-1 overflow-hidden b"},_hoisted_25$2={key:0,class:"flex items-center justify-center h-full"},_hoisted_26$2=_withScopeId$k(()=>vue.createElementVNode("i",{class:"ri-table-fill"},null,-1)),_hoisted_27$1=_withScopeId$k(()=>vue.createElementVNode("i",{class:"ri-database-2-fill"},null,-1)),_hoisted_28$1={class:"h-full mt-2 overflow-y-auto"},_hoisted_29$1={class:"overflow-y-auto max-h-96",style:{"min-height":"300px"}},_hoisted_30$1=_withScopeId$k(()=>vue.createElementVNode("span",{class:"mr-1 text-color-danger"},"*",-1)),_hoisted_31$1={class:"h-full mt-2 overflow-y-auto"},_hoisted_32$1={class:"mt-2"},_hoisted_33$1={key:0,class:"flex flex-col flex-1 overflow-hidden"},_hoisted_34$1={class:"h"},_hoisted_35$1=["onClick"],_hoisted_36$1={class:"flex-1 overflow-hidden b"},_sfc_main$$=vue.defineComponent({__name:"design",props:{widgetType:{default:""}},emits:["success"],setup(i,{expose:n,emit:r}){const o=i,a=r,{proxy:l}=vue.getCurrentInstance(),{setFormValue:s,getFormValue:u}=l.$globalHooks.useForm(),{openMessage:c}=l.$globalHooks.useMessage(),d=vue.inject("projectList"),f=vue.computed(()=>{var j,ee;return((ee=(j=(vue.unref(d)??[]).find(le=>le.value==l.$baseGetCurrentProjectId()))==null?void 0:j.ext)==null?void 0:ee.storeType)??"-"}),p=[{label:"SQL编写",value:"1",num:"①"}],v=vue.ref("1"),m=[{label:"SQL执行结果",value:"1"},{label:"SQL执行结果(JSON)",value:"2"}],g=vue.ref("1"),_=vue.ref([]),y=vue.ref(""),b=vue.ref("1"),x=[{label:"插件执行结果",value:"1"},{label:"插件执行结果(JSON)",value:"2"}],C=vue.ref("1"),w=vue.ref(!1),E=vue.ref(null),$=vue.ref(""),S=vue.ref([]),V=vue.ref(""),k=vue.ref([]),P=vue.ref(`function plugin(item){
616
616
  var data=JSON.parse(item);
617
617
  return JSON.stringify(data)
618
618
  }`),T=vue.ref([]),B=vue.ref(!1),N=vue.ref([]),O=vue.ref(!1),I=vue.ref(null),L=vue.ref(""),D=vue.computed(()=>z.find(j=>j.fieldName=="extractType"));vue.watch(w,j=>{j&&!vue.unref(N).length&&J("javascript",!1)});const F=(j=!1)=>{const ee=R.find(le=>le.fieldName=="modelLayer");j&&(ee.value=""),(ee.options??[]).forEach(le=>{le.disabled=vue.unref(y)=="view",le.value=="ODSVIEW"&&(le.disabled=vue.unref(y)!="view")})},M=vue.ref(""),R=vue.reactive([{name:"项目名称",type:FieldType.Select,fieldName:"projectId",value:"",required:!0,props:{url:"/api/ace-data-center/project/options",label:"label",value:"code"},hide:!0},{name:"模型层级",type:FieldType.Select,fieldName:"modelLayer",value:"",required:!0,props:{url:"/api/ace-api/blade-system/dict-biz/dictionary?code=modelLayer",label:"dictValue",value:"dictKey"},optionsSuccess:()=>{F()},changeFunc:j=>{const ee=R.find(se=>se.fieldName==="modelType");ee.required=j.value=="DWD",ee.disabled=j.value!="DWD";const le=`${((j==null?void 0:j.value)??"").toLocaleLowerCase()}_`;M.value=le,R.find(se=>se.fieldName==="modelCode").prepend=vue.h("div",{},le)}},{name:"模型名称",type:FieldType.Text,fieldName:"modelName",value:"",required:!0},{name:"模型表名",type:FieldType.Text,fieldName:"modelCode",value:"",required:!0},{name:"模型类型",type:FieldType.Select,fieldName:"modelType",value:"",props:{url:"/api/ace-api/blade-system/dict-biz/dictionary?code=modelType",label:"dictValue",value:"dictKey"}}]);vue.watch(y,j=>{_.value=[{label:"输出结果",value:"1",num:"②",isRequired:!1}],j=="view"?_.value.push({label:"输出模型",value:"2",num:"③",isRequired:!1}):o.widgetType=="model-add"?_.value.push({label:"ETL插件编写",value:"2",num:"③",isRequired:!1},{label:"输出模型",value:"3",num:"④",isRequired:!0},{label:"方案作业配置",value:"4",num:"⑤",isRequired:!0}):_.value.push({label:"ETL插件编写",value:"2",num:"③",isRequired:!1},{label:"方案作业配置",value:"4",num:"④",isRequired:!0}),F(!0)},{immediate:!0});const z=vue.reactive([{name:"方案名称",type:FieldType.Text,fieldName:"extractName",value:"",required:!0},{name:"数据流类型",type:FieldType.Radio,fieldName:"streamType",value:"",required:!0,options:[{label:"标准流",value:"STANDARD"},{label:"自定义流",value:"CUSTOM"}]},{name:"抽取方式",type:FieldType.Radio,fieldName:"extractType",value:"",required:!0,options:[{label:"全量抽取",value:"1"},{label:"增量抽取",value:"2"},{label:"协同抽取",value:"3"}],changeFunc:j=>{z.find(le=>le.fieldName=="incrementalField").hide=j.value!=2,z.find(le=>le.fieldName=="incrementalCondition").hide=j.value!=2,z.find(le=>le.fieldName=="incrementalConditionKey").hide=j.value!=2;const ee=z.find(le=>le.fieldName=="clearBeforeExt");ee.hide=j.value!=1,j.isChange&&j.value!=1&&(ee.value="0")}},{name:"清空历史数据",type:FieldType.Radio,fieldName:"clearBeforeExt",value:"",required:!0,options:[{label:"是",value:"1"},{label:"否",value:"0"}],defVal:"0"},{name:"增量字段",type:FieldType.Slot,fieldName:"incrementalField",value:"",required:!0,hide:!0,tip:"该字段必须为本模型字段,并且是SQL结果集中存在的字段"},{name:"增量条件",type:FieldType.Slot,fieldName:"incrementalCondition",value:"",width:"60%"},{name:"增量值",type:FieldType.Text,fieldName:"incrementalConditionKey",width:"40%",value:""},{name:"taskDefinedId",type:FieldType.Text,fieldName:"taskDefinedId",hide:!0},{name:"id",type:FieldType.Text,fieldName:"id",hide:!0}]),U=vue.ref(null),G=(j={})=>{vue.nextTick(()=>{y.value=o.widgetType.indexOf("ODSVIEW")==-1?"dataTable":"view";const ee=((j==null?void 0:j.incrementalCondition)??"").split("=");if(ee.length&&(j.incrementalCondition=ee[0]??"",j.incrementalConditionKey=(ee[1]??"").replace(/^'|'$/g,"")),s(j??{},z),j!=null&&j.taskDefined&&(O.value=!0),o.widgetType.indexOf("ODSVIEW")>=0&&(b.value="2"),V.value=(j==null?void 0:j.extractSql)??"",P.value=(j==null?void 0:j.extractPluginScript)??`function plugin(item){