ace-component-lib 0.0.93 → 0.0.94
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(te,U){typeof exports=="object"&&typeof module<"u"?module.exports=U(require("pinia"),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(["pinia","@wangeditor/editor","vue","element-plus","vue-draggable-plus","dayjs","echarts/core","@wangeditor/editor-for-vue","jsoneditor"],U):(te=typeof globalThis<"u"?globalThis:te||self,te["ace-component-lib"]=U(te.pinia,te.editor,te.Vue,te.elementPlus,te.vueDraggablePlus,te.dayjs,te.core,te.editorForVue,te.JsonEditor))})(this,function(pinia,editor,vue,elementPlus,vueDraggablePlus,dayjs,core,editorForVue,JsonEditor){"use strict";var Dt=Object.defineProperty;var It=(te,U,G)=>U in te?Dt(te,U,{enumerable:!0,configurable:!0,writable:!0,value:G}):te[U]=G;var Et=(te,U,G)=>(It(te,typeof U!="symbol"?U+"":U,G),G);const version="0.0.93",aceLib="";let e$3=class{constructor(U){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,U),this.init()}init(){this.counter++,this.settings.id=`printArea_${this.counter}`;let U="";this.settings.url&&!this.settings.asyncUrl&&(U=this.settings.url);let G=this;if(this.settings.asyncUrl)return void G.settings.asyncUrl(function(ne){let re=G.getPrintWindow(ne);G.settings.preview?G.previewIfrmaeLoad():G.print(re)},G.settings.vue);let ee=this.getPrintWindow(U);this.settings.url||this.write(ee.doc),this.settings.preview?this.previewIfrmaeLoad():this.print(ee)}addEvent(U,G,ee){U.addEventListener?U.addEventListener(G,ee,!1):U.attachEvent?U.attachEvent("on"+G,ee):U["on"+G]=ee}previewIfrmaeLoad(){let U=document.getElementById("vue-pirnt-nb-previewBox");if(U){let G=this,ee=U.querySelector("iframe");this.settings.previewBeforeOpenCallback(),this.addEvent(ee,"load",function(){G.previewBoxShow(),G.removeCanvasImg(),G.settings.previewOpenCallback()}),this.addEvent(U.querySelector(".previewBodyUtilPrintBtn"),"click",function(){G.settings.beforeOpenCallback(),G.settings.openCallback(),ee.contentWindow.print(),G.settings.closeCallback()})}}removeCanvasImg(){let U=this;try{if(U.elsdom){let G=U.elsdom.querySelectorAll(".canvasImg");for(let ee=0;ee<G.length;ee++)G[ee].remove()}}catch(G){console.log(G)}}print(U){var G=this;let ee=document.getElementById(this.settings.id)||U.f,ne=document.getElementById(this.settings.id).contentWindow||U.f.contentWindow;G.settings.beforeOpenCallback(),G.addEvent(ee,"load",function(){ne.focus(),G.settings.openCallback(),ne.print(),ee.remove(),G.settings.closeCallback(),G.removeCanvasImg()})}write(U){U.open(),U.write(`${this.docType()}<html>${this.getHead()}${this.getBody()}</html>`),U.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 U="",G="",ee="";this.settings.extraHead&&this.settings.extraHead.replace(/([^,]+)/g,re=>{U+=re}),[].forEach.call(document.querySelectorAll("link"),function(re){re.href.indexOf(".css")>=0&&(G+=`<link type="text/css" rel="stylesheet" href="${re.href}" >`)});let ne=document.styleSheets;if(ne&&ne.length>0)for(let re=0;re<ne.length;re++)try{if(ne[re].cssRules||ne[re].rules){let oe=ne[re].cssRules||ne[re].rules;for(let ie=0;ie<oe.length;ie++)ee+=oe[ie].cssText}}catch(oe){console.log(ne[re].href+oe)}return this.settings.extraCss&&this.settings.extraCss.replace(/([^,\s]+)/g,re=>{G+=`<link type="text/css" rel="stylesheet" href="${re}">`}),`<head><title>${this.settings.popTitle}</title>${U}${G}<style type="text/css">${ee}</style></head>`}getBody(){let U=this.settings.ids;return U=U.replace(new RegExp("#","g"),""),this.elsdom=this.beforeHanler(document.getElementById(U)),"<body>"+this.getFormData(this.elsdom).outerHTML+"</body>"}beforeHanler(U){let G=U.querySelectorAll("canvas");for(let ee=0;ee<G.length;ee++)if(!G[ee].style.display){let ne=G[ee].parentNode,re=G[ee].toDataURL("image/png"),oe=new Image;oe.className="canvasImg",oe.style.display="none",oe.src=re,ne.appendChild(oe)}return U}getFormData(U){let G=U.cloneNode(!0),ee=G.querySelectorAll("input,select,textarea"),ne=G.querySelectorAll(".canvasImg,canvas"),re=-1;for(let oe=0;oe<ne.length;oe++){let ie=ne[oe].parentNode,le=ne[oe];le.tagName.toLowerCase()==="canvas"?ie.removeChild(le):le.style.display="block"}for(let oe=0;oe<ee.length;oe++){let ie=ee[oe],le=ie.getAttribute("type"),ae=ee[oe];if(le||(le=ie.tagName==="SELECT"?"select":ie.tagName==="TEXTAREA"?"textarea":""),ie.tagName==="INPUT")le==="radio"||le==="checkbox"?ie.checked&&ae.setAttribute("checked",ie.checked):(ae.value=ie.value,ae.setAttribute("value",ie.value));else if(le==="select"){re++;for(let se=0;se<U.querySelectorAll("select").length;se++){let ue=U.querySelectorAll("select")[se];if(!ue.getAttribute("newbs")&&ue.setAttribute("newbs",se),ue.getAttribute("newbs")==re){let ce=U.querySelectorAll("select")[re].selectedIndex;ie.options[ce].setAttribute("selected",!0)}}}else ae.innerHTML=ie.value,ae.setAttribute("html",ie.value)}return G}getPrintWindow(U){var G=this.Iframe(U);return{f:G,win:G.contentWindow||G,doc:G.doc}}previewBoxShow(){let U=document.getElementById("vue-pirnt-nb-previewBox");U&&(document.querySelector("html").setAttribute("style","overflow: hidden"),U.style.display="block")}previewBoxHide(){let U=document.getElementById("vue-pirnt-nb-previewBox");U&&(document.querySelector("html").setAttribute("style","overflow: visible;"),U.querySelector("iframe")&&U.querySelector("iframe").remove(),U.style.display="none")}previewBox(){let U=document.getElementById("vue-pirnt-nb-previewBox"),G="previewBody";if(U)return U.querySelector("iframe")&&U.querySelector("iframe").remove(),{close:U.querySelector(".previewClose"),previewBody:U.querySelector(".previewBody")};let ee=document.createElement("div");ee.setAttribute("id","vue-pirnt-nb-previewBox"),ee.setAttribute("style","position: fixed;top: 0px;left: 0px;width: 100%;height: 100%;background: white;display:none"),ee.style.zIndex=this.settings.zIndex;let ne=document.createElement("div");ne.setAttribute("class","previewHeader"),ne.setAttribute("style","padding: 5px 20px;"),ne.innerHTML=this.settings.previewTitle,ee.appendChild(ne),this.close=document.createElement("div");let re=this.close;re.setAttribute("class","previewClose"),re.setAttribute("style","position: absolute;top: 5px;right: 20px;width: 25px;height: 20px;cursor: pointer;");let oe=document.createElement("div"),ie=document.createElement("div");oe.setAttribute("class","closeBefore"),oe.setAttribute("style","position: absolute;width: 3px;height: 100%;background: #040404;transform: rotate(45deg); top: 0px;left: 50%;"),ie.setAttribute("class","closeAfter"),ie.setAttribute("style","position: absolute;width: 3px;height: 100%;background: #040404;transform: rotate(-45deg); top: 0px;left: 50%;"),re.appendChild(oe),re.appendChild(ie),ne.appendChild(re),this.previewBody=document.createElement("div");let le=this.previewBody;le.setAttribute("class",G),le.setAttribute("style","display: flex;flex-direction: column; height: 100%;"),ee.appendChild(le);let ae=document.createElement("div");ae.setAttribute("class","previewBodyUtil"),ae.setAttribute("style","height: 32px;background: #474747;position: relative;"),le.appendChild(ae),this.previewBodyUtilPrintBtn=document.createElement("div");let se=this.previewBodyUtilPrintBtn;return se.setAttribute("class","previewBodyUtilPrintBtn"),se.innerHTML=this.settings.previewPrintBtnLabel,se.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);"),ae.appendChild(se),document.body.appendChild(ee),{close:this.close,previewBody:this.previewBody}}iframeBox(U,G){let ee=document.createElement("iframe");return ee.style.border="0px",ee.style.position="absolute",ee.style.width="0px",ee.style.height="0px",ee.style.right="0px",ee.style.top="0px",ee.setAttribute("id",U),ee.setAttribute("src",G),ee}Iframe(U){let G=this.settings.id;U=U||new Date().getTime();let ee=this,ne=this.iframeBox(G,U);try{if(this.settings.preview){ne.setAttribute("style","border: 0px;flex: 1;");let re=this.previewBox(),oe=re.previewBody,ie=re.close;oe.appendChild(ne),this.addEvent(ie,"click",function(){ee.previewBoxHide()})}else document.body.appendChild(ne);ne.doc=null,ne.doc=ne.contentDocument?ne.contentDocument:ne.contentWindow?ne.contentWindow.document:ne.document}catch(re){throw new Error(re+". iframes may not be supported in this browser.")}if(ne.doc==null)throw new Error("Cannot find document.");return ne}};var t$2={directiveName:"print",mounted(te,U,G){let ee=U.instance,ne="";var re,oe,ie;oe="click",ie=()=>{if(typeof U.value=="string")ne=U.value;else{if(typeof U.value!="object"||!U.value.id)return void window.print();{ne=U.value.id;let ae=ne.replace(new RegExp("#","g"),"");document.getElementById(ae)||(console.log("id in Error"),ne="")}}le()},(re=te).addEventListener?re.addEventListener(oe,ie,!1):re.attachEvent?re.attachEvent("on"+oe,ie):re["on"+oe]=ie;const le=()=>{new e$3({ids:ne,vue:ee,url:U.value.url,standard:"",extraHead:U.value.extraHead,extraCss:U.value.extraCss,zIndex:U.value.zIndex||20002,previewTitle:U.value.previewTitle||"打印预览",previewPrintBtnLabel:U.value.previewPrintBtnLabel||"打印",popTitle:U.value.popTitle,preview:U.value.preview||!1,asyncUrl:U.value.asyncUrl,previewBeforeOpenCallback(){U.value.previewBeforeOpenCallback&&U.value.previewBeforeOpenCallback(ee)},previewOpenCallback(){U.value.previewOpenCallback&&U.value.previewOpenCallback(ee)},openCallback(){U.value.openCallback&&U.value.openCallback(ee)},closeCallback(){U.value.closeCallback&&U.value.closeCallback(ee)},beforeOpenCallback(){U.value.beforeOpenCallback&&U.value.beforeOpenCallback(ee)}})}},install:function(te){te.directive("print",t$2)}},FieldRenderType=(te=>(te.String="string",te.Integer="interget",te))(FieldRenderType||{}),DynamicTableType=(te=>(te.Default="default",te.DataForm="dataForm",te))(DynamicTableType||{}),ItableType=(te=>(te.Link="link",te))(ItableType||{}),FieldType=(te=>(te.Text="text",te.Select="select",te.Date="date",te.DateTime="datetime",te.CheckBox="checkbox",te.Switch="switch",te.Radio="radio",te.Textarea="textarea",te.Number="number",te.NumberRange="numberRange",te.Cascader="cascader",te.Daterange="daterange",te.Monthrange="monthrange",te.File="file",te.TreeSelect="treeSelect",te.Year="year",te.Month="month",te.Hr="hr",te.Slot="slot",te.Editor="editor",te.Password="password",te.Json="json",te.Markdown="markdown",te.Rate="rate",te.TimeRange="timerange",te.Time="time",te.DateTimeRange="datetimerange",te))(FieldType||{});let nanoid=(te=21)=>crypto.getRandomValues(new Uint8Array(te)).reduce((U,G)=>(G&=63,G<36?U+=G.toString(36):G<62?U+=(G-26).toString(36).toUpperCase():G>62?U+="-":U+="_",U),"");const screenDesignMainStore=pinia.defineStore({id:"design",state:()=>({theme:localStorage.getItem("design-theme")||"",stageWidth:1920,stageHeight:1080,scale:.2,targetsWidget:[],sketchRuleLine:{h:[],v:[]},widgetConfg:{config:{backgroundColor:"transparent",backgroundImage:""},list:[]},widgetHoverIds:[],pasteWidget:[],createLoading:!1,showRightPannel:!1,tempChartData:{},chartData:{},countMap:{}}),getters:{getScale(){return this.scale},getStage(){return{stageWidth:this.stageWidth,stageHeight:this.stageHeight}},getSketchRuleLine(){return this.sketchRuleLine},getTargetWidget(){return this.targetsWidget},getWidgetConfig(){return this.widgetConfg.config},getWidgetList(){return this.widgetConfg.list},getWidgetHoverIds(){return this.widgetHoverIds},getPasteWidget(){return this.pasteWidget},getCreateLoading(){return this.createLoading},getRightPannel(){return this.showRightPannel},getTheme(){return this.theme},getChartData(){return this.chartData},getCountMap(){return this.countMap}},actions:{setSacle(te){this.scale=te/100},setSketchRuleLine(te,U){this.sketchRuleLine.h=te,this.sketchRuleLine.v=U},clearSketchRuleLine(){this.sketchRuleLine={h:[],v:[]}},setTargetWidget(te){this.targetsWidget=te},setWidgetList(te){this.widgetConfg.list=te},setWidgetHoverIds(te){this.widgetHoverIds=te},delWidgetItem(te){this.setWidgetList(this.getWidgetList.filter(U=>!te.includes(U.id))),this.setTargetWidget(this.getTargetWidget.filter(U=>!te.includes(U.id)))},copyWidgetItem(te){this.pasteWidget=[],te.forEach(U=>{const G=this.getWidgetList.find(ee=>ee.id==U);G&&this.pasteWidget.push(G)})},pasteWidgetItem(){this.pasteWidget.forEach(G=>{const ee=JSON.parse(JSON.stringify(G));let ne=ee.x,re=ee.y;ee.x+40>this.stageWidth-ee.w?ne=this.stageWidth-ee.w-40:ne+=40,ee.y+40>this.stageHeight-ee.h?re=this.stageHeight-ee.h-40:re+=40,this.widgetConfg.list.unshift({...ee,id:nanoid(),x:ne,y:re,z:this.widgetConfg.list.length+1,locked:!1})})},sortWidgetList(){this.widgetConfg.list.sort((te,U)=>U.z-te.z)},setCreateLoading(te){this.createLoading=te,te&&(this.targetsWidget=[],this.clearSketchRuleLine())},setRightPannel(te){this.showRightPannel=te},setStageWidth(te){this.stageWidth=te,this.widgetConfg.config.stageWidth=te},setStageHeight(te){this.stageHeight=te,this.widgetConfg.config.stageHeight=te},setTheme(){this.theme=this.theme=="dark"?"":"dark",document.getElementsByTagName("html")[0].className=this.theme,localStorage.setItem("design-theme",this.theme)},setChartData(te){this.chartData=te},setCountMap(te,U){this.countMap[te]=U}}});/*!
|
|
1
|
+
(function(te,U){typeof exports=="object"&&typeof module<"u"?module.exports=U(require("pinia"),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(["pinia","@wangeditor/editor","vue","element-plus","vue-draggable-plus","dayjs","echarts/core","@wangeditor/editor-for-vue","jsoneditor"],U):(te=typeof globalThis<"u"?globalThis:te||self,te["ace-component-lib"]=U(te.pinia,te.editor,te.Vue,te.elementPlus,te.vueDraggablePlus,te.dayjs,te.core,te.editorForVue,te.JsonEditor))})(this,function(pinia,editor,vue,elementPlus,vueDraggablePlus,dayjs,core,editorForVue,JsonEditor){"use strict";var Dt=Object.defineProperty;var It=(te,U,G)=>U in te?Dt(te,U,{enumerable:!0,configurable:!0,writable:!0,value:G}):te[U]=G;var Et=(te,U,G)=>(It(te,typeof U!="symbol"?U+"":U,G),G);const version="0.0.94",aceLib="";let e$3=class{constructor(U){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,U),this.init()}init(){this.counter++,this.settings.id=`printArea_${this.counter}`;let U="";this.settings.url&&!this.settings.asyncUrl&&(U=this.settings.url);let G=this;if(this.settings.asyncUrl)return void G.settings.asyncUrl(function(ne){let re=G.getPrintWindow(ne);G.settings.preview?G.previewIfrmaeLoad():G.print(re)},G.settings.vue);let ee=this.getPrintWindow(U);this.settings.url||this.write(ee.doc),this.settings.preview?this.previewIfrmaeLoad():this.print(ee)}addEvent(U,G,ee){U.addEventListener?U.addEventListener(G,ee,!1):U.attachEvent?U.attachEvent("on"+G,ee):U["on"+G]=ee}previewIfrmaeLoad(){let U=document.getElementById("vue-pirnt-nb-previewBox");if(U){let G=this,ee=U.querySelector("iframe");this.settings.previewBeforeOpenCallback(),this.addEvent(ee,"load",function(){G.previewBoxShow(),G.removeCanvasImg(),G.settings.previewOpenCallback()}),this.addEvent(U.querySelector(".previewBodyUtilPrintBtn"),"click",function(){G.settings.beforeOpenCallback(),G.settings.openCallback(),ee.contentWindow.print(),G.settings.closeCallback()})}}removeCanvasImg(){let U=this;try{if(U.elsdom){let G=U.elsdom.querySelectorAll(".canvasImg");for(let ee=0;ee<G.length;ee++)G[ee].remove()}}catch(G){console.log(G)}}print(U){var G=this;let ee=document.getElementById(this.settings.id)||U.f,ne=document.getElementById(this.settings.id).contentWindow||U.f.contentWindow;G.settings.beforeOpenCallback(),G.addEvent(ee,"load",function(){ne.focus(),G.settings.openCallback(),ne.print(),ee.remove(),G.settings.closeCallback(),G.removeCanvasImg()})}write(U){U.open(),U.write(`${this.docType()}<html>${this.getHead()}${this.getBody()}</html>`),U.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 U="",G="",ee="";this.settings.extraHead&&this.settings.extraHead.replace(/([^,]+)/g,re=>{U+=re}),[].forEach.call(document.querySelectorAll("link"),function(re){re.href.indexOf(".css")>=0&&(G+=`<link type="text/css" rel="stylesheet" href="${re.href}" >`)});let ne=document.styleSheets;if(ne&&ne.length>0)for(let re=0;re<ne.length;re++)try{if(ne[re].cssRules||ne[re].rules){let oe=ne[re].cssRules||ne[re].rules;for(let ie=0;ie<oe.length;ie++)ee+=oe[ie].cssText}}catch(oe){console.log(ne[re].href+oe)}return this.settings.extraCss&&this.settings.extraCss.replace(/([^,\s]+)/g,re=>{G+=`<link type="text/css" rel="stylesheet" href="${re}">`}),`<head><title>${this.settings.popTitle}</title>${U}${G}<style type="text/css">${ee}</style></head>`}getBody(){let U=this.settings.ids;return U=U.replace(new RegExp("#","g"),""),this.elsdom=this.beforeHanler(document.getElementById(U)),"<body>"+this.getFormData(this.elsdom).outerHTML+"</body>"}beforeHanler(U){let G=U.querySelectorAll("canvas");for(let ee=0;ee<G.length;ee++)if(!G[ee].style.display){let ne=G[ee].parentNode,re=G[ee].toDataURL("image/png"),oe=new Image;oe.className="canvasImg",oe.style.display="none",oe.src=re,ne.appendChild(oe)}return U}getFormData(U){let G=U.cloneNode(!0),ee=G.querySelectorAll("input,select,textarea"),ne=G.querySelectorAll(".canvasImg,canvas"),re=-1;for(let oe=0;oe<ne.length;oe++){let ie=ne[oe].parentNode,le=ne[oe];le.tagName.toLowerCase()==="canvas"?ie.removeChild(le):le.style.display="block"}for(let oe=0;oe<ee.length;oe++){let ie=ee[oe],le=ie.getAttribute("type"),ae=ee[oe];if(le||(le=ie.tagName==="SELECT"?"select":ie.tagName==="TEXTAREA"?"textarea":""),ie.tagName==="INPUT")le==="radio"||le==="checkbox"?ie.checked&&ae.setAttribute("checked",ie.checked):(ae.value=ie.value,ae.setAttribute("value",ie.value));else if(le==="select"){re++;for(let se=0;se<U.querySelectorAll("select").length;se++){let ue=U.querySelectorAll("select")[se];if(!ue.getAttribute("newbs")&&ue.setAttribute("newbs",se),ue.getAttribute("newbs")==re){let ce=U.querySelectorAll("select")[re].selectedIndex;ie.options[ce].setAttribute("selected",!0)}}}else ae.innerHTML=ie.value,ae.setAttribute("html",ie.value)}return G}getPrintWindow(U){var G=this.Iframe(U);return{f:G,win:G.contentWindow||G,doc:G.doc}}previewBoxShow(){let U=document.getElementById("vue-pirnt-nb-previewBox");U&&(document.querySelector("html").setAttribute("style","overflow: hidden"),U.style.display="block")}previewBoxHide(){let U=document.getElementById("vue-pirnt-nb-previewBox");U&&(document.querySelector("html").setAttribute("style","overflow: visible;"),U.querySelector("iframe")&&U.querySelector("iframe").remove(),U.style.display="none")}previewBox(){let U=document.getElementById("vue-pirnt-nb-previewBox"),G="previewBody";if(U)return U.querySelector("iframe")&&U.querySelector("iframe").remove(),{close:U.querySelector(".previewClose"),previewBody:U.querySelector(".previewBody")};let ee=document.createElement("div");ee.setAttribute("id","vue-pirnt-nb-previewBox"),ee.setAttribute("style","position: fixed;top: 0px;left: 0px;width: 100%;height: 100%;background: white;display:none"),ee.style.zIndex=this.settings.zIndex;let ne=document.createElement("div");ne.setAttribute("class","previewHeader"),ne.setAttribute("style","padding: 5px 20px;"),ne.innerHTML=this.settings.previewTitle,ee.appendChild(ne),this.close=document.createElement("div");let re=this.close;re.setAttribute("class","previewClose"),re.setAttribute("style","position: absolute;top: 5px;right: 20px;width: 25px;height: 20px;cursor: pointer;");let oe=document.createElement("div"),ie=document.createElement("div");oe.setAttribute("class","closeBefore"),oe.setAttribute("style","position: absolute;width: 3px;height: 100%;background: #040404;transform: rotate(45deg); top: 0px;left: 50%;"),ie.setAttribute("class","closeAfter"),ie.setAttribute("style","position: absolute;width: 3px;height: 100%;background: #040404;transform: rotate(-45deg); top: 0px;left: 50%;"),re.appendChild(oe),re.appendChild(ie),ne.appendChild(re),this.previewBody=document.createElement("div");let le=this.previewBody;le.setAttribute("class",G),le.setAttribute("style","display: flex;flex-direction: column; height: 100%;"),ee.appendChild(le);let ae=document.createElement("div");ae.setAttribute("class","previewBodyUtil"),ae.setAttribute("style","height: 32px;background: #474747;position: relative;"),le.appendChild(ae),this.previewBodyUtilPrintBtn=document.createElement("div");let se=this.previewBodyUtilPrintBtn;return se.setAttribute("class","previewBodyUtilPrintBtn"),se.innerHTML=this.settings.previewPrintBtnLabel,se.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);"),ae.appendChild(se),document.body.appendChild(ee),{close:this.close,previewBody:this.previewBody}}iframeBox(U,G){let ee=document.createElement("iframe");return ee.style.border="0px",ee.style.position="absolute",ee.style.width="0px",ee.style.height="0px",ee.style.right="0px",ee.style.top="0px",ee.setAttribute("id",U),ee.setAttribute("src",G),ee}Iframe(U){let G=this.settings.id;U=U||new Date().getTime();let ee=this,ne=this.iframeBox(G,U);try{if(this.settings.preview){ne.setAttribute("style","border: 0px;flex: 1;");let re=this.previewBox(),oe=re.previewBody,ie=re.close;oe.appendChild(ne),this.addEvent(ie,"click",function(){ee.previewBoxHide()})}else document.body.appendChild(ne);ne.doc=null,ne.doc=ne.contentDocument?ne.contentDocument:ne.contentWindow?ne.contentWindow.document:ne.document}catch(re){throw new Error(re+". iframes may not be supported in this browser.")}if(ne.doc==null)throw new Error("Cannot find document.");return ne}};var t$2={directiveName:"print",mounted(te,U,G){let ee=U.instance,ne="";var re,oe,ie;oe="click",ie=()=>{if(typeof U.value=="string")ne=U.value;else{if(typeof U.value!="object"||!U.value.id)return void window.print();{ne=U.value.id;let ae=ne.replace(new RegExp("#","g"),"");document.getElementById(ae)||(console.log("id in Error"),ne="")}}le()},(re=te).addEventListener?re.addEventListener(oe,ie,!1):re.attachEvent?re.attachEvent("on"+oe,ie):re["on"+oe]=ie;const le=()=>{new e$3({ids:ne,vue:ee,url:U.value.url,standard:"",extraHead:U.value.extraHead,extraCss:U.value.extraCss,zIndex:U.value.zIndex||20002,previewTitle:U.value.previewTitle||"打印预览",previewPrintBtnLabel:U.value.previewPrintBtnLabel||"打印",popTitle:U.value.popTitle,preview:U.value.preview||!1,asyncUrl:U.value.asyncUrl,previewBeforeOpenCallback(){U.value.previewBeforeOpenCallback&&U.value.previewBeforeOpenCallback(ee)},previewOpenCallback(){U.value.previewOpenCallback&&U.value.previewOpenCallback(ee)},openCallback(){U.value.openCallback&&U.value.openCallback(ee)},closeCallback(){U.value.closeCallback&&U.value.closeCallback(ee)},beforeOpenCallback(){U.value.beforeOpenCallback&&U.value.beforeOpenCallback(ee)}})}},install:function(te){te.directive("print",t$2)}},FieldRenderType=(te=>(te.String="string",te.Integer="interget",te))(FieldRenderType||{}),DynamicTableType=(te=>(te.Default="default",te.DataForm="dataForm",te))(DynamicTableType||{}),ItableType=(te=>(te.Link="link",te))(ItableType||{}),FieldType=(te=>(te.Text="text",te.Select="select",te.Date="date",te.DateTime="datetime",te.CheckBox="checkbox",te.Switch="switch",te.Radio="radio",te.Textarea="textarea",te.Number="number",te.NumberRange="numberRange",te.Cascader="cascader",te.Daterange="daterange",te.Monthrange="monthrange",te.File="file",te.TreeSelect="treeSelect",te.Year="year",te.Month="month",te.Hr="hr",te.Slot="slot",te.Editor="editor",te.Password="password",te.Json="json",te.Markdown="markdown",te.Rate="rate",te.TimeRange="timerange",te.Time="time",te.DateTimeRange="datetimerange",te))(FieldType||{});let nanoid=(te=21)=>crypto.getRandomValues(new Uint8Array(te)).reduce((U,G)=>(G&=63,G<36?U+=G.toString(36):G<62?U+=(G-26).toString(36).toUpperCase():G>62?U+="-":U+="_",U),"");const screenDesignMainStore=pinia.defineStore({id:"design",state:()=>({theme:localStorage.getItem("design-theme")||"",stageWidth:1920,stageHeight:1080,scale:.2,targetsWidget:[],sketchRuleLine:{h:[],v:[]},widgetConfg:{config:{backgroundColor:"transparent",backgroundImage:""},list:[]},widgetHoverIds:[],pasteWidget:[],createLoading:!1,showRightPannel:!1,tempChartData:{},chartData:{},countMap:{}}),getters:{getScale(){return this.scale},getStage(){return{stageWidth:this.stageWidth,stageHeight:this.stageHeight}},getSketchRuleLine(){return this.sketchRuleLine},getTargetWidget(){return this.targetsWidget},getWidgetConfig(){return this.widgetConfg.config},getWidgetList(){return this.widgetConfg.list},getWidgetHoverIds(){return this.widgetHoverIds},getPasteWidget(){return this.pasteWidget},getCreateLoading(){return this.createLoading},getRightPannel(){return this.showRightPannel},getTheme(){return this.theme},getChartData(){return this.chartData},getCountMap(){return this.countMap}},actions:{setSacle(te){this.scale=te/100},setSketchRuleLine(te,U){this.sketchRuleLine.h=te,this.sketchRuleLine.v=U},clearSketchRuleLine(){this.sketchRuleLine={h:[],v:[]}},setTargetWidget(te){this.targetsWidget=te},setWidgetList(te){this.widgetConfg.list=te},setWidgetHoverIds(te){this.widgetHoverIds=te},delWidgetItem(te){this.setWidgetList(this.getWidgetList.filter(U=>!te.includes(U.id))),this.setTargetWidget(this.getTargetWidget.filter(U=>!te.includes(U.id)))},copyWidgetItem(te){this.pasteWidget=[],te.forEach(U=>{const G=this.getWidgetList.find(ee=>ee.id==U);G&&this.pasteWidget.push(G)})},pasteWidgetItem(){this.pasteWidget.forEach(G=>{const ee=JSON.parse(JSON.stringify(G));let ne=ee.x,re=ee.y;ee.x+40>this.stageWidth-ee.w?ne=this.stageWidth-ee.w-40:ne+=40,ee.y+40>this.stageHeight-ee.h?re=this.stageHeight-ee.h-40:re+=40,this.widgetConfg.list.unshift({...ee,id:nanoid(),x:ne,y:re,z:this.widgetConfg.list.length+1,locked:!1})})},sortWidgetList(){this.widgetConfg.list.sort((te,U)=>U.z-te.z)},setCreateLoading(te){this.createLoading=te,te&&(this.targetsWidget=[],this.clearSketchRuleLine())},setRightPannel(te){this.showRightPannel=te},setStageWidth(te){this.stageWidth=te,this.widgetConfg.config.stageWidth=te},setStageHeight(te){this.stageHeight=te,this.widgetConfg.config.stageHeight=te},setTheme(){this.theme=this.theme=="dark"?"":"dark",document.getElementsByTagName("html")[0].className=this.theme,localStorage.setItem("design-theme",this.theme)},setChartData(te){this.chartData=te},setCountMap(te,U){this.countMap[te]=U}}});/*!
|
|
2
2
|
* Compressor.js v1.2.1
|
|
3
3
|
* https://fengyuanchen.github.io/compressorjs
|
|
4
4
|
*
|
|
@@ -888,7 +888,7 @@ ${ue} div ,${ue} span,${ue} a,${ue} * {
|
|
|
888
888
|
data-bold="${se}"
|
|
889
889
|
data-color="${ue}"
|
|
890
890
|
data-src="${le}"
|
|
891
|
-
>${ie}</span>`},parseDemoHtml=te=>{const U=te.getAttribute("data-chartType")||"",G=te.getAttribute("data-id")||"",ee=te.getAttribute("data-content")||"",ne=te.getAttribute("data-singleValue")||"",re=te.getAttribute("data-singleValueKey")||"",oe=te.getAttribute("data-subtitle")||"",ie=te.getAttribute("data-width")||"",le=te.getAttribute("data-fontSize")||"",ae=te.getAttribute("data-bold")||"",se=te.getAttribute("data-color")||"",ue=te.getAttribute("data-src")||"",ce=te.getAttribute("data-indicatorsType")||"";return{type:"indicator",id:G,chartType:U,subtitle:oe,content:ee,width:ie,src:ue,fontSize:le,bold:ae,singleValue:ne,singleValueKey:re,color:se,indicatorsType:ce,children:[{text:ee}]}};function withMention(te){const{insertText:U,isInline:G,isVoid:ee}=te,ne=te;return ne.insertText=re=>{if(editor.DomEditor.getSelectedElems(ne).some(le=>ne.isVoid(le))){U(re);return}U(re)},ne.isInline=re=>editor.DomEditor.getNodeType(re)==="indicator"?!0:G(re),ne.isVoid=re=>editor.DomEditor.getNodeType(re)==="indicator"?!0:ee(re),ne}const aceIndicatorReportPlugin={editorPlugin:withMention,renderElems:[{type:"indicator",renderElem:renderIndicator}],elemsToHtml:[{type:"indicator",elemToHtml:indicatorToHtml}],parseElemsHtml:[{selector:'span[data-w-e-type="indicator"]',parseElemHtml:parseDemoHtml}]},_withScopeId$s=te=>(vue.pushScopeId("data-v-5520f2bf"),te=te(),vue.popScopeId(),te),_hoisted_1$17={class:"flex-1 p-2 border border-gray-200 border-solid"},_hoisted_2$Y={class:"flex justify-end"},_hoisted_3$Q=_withScopeId$s(()=>vue.createElementVNode("div",{class:"h-px mt-2 mb-2 bg-gray-200"},null,-1)),_hoisted_4$O={class:"overflow-y-auto max-h-80"},_hoisted_5$E=_withScopeId$s(()=>vue.createElementVNode("span",{class:"ml-2 mr-2"},"~",-1)),_hoisted_6$z=_withScopeId$s(()=>vue.createElementVNode("span",{class:"ml-2 mr-2"},"~",-1)),_sfc_main$1k=vue.defineComponent({__name:"customSearch",props:{dynamicSearchForm:{default:()=>[]},customSearchVisible:{type:Boolean,default:!1}},emits:["update:customSearchVisible","dynamicSearchFormUpdate","success"],setup(te,{expose:U,emit:G}){var ge;const ee=te,ne=G;vue.watch(()=>ee.customSearchVisible,me=>{me&&vue.nextTick(()=>{he()})});const{proxy:re}=vue.getCurrentInstance(),oe=vue.inject("modelEle"),ie=vue.ref([]),le=vue.ref([]);re.$baseHttp.get(`/api/ace-data-center/model/detail?id=${(ge=vue.unref(oe))==null?void 0:ge.id}`).then(me=>{ie.value=me.data.listModelAttribute.map(_e=>({name:_e.attributeComment,key:_e.attributeCode,dataType:_e.dataType,checked:!1,type:"",value:"",minValue:"",maxValue:"",defaultRule:"",dictId:"",options:""}))});const ae=vue.ref([]);re.$baseHttp.get(`/api/ace-data-center/custom-dic/options?projectId=${re.$baseGetCurrentProjectId()}`).then(me=>{ae.value=me.data});const se={yymmddSingle:[{name:"当日",value:"today"},{name:"昨天",value:"yesterday"}],yymmddhhmmssSingle:[{name:"当日",value:"today"}],yymmddhhmmssRange:[{name:"当日",value:"today"},{name:"昨天",value:"yesterday"}],yymmddRange:[{name:"近一周",value:"week"}],yymmSingle:[{name:"当月",value:"month"}],yymmRange:[{name:"近两月",value:"two-month"}],yySingle:[{name:"当年",value:"year"}],yyRange:[{name:"近两年",value:"two-year"}]},ue=me=>{let _e="date",be="YYYY-MM-DD";return["yyRange","yySingle"].includes(me)&&(_e="year",be="YYYY"),["yymmRange","yymmSingle"].includes(me)&&(_e="month",be="YYYY-MM"),{type:_e,format:be}},ce=(me,_e,be)=>me=="gt"?_e.getTime()>dayjs(be||"").valueOf():_e.getTime()<dayjs(be||"").valueOf(),de=(me,_e,be)=>{if(me[_e]==""||me[be]=="")return;const ye=Number(me[_e]),xe=Number(me[be]);(_e=="minValue"?ye>xe:ye<xe)&&(me[_e]=me[be])},fe=me=>{me.value="",me.options=[],me.dictId&&re.$baseHttp.get(`/api/ace-data-center/custom-dic/readDict/${me.dictId}`).then(_e=>{me.options=_e.data??[]})},ve=me=>{me.value="",me.minValue="",me.maxValue="",me.defaultRule="",me.dictId="",me.options=[]},he=()=>{le.value=JSON.parse(JSON.stringify(vue.unref(ie))),vue.unref(le).forEach(me=>{const _e=ee.dynamicSearchForm.find(be=>be.key==me.key);_e&&(me.checked=!0,Object.keys(_e).forEach(be=>{me[be]=_e[be]})),["varchar","text"].includes(me.dataType)&&!_e&&(me.type="stringSingle")})},pe=()=>{ne("dynamicSearchFormUpdate",le.value.filter(me=>me.checked&&me.type)),ne("update:customSearchVisible",!1)};return U({init:he}),(me,_e)=>(vue.openBlock(),vue.createElementBlock("div",_hoisted_1$17,[vue.createElementVNode("div",_hoisted_2$Y,[vue.createVNode(vue.unref(elementPlus.ElButton),{type:"primary",size:"small",onClick:pe},{default:vue.withCtx(()=>[vue.createTextVNode("保存")]),_:1}),vue.createVNode(vue.unref(elementPlus.ElButton),{type:"primary",class:"ml-3",size:"small",onClick:_e[0]||(_e[0]=be=>ne("update:customSearchVisible",!1))},{default:vue.withCtx(()=>[vue.createTextVNode(" 关闭 ")]),_:1})]),_hoisted_3$Q,vue.createElementVNode("div",_hoisted_4$O,[vue.createVNode(vue.unref(elementPlus.ElForm),{inline:"",size:"small"},{default:vue.withCtx(()=>[(vue.openBlock(!0),vue.createElementBlock(vue.Fragment,null,vue.renderList(vue.unref(le),(be,ye)=>(vue.openBlock(),vue.createElementBlock("div",{key:ye},[vue.createVNode(vue.unref(elementPlus.ElFormItem),{label:""},{default:vue.withCtx(()=>[vue.createVNode(vue.unref(elementPlus.ElCheckbox),{modelValue:be.checked,"onUpdate:modelValue":xe=>be.checked=xe,size:"small"},null,8,["modelValue","onUpdate:modelValue"])]),_:2},1024),vue.createVNode(vue.unref(elementPlus.ElFormItem),{label:"名称:"},{default:vue.withCtx(()=>[vue.createVNode(vue.unref(elementPlus.ElInput),{modelValue:be.name,"onUpdate:modelValue":xe=>be.name=xe,size:"small",placeholder:"请输入名称",clearable:""},null,8,["modelValue","onUpdate:modelValue"])]),_:2},1024),vue.createVNode(vue.unref(elementPlus.ElFormItem),{label:"类型:"},{default:vue.withCtx(()=>[vue.createVNode(vue.unref(elementPlus.ElSelect),{size:"small",clearable:"",teleported:!1,modelValue:be.type,"onUpdate:modelValue":xe=>be.type=xe,onChange:xe=>ve(be),placeholder:"类型"},{default:vue.withCtx(()=>[["date","datetime"].includes(be.dataType)?(vue.openBlock(),vue.createElementBlock(vue.Fragment,{key:0},[vue.createVNode(vue.unref(elementPlus.ElOption),{label:"年·区间",value:"yyRange"}),vue.createVNode(vue.unref(elementPlus.ElOption),{label:"年·单值",value:"yySingle"}),vue.createVNode(vue.unref(elementPlus.ElOption),{label:"年月·区间",value:"yymmRange"}),vue.createVNode(vue.unref(elementPlus.ElOption),{label:"年月·单值",value:"yymmSingle"}),vue.createVNode(vue.unref(elementPlus.ElOption),{label:"年月日·区间",value:"yymmddRange"}),vue.createVNode(vue.unref(elementPlus.ElOption),{label:"年月日·单值",value:"yymmddSingle"}),vue.createVNode(vue.unref(elementPlus.ElOption),{label:"年月日时分秒·区间",value:"yymmddhhmmssRange"}),vue.createVNode(vue.unref(elementPlus.ElOption),{label:"年月日时分秒·单值",value:"yymmddhhmmssSingle"})],64)):["int","decimal","double"].includes(be.dataType)?(vue.openBlock(),vue.createElementBlock(vue.Fragment,{key:1},[vue.createVNode(vue.unref(elementPlus.ElOption),{label:"数值·区间",value:"numberRange"}),vue.createVNode(vue.unref(elementPlus.ElOption),{label:"数值·单值",value:"numberSingle"}),vue.createVNode(vue.unref(elementPlus.ElOption),{label:"下拉框·字典",value:"select"})],64)):(vue.openBlock(),vue.createElementBlock(vue.Fragment,{key:2},[vue.createVNode(vue.unref(elementPlus.ElOption),{label:"字符串",value:"stringSingle"}),vue.createVNode(vue.unref(elementPlus.ElOption),{label:"字符串分隔",value:"stringMultiple"}),vue.createVNode(vue.unref(elementPlus.ElOption),{label:"下拉框·字典",value:"select"})],64))]),_:2},1032,["modelValue","onUpdate:modelValue","onChange"])]),_:2},1024),be.type?(vue.openBlock(),vue.createBlock(vue.unref(elementPlus.ElFormItem),{key:0,label:"默认值:"},{default:vue.withCtx(()=>[se[be.type]?(vue.openBlock(),vue.createBlock(vue.unref(elementPlus.ElSelect),{key:0,size:"small",clearable:"",style:{"margin-right":"10px"},teleported:!1,modelValue:be.defaultRule,"onUpdate:modelValue":xe=>be.defaultRule=xe,placeholder:"默认值"},{default:vue.withCtx(()=>[(vue.openBlock(!0),vue.createElementBlock(vue.Fragment,null,vue.renderList(se[be.type],xe=>(vue.openBlock(),vue.createBlock(vue.unref(elementPlus.ElOption),{label:xe.name,value:xe.value,key:xe.value},null,8,["label","value"]))),128)),vue.createVNode(vue.unref(elementPlus.ElOption),{label:"自定义",value:"custom"})]),_:2},1032,["modelValue","onUpdate:modelValue"])):vue.createCommentVNode("",!0),be.type.endsWith("Range")?(vue.openBlock(),vue.createElementBlock(vue.Fragment,{key:1},[["yyRange","yymmRange","yymmddRange"].includes(be.type)?(vue.openBlock(),vue.createElementBlock(vue.Fragment,{key:0},[vue.createVNode(vue.unref(elementPlus.ElDatePicker),{size:"small",teleported:!1,modelValue:be.minValue,"onUpdate:modelValue":xe=>be.minValue=xe,clearable:"",placeholder:"开始","disabled-date":xe=>ce("gt",xe,be.maxValue),type:ue(be.type).type,"value-format":ue(be.type).format},null,8,["modelValue","onUpdate:modelValue","disabled-date","type","value-format"]),_hoisted_5$E,vue.createVNode(vue.unref(elementPlus.ElDatePicker),{size:"small",teleported:!1,modelValue:be.maxValue,"onUpdate:modelValue":xe=>be.maxValue=xe,clearable:"",placeholder:"结束","disabled-date":xe=>ce("lt",xe,be.minValue),type:ue(be.type).type,"value-format":ue(be.type).format},null,8,["modelValue","onUpdate:modelValue","disabled-date","type","value-format"])],64)):(vue.openBlock(),vue.createElementBlock(vue.Fragment,{key:1},[vue.createVNode(vue.unref(elementPlus.ElInput),{size:"small",modelValue:be.minValue,"onUpdate:modelValue":xe=>be.minValue=xe,max:be.maxValue,clearable:!1,onBlur:xe=>de(be,"minValue","maxValue"),type:"number",placeholder:"最小值"},null,8,["modelValue","onUpdate:modelValue","max","onBlur"]),_hoisted_6$z,vue.createVNode(vue.unref(elementPlus.ElInput),{size:"small",modelValue:be.maxValue,"onUpdate:modelValue":xe=>be.maxValue=xe,min:be.minValue,clearable:!1,onBlur:xe=>de(be,"maxValue","minValue"),type:"number",placeholder:"最大值"},null,8,["modelValue","onUpdate:modelValue","min","onBlur"])],64))],64)):vue.createCommentVNode("",!0),be.type.includes("Single")?(vue.openBlock(),vue.createElementBlock(vue.Fragment,{key:2},[["yySingle","yymmSingle","yymmddSingle"].includes(be.type)?(vue.openBlock(),vue.createBlock(vue.unref(elementPlus.ElDatePicker),{key:0,size:"small",teleported:!1,modelValue:be.value,"onUpdate:modelValue":xe=>be.value=xe,clearable:"",placeholder:"请输入"+be.name,type:ue(be.type).type,"value-format":ue(be.type).format},null,8,["modelValue","onUpdate:modelValue","placeholder","type","value-format"])):(vue.openBlock(),vue.createBlock(vue.unref(elementPlus.ElInput),{key:1,size:"small",modelValue:be.value,"onUpdate:modelValue":xe=>be.value=xe,teleported:!1,clearable:"",type:be.type=="numberSingle"?"number":"",placeholder:"请输入"+be.name},null,8,["modelValue","onUpdate:modelValue","type","placeholder"]))],64)):vue.createCommentVNode("",!0),be.type=="stringMultiple"?(vue.openBlock(),vue.createBlock(vue.unref(elementPlus.ElSelect),{key:3,size:"small",teleported:!1,modelValue:be.value,"onUpdate:modelValue":xe=>be.value=xe,placeholder:"请选择",clearable:"",multiple:"",filterable:"","allow-create":"","reserve-keyword":!1,"default-first-option":""},{default:vue.withCtx(()=>[(vue.openBlock(!0),vue.createElementBlock(vue.Fragment,null,vue.renderList(be.options,xe=>(vue.openBlock(),vue.createBlock(vue.unref(elementPlus.ElOption),{label:xe.label,value:xe.value,key:xe.value},null,8,["label","value"]))),128))]),_:2},1032,["modelValue","onUpdate:modelValue"])):vue.createCommentVNode("",!0),be.type=="select"?(vue.openBlock(),vue.createElementBlock(vue.Fragment,{key:4},[vue.createVNode(vue.unref(elementPlus.ElSelect),{size:"small",teleported:!1,style:{"margin-right":"10px"},modelValue:be.dictId,"onUpdate:modelValue":xe=>be.dictId=xe,placeholder:"字典值",clearable:"",onChange:xe=>fe(be)},{default:vue.withCtx(()=>[(vue.openBlock(!0),vue.createElementBlock(vue.Fragment,null,vue.renderList(vue.unref(ae),xe=>(vue.openBlock(),vue.createBlock(vue.unref(elementPlus.ElOption),{label:xe.label,value:xe.code,key:xe.code},null,8,["label","value"]))),128))]),_:2},1032,["modelValue","onUpdate:modelValue","onChange"]),vue.createVNode(vue.unref(elementPlus.ElSelect),{size:"small",teleported:!1,modelValue:be.value,"onUpdate:modelValue":xe=>be.value=xe,placeholder:"请选择",clearable:""},{default:vue.withCtx(()=>[(vue.openBlock(!0),vue.createElementBlock(vue.Fragment,null,vue.renderList(be.options,xe=>(vue.openBlock(),vue.createBlock(vue.unref(elementPlus.ElOption),{label:xe.name,value:xe.code,key:xe.code},null,8,["label","value"]))),128))]),_:2},1032,["modelValue","onUpdate:modelValue"])],64)):vue.createCommentVNode("",!0)]),_:2},1024)):vue.createCommentVNode("",!0)]))),128))]),_:1})])]))}}),customSearch_vue_vue_type_style_index_0_scoped_5520f2bf_lang="",aceIndicatorCustomSearch=_export_sfc$2(_sfc_main$1k,[["__scopeId","data-v-5520f2bf"]]),_hoisted_1$16={class:"field"},_hoisted_2$X={class:"flex items-center justify-center flex-1 h-full overflow-hidden cursor-pointer field-container"},_hoisted_3$P=["onClick"],_hoisted_4$N={class:"overflow-hidden field-label whitespace-nowrap text-ellipsis"},_hoisted_5$D={key:0,class:"flex items-center h-full"},_hoisted_6$y={class:"mr-5"},_hoisted_7$u=["onClick"],_hoisted_8$q={key:0,class:"field-add"},_hoisted_9$n=["onClick"],_sfc_main$1j=vue.defineComponent({__name:"model-table-dimension",props:{loading:{type:Boolean,default:!0},iconMap:{default:()=>{}},calendarType:{default:()=>{}},modelValue:{default:()=>[]},list:{default:()=>[]}},emits:["success","update:modelValue"],setup(te,{emit:U}){const G=te,ee=U;vue.inject("chartList");const ne=vue.ref(""),re=vue.computed(()=>G.list.filter(se=>se.columnComment.indexOf(vue.unref(ne))>=0)),oe=se=>{ee("update:modelValue",[se]),ee("success")},ie=se=>{ee("update:modelValue",[...G.modelValue,se]),ee("success")},le=se=>{ee("update:modelValue",G.modelValue.filter(ue=>ue.identifier!==se.identifier)),ee("success")},ae=(se,ue)=>{const ce=G.modelValue.find(de=>de.identifier==ue.identifier);ce.dateFormatType=se,ue.dateFormatType=se,ee("success")};return(se,ue)=>{const ce=vue.resolveComponent("aceHeader");return vue.openBlock(),vue.createElementBlock(vue.Fragment,null,[vue.createVNode(ce,{title:"分组统计维度",class:"mt-4 mb-2"}),vue.createVNode(vue.unref(elementPlus.ElSkeleton),{loading:se.loading,animated:""},{default:vue.withCtx(()=>[vue.createVNode(vue.unref(elementPlus.ElInput),{modelValue:vue.unref(ne),"onUpdate:modelValue":ue[0]||(ue[0]=de=>vue.isRef(ne)?ne.value=de:null),placeholder:"搜索字段",class:"mb-2"},null,8,["modelValue"]),vue.createElementVNode("div",_hoisted_1$16,[(vue.openBlock(!0),vue.createElementBlock(vue.Fragment,null,vue.renderList(vue.unref(re),de=>(vue.openBlock(),vue.createElementBlock("div",{class:vue.normalizeClass(["field-item",{active:se.modelValue.some(fe=>fe.identifier==de.identifier)}]),key:de.identifier},[vue.createElementVNode("div",_hoisted_2$X,[vue.createElementVNode("div",{class:"flex items-center flex-1 overflow-hidden",onClick:fe=>oe(de)},[vue.createElementVNode("i",{class:vue.normalizeClass([se.iconMap[de.dataType],"mr-2"])},null,2),vue.createElementVNode("span",_hoisted_4$N,vue.toDisplayString(de.columnComment),1)],8,_hoisted_3$P),se.modelValue.some(fe=>fe.identifier==de.identifier)?(vue.openBlock(),vue.createElementBlock("div",_hoisted_5$D,[["date","datetime"].includes(de.dataType)?(vue.openBlock(),vue.createBlock(vue.unref(elementPlus.ElDropdown),{key:0,trigger:"hover",onCommand:fe=>ae(fe,de)},{dropdown:vue.withCtx(()=>[vue.createVNode(vue.unref(elementPlus.ElDropdownMenu),null,{default:vue.withCtx(()=>[(vue.openBlock(!0),vue.createElementBlock(vue.Fragment,null,vue.renderList(se.calendarType,(fe,ve)=>(vue.openBlock(),vue.createBlock(vue.unref(elementPlus.ElDropdownItem),{command:ve,key:fe},{default:vue.withCtx(()=>[vue.createTextVNode(vue.toDisplayString(fe),1)]),_:2},1032,["command"]))),128))]),_:1})]),default:vue.withCtx(()=>[vue.createElementVNode("span",_hoisted_6$y,vue.toDisplayString(se.calendarType[de.dateFormatType]),1)]),_:2},1032,["onCommand"])):vue.createCommentVNode("",!0),vue.createElementVNode("i",{class:"cursor-pointer ri-close-line",onClick:vue.withModifiers(fe=>le(de),["stop"])},null,8,_hoisted_7$u)])):vue.createCommentVNode("",!0)]),!se.modelValue.some(fe=>fe.identifier==de.identifier)&&se.modelValue.length?(vue.openBlock(),vue.createElementBlock("div",_hoisted_8$q,[vue.createElementVNode("i",{class:"text-gray-800 cursor-pointer ri-add-line",onClick:vue.withModifiers(fe=>ie(de),["stop"])},null,8,_hoisted_9$n)])):vue.createCommentVNode("",!0)],2))),128))])]),_:1},8,["loading"])],64)}}}),modelTableDimension_vue_vue_type_style_index_0_scoped_17c71fa7_lang="",modelTableDimension=_export_sfc$2(_sfc_main$1j,[["__scopeId","data-v-17c71fa7"]]),_withScopeId$r=te=>(vue.pushScopeId("data-v-449a4f14"),te=te(),vue.popScopeId(),te),_hoisted_1$15={class:"mb-2"},_hoisted_2$W=_withScopeId$r(()=>vue.createElementVNode("div",{class:"mb-2 font-bold"},"公式名称:",-1)),_hoisted_3$O={class:"relative mt-4 mb-4"},_hoisted_4$M={class:"mb-2 font-bold"},_hoisted_5$C={class:"ml-2 text-color-primary"},_hoisted_6$x={key:0,class:"selection el-popper is-light el-popover","data-popper-placement":"bottom"},_hoisted_7$t=_withScopeId$r(()=>vue.createElementVNode("div",null,"选择变量",-1)),_hoisted_8$p={class:"mt-2"},_hoisted_9$m=_withScopeId$r(()=>vue.createElementVNode("span",{class:"el-popper__arrow","data-popper-arrow":""},null,-1)),validKeys="0123456789+-*/@.()",_sfc_main$1i=vue.defineComponent({__name:"model-exp",props:{options:{default:()=>[]}},emits:["success"],setup(te,{expose:U,emit:G}){const{proxy:ee}=vue.getCurrentInstance(),ne=vue.ref(!1),re=te,oe=G,ie=vue.ref(""),le=vue.ref(null),ae=Ve=>{const{key:Se}=Ve;switch(Se){case"Enter":Ve.preventDefault();break;case"@":case"Process":de();break}};let se=null;const ue=()=>{const Ve=vue.unref(le).innerHTML;let Se=xe(Ve.replace(/<br>/g,""));Se=Se.map(Ne=>$e(Ne)?Ce(Ne):Ne.data.split("").filter(Ie=>validKeys.includes(Ie)).join(""));const ke=Se.join("");if(Ve!==ke){const Ne=we(Ve,ke);vue.unref(le).innerHTML=ke,Ee(vue.unref(le),Ne)}clearTimeout(se),se=setTimeout(async()=>{_e()},500)},ce=vue.ref(!1),de=()=>{ce.value=!0},fe=Ve=>{const{identifier:Se,columnComment:ke}=Ve;ce.value=!1;const Ne=`<div contenteditable="false">${ke}<span>${Se}</span></div>`;ge("@",Ne)},ve=vue.ref(null),he=Ve=>{if(ve.value=Ve,ie.value="",ne.value=!0,Ve){const Se=JSON.parse(JSON.stringify(Ve.data));let ke=Se.exp??"";ie.value=Se.comment,Se.identifier.split(",").forEach(Ne=>{const Ie=new RegExp(Ne,"g"),Pe=re.options.find(Te=>Te.identifier==Ne);if(Pe){const Te=`<div contenteditable="false">${Pe.columnComment}<span>${Ne}</span></div>`;ke=ke.replace(Ie,(De,Oe,Be)=>{const Ae=De.length,Le=Be.slice(Oe-1,Ae+Oe+1);return Le.startsWith("_")||Le.endsWith("_")?Ne:Te})}}),vue.nextTick(()=>{vue.unref(le).innerHTML=ke.replace(/@/g,""),setTimeout(()=>{_e()},100)})}},pe=()=>{var Ve,Se;if(!((Ve=vue.unref(me))!=null&&Ve.exp)){ee.$message({type:"warning",message:"公式不能为空",plain:!0});return}if(vue.unref(ie)==""){ee.$message({type:"warning",message:"公式名称不能为空",plain:!0});return}oe("success",{...vue.unref(me),aggType:"exp",comment:vue.unref(ie),showLabel:vue.unref(ie)},((Se=vue.unref(ve))==null?void 0:Se.index)??""),ne.value=!1},ge=(Ve,Se="")=>{if(!vue.unref(le))return;let ke=vue.unref(le).innerHTML;ke.includes(Ve)&&(ke=ke.replace(new RegExp(Ve,"g"),Se),vue.unref(le).innerHTML=ke),_e()},me=vue.ref({}),_e=()=>{let Ve="";const Se=[],ke=vue.unref(le).innerHTML.replace(/\sdata-spm-anchor-id=".*?"/g,"");ye({text:ke,prefix:'<div contenteditable="false">',suffix:"</div>"}).forEach(Ie=>{const[Pe,Te]=ye({text:Ie,prefix:"<span>",suffix:"</span>"});Te?(Ve+=`@${Te}`,Se.push(Te)):Ve+=Pe}),me.value={exp:Ve,identifier:Se.toString()}},be=Ve=>{ce.value=!1,Ve&&ge("@")};vue.onMounted(()=>window.addEventListener("click",be)),vue.onBeforeUnmount(()=>window.removeEventListener("click",be)),U({init:he});const ye=({text:Ve,prefix:Se,suffix:ke})=>Ve.replace(new RegExp(Se,"g"),",").replace(new RegExp(ke,"g"),",").split(",").filter(Ne=>!!Ne),xe=Ve=>{const Se=document.createElement("div");return Se.innerHTML=Ve,[...Se.childNodes]},Ce=Ve=>{let Se=document.createElement("div");Se.appendChild(Ve);let ke=Se.innerHTML;return Se=Ve=null,ke},$e=Ve=>Object.prototype.toString.call(Ve)==="[object HTMLDivElement]",we=(Ve,Se)=>{const ke=Ve.split(""),Ne=Se.split(""),Ie=Math.max(ke.length,Ne.length);let Pe=0;for(let Te=0;Te<Ie&&ke[Te]==Ne[Te];Te++)Pe++;return Pe},Ee=(Ve,Se)=>{const ke=document.createRange(),Ne=window.getSelection();let Ie=0,Pe=0;const Te=xe(Ve.innerHTML);for(let De=0;De<Te.length;De++){const Oe=Te[De];if($e(Oe))Se-=Ce(Oe).length;else if(Se>Oe.length)Se-=Oe.length;else{Pe=Se;break}Ie++}ke.selectNodeContents(Ve),ke.collapse(!1),Ve.childNodes[Ie]&&ke.setStart(Ve.childNodes[Ie],Pe),ke.collapse(!0),Ne.removeAllRanges(),Ne.addRange(ke)};return(Ve,Se)=>{const ke=vue.resolveComponent("AppDialog");return vue.openBlock(),vue.createBlock(ke,{modelValue:vue.unref(ne),"onUpdate:modelValue":Se[2]||(Se[2]=Ne=>vue.isRef(ne)?ne.value=Ne:null),title:"计算公式",size:800},{footer:vue.withCtx(()=>[vue.createVNode(vue.unref(elementPlus.ElButton),{class:"ml-3",type:"primary",onClick:pe},{default:vue.withCtx(()=>[vue.createTextVNode("保存")]),_:1}),vue.createVNode(vue.unref(elementPlus.ElButton),{class:"ml-3",onClick:Se[1]||(Se[1]=Ne=>ne.value=!1)},{default:vue.withCtx(()=>[vue.createTextVNode("取消")]),_:1})]),default:vue.withCtx(()=>[vue.createElementVNode("div",_hoisted_1$15,[_hoisted_2$W,vue.createVNode(vue.unref(elementPlus.ElInput),{modelValue:vue.unref(ie),"onUpdate:modelValue":Se[0]||(Se[0]=Ne=>vue.isRef(ie)?ie.value=Ne:null),placeholder:"请输入公式名称"},null,8,["modelValue"])]),vue.createElementVNode("div",_hoisted_3$O,[vue.createElementVNode("div",_hoisted_4$M,[vue.createTextVNode(" 公式: "),vue.createElementVNode("span",_hoisted_5$C,vue.toDisplayString(vue.unref(me).exp),1)]),vue.createElementVNode("div",{ref_key:"formulaRef",ref:le,class:"flex-1 formula",contenteditable:"",placeholder:"请输入表达式 输入「@」后选择指标",style:{"ime-mode":"disabled"},onKeydown:vue.withModifiers(ae,["stop"]),onKeyup:ue},null,544),vue.unref(ce)?(vue.openBlock(),vue.createElementBlock("div",_hoisted_6$x,[_hoisted_7$t,vue.createElementVNode("div",_hoisted_8$p,[(vue.openBlock(!0),vue.createElementBlock(vue.Fragment,null,vue.renderList(re.options,Ne=>(vue.openBlock(),vue.createBlock(vue.unref(elementPlus.ElTag),{class:"m-2 cursor-pointer",onClick:Ie=>fe(Ne),key:Ne.identifier,type:"primary"},{default:vue.withCtx(()=>[vue.createTextVNode(vue.toDisplayString(Ne.columnComment),1)]),_:2},1032,["onClick"]))),128))]),_hoisted_9$m])):vue.createCommentVNode("",!0)])]),_:1},8,["modelValue"])}}}),modelExp_vue_vue_type_style_index_0_scoped_449a4f14_lang="",ModelExp=_export_sfc$2(_sfc_main$1i,[["__scopeId","data-v-449a4f14"]]),_withScopeId$q=te=>(vue.pushScopeId("data-v-216c5764"),te=te(),vue.popScopeId(),te),_hoisted_1$14={key:0},_hoisted_2$V=_withScopeId$q(()=>vue.createElementVNode("div",{class:"mb-2 text-sm indicators-title"},[vue.createElementVNode("i",{class:"mr-1 ri-table-line"}),vue.createTextVNode(" 基本指标 ")],-1)),_hoisted_3$N=["onClick"],_hoisted_4$L=_withScopeId$q(()=>vue.createElementVNode("i",{class:"ri-lightbulb-line"},null,-1)),_hoisted_5$B={key:1},_hoisted_6$w={class:"flex items-center mb-2 text-sm indicators-title"},_hoisted_7$s={class:"overflow-y-auto max-h-96"},_hoisted_8$o=["onClick"],_hoisted_9$l={class:"field-label"},_hoisted_10$i=_withScopeId$q(()=>vue.createElementVNode("i",{class:"ri-add-fill"},null,-1)),_sfc_main$1h=vue.defineComponent({__name:"model-table-summary",props:{modelValue:{default:()=>[]},iconMap:{default:()=>{}},list:{default:()=>[]}},emits:["update:modelValue"],setup(te,{emit:U}){const G=te,ee=U,{proxy:ne}=vue.getCurrentInstance();vue.inject("chartList");const re=vue.ref(!1),oe=vue.ref(1),ie=vue.ref(null),le=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:"可手动输入计算公式"}]);vue.watch(re,fe=>{fe&&(ue.value={},oe.value=1)});const ae=fe=>{ee("update:modelValue",G.modelValue.filter(ve=>ve.showLabel!==fe.showLabel))},se=(fe,ve)=>{fe.aggType=="exp"&&vue.unref(ie).init({data:fe,index:ve})},ue=vue.ref({}),ce=fe=>{if(fe.value==="count"){if(G.modelValue.some(ve=>ve.aggType==fe.value)){ne.$message({type:"warning",message:"存在重复数据",plain:!0});return}ee("update:modelValue",[...G.modelValue,{identifier:1,aggType:fe.value,showLabel:fe.label}]),re.value=!1;return}if(fe.value=="exp"){vue.unref(ie).init();return}oe.value=2,ue.value=fe},de=fe=>{var ve,he;if(G.modelValue.some(pe=>{var ge;return pe.identifier==fe.identifier&&pe.aggType==((ge=vue.unref(ue))==null?void 0:ge.value)})){ne.$message({type:"warning",message:"存在重复数据",plain:!0});return}re.value=!1,ee("update:modelValue",[...G.modelValue,{identifier:fe.identifier,comment:fe.columnComment,aggType:(ve=vue.unref(ue))==null?void 0:ve.value,showLabel:fe.columnComment+((he=vue.unref(ue))==null?void 0:he.label)}])};return(fe,ve)=>{const he=vue.resolveComponent("aceHeader");return vue.openBlock(),vue.createElementBlock(vue.Fragment,null,[vue.createVNode(he,{title:"汇总方式",class:"mb-2"}),vue.createElementVNode("div",null,[(vue.openBlock(!0),vue.createElementBlock(vue.Fragment,null,vue.renderList(fe.modelValue,(pe,ge)=>(vue.openBlock(),vue.createBlock(vue.unref(elementPlus.ElTag),{key:pe.value,class:vue.normalizeClass(["m-1",[pe.aggType=="exp"?"cursor-pointer":""]]),closable:!0,onClick:me=>se(pe,ge),onClose:me=>ae(pe),type:"primary"},{default:vue.withCtx(()=>[vue.createTextVNode(vue.toDisplayString(pe.showLabel),1)]),_:2},1032,["onClick","class","onClose"]))),128)),vue.createVNode(vue.unref(elementPlus.ElPopover),{trigger:"click",width:"300px",placement:"top-start",visible:vue.unref(re),"onUpdate:visible":ve[1]||(ve[1]=pe=>vue.isRef(re)?re.value=pe:null)},{reference:vue.withCtx(()=>[vue.createVNode(vue.unref(elementPlus.ElButton),{type:"primary",class:"ml-1",size:"small"},{default:vue.withCtx(()=>[_hoisted_10$i,vue.createTextVNode(" "+vue.toDisplayString(fe.modelValue.length?"":"添加度量"),1)]),_:1})]),default:vue.withCtx(()=>[vue.unref(oe)==1?(vue.openBlock(),vue.createElementBlock("div",_hoisted_1$14,[_hoisted_2$V,(vue.openBlock(!0),vue.createElementBlock(vue.Fragment,null,vue.renderList(vue.unref(le),pe=>(vue.openBlock(),vue.createElementBlock("div",{onClick:ge=>ce(pe),key:pe.value,class:vue.normalizeClass([{active:vue.unref(ue).value==pe.value},"indicators-item"])},[vue.createTextVNode(vue.toDisplayString(pe.label)+" ",1),vue.createVNode(vue.unref(elementPlus.ElTooltip),{effect:"dark",content:pe.tip,placement:"top"},{default:vue.withCtx(()=>[_hoisted_4$L]),_:2},1032,["content"])],10,_hoisted_3$N))),128))])):vue.createCommentVNode("",!0),vue.unref(oe)==2?(vue.openBlock(),vue.createElementBlock("div",_hoisted_5$B,[vue.createElementVNode("div",_hoisted_6$w,[vue.createElementVNode("i",{class:"mr-1 text-xl cursor-pointer ri-arrow-left-s-line",onClick:ve[0]||(ve[0]=pe=>oe.value=1)}),vue.createTextVNode(" "+vue.toDisplayString(vue.unref(ue).label),1)]),vue.createElementVNode("div",_hoisted_7$s,[(vue.openBlock(!0),vue.createElementBlock(vue.Fragment,null,vue.renderList(fe.list,pe=>(vue.openBlock(),vue.createElementBlock("div",{onClick:ge=>de(pe),key:pe.identifier,class:"indicators-item"},[vue.createElementVNode("div",null,[vue.createElementVNode("i",{class:vue.normalizeClass([fe.iconMap[pe.dataType],"mr-2"])},null,2),vue.createElementVNode("span",_hoisted_9$l,vue.toDisplayString(pe.columnComment),1)])],8,_hoisted_8$o))),128))])])):vue.createCommentVNode("",!0)]),_:1},8,["visible"]),vue.createVNode(ModelExp,{ref_key:"modelPercentRef",ref:ie,options:G.list,onSuccess:ve[2]||(ve[2]=(pe,ge)=>ge?G.modelValue[ge]=pe:ee("update:modelValue",[...G.modelValue,pe]))},null,8,["options"])])],64)}}}),modelTableSummary_vue_vue_type_style_index_0_scoped_216c5764_lang="",modelTableSunmary=_export_sfc$2(_sfc_main$1h,[["__scopeId","data-v-216c5764"]]),_sfc_main$1g=vue.defineComponent({__name:"chart-list-widget",props:{type:{default:""}},setup(te){const{proxy:U}=vue.getCurrentInstance(),G=vue.inject("chartList"),ee=ne=>{U.$baseEventBus.emit("model-chart-click",ne)};return(ne,re)=>(vue.openBlock(!0),vue.createElementBlock(vue.Fragment,null,vue.renderList(vue.unref(G),oe=>(vue.openBlock(),vue.createBlock(vue.unref(elementPlus.ElButton),{type:ne.type==oe.type?"primary":"",key:oe.type,onClick:ie=>ee(oe)},{default:vue.withCtx(()=>{var ie;return[vue.createElementVNode("i",{class:vue.normalizeClass((ie=vue.unref(echartsTypeList)[oe.type])==null?void 0:ie.icon)},null,2)]}),_:2},1032,["type","onClick"]))),128))}}),_withScopeId$p=te=>(vue.pushScopeId("data-v-ad68cd37"),te=te(),vue.popScopeId(),te),_hoisted_1$13={class:"overflow-y-auto max-h-96"},_hoisted_2$U=["onClick"],_hoisted_3$M={class:"field-label"},_hoisted_4$K=_withScopeId$p(()=>vue.createElementVNode("i",{class:"ri-add-fill"},null,-1)),_sfc_main$1f=vue.defineComponent({__name:"model-table-other-summary",props:{modelValue:{default:()=>[]},iconMap:{default:()=>{}},list:{default:()=>[]}},emits:["update:modelValue"],setup(te,{emit:U}){const G=te,ee=U,{proxy:ne}=vue.getCurrentInstance();vue.inject("chartList");const re=vue.ref(!1);vue.ref(null);const oe=le=>{ee("update:modelValue",G.modelValue.filter(ae=>ae.showLabel!==le.showLabel))},ie=le=>{if(G.modelValue.some(ae=>ae.identifier==le.identifier)){ne.$message({type:"warning",message:"存在重复数据",plain:!0});return}re.value=!1,ee("update:modelValue",[...G.modelValue,{identifier:le.identifier,comment:le.columnComment,aggType:"other",showLabel:le.columnComment}])};return(le,ae)=>{const se=vue.resolveComponent("aceHeader");return vue.openBlock(),vue.createElementBlock(vue.Fragment,null,[vue.createVNode(se,{title:"显示其他列",class:"mt-2 mb-2"}),vue.createElementVNode("div",null,[(vue.openBlock(!0),vue.createElementBlock(vue.Fragment,null,vue.renderList(le.modelValue,(ue,ce)=>(vue.openBlock(),vue.createBlock(vue.unref(elementPlus.ElTag),{key:ue.value,class:"m-1",closable:!0,onClose:de=>oe(ue),type:"primary"},{default:vue.withCtx(()=>[vue.createTextVNode(vue.toDisplayString(ue.showLabel),1)]),_:2},1032,["onClose"]))),128)),vue.createVNode(vue.unref(elementPlus.ElPopover),{trigger:"click",width:"300px",placement:"top-start",visible:vue.unref(re),"onUpdate:visible":ae[0]||(ae[0]=ue=>vue.isRef(re)?re.value=ue:null)},{reference:vue.withCtx(()=>[vue.createVNode(vue.unref(elementPlus.ElButton),{type:"primary",class:"ml-1",size:"small"},{default:vue.withCtx(()=>[_hoisted_4$K]),_:1})]),default:vue.withCtx(()=>[vue.createElementVNode("div",_hoisted_1$13,[(vue.openBlock(!0),vue.createElementBlock(vue.Fragment,null,vue.renderList(le.list,ue=>(vue.openBlock(),vue.createElementBlock("div",{onClick:ce=>ie(ue),key:ue.identifier,class:"indicators-item"},[vue.createElementVNode("div",null,[vue.createElementVNode("i",{class:vue.normalizeClass([le.iconMap[ue.dataType],"mr-2"])},null,2),vue.createElementVNode("span",_hoisted_3$M,vue.toDisplayString(ue.columnComment),1)])],8,_hoisted_2$U))),128))])]),_:1},8,["visible"])])],64)}}}),modelTableOtherSummary_vue_vue_type_style_index_0_scoped_ad68cd37_lang="",ModelTableOtherSummary=_export_sfc$2(_sfc_main$1f,[["__scopeId","data-v-ad68cd37"]]),_withScopeId$o=te=>(vue.pushScopeId("data-v-3d6e6e94"),te=te(),vue.popScopeId(),te),_hoisted_1$12={class:"flex w-full h-full"},_hoisted_2$T={class:"flex flex-col flex-1 overflow-hidden"},_hoisted_3$L={class:"flex flex-col flex-1 pb-3 pr-3 overflow-y-auto"},_hoisted_4$J={key:0,class:"relative flex items-center justify-center pannel h-14"},_hoisted_5$A={class:"absolute left-5 top-3"},_hoisted_6$v=_withScopeId$o(()=>vue.createElementVNode("i",{class:"ml-1 ri-settings-2-line"},null,-1)),_hoisted_7$r=_withScopeId$o(()=>vue.createElementVNode("i",{class:"ri-table-line"},null,-1)),_hoisted_8$n={class:"absolute flex items-center right-5 top-4"},_hoisted_9$k=_withScopeId$o(()=>vue.createElementVNode("i",{class:"mr-1 ri-settings-2-line"},null,-1)),_hoisted_10$h={class:"ml-2 mr-2"},_hoisted_11$d={class:"flex flex-col"},_hoisted_12$b={class:"flex-1 overflow-y-auto"},_hoisted_13$9={key:0,class:"flex items-center justify-center pannel h-14"},_hoisted_14$8=_withScopeId$o(()=>vue.createElementVNode("i",{class:"mr-1 ri-save-line"},null,-1)),_sfc_main$1e=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(te,{expose:U,emit:G}){const ee=te,ne=G,re=screenDesignMainStore(),{proxy:oe}=vue.getCurrentInstance(),{setFormValue:ie,getFormValue:le}=oe.$globalHooks.useForm(),{dynamicSearchForm:ae,dynamicSearchFormat:se,dynamicSearchParams:ue}=oe.$aceDynamicSearch(),ce=vue.inject("modelEle"),de=vue.inject("getListModelIndicators");vue.inject("chartList");const fe={varchar:"ri-text",date:"ri-calendar-2-line",datetime:"ri-calendar-2-line",int:"ri-hashtag",decimal:"ri-hashtag"},ve={day:"按日",week:"按周",month:"按月",quarter:"按季度",year:"按年","":"按时分秒"},he=vue.ref(!1),pe=vue.ref(!0),ge=vue.ref(0),me=vue.ref([]),_e=vue.ref([]),be=vue.ref([]),ye=vue.ref([]),xe=vue.ref([]),Ce=vue.ref(!0),$e=vue.ref(!0),we=async Me=>{var We,Ue;Ce.value=!0,$e.value=!1;const ze=JSON.parse((Me==null?void 0:Me.groupArgsJson)??"[]"),Ge=JSON.parse((Me==null?void 0:Me.aggArgsJson)??JSON.stringify([{identifier:1,aggType:"count",showLabel:"行数"}]));ye.value=Ge.filter(qe=>qe.aggType!="other"),xe.value=Ge.filter(qe=>qe.aggType=="other"),ze.length||(Ce.value=!1),ge.value=(Me==null?void 0:Me.pageSize)??20,Te.value=JSON.parse((Me==null?void 0:Me.sortArgsJson)??"{}"),Me!=null&&Me.formConfJson?(ae.value=se(JSON.parse(Me.formConfJson??"[]")),ne("update:dynamicSearchForm",ae.value)):await fetch$1(oe).getFormJsonConfig((We=vue.unref(ce))==null?void 0:We.id).then(qe=>{var Ye;ae.value=se(JSON.parse(((Ye=qe.data)==null?void 0:Ye.formConfJson)??"[]"))}),ne("update:dynamicSearchForm",ae.value),ie(Me,Be),oe.$baseHttp.post("/api/ace-data-center/aidc/modelAnalysis",{projectId:oe.$baseGetCurrentProjectId(),modelId:(Ue=vue.unref(ce))==null?void 0:Ue.id,serialId:new Date().getTime()}).then(qe=>{pe.value=!1,me.value=qe.data.filter(Ye=>!["创建时间","创建人","所属项目","创建部门","标签"].includes(Ye.columnComment)).map(Ye=>({...Ye,dateFormatType:["date","datetime"].includes(Ye.dataType)?"day":""})),be.value=qe.data.filter(Ye=>["ADDABLE","SEMIADDABLE"].includes(Ye.quantityType)),ze.forEach(Ye=>{const Je=me.value.find(Xe=>Xe.identifier==Ye.identifier);Je&&(_e.value.push({...Je,dataType:Ye.dataType,dateFormatType:Ye.dateFormatType}),Je.dateFormatType=Ye.dateFormatType)}),Ce.value=!1,setTimeout(()=>{$e.value=!0},1e3)})};vue.watch([ye,_e,xe],()=>{vue.unref($e)&&(Te.value={}),Ie()},{deep:!0});let Ee=null;const Ve=vue.ref(null),Se=vue.ref(!1),ke=vue.ref([]),Ne=vue.ref([]),Ie=async()=>{clearTimeout(Ee),Ee=setTimeout(async()=>{var Ue,qe;Ne.value=[],re.setChartData([]);const Me=Pe(),ze=Object.keys(vue.unref(Te)).map(Ye=>({field:Ye,type:vue.unref(Te)[Ye]=="ascending"?"asc":"desc"})),Ge={aggArgsJson:JSON.stringify([...vue.unref(ye),...vue.unref(xe)]),groupArgsJson:JSON.stringify(Me),sortArgsJson:JSON.stringify(ze),params:ue(vue.unref(ae)),pageSize:vue.unref(ge),modelId:(Ue=vue.unref(ce))==null?void 0:Ue.id};if(ee.indicatorsId&&(Ge.modelIndicatorsId=ee.indicatorsId),ne("update:title",`${vue.unref(ye).length}个指标:${vue.unref(ye).length?"根据":""}${Me.map(Ye=>Ye.showLabel).toString()}${vue.unref(ye).length?"分组的":""}${vue.unref(ye).filter((Ye,Je)=>Je<3).map(Ye=>Ye.showLabel).toString()}${vue.unref(ye).length>3?"...":""}`),!vue.unref(ye).length||vue.unref(Ce)){ke.value=[];return}Se.value=!0;const We=await oe.$baseHttp.post("/api/ace-data-center/model-indicators/debug",Ge);Ve.value=Ge,Se.value=!1,We&&(ke.value=((qe=We.data)==null?void 0:qe.records)??[],re.setChartData({x:Me,y:[...vue.unref(ye),...vue.unref(xe)],params:Ge}),vue.unref(ke).length&&Object.keys(vue.unref(ke)[0]).forEach(Ye=>{Ne.value.push({label:Ye,prop:Ye,sortable:"custom"})}))})},Pe=()=>vue.unref(_e).map(Me=>({identifier:Me.identifier,comment:Me.columnComment,showLabel:Me.columnComment+(ve[Me.dateFormatType]??""),dateFormatType:Me.dateFormatType||null})),Te=vue.ref({}),De=({column:Me})=>{vue.unref(Te)[Me.property]&&(Me.order=vue.unref(Te)[Me.property])};vue.watch(Te,Me=>{const ze=Object.keys(Me).map(Ge=>`${Ge}${Me[Ge]=="descending"?"降序":"升序"}`);ne("update:sortHtml",ze.length?`<span class="text-color-warning">排序:${ze.toString()}</span>`:"")},{deep:!0});const Oe=Me=>{const{prop:ze,order:Ge}=Me;!Ge||vue.unref(Te)[ze]===Ge?delete vue.unref(Te)[ze]:vue.unref(Te)[ze]=Ge,Ie()};fetch$1(oe).loadIndicatorsMenu().then(Me=>{Be.find(ze=>ze.fieldName=="tags").options=Object.keys(Me.data).map(ze=>({label:ze,value:ze}))});const Be=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}]),Ae=vue.ref(!1),Le=()=>{Be.find(Me=>Me.fieldName=="remark").value=ee.title,Ae.value=!0},Re=async()=>{var Ue;const{params:Me,error:ze}=le(Be);if(ze.length>0)return;const Ge=Pe();if(!Ge.length||!vue.unref(ye).length){oe.$message({type:"warning",message:"计算维度或汇总方式不能为空",plain:!0});return}Me.code||(Me.code=nanoid()),Me.groupArgsJson=JSON.stringify(Ge),Me.aggArgsJson=JSON.stringify([...vue.unref(ye),...vue.unref(xe)]),Me.modelId=(Ue=vue.unref(ce))==null?void 0:Ue.id,Me.projectId=oe.$baseGetCurrentProjectId(),Me.pageSize=vue.unref(ge),Me.formConfJson=JSON.stringify(vue.unref(ae)),Me.sortArgsJson=JSON.stringify(vue.unref(Te)),ee.indicatorsId&&(Me.id=ee.indicatorsId),Ae.value=!1;const We=await oe.$baseHttp.post(`/api/ace-data-center/model-indicators/${ee.indicatorsId?"update":"save"}`,Me,{header:{loading:!0}});We&&(ee.indicatorsId||ne("update:indicatorsId",We.data),ne("update:resultTitle",Me.name),oe.$message({type:"success",message:"操作成功",plain:!0}),ie(Me,Be),de())},Fe=()=>{ne("update:modelValue","chart")},je=()=>{oe.$baseExportExcel({title:ee.title,url:"/api/ace-data-center/model-indicators/debug",header:vue.unref(Ne),customParams:vue.unref(Ve)})};return U({init:we,dynamicSearchForm:ae,handlePopupForm:Le,handleSubmit:Re}),(Me,ze)=>{var Xe,Ke;const Ge=vue.resolveComponent("aceDynamicSearch"),We=vue.resolveComponent("AppTable"),Ue=vue.resolveComponent("AppEmpty"),qe=vue.resolveComponent("aceDynamicList"),Ye=vue.resolveComponent("AppForm"),Je=vue.resolveComponent("AppDialog");return vue.openBlock(),vue.createElementBlock("div",_hoisted_1$12,[vue.createElementVNode("div",_hoisted_2$T,[vue.createElementVNode("div",_hoisted_3$L,[vue.unref(ye).length?(vue.openBlock(),vue.createElementBlock(vue.Fragment,{key:0},[vue.createVNode(Ge,{form:vue.unref(ae),onSuccess:ze[0]||(ze[0]=He=>Ie())},null,8,["form"]),vue.createVNode(vue.unref(elementPlus.ElSkeleton),{loading:vue.unref(Se),animated:""},{default:vue.withCtx(()=>[vue.unref(Ne).length?(vue.openBlock(),vue.createBlock(We,{key:0,tableData:vue.unref(Ne),list:vue.unref(ke),loading:!1,headerCellClassName:De,onSortChange:Oe},null,8,["tableData","list"])):(vue.openBlock(),vue.createBlock(Ue,{key:1,description:"暂无数据",class:"mt-4"}))]),_:1},8,["loading"])],64)):(vue.openBlock(),vue.createBlock(qe,{key:1,id:(Xe=vue.unref(ce))==null?void 0:Xe.id,title:(Ke=vue.unref(ce))==null?void 0:Ke.modelName,showPageIndex:!0},null,8,["id","title"]))]),vue.unref(ye).length?(vue.openBlock(),vue.createElementBlock("div",_hoisted_4$J,[vue.createElementVNode("div",_hoisted_5$A,[vue.createVNode(vue.unref(elementPlus.ElTooltip),{effect:"dark",content:"保存汇总配置后可设置",placement:"top",visible:vue.unref(he)},{default:vue.withCtx(()=>[vue.createVNode(vue.unref(elementPlus.ElButton),{disabled:Me.indicatorsId=="",type:"warning",style:{padding:"0 10px"},onMouseenter:ze[1]||(ze[1]=He=>{Me.indicatorsId||(he.value=!0)}),onMouseleave:ze[2]||(ze[2]=He=>he.value=!1),onClick:Fe},{default:vue.withCtx(()=>[vue.createTextVNode(" 图表配置 "),_hoisted_6$v]),_: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$r]),_:1}),vue.createVNode(_sfc_main$1g)]),_:1}),vue.createElementVNode("div",_hoisted_8$n,[vue.createVNode(vue.unref(elementPlus.ElLink),{type:"primary"},{default:vue.withCtx(()=>[_hoisted_9$k,vue.createTextVNode(" 显示前 "),vue.createElementVNode("div",_hoisted_10$h,[vue.createVNode(vue.unref(elementPlus.ElInputNumber),{size:"small",style:{width:"100px"},modelValue:vue.unref(ge),"onUpdate:modelValue":ze[3]||(ze[3]=He=>vue.isRef(ge)?ge.value=He:null),onChange:ze[4]||(ze[4]=He=>Ie()),min:1,max:9999999},null,8,["modelValue"])]),vue.createTextVNode(" 条聚合数据 ")]),_:1}),vue.unref(Ne).length?(vue.openBlock(),vue.createElementBlock("i",{key:0,class:"ml-2 cursor-pointer ri-download-2-line text-color-warning",onClick:je})):vue.createCommentVNode("",!0)])])):vue.createCommentVNode("",!0)]),vue.createElementVNode("aside",_hoisted_11$d,[vue.createElementVNode("div",_hoisted_12$b,[vue.createVNode(modelTableSunmary,{list:vue.unref(be),modelValue:vue.unref(ye),"onUpdate:modelValue":ze[5]||(ze[5]=He=>vue.isRef(ye)?ye.value=He:null),iconMap:fe},null,8,["list","modelValue"]),vue.createVNode(ModelTableOtherSummary,{iconMap:fe,list:vue.unref(me),modelValue:vue.unref(xe),"onUpdate:modelValue":ze[6]||(ze[6]=He=>vue.isRef(xe)?xe.value=He:null)},null,8,["list","modelValue"]),vue.withDirectives(vue.createElementVNode("div",null,[vue.createVNode(modelTableDimension,{loading:vue.unref(pe),list:vue.unref(me),iconMap:fe,calendarType:ve,modelValue:vue.unref(_e),"onUpdate:modelValue":ze[7]||(ze[7]=He=>vue.isRef(_e)?_e.value=He:null)},null,8,["loading","list","modelValue"])],512),[[vue.vShow,vue.unref(ye).length]])]),vue.unref(ye).length?(vue.openBlock(),vue.createElementBlock("div",_hoisted_13$9,[vue.createVNode(vue.unref(elementPlus.ElButton),{type:"primary",onClick:Le},{default:vue.withCtx(()=>[_hoisted_14$8,vue.createTextVNode(" 完 成 ")]),_:1})])):vue.createCommentVNode("",!0),vue.createVNode(Je,{modelValue:vue.unref(Ae),"onUpdate:modelValue":ze[9]||(ze[9]=He=>vue.isRef(Ae)?Ae.value=He:null),title:"保存指标",size:800},{footer:vue.withCtx(()=>[vue.createVNode(vue.unref(elementPlus.ElButton),{class:"ml-3",type:"primary",onClick:Re},{default:vue.withCtx(()=>[vue.createTextVNode("保存")]),_:1}),vue.createVNode(vue.unref(elementPlus.ElButton),{class:"ml-3",onClick:ze[8]||(ze[8]=He=>Ae.value=!1)},{default:vue.withCtx(()=>[vue.createTextVNode("取消")]),_:1})]),default:vue.withCtx(()=>[vue.createVNode(Ye,{form:vue.unref(Be),col:1},null,8,["form"])]),_:1},8,["modelValue"])])])}}}),tableWidget_vue_vue_type_style_index_0_scoped_3d6e6e94_lang="",tableWidget=_export_sfc$2(_sfc_main$1e,[["__scopeId","data-v-3d6e6e94"]]),_withScopeId$n=te=>(vue.pushScopeId("data-v-6fadb38d"),te=te(),vue.popScopeId(),te),_hoisted_1$11={class:"flex flex-wrap chart-container"},_hoisted_2$S=["onClick"],_hoisted_3$K=["onClick"],_hoisted_4$I=_withScopeId$n(()=>vue.createElementVNode("i",{class:"ml-1 ri-settings-2-line"},null,-1)),_hoisted_5$z=[_hoisted_4$I],_hoisted_6$u={key:0,class:"success setting"},_hoisted_7$q=_withScopeId$n(()=>vue.createElementVNode("i",{class:"ml-1 ri-check-line"},null,-1)),_hoisted_8$m=[_hoisted_7$q],_hoisted_9$j={class:"label"},_sfc_main$1d=vue.defineComponent({__name:"model-chart-menu",props:{modelValue:{default:""}},emits:["click-chart-setting","update:modelValue"],setup(te,{emit:U}){vue.getCurrentInstance();const G=[{...echartsTypeList[3],key:"3"},...Object.keys(echartsTypeList).filter(ie=>ie!="3").map(ie=>({...echartsTypeList[ie],key:ie}))],ee=vue.inject("chartList"),ne=U,re=ie=>{ne("update:modelValue",String(ie))},oe=ie=>{ne("update:modelValue",String(ie)),ne("click-chart-setting")};return(ie,le)=>(vue.openBlock(),vue.createElementBlock("div",_hoisted_1$11,[(vue.openBlock(),vue.createElementBlock(vue.Fragment,null,vue.renderList(G,ae=>{var se;return vue.createElementVNode("div",{class:"items",key:ae.key,onClick:ue=>re(ae.key)},[vue.createElementVNode("div",{class:vue.normalizeClass(["icon",{active:ie.modelValue==ae.key}])},[vue.createElementVNode("i",{class:vue.normalizeClass(ae.icon)},null,2),vue.createElementVNode("div",{class:"setting",onClick:vue.withModifiers(ue=>oe(ae.key),["stop"])},_hoisted_5$z,8,_hoisted_3$K),(se=vue.unref(ee))!=null&&se.some(ue=>ue.type==ae.key)?(vue.openBlock(),vue.createElementBlock("div",_hoisted_6$u,_hoisted_8$m)):vue.createCommentVNode("",!0)],2),vue.createElementVNode("div",_hoisted_9$j,vue.toDisplayString(ae.name),1)],8,_hoisted_2$S)}),64))]))}}),modelChartMenu_vue_vue_type_style_index_0_scoped_6fadb38d_lang="",modelChartMenu=_export_sfc$2(_sfc_main$1d,[["__scopeId","data-v-6fadb38d"]]),_sfc_main$1c=vue.defineComponent({__name:"model-chart-setting",props:{option:{default:{}},type:{default:""}},emits:["close"],setup(te,{expose:U,emit:G}){const ee=te,ne=G,{proxy:re}=vue.getCurrentInstance(),oe=vue.ref(""),ie=vue.inject("indicatorsId"),le=vue.inject("getListModelIndicators"),ae=vue.inject("getChartWidgetList"),se=vue.computed(()=>({3:_sfc_main$1G,2:_sfc_main$1E,1:_sfc_main$1F,4:_sfc_main$1B,5:_sfc_main$1D,6:_sfc_main$1C,7:_sfc_main$1A,8:_sfc_main$1z,9:_sfc_main$1y})[ee.type]??null),ue=vue.ref(!1),ce=()=>{oe.value="data",ue.value=!0},de=async()=>{ee.option.tooltip&&(delete ee.option.tooltip.valueFormatter,delete ee.option.tooltip.formatter),ee.type=="9"&&delete ee.option.series[2].label.formatter,await re.$baseHttp.post("/api/ace-data-center/model-indicators-echarts/save",{modelIndicatorsId:vue.unref(ie),echartsType:ee.type,echartsConfig:chartJsonToStringFormat({...ee.option,customSeriesData:window.customSeriesData,dataset:{...ee.option.dataset,source:[]}})},{headers:{loading:!0}})&&(re.$message({type:"success",message:"操作成功",plain:!0}),await ae(),await le(),ue.value=!1,ne("close"))},fe=()=>{ue.value=!1};return U({init:ce,handleSubmit:de}),(ve,he)=>{const pe=vue.resolveComponent("AppDrawer");return vue.openBlock(),vue.createBlock(pe,{modelValue:vue.unref(ue),"onUpdate:modelValue":he[3]||(he[3]=ge=>vue.isRef(ue)?ue.value=ge:null),withHeader:!1,modal:!1,direction:"ltr",size:"300px",modalClass:"ace-modal-drawer"},{footer:vue.withCtx(()=>[vue.createVNode(vue.unref(elementPlus.ElButton),{type:"primary",onClick:he[1]||(he[1]=ge=>de())},{default:vue.withCtx(()=>[vue.createTextVNode("保存")]),_:1}),vue.createVNode(vue.unref(elementPlus.ElButton),{class:"ml-3",onClick:he[2]||(he[2]=ge=>fe())},{default:vue.withCtx(()=>[vue.createTextVNode("关闭")]),_:1})]),default:vue.withCtx(()=>[vue.createVNode(vue.unref(elementPlus.ElCollapse),{accordion:"",modelValue:vue.unref(oe),"onUpdate:modelValue":he[0]||(he[0]=ge=>vue.isRef(oe)?oe.value=ge:null)},{default:vue.withCtx(()=>[vue.unref(se)?(vue.openBlock(),vue.createBlock(vue.unref(se),{key:0,option:ee.option,type:ve.type},null,8,["option","type"])):vue.createCommentVNode("",!0)]),_:1},8,["modelValue"])]),_:1},8,["modelValue"])}}}),modelChartSetting_vue_vue_type_style_index_0_scoped_b48a9fb7_lang="",modelChartSetting=_export_sfc$2(_sfc_main$1c,[["__scopeId","data-v-b48a9fb7"]]),_withScopeId$m=te=>(vue.pushScopeId("data-v-7094027b"),te=te(),vue.popScopeId(),te),_hoisted_1$10={class:"flex w-full h-full"},_hoisted_2$R={class:"flex-1"},_hoisted_3$J={key:0,class:"flex items-center justify-center pannel h-14"},_hoisted_4$H=_withScopeId$m(()=>vue.createElementVNode("i",{class:"mr-1 ri-save-line"},null,-1)),_hoisted_5$y={class:"flex flex-col flex-1 overflow-hidden"},_hoisted_6$t={class:"relative flex flex-col flex-1 pb-3 pl-3"},_hoisted_7$p={class:"mb-2.5"},_hoisted_8$l={class:"relative flex items-center justify-center pannel h-14"},_hoisted_9$i={key:0,class:"absolute left-5 top-3"},_hoisted_10$g=_withScopeId$m(()=>vue.createElementVNode("i",{class:"ml-1 ri-settings-2-line"},null,-1)),_hoisted_11$c=_withScopeId$m(()=>vue.createElementVNode("i",{class:"ri-table-line"},null,-1)),_sfc_main$1b=vue.defineComponent({__name:"chart-widget",props:{modelValue:{default:""},dynamicSearchForm:{default:()=>[]}},emits:["update:modelValue"],setup(te,{expose:U,emit:G}){const ee=G,{proxy:ne}=vue.getCurrentInstance(),re=vue.inject("chartList"),{option:oe,formatChart:ie}=useCustomChart(),le=vue.ref(""),ae=vue.ref(null),se=vue.ref(!1),ue=()=>{if(vue.unref(le)==""){ne.$message({type:"warning",message:"请选择图表",plain:!0});return}const he=setInterval(()=>{vue.unref(se)&&(vue.unref(ae).init(),clearInterval(he))},20)};vue.watch(le,async he=>{var ge;if(oe.value={},se.value=!1,he==""){se.value=!0;return}const pe=(ge=vue.unref(re))==null?void 0:ge.find(me=>me.type==he);await ie((pe==null?void 0:pe.code)??"",he),se.value=!0});const ce=vue.ref(!1);ne.$baseEventBus.on("model-chart-click",async he=>{ce.value=!0,ee("update:modelValue","chart"),le.value=he.type,setTimeout(()=>{ce.value=!1},100)});const de=()=>{if(vue.unref(re).length>0){vue.unref(ce)||(le.value=vue.unref(re)[0].type),se.value=!0;return}le.value="3"},fe=()=>{const he=le.value;le.value="",setTimeout(()=>{le.value=he},10)},ve=()=>{le.value="",ee("update:modelValue","table")};return U({init:de}),(he,pe)=>{var _e;const ge=vue.resolveComponent("aceDynamicSearch"),me=vue.resolveComponent("aceCustomChart");return vue.openBlock(),vue.createElementBlock("div",_hoisted_1$10,[vue.createElementVNode("aside",null,[vue.createElementVNode("div",_hoisted_2$R,[vue.createVNode(modelChartMenu,{modelValue:vue.unref(le),"onUpdate:modelValue":pe[0]||(pe[0]=be=>vue.isRef(le)?le.value=be:null),onClickChartSetting:ue},null,8,["modelValue"])]),(_e=vue.unref(re))!=null&&_e.some(be=>be.type==vue.unref(le))?vue.createCommentVNode("",!0):(vue.openBlock(),vue.createElementBlock("div",_hoisted_3$J,[vue.createVNode(vue.unref(elementPlus.ElButton),{type:"primary",onClick:pe[1]||(pe[1]=be=>vue.unref(ae).handleSubmit())},{default:vue.withCtx(()=>[_hoisted_4$H,vue.createTextVNode(" 保 存 ")]),_:1})]))]),vue.createElementVNode("div",_hoisted_5$y,[vue.createElementVNode("div",_hoisted_6$t,[vue.createVNode(vue.unref(elementPlus.ElSkeleton),{loading:!vue.unref(se),animated:""},{default:vue.withCtx(()=>[vue.createElementVNode("div",_hoisted_7$p,[vue.createVNode(ge,{form:he.dynamicSearchForm,search:!1,disabled:""},null,8,["form"])]),vue.createVNode(me,{option:vue.unref(oe),chartType:vue.unref(le)},null,8,["option","chartType"])]),_:1},8,["loading"])]),vue.createElementVNode("div",_hoisted_8$l,[vue.unref(oe)?(vue.openBlock(),vue.createElementBlock("div",_hoisted_9$i,[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:ue},{default:vue.withCtx(()=>[_hoisted_10$g]),_:1})]),_:1})])):vue.createCommentVNode("",!0),vue.createVNode(vue.unref(elementPlus.ElButtonGroup),null,{default:vue.withCtx(()=>[vue.createVNode(vue.unref(elementPlus.ElButton),{type:"",onClick:ve},{default:vue.withCtx(()=>[_hoisted_11$c]),_:1}),vue.createVNode(_sfc_main$1g,{type:vue.unref(le)},null,8,["type"])]),_:1})])]),vue.unref(le)?(vue.openBlock(),vue.createBlock(modelChartSetting,{key:0,ref_key:"modelChartSettingRef",ref:ae,option:vue.unref(oe),type:vue.unref(le),onClose:fe},null,8,["option","type"])):vue.createCommentVNode("",!0)])}}}),chartWidget_vue_vue_type_style_index_0_scoped_7094027b_lang="",chartWidget=_export_sfc$2(_sfc_main$1b,[["__scopeId","data-v-7094027b"]]),_withScopeId$l=te=>(vue.pushScopeId("data-v-e26b4ea0"),te=te(),vue.popScopeId(),te),_hoisted_1$$={class:"design"},_hoisted_2$Q={class:"design-header"},_hoisted_3$I={class:"flex-1"},_hoisted_4$G={class:"mt-2 text-xs text-color-info"},_hoisted_5$x=["innerHTML"],_hoisted_6$s={class:"flex"},_hoisted_7$o={class:"mr-2"},_hoisted_8$k=_withScopeId$l(()=>vue.createElementVNode("i",{class:"mr-1 ri-settings-2-line"},null,-1)),_hoisted_9$h=_withScopeId$l(()=>vue.createElementVNode("i",{class:"mr-1 ri-close-line"},null,-1)),_hoisted_10$f={class:"flex flex-1 p-3 overflow-hidden design-container"},_sfc_main$1a=vue.defineComponent({__name:"index",emits:["close"],setup(te,{expose:U,emit:G}){screenDesignMainStore();const{proxy:ee}=vue.getCurrentInstance(),ne=vue.ref(!1),re=vue.ref(!1),oe=vue.ref(),ie=vue.ref(null),le=vue.ref(null),ae=vue.ref(null),se=vue.ref([]),ue=vue.ref("0个指标"),ce=vue.ref(""),de=vue.ref(""),fe=vue.ref([]),ve=G;vue.watch(ne,xe=>{xe||ee.$baseEventBus.off("model-chart-click")}),vue.provide("indicatorsId",de);const he=vue.inject("modelEle"),pe=vue.ref(""),ge=async xe=>{var $e;let Ce={};oe.value="table",de.value=xe,fe.value=[],se.value=[],vue.unref(de)&&(Ce=await me(),_e()),ne.value=!0,pe.value=($e=Ce==null?void 0:Ce.data)==null?void 0:$e.name,vue.nextTick(()=>{vue.unref(ie).init((Ce==null?void 0:Ce.data)??{})})};vue.watch(oe,xe=>{xe=="chart"&&vue.unref(le).init()});const me=async()=>await ee.$baseHttp.get(`/api/ace-data-center/model-indicators/detail?id=${vue.unref(de)}`,{headers:{loading:!0}}),_e=async()=>{const xe=await ee.$baseHttp.post(`/api/ace-data-center/model-indicators-echarts/getEchartsTypes/${vue.unref(de)}`);fe.value=xe.data};vue.provide("getChartWidgetList",_e),vue.provide("chartList",fe);const be=()=>{ee.$baseConfirm({content:"是否确定关闭",callConfirm:async()=>{ne.value=!1,vue.unref(de)&&ve("close")}})},ye=xe=>{se.value=xe,vue.unref(ie).dynamicSearchForm=xe,vue.unref(ie).handleSubmit()};return U({init:ge}),(xe,Ce)=>{const $e=vue.resolveComponent("aceHeader"),we=vue.resolveComponent("AppDrawer");return vue.openBlock(),vue.createBlock(we,{modelValue:vue.unref(ne),"onUpdate:modelValue":Ce[11]||(Ce[11]=Ee=>vue.isRef(ne)?ne.value=Ee:null),withHeader:!1,size:"100%",modalClass:"ace-modal-drawer"},{default:vue.withCtx(()=>{var Ee,Ve;return[vue.createElementVNode("div",_hoisted_1$$,[vue.createElementVNode("div",_hoisted_2$Q,[vue.createElementVNode("div",_hoisted_3$I,[vue.createVNode($e,{title:vue.unref(oe)=="table"?vue.unref(ue):`${vue.unref(pe)}【${vue.unref(ue)}】`},vue.createSlots({_:2},[vue.unref(fe).length?{name:"left",fn:vue.withCtx(()=>[vue.createElementVNode("i",{onClick:Ce[0]||(Ce[0]=Se=>vue.unref(ie).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$G,[vue.createTextVNode(" 模型数据 / "+vue.toDisplayString((Ee=vue.unref(he))==null?void 0:Ee.modelName)+" ["+vue.toDisplayString((Ve=vue.unref(he))==null?void 0:Ve.modelCode)+"] ",1),vue.createElementVNode("span",{class:"ml-2",innerHTML:vue.unref(ce)},null,8,_hoisted_5$x)])]),vue.createElementVNode("div",_hoisted_6$s,[vue.withDirectives(vue.createElementVNode("div",_hoisted_7$o,[vue.createVNode(vue.unref(elementPlus.ElPopover),{placement:"bottom",visible:vue.unref(re),"onUpdate:visible":Ce[2]||(Ce[2]=Se=>vue.isRef(re)?re.value=Se:null),trigger:"click",width:"900px",teleported:!1},{reference:vue.withCtx(()=>[vue.createVNode(vue.unref(elementPlus.ElButton),{type:"warning"},{default:vue.withCtx(()=>[_hoisted_8$k,vue.createTextVNode(" 筛选配置 ")]),_:1})]),default:vue.withCtx(()=>[vue.createVNode(aceIndicatorCustomSearch,{ref_key:"customSearchRef",ref:ae,customSearchVisible:vue.unref(re),"onUpdate:customSearchVisible":Ce[1]||(Ce[1]=Se=>vue.isRef(re)?re.value=Se:null),onDynamicSearchFormUpdate:ye,dynamicSearchForm:vue.unref(se)},null,8,["customSearchVisible","dynamicSearchForm"])]),_:1},8,["visible"])],512),[[vue.vShow,vue.unref(oe)=="table"&&vue.unref(ue)!="0个指标:"]]),vue.createVNode(vue.unref(elementPlus.ElButton),{onClick:be},{default:vue.withCtx(()=>[_hoisted_9$h,vue.createTextVNode(" 关闭 ")]),_:1})])]),vue.createElementVNode("div",_hoisted_10$f,[vue.withDirectives(vue.createVNode(tableWidget,{ref_key:"tableWidgetRef",ref:ie,modelValue:vue.unref(oe),"onUpdate:modelValue":Ce[3]||(Ce[3]=Se=>vue.isRef(oe)?oe.value=Se:null),indicatorsId:vue.unref(de),"onUpdate:indicatorsId":Ce[4]||(Ce[4]=Se=>vue.isRef(de)?de.value=Se:null),title:vue.unref(ue),"onUpdate:title":Ce[5]||(Ce[5]=Se=>vue.isRef(ue)?ue.value=Se:null),resultTitle:vue.unref(pe),"onUpdate:resultTitle":Ce[6]||(Ce[6]=Se=>vue.isRef(pe)?pe.value=Se:null),sortHtml:vue.unref(ce),"onUpdate:sortHtml":Ce[7]||(Ce[7]=Se=>vue.isRef(ce)?ce.value=Se:null),dynamicSearchForm:vue.unref(se),"onUpdate:dynamicSearchForm":Ce[8]||(Ce[8]=Se=>vue.isRef(se)?se.value=Se:null)},null,8,["modelValue","indicatorsId","title","resultTitle","sortHtml","dynamicSearchForm"]),[[vue.vShow,vue.unref(oe)=="table"]]),vue.withDirectives(vue.createVNode(chartWidget,{ref_key:"chartWidgetRef",ref:le,dynamicSearchForm:vue.unref(se),"onUpdate:dynamicSearchForm":Ce[9]||(Ce[9]=Se=>vue.isRef(se)?se.value=Se:null),modelValue:vue.unref(oe),"onUpdate:modelValue":Ce[10]||(Ce[10]=Se=>vue.isRef(oe)?oe.value=Se:null)},null,8,["dynamicSearchForm","modelValue"]),[[vue.vShow,vue.unref(oe)=="chart"]])])])]}),_:1},8,["modelValue"])}}}),index_vue_vue_type_style_index_0_scoped_e26b4ea0_lang="",aceIndicatorDesign=_export_sfc$2(_sfc_main$1a,[["__scopeId","data-v-e26b4ea0"]]),_hoisted_1$_={class:"flex items-center"},_hoisted_2$P=vue.createElementVNode("i",{class:"ri-search-line"},null,-1),_hoisted_3$H={class:"mt-3"},_hoisted_4$F={class:"flex items-center w-full overflow-hidden"},_hoisted_5$w={class:"overflow-hidden text-ellipsis whitespace-nowrap"},_hoisted_6$r={key:0,class:"mr-1 text-base ri-checkbox-circle-fill text-color-success"},_hoisted_7$n={key:1,class:"mr-1 text-base ri-progress-1-fill text-color-warning"},_hoisted_8$j={key:0,class:"flex items-center justify-end flex-1"},_sfc_main$19=vue.defineComponent({__name:"menu",props:{tempId:{default:""}},emits:["node-click"],setup(te,{expose:U,emit:G}){const ee=te,{proxy:ne}=vue.getCurrentInstance(),re=vue.ref(""),oe=vue.ref(null),ie=vue.ref(null),le=G;vue.watch(re,de=>{vue.unref(ie).filter(de)});const ae=(de,fe)=>de?fe.name.includes(de):!0,se=vue.ref(!1),ue=()=>{oe.value=[],se.value=!0,fetch$1(ne).loadIndicatorsMenu().then(de=>{oe.value=Object.keys(de.data).map(ve=>({name:ve,id:ve,children:de.data[ve]}));let fe;se.value=!1,vue.unref(oe).length&&vue.nextTick(()=>{var ve;ee.tempId?fe=vue.unref(ie).getNode(ee.tempId):fe=vue.unref(ie).getNode((ve=vue.unref(oe)[0].children[0])==null?void 0:ve.id),fe&&(ce(fe==null?void 0:fe.data),vue.unref(ie).setCurrentKey(fe==null?void 0:fe.data.id))})})};ue();const ce=de=>{Array.isArray(de.children)||le("node-click",de)};return U({init:ue}),(de,fe)=>{const ve=vue.resolveComponent("AppEmpty");return vue.openBlock(),vue.createElementBlock(vue.Fragment,null,[vue.createElementVNode("div",_hoisted_1$_,[vue.createVNode(vue.unref(elementPlus.ElInput),{placeholder:"请输入内容",clearable:"",modelValue:vue.unref(re),"onUpdate:modelValue":fe[0]||(fe[0]=he=>vue.isRef(re)?re.value=he:null)},{prefix:vue.withCtx(()=>[_hoisted_2$P]),_:1},8,["modelValue"]),vue.renderSlot(de.$slots,"search")]),vue.createElementVNode("div",_hoisted_3$H,[vue.unref(se)?(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:ie,data:vue.unref(oe),"node-key":"id","default-expand-all":"",indent:0,"highlight-current":"","filter-node-method":ae,onNodeClick:ce},{default:vue.withCtx(({node:he,data:pe})=>[vue.createElementVNode("div",_hoisted_4$F,[vue.createElementVNode("div",_hoisted_5$w,[Array.isArray(pe.children)?vue.createCommentVNode("",!0):(vue.openBlock(),vue.createElementBlock(vue.Fragment,{key:0},[pe.normal?(vue.openBlock(),vue.createElementBlock("i",_hoisted_6$r)):(vue.openBlock(),vue.createElementBlock("i",_hoisted_7$n))],64)),vue.createElementVNode("span",{class:vue.normalizeClass(["flex-1 overflow-hidden whitespace-nowrap text-ellipsis",{"font-bold":he.level==1}])},vue.toDisplayString(pe.name),3)]),Array.isArray(pe.children)?vue.createCommentVNode("",!0):(vue.openBlock(),vue.createElementBlock("div",_hoisted_8$j,[vue.renderSlot(de.$slots,"menu-item",{data:pe})]))])]),empty:vue.withCtx(()=>[vue.createVNode(ve,{description:"暂无数据"})]),_:3},8,["data"]))])],64)}}}),_hoisted_1$Z={class:"rule-list"},_hoisted_2$O={key:0,class:"flex items-center"},_hoisted_3$G=vue.createElementVNode("i",{class:"ri-error-warning-fill text-2xl text-color-warning mr-2"},null,-1),_hoisted_4$E={key:1,class:"flex items-center"},_hoisted_5$v=vue.createElementVNode("i",{class:"ri-checkbox-circle-fill text-2xl text-color-success mr-2"},null,-1),_sfc_main$18=vue.defineComponent({__name:"rule",props:{ruleList:{default:()=>[]}},setup(te){const{proxy:U}=vue.getCurrentInstance(),G=vue.ref(!1),ee=vue.ref(""),ne=vue.ref([]),re=le=>{ee.value=`/api/ace-data-center/rule/ruleDataView?ruleId=${le}`,G.value=!0},oe=le=>{vue.unref(ne).length==0&&Object.keys(le.data[0]).forEach(ae=>{if(ae==="pageIndex"){ne.value.unshift({label:"序号",prop:"pageIndex",width:"80px"});return}ne.value.push({label:ae,prop:ae})})},ie=()=>{U.$baseExportExcel({title:"数据列表",url:vue.unref(ee),method:"get",header:vue.unref(ne)})};return(le,ae)=>{const se=vue.resolveComponent("aceHeader"),ue=vue.resolveComponent("AppList"),ce=vue.resolveComponent("AppDrawer");return vue.openBlock(),vue.createElementBlock(vue.Fragment,null,[vue.createElementVNode("div",_hoisted_1$Z,[le.ruleList.length>0?(vue.openBlock(),vue.createElementBlock(vue.Fragment,{key:0},[vue.createVNode(se,{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(le.ruleList,de=>(vue.openBlock(),vue.createElementBlock("div",{key:de.id,class:"mt-0 text-sm"},[+de.rows>0?(vue.openBlock(),vue.createElementBlock("div",_hoisted_2$O,[_hoisted_3$G,vue.createTextVNode(" "+vue.toDisplayString(de.ruleName)+" 【异常数据"+vue.toDisplayString(de.rows>99?"99+":de.rows)+"】 ",1),vue.createVNode(vue.unref(elementPlus.ElLink),{class:"ml-2",type:"primary",onClick:fe=>re(de.id)},{default:vue.withCtx(()=>[vue.createTextVNode("查看明细")]),_:2},1032,["onClick"])])):(vue.openBlock(),vue.createElementBlock("div",_hoisted_4$E,[_hoisted_5$v,vue.createTextVNode(" "+vue.toDisplayString(de.ruleName)+" 【未检测到异常数据】 ",1)]))]))),128))]),_:1})],64)):vue.createCommentVNode("",!0)]),vue.createVNode(ce,{modelValue:vue.unref(G),"onUpdate:modelValue":ae[1]||(ae[1]=de=>vue.isRef(G)?G.value=de:null),title:"数据列表"},{footer:vue.withCtx(()=>[vue.createVNode(vue.unref(elementPlus.ElButton),{type:"primary",class:"ml-3",onClick:ie},{default:vue.withCtx(()=>[vue.createTextVNode("导 出")]),_:1}),vue.createVNode(vue.unref(elementPlus.ElButton),{class:"ml-3",onClick:ae[0]||(ae[0]=de=>G.value=!1)},{default:vue.withCtx(()=>[vue.createTextVNode("关 闭")]),_:1})]),default:vue.withCtx(()=>[vue.createVNode(ue,{tableData:vue.unref(ne),url:vue.unref(ee),onSuccess:oe},null,8,["tableData","url"])]),_:1},8,["modelValue"])],64)}}}),_hoisted_1$Y={key:1,class:"animated fadeIn"},_hoisted_2$N={class:"flex items-center mt-5 mb-5 ml-2 moudle-1"},_hoisted_3$F={key:0,class:"mr-1 text-xl ri-error-warning-fill text-color-warning"},_hoisted_4$D={key:1,class:"mr-1 text-xl ri-checkbox-circle-fill text-color-success"},_hoisted_5$u={class:"ml-1"},_hoisted_6$q={class:"flex items-center select-type"},_hoisted_7$m=["onClick"],_hoisted_8$i={class:"mt-5 mb-5"},_hoisted_9$g={class:"mt-4"},_sfc_main$17=vue.defineComponent({__name:"analysis",props:{indicatorsId:{default:""}},emits:["rule-success"],setup(te,{emit:U}){const G=te;vue.watch(()=>G.indicatorsId,()=>ue());const ee=U,{proxy:ne}=vue.getCurrentInstance(),{dynamicSearchForm:re,dynamicSearchFormat:oe,dynamicSearchParams:ie}=ne.$aceDynamicSearch(),le=vue.ref(!0),ae=vue.ref([]),se=vue.ref(null),ue=async()=>{var _e,be,ye;le.value=!0,re.value=[],ve.value={type:"",value:""},ce.value=[],de.value="",ge();const me=await fetch$1(ne).detailAndTask(G.indicatorsId);se.value=me.data,(be=(_e=me.data)==null?void 0:_e.echartsDataVO)!=null&&be.config&&fe(),(ye=me==null?void 0:me.data)!=null&&ye.formConfJson&&(re.value=oe(JSON.parse(me==null?void 0:me.data.formConfJson))),le.value=!1},ce=vue.ref([]),de=vue.ref(""),fe=async()=>{var _e;ce.value=[],de.value="";const me=await fetch$1(ne).getEchartDetail({indicatorsId:G.indicatorsId});me&&(Object.keys(((_e=me.data)==null?void 0:_e.clientEchartsType)??{}).forEach(be=>{var ye;Object.values((ye=me.data)==null?void 0:ye.clientEchartsType[be]).forEach(xe=>{var Ce,$e;ce.value.push({client:be,label:(Ce=echartsTypeList[xe])==null?void 0:Ce.name,icon:($e=echartsTypeList[xe])==null?void 0:$e.icon,value:`${be}_${xe}`})})}),vue.unref(ce).length>0&&(de.value=vue.unref(ce)[0].value,pe(vue.unref(de))))},ve=vue.ref({type:"",value:""}),he=vue.ref(!1),pe=async(me,_e=!1)=>{var Ce;de.value=me,_e&&(he.value=!0);const be=ie(vue.unref(re)),ye=me.split("_"),xe=await fetch$1(ne).pullEchartsDataVO({indicatorsId:G.indicatorsId,loadType:((Ce=vue.unref(se))==null?void 0:Ce.loadType)??3,params:be,targetClient:ye[0],echartsType:ye[1]});if(xe){he.value=!1,vue.unref(ve).type=ye[1];try{vue.unref(ve).value=chartJsonFormat(xe.data.config)}catch{vue.unref(ve).value=xe.data.config}}},ge=async()=>{var _e;ae.value=[];const me=await fetch$1(ne).getRule({current:1,size:100,businessType:"indicators",businessId:G.indicatorsId});ae.value=((_e=me.data)==null?void 0:_e.records)??[],ee("rule-success",ae.value)};return ue(),(me,_e)=>{const be=vue.resolveComponent("AppResourceVisitor"),ye=vue.resolveComponent("aceHeader"),xe=vue.resolveComponent("aceDynamicSearch"),Ce=vue.resolveComponent("aceChart");return vue.unref(le)?(vue.openBlock(),vue.createBlock(vue.unref(elementPlus.ElSkeleton),{key:0,animated:""})):(vue.openBlock(),vue.createElementBlock("div",_hoisted_1$Y,[vue.createVNode(ye,{title:"指标计算"},{default:vue.withCtx(()=>[vue.createVNode(be,{businessType:"INDICATORS",businessld:G.indicatorsId},null,8,["businessld"])]),_:1}),vue.createElementVNode("div",_hoisted_2$N,[vue.unref(ae).some($e=>$e.rows>0)?(vue.openBlock(),vue.createElementBlock("i",_hoisted_3$F)):(vue.openBlock(),vue.createElementBlock("i",_hoisted_4$D)),vue.createElementVNode("span",_hoisted_5$u,vue.toDisplayString(vue.unref(se).remark),1)]),vue.createVNode(ye,{title:"指标数据"},{default:vue.withCtx(()=>[vue.createElementVNode("div",_hoisted_6$q,[(vue.openBlock(!0),vue.createElementBlock(vue.Fragment,null,vue.renderList(vue.unref(ce),$e=>(vue.openBlock(),vue.createElementBlock("span",{onClick:we=>pe($e.value,!0),class:vue.normalizeClass(["flex items-center cursor-pointer",[$e.value==vue.unref(de)?"text-color-primary":"text-gray-600"]]),key:$e.value},[vue.createElementVNode("i",{class:vue.normalizeClass([$e.icon,"mr-1"])},null,2),vue.createTextVNode(" "+vue.toDisplayString($e.label),1)],10,_hoisted_7$m))),128))])]),_:1}),vue.createElementVNode("div",_hoisted_8$i,[vue.unref(re).length>0?(vue.openBlock(),vue.createBlock(xe,{key:0,form:vue.unref(re),onSuccess:_e[0]||(_e[0]=$e=>pe(vue.unref(de),!0)),class:"mb-0"},null,8,["form"])):vue.createCommentVNode("",!0),vue.createElementVNode("div",_hoisted_9$g,[vue.createVNode(Ce,{type:vue.unref(ve).type,options:vue.unref(ve).value,loading:vue.unref(he)},null,8,["type","options","loading"])])]),vue.createVNode(_sfc_main$18,{ruleList:vue.unref(ae)},null,8,["ruleList"])]))}}}),analysis_vue_vue_type_style_index_0_scoped_c9f7a244_lang="",aceIndicatorSystemPreview=_export_sfc$2(_sfc_main$17,[["__scopeId","data-v-c9f7a244"]]),_hoisted_1$X={class:"h-full"},_sfc_main$16=vue.defineComponent({__name:"relation",setup(te){const{proxy:U}=vue.getCurrentInstance(),G=vue.ref(null),ee=vue.ref(!0),ne=["#00ADD0","#FFA12F","#B62AFF","#604BFF","#6E35FF","#002AFF","#20C0F4","#95F300","#04FDB8","#AF5AFF"],re=(oe,ie,le="#00f6ff")=>oe.map((ae,se)=>{switch(ae&&ae.title&&(ae.name=ae.title),ie==1&&(le=ne.find((ue,ce)=>ce==se%10)),(ie===0||ie===1)&&(ae.label={position:"inside"}),ie){case 0:ae.symbolSize=70;break;case 1:ae.symbolSize=50;break;default:ae.symbolSize=10;break}return ae.lineStyle={color:le},ae.children?(ae.itemStyle={borderColor:le,color:le},ae.children=re(ae.children,ie+1,le)):ae.itemStyle={color:"transparent",borderColor:le},ae});return fetch$1(U).indicatorsRelationTree().then(oe=>{if(ee.value=!1,!oe.data.length){G.value={};return}G.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:re([oe==null?void 0:oe.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}}]}}),(oe,ie)=>{const le=vue.resolveComponent("v-chart");return vue.withDirectives((vue.openBlock(),vue.createElementBlock("div",_hoisted_1$X,[vue.createVNode(le,{option:vue.unref(G),autoresize:""},null,8,["option"])])),[[vue.unref(elementPlus.vLoading),vue.unref(ee)]])}}}),_hoisted_1$W={key:0,class:"flex items-center gap-x-2.5"},_hoisted_2$M=vue.createElementVNode("div",{class:"font-bold"},"数据分析",-1),_sfc_main$15=vue.defineComponent({__name:"yoy",props:{search:{default:()=>[]},originSearch:{default:()=>[]},chartType:{default:""},option:{default:null}},setup(te,{expose:U}){const G=te,ee=screenDesignMainStore(),{proxy:ne}=vue.getCurrentInstance(),{dynamicSearchForm:re,dynamicSearchFormat:oe,dynamicSearchParams:ie}=ne.$aceDynamicSearch(),le=["yySingle","yymmSingle","yymmddSingle"],{seriesItem:ae}=useLineCommon(),se=vue.computed(()=>G.search.find(ve=>le.includes(ve.type))),ue=vue.computed(()=>{const ve=vue.unref(se)?Object.values(ie([vue.unref(se)])).every(he=>he==""):!1;return G.search.filter(he=>le.includes(he.type)).length==1&&!ve}),ce=vue.ref("");vue.watch(ce,()=>de());const de=async()=>{var Se;if(!vue.unref(ue)||vue.unref(ce)=="")return;const ve=JSON.parse(JSON.stringify((Se=ee.getChartData)==null?void 0:Se.params)),he=JSON.parse(JSON.stringify(G.search)),pe=he.find(ke=>le.includes(ke.type)),ge=G.originSearch.find(ke=>le.includes(ke.type));console.log(G.originSearch);const _e=JSON.parse((ve==null?void 0:ve.groupArgsJson)??"[]").find(ke=>ke.comment==G.option.dataShow.x);ve.groupArgsJson=JSON.stringify([_e]);const be=_e.dateFormatType;switch(pe.type){case"yymmSingle":pe.value=dayjs(pe.value).subtract(1,vue.unref(ce)=="TB"?"year":"month").format("YYYY-MM");break;case"yymmddSingle":pe.value=dayjs(pe.value).subtract(1,vue.unref(ce)=="TB"?"year":"day").format("YYYY-MM-DD");break;case"yySingle":pe.value=dayjs(pe.value).subtract(1,"year").format("YYYY");break}ve.params=ie(he);const xe=G.option.dataset.dimensions;xe.length>=3&&G.option.dataset.dimensions.pop();const Ce=await ne.$baseHttp.post("/api/ace-data-center/model-indicators/debug",ve),$e=xe[0],we=G.option.dataShow.y.filter(ke=>!G.option.dataShow.hide.includes(ke));vue.unref(pe.type).includes("Range")?(G.option.dataset.dimensions[1]=`${ge!=null&&ge.minValue?`${ge==null?void 0:ge.minValue}~`:""}${(ge==null?void 0:ge.maxValue)??""}${we}`,G.option.dataset.dimensions.push(`${pe.minValue?`${pe.minValue}~`:""}${(pe==null?void 0:pe.maxValue)??""}${we}`)):(G.option.dataset.dimensions[1]=`${ge==null?void 0:ge.value}${we}`,G.option.dataset.dimensions[2]=`${pe.value}${we}`,G.option.dataset.dimensions[3]="增长率");const Ee=G.option.series[0];G.option.series=[],Ce.data.records.forEach(ke=>{fe(ke,$e,be)});const Ve=JSON.parse(JSON.stringify(G.option.dataset.temp_source));Ve.forEach((ke,Ne)=>{fe(ke,$e,be);let Ie=null;ke[G.option.dataset.dimensions[1]]=ke[we],be?(Ie=Ce.data.records.find(De=>De[$e]==ke[$e]),Ie||(["year"].includes(be)&&(Ie=Ce.data.records.find(De=>De[$e].indexOf(pe.value)>=0),ke[$e]=$e),["day","month"].includes(be)&&(Ie=Ce.data.records.find(De=>De[$e].split("-").at(-1)==ke[$e].split("-").at(-1))))):Ie=Ce.data.records.find(De=>De[$e]==ke[$e]),Ie||(Ie={[we]:0}),Ie&&(ke[G.option.dataset.dimensions[2]]=Ie[we]);const Pe=ke[G.option.dataset.dimensions[1]]??0,Te=ke[G.option.dataset.dimensions[2]]??0;ke.增长率=!Pe||!Te?0:((Pe-Te)/Te*100).toFixed(2)}),G.option.dataset.source=Ve,setTimeout(()=>{const{yAxis:ke,xAxis:Ne}=G.option;let Ie="yAxis";!Array.isArray(ke)&&ke.type!="value"&&(Ie="xAxis"),G.option.series=[Ee,{...Ee,itemStyle:{...(Ee==null?void 0:Ee.itemStyle)??{},color:null}},{...ae,name:"增长率",[`${Ie}Index`]:1}],console.log(G.option.series,Ee),G.option[Ie]=[Array.isArray(G.option[Ie])?G.option[Ie][0]:G.option[Ie],{type:"value",name:"增长率",nameGap:20,splitLine:!1,nameLocation:Ie=="xAxis"?"start":"end"}]})},fe=(ve,he,pe)=>{if(!(!pe||(ve[he]??"")=="")&&["day"].includes(pe)){const ge=ve[he].split("-").filter((me,_e)=>_e==0?"":me);ve[he]=ge.join("-")}};return U({init:de,type:ce}),(ve,he)=>vue.unref(ue)&&ve.option?(vue.openBlock(),vue.createElementBlock("div",_hoisted_1$W,[_hoisted_2$M,vue.createElementVNode("div",null,[vue.createVNode(vue.unref(elementPlus.ElRadioGroup),{modelValue:vue.unref(ce),"onUpdate:modelValue":he[0]||(he[0]=pe=>vue.isRef(ce)?ce.value=pe:null)},{default:vue.withCtx(()=>{var pe;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((pe=vue.unref(se))==null?void 0:pe.type)},{default:vue.withCtx(()=>[vue.createTextVNode(" 环比 ")]),_:1},8,["disabled"])]}),_:1},8,["modelValue"])])])):vue.createCommentVNode("",!0)}}),_withScopeId$k=te=>(vue.pushScopeId("data-v-54d5c5dd"),te=te(),vue.popScopeId(),te),_hoisted_1$V={key:2,class:"flex flex-col chart-preview"},_hoisted_2$L={class:"flex mb-2.5"},_hoisted_3$E={key:0,class:"flex-1"},_hoisted_4$C={class:"flex items-center gap-x-2.5"},_hoisted_5$t=_withScopeId$k(()=>vue.createElementVNode("div",{class:"font-bold"},"计算指标",-1)),_hoisted_6$p={key:0,class:"flex items-center gap-x-2.5"},_hoisted_7$l=_withScopeId$k(()=>vue.createElementVNode("div",{class:"font-bold"},"分组维度",-1)),_hoisted_8$h={class:"flex flex-col flex-1 overflow-hidden"},_hoisted_9$f={class:"relative flex-1"},_hoisted_10$e={class:"flex justify-center change-btns"},_sfc_main$14=vue.defineComponent({__name:"IndicatorsView",props:{dynamicSearchForm:{default:()=>[]},result:{default:()=>{}},chartData:{default:null}},emits:["search-success"],setup(te,{emit:U}){const G=te,ee=U,ne=screenDesignMainStore(),{proxy:re}=vue.getCurrentInstance(),{dynamicSearchForm:oe,dynamicSearchFormat:ie,dynamicSearchParams:le}=re.$aceDynamicSearch(),ae=vue.ref(null),se=vue.ref(""),ue=vue.ref([]),ce=vue.ref(G.dynamicSearchForm),de=vue.ref(!1),{option:fe,formatChart:ve,chartType:he,setChartData:pe,changeChartSeries:ge,chartDataParams:me}=useCustomChart(),_e={day:"按日",week:"按周",month:"按月",quarter:"按季度",year:"按年","":"按时分秒"};vue.onMounted(async()=>{await re.$baseHttp.post(`/api/ace-data-center/model-indicators-echarts/getEchartsTypes/${G.result.id}`).then(we=>{ue.value=we.data,we.data.length&&(se.value=we.data[0].code,he.value=we.data[0].type)})}),vue.watch(se,async()=>{Ce()});const be=we=>{se.value!=we.code&&(fe.value={},he.value=we.type,se.value=we.code,vue.unref(ae)&&(vue.unref(ae).type=""))},ye=vue.ref(""),xe=vue.ref(""),Ce=async()=>{var we,Ee,Ve,Se,ke,Ne,Ie;ce.value=JSON.parse(JSON.stringify(G.dynamicSearchForm)),de.value=!0,fe.value={},ye.value="",xe.value=["2"].includes(vue.unref(he))?"":[],G.chartData&&(me.value=G.chartData),await ve(vue.unref(se)),ye.value=(Ee=(we=vue.unref(fe))==null?void 0:we.dataShow)==null?void 0:Ee.x,Array.isArray((Se=(Ve=vue.unref(fe))==null?void 0:Ve.dataShow)==null?void 0:Se.y)?xe.value=(ke=vue.unref(fe))==null?void 0:ke.dataShow.y.filter(Pe=>{var Te;return!(((Te=vue.unref(fe))==null?void 0:Te.dataShow.hide)??[]).includes(Pe)}):xe.value=(Ie=(Ne=vue.unref(fe))==null?void 0:Ne.dataShow)==null?void 0:Ie.y,isMobile&&["1","3","5"].includes(vue.unref(he))&&!vue.unref(fe).dataZoom&&(fe.value.grid.bottom="10%",fe.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(()=>{de.value=!1},10)};vue.watch([ye,xe],async([we,Ee],[Ve,Se])=>{var ke;vue.unref(de)||(vue.unref(fe).dataShow.x=we,vue.unref(fe).dataShow.y=Ee,Array.isArray(Ee)&&(vue.unref(fe).dataShow.hide=(ke=vue.unref(fe))==null?void 0:ke.dataShow.y.filter(Ne=>ne.getChartData.y.includes(Ne.showLabel))),(we!=Ve||["2","7"].includes(vue.unref(he)))&&(fe.value.dataset.source=await pe(vue.unref(he),we,["2","7"].includes(vue.unref(he))?Ee:null),fe.value.dataset.temp_source=JSON.parse(JSON.stringify(fe.value.dataset.source)),ce.value=JSON.parse(JSON.stringify(G.dynamicSearchForm)),vue.unref(ae)&&(vue.unref(ae).type="")),["xAxis","yAxis"].forEach(Ne=>{Array.isArray(fe.value[Ne])&&(fe.value[Ne]=fe.value[Ne].filter(Ie=>Ie.name!="增长率"))}),ge())},{deep:!0});const $e=()=>{ne.getChartData.params.params=le(G.dynamicSearchForm),Ce(),ee("search-success",ne.getChartData.params.params)};return(we,Ee)=>{var Ne;const Ve=vue.resolveComponent("aceDynamicSearch"),Se=vue.resolveComponent("AppEmpty"),ke=vue.resolveComponent("aceCustomChart");return vue.openBlock(),vue.createElementBlock("div",null,[G.dynamicSearchForm.length?(vue.openBlock(),vue.createBlock(Ve,{key:0,form:G.dynamicSearchForm,onSuccess:$e},null,8,["form"])):vue.createCommentVNode("",!0),vue.unref(ue).length?(vue.openBlock(),vue.createElementBlock("div",_hoisted_1$V,[vue.createElementVNode("div",_hoisted_2$L,[["9"].includes(vue.unref(he))?vue.createCommentVNode("",!0):(vue.openBlock(),vue.createElementBlock("div",_hoisted_3$E,[vue.createVNode(vue.unref(elementPlus.ElSkeleton),{loading:!((Ne=vue.unref(fe))!=null&&Ne.dataShow),animated:""},{default:vue.withCtx(()=>[vue.createElementVNode("div",_hoisted_4$C,[_hoisted_5$t,vue.createElementVNode("div",null,[["2"].includes(vue.unref(he))?(vue.openBlock(),vue.createBlock(vue.unref(elementPlus.ElRadioGroup),{key:0,modelValue:vue.unref(xe),"onUpdate:modelValue":Ee[0]||(Ee[0]=Ie=>vue.isRef(xe)?xe.value=Ie:null)},{default:vue.withCtx(()=>{var Ie;return[(vue.openBlock(!0),vue.createElementBlock(vue.Fragment,null,vue.renderList((((Ie=vue.unref(ne).getChartData)==null?void 0:Ie.y)??[]).filter(Pe=>Pe.aggType!="other"),Pe=>(vue.openBlock(),vue.createBlock(vue.unref(elementPlus.ElRadio),{key:Pe.showLabel,label:Pe.showLabel,value:Pe.showLabel},null,8,["label","value"]))),128))]}),_:1},8,["modelValue"])):["8"].includes(vue.unref(he))?(vue.openBlock(),vue.createBlock(vue.unref(elementPlus.ElCheckboxGroup),{key:1,modelValue:vue.unref(xe),"onUpdate:modelValue":Ee[1]||(Ee[1]=Ie=>vue.isRef(xe)?xe.value=Ie:null)},{default:vue.withCtx(()=>{var Ie,Pe;return[(vue.openBlock(!0),vue.createElementBlock(vue.Fragment,null,vue.renderList([...((Ie=vue.unref(ne).getChartData)==null?void 0:Ie.y)??[],...(((Pe=vue.unref(ne).getChartData)==null?void 0:Pe.x)??[]).map(Te=>({...Te,showLabel:Te.comment}))],Te=>(vue.openBlock(),vue.createBlock(vue.unref(elementPlus.ElCheckbox),{key:Te.showLabel,label:Te.showLabel,value:Te.showLabel},null,8,["label","value"]))),128))]}),_:1},8,["modelValue"])):(vue.openBlock(),vue.createBlock(vue.unref(elementPlus.ElCheckboxGroup),{key:2,modelValue:vue.unref(xe),"onUpdate:modelValue":Ee[2]||(Ee[2]=Ie=>vue.isRef(xe)?xe.value=Ie:null)},{default:vue.withCtx(()=>{var Ie;return[(vue.openBlock(!0),vue.createElementBlock(vue.Fragment,null,vue.renderList((((Ie=vue.unref(ne).getChartData)==null?void 0:Ie.y)??[]).filter(Pe=>Pe.aggType!="other"),Pe=>(vue.openBlock(),vue.createBlock(vue.unref(elementPlus.ElCheckbox),{key:Pe.showLabel,label:Pe.showLabel,value:Pe.showLabel},null,8,["label","value"]))),128))]}),_:1},8,["modelValue"]))])]),["8"].includes(vue.unref(he))?vue.createCommentVNode("",!0):(vue.openBlock(),vue.createElementBlock("div",_hoisted_6$p,[_hoisted_7$l,vue.createElementVNode("div",null,[vue.createVNode(vue.unref(elementPlus.ElRadioGroup),{modelValue:vue.unref(ye),"onUpdate:modelValue":Ee[3]||(Ee[3]=Ie=>vue.isRef(ye)?ye.value=Ie:null)},{default:vue.withCtx(()=>[(vue.openBlock(!0),vue.createElementBlock(vue.Fragment,null,vue.renderList(vue.unref(ne).getChartData.x,Ie=>(vue.openBlock(),vue.createBlock(vue.unref(elementPlus.ElRadio),{key:Ie.comment,label:Ie.comment,value:Ie.comment},{default:vue.withCtx(()=>[vue.createTextVNode(vue.toDisplayString(Ie.comment)+" ",1),_e[Ie.dateFormatType]?(vue.openBlock(),vue.createElementBlock(vue.Fragment,{key:0},[vue.createTextVNode(" ("+vue.toDisplayString(_e[Ie.dateFormatType])+") ",1)],64)):vue.createCommentVNode("",!0)]),_:2},1032,["label","value"]))),128))]),_:1},8,["modelValue"])])])),["3","1"].includes(vue.unref(he))&&vue.unref(fe).dataShow.y.filter(Ie=>!vue.unref(fe).dataShow.hide.includes(Ie)).length==1?(vue.openBlock(),vue.createBlock(_sfc_main$15,{key:1,ref_key:"yoyRef",ref:ae,option:vue.unref(fe),search:vue.unref(ce),originSearch:G.dynamicSearchForm,chartType:vue.unref(he)},null,8,["option","search","originSearch","chartType"])):vue.createCommentVNode("",!0)]),_:1},8,["loading"])]))]),vue.createElementVNode("div",_hoisted_8$h,[vue.createElementVNode("div",_hoisted_9$f,[vue.createVNode(vue.unref(elementPlus.ElSkeleton),{loading:vue.unref(de),animated:""},{default:vue.withCtx(()=>[vue.createVNode(ke,{option:vue.unref(fe),chartType:vue.unref(he)},null,8,["option","chartType"])]),_:1},8,["loading"])]),vue.createElementVNode("div",_hoisted_10$e,[vue.createVNode(vue.unref(elementPlus.ElButtonGroup),null,{default:vue.withCtx(()=>[(vue.openBlock(!0),vue.createElementBlock(vue.Fragment,null,vue.renderList(vue.unref(ue),Ie=>(vue.openBlock(),vue.createBlock(vue.unref(elementPlus.ElButton),{type:vue.unref(se)==Ie.code?"primary":"",key:Ie.type,onClick:Pe=>be(Ie)},{default:vue.withCtx(()=>{var Pe;return[vue.createElementVNode("i",{class:vue.normalizeClass((Pe=vue.unref(echartsTypeList)[Ie.type])==null?void 0:Pe.icon)},null,2)]}),_:2},1032,["type","onClick"]))),128))]),_:1})])])])):(vue.openBlock(),vue.createBlock(Se,{key:1,description:"暂无数据"}))])}}}),IndicatorsView_vue_vue_type_style_index_0_scoped_54d5c5dd_lang="",IndicatorsView=_export_sfc$2(_sfc_main$14,[["__scopeId","data-v-54d5c5dd"]]),_hoisted_1$U=["hidden"],_hoisted_2$K={class:"flex items-center w-full mb-4"},_hoisted_3$D={class:"flex justify-end flex-1"},_hoisted_4$B={class:"mb-4"},_hoisted_5$s={class:"flex mb-5 moudle-1"},_hoisted_6$o={class:"flex-1"},_hoisted_7$k={class:"flex items-center mt-2"},_hoisted_8$g={key:0,class:"mr-1 text-xl ri-error-warning-fill text-color-warning"},_hoisted_9$e={key:1,class:"mr-1 text-xl ri-checkbox-circle-fill text-color-success"},_hoisted_10$d={class:"ml-1"},_hoisted_11$b=vue.createElementVNode("div",{class:"w-10"},null,-1),_hoisted_12$a={class:"flex-1"},_hoisted_13$8={class:"items-center mt-2"},_hoisted_14$7=vue.createElementVNode("i",{class:"mr-1 text-xl ri-database-2-fill text-color-primary"},null,-1),_hoisted_15$4={key:1,class:"w-full"},_sfc_main$13=vue.defineComponent({__name:"modelIndicators",props:{indicatorsId:{default:""},modelIndicatorsRules:{default:()=>[]}},emits:["click-design","rule-success"],setup(te,{expose:U,emit:G}){const ee=te,ne=G;vue.watch(()=>ee.indicatorsId,()=>be());const{proxy:re}=vue.getCurrentInstance(),oe=screenDesignMainStore(),{dynamicSearchForm:ie,dynamicSearchFormat:le,dynamicSearchParams:ae}=re.$aceDynamicSearch(),se=vue.ref(!0),ue=vue.ref("basic"),ce=vue.ref(!1),de=vue.ref(!1),fe=vue.ref([]),ve=vue.ref({}),he=vue.ref(null),pe=vue.ref([]),ge=vue.ref([]),me=vue.ref({}),_e=({column:De})=>{vue.unref(me)[De.property]&&(De.order=vue.unref(me)[De.property])},be=async()=>{se.value=!0,ue.value="basic",oe.setChartData({}),we();const De=await re.$baseHttp.get(`/api/ace-data-center/model-indicators/detail?id=${ee.indicatorsId}`);he.value=De.data,se.value=!1,me.value=JSON.parse(De.data.sortArgsJson??"{}"),ie.value=le(JSON.parse(De.data.formConfJson??"[]")),Ce()},ye=vue.ref(!1),xe=vue.ref(!1),Ce=async(De="")=>{var Le,Re,Fe,je,Me,ze,Ge,We,Ue;De!="sort"&&(ge.value=[],ye.value=!0),xe.value=!0;const Oe=Object.keys(vue.unref(me)).map(qe=>({field:qe,type:vue.unref(me)[qe]=="ascending"?"asc":"desc"})),Be={aggArgsJson:(Le=vue.unref(he))==null?void 0:Le.aggArgsJson,groupArgsJson:(Re=vue.unref(he))==null?void 0:Re.groupArgsJson,sortArgsJson:JSON.stringify(Oe),params:vue.unref(Ne)??ae(le(JSON.parse(((Fe=vue.unref(he))==null?void 0:Fe.formConfJson)??"[]"))),modelIndicatorsId:(je=vue.unref(he))==null?void 0:je.id,pageSize:(Me=vue.unref(he))==null?void 0:Me.pageSize,modelId:(ze=vue.unref(he))==null?void 0:ze.modelId},Ae=await re.$baseHttp.post("/api/ace-data-center/model-indicators/debug",Be);Ae&&(pe.value=((Ge=Ae.data)==null?void 0:Ge.records)??[],ye.value=!1,xe.value=!1,ve.value={x:JSON.parse((We=vue.unref(he))==null?void 0:We.groupArgsJson),y:JSON.parse((Ue=vue.unref(he))==null?void 0:Ue.aggArgsJson),params:Be},oe.setChartData(ve.value),vue.unref(pe).length&&De!="sort"&&(Object.keys(vue.unref(pe)[0]).forEach(qe=>{ge.value.push({label:qe,prop:qe,sortable:"custom"})}),ge.value.push({label:"操作",prop:"button",width:"120px",fixed:"right",slot:!0})))},$e=De=>{const{prop:Oe,order:Be}=De;!Be||vue.unref(me)[Oe]===Be?delete vue.unref(me)[Oe]:vue.unref(me)[Oe]=Be,Ce("sort")},we=async()=>{var Oe;fe.value=[];const De=await fetch$1(re).getRule({current:1,size:100,businessType:"indicators",businessId:ee.indicatorsId});fe.value=((Oe=De.data)==null?void 0:Oe.records)??[],ne("rule-success",fe.value)},Ee=vue.ref(null),Ve=De=>{Ee.value=De,ce.value=!0},Se=De=>(De.modelIndicatorsId=vue.unref(he).id,De.row=vue.unref(Ee),De),ke=()=>{de.value=!0},Ne=vue.ref(null),Ie=De=>{Ne.value=De,Ce()};vue.watch(ce,De=>Te(De)),vue.watch(de,De=>Te(De));const Pe=vue.ref(!1),Te=De=>{self!=top&&(Pe.value=De,window.parent.postMessage(De?"model-indicators-open":"model-indicators-close","*"))};return be(),U({init:be,result:he}),(De,Oe)=>{const Be=vue.resolveComponent("AppResourceVisitor"),Ae=vue.resolveComponent("aceHeader"),Le=vue.resolveComponent("AppTable"),Re=vue.resolveComponent("AppEmpty"),Fe=vue.resolveComponent("aceDynamicList"),je=vue.resolveComponent("AppDrawer");return vue.unref(se)?(vue.openBlock(),vue.createBlock(vue.unref(elementPlus.ElSkeleton),{key:0,animated:""})):(vue.openBlock(),vue.createElementBlock("div",{key:1,class:"animated fadeIn",hidden:vue.unref(Pe)},[vue.createElementVNode("div",_hoisted_2$K,[vue.createElementVNode("div",null,[vue.createVNode(vue.unref(elementPlus.ElButtonGroup),null,{default:vue.withCtx(()=>[vue.createVNode(vue.unref(elementPlus.ElButton),{onClick:Oe[0]||(Oe[0]=Me=>ue.value="basic"),type:vue.unref(ue)=="basic"?"primary":""},{default:vue.withCtx(()=>[vue.createTextVNode(" 指标图表 ")]),_:1},8,["type"]),vue.createVNode(vue.unref(elementPlus.ElButton),{onClick:Oe[1]||(Oe[1]=Me=>ue.value="data"),type:vue.unref(ue)=="data"?"primary":""},{default:vue.withCtx(()=>[vue.createTextVNode(" 指标数据 ")]),_:1},8,["type"])]),_:1})]),vue.createElementVNode("div",_hoisted_3$D,[vue.createVNode(Be,{businessType:"MODEL_INDICATORS",businessld:ee.indicatorsId},null,8,["businessld"])])]),vue.withDirectives(vue.createElementVNode("div",null,[vue.createElementVNode("div",_hoisted_4$B,[vue.createVNode(vue.unref(elementPlus.ElSkeleton),{loading:vue.unref(xe),animated:""},{default:vue.withCtx(()=>[vue.createVNode(IndicatorsView,{dynamicSearchForm:vue.unref(ie),result:vue.unref(he),chartData:vue.unref(ve),onSearchSuccess:Ie},null,8,["dynamicSearchForm","result","chartData"])]),_:1},8,["loading"])])],512),[[vue.vShow,vue.unref(ue)=="basic"]]),vue.withDirectives(vue.createElementVNode("div",null,[vue.createElementVNode("div",_hoisted_5$s,[vue.createElementVNode("div",_hoisted_6$o,[vue.createVNode(Ae,{title:"指标计算"}),vue.createElementVNode("div",_hoisted_7$k,[vue.unref(fe).some(Me=>Me.rows>0)?(vue.openBlock(),vue.createElementBlock("i",_hoisted_8$g)):(vue.openBlock(),vue.createElementBlock("i",_hoisted_9$e)),vue.createElementVNode("span",_hoisted_10$d,vue.toDisplayString(vue.unref(he).remark),1)])]),_hoisted_11$b,vue.createElementVNode("div",_hoisted_12$a,[vue.createVNode(Ae,{title:"数据来源"}),vue.createElementVNode("div",_hoisted_13$8,[_hoisted_14$7,vue.createTextVNode(" 重构仓模型数据 | "+vue.toDisplayString(vue.unref(he).modelName)+"【 ",1),vue.createElementVNode("span",{class:"cursor-pointer text-color-primary",onClick:ke},vue.toDisplayString(vue.unref(he).modelCode),1),vue.createTextVNode(" 】 ")])])]),vue.createVNode(vue.unref(elementPlus.ElSkeleton),{loading:vue.unref(ye),animated:""},{default:vue.withCtx(()=>[vue.unref(ge).length?(vue.openBlock(),vue.createBlock(Le,{key:0,maxHeight:"400px",tableData:vue.unref(ge),list:vue.unref(pe),loading:!1,headerCellClassName:_e,onSortChange:$e},{button:vue.withCtx(({row:Me})=>[vue.createVNode(vue.unref(elementPlus.ElLink),{type:"primary",onClick:ze=>Ve(Me)},{default:vue.withCtx(()=>[vue.createTextVNode("查看明细")]),_:2},1032,["onClick"])]),_:1},8,["tableData","list"])):(vue.openBlock(),vue.createElementBlock("div",_hoisted_15$4,[vue.createVNode(Re,{description:"暂无数据",class:"mt-4"})]))]),_:1},8,["loading"])],512),[[vue.vShow,vue.unref(ue)=="data"]]),vue.createVNode(_sfc_main$18,{ruleList:vue.unref(fe)},null,8,["ruleList"]),vue.createVNode(je,{modelValue:vue.unref(ce),"onUpdate:modelValue":Oe[2]||(Oe[2]=Me=>vue.isRef(ce)?ce.value=Me:null),title:"查看明细",size:"90%"},{default:vue.withCtx(()=>[vue.createVNode(Ae,{title:"统计:",class:"mb-2"}),vue.createVNode(Le,{height:null,tableData:Object.keys(vue.unref(Ee)).map(Me=>({label:Me,prop:Me})),list:[vue.unref(Ee)],loading:!1},null,8,["tableData","list"]),vue.createVNode(Ae,{title:"钻取明细:",class:"mt-4 mb-2"}),vue.createVNode(Fe,{id:vue.unref(he).modelId,keyName:"modelIndicatorsId",title:vue.unref(he).modelName,isDownLoad:vue.unref(isMobile),url:"/api/ace-data-center/model-indicators/drilling",formatParamsFunc:Se},null,8,["id","title","isDownLoad"])]),_:1},8,["modelValue"]),vue.createVNode(je,{modelValue:vue.unref(de),"onUpdate:modelValue":Oe[3]||(Oe[3]=Me=>vue.isRef(de)?de.value=Me:null),title:"模型数据",size:"90%"},{default:vue.withCtx(()=>[vue.createVNode(Fe,{id:vue.unref(he).modelId,title:vue.unref(he).modelName},null,8,["id","title"])]),_:1},8,["modelValue"])],8,_hoisted_1$U))}}}),_hoisted_1$T=vue.createElementVNode("i",{class:"ri-search-line"},null,-1),_hoisted_2$J={class:"mt-3"},_hoisted_3$C={key:1,class:"mr-1 -ml-5 text-base ri-edit-circle-fill text-color-primary"},_sfc_main$12=vue.defineComponent({__name:"modelMenu",props:{type:{default:""}},emits:["node-click","change-type"],setup(te,{expose:U,emit:G}){const ee=te,{proxy:ne}=vue.getCurrentInstance(),re=vue.ref(""),oe=vue.ref(null),ie=G;vue.watch(re,he=>{vue.unref(oe).filter(he)});const le=(he,pe)=>he?pe.modelName.includes(he):!0,ae=vue.ref([]),se=vue.ref([]),ue=vue.ref([]),ce=vue.ref(!0),de=vue.computed(()=>ee.type=="ODS"?vue.unref(ae):ee.type=="DWD"?vue.unref(se):vue.unref(ue)),fe=()=>{Promise.all([fetch$1(ne).loadModelMenu({modelLayer:"ODS"}),fetch$1(ne).loadModelMenu({modelLayer:"DWD"}),fetch$1(ne).loadModelMenu({modelLayer:"ODSVIEW"})]).then(he=>{const pe=he[0].data,ge=he[1].data,me=he[2].data;ae.value=Object.keys(pe).map(_e=>({modelName:_e,id:_e,children:pe[_e]})),se.value=Object.keys(ge).map(_e=>({modelName:_e,id:_e,children:ge[_e]})),ue.value=Object.keys(me).map(_e=>({modelName:_e,id:_e,children:me[_e]})),ce.value=!1})};fe();const ve=he=>{if(he.modelCode){if(ee.type=="ODS"){ie("node-click",he);return}Array.isArray(he.children)||ie("node-click",he)}};return U({init:fe}),(he,pe)=>{const ge=vue.resolveComponent("AppEmpty");return vue.openBlock(),vue.createElementBlock(vue.Fragment,null,[vue.createVNode(vue.unref(elementPlus.ElInput),{placeholder:"请输入内容",clearable:"",modelValue:vue.unref(re),"onUpdate:modelValue":pe[0]||(pe[0]=me=>vue.isRef(re)?re.value=me:null)},{prefix:vue.withCtx(()=>[_hoisted_1$T]),_:1},8,["modelValue"]),vue.createElementVNode("div",_hoisted_2$J,[vue.unref(ce)?(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:oe,data:vue.unref(de),"default-expand-all":"","node-key":"id","highlight-current":"","filter-node-method":le,onNodeClick:ve},{default:vue.withCtx(({node:me,data:_e})=>[me.level!=1||he.type=="ODS"?(vue.openBlock(),vue.createElementBlock(vue.Fragment,{key:0},[_e.modelCode&&_e.openForm!=2?(vue.openBlock(),vue.createElementBlock("i",{key:0,class:vue.normalizeClass(["mr-1 -ml-5 text-base ri-checkbox-circle-fill",[_e.publishStatus==2?"text-color-success":"text-color-info"]])},null,2)):vue.createCommentVNode("",!0)],64)):vue.createCommentVNode("",!0),_e.openForm==2?(vue.openBlock(),vue.createElementBlock("i",_hoisted_3$C)):vue.createCommentVNode("",!0),vue.createElementVNode("span",{class:vue.normalizeClass({"font-bold":me.level==1})},vue.toDisplayString(_e.modelName),3),vue.renderSlot(he.$slots,"default",{element:_e})]),empty:vue.withCtx(()=>[vue.createVNode(ge,{description:"暂无数据"})]),_:3},8,["data"]))])],64)}}}),_hoisted_1$S={class:"mb-3"},_hoisted_2$I={style:{height:"calc(100vh - 100px)"},class:"overflow-y-auto"},_sfc_main$11=vue.defineComponent({__name:"modelIndicatorsAdd",emits:["click-node"],setup(te,{expose:U,emit:G}){const ee=G,{proxy:ne}=vue.getCurrentInstance(),re=vue.ref(!1),oe=vue.ref(),ie=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(ne).getCurrFunc("MODEL").then(ue=>{vue.unref(ie).forEach(ce=>{ce.disabled=!ue.data.includes(ce.rule),!vue.unref(oe)&&!ce.disabled&&(oe.value=ce.value)})});const le=ue=>{oe.value=ue},ae=()=>{re.value=!0},se=ue=>{ee("click-node",ue),re.value=!1};return U({init:ae}),(ue,ce)=>{const de=vue.resolveComponent("AppDrawer");return vue.openBlock(),vue.createBlock(de,{modelValue:vue.unref(re),"onUpdate:modelValue":ce[0]||(ce[0]=fe=>vue.isRef(re)?re.value=fe:null),title:"选择要分析的数据",size:"400px"},{default:vue.withCtx(()=>[vue.createElementVNode("div",_hoisted_1$S,[vue.createVNode(vue.unref(elementPlus.ElButtonGroup),null,{default:vue.withCtx(()=>[(vue.openBlock(!0),vue.createElementBlock(vue.Fragment,null,vue.renderList(vue.unref(ie),fe=>(vue.openBlock(),vue.createBlock(vue.unref(elementPlus.ElButton),{type:vue.unref(oe)==fe.value?"primary":"",key:fe.value,disabled:fe.disabled,onClick:ve=>le(fe.value)},{default:vue.withCtx(()=>[vue.createTextVNode(vue.toDisplayString(fe.label),1)]),_:2},1032,["type","disabled","onClick"]))),128))]),_:1})]),vue.createElementVNode("div",_hoisted_2$I,[vue.createVNode(_sfc_main$12,{ref:"menuRef",type:vue.unref(oe),onNodeClick:se},null,8,["type"])])]),_:1},8,["modelValue"])}}}),_hoisted_1$R=vue.createElementVNode("div",{class:"flex justify-end flex-1"},null,-1),_hoisted_2$H={class:"whitespace-nowrap ml-2.5"},_hoisted_3$B=vue.createElementVNode("i",{class:"mr-1 ri-add-circle-line"},null,-1),_hoisted_4$A=["onClick"],_hoisted_5$r=vue.createElementVNode("i",{class:"ri-edit-box-line"},null,-1),_hoisted_6$n={key:0,class:"flex items-center justify-center h-full"},_sfc_main$10=vue.defineComponent({__name:"index",props:{isCustom:{type:Boolean,default:!1},element:{default:null},tempId:{default:""}},emits:["close-design"],setup(te,{emit:U}){var me,_e;const G=te,ee=U,{proxy:ne}=vue.getCurrentInstance();vue.inject("local");const re=vue.ref(null),oe=vue.ref(null),ie=vue.ref(null),le=vue.ref(null),ae=vue.ref(G.element??{});vue.provide("modelEle",ae),vue.provide("getListModelIndicators",()=>{});const se=vue.ref([{label:"指标分析",value:"zbfx"},{label:"指标全景",value:"zbqj",disabled:!0}]),ue=vue.ref(vue.unref(se)[0].value),ce=vue.ref(((me=G==null?void 0:G.element)==null?void 0:me.id)??"");fetch$1(ne).getCurrFunc("INDICATORS").then(be=>{vue.unref(se).find(ye=>ye.value=="zbqj").disabled=!be.data.includes("INDICATORS_VIEW")});const de=vue.ref([]);fetch$1(ne).getCurrFunc("MODEL_INDICATORS").then(be=>{de.value=be.data});const fe=vue.ref(((_e=G==null?void 0:G.element)==null?void 0:_e.businessType)??""),ve=be=>{ce.value="",fe.value=be.type,setTimeout(()=>{ce.value=be.id},100)},he=be=>{ae.value=be,vue.unref(re).init()},pe=be=>{vue.nextTick(()=>{setTimeout(()=>{var ye,xe,Ce;ae.value={id:(ye=vue.unref(ie).result)==null?void 0:ye.modelId,modelName:(xe=vue.unref(ie).result)==null?void 0:xe.modelName,modelCode:(Ce=vue.unref(ie).result)==null?void 0:Ce.modelCode},vue.unref(re).init(be)},300)})},ge=()=>{vue.unref(ce)&&(ee("close-design",vue.unref(ce)),vue.unref(ie)&&vue.unref(ie).init()),vue.unref(oe)&&vue.unref(oe).init()};return(be,ye)=>{const xe=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(()=>[be.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(se),Ce=>(vue.openBlock(),vue.createBlock(vue.unref(elementPlus.ElButton),{type:vue.unref(ue)==Ce.value?"primary":"",key:Ce.value,disabled:Ce.disabled,onClick:$e=>ue.value=Ce.value},{default:vue.withCtx(()=>[vue.createTextVNode(vue.toDisplayString(Ce.label),1)]),_:2},1032,["type","disabled","onClick"]))),128))]),_:1})),_hoisted_1$R]),_:1}),vue.withDirectives(vue.createVNode(vue.unref(elementPlus.ElContainer),{class:"overflow-hidden"},{default:vue.withCtx(()=>[be.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$19,{onNodeClick:ve,tempId:be.tempId||vue.unref(ce),ref_key:"menuRef",ref:oe},{search:vue.withCtx(()=>[vue.createElementVNode("div",_hoisted_2$H,[vue.unref(de).includes("STATISTICAL_ANALYSIS")?(vue.openBlock(),vue.createBlock(vue.unref(elementPlus.ElButton),{key:0,type:"primary",onClick:ye[0]||(ye[0]=Ce=>vue.unref(le).init())},{default:vue.withCtx(()=>[_hoisted_3$B,vue.createTextVNode(" 新增指标 ")]),_:1})):vue.createCommentVNode("",!0)])]),"menu-item":vue.withCtx(({data:Ce})=>[vue.unref(de).includes("RELATED_INDICATORS")&&Ce.type!="INDICATORS"?(vue.openBlock(),vue.createElementBlock("div",{key:0,class:"ml-4 mr-2 cursor-pointer text-color-warning",onClick:$e=>pe(Ce.id)},[_hoisted_5$r,vue.createTextVNode(" 编辑 ")],8,_hoisted_4$A)):vue.createCommentVNode("",!0)]),_:1},8,["tempId"])]),_:1})),vue.createVNode(vue.unref(elementPlus.ElMain),null,{default:vue.withCtx(()=>[vue.unref(ce)?(vue.openBlock(),vue.createElementBlock(vue.Fragment,{key:1},[vue.unref(fe)=="INDICATORS"?(vue.openBlock(),vue.createBlock(aceIndicatorSystemPreview,{key:0,indicatorsId:vue.unref(ce)},null,8,["indicatorsId"])):vue.createCommentVNode("",!0),vue.unref(fe)=="MODEL_INDICATORS"?(vue.openBlock(),vue.createBlock(_sfc_main$13,{key:1,onClickDesign:pe,modelIndicatorsRules:vue.unref(de),indicatorsId:vue.unref(ce),ref_key:"modelIndicatorsRef",ref:ie},null,8,["modelIndicatorsRules","indicatorsId"])):vue.createCommentVNode("",!0)],64)):(vue.openBlock(),vue.createElementBlock("div",_hoisted_6$n,[vue.createVNode(xe,{description:"请选择对应指标"})]))]),_:1})]),_:1},512),[[vue.vShow,vue.unref(ue)=="zbfx"]]),vue.unref(ue)=="zbqj"?(vue.openBlock(),vue.createBlock(vue.unref(elementPlus.ElMain),{key:0},{default:vue.withCtx(()=>[vue.createVNode(_sfc_main$16)]),_:1})):vue.createCommentVNode("",!0),vue.createVNode(aceIndicatorDesign,{ref_key:"designRef",ref:re,onClose:ge},null,512),vue.createVNode(_sfc_main$11,{ref_key:"modelIndicatorsAddRef",ref:le,onClickNode:he},null,512)]),_:1})}}}),_withScopeId$j=te=>(vue.pushScopeId("data-v-e52b7096"),te=te(),vue.popScopeId(),te),_hoisted_1$Q={class:"flex flex-col h-full"},_hoisted_2$G=_withScopeId$j(()=>vue.createElementVNode("i",{class:"mr-1 ri-add-circle-line"},null,-1)),_hoisted_3$A={class:"flex-1 mt-3 overflow-y-auto card-container"},_hoisted_4$z={key:0,class:"flex items-center justify-center h-full"},_hoisted_5$q=["onClick"],_hoisted_6$m={class:"flex items-center"},_hoisted_7$j=_withScopeId$j(()=>vue.createElementVNode("i",{class:"mr-1 ri-database-line"},null,-1)),_hoisted_8$f={class:"font-bold"},_hoisted_9$d={class:"flex items-center justify-between w-4/5 mt-3 ml-auto mr-auto"},_hoisted_10$c={class:"flex items-center"},_hoisted_11$a=_withScopeId$j(()=>vue.createElementVNode("i",{class:"mr-1 ri-checkbox-circle-fill text-color-success"},null,-1)),_hoisted_12$9=_withScopeId$j(()=>vue.createElementVNode("div",{class:"text-color-info"},"|",-1)),_hoisted_13$7={class:"flex justify-end mt-3 text-xs text-color-info pb"},_hoisted_14$6={class:"w-4/5 overflow-hidden whitespace-nowrap text-ellipsis"},_sfc_main$$=vue.defineComponent({__name:"menu",emits:["node-click"],setup(te,{expose:U,emit:G}){const{proxy:ee}=vue.getCurrentInstance(),{dataSourceSubmit:ne,testConnect:re,loadDataSourceMenu:oe}=fetch$1(ee).dbImport,{setFormValue:ie,getFormValue:le}=ee.$globalHooks.useForm(),{openMessage:ae}=ee.$globalHooks.useMessage(),se=ee.$globalDict,ue=G,ce=vue.ref([]),de=vue.ref(!0),fe=()=>{ce.value=[],de.value=!0,oe().then(xe=>{de.value=!1,ce.value=xe.data??[],xe.data.length&&vue.unref(be)==""&&ye(xe.data[0])})};fe();const ve=vue.reactive([{name:"数据源名称",type:FieldType.Text,fieldName:"name",value:"",required:!0},{name:"数据源类型",type:FieldType.Select,fieldName:"dataSourceType",value:"",dict:"storeType",required:!0,changeFunc:xe=>{if(!xe.value)return;let Ce=se.dataSourceUrlDemo.find($e=>$e.label.toLowerCase()===xe.value.toLowerCase());ve.find($e=>$e.fieldName==="dataSourceUrlDemo").value=(Ce==null?void 0:Ce.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}]),he=vue.ref(!1),pe=()=>{ie({},ve),he.value=!0},ge=xe=>{ve.find(Ce=>Ce.fieldName==="dataSourceUrl").value=xe.value},me=async()=>{const{params:xe,error:Ce}=le(ve);Ce.length>0||!await ne(xe)||(he.value=!1,ae({type:"success",message:"操作成功"}),fe())},_e=async()=>{const{params:xe,error:Ce}=le(ve);Ce.length>0||!await re(xe)||ae({type:"success",message:"数据库链接成功"})},be=vue.ref(""),ye=xe=>{vue.unref(be)!=xe.dataSourceId&&(be.value=xe.dataSourceId,ue("node-click",xe))};return U({initMenu:fe}),(xe,Ce)=>{const $e=vue.resolveComponent("aceHeader"),we=vue.resolveComponent("AppEmpty"),Ee=vue.resolveComponent("AppForm"),Ve=vue.resolveComponent("AppDialog");return vue.openBlock(),vue.createElementBlock("div",_hoisted_1$Q,[vue.createVNode($e,{title:"数据源"},{default:vue.withCtx(()=>[vue.createVNode(vue.unref(elementPlus.ElButton),{type:"primary",size:"small",onClick:pe},{default:vue.withCtx(()=>[_hoisted_2$G,vue.createTextVNode(" 新增 ")]),_:1})]),_:1}),vue.createElementVNode("div",_hoisted_3$A,[vue.createVNode(vue.unref(elementPlus.ElSkeleton),{loading:vue.unref(de),animated:""},{default:vue.withCtx(()=>[vue.unref(ce).length?(vue.openBlock(!0),vue.createElementBlock(vue.Fragment,{key:1},vue.renderList(vue.unref(ce),Se=>(vue.openBlock(),vue.createElementBlock("div",{key:Se.id,class:vue.normalizeClass(["item",{active:vue.unref(be)==Se.dataSourceId}]),onClick:ke=>ye(Se)},[vue.createElementVNode("div",_hoisted_6$m,[_hoisted_7$j,vue.createElementVNode("span",_hoisted_8$f,vue.toDisplayString(Se.dataSourceComment),1)]),vue.createElementVNode("div",_hoisted_9$d,[vue.createElementVNode("div",_hoisted_10$c,[_hoisted_11$a,vue.createTextVNode(" 已同步 "),vue.createElementVNode("strong",null,vue.toDisplayString(Se.synchronizedTableCount),1)]),_hoisted_12$9,vue.createElementVNode("div",null,[vue.createTextVNode(" 总表数 "),vue.createElementVNode("strong",null,vue.toDisplayString(Se.tableCount),1)])]),vue.createElementVNode("div",_hoisted_13$7,vue.toDisplayString(Se.version),1)],10,_hoisted_5$q))),128)):(vue.openBlock(),vue.createElementBlock("div",_hoisted_4$z,[vue.createVNode(we,{description:"暂无数据源"})]))]),_:1},8,["loading"])]),vue.createVNode(Ve,{modelValue:vue.unref(he),"onUpdate:modelValue":Ce[1]||(Ce[1]=Se=>vue.isRef(he)?he.value=Se:null),title:"新增接入数据源",size:700},{footer:vue.withCtx(()=>[vue.createVNode(vue.unref(elementPlus.ElButton),{style:{"margin-right":"auto"},type:"success",onClick:_e},{default:vue.withCtx(()=>[vue.createTextVNode(" 测试链接 ")]),_:1}),vue.createVNode(vue.unref(elementPlus.ElButton),{class:"ml-3",type:"primary",onClick:me},{default:vue.withCtx(()=>[vue.createTextVNode("保存")]),_:1}),vue.createVNode(vue.unref(elementPlus.ElButton),{class:"ml-3",onClick:Ce[0]||(Ce[0]=Se=>he.value=!1)},{default:vue.withCtx(()=>[vue.createTextVNode("取消")]),_:1})]),default:vue.withCtx(()=>[vue.createVNode(Ee,{form:vue.unref(ve),col:1,labelWidth:120},{dataSourceUrlDemo:vue.withCtx(({element:Se})=>[vue.createVNode(vue.unref(elementPlus.ElTooltip),{content:Se.value},{default:vue.withCtx(()=>[vue.createElementVNode("div",_hoisted_14$6,vue.toDisplayString(Se.value),1)]),_:2},1032,["content"]),vue.createVNode(vue.unref(elementPlus.ElButton),{type:"primary",onClick:ke=>ge(Se)},{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$$,[["__scopeId","data-v-e52b7096"]]),_sfc_main$_=vue.defineComponent({__name:"sourceTableData",setup(te,{expose:U}){const G=vue.ref(!1),ee=vue.ref(null),ne=vue.ref(""),re=vue.ref([]),oe=se=>{re.value=[],(se==null?void 0:se.data.length)>0&&(re.value=Object.keys(se.data[0]).filter(ue=>ue!="pageIndex").map(ue=>({label:ue,prop:ue})))},ie=vue.ref({}),le=se=>Object.assign(se,vue.unref(ie));return U({init:(se,ue)=>{vue.unref(ie).dataSourceId=se,vue.unref(ie).sourceTableCode=ue,G.value=!0,ne.value="/api/ace-data-center/data-source/sourceDataPage"}}),(se,ue)=>{const ce=vue.resolveComponent("AppList"),de=vue.resolveComponent("AppDrawer");return vue.openBlock(),vue.createBlock(de,{modelValue:vue.unref(G),"onUpdate:modelValue":ue[0]||(ue[0]=fe=>vue.isRef(G)?G.value=fe:null),title:"数据源明细",size:"90%"},{default:vue.withCtx(()=>[vue.createVNode(ce,{tableData:vue.unref(re),url:vue.unref(ne),ref_key:"appList",ref:ee,formatParamsFunc:le,onSuccess:oe,methods:"post"},null,8,["tableData","url"])]),_:1},8,["modelValue"])}}}),_hoisted_1$P={class:"mt-2"},_sfc_main$Z=vue.defineComponent({__name:"setting",emits:["refresh"],setup(te,{expose:U,emit:G}){const{proxy:ee}=vue.getCurrentInstance(),{setFormValue:ne,getFormValue:re}=ee.$globalHooks.useForm(),{openMessage:oe}=ee.$globalHooks.useMessage(),{submitDefaultDbExtract:ie}=fetch$1(ee).dbImport,le=G,ae=vue.ref(!1),se=vue.ref(!1),ue=vue.ref(null),ce=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:pe=>{ce.find(ge=>ge.fieldName=="incrementalField").hide=pe.value!=2}},{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}]),de=vue.ref(null),fe=vue.ref({}),ve=async pe=>{fe.value=pe,se.value=!1;const ge=await ee.$baseHttp.get("/api/ace-data-center/model-attribute/allModelAttribute",{params:{modelId:pe.modelId,projectId:ee.$baseGetCurrentProjectId()},headers:{loading:!0}});ce.find(me=>me.fieldName=="incrementalField").options=ge.data.map(me=>({...me,label:`${me.attributeCode}(${me.attributeComment||me.attributeCode})`,value:me.attributeCode})),ae.value=!0,vue.nextTick(()=>{ne({...pe,extractName:pe.extractName??"增量抽取"},ce),pe!=null&&pe.taskDefined&&(se.value=!0),vue.unref(ue).init((pe==null?void 0:pe.taskDefined)??{}),de.value=(pe==null?void 0:pe.taskDefined)??null})},he=async()=>{const{params:pe,error:ge}=re(ce);if(ge.length>0)return;if(vue.unref(se)){const{params:_e,error:be}=vue.unref(ue).getForm();if(be.length>0)return;pe.taskDefined={...vue.unref(de)??{},..._e}}pe.dataSourceId=vue.unref(fe).dataSourceId,pe.modelId=vue.unref(fe).modelId,pe.streamType="STANDARD",await ie(pe)&&(oe({type:"success",message:"操作成功"}),ae.value=!1,le("refresh"))};return U({init:ve}),(pe,ge)=>{const me=vue.resolveComponent("AppForm"),_e=vue.resolveComponent("aceHeader"),be=vue.resolveComponent("AppTaskDesign"),ye=vue.resolveComponent("AppDialog");return vue.openBlock(),vue.createBlock(ye,{modelValue:vue.unref(ae),"onUpdate:modelValue":ge[2]||(ge[2]=xe=>vue.isRef(ae)?ae.value=xe:null),title:"配置",size:500},{footer:vue.withCtx(()=>[vue.createVNode(vue.unref(elementPlus.ElButton),{class:"ml-3",type:"primary",onClick:he},{default:vue.withCtx(()=>[vue.createTextVNode("保存")]),_:1}),vue.createVNode(vue.unref(elementPlus.ElButton),{class:"ml-3",onClick:ge[1]||(ge[1]=xe=>ae.value=!1)},{default:vue.withCtx(()=>[vue.createTextVNode("取消")]),_:1})]),default:vue.withCtx(()=>[vue.createVNode(me,{form:vue.unref(ce)},null,8,["form"]),vue.createElementVNode("div",_hoisted_1$P,[vue.createVNode(_e,{title:"作业配置",class:"mb-2"},{left:vue.withCtx(()=>[vue.createVNode(vue.unref(elementPlus.ElCheckbox),{class:"ml-2",modelValue:vue.unref(se),"onUpdate:modelValue":ge[0]||(ge[0]=xe=>vue.isRef(se)?se.value=xe:null)},{default:vue.withCtx(()=>[vue.createTextVNode("作业配置")]),_:1},8,["modelValue"])]),_:1}),vue.withDirectives(vue.createElementVNode("div",null,[vue.createVNode(be,{ref_key:"taskDesignRef",ref:ue},null,512)],512),[[vue.vShow,vue.unref(se)]])])]),_:1},8,["modelValue"])}}}),_hoisted_1$O=vue.createElementVNode("i",{class:"mr-2 ri-exchange-line"},null,-1),_hoisted_2$F=vue.createElementVNode("i",{class:"mr-2 ri-refresh-line"},null,-1),_hoisted_3$z=vue.createElementVNode("div",null,null,-1),_hoisted_4$y=vue.createElementVNode("i",{class:"mr-2 ri-delete-bin-line"},null,-1),_sfc_main$Y=vue.defineComponent({__name:"model-extract-log",emits:["success"],setup(te,{expose:U,emit:G}){const{proxy:ee}=vue.getCurrentInstance(),{openMessage:ne}=ee.$globalHooks.useMessage(),re=G,oe=vue.ref(!1),ie=vue.ref(null),le=vue.ref(""),ae=vue.ref([]),se=ce=>{const{businessId:de,businessType:fe="file_extract",ajaxUrl:ve="",table:he}=ce;ae.value=he||[{label:"批次号",prop:"batchNo"},{label:"日期",prop:"createTime"},{label:"文件名",prop:"file",slot:!0},{label:"抽取方式",prop:"createTime",func:pe=>{var ge;return((ge=JSON.parse(pe.businessSnapshot||"{}"))==null?void 0:ge.extractType)==2?"覆盖":"追加"}},{label:"数据总数",prop:"totalNum"},{label:"成功数",prop:"successNum"},{label:"失败数",prop:"failNum"},{label:"协同参数",prop:"collaborateValue"},{label:"操作",prop:"action",slot:!0,fixed:"right"}],le.value=ve||`/api/ace-data-center/extract-log/list?descs=create_time&businessId=${de}&businessType=${fe}`,oe.value=!0},ue=async(ce,de)=>{switch(ce){case"refresh":{if(!await ee.$baseHttp.post(`/api/ace-data-center/extract-log/updateSuccessTotal/${de.id}`,{},{headers:{loading:!0}}))return;ne({type:"success",message:"操作成功"}),vue.unref(ie).getData(),re("success")}break;case"delete":ee.$baseConfirm({content:"删除数据可能影响指标统计,是否确认删除?",callConfirm:async()=>{await ee.$baseHttp.post(`/api/ace-data-center/extract-log/deleteModelData/${de.id}`,{},{headers:{loading:!0}})&&(ne({type:"success",message:"操作成功"}),vue.unref(ie).getData(),re("success"))}});break;case"run":ee.$baseConfirm({content:"重跑数据会先删除本批次数据,然后新建立一个批次任务执行,是否继续执行?",callConfirm:async()=>{await ee.$baseHttp.post(`/api/ace-data-center/extract-log/reRunTeamworkDbExtractBy/${de.id}`,{},{headers:{loading:!0}})&&(ne({type:"success",message:"操作成功"}),vue.unref(ie).getData(),re("success"))}});break;case"download":{const fe=JSON.parse((de==null?void 0:de.businessSnapshot)??"{}");window.open(fe.fileUrl)}break}};return U({init:se}),(ce,de)=>{const fe=vue.resolveComponent("AppList"),ve=vue.resolveComponent("AppDrawer");return vue.openBlock(),vue.createBlock(ve,{modelValue:vue.unref(oe),"onUpdate:modelValue":de[0]||(de[0]=he=>vue.isRef(oe)?oe.value=he:null),title:"抽取日志",size:"90%"},{default:vue.withCtx(()=>[vue.createVNode(fe,{tableData:vue.unref(ae),url:vue.unref(le),ref_key:"appList",ref:ie},{file:vue.withCtx(({row:he})=>[vue.createVNode(vue.unref(elementPlus.ElLink),{type:"primary",onClick:pe=>ue("download",he)},{default:vue.withCtx(()=>{var pe;return[vue.createTextVNode(vue.toDisplayString((pe=JSON.parse(he.businessSnapshot??"{}"))==null?void 0:pe.fileName),1)]}),_:2},1032,["onClick"])]),action:vue.withCtx(({row:he})=>{var pe;return[((pe=JSON.parse(he.businessSnapshot||"{}"))==null?void 0:pe.extractType)==3?(vue.openBlock(),vue.createBlock(vue.unref(elementPlus.ElLink),{key:0,type:"primary",class:"mr-2",onClick:ge=>ue("run",he)},{default:vue.withCtx(()=>[_hoisted_1$O,vue.createTextVNode(" 重跑 ")]),_:2},1032,["onClick"])):vue.createCommentVNode("",!0),vue.createVNode(vue.unref(elementPlus.ElLink),{type:"primary",onClick:ge=>ue("refresh",he)},{default:vue.withCtx(()=>[_hoisted_2$F,vue.createTextVNode(" 刷新 ")]),_:2},1032,["onClick"]),_hoisted_3$z,vue.createVNode(vue.unref(elementPlus.ElLink),{type:"danger",onClick:ge=>ue("delete",he)},{default:vue.withCtx(()=>[_hoisted_4$y,vue.createTextVNode(" 删除本批次数据 ")]),_:2},1032,["onClick"])]}),_:1},8,["tableData","url"])]),_:1},8,["modelValue"])}}}),_hoisted_1$N={class:"flex flex-col h-full overflow-hidden"},_hoisted_2$E={class:"flex flex-col flex-1 mt-3 overflow-hidden"},_hoisted_3$y={class:"app-search"},_hoisted_4$x=vue.createElementVNode("i",{class:"mr-1 ri-search-line"},null,-1),_hoisted_5$p={class:"flex flex-1 overflow-hidden"},_hoisted_6$l={class:"flex justify-end mt-3"},_hoisted_7$i={class:"flex justify-end mb-2"},_hoisted_8$e=vue.createElementVNode("i",{class:"mr-1 ri-add-line"},null,-1),_sfc_main$X=vue.defineComponent({__name:"view",emits:["refresh"],setup(te,{expose:U,emit:G}){const{proxy:ee}=vue.getCurrentInstance(),ne=vue.inject("modelEle"),{setFormValue:re,getFormValue:oe}=ee.$globalHooks.useForm(),{openMessage:ie}=ee.$globalHooks.useMessage(),{createModelSyncRelation:le,listDataSourceSynchronized:ae}=fetch$1(ee).dbImport,se=vue.ref(null),ue=vue.ref(null),ce=vue.ref(null),de=vue.ref(null),fe=G,{originlist:ve,list:he,pageLoading:pe,page:ge,pageSize:me,getData:_e,handleSizeChange:be,handleCurrentChange:ye}=ee.$globalHooks.usePage(),xe=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}]}]),Ce=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:Pe=>Pe==2?"success":"danger",func:Pe=>{var Te,De;return((Te=Pe.modelSyncDetail)==null?void 0:Te.synchronizeResult)=="2"?"正常":((De=Pe.modelSyncDetail)==null?void 0:De.synchronizeResult)=="1"?"异常":"-"}},{label:"目标表",prop:"relationTableCode"},{label:"目标数据",prop:"relationTableDataCount"},{label:"主键",prop:"primaryKeyColumn",func:Pe=>{var Te;return((Te=Pe==null?void 0:Pe.modelSyncDetail)==null?void 0:Te.primaryKeyColumn)??"-"}},{label:"增量字段",prop:"incrColumn",func:Pe=>{var Te;return((Te=Pe==null?void 0:Pe.modelSyncDetail)==null?void 0:Te.incrColumn)??"-"}},{label:"上次同步",prop:"lastSyncTime",func:Pe=>{var Te;return((Te=Pe==null?void 0:Pe.modelSyncDetail)==null?void 0:Te.lastSyncTime)??"-"}},{label:"操作",prop:"htmlButton",fixed:"right",width:"120px"}]),$e=async(Pe=!0)=>{Pe&&(re({},xe),ge.value=1),pe.value=!0;const{params:Te}=oe(xe,!1,!0),De=await ae({dataSourceId:vue.unref(ne).dataSourceId,...Te});if(pe.value=!1,!De){ve.value=[];return}De.data.forEach(Oe=>{var Be;(Be=Oe==null?void 0:Oe.modelSyncDetail)!=null&&Be.modelId&&(Oe.htmlButton=[{name:"配置",key:"setting",type:"primary"},{name:"历史",key:"history",type:"primary"}])}),ve.value=De.data,_e()},we=async Pe=>{await le({sourceId:Pe.dataSourceId,sourceTableCode:Pe.sourceTableCode})&&(ie({type:"success",message:"操作成功"}),fe("refresh"),$e(!1))},Ee=vue.ref(!1),Ve=vue.ref(""),Se=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"}]),ke=Pe=>{Pe.data.forEach(Te=>{Te.htmlButton=[],Te.htmlButton.push({name:"编辑",key:"EDIT",type:"primary",icon:"ri-edit-line"}),Te.htmlButton.push({name:"抽取记录",key:"LOG",type:"primary",icon:"ri-file-line"}),[1,2].includes(Te.extractType)&&Te.htmlButton.push({name:"抽取",key:"PUSH",type:"primary",icon:"ri-pushpin-line"}),Te.htmlButton.push({name:"删除",key:"DEL",type:"danger",icon:"ri-delete-bin-6-line"})})},Ne=vue.ref({}),Ie=async Pe=>{var Be;const{type:Te,row:De,index:Oe}=Pe;switch(Te){case"history":vue.unref(ce).init({ajaxUrl:`/api/ace-data-center/extract-log/modelSyncHistory?descs=create_time&modelId=${De.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(ce).init({businessId:De.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":ee.$baseConfirm({content:"是否抽取?",callConfirm:async()=>{await ee.$baseHttp.post(`/api/ace-data-center/db-extract/extract/${De.id}`,{},{headers:{loading:!0}})&&ie({type:"success",message:"操作成功"})}});break;case"DEL":ee.$baseConfirm({content:"是否删除?",callConfirm:async()=>{await ee.$baseHttp.post(`/api/ace-data-center/db-extract/removeById/${De.id}`,{},{headers:{loading:!0}})&&(ie({type:"success",message:"操作成功"}),vue.unref(se).getData())}});break;case"EDIT":const Ae=await ee.$baseHttp.get(`/api/ace-data-center/db-extract/detailAndTask?dbExtractId=${De.id}`);if(!Ae)return;vue.unref(ue).init(Ae.data);break;case"ADD":vue.unref(ue).init({dataSourceId:vue.unref(Ne).dataSourceId,modelId:(Be=vue.unref(Ne))==null?void 0:Be.modelSyncDetail.modelId});break;case"setting":Ee.value=!0,Ne.value=De,Ve.value=`/api/ace-data-center/db-extract/list?modelId=${De.modelSyncDetail.modelId}&projectId=${ee.$baseGetCurrentProjectId()}`;break;case"source-table-data":vue.unref(de).init(De.dataSourceId,De.sourceTableCode);break}};return U({init:$e}),(Pe,Te)=>{const De=vue.resolveComponent("aceHeader"),Oe=vue.resolveComponent("AppForm"),Be=vue.resolveComponent("AppTable"),Ae=vue.resolveComponent("AppList"),Le=vue.resolveComponent("AppDrawer");return vue.openBlock(),vue.createElementBlock("div",_hoisted_1$N,[vue.createVNode(De,{title:vue.unref(ne).dataSourceComment},null,8,["title"]),vue.createElementVNode("div",_hoisted_2$E,[vue.createElementVNode("div",_hoisted_3$y,[vue.createVNode(Oe,{form:vue.unref(xe)},{default:vue.withCtx(()=>[vue.createVNode(vue.unref(elementPlus.ElButton),{type:"primary",class:"ml-1",onClick:Te[0]||(Te[0]=Re=>$e(!1))},{default:vue.withCtx(()=>[_hoisted_4$x,vue.createTextVNode(" 查询 ")]),_:1})]),_:1},8,["form"])]),vue.createElementVNode("div",_hoisted_5$p,[vue.createVNode(Be,{tableData:vue.unref(Ce),list:vue.unref(he),loading:vue.unref(pe),onTableBtnClick:Ie},{related:vue.withCtx(({row:Re})=>[Re.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:Fe=>we(Re)},{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:Re})=>[Re.sourceTableDataCount==0?(vue.openBlock(),vue.createElementBlock(vue.Fragment,{key:0},[vue.createTextVNode(vue.toDisplayString(Re.sourceTableDataCount),1)],64)):(vue.openBlock(),vue.createBlock(vue.unref(elementPlus.ElLink),{key:1,type:"primary",onClick:Fe=>Ie({type:"source-table-data",row:Re,index:-1})},{default:vue.withCtx(()=>[vue.createTextVNode(vue.toDisplayString(Re.sourceTableDataCount),1)]),_:2},1032,["onClick"]))]),_:1},8,["tableData","list","loading"])]),vue.createElementVNode("div",_hoisted_6$l,[vue.createVNode(vue.unref(elementPlus.ElPagination),{"current-page":vue.unref(ge),"onUpdate:currentPage":Te[1]||(Te[1]=Re=>vue.isRef(ge)?ge.value=Re:null),"page-size":vue.unref(me),"onUpdate:pageSize":Te[2]||(Te[2]=Re=>vue.isRef(me)?me.value=Re:null),"page-sizes":[10,20,40,60,80,100],background:!0,layout:"total, sizes, prev, pager, next, jumper",total:vue.unref(ve).length,onCurrentChange:vue.unref(ye),onSizeChange:vue.unref(be)},null,8,["current-page","page-size","total","onCurrentChange","onSizeChange"])])]),vue.createVNode(Le,{modelValue:vue.unref(Ee),"onUpdate:modelValue":Te[4]||(Te[4]=Re=>vue.isRef(Ee)?Ee.value=Re:null),title:"数据同步方案",size:"1000px"},{default:vue.withCtx(()=>[vue.createElementVNode("div",_hoisted_7$i,[vue.createVNode(vue.unref(elementPlus.ElButton),{type:"primary",onClick:Te[3]||(Te[3]=Re=>Ie({type:"ADD",row:{},index:0}))},{default:vue.withCtx(()=>[_hoisted_8$e,vue.createTextVNode(" 新增 ")]),_:1})]),vue.createVNode(Ae,{tableData:vue.unref(Se),url:vue.unref(Ve),ref_key:"appListRef",ref:se,onBtnClick:Ie,onSuccess:ke},null,8,["tableData","url"])]),_:1},8,["modelValue"]),vue.createVNode(_sfc_main$Z,{ref_key:"settingRef",ref:ue,onRefresh:Te[5]||(Te[5]=Re=>vue.unref(se).getData({clear:!0}))},null,512),vue.createVNode(_sfc_main$Y,{ref_key:"extractLogRef",ref:ce},null,512),vue.createVNode(_sfc_main$_,{ref_key:"sourceTableDataRef",ref:de},null,512)])}}}),_hoisted_1$M={key:0,class:"flex items-center justify-center h-full"},_sfc_main$W=vue.defineComponent({__name:"index",setup(te){const U=vue.ref(null),G=vue.ref(null),ee=vue.ref({});vue.provide("modelEle",ee);const ne=vue.inject("local"),re=oe=>{ee.value=oe,vue.nextTick(()=>{vue.unref(U).init()})};return(oe,ie)=>{const le=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(ne)},{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:G,onNodeClick:re},null,512)]),_:1}),vue.createVNode(vue.unref(elementPlus.ElMain),null,{default:vue.withCtx(()=>[vue.unref(ee).dataSourceId?(vue.openBlock(),vue.createBlock(_sfc_main$X,{key:1,ref_key:"viewRef",ref:U,onRefresh:ie[0]||(ie[0]=ae=>vue.unref(G).initMenu())},null,512)):(vue.openBlock(),vue.createElementBlock("div",_hoisted_1$M,[vue.createVNode(le,{description:"请选择数据源"})]))]),_:1})]),_:1},8,["locale"])]),_:1})}}}),_withScopeId$i=te=>(vue.pushScopeId("data-v-cabcba66"),te=te(),vue.popScopeId(),te),_hoisted_1$L={class:"flex flex-col h-full"},_hoisted_2$D=_withScopeId$i(()=>vue.createElementVNode("i",{class:"mr-1 ri-add-circle-line"},null,-1)),_hoisted_3$x={class:"flex-1 mt-3 overflow-y-auto card-container"},_hoisted_4$w={key:0,class:"flex items-center justify-center h-full"},_hoisted_5$o=["onClick"],_hoisted_6$k={class:"flex items-center justify-between"},_hoisted_7$h={class:"flex-1 mr-2.5"},_hoisted_8$d=_withScopeId$i(()=>vue.createElementVNode("i",{class:"mr-1 ri-database-line"},null,-1)),_hoisted_9$c={class:"font-bold"},_hoisted_10$b=_withScopeId$i(()=>vue.createElementVNode("i",{class:"mr-1 ri-edit-circle-line"},null,-1)),_hoisted_11$9={class:"flex items-center justify-between w-4/5 mt-3 ml-auto mr-auto"},_hoisted_12$8={class:"flex items-center"},_hoisted_13$6=_withScopeId$i(()=>vue.createElementVNode("i",{class:"mr-1 ri-checkbox-circle-fill text-color-success"},null,-1)),_hoisted_14$5=_withScopeId$i(()=>vue.createElementVNode("div",{class:"text-color-info"},"|",-1)),_hoisted_15$3={class:"flex justify-end mt-3 text-xs text-color-info pb"},_hoisted_16$3={class:"w-4/5 overflow-hidden whitespace-nowrap text-ellipsis"},_sfc_main$V=vue.defineComponent({__name:"menu",emits:["node-click"],setup(te,{expose:U,emit:G}){const{proxy:ee}=vue.getCurrentInstance(),{dataSourceSubmit:ne,testConnect:re,loadDataSourceMenu:oe,detail:ie}=fetch$1(ee).dbImport,{setFormValue:le,getFormValue:ae}=ee.$globalHooks.useForm(),{openMessage:se}=ee.$globalHooks.useMessage(),ue=ee.$globalDict,ce=G,de=vue.ref([]),fe=vue.ref(!0),ve=()=>{de.value=[],fe.value=!0,oe().then($e=>{fe.value=!1,de.value=$e.data??[],$e.data.length&&vue.unref(xe)==""&&Ce($e.data[0])})};ve();const he=vue.reactive([{name:"数据源名称",type:FieldType.Text,fieldName:"name",value:"",required:!0},{name:"数据源类型",type:FieldType.Select,fieldName:"dataSourceType",value:"",dict:"storeType",required:!0,changeFunc:$e=>{if(!$e.value)return;let we=ue.dataSourceUrlDemo.find(Ee=>Ee.label.toLowerCase()===$e.value.toLowerCase());he.find(Ee=>Ee.fieldName==="dataSourceUrlDemo").value=(we==null?void 0:we.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}]),pe=vue.ref(!1),ge=()=>{le({},he),pe.value=!0},me=async $e=>{const we=await ie({id:$e.dataSourceId});le(we.data,he),pe.value=!0},_e=$e=>{he.find(we=>we.fieldName==="dataSourceUrl").value=$e.value},be=async()=>{const{params:$e,error:we}=ae(he);we.length>0||($e.id||delete $e.id,!await ne($e))||(pe.value=!1,se({type:"success",message:"操作成功"}),ve())},ye=async()=>{const{params:$e,error:we}=ae(he);we.length>0||!await re($e)||se({type:"success",message:"数据库链接成功"})},xe=vue.ref(""),Ce=$e=>{vue.unref(xe)!=$e.dataSourceId&&(xe.value=$e.dataSourceId,ce("node-click",$e))};return U({initMenu:ve}),($e,we)=>{const Ee=vue.resolveComponent("aceHeader"),Ve=vue.resolveComponent("AppEmpty"),Se=vue.resolveComponent("AppForm"),ke=vue.resolveComponent("AppDialog");return vue.openBlock(),vue.createElementBlock("div",_hoisted_1$L,[vue.createVNode(Ee,{title:"数据源"},{default:vue.withCtx(()=>[vue.createVNode(vue.unref(elementPlus.ElButton),{type:"primary",size:"small",onClick:ge},{default:vue.withCtx(()=>[_hoisted_2$D,vue.createTextVNode(" 新增 ")]),_:1})]),_:1}),vue.createElementVNode("div",_hoisted_3$x,[vue.createVNode(vue.unref(elementPlus.ElSkeleton),{loading:vue.unref(fe),animated:""},{default:vue.withCtx(()=>[vue.unref(de).length?(vue.openBlock(!0),vue.createElementBlock(vue.Fragment,{key:1},vue.renderList(vue.unref(de),Ne=>(vue.openBlock(),vue.createElementBlock("div",{key:Ne.id,class:vue.normalizeClass(["item",{active:vue.unref(xe)==Ne.dataSourceId}]),onClick:Ie=>Ce(Ne)},[vue.createElementVNode("div",_hoisted_6$k,[vue.createElementVNode("div",_hoisted_7$h,[_hoisted_8$d,vue.createElementVNode("span",_hoisted_9$c,vue.toDisplayString(Ne.dataSourceComment),1)]),vue.createVNode(vue.unref(elementPlus.ElLink),{type:"primary",onClick:vue.withModifiers(Ie=>me(Ne),["stop"])},{default:vue.withCtx(()=>[_hoisted_10$b,vue.createTextVNode(" 修改 ")]),_:2},1032,["onClick"])]),vue.createElementVNode("div",_hoisted_11$9,[vue.createElementVNode("div",_hoisted_12$8,[_hoisted_13$6,vue.createTextVNode(" 已同步 "),vue.createElementVNode("strong",null,vue.toDisplayString(Ne.synchronizedShadowTableCount),1)]),_hoisted_14$5,vue.createElementVNode("div",null,[vue.createTextVNode(" 总表数 "),vue.createElementVNode("strong",null,vue.toDisplayString(Ne.tableCount),1)])]),vue.createElementVNode("div",_hoisted_15$3,vue.toDisplayString(Ne.version),1)],10,_hoisted_5$o))),128)):(vue.openBlock(),vue.createElementBlock("div",_hoisted_4$w,[vue.createVNode(Ve,{description:"暂无数据源"})]))]),_:1},8,["loading"])]),vue.createVNode(ke,{modelValue:vue.unref(pe),"onUpdate:modelValue":we[1]||(we[1]=Ne=>vue.isRef(pe)?pe.value=Ne:null),title:"新增接入数据源",size:700},{footer:vue.withCtx(()=>[vue.createVNode(vue.unref(elementPlus.ElButton),{style:{"margin-right":"auto"},type:"success",onClick:ye},{default:vue.withCtx(()=>[vue.createTextVNode(" 测试链接 ")]),_:1}),vue.createVNode(vue.unref(elementPlus.ElButton),{class:"ml-3",type:"primary",onClick:be},{default:vue.withCtx(()=>[vue.createTextVNode("保存")]),_:1}),vue.createVNode(vue.unref(elementPlus.ElButton),{class:"ml-3",onClick:we[0]||(we[0]=Ne=>pe.value=!1)},{default:vue.withCtx(()=>[vue.createTextVNode("取消")]),_:1})]),default:vue.withCtx(()=>[vue.createVNode(Se,{form:vue.unref(he),col:1,labelWidth:120},{dataSourceUrlDemo:vue.withCtx(({element:Ne})=>[vue.createVNode(vue.unref(elementPlus.ElTooltip),{content:Ne.value},{default:vue.withCtx(()=>[vue.createElementVNode("div",_hoisted_16$3,vue.toDisplayString(Ne.value),1)]),_:2},1032,["content"]),vue.createVNode(vue.unref(elementPlus.ElButton),{type:"primary",onClick:Ie=>_e(Ne)},{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$V,[["__scopeId","data-v-cabcba66"]]),_sfc_main$U=vue.defineComponent({__name:"sourceTableData",setup(te,{expose:U}){const G=vue.ref(!1),ee=vue.ref(null),ne=vue.ref(""),re=vue.ref([]),oe=se=>{re.value=[],(se==null?void 0:se.data.length)>0&&(re.value=Object.keys(se.data[0]).filter(ue=>ue!="pageIndex").map(ue=>({label:ue,prop:ue})))},ie=vue.ref({}),le=se=>Object.assign(se,vue.unref(ie));return U({init:(se,ue)=>{vue.unref(ie).dataSourceId=se,vue.unref(ie).sourceTableCode=ue,G.value=!0,ne.value="/api/ace-data-center/data-source/sourceDataPage"}}),(se,ue)=>{const ce=vue.resolveComponent("AppList"),de=vue.resolveComponent("AppDrawer");return vue.openBlock(),vue.createBlock(de,{modelValue:vue.unref(G),"onUpdate:modelValue":ue[0]||(ue[0]=fe=>vue.isRef(G)?G.value=fe:null),title:"数据源明细",size:"90%"},{default:vue.withCtx(()=>[vue.createVNode(ce,{tableData:vue.unref(re),url:vue.unref(ne),ref_key:"appList",ref:ee,formatParamsFunc:le,onSuccess:oe,methods:"post"},null,8,["tableData","url"])]),_:1},8,["modelValue"])}}}),_withScopeId$h=te=>(vue.pushScopeId("data-v-9a318098"),te=te(),vue.popScopeId(),te),_hoisted_1$K={class:"mt-3"},_hoisted_2$C=_withScopeId$h(()=>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$w={class:"sort-target"},_hoisted_4$v={key:0},_sfc_main$T=vue.defineComponent({__name:"model-normal",emits:["success"],setup(te,{expose:U,emit:G}){const{proxy:ee}=vue.getCurrentInstance(),{setFormValue:ne,getFormValue:re}=ee.$globalHooks.useForm(),oe=G,ie=vue.ref(!1),le=vue.ref(""),ae=vue.ref([]);vue.ref("");const se=vue.ref([]),ue=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:fe=>{},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}]),ce=fe=>{ie.value=!0,le.value="",ae.value=[],se.value=(fe?(fe==null?void 0:fe.listModelAttribute)??[]:[{nanoid:nanoid()}]).map(ve=>{const he=((ve==null?void 0:ve.attributeCode)??"").split("");return ve.nanoid=nanoid(),he[0]=="_"&&(ve.hide=!0),ve}),ne({...fe??{},projectId:ee.$baseGetCurrentProjectId()},ue)},de=async()=>{const{params:fe,error:ve}=re(ue);if(ve.length>0)return;const he="/api/ace-data-center/model/editModelDetail";await ee.$baseHttp.post(he,{...fe,projectId:String(ee.$baseGetCurrentProjectId()),listModelAttribute:vue.unref(se)},{headers:{loading:!0}})&&(ie.value=!1,ee.$message.success("操作成功"),oe("success"))};return U({init:ce}),(fe,ve)=>{const he=vue.resolveComponent("AppForm"),pe=vue.resolveComponent("aceHeader"),ge=vue.resolveComponent("AppDrawer");return vue.openBlock(),vue.createBlock(ge,{modelValue:vue.unref(ie),"onUpdate:modelValue":ve[1]||(ve[1]=me=>vue.isRef(ie)?ie.value=me:null),title:"影子模型",size:"100%"},{footer:vue.withCtx(()=>[vue.createVNode(vue.unref(elementPlus.ElButton),{class:"ml-3",type:"primary",onClick:de},{default:vue.withCtx(()=>[vue.createTextVNode("提交")]),_:1}),vue.renderSlot(fe.$slots,"formFooter",{},void 0,!0),vue.createVNode(vue.unref(elementPlus.ElButton),{class:"ml-3",onClick:ve[0]||(ve[0]=me=>ie.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(he,{form:vue.unref(ue)},null,8,["form"])]),_:1}),vue.createVNode(vue.unref(elementPlus.ElMain),null,{default:vue.withCtx(()=>[vue.createVNode(pe,{title:"影子模型属性"}),vue.createElementVNode("table",_hoisted_1$K,[_hoisted_2$C,vue.createElementVNode("tbody",_hoisted_3$w,[(vue.openBlock(!0),vue.createElementBlock(vue.Fragment,null,vue.renderList(vue.unref(se),(me,_e)=>(vue.openBlock(),vue.createElementBlock(vue.Fragment,{key:me.nanoid},[me.hide?vue.createCommentVNode("",!0):(vue.openBlock(),vue.createElementBlock("tr",_hoisted_4$v,[vue.createElementVNode("td",null,vue.toDisplayString(me.attributeCode),1),vue.createElementVNode("td",null,[vue.createVNode(vue.unref(elementPlus.ElInput),{modelValue:me.attributeComment,"onUpdate:modelValue":be=>me.attributeComment=be,maxlength:"30",showWordLimit:"",placeholder:"字段描述"},null,8,["modelValue","onUpdate:modelValue"])]),vue.createElementVNode("td",null,vue.toDisplayString(me.mapCode),1),vue.createElementVNode("td",null,[vue.createVNode(vue.unref(elementPlus.ElSelect),{modelValue:me.dataType,"onUpdate:modelValue":be=>me.dataType=be,placeholder:"数据类型",style:{width:"100%"},disabled:""},{default:vue.withCtx(()=>[(vue.openBlock(!0),vue.createElementBlock(vue.Fragment,null,vue.renderList(vue.unref(commonDataType),be=>(vue.openBlock(),vue.createBlock(vue.unref(elementPlus.ElOption),{key:be.value,label:be.label,value:be.value},null,8,["label","value"]))),128))]),_:2},1032,["modelValue","onUpdate:modelValue"])]),vue.createElementVNode("td",null,vue.toDisplayString(me.dataLength),1),vue.createElementVNode("td",null,vue.toDisplayString(me.dataScale??"-"),1),vue.createElementVNode("td",null,[vue.createVNode(vue.unref(elementPlus.ElSwitch),{modelValue:me.primaryKey,"onUpdate:modelValue":be=>me.primaryKey=be,"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:me.uniqueKey,"onUpdate:modelValue":be=>me.uniqueKey=be,"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_9a318098_lang="",ModelNormal=_export_sfc$2(_sfc_main$T,[["__scopeId","data-v-9a318098"]]),_hoisted_1$J={class:"flex flex-col h-full overflow-hidden"},_hoisted_2$B={class:"flex flex-col flex-1 mt-3 overflow-hidden"},_hoisted_3$v={class:"app-search"},_hoisted_4$u=vue.createElementVNode("i",{class:"mr-1 ri-search-line"},null,-1),_hoisted_5$n={class:"flex flex-1 overflow-hidden"},_hoisted_6$j={class:"flex justify-end mt-3"},_sfc_main$S=vue.defineComponent({__name:"view",emits:["refresh"],setup(te,{expose:U,emit:G}){const{proxy:ee}=vue.getCurrentInstance(),ne=vue.inject("modelEle"),{setFormValue:re,getFormValue:oe}=ee.$globalHooks.useForm(),{openMessage:ie}=ee.$globalHooks.useMessage(),{createShadowModelSync:le,listDataSourceSynchronized:ae}=fetch$1(ee).dbImport,se=vue.ref(null),ue=vue.ref(null),ce=G,{originlist:de,list:fe,pageLoading:ve,page:he,pageSize:pe,getData:ge,handleSizeChange:me,handleCurrentChange:_e}=ee.$globalHooks.usePage(),be=vue.reactive([{name:"源表",type:FieldType.Text,fieldName:"sourceTableCode",value:""},{name:"源表名",type:FieldType.Text,fieldName:"sourceTableComment",value:""}]),ye=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"}]),xe=async($e=!0)=>{$e&&(re({},be),he.value=1),ve.value=!0;const{params:we}=oe(be,!1,!0),Ee=await ae({dataSourceId:vue.unref(ne).dataSourceId,...we});if(ve.value=!1,!Ee){de.value=[];return}Ee.data.forEach(Ve=>{Ve.shadowModelId?Ve.htmlButton=[{name:"编辑",key:"EDIT",type:"primary"}]:Ve.htmlButton=[{name:"创建影子模型",key:"CREATE",type:"primary"}]}),de.value=Ee.data,ge()},Ce=async $e=>{const{type:we,row:Ee,index:Ve}=$e;switch(we){case"EDIT":{const Se=await ee.$baseHttp.get(`/api/ace-data-center/model/detail?id=${Ee==null?void 0:Ee.shadowModelId}`);if(!Se)return;ee.$refs.normalRef.init(Se.data)}break;case"CREATE":ee.$baseConfirm({content:"是否创建影子模型?",callConfirm:async()=>{await le({sourceId:Ee.dataSourceId,sourceTableCode:Ee.sourceTableCode})&&(ie({type:"success",message:"操作成功"}),ce("refresh"),xe(!1))}});break;case"source-table-data":vue.unref(ue).init(Ee.dataSourceId,Ee.sourceTableCode);break}};return U({init:xe}),($e,we)=>{const Ee=vue.resolveComponent("aceHeader"),Ve=vue.resolveComponent("AppForm"),Se=vue.resolveComponent("AppTable");return vue.openBlock(),vue.createElementBlock("div",_hoisted_1$J,[vue.createVNode(Ee,{title:vue.unref(ne).dataSourceComment},null,8,["title"]),vue.createElementVNode("div",_hoisted_2$B,[vue.createElementVNode("div",_hoisted_3$v,[vue.createVNode(Ve,{form:vue.unref(be)},{default:vue.withCtx(()=>[vue.createVNode(vue.unref(elementPlus.ElButton),{type:"primary",class:"ml-1",onClick:we[0]||(we[0]=ke=>xe(!1))},{default:vue.withCtx(()=>[_hoisted_4$u,vue.createTextVNode(" 查询 ")]),_:1})]),_:1},8,["form"])]),vue.createElementVNode("div",_hoisted_5$n,[vue.createVNode(Se,{tableData:vue.unref(ye),list:vue.unref(fe),loading:vue.unref(ve),onTableBtnClick:Ce},{shadowModelId:vue.withCtx(({row:ke})=>[ke.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:ke})=>[ke.sourceTableDataCount==0?(vue.openBlock(),vue.createElementBlock(vue.Fragment,{key:0},[vue.createTextVNode(vue.toDisplayString(ke.sourceTableDataCount),1)],64)):(vue.openBlock(),vue.createBlock(vue.unref(elementPlus.ElLink),{key:1,type:"primary",onClick:Ne=>Ce({type:"source-table-data",row:ke,index:-1})},{default:vue.withCtx(()=>[vue.createTextVNode(vue.toDisplayString(ke.sourceTableDataCount),1)]),_:2},1032,["onClick"]))]),_:1},8,["tableData","list","loading"])]),vue.createElementVNode("div",_hoisted_6$j,[vue.createVNode(vue.unref(elementPlus.ElPagination),{"current-page":vue.unref(he),"onUpdate:currentPage":we[1]||(we[1]=ke=>vue.isRef(he)?he.value=ke:null),"page-size":vue.unref(pe),"onUpdate:pageSize":we[2]||(we[2]=ke=>vue.isRef(pe)?pe.value=ke:null),"page-sizes":[10,20,40,60,80,100],background:!0,layout:"total, sizes, prev, pager, next, jumper",total:vue.unref(de).length,onCurrentChange:vue.unref(_e),onSizeChange:vue.unref(me)},null,8,["current-page","page-size","total","onCurrentChange","onSizeChange"])])]),vue.createVNode(ModelNormal,{ref_key:"normalRef",ref:se},null,512),vue.createVNode(_sfc_main$U,{ref_key:"sourceTableDataRef",ref:ue},null,512)])}}}),_hoisted_1$I={key:0,class:"flex items-center justify-center h-full"},_sfc_main$R=vue.defineComponent({__name:"index",setup(te){const U=vue.ref(null),G=vue.ref(null),ee=vue.ref({});vue.provide("modelEle",ee);const ne=vue.inject("local"),re=oe=>{ee.value=oe,vue.nextTick(()=>{vue.unref(U).init()})};return(oe,ie)=>{const le=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(ne)},{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:G,onNodeClick:re},null,512)]),_:1}),vue.createVNode(vue.unref(elementPlus.ElMain),null,{default:vue.withCtx(()=>[vue.unref(ee).dataSourceId?(vue.openBlock(),vue.createBlock(_sfc_main$S,{key:1,ref_key:"viewRef",ref:U,onRefresh:ie[0]||(ie[0]=ae=>vue.unref(G).initMenu())},null,512)):(vue.openBlock(),vue.createElementBlock("div",_hoisted_1$I,[vue.createVNode(le,{description:"请选择数据源"})]))]),_:1})]),_:1},8,["locale"])]),_:1})}}}),_hoisted_1$H=vue.createElementVNode("i",{class:"ri-search-line"},null,-1),_hoisted_2$A={class:"mt-3"},_hoisted_3$u={class:"mt-3"},_hoisted_4$t={key:1,class:"mr-1 -ml-5 text-base ri-edit-circle-fill text-color-primary"},_sfc_main$Q=vue.defineComponent({__name:"menu",emits:["node-click"],setup(te,{expose:U,emit:G}){const ee=vue.ref(""),ne=vue.ref(null),re=vue.ref([{label:"源视图表",value:"ODSVIEW"},{label:"整合数据表",value:"DWD"}]),oe=vue.ref(vue.unref(re)[0].value),{proxy:ie}=vue.getCurrentInstance(),le=G;vue.watch(ee,ve=>{vue.unref(ne).filter(ve)});const ae=(ve,he)=>ve?he.name.includes(ve):!0,se=vue.ref([]),ue=vue.ref([]),ce=vue.ref(!0),de=()=>{ce.value=!0,Promise.all([fetch$1(ie).loadModelMenu({modelLayer:"ODSVIEW"}),fetch$1(ie).loadModelMenu({modelLayer:"DWD"})]).then(ve=>{se.value=Object.keys(ve[0].data).map(he=>({modelName:he,id:he,children:ve[0].data[he]})),ue.value=Object.keys(ve[1].data).map(he=>({modelName:he,id:he,children:ve[1].data[he]})),ce.value=!1})};de();const fe=ve=>{Array.isArray(ve.children)||le("node-click",ve)};return U({init:de}),(ve,he)=>{const pe=vue.resolveComponent("aceHeader");return vue.openBlock(),vue.createElementBlock(vue.Fragment,null,[vue.createVNode(pe,{title:"整合数据",class:"mb-2"},{default:vue.withCtx(()=>[vue.renderSlot(ve.$slots,"top")]),_:3}),vue.createVNode(vue.unref(elementPlus.ElInput),{placeholder:"请输入内容",clearable:"",modelValue:vue.unref(ee),"onUpdate:modelValue":he[0]||(he[0]=ge=>vue.isRef(ee)?ee.value=ge:null)},{prefix:vue.withCtx(()=>[_hoisted_1$H]),_:1},8,["modelValue"]),vue.createElementVNode("div",_hoisted_2$A,[vue.createVNode(vue.unref(elementPlus.ElButtonGroup),null,{default:vue.withCtx(()=>[(vue.openBlock(!0),vue.createElementBlock(vue.Fragment,null,vue.renderList(vue.unref(re),ge=>(vue.openBlock(),vue.createBlock(vue.unref(elementPlus.ElButton),{type:vue.unref(oe)==ge.value?"primary":"",key:ge.value,onClick:me=>oe.value=ge.value},{default:vue.withCtx(()=>[vue.createTextVNode(vue.toDisplayString(ge.label),1)]),_:2},1032,["type","onClick"]))),128))]),_:1})]),vue.createElementVNode("div",_hoisted_3$u,[vue.createVNode(vue.unref(elementPlus.ElSkeleton),{animated:"",loading:vue.unref(ce),count:2},{default:vue.withCtx(()=>[vue.createVNode(vue.unref(elementPlus.ElTree),{class:"animated fadeIn",ref_key:"treeRef",ref:ne,data:vue.unref(oe)=="DWD"?vue.unref(ue):vue.unref(se),"node-key":"id","default-expand-all":"","highlight-current":"","filter-node-method":ae,onNodeClick:fe},{default:vue.withCtx(({node:ge,data:me})=>[ge.level!=1?(vue.openBlock(),vue.createElementBlock(vue.Fragment,{key:0},[me.modelCode&&me.openForm!=2?(vue.openBlock(),vue.createElementBlock("i",{key:0,class:vue.normalizeClass(["mr-1 -ml-5 text-base ri-checkbox-circle-fill",[me.publishStatus==2?"text-color-success":"text-color-info"]])},null,2)):vue.createCommentVNode("",!0)],64)):vue.createCommentVNode("",!0),me.openForm==2?(vue.openBlock(),vue.createElementBlock("i",_hoisted_4$t)):vue.createCommentVNode("",!0),vue.createElementVNode("span",{class:vue.normalizeClass({"font-bold":ge.level==1})},vue.toDisplayString(me.modelName),3)]),_:1},8,["data"])]),_:1},8,["loading"])])],64)}}}),_withScopeId$g=te=>(vue.pushScopeId("data-v-8dbf5661"),te=te(),vue.popScopeId(),te),_hoisted_1$G={class:"mt-3"},_hoisted_2$z=_withScopeId$g(()=>vue.createElementVNode("td",null,"字段名称",-1)),_hoisted_3$t=_withScopeId$g(()=>vue.createElementVNode("td",null,"字段描述",-1)),_hoisted_4$s=_withScopeId$g(()=>vue.createElementVNode("td",null,"映射字段",-1)),_hoisted_5$m=_withScopeId$g(()=>vue.createElementVNode("td",{width:"120px"},"数据类型",-1)),_hoisted_6$i=_withScopeId$g(()=>vue.createElementVNode("td",null,"数据长度",-1)),_hoisted_7$g=_withScopeId$g(()=>vue.createElementVNode("td",null,"数据标度",-1)),_hoisted_8$c=_withScopeId$g(()=>vue.createElementVNode("td",null,"是否主键",-1)),_hoisted_9$b=_withScopeId$g(()=>vue.createElementVNode("td",null,"唯一校验",-1)),_hoisted_10$a=_withScopeId$g(()=>vue.createElementVNode("td",{style:{width:"50px"}},null,-1)),_hoisted_11$8={class:"sort-target"},_hoisted_12$7={key:0},_hoisted_13$5=["onClick"],_hoisted_14$4=_withScopeId$g(()=>vue.createElementVNode("td",null,[vue.createElementVNode("i",{class:"text-lg cursor-move ri-mouse-line handle text-color-warning"})],-1)),_sfc_main$P=vue.defineComponent({__name:"attribute",props:vue.mergeModels({isRequired:{default:1}},{modelValue:{},modelModifiers:{}}),emits:["update:modelValue"],setup(te,{expose:U}){const G=vue.useModel(te,"modelValue");vue.getCurrentInstance();const ee=vue.ref(null),ne=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:"请选择是否为主键"}]}),re=ue=>{const ce=ue.dataType;ce!=="decimal"&&(ue.dataScale=0),["autoIncrement","date","time","datetime","int","bigint","double","text"].includes(ce)&&(ue.dataLength=0),ce==="decimal"&&(ue.dataLength=10,ue.dataScale=6),ce==="varchar"&&(ue.dataLength=255)},oe=(ue,ce)=>{ue.primaryKey==2&&vue.unref(G).forEach((fe,ve)=>{ve!=ce&&(fe.primaryKey=1)})},ie=()=>{vue.unref(G).push({nanoid:nanoid()})},le=ue=>{vue.unref(G).splice(ue,1)};return U({validate:async()=>await vue.unref(ee).validate(ue=>ue),isRepeat:()=>{const ue=new Map;let ce="";for(let de=0;de<vue.unref(G).length;de++){let fe=vue.unref(G)[de],ve=ue.get(fe.attributeCode);ve!=null&&(ce+="字段名称 <strong>"+fe.attributeCode+"</strong> 重复(<i>第"+(ve+1)+"行和第"+(de+1)+"行</i>);<br>"),ue.set(vue.unref(G)[de].attributeCode,de)}return ce}}),(ue,ce)=>(vue.openBlock(),vue.createBlock(vue.unref(elementPlus.ElForm),{"label-width":"0",model:{modelValue:G.value},size:"small",ref_key:"elFormRef",ref:ee,rules:vue.unref(ne)},{default:vue.withCtx(()=>[vue.createVNode(vue.unref(vueDraggablePlus.VueDraggable),{modelValue:G.value,"onUpdate:modelValue":ce[0]||(ce[0]=de=>G.value=de),target:".sort-target",animation:150,handle:".handle"},{default:vue.withCtx(()=>[vue.createElementVNode("table",_hoisted_1$G,[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:ie})]),_hoisted_2$z,_hoisted_3$t,_hoisted_4$s,_hoisted_5$m,_hoisted_6$i,_hoisted_7$g,_hoisted_8$c,_hoisted_9$b,_hoisted_10$a]),vue.createElementVNode("tbody",_hoisted_11$8,[(vue.openBlock(!0),vue.createElementBlock(vue.Fragment,null,vue.renderList(G.value,(de,fe)=>(vue.openBlock(),vue.createElementBlock(vue.Fragment,{key:de.nanoid},[de.hide?vue.createCommentVNode("",!0):(vue.openBlock(),vue.createElementBlock("tr",_hoisted_12$7,[vue.createElementVNode("td",null,[vue.createElementVNode("i",{class:"text-lg cursor-pointer ri-indeterminate-circle-line text-color-danger",onClick:ve=>le(fe)},null,8,_hoisted_13$5)]),vue.createElementVNode("td",null,[vue.createVNode(vue.unref(elementPlus.ElFormItem),{prop:"modelValue."+fe+".attributeCode",rules:vue.unref(ne).attributeCode},{default:vue.withCtx(()=>[vue.createVNode(vue.unref(elementPlus.ElInput),{modelValue:de.attributeCode,"onUpdate:modelValue":ve=>de.attributeCode=ve,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."+fe+".attributeComment",rules:vue.unref(ne).attributeComment},{default:vue.withCtx(()=>[vue.createVNode(vue.unref(elementPlus.ElInput),{modelValue:de.attributeComment,"onUpdate:modelValue":ve=>de.attributeComment=ve,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."+fe+".mapCode",rules:vue.unref(ne).mapCode},{default:vue.withCtx(()=>[vue.createVNode(vue.unref(elementPlus.ElInput),{modelValue:de.mapCode,"onUpdate:modelValue":ve=>de.mapCode=ve,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."+fe+".dataType",rules:vue.unref(ne).dataType},{default:vue.withCtx(()=>[vue.createVNode(vue.unref(elementPlus.ElSelect),{modelValue:de.dataType,"onUpdate:modelValue":ve=>de.dataType=ve,placeholder:"数据类型",class:"w-full",teleported:!1,onChange:()=>re(de)},{default:vue.withCtx(()=>[(vue.openBlock(!0),vue.createElementBlock(vue.Fragment,null,vue.renderList(vue.unref(commonDataType),ve=>(vue.openBlock(),vue.createBlock(vue.unref(elementPlus.ElOption),{key:ve.value,label:ve.label,value:ve.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."+fe+".dataLength",rules:vue.unref(ne).dataLength},{default:vue.withCtx(()=>[vue.createVNode(vue.unref(elementPlus.ElInputNumber),{min:0,max:2048,"value-on-clear":0,"controls-position":"right",modelValue:de.dataLength,"onUpdate:modelValue":ve=>de.dataLength=ve,disabled:["autoIncrement","date","time","datetime","int","bigint","double","text"].includes(de.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."+fe+".dataScale",rules:vue.unref(ne).dataScale},{default:vue.withCtx(()=>[vue.createVNode(vue.unref(elementPlus.ElInputNumber),{modelValue:de.dataScale,"onUpdate:modelValue":ve=>de.dataScale=ve,min:0,max:2048,"value-on-clear":0,"controls-position":"right",disabled:!["decimal"].includes(de.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:de.primaryKey,"onUpdate:modelValue":ve=>de.primaryKey=ve,"inline-prompt":"","active-text":"是","inactive-text":"否","active-value":"2","inactive-value":"1",onChange:()=>oe(de,fe)},null,8,["modelValue","onUpdate:modelValue","onChange"])]),vue.createElementVNode("td",null,[vue.createVNode(vue.unref(elementPlus.ElSwitch),{modelValue:de.uniqueKey,"onUpdate:modelValue":ve=>de.uniqueKey=ve,"inline-prompt":"","active-text":"是","inactive-text":"否","active-value":"2","inactive-value":"1"},null,8,["modelValue","onUpdate:modelValue"])]),_hoisted_14$4]))],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$P,[["__scopeId","data-v-8dbf5661"]]),_withScopeId$f=te=>(vue.pushScopeId("data-v-22676e4d"),te=te(),vue.popScopeId(),te),_hoisted_1$F={class:"flex flex-col h-full"},_hoisted_2$y={class:"flex flex-1 overflow-hidden"},_hoisted_3$s={class:"flex flex-col flex-1 mr-3 overflow-hidden"},_hoisted_4$r={class:"h"},_hoisted_5$l=["onClick"],_hoisted_6$h={class:"mr-1 text-base"},_hoisted_7$f={class:"ml-2 text-xs text-color-info"},_hoisted_8$b={class:"text-color-warning"},_hoisted_9$a={class:"flex justify-end flex-1"},_hoisted_10$9=_withScopeId$f(()=>vue.createElementVNode("i",{class:"mr-1 ri-play-mini-fill"},null,-1)),_hoisted_11$7={class:"flex-1 overflow-hidden b"},_hoisted_12$6={class:"flex flex-col flex-1 overflow-hidden"},_hoisted_13$4={class:"h"},_hoisted_14$3=["onClick"],_hoisted_15$2={class:"flex-1 overflow-hidden b"},_hoisted_16$2={class:"flex flex-1 mt-3 overflow-hidden"},_hoisted_17$2={class:"flex flex-col flex-1 mr-3 overflow-hidden"},_hoisted_18$2={class:"flex h"},_hoisted_19$2=["onClick"],_hoisted_20$2={key:0,class:"mr-1 text-color-danger"},_hoisted_21$2={class:"mr-1 text-base"},_hoisted_22$2={key:0,class:"flex justify-end flex-1"},_hoisted_23$2=_withScopeId$f(()=>vue.createElementVNode("i",{class:"mr-1 ri-play-mini-fill"},null,-1)),_hoisted_24$1={class:"flex-1 overflow-hidden b"},_hoisted_25$1={key:0,class:"flex items-center justify-center h-full"},_hoisted_26$1=_withScopeId$f(()=>vue.createElementVNode("i",{class:"ri-table-fill"},null,-1)),_hoisted_27=_withScopeId$f(()=>vue.createElementVNode("i",{class:"ri-database-2-fill"},null,-1)),_hoisted_28={class:"h-full mt-2 overflow-y-auto"},_hoisted_29={class:"overflow-y-auto max-h-96",style:{"min-height":"300px"}},_hoisted_30=_withScopeId$f(()=>vue.createElementVNode("span",{class:"mr-1 text-color-danger"},"*",-1)),_hoisted_31={class:"h-full mt-2 overflow-y-auto"},_hoisted_32={class:"mt-2"},_hoisted_33={key:0,class:"flex flex-col flex-1 overflow-hidden"},_hoisted_34={class:"h"},_hoisted_35=["onClick"],_hoisted_36={class:"flex-1 overflow-hidden b"},_sfc_main$O=vue.defineComponent({__name:"design",props:{widgetType:{default:""}},emits:["success"],setup(te,{expose:U,emit:G}){const ee=te,ne=G,{proxy:re}=vue.getCurrentInstance(),{setFormValue:oe,getFormValue:ie}=re.$globalHooks.useForm(),{openMessage:le}=re.$globalHooks.useMessage(),ae=vue.inject("projectList"),se=vue.computed(()=>{var Me,ze;return((ze=(Me=(vue.unref(ae)??[]).find(Ge=>Ge.value==re.$baseGetCurrentProjectId()))==null?void 0:Me.ext)==null?void 0:ze.storeType)??"-"}),ue=[{label:"SQL编写",value:"1",num:"①"}],ce=vue.ref("1"),de=[{label:"SQL执行结果",value:"1"},{label:"SQL执行结果(JSON)",value:"2"}],fe=vue.ref("1"),ve=vue.ref([]),he=vue.ref(""),pe=vue.ref("1"),ge=[{label:"插件执行结果",value:"1"},{label:"插件执行结果(JSON)",value:"2"}],me=vue.ref("1"),_e=vue.ref(!1),be=vue.ref(null),ye=vue.ref(""),xe=vue.ref([]),Ce=vue.ref(""),$e=vue.ref([]),we=vue.ref(`function plugin(item){
|
|
891
|
+
>${ie}</span>`},parseDemoHtml=te=>{const U=te.getAttribute("data-chartType")||"",G=te.getAttribute("data-id")||"",ee=te.getAttribute("data-content")||"",ne=te.getAttribute("data-singleValue")||"",re=te.getAttribute("data-singleValueKey")||"",oe=te.getAttribute("data-subtitle")||"",ie=te.getAttribute("data-width")||"",le=te.getAttribute("data-fontSize")||"",ae=te.getAttribute("data-bold")||"",se=te.getAttribute("data-color")||"",ue=te.getAttribute("data-src")||"",ce=te.getAttribute("data-indicatorsType")||"";return{type:"indicator",id:G,chartType:U,subtitle:oe,content:ee,width:ie,src:ue,fontSize:le,bold:ae,singleValue:ne,singleValueKey:re,color:se,indicatorsType:ce,children:[{text:ee}]}};function withMention(te){const{insertText:U,isInline:G,isVoid:ee}=te,ne=te;return ne.insertText=re=>{if(editor.DomEditor.getSelectedElems(ne).some(le=>ne.isVoid(le))){U(re);return}U(re)},ne.isInline=re=>editor.DomEditor.getNodeType(re)==="indicator"?!0:G(re),ne.isVoid=re=>editor.DomEditor.getNodeType(re)==="indicator"?!0:ee(re),ne}const aceIndicatorReportPlugin={editorPlugin:withMention,renderElems:[{type:"indicator",renderElem:renderIndicator}],elemsToHtml:[{type:"indicator",elemToHtml:indicatorToHtml}],parseElemsHtml:[{selector:'span[data-w-e-type="indicator"]',parseElemHtml:parseDemoHtml}]},_withScopeId$s=te=>(vue.pushScopeId("data-v-5520f2bf"),te=te(),vue.popScopeId(),te),_hoisted_1$17={class:"flex-1 p-2 border border-gray-200 border-solid"},_hoisted_2$Y={class:"flex justify-end"},_hoisted_3$Q=_withScopeId$s(()=>vue.createElementVNode("div",{class:"h-px mt-2 mb-2 bg-gray-200"},null,-1)),_hoisted_4$O={class:"overflow-y-auto max-h-80"},_hoisted_5$E=_withScopeId$s(()=>vue.createElementVNode("span",{class:"ml-2 mr-2"},"~",-1)),_hoisted_6$z=_withScopeId$s(()=>vue.createElementVNode("span",{class:"ml-2 mr-2"},"~",-1)),_sfc_main$1k=vue.defineComponent({__name:"customSearch",props:{dynamicSearchForm:{default:()=>[]},customSearchVisible:{type:Boolean,default:!1}},emits:["update:customSearchVisible","dynamicSearchFormUpdate","success"],setup(te,{expose:U,emit:G}){var ge;const ee=te,ne=G;vue.watch(()=>ee.customSearchVisible,me=>{me&&vue.nextTick(()=>{he()})});const{proxy:re}=vue.getCurrentInstance(),oe=vue.inject("modelEle"),ie=vue.ref([]),le=vue.ref([]);re.$baseHttp.get(`/api/ace-data-center/model/detail?id=${(ge=vue.unref(oe))==null?void 0:ge.id}`).then(me=>{ie.value=me.data.listModelAttribute.map(_e=>({name:_e.attributeComment,key:_e.attributeCode,dataType:_e.dataType,checked:!1,type:"",value:"",minValue:"",maxValue:"",defaultRule:"",dictId:"",options:""}))});const ae=vue.ref([]);re.$baseHttp.get(`/api/ace-data-center/custom-dic/options?projectId=${re.$baseGetCurrentProjectId()}`).then(me=>{ae.value=me.data});const se={yymmddSingle:[{name:"当日",value:"today"},{name:"昨天",value:"yesterday"}],yymmddhhmmssSingle:[{name:"当日",value:"today"}],yymmddhhmmssRange:[{name:"当日",value:"today"},{name:"昨天",value:"yesterday"}],yymmddRange:[{name:"近一周",value:"week"}],yymmSingle:[{name:"当月",value:"month"}],yymmRange:[{name:"近两月",value:"two-month"}],yySingle:[{name:"当年",value:"year"}],yyRange:[{name:"近两年",value:"two-year"}]},ue=me=>{let _e="date",be="YYYY-MM-DD";return["yyRange","yySingle"].includes(me)&&(_e="year",be="YYYY"),["yymmRange","yymmSingle"].includes(me)&&(_e="month",be="YYYY-MM"),{type:_e,format:be}},ce=(me,_e,be)=>me=="gt"?_e.getTime()>dayjs(be||"").valueOf():_e.getTime()<dayjs(be||"").valueOf(),de=(me,_e,be)=>{if(me[_e]==""||me[be]=="")return;const ye=Number(me[_e]),xe=Number(me[be]);(_e=="minValue"?ye>xe:ye<xe)&&(me[_e]=me[be])},fe=me=>{me.value="",me.options=[],me.dictId&&re.$baseHttp.get(`/api/ace-data-center/custom-dic/readDict/${me.dictId}`).then(_e=>{me.options=_e.data??[]})},ve=me=>{me.value="",me.minValue="",me.maxValue="",me.defaultRule="",me.dictId="",me.options=[]},he=()=>{le.value=JSON.parse(JSON.stringify(vue.unref(ie))),vue.unref(le).forEach(me=>{const _e=ee.dynamicSearchForm.find(be=>be.key==me.key);_e&&(me.checked=!0,Object.keys(_e).forEach(be=>{me[be]=_e[be]})),["varchar","text"].includes(me.dataType)&&!_e&&(me.type="stringSingle")})},pe=()=>{ne("dynamicSearchFormUpdate",le.value.filter(me=>me.checked&&me.type)),ne("update:customSearchVisible",!1)};return U({init:he}),(me,_e)=>(vue.openBlock(),vue.createElementBlock("div",_hoisted_1$17,[vue.createElementVNode("div",_hoisted_2$Y,[vue.createVNode(vue.unref(elementPlus.ElButton),{type:"primary",size:"small",onClick:pe},{default:vue.withCtx(()=>[vue.createTextVNode("保存")]),_:1}),vue.createVNode(vue.unref(elementPlus.ElButton),{type:"primary",class:"ml-3",size:"small",onClick:_e[0]||(_e[0]=be=>ne("update:customSearchVisible",!1))},{default:vue.withCtx(()=>[vue.createTextVNode(" 关闭 ")]),_:1})]),_hoisted_3$Q,vue.createElementVNode("div",_hoisted_4$O,[vue.createVNode(vue.unref(elementPlus.ElForm),{inline:"",size:"small"},{default:vue.withCtx(()=>[(vue.openBlock(!0),vue.createElementBlock(vue.Fragment,null,vue.renderList(vue.unref(le),(be,ye)=>(vue.openBlock(),vue.createElementBlock("div",{key:ye},[vue.createVNode(vue.unref(elementPlus.ElFormItem),{label:""},{default:vue.withCtx(()=>[vue.createVNode(vue.unref(elementPlus.ElCheckbox),{modelValue:be.checked,"onUpdate:modelValue":xe=>be.checked=xe,size:"small"},null,8,["modelValue","onUpdate:modelValue"])]),_:2},1024),vue.createVNode(vue.unref(elementPlus.ElFormItem),{label:"名称:"},{default:vue.withCtx(()=>[vue.createVNode(vue.unref(elementPlus.ElInput),{modelValue:be.name,"onUpdate:modelValue":xe=>be.name=xe,size:"small",placeholder:"请输入名称",clearable:""},null,8,["modelValue","onUpdate:modelValue"])]),_:2},1024),vue.createVNode(vue.unref(elementPlus.ElFormItem),{label:"类型:"},{default:vue.withCtx(()=>[vue.createVNode(vue.unref(elementPlus.ElSelect),{size:"small",clearable:"",teleported:!1,modelValue:be.type,"onUpdate:modelValue":xe=>be.type=xe,onChange:xe=>ve(be),placeholder:"类型"},{default:vue.withCtx(()=>[["date","datetime"].includes(be.dataType)?(vue.openBlock(),vue.createElementBlock(vue.Fragment,{key:0},[vue.createVNode(vue.unref(elementPlus.ElOption),{label:"年·区间",value:"yyRange"}),vue.createVNode(vue.unref(elementPlus.ElOption),{label:"年·单值",value:"yySingle"}),vue.createVNode(vue.unref(elementPlus.ElOption),{label:"年月·区间",value:"yymmRange"}),vue.createVNode(vue.unref(elementPlus.ElOption),{label:"年月·单值",value:"yymmSingle"}),vue.createVNode(vue.unref(elementPlus.ElOption),{label:"年月日·区间",value:"yymmddRange"}),vue.createVNode(vue.unref(elementPlus.ElOption),{label:"年月日·单值",value:"yymmddSingle"}),vue.createVNode(vue.unref(elementPlus.ElOption),{label:"年月日时分秒·区间",value:"yymmddhhmmssRange"}),vue.createVNode(vue.unref(elementPlus.ElOption),{label:"年月日时分秒·单值",value:"yymmddhhmmssSingle"})],64)):["int","decimal","double"].includes(be.dataType)?(vue.openBlock(),vue.createElementBlock(vue.Fragment,{key:1},[vue.createVNode(vue.unref(elementPlus.ElOption),{label:"数值·区间",value:"numberRange"}),vue.createVNode(vue.unref(elementPlus.ElOption),{label:"数值·单值",value:"numberSingle"}),vue.createVNode(vue.unref(elementPlus.ElOption),{label:"下拉框·字典",value:"select"})],64)):(vue.openBlock(),vue.createElementBlock(vue.Fragment,{key:2},[vue.createVNode(vue.unref(elementPlus.ElOption),{label:"字符串",value:"stringSingle"}),vue.createVNode(vue.unref(elementPlus.ElOption),{label:"字符串分隔",value:"stringMultiple"}),vue.createVNode(vue.unref(elementPlus.ElOption),{label:"下拉框·字典",value:"select"})],64))]),_:2},1032,["modelValue","onUpdate:modelValue","onChange"])]),_:2},1024),be.type?(vue.openBlock(),vue.createBlock(vue.unref(elementPlus.ElFormItem),{key:0,label:"默认值:"},{default:vue.withCtx(()=>[se[be.type]?(vue.openBlock(),vue.createBlock(vue.unref(elementPlus.ElSelect),{key:0,size:"small",clearable:"",style:{"margin-right":"10px"},teleported:!1,modelValue:be.defaultRule,"onUpdate:modelValue":xe=>be.defaultRule=xe,placeholder:"默认值"},{default:vue.withCtx(()=>[(vue.openBlock(!0),vue.createElementBlock(vue.Fragment,null,vue.renderList(se[be.type],xe=>(vue.openBlock(),vue.createBlock(vue.unref(elementPlus.ElOption),{label:xe.name,value:xe.value,key:xe.value},null,8,["label","value"]))),128)),vue.createVNode(vue.unref(elementPlus.ElOption),{label:"自定义",value:"custom"})]),_:2},1032,["modelValue","onUpdate:modelValue"])):vue.createCommentVNode("",!0),be.type.endsWith("Range")?(vue.openBlock(),vue.createElementBlock(vue.Fragment,{key:1},[["yyRange","yymmRange","yymmddRange"].includes(be.type)?(vue.openBlock(),vue.createElementBlock(vue.Fragment,{key:0},[vue.createVNode(vue.unref(elementPlus.ElDatePicker),{size:"small",teleported:!1,modelValue:be.minValue,"onUpdate:modelValue":xe=>be.minValue=xe,clearable:"",placeholder:"开始","disabled-date":xe=>ce("gt",xe,be.maxValue),type:ue(be.type).type,"value-format":ue(be.type).format},null,8,["modelValue","onUpdate:modelValue","disabled-date","type","value-format"]),_hoisted_5$E,vue.createVNode(vue.unref(elementPlus.ElDatePicker),{size:"small",teleported:!1,modelValue:be.maxValue,"onUpdate:modelValue":xe=>be.maxValue=xe,clearable:"",placeholder:"结束","disabled-date":xe=>ce("lt",xe,be.minValue),type:ue(be.type).type,"value-format":ue(be.type).format},null,8,["modelValue","onUpdate:modelValue","disabled-date","type","value-format"])],64)):(vue.openBlock(),vue.createElementBlock(vue.Fragment,{key:1},[vue.createVNode(vue.unref(elementPlus.ElInput),{size:"small",modelValue:be.minValue,"onUpdate:modelValue":xe=>be.minValue=xe,max:be.maxValue,clearable:!1,onBlur:xe=>de(be,"minValue","maxValue"),type:"number",placeholder:"最小值"},null,8,["modelValue","onUpdate:modelValue","max","onBlur"]),_hoisted_6$z,vue.createVNode(vue.unref(elementPlus.ElInput),{size:"small",modelValue:be.maxValue,"onUpdate:modelValue":xe=>be.maxValue=xe,min:be.minValue,clearable:!1,onBlur:xe=>de(be,"maxValue","minValue"),type:"number",placeholder:"最大值"},null,8,["modelValue","onUpdate:modelValue","min","onBlur"])],64))],64)):vue.createCommentVNode("",!0),be.type.includes("Single")?(vue.openBlock(),vue.createElementBlock(vue.Fragment,{key:2},[["yySingle","yymmSingle","yymmddSingle"].includes(be.type)?(vue.openBlock(),vue.createBlock(vue.unref(elementPlus.ElDatePicker),{key:0,size:"small",teleported:!1,modelValue:be.value,"onUpdate:modelValue":xe=>be.value=xe,clearable:"",placeholder:"请输入"+be.name,type:ue(be.type).type,"value-format":ue(be.type).format},null,8,["modelValue","onUpdate:modelValue","placeholder","type","value-format"])):(vue.openBlock(),vue.createBlock(vue.unref(elementPlus.ElInput),{key:1,size:"small",modelValue:be.value,"onUpdate:modelValue":xe=>be.value=xe,teleported:!1,clearable:"",type:be.type=="numberSingle"?"number":"",placeholder:"请输入"+be.name},null,8,["modelValue","onUpdate:modelValue","type","placeholder"]))],64)):vue.createCommentVNode("",!0),be.type=="stringMultiple"?(vue.openBlock(),vue.createBlock(vue.unref(elementPlus.ElSelect),{key:3,size:"small",teleported:!1,modelValue:be.value,"onUpdate:modelValue":xe=>be.value=xe,placeholder:"请选择",clearable:"",multiple:"",filterable:"","allow-create":"","reserve-keyword":!1,"default-first-option":""},{default:vue.withCtx(()=>[(vue.openBlock(!0),vue.createElementBlock(vue.Fragment,null,vue.renderList(be.options,xe=>(vue.openBlock(),vue.createBlock(vue.unref(elementPlus.ElOption),{label:xe.label,value:xe.value,key:xe.value},null,8,["label","value"]))),128))]),_:2},1032,["modelValue","onUpdate:modelValue"])):vue.createCommentVNode("",!0),be.type=="select"?(vue.openBlock(),vue.createElementBlock(vue.Fragment,{key:4},[vue.createVNode(vue.unref(elementPlus.ElSelect),{size:"small",teleported:!1,style:{"margin-right":"10px"},modelValue:be.dictId,"onUpdate:modelValue":xe=>be.dictId=xe,placeholder:"字典值",clearable:"",onChange:xe=>fe(be)},{default:vue.withCtx(()=>[(vue.openBlock(!0),vue.createElementBlock(vue.Fragment,null,vue.renderList(vue.unref(ae),xe=>(vue.openBlock(),vue.createBlock(vue.unref(elementPlus.ElOption),{label:xe.label,value:xe.code,key:xe.code},null,8,["label","value"]))),128))]),_:2},1032,["modelValue","onUpdate:modelValue","onChange"]),vue.createVNode(vue.unref(elementPlus.ElSelect),{size:"small",teleported:!1,modelValue:be.value,"onUpdate:modelValue":xe=>be.value=xe,placeholder:"请选择",clearable:""},{default:vue.withCtx(()=>[(vue.openBlock(!0),vue.createElementBlock(vue.Fragment,null,vue.renderList(be.options,xe=>(vue.openBlock(),vue.createBlock(vue.unref(elementPlus.ElOption),{label:xe.name,value:xe.code,key:xe.code},null,8,["label","value"]))),128))]),_:2},1032,["modelValue","onUpdate:modelValue"])],64)):vue.createCommentVNode("",!0)]),_:2},1024)):vue.createCommentVNode("",!0)]))),128))]),_:1})])]))}}),customSearch_vue_vue_type_style_index_0_scoped_5520f2bf_lang="",aceIndicatorCustomSearch=_export_sfc$2(_sfc_main$1k,[["__scopeId","data-v-5520f2bf"]]),_hoisted_1$16={class:"field"},_hoisted_2$X={class:"flex items-center justify-center flex-1 h-full overflow-hidden cursor-pointer field-container"},_hoisted_3$P=["onClick"],_hoisted_4$N={class:"overflow-hidden field-label whitespace-nowrap text-ellipsis"},_hoisted_5$D={key:0,class:"flex items-center h-full"},_hoisted_6$y={class:"mr-5"},_hoisted_7$u=["onClick"],_hoisted_8$q={key:0,class:"field-add"},_hoisted_9$n=["onClick"],_sfc_main$1j=vue.defineComponent({__name:"model-table-dimension",props:{loading:{type:Boolean,default:!0},iconMap:{default:()=>{}},calendarType:{default:()=>{}},modelValue:{default:()=>[]},list:{default:()=>[]}},emits:["success","update:modelValue"],setup(te,{emit:U}){const G=te,ee=U;vue.inject("chartList");const ne=vue.ref(""),re=vue.computed(()=>G.list.filter(se=>se.columnComment.indexOf(vue.unref(ne))>=0)),oe=se=>{ee("update:modelValue",[se]),ee("success")},ie=se=>{ee("update:modelValue",[...G.modelValue,se]),ee("success")},le=se=>{ee("update:modelValue",G.modelValue.filter(ue=>ue.identifier!==se.identifier)),ee("success")},ae=(se,ue)=>{const ce=G.modelValue.find(de=>de.identifier==ue.identifier);ce.dateFormatType=se,ue.dateFormatType=se,ee("success")};return(se,ue)=>{const ce=vue.resolveComponent("aceHeader");return vue.openBlock(),vue.createElementBlock(vue.Fragment,null,[vue.createVNode(ce,{title:"分组统计维度",class:"mt-4 mb-2"}),vue.createVNode(vue.unref(elementPlus.ElSkeleton),{loading:se.loading,animated:""},{default:vue.withCtx(()=>[vue.createVNode(vue.unref(elementPlus.ElInput),{modelValue:vue.unref(ne),"onUpdate:modelValue":ue[0]||(ue[0]=de=>vue.isRef(ne)?ne.value=de:null),placeholder:"搜索字段",class:"mb-2"},null,8,["modelValue"]),vue.createElementVNode("div",_hoisted_1$16,[(vue.openBlock(!0),vue.createElementBlock(vue.Fragment,null,vue.renderList(vue.unref(re),de=>(vue.openBlock(),vue.createElementBlock("div",{class:vue.normalizeClass(["field-item",{active:se.modelValue.some(fe=>fe.identifier==de.identifier)}]),key:de.identifier},[vue.createElementVNode("div",_hoisted_2$X,[vue.createElementVNode("div",{class:"flex items-center flex-1 overflow-hidden",onClick:fe=>oe(de)},[vue.createElementVNode("i",{class:vue.normalizeClass([se.iconMap[de.dataType],"mr-2"])},null,2),vue.createElementVNode("span",_hoisted_4$N,vue.toDisplayString(de.columnComment),1)],8,_hoisted_3$P),se.modelValue.some(fe=>fe.identifier==de.identifier)?(vue.openBlock(),vue.createElementBlock("div",_hoisted_5$D,[["date","datetime"].includes(de.dataType)?(vue.openBlock(),vue.createBlock(vue.unref(elementPlus.ElDropdown),{key:0,trigger:"hover",onCommand:fe=>ae(fe,de)},{dropdown:vue.withCtx(()=>[vue.createVNode(vue.unref(elementPlus.ElDropdownMenu),null,{default:vue.withCtx(()=>[(vue.openBlock(!0),vue.createElementBlock(vue.Fragment,null,vue.renderList(se.calendarType,(fe,ve)=>(vue.openBlock(),vue.createBlock(vue.unref(elementPlus.ElDropdownItem),{command:ve,key:fe},{default:vue.withCtx(()=>[vue.createTextVNode(vue.toDisplayString(fe),1)]),_:2},1032,["command"]))),128))]),_:1})]),default:vue.withCtx(()=>[vue.createElementVNode("span",_hoisted_6$y,vue.toDisplayString(se.calendarType[de.dateFormatType]),1)]),_:2},1032,["onCommand"])):vue.createCommentVNode("",!0),vue.createElementVNode("i",{class:"cursor-pointer ri-close-line",onClick:vue.withModifiers(fe=>le(de),["stop"])},null,8,_hoisted_7$u)])):vue.createCommentVNode("",!0)]),!se.modelValue.some(fe=>fe.identifier==de.identifier)&&se.modelValue.length?(vue.openBlock(),vue.createElementBlock("div",_hoisted_8$q,[vue.createElementVNode("i",{class:"text-gray-800 cursor-pointer ri-add-line",onClick:vue.withModifiers(fe=>ie(de),["stop"])},null,8,_hoisted_9$n)])):vue.createCommentVNode("",!0)],2))),128))])]),_:1},8,["loading"])],64)}}}),modelTableDimension_vue_vue_type_style_index_0_scoped_17c71fa7_lang="",modelTableDimension=_export_sfc$2(_sfc_main$1j,[["__scopeId","data-v-17c71fa7"]]),_withScopeId$r=te=>(vue.pushScopeId("data-v-449a4f14"),te=te(),vue.popScopeId(),te),_hoisted_1$15={class:"mb-2"},_hoisted_2$W=_withScopeId$r(()=>vue.createElementVNode("div",{class:"mb-2 font-bold"},"公式名称:",-1)),_hoisted_3$O={class:"relative mt-4 mb-4"},_hoisted_4$M={class:"mb-2 font-bold"},_hoisted_5$C={class:"ml-2 text-color-primary"},_hoisted_6$x={key:0,class:"selection el-popper is-light el-popover","data-popper-placement":"bottom"},_hoisted_7$t=_withScopeId$r(()=>vue.createElementVNode("div",null,"选择变量",-1)),_hoisted_8$p={class:"mt-2"},_hoisted_9$m=_withScopeId$r(()=>vue.createElementVNode("span",{class:"el-popper__arrow","data-popper-arrow":""},null,-1)),validKeys="0123456789+-*/@.()",_sfc_main$1i=vue.defineComponent({__name:"model-exp",props:{options:{default:()=>[]}},emits:["success"],setup(te,{expose:U,emit:G}){const{proxy:ee}=vue.getCurrentInstance(),ne=vue.ref(!1),re=te,oe=G,ie=vue.ref(""),le=vue.ref(null),ae=Ve=>{const{key:Se}=Ve;switch(Se){case"Enter":Ve.preventDefault();break;case"@":case"Process":de();break}};let se=null;const ue=()=>{const Ve=vue.unref(le).innerHTML;let Se=xe(Ve.replace(/<br>/g,""));Se=Se.map(Ne=>$e(Ne)?Ce(Ne):Ne.data.split("").filter(Ie=>validKeys.includes(Ie)).join(""));const ke=Se.join("");if(Ve!==ke){const Ne=we(Ve,ke);vue.unref(le).innerHTML=ke,Ee(vue.unref(le),Ne)}clearTimeout(se),se=setTimeout(async()=>{_e()},500)},ce=vue.ref(!1),de=()=>{ce.value=!0},fe=Ve=>{const{identifier:Se,columnComment:ke}=Ve;ce.value=!1;const Ne=`<div contenteditable="false">${ke}<span>${Se}</span></div>`;ge("@",Ne)},ve=vue.ref(null),he=Ve=>{if(ve.value=Ve,ie.value="",ne.value=!0,Ve){const Se=JSON.parse(JSON.stringify(Ve.data));let ke=Se.exp??"";ie.value=Se.comment,Se.identifier.split(",").forEach(Ne=>{const Ie=new RegExp(Ne,"g"),Pe=re.options.find(Te=>Te.identifier==Ne);if(Pe){const Te=`<div contenteditable="false">${Pe.columnComment}<span>${Ne}</span></div>`;ke=ke.replace(Ie,(De,Oe,Be)=>{const Ae=De.length,Le=Be.slice(Oe-1,Ae+Oe+1);return Le.startsWith("_")||Le.endsWith("_")?Ne:Te})}}),vue.nextTick(()=>{vue.unref(le).innerHTML=ke.replace(/@/g,""),setTimeout(()=>{_e()},100)})}},pe=()=>{var Ve,Se;if(!((Ve=vue.unref(me))!=null&&Ve.exp)){ee.$message({type:"warning",message:"公式不能为空",plain:!0});return}if(vue.unref(ie)==""){ee.$message({type:"warning",message:"公式名称不能为空",plain:!0});return}oe("success",{...vue.unref(me),aggType:"exp",comment:vue.unref(ie),showLabel:vue.unref(ie)},((Se=vue.unref(ve))==null?void 0:Se.index)??""),ne.value=!1},ge=(Ve,Se="")=>{if(!vue.unref(le))return;let ke=vue.unref(le).innerHTML;ke.includes(Ve)&&(ke=ke.replace(new RegExp(Ve,"g"),Se),vue.unref(le).innerHTML=ke),_e()},me=vue.ref({}),_e=()=>{let Ve="";const Se=[],ke=vue.unref(le).innerHTML.replace(/\sdata-spm-anchor-id=".*?"/g,"");ye({text:ke,prefix:'<div contenteditable="false">',suffix:"</div>"}).forEach(Ie=>{const[Pe,Te]=ye({text:Ie,prefix:"<span>",suffix:"</span>"});Te?(Ve+=`@${Te}`,Se.push(Te)):Ve+=Pe}),me.value={exp:Ve,identifier:Se.toString()}},be=Ve=>{ce.value=!1,Ve&&ge("@")};vue.onMounted(()=>window.addEventListener("click",be)),vue.onBeforeUnmount(()=>window.removeEventListener("click",be)),U({init:he});const ye=({text:Ve,prefix:Se,suffix:ke})=>Ve.replace(new RegExp(Se,"g"),",").replace(new RegExp(ke,"g"),",").split(",").filter(Ne=>!!Ne),xe=Ve=>{const Se=document.createElement("div");return Se.innerHTML=Ve,[...Se.childNodes]},Ce=Ve=>{let Se=document.createElement("div");Se.appendChild(Ve);let ke=Se.innerHTML;return Se=Ve=null,ke},$e=Ve=>Object.prototype.toString.call(Ve)==="[object HTMLDivElement]",we=(Ve,Se)=>{const ke=Ve.split(""),Ne=Se.split(""),Ie=Math.max(ke.length,Ne.length);let Pe=0;for(let Te=0;Te<Ie&&ke[Te]==Ne[Te];Te++)Pe++;return Pe},Ee=(Ve,Se)=>{const ke=document.createRange(),Ne=window.getSelection();let Ie=0,Pe=0;const Te=xe(Ve.innerHTML);for(let De=0;De<Te.length;De++){const Oe=Te[De];if($e(Oe))Se-=Ce(Oe).length;else if(Se>Oe.length)Se-=Oe.length;else{Pe=Se;break}Ie++}ke.selectNodeContents(Ve),ke.collapse(!1),Ve.childNodes[Ie]&&ke.setStart(Ve.childNodes[Ie],Pe),ke.collapse(!0),Ne.removeAllRanges(),Ne.addRange(ke)};return(Ve,Se)=>{const ke=vue.resolveComponent("AppDialog");return vue.openBlock(),vue.createBlock(ke,{modelValue:vue.unref(ne),"onUpdate:modelValue":Se[2]||(Se[2]=Ne=>vue.isRef(ne)?ne.value=Ne:null),title:"计算公式",size:800},{footer:vue.withCtx(()=>[vue.createVNode(vue.unref(elementPlus.ElButton),{class:"ml-3",type:"primary",onClick:pe},{default:vue.withCtx(()=>[vue.createTextVNode("保存")]),_:1}),vue.createVNode(vue.unref(elementPlus.ElButton),{class:"ml-3",onClick:Se[1]||(Se[1]=Ne=>ne.value=!1)},{default:vue.withCtx(()=>[vue.createTextVNode("取消")]),_:1})]),default:vue.withCtx(()=>[vue.createElementVNode("div",_hoisted_1$15,[_hoisted_2$W,vue.createVNode(vue.unref(elementPlus.ElInput),{modelValue:vue.unref(ie),"onUpdate:modelValue":Se[0]||(Se[0]=Ne=>vue.isRef(ie)?ie.value=Ne:null),placeholder:"请输入公式名称"},null,8,["modelValue"])]),vue.createElementVNode("div",_hoisted_3$O,[vue.createElementVNode("div",_hoisted_4$M,[vue.createTextVNode(" 公式: "),vue.createElementVNode("span",_hoisted_5$C,vue.toDisplayString(vue.unref(me).exp),1)]),vue.createElementVNode("div",{ref_key:"formulaRef",ref:le,class:"flex-1 formula",contenteditable:"",placeholder:"请输入表达式 输入「@」后选择指标",style:{"ime-mode":"disabled"},onKeydown:vue.withModifiers(ae,["stop"]),onKeyup:ue},null,544),vue.unref(ce)?(vue.openBlock(),vue.createElementBlock("div",_hoisted_6$x,[_hoisted_7$t,vue.createElementVNode("div",_hoisted_8$p,[(vue.openBlock(!0),vue.createElementBlock(vue.Fragment,null,vue.renderList(re.options,Ne=>(vue.openBlock(),vue.createBlock(vue.unref(elementPlus.ElTag),{class:"m-2 cursor-pointer",onClick:Ie=>fe(Ne),key:Ne.identifier,type:"primary"},{default:vue.withCtx(()=>[vue.createTextVNode(vue.toDisplayString(Ne.columnComment),1)]),_:2},1032,["onClick"]))),128))]),_hoisted_9$m])):vue.createCommentVNode("",!0)])]),_:1},8,["modelValue"])}}}),modelExp_vue_vue_type_style_index_0_scoped_449a4f14_lang="",ModelExp=_export_sfc$2(_sfc_main$1i,[["__scopeId","data-v-449a4f14"]]),_withScopeId$q=te=>(vue.pushScopeId("data-v-216c5764"),te=te(),vue.popScopeId(),te),_hoisted_1$14={key:0},_hoisted_2$V=_withScopeId$q(()=>vue.createElementVNode("div",{class:"mb-2 text-sm indicators-title"},[vue.createElementVNode("i",{class:"mr-1 ri-table-line"}),vue.createTextVNode(" 基本指标 ")],-1)),_hoisted_3$N=["onClick"],_hoisted_4$L=_withScopeId$q(()=>vue.createElementVNode("i",{class:"ri-lightbulb-line"},null,-1)),_hoisted_5$B={key:1},_hoisted_6$w={class:"flex items-center mb-2 text-sm indicators-title"},_hoisted_7$s={class:"overflow-y-auto max-h-96"},_hoisted_8$o=["onClick"],_hoisted_9$l={class:"field-label"},_hoisted_10$i=_withScopeId$q(()=>vue.createElementVNode("i",{class:"ri-add-fill"},null,-1)),_sfc_main$1h=vue.defineComponent({__name:"model-table-summary",props:{modelValue:{default:()=>[]},iconMap:{default:()=>{}},list:{default:()=>[]}},emits:["update:modelValue"],setup(te,{emit:U}){const G=te,ee=U,{proxy:ne}=vue.getCurrentInstance();vue.inject("chartList");const re=vue.ref(!1),oe=vue.ref(1),ie=vue.ref(null),le=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:"可手动输入计算公式"}]);vue.watch(re,fe=>{fe&&(ue.value={},oe.value=1)});const ae=fe=>{ee("update:modelValue",G.modelValue.filter(ve=>ve.showLabel!==fe.showLabel))},se=(fe,ve)=>{fe.aggType=="exp"&&vue.unref(ie).init({data:fe,index:ve})},ue=vue.ref({}),ce=fe=>{if(fe.value==="count"){if(G.modelValue.some(ve=>ve.aggType==fe.value)){ne.$message({type:"warning",message:"存在重复数据",plain:!0});return}ee("update:modelValue",[...G.modelValue,{identifier:1,aggType:fe.value,showLabel:fe.label}]),re.value=!1;return}if(fe.value=="exp"){vue.unref(ie).init();return}oe.value=2,ue.value=fe},de=fe=>{var ve,he;if(G.modelValue.some(pe=>{var ge;return pe.identifier==fe.identifier&&pe.aggType==((ge=vue.unref(ue))==null?void 0:ge.value)})){ne.$message({type:"warning",message:"存在重复数据",plain:!0});return}re.value=!1,ee("update:modelValue",[...G.modelValue,{identifier:fe.identifier,comment:fe.columnComment,aggType:(ve=vue.unref(ue))==null?void 0:ve.value,showLabel:fe.columnComment+((he=vue.unref(ue))==null?void 0:he.label)}])};return(fe,ve)=>{const he=vue.resolveComponent("aceHeader");return vue.openBlock(),vue.createElementBlock(vue.Fragment,null,[vue.createVNode(he,{title:"汇总方式",class:"mb-2"}),vue.createElementVNode("div",null,[(vue.openBlock(!0),vue.createElementBlock(vue.Fragment,null,vue.renderList(fe.modelValue,(pe,ge)=>(vue.openBlock(),vue.createBlock(vue.unref(elementPlus.ElTag),{key:pe.value,class:vue.normalizeClass(["m-1",[pe.aggType=="exp"?"cursor-pointer":""]]),closable:!0,onClick:me=>se(pe,ge),onClose:me=>ae(pe),type:"primary"},{default:vue.withCtx(()=>[vue.createTextVNode(vue.toDisplayString(pe.showLabel),1)]),_:2},1032,["onClick","class","onClose"]))),128)),vue.createVNode(vue.unref(elementPlus.ElPopover),{trigger:"click",width:"300px",placement:"top-start",visible:vue.unref(re),"onUpdate:visible":ve[1]||(ve[1]=pe=>vue.isRef(re)?re.value=pe:null)},{reference:vue.withCtx(()=>[vue.createVNode(vue.unref(elementPlus.ElButton),{type:"primary",class:"ml-1",size:"small"},{default:vue.withCtx(()=>[_hoisted_10$i,vue.createTextVNode(" "+vue.toDisplayString(fe.modelValue.length?"":"添加度量"),1)]),_:1})]),default:vue.withCtx(()=>[vue.unref(oe)==1?(vue.openBlock(),vue.createElementBlock("div",_hoisted_1$14,[_hoisted_2$V,(vue.openBlock(!0),vue.createElementBlock(vue.Fragment,null,vue.renderList(vue.unref(le),pe=>(vue.openBlock(),vue.createElementBlock("div",{onClick:ge=>ce(pe),key:pe.value,class:vue.normalizeClass([{active:vue.unref(ue).value==pe.value},"indicators-item"])},[vue.createTextVNode(vue.toDisplayString(pe.label)+" ",1),vue.createVNode(vue.unref(elementPlus.ElTooltip),{effect:"dark",content:pe.tip,placement:"top"},{default:vue.withCtx(()=>[_hoisted_4$L]),_:2},1032,["content"])],10,_hoisted_3$N))),128))])):vue.createCommentVNode("",!0),vue.unref(oe)==2?(vue.openBlock(),vue.createElementBlock("div",_hoisted_5$B,[vue.createElementVNode("div",_hoisted_6$w,[vue.createElementVNode("i",{class:"mr-1 text-xl cursor-pointer ri-arrow-left-s-line",onClick:ve[0]||(ve[0]=pe=>oe.value=1)}),vue.createTextVNode(" "+vue.toDisplayString(vue.unref(ue).label),1)]),vue.createElementVNode("div",_hoisted_7$s,[(vue.openBlock(!0),vue.createElementBlock(vue.Fragment,null,vue.renderList(fe.list,pe=>(vue.openBlock(),vue.createElementBlock("div",{onClick:ge=>de(pe),key:pe.identifier,class:"indicators-item"},[vue.createElementVNode("div",null,[vue.createElementVNode("i",{class:vue.normalizeClass([fe.iconMap[pe.dataType],"mr-2"])},null,2),vue.createElementVNode("span",_hoisted_9$l,vue.toDisplayString(pe.columnComment),1)])],8,_hoisted_8$o))),128))])])):vue.createCommentVNode("",!0)]),_:1},8,["visible"]),vue.createVNode(ModelExp,{ref_key:"modelPercentRef",ref:ie,options:G.list,onSuccess:ve[2]||(ve[2]=(pe,ge)=>ge?G.modelValue[ge]=pe:ee("update:modelValue",[...G.modelValue,pe]))},null,8,["options"])])],64)}}}),modelTableSummary_vue_vue_type_style_index_0_scoped_216c5764_lang="",modelTableSunmary=_export_sfc$2(_sfc_main$1h,[["__scopeId","data-v-216c5764"]]),_sfc_main$1g=vue.defineComponent({__name:"chart-list-widget",props:{type:{default:""}},setup(te){const{proxy:U}=vue.getCurrentInstance(),G=vue.inject("chartList"),ee=ne=>{U.$baseEventBus.emit("model-chart-click",ne)};return(ne,re)=>(vue.openBlock(!0),vue.createElementBlock(vue.Fragment,null,vue.renderList(vue.unref(G),oe=>(vue.openBlock(),vue.createBlock(vue.unref(elementPlus.ElButton),{type:ne.type==oe.type?"primary":"",key:oe.type,onClick:ie=>ee(oe)},{default:vue.withCtx(()=>{var ie;return[vue.createElementVNode("i",{class:vue.normalizeClass((ie=vue.unref(echartsTypeList)[oe.type])==null?void 0:ie.icon)},null,2)]}),_:2},1032,["type","onClick"]))),128))}}),_withScopeId$p=te=>(vue.pushScopeId("data-v-ad68cd37"),te=te(),vue.popScopeId(),te),_hoisted_1$13={class:"overflow-y-auto max-h-96"},_hoisted_2$U=["onClick"],_hoisted_3$M={class:"field-label"},_hoisted_4$K=_withScopeId$p(()=>vue.createElementVNode("i",{class:"ri-add-fill"},null,-1)),_sfc_main$1f=vue.defineComponent({__name:"model-table-other-summary",props:{modelValue:{default:()=>[]},iconMap:{default:()=>{}},list:{default:()=>[]}},emits:["update:modelValue"],setup(te,{emit:U}){const G=te,ee=U,{proxy:ne}=vue.getCurrentInstance();vue.inject("chartList");const re=vue.ref(!1);vue.ref(null);const oe=le=>{ee("update:modelValue",G.modelValue.filter(ae=>ae.showLabel!==le.showLabel))},ie=le=>{if(G.modelValue.some(ae=>ae.identifier==le.identifier)){ne.$message({type:"warning",message:"存在重复数据",plain:!0});return}re.value=!1,ee("update:modelValue",[...G.modelValue,{identifier:le.identifier,comment:le.columnComment,aggType:"other",showLabel:le.columnComment}])};return(le,ae)=>{const se=vue.resolveComponent("aceHeader");return vue.openBlock(),vue.createElementBlock(vue.Fragment,null,[vue.createVNode(se,{title:"显示其他列",class:"mt-2 mb-2"}),vue.createElementVNode("div",null,[(vue.openBlock(!0),vue.createElementBlock(vue.Fragment,null,vue.renderList(le.modelValue,(ue,ce)=>(vue.openBlock(),vue.createBlock(vue.unref(elementPlus.ElTag),{key:ue.value,class:"m-1",closable:!0,onClose:de=>oe(ue),type:"primary"},{default:vue.withCtx(()=>[vue.createTextVNode(vue.toDisplayString(ue.showLabel),1)]),_:2},1032,["onClose"]))),128)),vue.createVNode(vue.unref(elementPlus.ElPopover),{trigger:"click",width:"300px",placement:"top-start",visible:vue.unref(re),"onUpdate:visible":ae[0]||(ae[0]=ue=>vue.isRef(re)?re.value=ue:null)},{reference:vue.withCtx(()=>[vue.createVNode(vue.unref(elementPlus.ElButton),{type:"primary",class:"ml-1",size:"small"},{default:vue.withCtx(()=>[_hoisted_4$K]),_:1})]),default:vue.withCtx(()=>[vue.createElementVNode("div",_hoisted_1$13,[(vue.openBlock(!0),vue.createElementBlock(vue.Fragment,null,vue.renderList(le.list,ue=>(vue.openBlock(),vue.createElementBlock("div",{onClick:ce=>ie(ue),key:ue.identifier,class:"indicators-item"},[vue.createElementVNode("div",null,[vue.createElementVNode("i",{class:vue.normalizeClass([le.iconMap[ue.dataType],"mr-2"])},null,2),vue.createElementVNode("span",_hoisted_3$M,vue.toDisplayString(ue.columnComment),1)])],8,_hoisted_2$U))),128))])]),_:1},8,["visible"])])],64)}}}),modelTableOtherSummary_vue_vue_type_style_index_0_scoped_ad68cd37_lang="",ModelTableOtherSummary=_export_sfc$2(_sfc_main$1f,[["__scopeId","data-v-ad68cd37"]]),_withScopeId$o=te=>(vue.pushScopeId("data-v-3d6e6e94"),te=te(),vue.popScopeId(),te),_hoisted_1$12={class:"flex w-full h-full"},_hoisted_2$T={class:"flex flex-col flex-1 overflow-hidden"},_hoisted_3$L={class:"flex flex-col flex-1 pb-3 pr-3 overflow-y-auto"},_hoisted_4$J={key:0,class:"relative flex items-center justify-center pannel h-14"},_hoisted_5$A={class:"absolute left-5 top-3"},_hoisted_6$v=_withScopeId$o(()=>vue.createElementVNode("i",{class:"ml-1 ri-settings-2-line"},null,-1)),_hoisted_7$r=_withScopeId$o(()=>vue.createElementVNode("i",{class:"ri-table-line"},null,-1)),_hoisted_8$n={class:"absolute flex items-center right-5 top-4"},_hoisted_9$k=_withScopeId$o(()=>vue.createElementVNode("i",{class:"mr-1 ri-settings-2-line"},null,-1)),_hoisted_10$h={class:"ml-2 mr-2"},_hoisted_11$d={class:"flex flex-col"},_hoisted_12$b={class:"flex-1 overflow-y-auto"},_hoisted_13$9={key:0,class:"flex items-center justify-center pannel h-14"},_hoisted_14$8=_withScopeId$o(()=>vue.createElementVNode("i",{class:"mr-1 ri-save-line"},null,-1)),_sfc_main$1e=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(te,{expose:U,emit:G}){const ee=te,ne=G,re=screenDesignMainStore(),{proxy:oe}=vue.getCurrentInstance(),{setFormValue:ie,getFormValue:le}=oe.$globalHooks.useForm(),{dynamicSearchForm:ae,dynamicSearchFormat:se,dynamicSearchParams:ue}=oe.$aceDynamicSearch(),ce=vue.inject("modelEle"),de=vue.inject("getListModelIndicators");vue.inject("chartList");const fe={varchar:"ri-text",date:"ri-calendar-2-line",datetime:"ri-calendar-2-line",int:"ri-hashtag",decimal:"ri-hashtag"},ve={day:"按日",week:"按周",month:"按月",quarter:"按季度",year:"按年","":"按时分秒"},he=vue.ref(!1),pe=vue.ref(!0),ge=vue.ref(0),me=vue.ref([]),_e=vue.ref([]),be=vue.ref([]),ye=vue.ref([]),xe=vue.ref([]),Ce=vue.ref(!0),$e=vue.ref(!0),we=async Me=>{var We,Ue;Ce.value=!0,$e.value=!1;const ze=JSON.parse((Me==null?void 0:Me.groupArgsJson)??"[]"),Ge=JSON.parse((Me==null?void 0:Me.aggArgsJson)??JSON.stringify([{identifier:1,aggType:"count",showLabel:"行数"}]));ye.value=Ge.filter(qe=>qe.aggType!="other"),xe.value=Ge.filter(qe=>qe.aggType=="other"),ze.length||(Ce.value=!1),ge.value=(Me==null?void 0:Me.pageSize)??20,Te.value=JSON.parse((Me==null?void 0:Me.sortArgsJson)??"{}"),Me!=null&&Me.formConfJson?(ae.value=se(JSON.parse(Me.formConfJson??"[]")),ne("update:dynamicSearchForm",ae.value)):await fetch$1(oe).getFormJsonConfig((We=vue.unref(ce))==null?void 0:We.id).then(qe=>{var Ye;ae.value=se(JSON.parse(((Ye=qe.data)==null?void 0:Ye.formConfJson)??"[]"))}),ne("update:dynamicSearchForm",ae.value),ie(Me,Be),oe.$baseHttp.post("/api/ace-data-center/aidc/modelAnalysis",{projectId:oe.$baseGetCurrentProjectId(),modelId:(Ue=vue.unref(ce))==null?void 0:Ue.id,serialId:new Date().getTime()}).then(qe=>{pe.value=!1,me.value=qe.data.filter(Ye=>!["创建时间","创建人","所属项目","创建部门","标签"].includes(Ye.columnComment)).map(Ye=>({...Ye,dateFormatType:["date","datetime"].includes(Ye.dataType)?"day":""})),be.value=qe.data.filter(Ye=>["ADDABLE","SEMIADDABLE"].includes(Ye.quantityType)),ze.forEach(Ye=>{const Je=me.value.find(Xe=>Xe.identifier==Ye.identifier);Je&&(_e.value.push({...Je,dataType:Ye.dataType,dateFormatType:Ye.dateFormatType}),Je.dateFormatType=Ye.dateFormatType)}),Ce.value=!1,setTimeout(()=>{$e.value=!0},1e3)})};vue.watch([ye,_e,xe],()=>{vue.unref($e)&&(Te.value={}),Ie()},{deep:!0});let Ee=null;const Ve=vue.ref(null),Se=vue.ref(!1),ke=vue.ref([]),Ne=vue.ref([]),Ie=async()=>{clearTimeout(Ee),Ee=setTimeout(async()=>{var Ue,qe;Ne.value=[],re.setChartData([]);const Me=Pe(),ze=Object.keys(vue.unref(Te)).map(Ye=>({field:Ye,type:vue.unref(Te)[Ye]=="ascending"?"asc":"desc"})),Ge={aggArgsJson:JSON.stringify([...vue.unref(ye),...vue.unref(xe)]),groupArgsJson:JSON.stringify(Me),sortArgsJson:JSON.stringify(ze),params:ue(vue.unref(ae)),pageSize:vue.unref(ge),modelId:(Ue=vue.unref(ce))==null?void 0:Ue.id};if(ee.indicatorsId&&(Ge.modelIndicatorsId=ee.indicatorsId),ne("update:title",`${vue.unref(ye).length}个指标:${vue.unref(ye).length?"根据":""}${Me.map(Ye=>Ye.showLabel).toString()}${vue.unref(ye).length?"分组的":""}${vue.unref(ye).filter((Ye,Je)=>Je<3).map(Ye=>Ye.showLabel).toString()}${vue.unref(ye).length>3?"...":""}`),!vue.unref(ye).length||vue.unref(Ce)){ke.value=[];return}Se.value=!0;const We=await oe.$baseHttp.post("/api/ace-data-center/model-indicators/debug",Ge);Ve.value=Ge,Se.value=!1,We&&(ke.value=((qe=We.data)==null?void 0:qe.records)??[],re.setChartData({x:Me,y:[...vue.unref(ye),...vue.unref(xe)],params:Ge}),vue.unref(ke).length&&Object.keys(vue.unref(ke)[0]).forEach(Ye=>{Ne.value.push({label:Ye,prop:Ye,sortable:"custom"})}))})},Pe=()=>vue.unref(_e).map(Me=>({identifier:Me.identifier,comment:Me.columnComment,showLabel:Me.columnComment+(ve[Me.dateFormatType]??""),dateFormatType:Me.dateFormatType||null})),Te=vue.ref({}),De=({column:Me})=>{vue.unref(Te)[Me.property]&&(Me.order=vue.unref(Te)[Me.property])};vue.watch(Te,Me=>{const ze=Object.keys(Me).map(Ge=>`${Ge}${Me[Ge]=="descending"?"降序":"升序"}`);ne("update:sortHtml",ze.length?`<span class="text-color-warning">排序:${ze.toString()}</span>`:"")},{deep:!0});const Oe=Me=>{const{prop:ze,order:Ge}=Me;!Ge||vue.unref(Te)[ze]===Ge?delete vue.unref(Te)[ze]:vue.unref(Te)[ze]=Ge,Ie()};fetch$1(oe).loadIndicatorsMenu().then(Me=>{Be.find(ze=>ze.fieldName=="tags").options=Object.keys(Me.data).map(ze=>({label:ze,value:ze}))});const Be=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}]),Ae=vue.ref(!1),Le=()=>{Be.find(Me=>Me.fieldName=="remark").value=ee.title,Ae.value=!0},Re=async()=>{var Ue;const{params:Me,error:ze}=le(Be);if(ze.length>0)return;const Ge=Pe();if(!Ge.length||!vue.unref(ye).length){oe.$message({type:"warning",message:"计算维度或汇总方式不能为空",plain:!0});return}Me.code||(Me.code=nanoid()),Me.groupArgsJson=JSON.stringify(Ge),Me.aggArgsJson=JSON.stringify([...vue.unref(ye),...vue.unref(xe)]),Me.modelId=(Ue=vue.unref(ce))==null?void 0:Ue.id,Me.projectId=oe.$baseGetCurrentProjectId(),Me.pageSize=vue.unref(ge),Me.formConfJson=JSON.stringify(vue.unref(ae)),Me.sortArgsJson=JSON.stringify(vue.unref(Te)),ee.indicatorsId&&(Me.id=ee.indicatorsId),Ae.value=!1;const We=await oe.$baseHttp.post(`/api/ace-data-center/model-indicators/${ee.indicatorsId?"update":"save"}`,Me,{header:{loading:!0}});We&&(ee.indicatorsId||ne("update:indicatorsId",We.data),ne("update:resultTitle",Me.name),oe.$message({type:"success",message:"操作成功",plain:!0}),ie(Me,Be),de())},Fe=()=>{ne("update:modelValue","chart")},je=()=>{oe.$baseExportExcel({title:ee.title,url:"/api/ace-data-center/model-indicators/debug",header:vue.unref(Ne),customParams:vue.unref(Ve)})};return U({init:we,dynamicSearchForm:ae,handlePopupForm:Le,handleSubmit:Re}),(Me,ze)=>{var Xe,Ke;const Ge=vue.resolveComponent("aceDynamicSearch"),We=vue.resolveComponent("AppTable"),Ue=vue.resolveComponent("AppEmpty"),qe=vue.resolveComponent("aceDynamicList"),Ye=vue.resolveComponent("AppForm"),Je=vue.resolveComponent("AppDialog");return vue.openBlock(),vue.createElementBlock("div",_hoisted_1$12,[vue.createElementVNode("div",_hoisted_2$T,[vue.createElementVNode("div",_hoisted_3$L,[vue.unref(ye).length?(vue.openBlock(),vue.createElementBlock(vue.Fragment,{key:0},[vue.createVNode(Ge,{form:vue.unref(ae),onSuccess:ze[0]||(ze[0]=He=>Ie())},null,8,["form"]),vue.createVNode(vue.unref(elementPlus.ElSkeleton),{loading:vue.unref(Se),animated:""},{default:vue.withCtx(()=>[vue.unref(Ne).length?(vue.openBlock(),vue.createBlock(We,{key:0,tableData:vue.unref(Ne),list:vue.unref(ke),loading:!1,headerCellClassName:De,onSortChange:Oe},null,8,["tableData","list"])):(vue.openBlock(),vue.createBlock(Ue,{key:1,description:"暂无数据",class:"mt-4"}))]),_:1},8,["loading"])],64)):(vue.openBlock(),vue.createBlock(qe,{key:1,id:(Xe=vue.unref(ce))==null?void 0:Xe.id,title:(Ke=vue.unref(ce))==null?void 0:Ke.modelName,showPageIndex:!0},null,8,["id","title"]))]),vue.unref(ye).length?(vue.openBlock(),vue.createElementBlock("div",_hoisted_4$J,[vue.createElementVNode("div",_hoisted_5$A,[vue.createVNode(vue.unref(elementPlus.ElTooltip),{effect:"dark",content:"保存汇总配置后可设置",placement:"top",visible:vue.unref(he)},{default:vue.withCtx(()=>[vue.createVNode(vue.unref(elementPlus.ElButton),{disabled:Me.indicatorsId=="",type:"warning",style:{padding:"0 10px"},onMouseenter:ze[1]||(ze[1]=He=>{Me.indicatorsId||(he.value=!0)}),onMouseleave:ze[2]||(ze[2]=He=>he.value=!1),onClick:Fe},{default:vue.withCtx(()=>[vue.createTextVNode(" 图表配置 "),_hoisted_6$v]),_: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$r]),_:1}),vue.createVNode(_sfc_main$1g)]),_:1}),vue.createElementVNode("div",_hoisted_8$n,[vue.createVNode(vue.unref(elementPlus.ElLink),{type:"primary"},{default:vue.withCtx(()=>[_hoisted_9$k,vue.createTextVNode(" 显示前 "),vue.createElementVNode("div",_hoisted_10$h,[vue.createVNode(vue.unref(elementPlus.ElInputNumber),{size:"small",style:{width:"100px"},modelValue:vue.unref(ge),"onUpdate:modelValue":ze[3]||(ze[3]=He=>vue.isRef(ge)?ge.value=He:null),onChange:ze[4]||(ze[4]=He=>Ie()),min:1,max:9999999},null,8,["modelValue"])]),vue.createTextVNode(" 条聚合数据 ")]),_:1}),vue.unref(Ne).length?(vue.openBlock(),vue.createElementBlock("i",{key:0,class:"ml-2 cursor-pointer ri-download-2-line text-color-warning",onClick:je})):vue.createCommentVNode("",!0)])])):vue.createCommentVNode("",!0)]),vue.createElementVNode("aside",_hoisted_11$d,[vue.createElementVNode("div",_hoisted_12$b,[vue.createVNode(modelTableSunmary,{list:vue.unref(be),modelValue:vue.unref(ye),"onUpdate:modelValue":ze[5]||(ze[5]=He=>vue.isRef(ye)?ye.value=He:null),iconMap:fe},null,8,["list","modelValue"]),vue.createVNode(ModelTableOtherSummary,{iconMap:fe,list:vue.unref(me),modelValue:vue.unref(xe),"onUpdate:modelValue":ze[6]||(ze[6]=He=>vue.isRef(xe)?xe.value=He:null)},null,8,["list","modelValue"]),vue.withDirectives(vue.createElementVNode("div",null,[vue.createVNode(modelTableDimension,{loading:vue.unref(pe),list:vue.unref(me),iconMap:fe,calendarType:ve,modelValue:vue.unref(_e),"onUpdate:modelValue":ze[7]||(ze[7]=He=>vue.isRef(_e)?_e.value=He:null)},null,8,["loading","list","modelValue"])],512),[[vue.vShow,vue.unref(ye).length]])]),vue.unref(ye).length?(vue.openBlock(),vue.createElementBlock("div",_hoisted_13$9,[vue.createVNode(vue.unref(elementPlus.ElButton),{type:"primary",onClick:Le},{default:vue.withCtx(()=>[_hoisted_14$8,vue.createTextVNode(" 完 成 ")]),_:1})])):vue.createCommentVNode("",!0),vue.createVNode(Je,{modelValue:vue.unref(Ae),"onUpdate:modelValue":ze[9]||(ze[9]=He=>vue.isRef(Ae)?Ae.value=He:null),title:"保存指标",size:800},{footer:vue.withCtx(()=>[vue.createVNode(vue.unref(elementPlus.ElButton),{class:"ml-3",type:"primary",onClick:Re},{default:vue.withCtx(()=>[vue.createTextVNode("保存")]),_:1}),vue.createVNode(vue.unref(elementPlus.ElButton),{class:"ml-3",onClick:ze[8]||(ze[8]=He=>Ae.value=!1)},{default:vue.withCtx(()=>[vue.createTextVNode("取消")]),_:1})]),default:vue.withCtx(()=>[vue.createVNode(Ye,{form:vue.unref(Be),col:1},null,8,["form"])]),_:1},8,["modelValue"])])])}}}),tableWidget_vue_vue_type_style_index_0_scoped_3d6e6e94_lang="",tableWidget=_export_sfc$2(_sfc_main$1e,[["__scopeId","data-v-3d6e6e94"]]),_withScopeId$n=te=>(vue.pushScopeId("data-v-6fadb38d"),te=te(),vue.popScopeId(),te),_hoisted_1$11={class:"flex flex-wrap chart-container"},_hoisted_2$S=["onClick"],_hoisted_3$K=["onClick"],_hoisted_4$I=_withScopeId$n(()=>vue.createElementVNode("i",{class:"ml-1 ri-settings-2-line"},null,-1)),_hoisted_5$z=[_hoisted_4$I],_hoisted_6$u={key:0,class:"success setting"},_hoisted_7$q=_withScopeId$n(()=>vue.createElementVNode("i",{class:"ml-1 ri-check-line"},null,-1)),_hoisted_8$m=[_hoisted_7$q],_hoisted_9$j={class:"label"},_sfc_main$1d=vue.defineComponent({__name:"model-chart-menu",props:{modelValue:{default:""}},emits:["click-chart-setting","update:modelValue"],setup(te,{emit:U}){vue.getCurrentInstance();const G=[{...echartsTypeList[3],key:"3"},...Object.keys(echartsTypeList).filter(ie=>ie!="3").map(ie=>({...echartsTypeList[ie],key:ie}))],ee=vue.inject("chartList"),ne=U,re=ie=>{ne("update:modelValue",String(ie))},oe=ie=>{ne("update:modelValue",String(ie)),ne("click-chart-setting")};return(ie,le)=>(vue.openBlock(),vue.createElementBlock("div",_hoisted_1$11,[(vue.openBlock(),vue.createElementBlock(vue.Fragment,null,vue.renderList(G,ae=>{var se;return vue.createElementVNode("div",{class:"items",key:ae.key,onClick:ue=>re(ae.key)},[vue.createElementVNode("div",{class:vue.normalizeClass(["icon",{active:ie.modelValue==ae.key}])},[vue.createElementVNode("i",{class:vue.normalizeClass(ae.icon)},null,2),vue.createElementVNode("div",{class:"setting",onClick:vue.withModifiers(ue=>oe(ae.key),["stop"])},_hoisted_5$z,8,_hoisted_3$K),(se=vue.unref(ee))!=null&&se.some(ue=>ue.type==ae.key)?(vue.openBlock(),vue.createElementBlock("div",_hoisted_6$u,_hoisted_8$m)):vue.createCommentVNode("",!0)],2),vue.createElementVNode("div",_hoisted_9$j,vue.toDisplayString(ae.name),1)],8,_hoisted_2$S)}),64))]))}}),modelChartMenu_vue_vue_type_style_index_0_scoped_6fadb38d_lang="",modelChartMenu=_export_sfc$2(_sfc_main$1d,[["__scopeId","data-v-6fadb38d"]]),_sfc_main$1c=vue.defineComponent({__name:"model-chart-setting",props:{option:{default:{}},type:{default:""}},emits:["close"],setup(te,{expose:U,emit:G}){const ee=te,ne=G,{proxy:re}=vue.getCurrentInstance(),oe=vue.ref(""),ie=vue.inject("indicatorsId"),le=vue.inject("getListModelIndicators"),ae=vue.inject("getChartWidgetList"),se=vue.computed(()=>({3:_sfc_main$1G,2:_sfc_main$1E,1:_sfc_main$1F,4:_sfc_main$1B,5:_sfc_main$1D,6:_sfc_main$1C,7:_sfc_main$1A,8:_sfc_main$1z,9:_sfc_main$1y})[ee.type]??null),ue=vue.ref(!1),ce=()=>{oe.value="data",ue.value=!0},de=async()=>{ee.option.tooltip&&(delete ee.option.tooltip.valueFormatter,delete ee.option.tooltip.formatter),ee.type=="9"&&delete ee.option.series[2].label.formatter,await re.$baseHttp.post("/api/ace-data-center/model-indicators-echarts/save",{modelIndicatorsId:vue.unref(ie),echartsType:ee.type,echartsConfig:chartJsonToStringFormat({...ee.option,customSeriesData:window.customSeriesData,dataset:{...ee.option.dataset,source:[]}})},{headers:{loading:!0}})&&(re.$message({type:"success",message:"操作成功",plain:!0}),await ae(),await le(),ue.value=!1,ne("close"))},fe=()=>{ue.value=!1};return U({init:ce,handleSubmit:de}),(ve,he)=>{const pe=vue.resolveComponent("AppDrawer");return vue.openBlock(),vue.createBlock(pe,{modelValue:vue.unref(ue),"onUpdate:modelValue":he[3]||(he[3]=ge=>vue.isRef(ue)?ue.value=ge:null),withHeader:!1,modal:!1,direction:"ltr",size:"300px",modalClass:"ace-modal-drawer"},{footer:vue.withCtx(()=>[vue.createVNode(vue.unref(elementPlus.ElButton),{type:"primary",onClick:he[1]||(he[1]=ge=>de())},{default:vue.withCtx(()=>[vue.createTextVNode("保存")]),_:1}),vue.createVNode(vue.unref(elementPlus.ElButton),{class:"ml-3",onClick:he[2]||(he[2]=ge=>fe())},{default:vue.withCtx(()=>[vue.createTextVNode("关闭")]),_:1})]),default:vue.withCtx(()=>[vue.createVNode(vue.unref(elementPlus.ElCollapse),{accordion:"",modelValue:vue.unref(oe),"onUpdate:modelValue":he[0]||(he[0]=ge=>vue.isRef(oe)?oe.value=ge:null)},{default:vue.withCtx(()=>[vue.unref(se)?(vue.openBlock(),vue.createBlock(vue.unref(se),{key:0,option:ee.option,type:ve.type},null,8,["option","type"])):vue.createCommentVNode("",!0)]),_:1},8,["modelValue"])]),_:1},8,["modelValue"])}}}),modelChartSetting_vue_vue_type_style_index_0_scoped_b48a9fb7_lang="",modelChartSetting=_export_sfc$2(_sfc_main$1c,[["__scopeId","data-v-b48a9fb7"]]),_withScopeId$m=te=>(vue.pushScopeId("data-v-7094027b"),te=te(),vue.popScopeId(),te),_hoisted_1$10={class:"flex w-full h-full"},_hoisted_2$R={class:"flex-1"},_hoisted_3$J={key:0,class:"flex items-center justify-center pannel h-14"},_hoisted_4$H=_withScopeId$m(()=>vue.createElementVNode("i",{class:"mr-1 ri-save-line"},null,-1)),_hoisted_5$y={class:"flex flex-col flex-1 overflow-hidden"},_hoisted_6$t={class:"relative flex flex-col flex-1 pb-3 pl-3"},_hoisted_7$p={class:"mb-2.5"},_hoisted_8$l={class:"relative flex items-center justify-center pannel h-14"},_hoisted_9$i={key:0,class:"absolute left-5 top-3"},_hoisted_10$g=_withScopeId$m(()=>vue.createElementVNode("i",{class:"ml-1 ri-settings-2-line"},null,-1)),_hoisted_11$c=_withScopeId$m(()=>vue.createElementVNode("i",{class:"ri-table-line"},null,-1)),_sfc_main$1b=vue.defineComponent({__name:"chart-widget",props:{modelValue:{default:""},dynamicSearchForm:{default:()=>[]}},emits:["update:modelValue"],setup(te,{expose:U,emit:G}){const ee=G,{proxy:ne}=vue.getCurrentInstance(),re=vue.inject("chartList"),{option:oe,formatChart:ie}=useCustomChart(),le=vue.ref(""),ae=vue.ref(null),se=vue.ref(!1),ue=()=>{if(vue.unref(le)==""){ne.$message({type:"warning",message:"请选择图表",plain:!0});return}const he=setInterval(()=>{vue.unref(se)&&(vue.unref(ae).init(),clearInterval(he))},20)};vue.watch(le,async he=>{var ge;if(oe.value={},se.value=!1,he==""){se.value=!0;return}const pe=(ge=vue.unref(re))==null?void 0:ge.find(me=>me.type==he);await ie((pe==null?void 0:pe.code)??"",he),se.value=!0});const ce=vue.ref(!1);ne.$baseEventBus.on("model-chart-click",async he=>{ce.value=!0,ee("update:modelValue","chart"),le.value=he.type,setTimeout(()=>{ce.value=!1},100)});const de=()=>{if(vue.unref(re).length>0){vue.unref(ce)||(le.value=vue.unref(re)[0].type),se.value=!0;return}le.value="3"},fe=()=>{const he=le.value;le.value="",setTimeout(()=>{le.value=he},10)},ve=()=>{le.value="",ee("update:modelValue","table")};return U({init:de}),(he,pe)=>{var _e;const ge=vue.resolveComponent("aceDynamicSearch"),me=vue.resolveComponent("aceCustomChart");return vue.openBlock(),vue.createElementBlock("div",_hoisted_1$10,[vue.createElementVNode("aside",null,[vue.createElementVNode("div",_hoisted_2$R,[vue.createVNode(modelChartMenu,{modelValue:vue.unref(le),"onUpdate:modelValue":pe[0]||(pe[0]=be=>vue.isRef(le)?le.value=be:null),onClickChartSetting:ue},null,8,["modelValue"])]),(_e=vue.unref(re))!=null&&_e.some(be=>be.type==vue.unref(le))?vue.createCommentVNode("",!0):(vue.openBlock(),vue.createElementBlock("div",_hoisted_3$J,[vue.createVNode(vue.unref(elementPlus.ElButton),{type:"primary",onClick:pe[1]||(pe[1]=be=>vue.unref(ae).handleSubmit())},{default:vue.withCtx(()=>[_hoisted_4$H,vue.createTextVNode(" 保 存 ")]),_:1})]))]),vue.createElementVNode("div",_hoisted_5$y,[vue.createElementVNode("div",_hoisted_6$t,[vue.createVNode(vue.unref(elementPlus.ElSkeleton),{loading:!vue.unref(se),animated:""},{default:vue.withCtx(()=>[vue.createElementVNode("div",_hoisted_7$p,[vue.createVNode(ge,{form:he.dynamicSearchForm,search:!1,disabled:""},null,8,["form"])]),vue.createVNode(me,{option:vue.unref(oe),chartType:vue.unref(le)},null,8,["option","chartType"])]),_:1},8,["loading"])]),vue.createElementVNode("div",_hoisted_8$l,[vue.unref(oe)?(vue.openBlock(),vue.createElementBlock("div",_hoisted_9$i,[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:ue},{default:vue.withCtx(()=>[_hoisted_10$g]),_:1})]),_:1})])):vue.createCommentVNode("",!0),vue.createVNode(vue.unref(elementPlus.ElButtonGroup),null,{default:vue.withCtx(()=>[vue.createVNode(vue.unref(elementPlus.ElButton),{type:"",onClick:ve},{default:vue.withCtx(()=>[_hoisted_11$c]),_:1}),vue.createVNode(_sfc_main$1g,{type:vue.unref(le)},null,8,["type"])]),_:1})])]),vue.unref(le)?(vue.openBlock(),vue.createBlock(modelChartSetting,{key:0,ref_key:"modelChartSettingRef",ref:ae,option:vue.unref(oe),type:vue.unref(le),onClose:fe},null,8,["option","type"])):vue.createCommentVNode("",!0)])}}}),chartWidget_vue_vue_type_style_index_0_scoped_7094027b_lang="",chartWidget=_export_sfc$2(_sfc_main$1b,[["__scopeId","data-v-7094027b"]]),_withScopeId$l=te=>(vue.pushScopeId("data-v-e26b4ea0"),te=te(),vue.popScopeId(),te),_hoisted_1$$={class:"design"},_hoisted_2$Q={class:"design-header"},_hoisted_3$I={class:"flex-1"},_hoisted_4$G={class:"mt-2 text-xs text-color-info"},_hoisted_5$x=["innerHTML"],_hoisted_6$s={class:"flex"},_hoisted_7$o={class:"mr-2"},_hoisted_8$k=_withScopeId$l(()=>vue.createElementVNode("i",{class:"mr-1 ri-settings-2-line"},null,-1)),_hoisted_9$h=_withScopeId$l(()=>vue.createElementVNode("i",{class:"mr-1 ri-close-line"},null,-1)),_hoisted_10$f={class:"flex flex-1 p-3 overflow-hidden design-container"},_sfc_main$1a=vue.defineComponent({__name:"index",emits:["close"],setup(te,{expose:U,emit:G}){screenDesignMainStore();const{proxy:ee}=vue.getCurrentInstance(),ne=vue.ref(!1),re=vue.ref(!1),oe=vue.ref(),ie=vue.ref(null),le=vue.ref(null),ae=vue.ref(null),se=vue.ref([]),ue=vue.ref("0个指标"),ce=vue.ref(""),de=vue.ref(""),fe=vue.ref([]),ve=G;vue.watch(ne,xe=>{xe||ee.$baseEventBus.off("model-chart-click")}),vue.provide("indicatorsId",de);const he=vue.inject("modelEle"),pe=vue.ref(""),ge=async xe=>{var $e;let Ce={};oe.value="table",de.value=xe,fe.value=[],se.value=[],vue.unref(de)&&(Ce=await me(),_e()),ne.value=!0,pe.value=($e=Ce==null?void 0:Ce.data)==null?void 0:$e.name,vue.nextTick(()=>{vue.unref(ie).init((Ce==null?void 0:Ce.data)??{})})};vue.watch(oe,xe=>{xe=="chart"&&vue.unref(le).init()});const me=async()=>await ee.$baseHttp.get(`/api/ace-data-center/model-indicators/detail?id=${vue.unref(de)}`,{headers:{loading:!0}}),_e=async()=>{const xe=await ee.$baseHttp.post(`/api/ace-data-center/model-indicators-echarts/getEchartsTypes/${vue.unref(de)}`);fe.value=xe.data};vue.provide("getChartWidgetList",_e),vue.provide("chartList",fe);const be=()=>{ee.$baseConfirm({content:"是否确定关闭",callConfirm:async()=>{ne.value=!1,vue.unref(de)&&ve("close")}})},ye=xe=>{se.value=xe,vue.unref(ie).dynamicSearchForm=xe,vue.unref(ie).handleSubmit()};return U({init:ge}),(xe,Ce)=>{const $e=vue.resolveComponent("aceHeader"),we=vue.resolveComponent("AppDrawer");return vue.openBlock(),vue.createBlock(we,{modelValue:vue.unref(ne),"onUpdate:modelValue":Ce[11]||(Ce[11]=Ee=>vue.isRef(ne)?ne.value=Ee:null),withHeader:!1,size:"100%",modalClass:"ace-modal-drawer"},{default:vue.withCtx(()=>{var Ee,Ve;return[vue.createElementVNode("div",_hoisted_1$$,[vue.createElementVNode("div",_hoisted_2$Q,[vue.createElementVNode("div",_hoisted_3$I,[vue.createVNode($e,{title:vue.unref(oe)=="table"?vue.unref(ue):`${vue.unref(pe)}【${vue.unref(ue)}】`},vue.createSlots({_:2},[vue.unref(fe).length?{name:"left",fn:vue.withCtx(()=>[vue.createElementVNode("i",{onClick:Ce[0]||(Ce[0]=Se=>vue.unref(ie).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$G,[vue.createTextVNode(" 模型数据 / "+vue.toDisplayString((Ee=vue.unref(he))==null?void 0:Ee.modelName)+" ["+vue.toDisplayString((Ve=vue.unref(he))==null?void 0:Ve.modelCode)+"] ",1),vue.createElementVNode("span",{class:"ml-2",innerHTML:vue.unref(ce)},null,8,_hoisted_5$x)])]),vue.createElementVNode("div",_hoisted_6$s,[vue.withDirectives(vue.createElementVNode("div",_hoisted_7$o,[vue.createVNode(vue.unref(elementPlus.ElPopover),{placement:"bottom",visible:vue.unref(re),"onUpdate:visible":Ce[2]||(Ce[2]=Se=>vue.isRef(re)?re.value=Se:null),trigger:"click",width:"900px",teleported:!1},{reference:vue.withCtx(()=>[vue.createVNode(vue.unref(elementPlus.ElButton),{type:"warning"},{default:vue.withCtx(()=>[_hoisted_8$k,vue.createTextVNode(" 筛选配置 ")]),_:1})]),default:vue.withCtx(()=>[vue.createVNode(aceIndicatorCustomSearch,{ref_key:"customSearchRef",ref:ae,customSearchVisible:vue.unref(re),"onUpdate:customSearchVisible":Ce[1]||(Ce[1]=Se=>vue.isRef(re)?re.value=Se:null),onDynamicSearchFormUpdate:ye,dynamicSearchForm:vue.unref(se)},null,8,["customSearchVisible","dynamicSearchForm"])]),_:1},8,["visible"])],512),[[vue.vShow,vue.unref(oe)=="table"&&vue.unref(ue)!="0个指标:"]]),vue.createVNode(vue.unref(elementPlus.ElButton),{onClick:be},{default:vue.withCtx(()=>[_hoisted_9$h,vue.createTextVNode(" 关闭 ")]),_:1})])]),vue.createElementVNode("div",_hoisted_10$f,[vue.withDirectives(vue.createVNode(tableWidget,{ref_key:"tableWidgetRef",ref:ie,modelValue:vue.unref(oe),"onUpdate:modelValue":Ce[3]||(Ce[3]=Se=>vue.isRef(oe)?oe.value=Se:null),indicatorsId:vue.unref(de),"onUpdate:indicatorsId":Ce[4]||(Ce[4]=Se=>vue.isRef(de)?de.value=Se:null),title:vue.unref(ue),"onUpdate:title":Ce[5]||(Ce[5]=Se=>vue.isRef(ue)?ue.value=Se:null),resultTitle:vue.unref(pe),"onUpdate:resultTitle":Ce[6]||(Ce[6]=Se=>vue.isRef(pe)?pe.value=Se:null),sortHtml:vue.unref(ce),"onUpdate:sortHtml":Ce[7]||(Ce[7]=Se=>vue.isRef(ce)?ce.value=Se:null),dynamicSearchForm:vue.unref(se),"onUpdate:dynamicSearchForm":Ce[8]||(Ce[8]=Se=>vue.isRef(se)?se.value=Se:null)},null,8,["modelValue","indicatorsId","title","resultTitle","sortHtml","dynamicSearchForm"]),[[vue.vShow,vue.unref(oe)=="table"]]),vue.withDirectives(vue.createVNode(chartWidget,{ref_key:"chartWidgetRef",ref:le,dynamicSearchForm:vue.unref(se),"onUpdate:dynamicSearchForm":Ce[9]||(Ce[9]=Se=>vue.isRef(se)?se.value=Se:null),modelValue:vue.unref(oe),"onUpdate:modelValue":Ce[10]||(Ce[10]=Se=>vue.isRef(oe)?oe.value=Se:null)},null,8,["dynamicSearchForm","modelValue"]),[[vue.vShow,vue.unref(oe)=="chart"]])])])]}),_:1},8,["modelValue"])}}}),index_vue_vue_type_style_index_0_scoped_e26b4ea0_lang="",aceIndicatorDesign=_export_sfc$2(_sfc_main$1a,[["__scopeId","data-v-e26b4ea0"]]),_hoisted_1$_={class:"flex items-center"},_hoisted_2$P=vue.createElementVNode("i",{class:"ri-search-line"},null,-1),_hoisted_3$H={class:"mt-3"},_hoisted_4$F={class:"flex items-center w-full overflow-hidden"},_hoisted_5$w={class:"overflow-hidden text-ellipsis whitespace-nowrap"},_hoisted_6$r={key:0,class:"mr-1 text-base ri-checkbox-circle-fill text-color-success"},_hoisted_7$n={key:1,class:"mr-1 text-base ri-progress-1-fill text-color-warning"},_hoisted_8$j={key:0,class:"flex items-center justify-end flex-1"},_sfc_main$19=vue.defineComponent({__name:"menu",props:{tempId:{default:""}},emits:["node-click"],setup(te,{expose:U,emit:G}){const ee=te,{proxy:ne}=vue.getCurrentInstance(),re=vue.ref(""),oe=vue.ref(null),ie=vue.ref(null),le=G;vue.watch(re,de=>{vue.unref(ie).filter(de)});const ae=(de,fe)=>de?fe.name.includes(de):!0,se=vue.ref(!1),ue=()=>{oe.value=[],se.value=!0,fetch$1(ne).loadIndicatorsMenu().then(de=>{oe.value=Object.keys(de.data).map(ve=>({name:ve,id:ve,children:de.data[ve]}));let fe;se.value=!1,vue.unref(oe).length&&vue.nextTick(()=>{var ve;ee.tempId?fe=vue.unref(ie).getNode(ee.tempId):fe=vue.unref(ie).getNode((ve=vue.unref(oe)[0].children[0])==null?void 0:ve.id),fe&&(ce(fe==null?void 0:fe.data),vue.unref(ie).setCurrentKey(fe==null?void 0:fe.data.id))})})};ue();const ce=de=>{Array.isArray(de.children)||le("node-click",de)};return U({init:ue}),(de,fe)=>{const ve=vue.resolveComponent("AppEmpty");return vue.openBlock(),vue.createElementBlock(vue.Fragment,null,[vue.createElementVNode("div",_hoisted_1$_,[vue.createVNode(vue.unref(elementPlus.ElInput),{placeholder:"请输入内容",clearable:"",modelValue:vue.unref(re),"onUpdate:modelValue":fe[0]||(fe[0]=he=>vue.isRef(re)?re.value=he:null)},{prefix:vue.withCtx(()=>[_hoisted_2$P]),_:1},8,["modelValue"]),vue.renderSlot(de.$slots,"search")]),vue.createElementVNode("div",_hoisted_3$H,[vue.unref(se)?(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:ie,data:vue.unref(oe),"node-key":"id","default-expand-all":"",indent:0,"highlight-current":"","filter-node-method":ae,onNodeClick:ce},{default:vue.withCtx(({node:he,data:pe})=>[vue.createElementVNode("div",_hoisted_4$F,[vue.createElementVNode("div",_hoisted_5$w,[Array.isArray(pe.children)?vue.createCommentVNode("",!0):(vue.openBlock(),vue.createElementBlock(vue.Fragment,{key:0},[pe.normal?(vue.openBlock(),vue.createElementBlock("i",_hoisted_6$r)):(vue.openBlock(),vue.createElementBlock("i",_hoisted_7$n))],64)),vue.createElementVNode("span",{class:vue.normalizeClass(["flex-1 overflow-hidden whitespace-nowrap text-ellipsis",{"font-bold":he.level==1}])},vue.toDisplayString(pe.name),3)]),Array.isArray(pe.children)?vue.createCommentVNode("",!0):(vue.openBlock(),vue.createElementBlock("div",_hoisted_8$j,[vue.renderSlot(de.$slots,"menu-item",{data:pe})]))])]),empty:vue.withCtx(()=>[vue.createVNode(ve,{description:"暂无数据"})]),_:3},8,["data"]))])],64)}}}),_hoisted_1$Z={class:"rule-list"},_hoisted_2$O={key:0,class:"flex items-center"},_hoisted_3$G=vue.createElementVNode("i",{class:"ri-error-warning-fill text-2xl text-color-warning mr-2"},null,-1),_hoisted_4$E={key:1,class:"flex items-center"},_hoisted_5$v=vue.createElementVNode("i",{class:"ri-checkbox-circle-fill text-2xl text-color-success mr-2"},null,-1),_sfc_main$18=vue.defineComponent({__name:"rule",props:{ruleList:{default:()=>[]}},setup(te){const{proxy:U}=vue.getCurrentInstance(),G=vue.ref(!1),ee=vue.ref(""),ne=vue.ref([]),re=le=>{ee.value=`/api/ace-data-center/rule/ruleDataView?ruleId=${le}`,G.value=!0},oe=le=>{vue.unref(ne).length==0&&Object.keys(le.data[0]).forEach(ae=>{if(ae==="pageIndex"){ne.value.unshift({label:"序号",prop:"pageIndex",width:"80px"});return}ne.value.push({label:ae,prop:ae})})},ie=()=>{U.$baseExportExcel({title:"数据列表",url:vue.unref(ee),method:"get",header:vue.unref(ne)})};return(le,ae)=>{const se=vue.resolveComponent("aceHeader"),ue=vue.resolveComponent("AppList"),ce=vue.resolveComponent("AppDrawer");return vue.openBlock(),vue.createElementBlock(vue.Fragment,null,[vue.createElementVNode("div",_hoisted_1$Z,[le.ruleList.length>0?(vue.openBlock(),vue.createElementBlock(vue.Fragment,{key:0},[vue.createVNode(se,{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(le.ruleList,de=>(vue.openBlock(),vue.createElementBlock("div",{key:de.id,class:"mt-0 text-sm"},[+de.rows>0?(vue.openBlock(),vue.createElementBlock("div",_hoisted_2$O,[_hoisted_3$G,vue.createTextVNode(" "+vue.toDisplayString(de.ruleName)+" 【异常数据"+vue.toDisplayString(de.rows>99?"99+":de.rows)+"】 ",1),vue.createVNode(vue.unref(elementPlus.ElLink),{class:"ml-2",type:"primary",onClick:fe=>re(de.id)},{default:vue.withCtx(()=>[vue.createTextVNode("查看明细")]),_:2},1032,["onClick"])])):(vue.openBlock(),vue.createElementBlock("div",_hoisted_4$E,[_hoisted_5$v,vue.createTextVNode(" "+vue.toDisplayString(de.ruleName)+" 【未检测到异常数据】 ",1)]))]))),128))]),_:1})],64)):vue.createCommentVNode("",!0)]),vue.createVNode(ce,{modelValue:vue.unref(G),"onUpdate:modelValue":ae[1]||(ae[1]=de=>vue.isRef(G)?G.value=de:null),title:"数据列表"},{footer:vue.withCtx(()=>[vue.createVNode(vue.unref(elementPlus.ElButton),{type:"primary",class:"ml-3",onClick:ie},{default:vue.withCtx(()=>[vue.createTextVNode("导 出")]),_:1}),vue.createVNode(vue.unref(elementPlus.ElButton),{class:"ml-3",onClick:ae[0]||(ae[0]=de=>G.value=!1)},{default:vue.withCtx(()=>[vue.createTextVNode("关 闭")]),_:1})]),default:vue.withCtx(()=>[vue.createVNode(ue,{tableData:vue.unref(ne),url:vue.unref(ee),onSuccess:oe},null,8,["tableData","url"])]),_:1},8,["modelValue"])],64)}}}),_hoisted_1$Y={key:1,class:"animated fadeIn"},_hoisted_2$N={class:"flex items-center mt-5 mb-5 ml-2 moudle-1"},_hoisted_3$F={key:0,class:"mr-1 text-xl ri-error-warning-fill text-color-warning"},_hoisted_4$D={key:1,class:"mr-1 text-xl ri-checkbox-circle-fill text-color-success"},_hoisted_5$u={class:"ml-1"},_hoisted_6$q={class:"flex items-center select-type"},_hoisted_7$m=["onClick"],_hoisted_8$i={class:"mt-5 mb-5"},_hoisted_9$g={class:"mt-4"},_sfc_main$17=vue.defineComponent({__name:"analysis",props:{indicatorsId:{default:""}},emits:["rule-success"],setup(te,{emit:U}){const G=te;vue.watch(()=>G.indicatorsId,()=>ue());const ee=U,{proxy:ne}=vue.getCurrentInstance(),{dynamicSearchForm:re,dynamicSearchFormat:oe,dynamicSearchParams:ie}=ne.$aceDynamicSearch(),le=vue.ref(!0),ae=vue.ref([]),se=vue.ref(null),ue=async()=>{var _e,be,ye;le.value=!0,re.value=[],ve.value={type:"",value:""},ce.value=[],de.value="",ge();const me=await fetch$1(ne).detailAndTask(G.indicatorsId);se.value=me.data,(be=(_e=me.data)==null?void 0:_e.echartsDataVO)!=null&&be.config&&fe(),(ye=me==null?void 0:me.data)!=null&&ye.formConfJson&&(re.value=oe(JSON.parse(me==null?void 0:me.data.formConfJson))),le.value=!1},ce=vue.ref([]),de=vue.ref(""),fe=async()=>{var _e;ce.value=[],de.value="";const me=await fetch$1(ne).getEchartDetail({indicatorsId:G.indicatorsId});me&&(Object.keys(((_e=me.data)==null?void 0:_e.clientEchartsType)??{}).forEach(be=>{var ye;Object.values((ye=me.data)==null?void 0:ye.clientEchartsType[be]).forEach(xe=>{var Ce,$e;ce.value.push({client:be,label:(Ce=echartsTypeList[xe])==null?void 0:Ce.name,icon:($e=echartsTypeList[xe])==null?void 0:$e.icon,value:`${be}_${xe}`})})}),vue.unref(ce).length>0&&(de.value=vue.unref(ce)[0].value,pe(vue.unref(de))))},ve=vue.ref({type:"",value:""}),he=vue.ref(!1),pe=async(me,_e=!1)=>{var Ce;de.value=me,_e&&(he.value=!0);const be=ie(vue.unref(re)),ye=me.split("_"),xe=await fetch$1(ne).pullEchartsDataVO({indicatorsId:G.indicatorsId,loadType:((Ce=vue.unref(se))==null?void 0:Ce.loadType)??3,params:be,targetClient:ye[0],echartsType:ye[1]});if(xe){he.value=!1,vue.unref(ve).type=ye[1];try{vue.unref(ve).value=chartJsonFormat(xe.data.config)}catch{vue.unref(ve).value=xe.data.config}}},ge=async()=>{var _e;ae.value=[];const me=await fetch$1(ne).getRule({current:1,size:100,businessType:"indicators",businessId:G.indicatorsId});ae.value=((_e=me.data)==null?void 0:_e.records)??[],ee("rule-success",ae.value)};return ue(),(me,_e)=>{const be=vue.resolveComponent("AppResourceVisitor"),ye=vue.resolveComponent("aceHeader"),xe=vue.resolveComponent("aceDynamicSearch"),Ce=vue.resolveComponent("aceChart");return vue.unref(le)?(vue.openBlock(),vue.createBlock(vue.unref(elementPlus.ElSkeleton),{key:0,animated:""})):(vue.openBlock(),vue.createElementBlock("div",_hoisted_1$Y,[vue.createVNode(ye,{title:"指标计算"},{default:vue.withCtx(()=>[vue.createVNode(be,{businessType:"INDICATORS",businessld:G.indicatorsId},null,8,["businessld"])]),_:1}),vue.createElementVNode("div",_hoisted_2$N,[vue.unref(ae).some($e=>$e.rows>0)?(vue.openBlock(),vue.createElementBlock("i",_hoisted_3$F)):(vue.openBlock(),vue.createElementBlock("i",_hoisted_4$D)),vue.createElementVNode("span",_hoisted_5$u,vue.toDisplayString(vue.unref(se).remark),1)]),vue.createVNode(ye,{title:"指标数据"},{default:vue.withCtx(()=>[vue.createElementVNode("div",_hoisted_6$q,[(vue.openBlock(!0),vue.createElementBlock(vue.Fragment,null,vue.renderList(vue.unref(ce),$e=>(vue.openBlock(),vue.createElementBlock("span",{onClick:we=>pe($e.value,!0),class:vue.normalizeClass(["flex items-center cursor-pointer",[$e.value==vue.unref(de)?"text-color-primary":"text-gray-600"]]),key:$e.value},[vue.createElementVNode("i",{class:vue.normalizeClass([$e.icon,"mr-1"])},null,2),vue.createTextVNode(" "+vue.toDisplayString($e.label),1)],10,_hoisted_7$m))),128))])]),_:1}),vue.createElementVNode("div",_hoisted_8$i,[vue.unref(re).length>0?(vue.openBlock(),vue.createBlock(xe,{key:0,form:vue.unref(re),onSuccess:_e[0]||(_e[0]=$e=>pe(vue.unref(de),!0)),class:"mb-0"},null,8,["form"])):vue.createCommentVNode("",!0),vue.createElementVNode("div",_hoisted_9$g,[vue.createVNode(Ce,{type:vue.unref(ve).type,options:vue.unref(ve).value,loading:vue.unref(he)},null,8,["type","options","loading"])])]),vue.createVNode(_sfc_main$18,{ruleList:vue.unref(ae)},null,8,["ruleList"])]))}}}),analysis_vue_vue_type_style_index_0_scoped_c9f7a244_lang="",aceIndicatorSystemPreview=_export_sfc$2(_sfc_main$17,[["__scopeId","data-v-c9f7a244"]]),_hoisted_1$X={class:"h-full"},_sfc_main$16=vue.defineComponent({__name:"relation",setup(te){const{proxy:U}=vue.getCurrentInstance(),G=vue.ref(null),ee=vue.ref(!0),ne=["#00ADD0","#FFA12F","#B62AFF","#604BFF","#6E35FF","#002AFF","#20C0F4","#95F300","#04FDB8","#AF5AFF"],re=(oe,ie,le="#00f6ff")=>oe.map((ae,se)=>{switch(ae&&ae.title&&(ae.name=ae.title),ie==1&&(le=ne.find((ue,ce)=>ce==se%10)),(ie===0||ie===1)&&(ae.label={position:"inside"}),ie){case 0:ae.symbolSize=70;break;case 1:ae.symbolSize=50;break;default:ae.symbolSize=10;break}return ae.lineStyle={color:le},ae.children?(ae.itemStyle={borderColor:le,color:le},ae.children=re(ae.children,ie+1,le)):ae.itemStyle={color:"transparent",borderColor:le},ae});return fetch$1(U).indicatorsRelationTree().then(oe=>{if(ee.value=!1,!oe.data.length){G.value={};return}G.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:re([oe==null?void 0:oe.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}}]}}),(oe,ie)=>{const le=vue.resolveComponent("v-chart");return vue.withDirectives((vue.openBlock(),vue.createElementBlock("div",_hoisted_1$X,[vue.createVNode(le,{option:vue.unref(G),autoresize:""},null,8,["option"])])),[[vue.unref(elementPlus.vLoading),vue.unref(ee)]])}}}),_hoisted_1$W={key:0,class:"flex items-center gap-x-2.5"},_hoisted_2$M=vue.createElementVNode("div",{class:"font-bold"},"数据分析",-1),_sfc_main$15=vue.defineComponent({__name:"yoy",props:{search:{default:()=>[]},originSearch:{default:()=>[]},chartType:{default:""},option:{default:null}},setup(te,{expose:U}){const G=te,ee=screenDesignMainStore(),{proxy:ne}=vue.getCurrentInstance(),{dynamicSearchForm:re,dynamicSearchFormat:oe,dynamicSearchParams:ie}=ne.$aceDynamicSearch(),le=["yySingle","yymmSingle","yymmddSingle"],{seriesItem:ae}=useLineCommon(),se=vue.computed(()=>G.search.find(ve=>le.includes(ve.type))),ue=vue.computed(()=>{const ve=vue.unref(se)?Object.values(ie([vue.unref(se)])).every(he=>he==""):!1;return G.search.filter(he=>le.includes(he.type)).length==1&&!ve}),ce=vue.ref("");vue.watch(ce,()=>de());const de=async()=>{var Se;if(!vue.unref(ue)||vue.unref(ce)=="")return;const ve=JSON.parse(JSON.stringify((Se=ee.getChartData)==null?void 0:Se.params)),he=JSON.parse(JSON.stringify(G.search)),pe=he.find(ke=>le.includes(ke.type)),ge=G.originSearch.find(ke=>le.includes(ke.type));console.log(G.originSearch);const _e=JSON.parse((ve==null?void 0:ve.groupArgsJson)??"[]").find(ke=>ke.comment==G.option.dataShow.x);ve.groupArgsJson=JSON.stringify([_e]);const be=_e.dateFormatType;switch(pe.type){case"yymmSingle":pe.value=dayjs(pe.value).subtract(1,vue.unref(ce)=="TB"?"year":"month").format("YYYY-MM");break;case"yymmddSingle":pe.value=dayjs(pe.value).subtract(1,vue.unref(ce)=="TB"?"year":"day").format("YYYY-MM-DD");break;case"yySingle":pe.value=dayjs(pe.value).subtract(1,"year").format("YYYY");break}ve.params=ie(he);const xe=G.option.dataset.dimensions;xe.length>=3&&G.option.dataset.dimensions.pop();const Ce=await ne.$baseHttp.post("/api/ace-data-center/model-indicators/debug",ve),$e=xe[0],we=G.option.dataShow.y.filter(ke=>!G.option.dataShow.hide.includes(ke));vue.unref(pe.type).includes("Range")?(G.option.dataset.dimensions[1]=`${ge!=null&&ge.minValue?`${ge==null?void 0:ge.minValue}~`:""}${(ge==null?void 0:ge.maxValue)??""}${we}`,G.option.dataset.dimensions.push(`${pe.minValue?`${pe.minValue}~`:""}${(pe==null?void 0:pe.maxValue)??""}${we}`)):(G.option.dataset.dimensions[1]=`${ge==null?void 0:ge.value}${we}`,G.option.dataset.dimensions[2]=`${pe.value}${we}`,G.option.dataset.dimensions[3]="增长率");const Ee=G.option.series[0];G.option.series=[],Ce.data.records.forEach(ke=>{fe(ke,$e,be)});const Ve=JSON.parse(JSON.stringify(G.option.dataset.temp_source));Ve.forEach((ke,Ne)=>{fe(ke,$e,be);let Ie=null;ke[G.option.dataset.dimensions[1]]=ke[we],be?(Ie=Ce.data.records.find(De=>De[$e]==ke[$e]),Ie||(["year"].includes(be)&&(Ie=Ce.data.records.find(De=>De[$e].indexOf(pe.value)>=0),ke[$e]=$e),["day","month"].includes(be)&&(Ie=Ce.data.records.find(De=>De[$e].split("-").at(-1)==ke[$e].split("-").at(-1))))):Ie=Ce.data.records.find(De=>De[$e]==ke[$e]),Ie||(Ie={[we]:0}),Ie&&(ke[G.option.dataset.dimensions[2]]=Ie[we]);const Pe=ke[G.option.dataset.dimensions[1]]??0,Te=ke[G.option.dataset.dimensions[2]]??0;ke.增长率=!Pe||!Te?0:((Pe-Te)/Te*100).toFixed(2)}),G.option.dataset.source=Ve,setTimeout(()=>{const{yAxis:ke,xAxis:Ne}=G.option;let Ie="yAxis";!Array.isArray(ke)&&ke.type!="value"&&(Ie="xAxis"),G.option.series=[Ee,{...Ee,itemStyle:{...(Ee==null?void 0:Ee.itemStyle)??{},color:null}},{...ae,name:"增长率",[`${Ie}Index`]:1}],console.log(G.option.series,Ee),G.option[Ie]=[Array.isArray(G.option[Ie])?G.option[Ie][0]:G.option[Ie],{type:"value",name:"增长率",nameGap:20,splitLine:!1,nameLocation:Ie=="xAxis"?"start":"end"}]})},fe=(ve,he,pe)=>{if(!(!pe||(ve[he]??"")=="")&&["day"].includes(pe)){const ge=ve[he].split("-").filter((me,_e)=>_e==0?"":me);ve[he]=ge.join("-")}};return U({init:de,type:ce}),(ve,he)=>vue.unref(ue)&&ve.option?(vue.openBlock(),vue.createElementBlock("div",_hoisted_1$W,[_hoisted_2$M,vue.createElementVNode("div",null,[vue.createVNode(vue.unref(elementPlus.ElRadioGroup),{modelValue:vue.unref(ce),"onUpdate:modelValue":he[0]||(he[0]=pe=>vue.isRef(ce)?ce.value=pe:null)},{default:vue.withCtx(()=>{var pe;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((pe=vue.unref(se))==null?void 0:pe.type)},{default:vue.withCtx(()=>[vue.createTextVNode(" 环比 ")]),_:1},8,["disabled"])]}),_:1},8,["modelValue"])])])):vue.createCommentVNode("",!0)}}),_withScopeId$k=te=>(vue.pushScopeId("data-v-54d5c5dd"),te=te(),vue.popScopeId(),te),_hoisted_1$V={key:2,class:"flex flex-col chart-preview"},_hoisted_2$L={class:"flex mb-2.5"},_hoisted_3$E={key:0,class:"flex-1"},_hoisted_4$C={class:"flex items-center gap-x-2.5"},_hoisted_5$t=_withScopeId$k(()=>vue.createElementVNode("div",{class:"font-bold"},"计算指标",-1)),_hoisted_6$p={key:0,class:"flex items-center gap-x-2.5"},_hoisted_7$l=_withScopeId$k(()=>vue.createElementVNode("div",{class:"font-bold"},"分组维度",-1)),_hoisted_8$h={class:"flex flex-col flex-1 overflow-hidden"},_hoisted_9$f={class:"relative flex-1"},_hoisted_10$e={class:"flex justify-center change-btns"},_sfc_main$14=vue.defineComponent({__name:"IndicatorsView",props:{dynamicSearchForm:{default:()=>[]},result:{default:()=>{}},chartData:{default:null}},emits:["search-success"],setup(te,{emit:U}){const G=te,ee=U,ne=screenDesignMainStore(),{proxy:re}=vue.getCurrentInstance(),{dynamicSearchForm:oe,dynamicSearchFormat:ie,dynamicSearchParams:le}=re.$aceDynamicSearch(),ae=vue.ref(null),se=vue.ref(""),ue=vue.ref([]),ce=vue.ref(G.dynamicSearchForm),de=vue.ref(!1),{option:fe,formatChart:ve,chartType:he,setChartData:pe,changeChartSeries:ge,chartDataParams:me}=useCustomChart(),_e={day:"按日",week:"按周",month:"按月",quarter:"按季度",year:"按年","":"按时分秒"};vue.onMounted(async()=>{await re.$baseHttp.post(`/api/ace-data-center/model-indicators-echarts/getEchartsTypes/${G.result.id}`).then(we=>{ue.value=we.data,we.data.length&&(se.value=we.data[0].code,he.value=we.data[0].type)})}),vue.watch(se,async()=>{Ce()});const be=we=>{se.value!=we.code&&(fe.value={},he.value=we.type,se.value=we.code,vue.unref(ae)&&(vue.unref(ae).type=""))},ye=vue.ref(""),xe=vue.ref(""),Ce=async()=>{var we,Ee,Ve,Se,ke,Ne,Ie;ce.value=JSON.parse(JSON.stringify(G.dynamicSearchForm)),de.value=!0,fe.value={},ye.value="",xe.value=["2"].includes(vue.unref(he))?"":[],G.chartData&&(me.value=G.chartData),await ve(vue.unref(se)),ye.value=(Ee=(we=vue.unref(fe))==null?void 0:we.dataShow)==null?void 0:Ee.x,Array.isArray((Se=(Ve=vue.unref(fe))==null?void 0:Ve.dataShow)==null?void 0:Se.y)?xe.value=(ke=vue.unref(fe))==null?void 0:ke.dataShow.y.filter(Pe=>{var Te;return!(((Te=vue.unref(fe))==null?void 0:Te.dataShow.hide)??[]).includes(Pe)}):xe.value=(Ie=(Ne=vue.unref(fe))==null?void 0:Ne.dataShow)==null?void 0:Ie.y,isMobile&&["1","3","5"].includes(vue.unref(he))&&!vue.unref(fe).dataZoom&&(fe.value.grid.bottom="10%",fe.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(()=>{de.value=!1},10)};vue.watch([ye,xe],async([we,Ee],[Ve,Se])=>{var ke;vue.unref(de)||(vue.unref(fe).dataShow.x=we,vue.unref(fe).dataShow.y=Ee,Array.isArray(Ee)&&(vue.unref(fe).dataShow.hide=(ke=vue.unref(fe))==null?void 0:ke.dataShow.y.filter(Ne=>ne.getChartData.y.includes(Ne.showLabel))),(we!=Ve||["2","7"].includes(vue.unref(he)))&&(fe.value.dataset.source=await pe(vue.unref(he),we,["2","7"].includes(vue.unref(he))?Ee:null),fe.value.dataset.temp_source=JSON.parse(JSON.stringify(fe.value.dataset.source)),ce.value=JSON.parse(JSON.stringify(G.dynamicSearchForm)),vue.unref(ae)&&(vue.unref(ae).type="")),["xAxis","yAxis"].forEach(Ne=>{Array.isArray(fe.value[Ne])&&(fe.value[Ne]=fe.value[Ne].filter(Ie=>Ie.name!="增长率"))}),ge())},{deep:!0});const $e=()=>{ne.getChartData.params.params=le(G.dynamicSearchForm),Ce(),ee("search-success",ne.getChartData.params.params)};return(we,Ee)=>{var Ne;const Ve=vue.resolveComponent("aceDynamicSearch"),Se=vue.resolveComponent("AppEmpty"),ke=vue.resolveComponent("aceCustomChart");return vue.openBlock(),vue.createElementBlock("div",null,[G.dynamicSearchForm.length?(vue.openBlock(),vue.createBlock(Ve,{key:0,form:G.dynamicSearchForm,onSuccess:$e},null,8,["form"])):vue.createCommentVNode("",!0),vue.unref(ue).length?(vue.openBlock(),vue.createElementBlock("div",_hoisted_1$V,[vue.createElementVNode("div",_hoisted_2$L,[["9"].includes(vue.unref(he))?vue.createCommentVNode("",!0):(vue.openBlock(),vue.createElementBlock("div",_hoisted_3$E,[vue.createVNode(vue.unref(elementPlus.ElSkeleton),{loading:!((Ne=vue.unref(fe))!=null&&Ne.dataShow),animated:""},{default:vue.withCtx(()=>[vue.createElementVNode("div",_hoisted_4$C,[_hoisted_5$t,vue.createElementVNode("div",null,[["2"].includes(vue.unref(he))?(vue.openBlock(),vue.createBlock(vue.unref(elementPlus.ElRadioGroup),{key:0,modelValue:vue.unref(xe),"onUpdate:modelValue":Ee[0]||(Ee[0]=Ie=>vue.isRef(xe)?xe.value=Ie:null)},{default:vue.withCtx(()=>{var Ie;return[(vue.openBlock(!0),vue.createElementBlock(vue.Fragment,null,vue.renderList((((Ie=vue.unref(ne).getChartData)==null?void 0:Ie.y)??[]).filter(Pe=>Pe.aggType!="other"),Pe=>(vue.openBlock(),vue.createBlock(vue.unref(elementPlus.ElRadio),{key:Pe.showLabel,label:Pe.showLabel,value:Pe.showLabel},null,8,["label","value"]))),128))]}),_:1},8,["modelValue"])):["8"].includes(vue.unref(he))?(vue.openBlock(),vue.createBlock(vue.unref(elementPlus.ElCheckboxGroup),{key:1,modelValue:vue.unref(xe),"onUpdate:modelValue":Ee[1]||(Ee[1]=Ie=>vue.isRef(xe)?xe.value=Ie:null)},{default:vue.withCtx(()=>{var Ie,Pe;return[(vue.openBlock(!0),vue.createElementBlock(vue.Fragment,null,vue.renderList([...((Ie=vue.unref(ne).getChartData)==null?void 0:Ie.y)??[],...(((Pe=vue.unref(ne).getChartData)==null?void 0:Pe.x)??[]).map(Te=>({...Te,showLabel:Te.comment}))],Te=>(vue.openBlock(),vue.createBlock(vue.unref(elementPlus.ElCheckbox),{key:Te.showLabel,label:Te.showLabel,value:Te.showLabel},null,8,["label","value"]))),128))]}),_:1},8,["modelValue"])):(vue.openBlock(),vue.createBlock(vue.unref(elementPlus.ElCheckboxGroup),{key:2,modelValue:vue.unref(xe),"onUpdate:modelValue":Ee[2]||(Ee[2]=Ie=>vue.isRef(xe)?xe.value=Ie:null)},{default:vue.withCtx(()=>{var Ie;return[(vue.openBlock(!0),vue.createElementBlock(vue.Fragment,null,vue.renderList((((Ie=vue.unref(ne).getChartData)==null?void 0:Ie.y)??[]).filter(Pe=>Pe.aggType!="other"),Pe=>(vue.openBlock(),vue.createBlock(vue.unref(elementPlus.ElCheckbox),{key:Pe.showLabel,label:Pe.showLabel,value:Pe.showLabel},null,8,["label","value"]))),128))]}),_:1},8,["modelValue"]))])]),["8"].includes(vue.unref(he))?vue.createCommentVNode("",!0):(vue.openBlock(),vue.createElementBlock("div",_hoisted_6$p,[_hoisted_7$l,vue.createElementVNode("div",null,[vue.createVNode(vue.unref(elementPlus.ElRadioGroup),{modelValue:vue.unref(ye),"onUpdate:modelValue":Ee[3]||(Ee[3]=Ie=>vue.isRef(ye)?ye.value=Ie:null)},{default:vue.withCtx(()=>[(vue.openBlock(!0),vue.createElementBlock(vue.Fragment,null,vue.renderList(vue.unref(ne).getChartData.x,Ie=>(vue.openBlock(),vue.createBlock(vue.unref(elementPlus.ElRadio),{key:Ie.comment,label:Ie.comment,value:Ie.comment},{default:vue.withCtx(()=>[vue.createTextVNode(vue.toDisplayString(Ie.comment)+" ",1),_e[Ie.dateFormatType]?(vue.openBlock(),vue.createElementBlock(vue.Fragment,{key:0},[vue.createTextVNode(" ("+vue.toDisplayString(_e[Ie.dateFormatType])+") ",1)],64)):vue.createCommentVNode("",!0)]),_:2},1032,["label","value"]))),128))]),_:1},8,["modelValue"])])])),["3","1"].includes(vue.unref(he))&&vue.unref(fe).dataShow.y.filter(Ie=>!vue.unref(fe).dataShow.hide.includes(Ie)).length==1?(vue.openBlock(),vue.createBlock(_sfc_main$15,{key:1,ref_key:"yoyRef",ref:ae,option:vue.unref(fe),search:vue.unref(ce),originSearch:G.dynamicSearchForm,chartType:vue.unref(he)},null,8,["option","search","originSearch","chartType"])):vue.createCommentVNode("",!0)]),_:1},8,["loading"])]))]),vue.createElementVNode("div",_hoisted_8$h,[vue.createElementVNode("div",_hoisted_9$f,[vue.createVNode(vue.unref(elementPlus.ElSkeleton),{loading:vue.unref(de),animated:""},{default:vue.withCtx(()=>[vue.createVNode(ke,{option:vue.unref(fe),chartType:vue.unref(he)},null,8,["option","chartType"])]),_:1},8,["loading"])]),vue.createElementVNode("div",_hoisted_10$e,[vue.createVNode(vue.unref(elementPlus.ElButtonGroup),null,{default:vue.withCtx(()=>[(vue.openBlock(!0),vue.createElementBlock(vue.Fragment,null,vue.renderList(vue.unref(ue),Ie=>(vue.openBlock(),vue.createBlock(vue.unref(elementPlus.ElButton),{type:vue.unref(se)==Ie.code?"primary":"",key:Ie.type,onClick:Pe=>be(Ie)},{default:vue.withCtx(()=>{var Pe;return[vue.createElementVNode("i",{class:vue.normalizeClass((Pe=vue.unref(echartsTypeList)[Ie.type])==null?void 0:Pe.icon)},null,2)]}),_:2},1032,["type","onClick"]))),128))]),_:1})])])])):(vue.openBlock(),vue.createBlock(Se,{key:1,description:"暂无数据"}))])}}}),IndicatorsView_vue_vue_type_style_index_0_scoped_54d5c5dd_lang="",IndicatorsView=_export_sfc$2(_sfc_main$14,[["__scopeId","data-v-54d5c5dd"]]),_hoisted_1$U=["hidden"],_hoisted_2$K={class:"flex items-center w-full mb-4"},_hoisted_3$D={class:"flex justify-end flex-1"},_hoisted_4$B={class:"mb-4"},_hoisted_5$s={class:"flex mb-5 moudle-1"},_hoisted_6$o={class:"flex-1"},_hoisted_7$k={class:"flex items-center mt-2"},_hoisted_8$g={key:0,class:"mr-1 text-xl ri-error-warning-fill text-color-warning"},_hoisted_9$e={key:1,class:"mr-1 text-xl ri-checkbox-circle-fill text-color-success"},_hoisted_10$d={class:"ml-1"},_hoisted_11$b=vue.createElementVNode("div",{class:"w-10"},null,-1),_hoisted_12$a={class:"flex-1"},_hoisted_13$8={class:"items-center mt-2"},_hoisted_14$7=vue.createElementVNode("i",{class:"mr-1 text-xl ri-database-2-fill text-color-primary"},null,-1),_hoisted_15$4={key:1,class:"w-full"},_sfc_main$13=vue.defineComponent({__name:"modelIndicators",props:{indicatorsId:{default:""},modelIndicatorsRules:{default:()=>[]}},emits:["click-design","rule-success"],setup(te,{expose:U,emit:G}){const ee=te,ne=G;vue.watch(()=>ee.indicatorsId,()=>be());const{proxy:re}=vue.getCurrentInstance(),oe=screenDesignMainStore(),{dynamicSearchForm:ie,dynamicSearchFormat:le,dynamicSearchParams:ae}=re.$aceDynamicSearch(),se=vue.ref(!0),ue=vue.ref("basic"),ce=vue.ref(!1),de=vue.ref(!1),fe=vue.ref([]),ve=vue.ref({}),he=vue.ref(null),pe=vue.ref([]),ge=vue.ref([]),me=vue.ref({}),_e=({column:De})=>{vue.unref(me)[De.property]&&(De.order=vue.unref(me)[De.property])},be=async()=>{se.value=!0,ue.value="basic",oe.setChartData({}),we();const De=await re.$baseHttp.get(`/api/ace-data-center/model-indicators/detail?id=${ee.indicatorsId}`);he.value=De.data,se.value=!1,me.value=JSON.parse(De.data.sortArgsJson??"{}"),ie.value=le(JSON.parse(De.data.formConfJson??"[]")),Ce()},ye=vue.ref(!1),xe=vue.ref(!1),Ce=async(De="")=>{var Le,Re,Fe,je,Me,ze,Ge,We,Ue;De!="sort"&&(ge.value=[],ye.value=!0),xe.value=!0;const Oe=Object.keys(vue.unref(me)).map(qe=>({field:qe,type:vue.unref(me)[qe]=="ascending"?"asc":"desc"})),Be={aggArgsJson:(Le=vue.unref(he))==null?void 0:Le.aggArgsJson,groupArgsJson:(Re=vue.unref(he))==null?void 0:Re.groupArgsJson,sortArgsJson:JSON.stringify(Oe),params:vue.unref(Ne)??ae(le(JSON.parse(((Fe=vue.unref(he))==null?void 0:Fe.formConfJson)??"[]"))),modelIndicatorsId:(je=vue.unref(he))==null?void 0:je.id,pageSize:(Me=vue.unref(he))==null?void 0:Me.pageSize,modelId:(ze=vue.unref(he))==null?void 0:ze.modelId},Ae=await re.$baseHttp.post("/api/ace-data-center/model-indicators/debug",Be);Ae&&(pe.value=((Ge=Ae.data)==null?void 0:Ge.records)??[],ye.value=!1,xe.value=!1,ve.value={x:JSON.parse((We=vue.unref(he))==null?void 0:We.groupArgsJson),y:JSON.parse((Ue=vue.unref(he))==null?void 0:Ue.aggArgsJson),params:Be},oe.setChartData(ve.value),vue.unref(pe).length&&De!="sort"&&(Object.keys(vue.unref(pe)[0]).forEach(qe=>{ge.value.push({label:qe,prop:qe,sortable:"custom"})}),ge.value.push({label:"操作",prop:"button",width:"120px",fixed:"right",slot:!0})))},$e=De=>{const{prop:Oe,order:Be}=De;!Be||vue.unref(me)[Oe]===Be?delete vue.unref(me)[Oe]:vue.unref(me)[Oe]=Be,Ce("sort")},we=async()=>{var Oe;fe.value=[];const De=await fetch$1(re).getRule({current:1,size:100,businessType:"indicators",businessId:ee.indicatorsId});fe.value=((Oe=De.data)==null?void 0:Oe.records)??[],ne("rule-success",fe.value)},Ee=vue.ref(null),Ve=De=>{Ee.value=De,ce.value=!0},Se=De=>(De.modelIndicatorsId=vue.unref(he).id,De.row=vue.unref(Ee),De),ke=()=>{de.value=!0},Ne=vue.ref(null),Ie=De=>{Ne.value=De,Ce()};vue.watch(ce,De=>Te(De)),vue.watch(de,De=>Te(De));const Pe=vue.ref(!1),Te=De=>{self!=top&&(Pe.value=De,window.parent.postMessage(De?"model-indicators-open":"model-indicators-close","*"))};return be(),U({init:be,result:he}),(De,Oe)=>{const Be=vue.resolveComponent("AppResourceVisitor"),Ae=vue.resolveComponent("aceHeader"),Le=vue.resolveComponent("AppTable"),Re=vue.resolveComponent("AppEmpty"),Fe=vue.resolveComponent("aceDynamicList"),je=vue.resolveComponent("AppDrawer");return vue.unref(se)?(vue.openBlock(),vue.createBlock(vue.unref(elementPlus.ElSkeleton),{key:0,animated:""})):(vue.openBlock(),vue.createElementBlock("div",{key:1,class:"animated fadeIn",hidden:vue.unref(Pe)},[vue.createElementVNode("div",_hoisted_2$K,[vue.createElementVNode("div",null,[vue.createVNode(vue.unref(elementPlus.ElButtonGroup),null,{default:vue.withCtx(()=>[vue.createVNode(vue.unref(elementPlus.ElButton),{onClick:Oe[0]||(Oe[0]=Me=>ue.value="basic"),type:vue.unref(ue)=="basic"?"primary":""},{default:vue.withCtx(()=>[vue.createTextVNode(" 指标图表 ")]),_:1},8,["type"]),vue.createVNode(vue.unref(elementPlus.ElButton),{onClick:Oe[1]||(Oe[1]=Me=>ue.value="data"),type:vue.unref(ue)=="data"?"primary":""},{default:vue.withCtx(()=>[vue.createTextVNode(" 指标数据 ")]),_:1},8,["type"])]),_:1})]),vue.createElementVNode("div",_hoisted_3$D,[vue.createVNode(Be,{businessType:"MODEL_INDICATORS",businessld:ee.indicatorsId},null,8,["businessld"])])]),vue.withDirectives(vue.createElementVNode("div",null,[vue.createElementVNode("div",_hoisted_4$B,[vue.createVNode(vue.unref(elementPlus.ElSkeleton),{loading:vue.unref(xe),animated:""},{default:vue.withCtx(()=>[vue.createVNode(IndicatorsView,{dynamicSearchForm:vue.unref(ie),result:vue.unref(he),chartData:vue.unref(ve),onSearchSuccess:Ie},null,8,["dynamicSearchForm","result","chartData"])]),_:1},8,["loading"])])],512),[[vue.vShow,vue.unref(ue)=="basic"]]),vue.withDirectives(vue.createElementVNode("div",null,[vue.createElementVNode("div",_hoisted_5$s,[vue.createElementVNode("div",_hoisted_6$o,[vue.createVNode(Ae,{title:"指标计算"}),vue.createElementVNode("div",_hoisted_7$k,[vue.unref(fe).some(Me=>Me.rows>0)?(vue.openBlock(),vue.createElementBlock("i",_hoisted_8$g)):(vue.openBlock(),vue.createElementBlock("i",_hoisted_9$e)),vue.createElementVNode("span",_hoisted_10$d,vue.toDisplayString(vue.unref(he).remark),1)])]),_hoisted_11$b,vue.createElementVNode("div",_hoisted_12$a,[vue.createVNode(Ae,{title:"数据来源"}),vue.createElementVNode("div",_hoisted_13$8,[_hoisted_14$7,vue.createTextVNode(" 重构仓模型数据 | "+vue.toDisplayString(vue.unref(he).modelName)+"【 ",1),vue.createElementVNode("span",{class:"cursor-pointer text-color-primary",onClick:ke},vue.toDisplayString(vue.unref(he).modelCode),1),vue.createTextVNode(" 】 ")])])]),vue.createVNode(vue.unref(elementPlus.ElSkeleton),{loading:vue.unref(ye),animated:""},{default:vue.withCtx(()=>[vue.unref(ge).length?(vue.openBlock(),vue.createBlock(Le,{key:0,maxHeight:"400px",tableData:vue.unref(ge),list:vue.unref(pe),loading:!1,headerCellClassName:_e,onSortChange:$e},{button:vue.withCtx(({row:Me})=>[vue.createVNode(vue.unref(elementPlus.ElLink),{type:"primary",onClick:ze=>Ve(Me)},{default:vue.withCtx(()=>[vue.createTextVNode("查看明细")]),_:2},1032,["onClick"])]),_:1},8,["tableData","list"])):(vue.openBlock(),vue.createElementBlock("div",_hoisted_15$4,[vue.createVNode(Re,{description:"暂无数据",class:"mt-4"})]))]),_:1},8,["loading"])],512),[[vue.vShow,vue.unref(ue)=="data"]]),vue.createVNode(_sfc_main$18,{ruleList:vue.unref(fe)},null,8,["ruleList"]),vue.createVNode(je,{modelValue:vue.unref(ce),"onUpdate:modelValue":Oe[2]||(Oe[2]=Me=>vue.isRef(ce)?ce.value=Me:null),title:"查看明细",size:"90%"},{default:vue.withCtx(()=>[vue.createVNode(Ae,{title:"统计:",class:"mb-2"}),vue.createVNode(Le,{height:null,tableData:Object.keys(vue.unref(Ee)).map(Me=>({label:Me,prop:Me})),list:[vue.unref(Ee)],loading:!1},null,8,["tableData","list"]),vue.createVNode(Ae,{title:"钻取明细:",class:"mt-4 mb-2"}),vue.createVNode(Fe,{id:vue.unref(he).modelId,keyName:"modelIndicatorsId",title:vue.unref(he).modelName,isDownLoad:vue.unref(isMobile),url:"/api/ace-data-center/model-indicators/drilling",formatParamsFunc:Se},null,8,["id","title","isDownLoad"])]),_:1},8,["modelValue"]),vue.createVNode(je,{modelValue:vue.unref(de),"onUpdate:modelValue":Oe[3]||(Oe[3]=Me=>vue.isRef(de)?de.value=Me:null),title:"模型数据",size:"90%"},{default:vue.withCtx(()=>[vue.createVNode(Fe,{id:vue.unref(he).modelId,title:vue.unref(he).modelName},null,8,["id","title"])]),_:1},8,["modelValue"])],8,_hoisted_1$U))}}}),_hoisted_1$T=vue.createElementVNode("i",{class:"ri-search-line"},null,-1),_hoisted_2$J={class:"mt-3"},_hoisted_3$C={key:1,class:"mr-1 -ml-5 text-base ri-edit-circle-fill text-color-primary"},_sfc_main$12=vue.defineComponent({__name:"modelMenu",props:{type:{default:""}},emits:["node-click","change-type"],setup(te,{expose:U,emit:G}){const ee=te,{proxy:ne}=vue.getCurrentInstance(),re=vue.ref(""),oe=vue.ref(null),ie=G;vue.watch(re,he=>{vue.unref(oe).filter(he)});const le=(he,pe)=>he?pe.modelName.includes(he):!0,ae=vue.ref([]),se=vue.ref([]),ue=vue.ref([]),ce=vue.ref(!0),de=vue.computed(()=>ee.type=="ODS"?vue.unref(ae):ee.type=="DWD"?vue.unref(se):vue.unref(ue)),fe=()=>{Promise.all([fetch$1(ne).loadModelMenu({modelLayer:"ODS"}),fetch$1(ne).loadModelMenu({modelLayer:"DWD"}),fetch$1(ne).loadModelMenu({modelLayer:"ODSVIEW"})]).then(he=>{const pe=he[0].data,ge=he[1].data,me=he[2].data;ae.value=Object.keys(pe).map(_e=>({modelName:_e,id:_e,children:pe[_e]})),se.value=Object.keys(ge).map(_e=>({modelName:_e,id:_e,children:ge[_e]})),ue.value=Object.keys(me).map(_e=>({modelName:_e,id:_e,children:me[_e]})),ce.value=!1})};fe();const ve=he=>{if(he.modelCode){if(ee.type=="ODS"){ie("node-click",he);return}Array.isArray(he.children)||ie("node-click",he)}};return U({init:fe}),(he,pe)=>{const ge=vue.resolveComponent("AppEmpty");return vue.openBlock(),vue.createElementBlock(vue.Fragment,null,[vue.createVNode(vue.unref(elementPlus.ElInput),{placeholder:"请输入内容",clearable:"",modelValue:vue.unref(re),"onUpdate:modelValue":pe[0]||(pe[0]=me=>vue.isRef(re)?re.value=me:null)},{prefix:vue.withCtx(()=>[_hoisted_1$T]),_:1},8,["modelValue"]),vue.createElementVNode("div",_hoisted_2$J,[vue.unref(ce)?(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:oe,data:vue.unref(de),"default-expand-all":"","node-key":"id","highlight-current":"","filter-node-method":le,onNodeClick:ve},{default:vue.withCtx(({node:me,data:_e})=>[me.level!=1||he.type=="ODS"?(vue.openBlock(),vue.createElementBlock(vue.Fragment,{key:0},[_e.modelCode&&_e.openForm!=2?(vue.openBlock(),vue.createElementBlock("i",{key:0,class:vue.normalizeClass(["mr-1 -ml-5 text-base ri-checkbox-circle-fill",[_e.publishStatus==2?"text-color-success":"text-color-info"]])},null,2)):vue.createCommentVNode("",!0)],64)):vue.createCommentVNode("",!0),_e.openForm==2?(vue.openBlock(),vue.createElementBlock("i",_hoisted_3$C)):vue.createCommentVNode("",!0),vue.createElementVNode("span",{class:vue.normalizeClass({"font-bold":me.level==1})},vue.toDisplayString(_e.modelName),3),vue.renderSlot(he.$slots,"default",{element:_e})]),empty:vue.withCtx(()=>[vue.createVNode(ge,{description:"暂无数据"})]),_:3},8,["data"]))])],64)}}}),_hoisted_1$S={class:"mb-3"},_hoisted_2$I={style:{height:"calc(100vh - 100px)"},class:"overflow-y-auto"},_sfc_main$11=vue.defineComponent({__name:"modelIndicatorsAdd",emits:["click-node"],setup(te,{expose:U,emit:G}){const ee=G,{proxy:ne}=vue.getCurrentInstance(),re=vue.ref(!1),oe=vue.ref(),ie=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(ne).getCurrFunc("MODEL").then(ue=>{vue.unref(ie).forEach(ce=>{ce.disabled=!ue.data.includes(ce.rule),!vue.unref(oe)&&!ce.disabled&&(oe.value=ce.value)})});const le=ue=>{oe.value=ue},ae=()=>{re.value=!0},se=ue=>{ee("click-node",ue),re.value=!1};return U({init:ae}),(ue,ce)=>{const de=vue.resolveComponent("AppDrawer");return vue.openBlock(),vue.createBlock(de,{modelValue:vue.unref(re),"onUpdate:modelValue":ce[0]||(ce[0]=fe=>vue.isRef(re)?re.value=fe:null),title:"选择要分析的数据",size:"400px"},{default:vue.withCtx(()=>[vue.createElementVNode("div",_hoisted_1$S,[vue.createVNode(vue.unref(elementPlus.ElButtonGroup),null,{default:vue.withCtx(()=>[(vue.openBlock(!0),vue.createElementBlock(vue.Fragment,null,vue.renderList(vue.unref(ie),fe=>(vue.openBlock(),vue.createBlock(vue.unref(elementPlus.ElButton),{type:vue.unref(oe)==fe.value?"primary":"",key:fe.value,disabled:fe.disabled,onClick:ve=>le(fe.value)},{default:vue.withCtx(()=>[vue.createTextVNode(vue.toDisplayString(fe.label),1)]),_:2},1032,["type","disabled","onClick"]))),128))]),_:1})]),vue.createElementVNode("div",_hoisted_2$I,[vue.createVNode(_sfc_main$12,{ref:"menuRef",type:vue.unref(oe),onNodeClick:se},null,8,["type"])])]),_:1},8,["modelValue"])}}}),_hoisted_1$R=vue.createElementVNode("div",{class:"flex justify-end flex-1"},null,-1),_hoisted_2$H={class:"whitespace-nowrap ml-2.5"},_hoisted_3$B=vue.createElementVNode("i",{class:"mr-1 ri-add-circle-line"},null,-1),_hoisted_4$A=["onClick"],_hoisted_5$r=vue.createElementVNode("i",{class:"ri-edit-box-line"},null,-1),_hoisted_6$n={key:0,class:"flex items-center justify-center h-full"},_sfc_main$10=vue.defineComponent({__name:"index",props:{isCustom:{type:Boolean,default:!1},element:{default:null},tempId:{default:""}},emits:["close-design"],setup(te,{emit:U}){var me,_e;const G=te,ee=U,{proxy:ne}=vue.getCurrentInstance();vue.inject("local");const re=vue.ref(null),oe=vue.ref(null),ie=vue.ref(null),le=vue.ref(null),ae=vue.ref(G.element??{});vue.provide("modelEle",ae),vue.provide("getListModelIndicators",()=>{});const se=vue.ref([{label:"指标分析",value:"zbfx"},{label:"指标全景",value:"zbqj",disabled:!0}]),ue=vue.ref(vue.unref(se)[0].value),ce=vue.ref(((me=G==null?void 0:G.element)==null?void 0:me.id)??"");fetch$1(ne).getCurrFunc("INDICATORS").then(be=>{vue.unref(se).find(ye=>ye.value=="zbqj").disabled=!be.data.includes("INDICATORS_VIEW")});const de=vue.ref([]);fetch$1(ne).getCurrFunc("MODEL_INDICATORS").then(be=>{de.value=be.data});const fe=vue.ref(((_e=G==null?void 0:G.element)==null?void 0:_e.businessType)??""),ve=be=>{ce.value="",fe.value=be.type,setTimeout(()=>{ce.value=be.id},100)},he=be=>{ae.value=be,console.log(be),vue.unref(re).init()},pe=be=>{vue.nextTick(()=>{setTimeout(()=>{var ye,xe,Ce;ae.value={id:(ye=vue.unref(ie).result)==null?void 0:ye.modelId,modelName:(xe=vue.unref(ie).result)==null?void 0:xe.modelName,modelCode:(Ce=vue.unref(ie).result)==null?void 0:Ce.modelCode},vue.unref(re).init(be)},300)})},ge=()=>{vue.unref(ce)&&(ee("close-design",vue.unref(ce)),vue.unref(ie)&&vue.unref(ie).init()),vue.unref(oe)&&vue.unref(oe).init()};return(be,ye)=>{const xe=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(()=>[be.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(se),Ce=>(vue.openBlock(),vue.createBlock(vue.unref(elementPlus.ElButton),{type:vue.unref(ue)==Ce.value?"primary":"",key:Ce.value,disabled:Ce.disabled,onClick:$e=>ue.value=Ce.value},{default:vue.withCtx(()=>[vue.createTextVNode(vue.toDisplayString(Ce.label),1)]),_:2},1032,["type","disabled","onClick"]))),128))]),_:1})),_hoisted_1$R]),_:1}),vue.withDirectives(vue.createVNode(vue.unref(elementPlus.ElContainer),{class:"overflow-hidden"},{default:vue.withCtx(()=>[be.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$19,{onNodeClick:ve,tempId:be.tempId||vue.unref(ce),ref_key:"menuRef",ref:oe},{search:vue.withCtx(()=>[vue.createElementVNode("div",_hoisted_2$H,[vue.unref(de).includes("STATISTICAL_ANALYSIS")?(vue.openBlock(),vue.createBlock(vue.unref(elementPlus.ElButton),{key:0,type:"primary",onClick:ye[0]||(ye[0]=Ce=>vue.unref(le).init())},{default:vue.withCtx(()=>[_hoisted_3$B,vue.createTextVNode(" 新增指标 ")]),_:1})):vue.createCommentVNode("",!0)])]),"menu-item":vue.withCtx(({data:Ce})=>[vue.unref(de).includes("RELATED_INDICATORS")&&Ce.type!="INDICATORS"?(vue.openBlock(),vue.createElementBlock("div",{key:0,class:"ml-4 mr-2 cursor-pointer text-color-warning",onClick:vue.withModifiers($e=>pe(Ce.id),["stop"])},[_hoisted_5$r,vue.createTextVNode(" 编辑 ")],8,_hoisted_4$A)):vue.createCommentVNode("",!0)]),_:1},8,["tempId"])]),_:1})),vue.createVNode(vue.unref(elementPlus.ElMain),null,{default:vue.withCtx(()=>[vue.unref(ce)?(vue.openBlock(),vue.createElementBlock(vue.Fragment,{key:1},[vue.unref(fe)=="INDICATORS"?(vue.openBlock(),vue.createBlock(aceIndicatorSystemPreview,{key:0,indicatorsId:vue.unref(ce)},null,8,["indicatorsId"])):vue.createCommentVNode("",!0),vue.unref(fe)=="MODEL_INDICATORS"?(vue.openBlock(),vue.createBlock(_sfc_main$13,{key:1,onClickDesign:pe,modelIndicatorsRules:vue.unref(de),indicatorsId:vue.unref(ce),ref_key:"modelIndicatorsRef",ref:ie},null,8,["modelIndicatorsRules","indicatorsId"])):vue.createCommentVNode("",!0)],64)):(vue.openBlock(),vue.createElementBlock("div",_hoisted_6$n,[vue.createVNode(xe,{description:"请选择对应指标"})]))]),_:1})]),_:1},512),[[vue.vShow,vue.unref(ue)=="zbfx"]]),vue.unref(ue)=="zbqj"?(vue.openBlock(),vue.createBlock(vue.unref(elementPlus.ElMain),{key:0},{default:vue.withCtx(()=>[vue.createVNode(_sfc_main$16)]),_:1})):vue.createCommentVNode("",!0),vue.createVNode(aceIndicatorDesign,{ref_key:"designRef",ref:re,onClose:ge},null,512),vue.createVNode(_sfc_main$11,{ref_key:"modelIndicatorsAddRef",ref:le,onClickNode:he},null,512)]),_:1})}}}),_withScopeId$j=te=>(vue.pushScopeId("data-v-e52b7096"),te=te(),vue.popScopeId(),te),_hoisted_1$Q={class:"flex flex-col h-full"},_hoisted_2$G=_withScopeId$j(()=>vue.createElementVNode("i",{class:"mr-1 ri-add-circle-line"},null,-1)),_hoisted_3$A={class:"flex-1 mt-3 overflow-y-auto card-container"},_hoisted_4$z={key:0,class:"flex items-center justify-center h-full"},_hoisted_5$q=["onClick"],_hoisted_6$m={class:"flex items-center"},_hoisted_7$j=_withScopeId$j(()=>vue.createElementVNode("i",{class:"mr-1 ri-database-line"},null,-1)),_hoisted_8$f={class:"font-bold"},_hoisted_9$d={class:"flex items-center justify-between w-4/5 mt-3 ml-auto mr-auto"},_hoisted_10$c={class:"flex items-center"},_hoisted_11$a=_withScopeId$j(()=>vue.createElementVNode("i",{class:"mr-1 ri-checkbox-circle-fill text-color-success"},null,-1)),_hoisted_12$9=_withScopeId$j(()=>vue.createElementVNode("div",{class:"text-color-info"},"|",-1)),_hoisted_13$7={class:"flex justify-end mt-3 text-xs text-color-info pb"},_hoisted_14$6={class:"w-4/5 overflow-hidden whitespace-nowrap text-ellipsis"},_sfc_main$$=vue.defineComponent({__name:"menu",emits:["node-click"],setup(te,{expose:U,emit:G}){const{proxy:ee}=vue.getCurrentInstance(),{dataSourceSubmit:ne,testConnect:re,loadDataSourceMenu:oe}=fetch$1(ee).dbImport,{setFormValue:ie,getFormValue:le}=ee.$globalHooks.useForm(),{openMessage:ae}=ee.$globalHooks.useMessage(),se=ee.$globalDict,ue=G,ce=vue.ref([]),de=vue.ref(!0),fe=()=>{ce.value=[],de.value=!0,oe().then(xe=>{de.value=!1,ce.value=xe.data??[],xe.data.length&&vue.unref(be)==""&&ye(xe.data[0])})};fe();const ve=vue.reactive([{name:"数据源名称",type:FieldType.Text,fieldName:"name",value:"",required:!0},{name:"数据源类型",type:FieldType.Select,fieldName:"dataSourceType",value:"",dict:"storeType",required:!0,changeFunc:xe=>{if(!xe.value)return;let Ce=se.dataSourceUrlDemo.find($e=>$e.label.toLowerCase()===xe.value.toLowerCase());ve.find($e=>$e.fieldName==="dataSourceUrlDemo").value=(Ce==null?void 0:Ce.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}]),he=vue.ref(!1),pe=()=>{ie({},ve),he.value=!0},ge=xe=>{ve.find(Ce=>Ce.fieldName==="dataSourceUrl").value=xe.value},me=async()=>{const{params:xe,error:Ce}=le(ve);Ce.length>0||!await ne(xe)||(he.value=!1,ae({type:"success",message:"操作成功"}),fe())},_e=async()=>{const{params:xe,error:Ce}=le(ve);Ce.length>0||!await re(xe)||ae({type:"success",message:"数据库链接成功"})},be=vue.ref(""),ye=xe=>{vue.unref(be)!=xe.dataSourceId&&(be.value=xe.dataSourceId,ue("node-click",xe))};return U({initMenu:fe}),(xe,Ce)=>{const $e=vue.resolveComponent("aceHeader"),we=vue.resolveComponent("AppEmpty"),Ee=vue.resolveComponent("AppForm"),Ve=vue.resolveComponent("AppDialog");return vue.openBlock(),vue.createElementBlock("div",_hoisted_1$Q,[vue.createVNode($e,{title:"数据源"},{default:vue.withCtx(()=>[vue.createVNode(vue.unref(elementPlus.ElButton),{type:"primary",size:"small",onClick:pe},{default:vue.withCtx(()=>[_hoisted_2$G,vue.createTextVNode(" 新增 ")]),_:1})]),_:1}),vue.createElementVNode("div",_hoisted_3$A,[vue.createVNode(vue.unref(elementPlus.ElSkeleton),{loading:vue.unref(de),animated:""},{default:vue.withCtx(()=>[vue.unref(ce).length?(vue.openBlock(!0),vue.createElementBlock(vue.Fragment,{key:1},vue.renderList(vue.unref(ce),Se=>(vue.openBlock(),vue.createElementBlock("div",{key:Se.id,class:vue.normalizeClass(["item",{active:vue.unref(be)==Se.dataSourceId}]),onClick:ke=>ye(Se)},[vue.createElementVNode("div",_hoisted_6$m,[_hoisted_7$j,vue.createElementVNode("span",_hoisted_8$f,vue.toDisplayString(Se.dataSourceComment),1)]),vue.createElementVNode("div",_hoisted_9$d,[vue.createElementVNode("div",_hoisted_10$c,[_hoisted_11$a,vue.createTextVNode(" 已同步 "),vue.createElementVNode("strong",null,vue.toDisplayString(Se.synchronizedTableCount),1)]),_hoisted_12$9,vue.createElementVNode("div",null,[vue.createTextVNode(" 总表数 "),vue.createElementVNode("strong",null,vue.toDisplayString(Se.tableCount),1)])]),vue.createElementVNode("div",_hoisted_13$7,vue.toDisplayString(Se.version),1)],10,_hoisted_5$q))),128)):(vue.openBlock(),vue.createElementBlock("div",_hoisted_4$z,[vue.createVNode(we,{description:"暂无数据源"})]))]),_:1},8,["loading"])]),vue.createVNode(Ve,{modelValue:vue.unref(he),"onUpdate:modelValue":Ce[1]||(Ce[1]=Se=>vue.isRef(he)?he.value=Se:null),title:"新增接入数据源",size:700},{footer:vue.withCtx(()=>[vue.createVNode(vue.unref(elementPlus.ElButton),{style:{"margin-right":"auto"},type:"success",onClick:_e},{default:vue.withCtx(()=>[vue.createTextVNode(" 测试链接 ")]),_:1}),vue.createVNode(vue.unref(elementPlus.ElButton),{class:"ml-3",type:"primary",onClick:me},{default:vue.withCtx(()=>[vue.createTextVNode("保存")]),_:1}),vue.createVNode(vue.unref(elementPlus.ElButton),{class:"ml-3",onClick:Ce[0]||(Ce[0]=Se=>he.value=!1)},{default:vue.withCtx(()=>[vue.createTextVNode("取消")]),_:1})]),default:vue.withCtx(()=>[vue.createVNode(Ee,{form:vue.unref(ve),col:1,labelWidth:120},{dataSourceUrlDemo:vue.withCtx(({element:Se})=>[vue.createVNode(vue.unref(elementPlus.ElTooltip),{content:Se.value},{default:vue.withCtx(()=>[vue.createElementVNode("div",_hoisted_14$6,vue.toDisplayString(Se.value),1)]),_:2},1032,["content"]),vue.createVNode(vue.unref(elementPlus.ElButton),{type:"primary",onClick:ke=>ge(Se)},{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$$,[["__scopeId","data-v-e52b7096"]]),_sfc_main$_=vue.defineComponent({__name:"sourceTableData",setup(te,{expose:U}){const G=vue.ref(!1),ee=vue.ref(null),ne=vue.ref(""),re=vue.ref([]),oe=se=>{re.value=[],(se==null?void 0:se.data.length)>0&&(re.value=Object.keys(se.data[0]).filter(ue=>ue!="pageIndex").map(ue=>({label:ue,prop:ue})))},ie=vue.ref({}),le=se=>Object.assign(se,vue.unref(ie));return U({init:(se,ue)=>{vue.unref(ie).dataSourceId=se,vue.unref(ie).sourceTableCode=ue,G.value=!0,ne.value="/api/ace-data-center/data-source/sourceDataPage"}}),(se,ue)=>{const ce=vue.resolveComponent("AppList"),de=vue.resolveComponent("AppDrawer");return vue.openBlock(),vue.createBlock(de,{modelValue:vue.unref(G),"onUpdate:modelValue":ue[0]||(ue[0]=fe=>vue.isRef(G)?G.value=fe:null),title:"数据源明细",size:"90%"},{default:vue.withCtx(()=>[vue.createVNode(ce,{tableData:vue.unref(re),url:vue.unref(ne),ref_key:"appList",ref:ee,formatParamsFunc:le,onSuccess:oe,methods:"post"},null,8,["tableData","url"])]),_:1},8,["modelValue"])}}}),_hoisted_1$P={class:"mt-2"},_sfc_main$Z=vue.defineComponent({__name:"setting",emits:["refresh"],setup(te,{expose:U,emit:G}){const{proxy:ee}=vue.getCurrentInstance(),{setFormValue:ne,getFormValue:re}=ee.$globalHooks.useForm(),{openMessage:oe}=ee.$globalHooks.useMessage(),{submitDefaultDbExtract:ie}=fetch$1(ee).dbImport,le=G,ae=vue.ref(!1),se=vue.ref(!1),ue=vue.ref(null),ce=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:pe=>{ce.find(ge=>ge.fieldName=="incrementalField").hide=pe.value!=2}},{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}]),de=vue.ref(null),fe=vue.ref({}),ve=async pe=>{fe.value=pe,se.value=!1;const ge=await ee.$baseHttp.get("/api/ace-data-center/model-attribute/allModelAttribute",{params:{modelId:pe.modelId,projectId:ee.$baseGetCurrentProjectId()},headers:{loading:!0}});ce.find(me=>me.fieldName=="incrementalField").options=ge.data.map(me=>({...me,label:`${me.attributeCode}(${me.attributeComment||me.attributeCode})`,value:me.attributeCode})),ae.value=!0,vue.nextTick(()=>{ne({...pe,extractName:pe.extractName??"增量抽取"},ce),pe!=null&&pe.taskDefined&&(se.value=!0),vue.unref(ue).init((pe==null?void 0:pe.taskDefined)??{}),de.value=(pe==null?void 0:pe.taskDefined)??null})},he=async()=>{const{params:pe,error:ge}=re(ce);if(ge.length>0)return;if(vue.unref(se)){const{params:_e,error:be}=vue.unref(ue).getForm();if(be.length>0)return;pe.taskDefined={...vue.unref(de)??{},..._e}}pe.dataSourceId=vue.unref(fe).dataSourceId,pe.modelId=vue.unref(fe).modelId,pe.streamType="STANDARD",await ie(pe)&&(oe({type:"success",message:"操作成功"}),ae.value=!1,le("refresh"))};return U({init:ve}),(pe,ge)=>{const me=vue.resolveComponent("AppForm"),_e=vue.resolveComponent("aceHeader"),be=vue.resolveComponent("AppTaskDesign"),ye=vue.resolveComponent("AppDialog");return vue.openBlock(),vue.createBlock(ye,{modelValue:vue.unref(ae),"onUpdate:modelValue":ge[2]||(ge[2]=xe=>vue.isRef(ae)?ae.value=xe:null),title:"配置",size:500},{footer:vue.withCtx(()=>[vue.createVNode(vue.unref(elementPlus.ElButton),{class:"ml-3",type:"primary",onClick:he},{default:vue.withCtx(()=>[vue.createTextVNode("保存")]),_:1}),vue.createVNode(vue.unref(elementPlus.ElButton),{class:"ml-3",onClick:ge[1]||(ge[1]=xe=>ae.value=!1)},{default:vue.withCtx(()=>[vue.createTextVNode("取消")]),_:1})]),default:vue.withCtx(()=>[vue.createVNode(me,{form:vue.unref(ce)},null,8,["form"]),vue.createElementVNode("div",_hoisted_1$P,[vue.createVNode(_e,{title:"作业配置",class:"mb-2"},{left:vue.withCtx(()=>[vue.createVNode(vue.unref(elementPlus.ElCheckbox),{class:"ml-2",modelValue:vue.unref(se),"onUpdate:modelValue":ge[0]||(ge[0]=xe=>vue.isRef(se)?se.value=xe:null)},{default:vue.withCtx(()=>[vue.createTextVNode("作业配置")]),_:1},8,["modelValue"])]),_:1}),vue.withDirectives(vue.createElementVNode("div",null,[vue.createVNode(be,{ref_key:"taskDesignRef",ref:ue},null,512)],512),[[vue.vShow,vue.unref(se)]])])]),_:1},8,["modelValue"])}}}),_hoisted_1$O=vue.createElementVNode("i",{class:"mr-2 ri-exchange-line"},null,-1),_hoisted_2$F=vue.createElementVNode("i",{class:"mr-2 ri-refresh-line"},null,-1),_hoisted_3$z=vue.createElementVNode("div",null,null,-1),_hoisted_4$y=vue.createElementVNode("i",{class:"mr-2 ri-delete-bin-line"},null,-1),_sfc_main$Y=vue.defineComponent({__name:"model-extract-log",emits:["success"],setup(te,{expose:U,emit:G}){const{proxy:ee}=vue.getCurrentInstance(),{openMessage:ne}=ee.$globalHooks.useMessage(),re=G,oe=vue.ref(!1),ie=vue.ref(null),le=vue.ref(""),ae=vue.ref([]),se=ce=>{const{businessId:de,businessType:fe="file_extract",ajaxUrl:ve="",table:he}=ce;ae.value=he||[{label:"批次号",prop:"batchNo"},{label:"日期",prop:"createTime"},{label:"文件名",prop:"file",slot:!0},{label:"抽取方式",prop:"createTime",func:pe=>{var ge;return((ge=JSON.parse(pe.businessSnapshot||"{}"))==null?void 0:ge.extractType)==2?"覆盖":"追加"}},{label:"数据总数",prop:"totalNum"},{label:"成功数",prop:"successNum"},{label:"失败数",prop:"failNum"},{label:"协同参数",prop:"collaborateValue"},{label:"操作",prop:"action",slot:!0,fixed:"right"}],le.value=ve||`/api/ace-data-center/extract-log/list?descs=create_time&businessId=${de}&businessType=${fe}`,oe.value=!0},ue=async(ce,de)=>{switch(ce){case"refresh":{if(!await ee.$baseHttp.post(`/api/ace-data-center/extract-log/updateSuccessTotal/${de.id}`,{},{headers:{loading:!0}}))return;ne({type:"success",message:"操作成功"}),vue.unref(ie).getData(),re("success")}break;case"delete":ee.$baseConfirm({content:"删除数据可能影响指标统计,是否确认删除?",callConfirm:async()=>{await ee.$baseHttp.post(`/api/ace-data-center/extract-log/deleteModelData/${de.id}`,{},{headers:{loading:!0}})&&(ne({type:"success",message:"操作成功"}),vue.unref(ie).getData(),re("success"))}});break;case"run":ee.$baseConfirm({content:"重跑数据会先删除本批次数据,然后新建立一个批次任务执行,是否继续执行?",callConfirm:async()=>{await ee.$baseHttp.post(`/api/ace-data-center/extract-log/reRunTeamworkDbExtractBy/${de.id}`,{},{headers:{loading:!0}})&&(ne({type:"success",message:"操作成功"}),vue.unref(ie).getData(),re("success"))}});break;case"download":{const fe=JSON.parse((de==null?void 0:de.businessSnapshot)??"{}");window.open(fe.fileUrl)}break}};return U({init:se}),(ce,de)=>{const fe=vue.resolveComponent("AppList"),ve=vue.resolveComponent("AppDrawer");return vue.openBlock(),vue.createBlock(ve,{modelValue:vue.unref(oe),"onUpdate:modelValue":de[0]||(de[0]=he=>vue.isRef(oe)?oe.value=he:null),title:"抽取日志",size:"90%"},{default:vue.withCtx(()=>[vue.createVNode(fe,{tableData:vue.unref(ae),url:vue.unref(le),ref_key:"appList",ref:ie},{file:vue.withCtx(({row:he})=>[vue.createVNode(vue.unref(elementPlus.ElLink),{type:"primary",onClick:pe=>ue("download",he)},{default:vue.withCtx(()=>{var pe;return[vue.createTextVNode(vue.toDisplayString((pe=JSON.parse(he.businessSnapshot??"{}"))==null?void 0:pe.fileName),1)]}),_:2},1032,["onClick"])]),action:vue.withCtx(({row:he})=>{var pe;return[((pe=JSON.parse(he.businessSnapshot||"{}"))==null?void 0:pe.extractType)==3?(vue.openBlock(),vue.createBlock(vue.unref(elementPlus.ElLink),{key:0,type:"primary",class:"mr-2",onClick:ge=>ue("run",he)},{default:vue.withCtx(()=>[_hoisted_1$O,vue.createTextVNode(" 重跑 ")]),_:2},1032,["onClick"])):vue.createCommentVNode("",!0),vue.createVNode(vue.unref(elementPlus.ElLink),{type:"primary",onClick:ge=>ue("refresh",he)},{default:vue.withCtx(()=>[_hoisted_2$F,vue.createTextVNode(" 刷新 ")]),_:2},1032,["onClick"]),_hoisted_3$z,vue.createVNode(vue.unref(elementPlus.ElLink),{type:"danger",onClick:ge=>ue("delete",he)},{default:vue.withCtx(()=>[_hoisted_4$y,vue.createTextVNode(" 删除本批次数据 ")]),_:2},1032,["onClick"])]}),_:1},8,["tableData","url"])]),_:1},8,["modelValue"])}}}),_hoisted_1$N={class:"flex flex-col h-full overflow-hidden"},_hoisted_2$E={class:"flex flex-col flex-1 mt-3 overflow-hidden"},_hoisted_3$y={class:"app-search"},_hoisted_4$x=vue.createElementVNode("i",{class:"mr-1 ri-search-line"},null,-1),_hoisted_5$p={class:"flex flex-1 overflow-hidden"},_hoisted_6$l={class:"flex justify-end mt-3"},_hoisted_7$i={class:"flex justify-end mb-2"},_hoisted_8$e=vue.createElementVNode("i",{class:"mr-1 ri-add-line"},null,-1),_sfc_main$X=vue.defineComponent({__name:"view",emits:["refresh"],setup(te,{expose:U,emit:G}){const{proxy:ee}=vue.getCurrentInstance(),ne=vue.inject("modelEle"),{setFormValue:re,getFormValue:oe}=ee.$globalHooks.useForm(),{openMessage:ie}=ee.$globalHooks.useMessage(),{createModelSyncRelation:le,listDataSourceSynchronized:ae}=fetch$1(ee).dbImport,se=vue.ref(null),ue=vue.ref(null),ce=vue.ref(null),de=vue.ref(null),fe=G,{originlist:ve,list:he,pageLoading:pe,page:ge,pageSize:me,getData:_e,handleSizeChange:be,handleCurrentChange:ye}=ee.$globalHooks.usePage(),xe=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}]}]),Ce=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:Pe=>Pe==2?"success":"danger",func:Pe=>{var Te,De;return((Te=Pe.modelSyncDetail)==null?void 0:Te.synchronizeResult)=="2"?"正常":((De=Pe.modelSyncDetail)==null?void 0:De.synchronizeResult)=="1"?"异常":"-"}},{label:"目标表",prop:"relationTableCode"},{label:"目标数据",prop:"relationTableDataCount"},{label:"主键",prop:"primaryKeyColumn",func:Pe=>{var Te;return((Te=Pe==null?void 0:Pe.modelSyncDetail)==null?void 0:Te.primaryKeyColumn)??"-"}},{label:"增量字段",prop:"incrColumn",func:Pe=>{var Te;return((Te=Pe==null?void 0:Pe.modelSyncDetail)==null?void 0:Te.incrColumn)??"-"}},{label:"上次同步",prop:"lastSyncTime",func:Pe=>{var Te;return((Te=Pe==null?void 0:Pe.modelSyncDetail)==null?void 0:Te.lastSyncTime)??"-"}},{label:"操作",prop:"htmlButton",fixed:"right",width:"120px"}]),$e=async(Pe=!0)=>{Pe&&(re({},xe),ge.value=1),pe.value=!0;const{params:Te}=oe(xe,!1,!0),De=await ae({dataSourceId:vue.unref(ne).dataSourceId,...Te});if(pe.value=!1,!De){ve.value=[];return}De.data.forEach(Oe=>{var Be;(Be=Oe==null?void 0:Oe.modelSyncDetail)!=null&&Be.modelId&&(Oe.htmlButton=[{name:"配置",key:"setting",type:"primary"},{name:"历史",key:"history",type:"primary"}])}),ve.value=De.data,_e()},we=async Pe=>{await le({sourceId:Pe.dataSourceId,sourceTableCode:Pe.sourceTableCode})&&(ie({type:"success",message:"操作成功"}),fe("refresh"),$e(!1))},Ee=vue.ref(!1),Ve=vue.ref(""),Se=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"}]),ke=Pe=>{Pe.data.forEach(Te=>{Te.htmlButton=[],Te.htmlButton.push({name:"编辑",key:"EDIT",type:"primary",icon:"ri-edit-line"}),Te.htmlButton.push({name:"抽取记录",key:"LOG",type:"primary",icon:"ri-file-line"}),[1,2].includes(Te.extractType)&&Te.htmlButton.push({name:"抽取",key:"PUSH",type:"primary",icon:"ri-pushpin-line"}),Te.htmlButton.push({name:"删除",key:"DEL",type:"danger",icon:"ri-delete-bin-6-line"})})},Ne=vue.ref({}),Ie=async Pe=>{var Be;const{type:Te,row:De,index:Oe}=Pe;switch(Te){case"history":vue.unref(ce).init({ajaxUrl:`/api/ace-data-center/extract-log/modelSyncHistory?descs=create_time&modelId=${De.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(ce).init({businessId:De.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":ee.$baseConfirm({content:"是否抽取?",callConfirm:async()=>{await ee.$baseHttp.post(`/api/ace-data-center/db-extract/extract/${De.id}`,{},{headers:{loading:!0}})&&ie({type:"success",message:"操作成功"})}});break;case"DEL":ee.$baseConfirm({content:"是否删除?",callConfirm:async()=>{await ee.$baseHttp.post(`/api/ace-data-center/db-extract/removeById/${De.id}`,{},{headers:{loading:!0}})&&(ie({type:"success",message:"操作成功"}),vue.unref(se).getData())}});break;case"EDIT":const Ae=await ee.$baseHttp.get(`/api/ace-data-center/db-extract/detailAndTask?dbExtractId=${De.id}`);if(!Ae)return;vue.unref(ue).init(Ae.data);break;case"ADD":vue.unref(ue).init({dataSourceId:vue.unref(Ne).dataSourceId,modelId:(Be=vue.unref(Ne))==null?void 0:Be.modelSyncDetail.modelId});break;case"setting":Ee.value=!0,Ne.value=De,Ve.value=`/api/ace-data-center/db-extract/list?modelId=${De.modelSyncDetail.modelId}&projectId=${ee.$baseGetCurrentProjectId()}`;break;case"source-table-data":vue.unref(de).init(De.dataSourceId,De.sourceTableCode);break}};return U({init:$e}),(Pe,Te)=>{const De=vue.resolveComponent("aceHeader"),Oe=vue.resolveComponent("AppForm"),Be=vue.resolveComponent("AppTable"),Ae=vue.resolveComponent("AppList"),Le=vue.resolveComponent("AppDrawer");return vue.openBlock(),vue.createElementBlock("div",_hoisted_1$N,[vue.createVNode(De,{title:vue.unref(ne).dataSourceComment},null,8,["title"]),vue.createElementVNode("div",_hoisted_2$E,[vue.createElementVNode("div",_hoisted_3$y,[vue.createVNode(Oe,{form:vue.unref(xe)},{default:vue.withCtx(()=>[vue.createVNode(vue.unref(elementPlus.ElButton),{type:"primary",class:"ml-1",onClick:Te[0]||(Te[0]=Re=>$e(!1))},{default:vue.withCtx(()=>[_hoisted_4$x,vue.createTextVNode(" 查询 ")]),_:1})]),_:1},8,["form"])]),vue.createElementVNode("div",_hoisted_5$p,[vue.createVNode(Be,{tableData:vue.unref(Ce),list:vue.unref(he),loading:vue.unref(pe),onTableBtnClick:Ie},{related:vue.withCtx(({row:Re})=>[Re.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:Fe=>we(Re)},{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:Re})=>[Re.sourceTableDataCount==0?(vue.openBlock(),vue.createElementBlock(vue.Fragment,{key:0},[vue.createTextVNode(vue.toDisplayString(Re.sourceTableDataCount),1)],64)):(vue.openBlock(),vue.createBlock(vue.unref(elementPlus.ElLink),{key:1,type:"primary",onClick:Fe=>Ie({type:"source-table-data",row:Re,index:-1})},{default:vue.withCtx(()=>[vue.createTextVNode(vue.toDisplayString(Re.sourceTableDataCount),1)]),_:2},1032,["onClick"]))]),_:1},8,["tableData","list","loading"])]),vue.createElementVNode("div",_hoisted_6$l,[vue.createVNode(vue.unref(elementPlus.ElPagination),{"current-page":vue.unref(ge),"onUpdate:currentPage":Te[1]||(Te[1]=Re=>vue.isRef(ge)?ge.value=Re:null),"page-size":vue.unref(me),"onUpdate:pageSize":Te[2]||(Te[2]=Re=>vue.isRef(me)?me.value=Re:null),"page-sizes":[10,20,40,60,80,100],background:!0,layout:"total, sizes, prev, pager, next, jumper",total:vue.unref(ve).length,onCurrentChange:vue.unref(ye),onSizeChange:vue.unref(be)},null,8,["current-page","page-size","total","onCurrentChange","onSizeChange"])])]),vue.createVNode(Le,{modelValue:vue.unref(Ee),"onUpdate:modelValue":Te[4]||(Te[4]=Re=>vue.isRef(Ee)?Ee.value=Re:null),title:"数据同步方案",size:"1000px"},{default:vue.withCtx(()=>[vue.createElementVNode("div",_hoisted_7$i,[vue.createVNode(vue.unref(elementPlus.ElButton),{type:"primary",onClick:Te[3]||(Te[3]=Re=>Ie({type:"ADD",row:{},index:0}))},{default:vue.withCtx(()=>[_hoisted_8$e,vue.createTextVNode(" 新增 ")]),_:1})]),vue.createVNode(Ae,{tableData:vue.unref(Se),url:vue.unref(Ve),ref_key:"appListRef",ref:se,onBtnClick:Ie,onSuccess:ke},null,8,["tableData","url"])]),_:1},8,["modelValue"]),vue.createVNode(_sfc_main$Z,{ref_key:"settingRef",ref:ue,onRefresh:Te[5]||(Te[5]=Re=>vue.unref(se).getData({clear:!0}))},null,512),vue.createVNode(_sfc_main$Y,{ref_key:"extractLogRef",ref:ce},null,512),vue.createVNode(_sfc_main$_,{ref_key:"sourceTableDataRef",ref:de},null,512)])}}}),_hoisted_1$M={key:0,class:"flex items-center justify-center h-full"},_sfc_main$W=vue.defineComponent({__name:"index",setup(te){const U=vue.ref(null),G=vue.ref(null),ee=vue.ref({});vue.provide("modelEle",ee);const ne=vue.inject("local"),re=oe=>{ee.value=oe,vue.nextTick(()=>{vue.unref(U).init()})};return(oe,ie)=>{const le=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(ne)},{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:G,onNodeClick:re},null,512)]),_:1}),vue.createVNode(vue.unref(elementPlus.ElMain),null,{default:vue.withCtx(()=>[vue.unref(ee).dataSourceId?(vue.openBlock(),vue.createBlock(_sfc_main$X,{key:1,ref_key:"viewRef",ref:U,onRefresh:ie[0]||(ie[0]=ae=>vue.unref(G).initMenu())},null,512)):(vue.openBlock(),vue.createElementBlock("div",_hoisted_1$M,[vue.createVNode(le,{description:"请选择数据源"})]))]),_:1})]),_:1},8,["locale"])]),_:1})}}}),_withScopeId$i=te=>(vue.pushScopeId("data-v-cabcba66"),te=te(),vue.popScopeId(),te),_hoisted_1$L={class:"flex flex-col h-full"},_hoisted_2$D=_withScopeId$i(()=>vue.createElementVNode("i",{class:"mr-1 ri-add-circle-line"},null,-1)),_hoisted_3$x={class:"flex-1 mt-3 overflow-y-auto card-container"},_hoisted_4$w={key:0,class:"flex items-center justify-center h-full"},_hoisted_5$o=["onClick"],_hoisted_6$k={class:"flex items-center justify-between"},_hoisted_7$h={class:"flex-1 mr-2.5"},_hoisted_8$d=_withScopeId$i(()=>vue.createElementVNode("i",{class:"mr-1 ri-database-line"},null,-1)),_hoisted_9$c={class:"font-bold"},_hoisted_10$b=_withScopeId$i(()=>vue.createElementVNode("i",{class:"mr-1 ri-edit-circle-line"},null,-1)),_hoisted_11$9={class:"flex items-center justify-between w-4/5 mt-3 ml-auto mr-auto"},_hoisted_12$8={class:"flex items-center"},_hoisted_13$6=_withScopeId$i(()=>vue.createElementVNode("i",{class:"mr-1 ri-checkbox-circle-fill text-color-success"},null,-1)),_hoisted_14$5=_withScopeId$i(()=>vue.createElementVNode("div",{class:"text-color-info"},"|",-1)),_hoisted_15$3={class:"flex justify-end mt-3 text-xs text-color-info pb"},_hoisted_16$3={class:"w-4/5 overflow-hidden whitespace-nowrap text-ellipsis"},_sfc_main$V=vue.defineComponent({__name:"menu",emits:["node-click"],setup(te,{expose:U,emit:G}){const{proxy:ee}=vue.getCurrentInstance(),{dataSourceSubmit:ne,testConnect:re,loadDataSourceMenu:oe,detail:ie}=fetch$1(ee).dbImport,{setFormValue:le,getFormValue:ae}=ee.$globalHooks.useForm(),{openMessage:se}=ee.$globalHooks.useMessage(),ue=ee.$globalDict,ce=G,de=vue.ref([]),fe=vue.ref(!0),ve=()=>{de.value=[],fe.value=!0,oe().then($e=>{fe.value=!1,de.value=$e.data??[],$e.data.length&&vue.unref(xe)==""&&Ce($e.data[0])})};ve();const he=vue.reactive([{name:"数据源名称",type:FieldType.Text,fieldName:"name",value:"",required:!0},{name:"数据源类型",type:FieldType.Select,fieldName:"dataSourceType",value:"",dict:"storeType",required:!0,changeFunc:$e=>{if(!$e.value)return;let we=ue.dataSourceUrlDemo.find(Ee=>Ee.label.toLowerCase()===$e.value.toLowerCase());he.find(Ee=>Ee.fieldName==="dataSourceUrlDemo").value=(we==null?void 0:we.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}]),pe=vue.ref(!1),ge=()=>{le({},he),pe.value=!0},me=async $e=>{const we=await ie({id:$e.dataSourceId});le(we.data,he),pe.value=!0},_e=$e=>{he.find(we=>we.fieldName==="dataSourceUrl").value=$e.value},be=async()=>{const{params:$e,error:we}=ae(he);we.length>0||($e.id||delete $e.id,!await ne($e))||(pe.value=!1,se({type:"success",message:"操作成功"}),ve())},ye=async()=>{const{params:$e,error:we}=ae(he);we.length>0||!await re($e)||se({type:"success",message:"数据库链接成功"})},xe=vue.ref(""),Ce=$e=>{vue.unref(xe)!=$e.dataSourceId&&(xe.value=$e.dataSourceId,ce("node-click",$e))};return U({initMenu:ve}),($e,we)=>{const Ee=vue.resolveComponent("aceHeader"),Ve=vue.resolveComponent("AppEmpty"),Se=vue.resolveComponent("AppForm"),ke=vue.resolveComponent("AppDialog");return vue.openBlock(),vue.createElementBlock("div",_hoisted_1$L,[vue.createVNode(Ee,{title:"数据源"},{default:vue.withCtx(()=>[vue.createVNode(vue.unref(elementPlus.ElButton),{type:"primary",size:"small",onClick:ge},{default:vue.withCtx(()=>[_hoisted_2$D,vue.createTextVNode(" 新增 ")]),_:1})]),_:1}),vue.createElementVNode("div",_hoisted_3$x,[vue.createVNode(vue.unref(elementPlus.ElSkeleton),{loading:vue.unref(fe),animated:""},{default:vue.withCtx(()=>[vue.unref(de).length?(vue.openBlock(!0),vue.createElementBlock(vue.Fragment,{key:1},vue.renderList(vue.unref(de),Ne=>(vue.openBlock(),vue.createElementBlock("div",{key:Ne.id,class:vue.normalizeClass(["item",{active:vue.unref(xe)==Ne.dataSourceId}]),onClick:Ie=>Ce(Ne)},[vue.createElementVNode("div",_hoisted_6$k,[vue.createElementVNode("div",_hoisted_7$h,[_hoisted_8$d,vue.createElementVNode("span",_hoisted_9$c,vue.toDisplayString(Ne.dataSourceComment),1)]),vue.createVNode(vue.unref(elementPlus.ElLink),{type:"primary",onClick:vue.withModifiers(Ie=>me(Ne),["stop"])},{default:vue.withCtx(()=>[_hoisted_10$b,vue.createTextVNode(" 修改 ")]),_:2},1032,["onClick"])]),vue.createElementVNode("div",_hoisted_11$9,[vue.createElementVNode("div",_hoisted_12$8,[_hoisted_13$6,vue.createTextVNode(" 已同步 "),vue.createElementVNode("strong",null,vue.toDisplayString(Ne.synchronizedShadowTableCount),1)]),_hoisted_14$5,vue.createElementVNode("div",null,[vue.createTextVNode(" 总表数 "),vue.createElementVNode("strong",null,vue.toDisplayString(Ne.tableCount),1)])]),vue.createElementVNode("div",_hoisted_15$3,vue.toDisplayString(Ne.version),1)],10,_hoisted_5$o))),128)):(vue.openBlock(),vue.createElementBlock("div",_hoisted_4$w,[vue.createVNode(Ve,{description:"暂无数据源"})]))]),_:1},8,["loading"])]),vue.createVNode(ke,{modelValue:vue.unref(pe),"onUpdate:modelValue":we[1]||(we[1]=Ne=>vue.isRef(pe)?pe.value=Ne:null),title:"新增接入数据源",size:700},{footer:vue.withCtx(()=>[vue.createVNode(vue.unref(elementPlus.ElButton),{style:{"margin-right":"auto"},type:"success",onClick:ye},{default:vue.withCtx(()=>[vue.createTextVNode(" 测试链接 ")]),_:1}),vue.createVNode(vue.unref(elementPlus.ElButton),{class:"ml-3",type:"primary",onClick:be},{default:vue.withCtx(()=>[vue.createTextVNode("保存")]),_:1}),vue.createVNode(vue.unref(elementPlus.ElButton),{class:"ml-3",onClick:we[0]||(we[0]=Ne=>pe.value=!1)},{default:vue.withCtx(()=>[vue.createTextVNode("取消")]),_:1})]),default:vue.withCtx(()=>[vue.createVNode(Se,{form:vue.unref(he),col:1,labelWidth:120},{dataSourceUrlDemo:vue.withCtx(({element:Ne})=>[vue.createVNode(vue.unref(elementPlus.ElTooltip),{content:Ne.value},{default:vue.withCtx(()=>[vue.createElementVNode("div",_hoisted_16$3,vue.toDisplayString(Ne.value),1)]),_:2},1032,["content"]),vue.createVNode(vue.unref(elementPlus.ElButton),{type:"primary",onClick:Ie=>_e(Ne)},{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$V,[["__scopeId","data-v-cabcba66"]]),_sfc_main$U=vue.defineComponent({__name:"sourceTableData",setup(te,{expose:U}){const G=vue.ref(!1),ee=vue.ref(null),ne=vue.ref(""),re=vue.ref([]),oe=se=>{re.value=[],(se==null?void 0:se.data.length)>0&&(re.value=Object.keys(se.data[0]).filter(ue=>ue!="pageIndex").map(ue=>({label:ue,prop:ue})))},ie=vue.ref({}),le=se=>Object.assign(se,vue.unref(ie));return U({init:(se,ue)=>{vue.unref(ie).dataSourceId=se,vue.unref(ie).sourceTableCode=ue,G.value=!0,ne.value="/api/ace-data-center/data-source/sourceDataPage"}}),(se,ue)=>{const ce=vue.resolveComponent("AppList"),de=vue.resolveComponent("AppDrawer");return vue.openBlock(),vue.createBlock(de,{modelValue:vue.unref(G),"onUpdate:modelValue":ue[0]||(ue[0]=fe=>vue.isRef(G)?G.value=fe:null),title:"数据源明细",size:"90%"},{default:vue.withCtx(()=>[vue.createVNode(ce,{tableData:vue.unref(re),url:vue.unref(ne),ref_key:"appList",ref:ee,formatParamsFunc:le,onSuccess:oe,methods:"post"},null,8,["tableData","url"])]),_:1},8,["modelValue"])}}}),_withScopeId$h=te=>(vue.pushScopeId("data-v-9a318098"),te=te(),vue.popScopeId(),te),_hoisted_1$K={class:"mt-3"},_hoisted_2$C=_withScopeId$h(()=>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$w={class:"sort-target"},_hoisted_4$v={key:0},_sfc_main$T=vue.defineComponent({__name:"model-normal",emits:["success"],setup(te,{expose:U,emit:G}){const{proxy:ee}=vue.getCurrentInstance(),{setFormValue:ne,getFormValue:re}=ee.$globalHooks.useForm(),oe=G,ie=vue.ref(!1),le=vue.ref(""),ae=vue.ref([]);vue.ref("");const se=vue.ref([]),ue=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:fe=>{},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}]),ce=fe=>{ie.value=!0,le.value="",ae.value=[],se.value=(fe?(fe==null?void 0:fe.listModelAttribute)??[]:[{nanoid:nanoid()}]).map(ve=>{const he=((ve==null?void 0:ve.attributeCode)??"").split("");return ve.nanoid=nanoid(),he[0]=="_"&&(ve.hide=!0),ve}),ne({...fe??{},projectId:ee.$baseGetCurrentProjectId()},ue)},de=async()=>{const{params:fe,error:ve}=re(ue);if(ve.length>0)return;const he="/api/ace-data-center/model/editModelDetail";await ee.$baseHttp.post(he,{...fe,projectId:String(ee.$baseGetCurrentProjectId()),listModelAttribute:vue.unref(se)},{headers:{loading:!0}})&&(ie.value=!1,ee.$message.success("操作成功"),oe("success"))};return U({init:ce}),(fe,ve)=>{const he=vue.resolveComponent("AppForm"),pe=vue.resolveComponent("aceHeader"),ge=vue.resolveComponent("AppDrawer");return vue.openBlock(),vue.createBlock(ge,{modelValue:vue.unref(ie),"onUpdate:modelValue":ve[1]||(ve[1]=me=>vue.isRef(ie)?ie.value=me:null),title:"影子模型",size:"100%"},{footer:vue.withCtx(()=>[vue.createVNode(vue.unref(elementPlus.ElButton),{class:"ml-3",type:"primary",onClick:de},{default:vue.withCtx(()=>[vue.createTextVNode("提交")]),_:1}),vue.renderSlot(fe.$slots,"formFooter",{},void 0,!0),vue.createVNode(vue.unref(elementPlus.ElButton),{class:"ml-3",onClick:ve[0]||(ve[0]=me=>ie.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(he,{form:vue.unref(ue)},null,8,["form"])]),_:1}),vue.createVNode(vue.unref(elementPlus.ElMain),null,{default:vue.withCtx(()=>[vue.createVNode(pe,{title:"影子模型属性"}),vue.createElementVNode("table",_hoisted_1$K,[_hoisted_2$C,vue.createElementVNode("tbody",_hoisted_3$w,[(vue.openBlock(!0),vue.createElementBlock(vue.Fragment,null,vue.renderList(vue.unref(se),(me,_e)=>(vue.openBlock(),vue.createElementBlock(vue.Fragment,{key:me.nanoid},[me.hide?vue.createCommentVNode("",!0):(vue.openBlock(),vue.createElementBlock("tr",_hoisted_4$v,[vue.createElementVNode("td",null,vue.toDisplayString(me.attributeCode),1),vue.createElementVNode("td",null,[vue.createVNode(vue.unref(elementPlus.ElInput),{modelValue:me.attributeComment,"onUpdate:modelValue":be=>me.attributeComment=be,maxlength:"30",showWordLimit:"",placeholder:"字段描述"},null,8,["modelValue","onUpdate:modelValue"])]),vue.createElementVNode("td",null,vue.toDisplayString(me.mapCode),1),vue.createElementVNode("td",null,[vue.createVNode(vue.unref(elementPlus.ElSelect),{modelValue:me.dataType,"onUpdate:modelValue":be=>me.dataType=be,placeholder:"数据类型",style:{width:"100%"},disabled:""},{default:vue.withCtx(()=>[(vue.openBlock(!0),vue.createElementBlock(vue.Fragment,null,vue.renderList(vue.unref(commonDataType),be=>(vue.openBlock(),vue.createBlock(vue.unref(elementPlus.ElOption),{key:be.value,label:be.label,value:be.value},null,8,["label","value"]))),128))]),_:2},1032,["modelValue","onUpdate:modelValue"])]),vue.createElementVNode("td",null,vue.toDisplayString(me.dataLength),1),vue.createElementVNode("td",null,vue.toDisplayString(me.dataScale??"-"),1),vue.createElementVNode("td",null,[vue.createVNode(vue.unref(elementPlus.ElSwitch),{modelValue:me.primaryKey,"onUpdate:modelValue":be=>me.primaryKey=be,"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:me.uniqueKey,"onUpdate:modelValue":be=>me.uniqueKey=be,"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_9a318098_lang="",ModelNormal=_export_sfc$2(_sfc_main$T,[["__scopeId","data-v-9a318098"]]),_hoisted_1$J={class:"flex flex-col h-full overflow-hidden"},_hoisted_2$B={class:"flex flex-col flex-1 mt-3 overflow-hidden"},_hoisted_3$v={class:"app-search"},_hoisted_4$u=vue.createElementVNode("i",{class:"mr-1 ri-search-line"},null,-1),_hoisted_5$n={class:"flex flex-1 overflow-hidden"},_hoisted_6$j={class:"flex justify-end mt-3"},_sfc_main$S=vue.defineComponent({__name:"view",emits:["refresh"],setup(te,{expose:U,emit:G}){const{proxy:ee}=vue.getCurrentInstance(),ne=vue.inject("modelEle"),{setFormValue:re,getFormValue:oe}=ee.$globalHooks.useForm(),{openMessage:ie}=ee.$globalHooks.useMessage(),{createShadowModelSync:le,listDataSourceSynchronized:ae}=fetch$1(ee).dbImport,se=vue.ref(null),ue=vue.ref(null),ce=G,{originlist:de,list:fe,pageLoading:ve,page:he,pageSize:pe,getData:ge,handleSizeChange:me,handleCurrentChange:_e}=ee.$globalHooks.usePage(),be=vue.reactive([{name:"源表",type:FieldType.Text,fieldName:"sourceTableCode",value:""},{name:"源表名",type:FieldType.Text,fieldName:"sourceTableComment",value:""}]),ye=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"}]),xe=async($e=!0)=>{$e&&(re({},be),he.value=1),ve.value=!0;const{params:we}=oe(be,!1,!0),Ee=await ae({dataSourceId:vue.unref(ne).dataSourceId,...we});if(ve.value=!1,!Ee){de.value=[];return}Ee.data.forEach(Ve=>{Ve.shadowModelId?Ve.htmlButton=[{name:"编辑",key:"EDIT",type:"primary"}]:Ve.htmlButton=[{name:"创建影子模型",key:"CREATE",type:"primary"}]}),de.value=Ee.data,ge()},Ce=async $e=>{const{type:we,row:Ee,index:Ve}=$e;switch(we){case"EDIT":{const Se=await ee.$baseHttp.get(`/api/ace-data-center/model/detail?id=${Ee==null?void 0:Ee.shadowModelId}`);if(!Se)return;ee.$refs.normalRef.init(Se.data)}break;case"CREATE":ee.$baseConfirm({content:"是否创建影子模型?",callConfirm:async()=>{await le({sourceId:Ee.dataSourceId,sourceTableCode:Ee.sourceTableCode})&&(ie({type:"success",message:"操作成功"}),ce("refresh"),xe(!1))}});break;case"source-table-data":vue.unref(ue).init(Ee.dataSourceId,Ee.sourceTableCode);break}};return U({init:xe}),($e,we)=>{const Ee=vue.resolveComponent("aceHeader"),Ve=vue.resolveComponent("AppForm"),Se=vue.resolveComponent("AppTable");return vue.openBlock(),vue.createElementBlock("div",_hoisted_1$J,[vue.createVNode(Ee,{title:vue.unref(ne).dataSourceComment},null,8,["title"]),vue.createElementVNode("div",_hoisted_2$B,[vue.createElementVNode("div",_hoisted_3$v,[vue.createVNode(Ve,{form:vue.unref(be)},{default:vue.withCtx(()=>[vue.createVNode(vue.unref(elementPlus.ElButton),{type:"primary",class:"ml-1",onClick:we[0]||(we[0]=ke=>xe(!1))},{default:vue.withCtx(()=>[_hoisted_4$u,vue.createTextVNode(" 查询 ")]),_:1})]),_:1},8,["form"])]),vue.createElementVNode("div",_hoisted_5$n,[vue.createVNode(Se,{tableData:vue.unref(ye),list:vue.unref(fe),loading:vue.unref(ve),onTableBtnClick:Ce},{shadowModelId:vue.withCtx(({row:ke})=>[ke.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:ke})=>[ke.sourceTableDataCount==0?(vue.openBlock(),vue.createElementBlock(vue.Fragment,{key:0},[vue.createTextVNode(vue.toDisplayString(ke.sourceTableDataCount),1)],64)):(vue.openBlock(),vue.createBlock(vue.unref(elementPlus.ElLink),{key:1,type:"primary",onClick:Ne=>Ce({type:"source-table-data",row:ke,index:-1})},{default:vue.withCtx(()=>[vue.createTextVNode(vue.toDisplayString(ke.sourceTableDataCount),1)]),_:2},1032,["onClick"]))]),_:1},8,["tableData","list","loading"])]),vue.createElementVNode("div",_hoisted_6$j,[vue.createVNode(vue.unref(elementPlus.ElPagination),{"current-page":vue.unref(he),"onUpdate:currentPage":we[1]||(we[1]=ke=>vue.isRef(he)?he.value=ke:null),"page-size":vue.unref(pe),"onUpdate:pageSize":we[2]||(we[2]=ke=>vue.isRef(pe)?pe.value=ke:null),"page-sizes":[10,20,40,60,80,100],background:!0,layout:"total, sizes, prev, pager, next, jumper",total:vue.unref(de).length,onCurrentChange:vue.unref(_e),onSizeChange:vue.unref(me)},null,8,["current-page","page-size","total","onCurrentChange","onSizeChange"])])]),vue.createVNode(ModelNormal,{ref_key:"normalRef",ref:se},null,512),vue.createVNode(_sfc_main$U,{ref_key:"sourceTableDataRef",ref:ue},null,512)])}}}),_hoisted_1$I={key:0,class:"flex items-center justify-center h-full"},_sfc_main$R=vue.defineComponent({__name:"index",setup(te){const U=vue.ref(null),G=vue.ref(null),ee=vue.ref({});vue.provide("modelEle",ee);const ne=vue.inject("local"),re=oe=>{ee.value=oe,vue.nextTick(()=>{vue.unref(U).init()})};return(oe,ie)=>{const le=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(ne)},{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:G,onNodeClick:re},null,512)]),_:1}),vue.createVNode(vue.unref(elementPlus.ElMain),null,{default:vue.withCtx(()=>[vue.unref(ee).dataSourceId?(vue.openBlock(),vue.createBlock(_sfc_main$S,{key:1,ref_key:"viewRef",ref:U,onRefresh:ie[0]||(ie[0]=ae=>vue.unref(G).initMenu())},null,512)):(vue.openBlock(),vue.createElementBlock("div",_hoisted_1$I,[vue.createVNode(le,{description:"请选择数据源"})]))]),_:1})]),_:1},8,["locale"])]),_:1})}}}),_hoisted_1$H=vue.createElementVNode("i",{class:"ri-search-line"},null,-1),_hoisted_2$A={class:"mt-3"},_hoisted_3$u={class:"mt-3"},_hoisted_4$t={key:1,class:"mr-1 -ml-5 text-base ri-edit-circle-fill text-color-primary"},_sfc_main$Q=vue.defineComponent({__name:"menu",emits:["node-click"],setup(te,{expose:U,emit:G}){const ee=vue.ref(""),ne=vue.ref(null),re=vue.ref([{label:"源视图表",value:"ODSVIEW"},{label:"整合数据表",value:"DWD"}]),oe=vue.ref(vue.unref(re)[0].value),{proxy:ie}=vue.getCurrentInstance(),le=G;vue.watch(ee,ve=>{vue.unref(ne).filter(ve)});const ae=(ve,he)=>ve?he.name.includes(ve):!0,se=vue.ref([]),ue=vue.ref([]),ce=vue.ref(!0),de=()=>{ce.value=!0,Promise.all([fetch$1(ie).loadModelMenu({modelLayer:"ODSVIEW"}),fetch$1(ie).loadModelMenu({modelLayer:"DWD"})]).then(ve=>{se.value=Object.keys(ve[0].data).map(he=>({modelName:he,id:he,children:ve[0].data[he]})),ue.value=Object.keys(ve[1].data).map(he=>({modelName:he,id:he,children:ve[1].data[he]})),ce.value=!1})};de();const fe=ve=>{Array.isArray(ve.children)||le("node-click",ve)};return U({init:de}),(ve,he)=>{const pe=vue.resolveComponent("aceHeader");return vue.openBlock(),vue.createElementBlock(vue.Fragment,null,[vue.createVNode(pe,{title:"整合数据",class:"mb-2"},{default:vue.withCtx(()=>[vue.renderSlot(ve.$slots,"top")]),_:3}),vue.createVNode(vue.unref(elementPlus.ElInput),{placeholder:"请输入内容",clearable:"",modelValue:vue.unref(ee),"onUpdate:modelValue":he[0]||(he[0]=ge=>vue.isRef(ee)?ee.value=ge:null)},{prefix:vue.withCtx(()=>[_hoisted_1$H]),_:1},8,["modelValue"]),vue.createElementVNode("div",_hoisted_2$A,[vue.createVNode(vue.unref(elementPlus.ElButtonGroup),null,{default:vue.withCtx(()=>[(vue.openBlock(!0),vue.createElementBlock(vue.Fragment,null,vue.renderList(vue.unref(re),ge=>(vue.openBlock(),vue.createBlock(vue.unref(elementPlus.ElButton),{type:vue.unref(oe)==ge.value?"primary":"",key:ge.value,onClick:me=>oe.value=ge.value},{default:vue.withCtx(()=>[vue.createTextVNode(vue.toDisplayString(ge.label),1)]),_:2},1032,["type","onClick"]))),128))]),_:1})]),vue.createElementVNode("div",_hoisted_3$u,[vue.createVNode(vue.unref(elementPlus.ElSkeleton),{animated:"",loading:vue.unref(ce),count:2},{default:vue.withCtx(()=>[vue.createVNode(vue.unref(elementPlus.ElTree),{class:"animated fadeIn",ref_key:"treeRef",ref:ne,data:vue.unref(oe)=="DWD"?vue.unref(ue):vue.unref(se),"node-key":"id","default-expand-all":"","highlight-current":"","filter-node-method":ae,onNodeClick:fe},{default:vue.withCtx(({node:ge,data:me})=>[ge.level!=1?(vue.openBlock(),vue.createElementBlock(vue.Fragment,{key:0},[me.modelCode&&me.openForm!=2?(vue.openBlock(),vue.createElementBlock("i",{key:0,class:vue.normalizeClass(["mr-1 -ml-5 text-base ri-checkbox-circle-fill",[me.publishStatus==2?"text-color-success":"text-color-info"]])},null,2)):vue.createCommentVNode("",!0)],64)):vue.createCommentVNode("",!0),me.openForm==2?(vue.openBlock(),vue.createElementBlock("i",_hoisted_4$t)):vue.createCommentVNode("",!0),vue.createElementVNode("span",{class:vue.normalizeClass({"font-bold":ge.level==1})},vue.toDisplayString(me.modelName),3)]),_:1},8,["data"])]),_:1},8,["loading"])])],64)}}}),_withScopeId$g=te=>(vue.pushScopeId("data-v-8dbf5661"),te=te(),vue.popScopeId(),te),_hoisted_1$G={class:"mt-3"},_hoisted_2$z=_withScopeId$g(()=>vue.createElementVNode("td",null,"字段名称",-1)),_hoisted_3$t=_withScopeId$g(()=>vue.createElementVNode("td",null,"字段描述",-1)),_hoisted_4$s=_withScopeId$g(()=>vue.createElementVNode("td",null,"映射字段",-1)),_hoisted_5$m=_withScopeId$g(()=>vue.createElementVNode("td",{width:"120px"},"数据类型",-1)),_hoisted_6$i=_withScopeId$g(()=>vue.createElementVNode("td",null,"数据长度",-1)),_hoisted_7$g=_withScopeId$g(()=>vue.createElementVNode("td",null,"数据标度",-1)),_hoisted_8$c=_withScopeId$g(()=>vue.createElementVNode("td",null,"是否主键",-1)),_hoisted_9$b=_withScopeId$g(()=>vue.createElementVNode("td",null,"唯一校验",-1)),_hoisted_10$a=_withScopeId$g(()=>vue.createElementVNode("td",{style:{width:"50px"}},null,-1)),_hoisted_11$8={class:"sort-target"},_hoisted_12$7={key:0},_hoisted_13$5=["onClick"],_hoisted_14$4=_withScopeId$g(()=>vue.createElementVNode("td",null,[vue.createElementVNode("i",{class:"text-lg cursor-move ri-mouse-line handle text-color-warning"})],-1)),_sfc_main$P=vue.defineComponent({__name:"attribute",props:vue.mergeModels({isRequired:{default:1}},{modelValue:{},modelModifiers:{}}),emits:["update:modelValue"],setup(te,{expose:U}){const G=vue.useModel(te,"modelValue");vue.getCurrentInstance();const ee=vue.ref(null),ne=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:"请选择是否为主键"}]}),re=ue=>{const ce=ue.dataType;ce!=="decimal"&&(ue.dataScale=0),["autoIncrement","date","time","datetime","int","bigint","double","text"].includes(ce)&&(ue.dataLength=0),ce==="decimal"&&(ue.dataLength=10,ue.dataScale=6),ce==="varchar"&&(ue.dataLength=255)},oe=(ue,ce)=>{ue.primaryKey==2&&vue.unref(G).forEach((fe,ve)=>{ve!=ce&&(fe.primaryKey=1)})},ie=()=>{vue.unref(G).push({nanoid:nanoid()})},le=ue=>{vue.unref(G).splice(ue,1)};return U({validate:async()=>await vue.unref(ee).validate(ue=>ue),isRepeat:()=>{const ue=new Map;let ce="";for(let de=0;de<vue.unref(G).length;de++){let fe=vue.unref(G)[de],ve=ue.get(fe.attributeCode);ve!=null&&(ce+="字段名称 <strong>"+fe.attributeCode+"</strong> 重复(<i>第"+(ve+1)+"行和第"+(de+1)+"行</i>);<br>"),ue.set(vue.unref(G)[de].attributeCode,de)}return ce}}),(ue,ce)=>(vue.openBlock(),vue.createBlock(vue.unref(elementPlus.ElForm),{"label-width":"0",model:{modelValue:G.value},size:"small",ref_key:"elFormRef",ref:ee,rules:vue.unref(ne)},{default:vue.withCtx(()=>[vue.createVNode(vue.unref(vueDraggablePlus.VueDraggable),{modelValue:G.value,"onUpdate:modelValue":ce[0]||(ce[0]=de=>G.value=de),target:".sort-target",animation:150,handle:".handle"},{default:vue.withCtx(()=>[vue.createElementVNode("table",_hoisted_1$G,[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:ie})]),_hoisted_2$z,_hoisted_3$t,_hoisted_4$s,_hoisted_5$m,_hoisted_6$i,_hoisted_7$g,_hoisted_8$c,_hoisted_9$b,_hoisted_10$a]),vue.createElementVNode("tbody",_hoisted_11$8,[(vue.openBlock(!0),vue.createElementBlock(vue.Fragment,null,vue.renderList(G.value,(de,fe)=>(vue.openBlock(),vue.createElementBlock(vue.Fragment,{key:de.nanoid},[de.hide?vue.createCommentVNode("",!0):(vue.openBlock(),vue.createElementBlock("tr",_hoisted_12$7,[vue.createElementVNode("td",null,[vue.createElementVNode("i",{class:"text-lg cursor-pointer ri-indeterminate-circle-line text-color-danger",onClick:ve=>le(fe)},null,8,_hoisted_13$5)]),vue.createElementVNode("td",null,[vue.createVNode(vue.unref(elementPlus.ElFormItem),{prop:"modelValue."+fe+".attributeCode",rules:vue.unref(ne).attributeCode},{default:vue.withCtx(()=>[vue.createVNode(vue.unref(elementPlus.ElInput),{modelValue:de.attributeCode,"onUpdate:modelValue":ve=>de.attributeCode=ve,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."+fe+".attributeComment",rules:vue.unref(ne).attributeComment},{default:vue.withCtx(()=>[vue.createVNode(vue.unref(elementPlus.ElInput),{modelValue:de.attributeComment,"onUpdate:modelValue":ve=>de.attributeComment=ve,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."+fe+".mapCode",rules:vue.unref(ne).mapCode},{default:vue.withCtx(()=>[vue.createVNode(vue.unref(elementPlus.ElInput),{modelValue:de.mapCode,"onUpdate:modelValue":ve=>de.mapCode=ve,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."+fe+".dataType",rules:vue.unref(ne).dataType},{default:vue.withCtx(()=>[vue.createVNode(vue.unref(elementPlus.ElSelect),{modelValue:de.dataType,"onUpdate:modelValue":ve=>de.dataType=ve,placeholder:"数据类型",class:"w-full",teleported:!1,onChange:()=>re(de)},{default:vue.withCtx(()=>[(vue.openBlock(!0),vue.createElementBlock(vue.Fragment,null,vue.renderList(vue.unref(commonDataType),ve=>(vue.openBlock(),vue.createBlock(vue.unref(elementPlus.ElOption),{key:ve.value,label:ve.label,value:ve.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."+fe+".dataLength",rules:vue.unref(ne).dataLength},{default:vue.withCtx(()=>[vue.createVNode(vue.unref(elementPlus.ElInputNumber),{min:0,max:2048,"value-on-clear":0,"controls-position":"right",modelValue:de.dataLength,"onUpdate:modelValue":ve=>de.dataLength=ve,disabled:["autoIncrement","date","time","datetime","int","bigint","double","text"].includes(de.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."+fe+".dataScale",rules:vue.unref(ne).dataScale},{default:vue.withCtx(()=>[vue.createVNode(vue.unref(elementPlus.ElInputNumber),{modelValue:de.dataScale,"onUpdate:modelValue":ve=>de.dataScale=ve,min:0,max:2048,"value-on-clear":0,"controls-position":"right",disabled:!["decimal"].includes(de.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:de.primaryKey,"onUpdate:modelValue":ve=>de.primaryKey=ve,"inline-prompt":"","active-text":"是","inactive-text":"否","active-value":"2","inactive-value":"1",onChange:()=>oe(de,fe)},null,8,["modelValue","onUpdate:modelValue","onChange"])]),vue.createElementVNode("td",null,[vue.createVNode(vue.unref(elementPlus.ElSwitch),{modelValue:de.uniqueKey,"onUpdate:modelValue":ve=>de.uniqueKey=ve,"inline-prompt":"","active-text":"是","inactive-text":"否","active-value":"2","inactive-value":"1"},null,8,["modelValue","onUpdate:modelValue"])]),_hoisted_14$4]))],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$P,[["__scopeId","data-v-8dbf5661"]]),_withScopeId$f=te=>(vue.pushScopeId("data-v-22676e4d"),te=te(),vue.popScopeId(),te),_hoisted_1$F={class:"flex flex-col h-full"},_hoisted_2$y={class:"flex flex-1 overflow-hidden"},_hoisted_3$s={class:"flex flex-col flex-1 mr-3 overflow-hidden"},_hoisted_4$r={class:"h"},_hoisted_5$l=["onClick"],_hoisted_6$h={class:"mr-1 text-base"},_hoisted_7$f={class:"ml-2 text-xs text-color-info"},_hoisted_8$b={class:"text-color-warning"},_hoisted_9$a={class:"flex justify-end flex-1"},_hoisted_10$9=_withScopeId$f(()=>vue.createElementVNode("i",{class:"mr-1 ri-play-mini-fill"},null,-1)),_hoisted_11$7={class:"flex-1 overflow-hidden b"},_hoisted_12$6={class:"flex flex-col flex-1 overflow-hidden"},_hoisted_13$4={class:"h"},_hoisted_14$3=["onClick"],_hoisted_15$2={class:"flex-1 overflow-hidden b"},_hoisted_16$2={class:"flex flex-1 mt-3 overflow-hidden"},_hoisted_17$2={class:"flex flex-col flex-1 mr-3 overflow-hidden"},_hoisted_18$2={class:"flex h"},_hoisted_19$2=["onClick"],_hoisted_20$2={key:0,class:"mr-1 text-color-danger"},_hoisted_21$2={class:"mr-1 text-base"},_hoisted_22$2={key:0,class:"flex justify-end flex-1"},_hoisted_23$2=_withScopeId$f(()=>vue.createElementVNode("i",{class:"mr-1 ri-play-mini-fill"},null,-1)),_hoisted_24$1={class:"flex-1 overflow-hidden b"},_hoisted_25$1={key:0,class:"flex items-center justify-center h-full"},_hoisted_26$1=_withScopeId$f(()=>vue.createElementVNode("i",{class:"ri-table-fill"},null,-1)),_hoisted_27=_withScopeId$f(()=>vue.createElementVNode("i",{class:"ri-database-2-fill"},null,-1)),_hoisted_28={class:"h-full mt-2 overflow-y-auto"},_hoisted_29={class:"overflow-y-auto max-h-96",style:{"min-height":"300px"}},_hoisted_30=_withScopeId$f(()=>vue.createElementVNode("span",{class:"mr-1 text-color-danger"},"*",-1)),_hoisted_31={class:"h-full mt-2 overflow-y-auto"},_hoisted_32={class:"mt-2"},_hoisted_33={key:0,class:"flex flex-col flex-1 overflow-hidden"},_hoisted_34={class:"h"},_hoisted_35=["onClick"],_hoisted_36={class:"flex-1 overflow-hidden b"},_sfc_main$O=vue.defineComponent({__name:"design",props:{widgetType:{default:""}},emits:["success"],setup(te,{expose:U,emit:G}){const ee=te,ne=G,{proxy:re}=vue.getCurrentInstance(),{setFormValue:oe,getFormValue:ie}=re.$globalHooks.useForm(),{openMessage:le}=re.$globalHooks.useMessage(),ae=vue.inject("projectList"),se=vue.computed(()=>{var Me,ze;return((ze=(Me=(vue.unref(ae)??[]).find(Ge=>Ge.value==re.$baseGetCurrentProjectId()))==null?void 0:Me.ext)==null?void 0:ze.storeType)??"-"}),ue=[{label:"SQL编写",value:"1",num:"①"}],ce=vue.ref("1"),de=[{label:"SQL执行结果",value:"1"},{label:"SQL执行结果(JSON)",value:"2"}],fe=vue.ref("1"),ve=vue.ref([]),he=vue.ref(""),pe=vue.ref("1"),ge=[{label:"插件执行结果",value:"1"},{label:"插件执行结果(JSON)",value:"2"}],me=vue.ref("1"),_e=vue.ref(!1),be=vue.ref(null),ye=vue.ref(""),xe=vue.ref([]),Ce=vue.ref(""),$e=vue.ref([]),we=vue.ref(`function plugin(item){
|
|
892
892
|
var data=JSON.parse(item);
|
|
893
893
|
return JSON.stringify(data)
|
|
894
894
|
}`),Ee=vue.ref([]),Ve=vue.ref(!1),Se=vue.ref([]),ke=vue.ref(!1),Ne=vue.ref(null),Ie=vue.ref(""),Pe=vue.computed(()=>Be.find(Me=>Me.fieldName=="extractType"));vue.watch(_e,Me=>{Me&&!vue.unref(Se).length&&Re("javascript",!1)});const Te=(Me=!1)=>{const ze=Oe.find(Ge=>Ge.fieldName=="modelLayer");Me&&(ze.value=""),(ze.options??[]).forEach(Ge=>{Ge.disabled=vue.unref(he)=="view",Ge.value=="ODSVIEW"&&(Ge.disabled=vue.unref(he)!="view")})},De=vue.ref(""),Oe=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:()=>{Te()},changeFunc:Me=>{const ze=Oe.find(We=>We.fieldName==="modelType");ze.required=Me.value=="DWD",ze.disabled=Me.value!="DWD";const Ge=`${((Me==null?void 0:Me.value)??"").toLocaleLowerCase()}_`;De.value=Ge,Oe.find(We=>We.fieldName==="modelCode").prepend=vue.h("div",{},Ge)}},{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(he,Me=>{ve.value=[{label:"输出结果",value:"1",num:"②",isRequired:!1}],Me=="view"?ve.value.push({label:"输出模型",value:"2",num:"③",isRequired:!1}):ee.widgetType=="model-add"?ve.value.push({label:"ETL插件编写",value:"2",num:"③",isRequired:!1},{label:"输出模型",value:"3",num:"④",isRequired:!0},{label:"方案作业配置",value:"4",num:"⑤",isRequired:!0}):ve.value.push({label:"ETL插件编写",value:"2",num:"③",isRequired:!1},{label:"方案作业配置",value:"4",num:"④",isRequired:!0}),Te(!0)},{immediate:!0});const Be=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:Me=>{Be.find(ze=>ze.fieldName=="incrementalField").hide=Me.value!=2}},{name:"增量字段",type:FieldType.Slot,fieldName:"incrementalField",value:"",required:!0,hide:!0,tip:"该字段必须为本模型字段,并且是SQL结果集中存在的字段"},{name:"taskDefinedId",type:FieldType.Text,fieldName:"taskDefinedId",hide:!0},{name:"id",type:FieldType.Text,fieldName:"id",hide:!0}]),Ae=vue.ref(null),Le=(Me={})=>{vue.nextTick(()=>{if(he.value=ee.widgetType.indexOf("ODSVIEW")==-1?"dataTable":"view",oe(Me??{},Be),Me!=null&&Me.taskDefined&&(ke.value=!0),ee.widgetType.indexOf("ODSVIEW")>=0&&(pe.value="2"),Ce.value=(Me==null?void 0:Me.extractSql)??"",we.value=(Me==null?void 0:Me.extractPluginScript)??`function plugin(item){
|