ace-component-lib 0.0.63 → 0.0.64
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/ace-component-lib.umd.js +2 -2
- package/dist/style.css +1 -1
- package/package.json +1 -1
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
(function(ct,Le){typeof exports=="object"&&typeof module<"u"?module.exports=Le(require("pinia"),require("@wangeditor/editor"),require("vue"),require("element-plus"),require("vue-draggable-plus"),require("dayjs"),require("echarts/core"),require("@wangeditor/editor-for-vue")):typeof define=="function"&&define.amd?define(["pinia","@wangeditor/editor","vue","element-plus","vue-draggable-plus","dayjs","echarts/core","@wangeditor/editor-for-vue"],Le):(ct=typeof globalThis<"u"?globalThis:ct||self,ct["ace-component-lib"]=Le(ct.pinia,ct.editor,ct.Vue,ct.elementPlus,ct.vueDraggablePlus,ct.dayjs,ct.core,ct.editorForVue))})(this,function(ct,Le,e,C,Xt,On,Gu,Ji){"use strict";const Hu="0.0.63",SD="";let Yu=class{constructor(n){this.standards={strict:"strict",loose:"loose",html5:"html5"},this.previewBody=null,this.close=null,this.previewBodyUtilPrintBtn=null,this.selectArray=[],this.counter=0,this.settings={standard:this.standards.html5},Object.assign(this.settings,n),this.init()}init(){this.counter++,this.settings.id=`printArea_${this.counter}`;let n="";this.settings.url&&!this.settings.asyncUrl&&(n=this.settings.url);let r=this;if(this.settings.asyncUrl)return void r.settings.asyncUrl(function(a){let l=r.getPrintWindow(a);r.settings.preview?r.previewIfrmaeLoad():r.print(l)},r.settings.vue);let o=this.getPrintWindow(n);this.settings.url||this.write(o.doc),this.settings.preview?this.previewIfrmaeLoad():this.print(o)}addEvent(n,r,o){n.addEventListener?n.addEventListener(r,o,!1):n.attachEvent?n.attachEvent("on"+r,o):n["on"+r]=o}previewIfrmaeLoad(){let n=document.getElementById("vue-pirnt-nb-previewBox");if(n){let r=this,o=n.querySelector("iframe");this.settings.previewBeforeOpenCallback(),this.addEvent(o,"load",function(){r.previewBoxShow(),r.removeCanvasImg(),r.settings.previewOpenCallback()}),this.addEvent(n.querySelector(".previewBodyUtilPrintBtn"),"click",function(){r.settings.beforeOpenCallback(),r.settings.openCallback(),o.contentWindow.print(),r.settings.closeCallback()})}}removeCanvasImg(){let n=this;try{if(n.elsdom){let r=n.elsdom.querySelectorAll(".canvasImg");for(let o=0;o<r.length;o++)r[o].remove()}}catch(r){console.log(r)}}print(n){var r=this;let o=document.getElementById(this.settings.id)||n.f,a=document.getElementById(this.settings.id).contentWindow||n.f.contentWindow;r.settings.beforeOpenCallback(),r.addEvent(o,"load",function(){a.focus(),r.settings.openCallback(),a.print(),o.remove(),r.settings.closeCallback(),r.removeCanvasImg()})}write(n){n.open(),n.write(`${this.docType()}<html>${this.getHead()}${this.getBody()}</html>`),n.close()}docType(){return this.settings.standard===this.standards.html5?"<!DOCTYPE html>":`<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01${this.settings.standard===this.standards.loose?" Transitional":""}//EN" "http://www.w3.org/TR/html4/${this.settings.standard===this.standards.loose?"loose":"strict"}.dtd">`}getHead(){let n="",r="",o="";this.settings.extraHead&&this.settings.extraHead.replace(/([^,]+)/g,l=>{n+=l}),[].forEach.call(document.querySelectorAll("link"),function(l){l.href.indexOf(".css")>=0&&(r+=`<link type="text/css" rel="stylesheet" href="${l.href}" >`)});let a=document.styleSheets;if(a&&a.length>0)for(let l=0;l<a.length;l++)try{if(a[l].cssRules||a[l].rules){let c=a[l].cssRules||a[l].rules;for(let i=0;i<c.length;i++)o+=c[i].cssText}}catch(c){console.log(a[l].href+c)}return this.settings.extraCss&&this.settings.extraCss.replace(/([^,\s]+)/g,l=>{r+=`<link type="text/css" rel="stylesheet" href="${l}">`}),`<head><title>${this.settings.popTitle}</title>${n}${r}<style type="text/css">${o}</style></head>`}getBody(){let n=this.settings.ids;return n=n.replace(new RegExp("#","g"),""),this.elsdom=this.beforeHanler(document.getElementById(n)),"<body>"+this.getFormData(this.elsdom).outerHTML+"</body>"}beforeHanler(n){let r=n.querySelectorAll("canvas");for(let o=0;o<r.length;o++)if(!r[o].style.display){let a=r[o].parentNode,l=r[o].toDataURL("image/png"),c=new Image;c.className="canvasImg",c.style.display="none",c.src=l,a.appendChild(c)}return n}getFormData(n){let r=n.cloneNode(!0),o=r.querySelectorAll("input,select,textarea"),a=r.querySelectorAll(".canvasImg,canvas"),l=-1;for(let c=0;c<a.length;c++){let i=a[c].parentNode,s=a[c];s.tagName.toLowerCase()==="canvas"?i.removeChild(s):s.style.display="block"}for(let c=0;c<o.length;c++){let i=o[c],s=i.getAttribute("type"),d=o[c];if(s||(s=i.tagName==="SELECT"?"select":i.tagName==="TEXTAREA"?"textarea":""),i.tagName==="INPUT")s==="radio"||s==="checkbox"?i.checked&&d.setAttribute("checked",i.checked):(d.value=i.value,d.setAttribute("value",i.value));else if(s==="select"){l++;for(let f=0;f<n.querySelectorAll("select").length;f++){let p=n.querySelectorAll("select")[f];if(!p.getAttribute("newbs")&&p.setAttribute("newbs",f),p.getAttribute("newbs")==l){let u=n.querySelectorAll("select")[l].selectedIndex;i.options[u].setAttribute("selected",!0)}}}else d.innerHTML=i.value,d.setAttribute("html",i.value)}return r}getPrintWindow(n){var r=this.Iframe(n);return{f:r,win:r.contentWindow||r,doc:r.doc}}previewBoxShow(){let n=document.getElementById("vue-pirnt-nb-previewBox");n&&(document.querySelector("html").setAttribute("style","overflow: hidden"),n.style.display="block")}previewBoxHide(){let n=document.getElementById("vue-pirnt-nb-previewBox");n&&(document.querySelector("html").setAttribute("style","overflow: visible;"),n.querySelector("iframe")&&n.querySelector("iframe").remove(),n.style.display="none")}previewBox(){let n=document.getElementById("vue-pirnt-nb-previewBox"),r="previewBody";if(n)return n.querySelector("iframe")&&n.querySelector("iframe").remove(),{close:n.querySelector(".previewClose"),previewBody:n.querySelector(".previewBody")};let o=document.createElement("div");o.setAttribute("id","vue-pirnt-nb-previewBox"),o.setAttribute("style","position: fixed;top: 0px;left: 0px;width: 100%;height: 100%;background: white;display:none"),o.style.zIndex=this.settings.zIndex;let a=document.createElement("div");a.setAttribute("class","previewHeader"),a.setAttribute("style","padding: 5px 20px;"),a.innerHTML=this.settings.previewTitle,o.appendChild(a),this.close=document.createElement("div");let l=this.close;l.setAttribute("class","previewClose"),l.setAttribute("style","position: absolute;top: 5px;right: 20px;width: 25px;height: 20px;cursor: pointer;");let c=document.createElement("div"),i=document.createElement("div");c.setAttribute("class","closeBefore"),c.setAttribute("style","position: absolute;width: 3px;height: 100%;background: #040404;transform: rotate(45deg); top: 0px;left: 50%;"),i.setAttribute("class","closeAfter"),i.setAttribute("style","position: absolute;width: 3px;height: 100%;background: #040404;transform: rotate(-45deg); top: 0px;left: 50%;"),l.appendChild(c),l.appendChild(i),a.appendChild(l),this.previewBody=document.createElement("div");let s=this.previewBody;s.setAttribute("class",r),s.setAttribute("style","display: flex;flex-direction: column; height: 100%;"),o.appendChild(s);let d=document.createElement("div");d.setAttribute("class","previewBodyUtil"),d.setAttribute("style","height: 32px;background: #474747;position: relative;"),s.appendChild(d),this.previewBodyUtilPrintBtn=document.createElement("div");let f=this.previewBodyUtilPrintBtn;return f.setAttribute("class","previewBodyUtilPrintBtn"),f.innerHTML=this.settings.previewPrintBtnLabel,f.setAttribute("style","position: absolute;padding: 2px 10px;margin-top: 3px;left: 24px;font-size: 14px;color: white;cursor: pointer;background-color: rgba(0,0,0,.12);background-image: linear-gradient(hsla(0,0%,100%,.05),hsla(0,0%,100%,0));background-clip: padding-box;border: 1px solid rgba(0,0,0,.35);border-color: rgba(0,0,0,.32) rgba(0,0,0,.38) rgba(0,0,0,.42);box-shadow: inset 0 1px 0 hsla(0,0%,100%,.05), inset 0 0 1px hsla(0,0%,100%,.15), 0 1px 0 hsla(0,0%,100%,.05);"),d.appendChild(f),document.body.appendChild(o),{close:this.close,previewBody:this.previewBody}}iframeBox(n,r){let o=document.createElement("iframe");return o.style.border="0px",o.style.position="absolute",o.style.width="0px",o.style.height="0px",o.style.right="0px",o.style.top="0px",o.setAttribute("id",n),o.setAttribute("src",r),o}Iframe(n){let r=this.settings.id;n=n||new Date().getTime();let o=this,a=this.iframeBox(r,n);try{if(this.settings.preview){a.setAttribute("style","border: 0px;flex: 1;");let l=this.previewBox(),c=l.previewBody,i=l.close;c.appendChild(a),this.addEvent(i,"click",function(){o.previewBoxHide()})}else document.body.appendChild(a);a.doc=null,a.doc=a.contentDocument?a.contentDocument:a.contentWindow?a.contentWindow.document:a.document}catch(l){throw new Error(l+". iframes may not be supported in this browser.")}if(a.doc==null)throw new Error("Cannot find document.");return a}};var Ki={directiveName:"print",mounted(t,n,r){let o=n.instance,a="";var l,c,i;c="click",i=()=>{if(typeof n.value=="string")a=n.value;else{if(typeof n.value!="object"||!n.value.id)return void window.print();{a=n.value.id;let d=a.replace(new RegExp("#","g"),"");document.getElementById(d)||(console.log("id in Error"),a="")}}s()},(l=t).addEventListener?l.addEventListener(c,i,!1):l.attachEvent?l.attachEvent("on"+c,i):l["on"+c]=i;const s=()=>{new Yu({ids:a,vue:o,url:n.value.url,standard:"",extraHead:n.value.extraHead,extraCss:n.value.extraCss,zIndex:n.value.zIndex||20002,previewTitle:n.value.previewTitle||"打印预览",previewPrintBtnLabel:n.value.previewPrintBtnLabel||"打印",popTitle:n.value.popTitle,preview:n.value.preview||!1,asyncUrl:n.value.asyncUrl,previewBeforeOpenCallback(){n.value.previewBeforeOpenCallback&&n.value.previewBeforeOpenCallback(o)},previewOpenCallback(){n.value.previewOpenCallback&&n.value.previewOpenCallback(o)},openCallback(){n.value.openCallback&&n.value.openCallback(o)},closeCallback(){n.value.closeCallback&&n.value.closeCallback(o)},beforeOpenCallback(){n.value.beforeOpenCallback&&n.value.beforeOpenCallback(o)}})}},install:function(t){t.directive("print",Ki)}},Ye=(t=>(t.Text="text",t.Select="select",t.Date="date",t.DateTime="datetime",t.CheckBox="checkbox",t.Switch="switch",t.Radio="radio",t.Textarea="textarea",t.Nnumber="number",t.NumberRange="numberRange",t.Cascader="cascader",t.Daterange="daterange",t.DateTimeRange="datetimerange",t.File="file",t.TreeSelect="treeSelect",t.Year="year",t.Hr="hr",t.Slot="slot",t.Editor="editor",t.Password="password",t.Json="json",t.Markdown="markdown",t.Rate="rate",t))(Ye||{});let Xr=(t=21)=>crypto.getRandomValues(new Uint8Array(t)).reduce((n,r)=>(r&=63,r<36?n+=r.toString(36):r<62?n+=(r-26).toString(36).toUpperCase():r>62?n+="-":n+="_",n),"");const ke=ct.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:{}}),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}},actions:{setSacle(t){this.scale=t/100},setSketchRuleLine(t,n){this.sketchRuleLine.h=t,this.sketchRuleLine.v=n},clearSketchRuleLine(){this.sketchRuleLine={h:[],v:[]}},setTargetWidget(t){this.targetsWidget=t},setWidgetList(t){this.widgetConfg.list=t},setWidgetHoverIds(t){this.widgetHoverIds=t},delWidgetItem(t){this.setWidgetList(this.getWidgetList.filter(n=>!t.includes(n.id))),this.setTargetWidget(this.getTargetWidget.filter(n=>!t.includes(n.id)))},copyWidgetItem(t){this.pasteWidget=[],t.forEach(n=>{const r=this.getWidgetList.find(o=>o.id==n);r&&this.pasteWidget.push(r)})},pasteWidgetItem(){this.pasteWidget.forEach(r=>{const o=JSON.parse(JSON.stringify(r));let a=o.x,l=o.y;o.x+40>this.stageWidth-o.w?a=this.stageWidth-o.w-40:a+=40,o.y+40>this.stageHeight-o.h?l=this.stageHeight-o.h-40:l+=40,this.widgetConfg.list.unshift({...o,id:Xr(),x:a,y:l,z:this.widgetConfg.list.length+1,locked:!1})})},sortWidgetList(){this.widgetConfg.list.sort((t,n)=>n.z-t.z)},setCreateLoading(t){this.createLoading=t,t&&(this.targetsWidget=[],this.clearSketchRuleLine())},setRightPannel(t){this.showRightPannel=t},setStageWidth(t){this.stageWidth=t,this.widgetConfg.config.stageWidth=t},setStageHeight(t){this.stageHeight=t,this.widgetConfg.config.stageHeight=t},setTheme(){this.theme=this.theme=="dark"?"":"dark",document.getElementsByTagName("html")[0].className=this.theme,localStorage.setItem("design-theme",this.theme)},setChartData(t){this.chartData=t}}});/*!
|
|
1
|
+
(function(ct,Le){typeof exports=="object"&&typeof module<"u"?module.exports=Le(require("pinia"),require("@wangeditor/editor"),require("vue"),require("element-plus"),require("vue-draggable-plus"),require("dayjs"),require("echarts/core"),require("@wangeditor/editor-for-vue")):typeof define=="function"&&define.amd?define(["pinia","@wangeditor/editor","vue","element-plus","vue-draggable-plus","dayjs","echarts/core","@wangeditor/editor-for-vue"],Le):(ct=typeof globalThis<"u"?globalThis:ct||self,ct["ace-component-lib"]=Le(ct.pinia,ct.editor,ct.Vue,ct.elementPlus,ct.vueDraggablePlus,ct.dayjs,ct.core,ct.editorForVue))})(this,function(ct,Le,e,C,Xt,On,Gu,Ji){"use strict";const Hu="0.0.64",SD="";let Yu=class{constructor(n){this.standards={strict:"strict",loose:"loose",html5:"html5"},this.previewBody=null,this.close=null,this.previewBodyUtilPrintBtn=null,this.selectArray=[],this.counter=0,this.settings={standard:this.standards.html5},Object.assign(this.settings,n),this.init()}init(){this.counter++,this.settings.id=`printArea_${this.counter}`;let n="";this.settings.url&&!this.settings.asyncUrl&&(n=this.settings.url);let r=this;if(this.settings.asyncUrl)return void r.settings.asyncUrl(function(a){let l=r.getPrintWindow(a);r.settings.preview?r.previewIfrmaeLoad():r.print(l)},r.settings.vue);let o=this.getPrintWindow(n);this.settings.url||this.write(o.doc),this.settings.preview?this.previewIfrmaeLoad():this.print(o)}addEvent(n,r,o){n.addEventListener?n.addEventListener(r,o,!1):n.attachEvent?n.attachEvent("on"+r,o):n["on"+r]=o}previewIfrmaeLoad(){let n=document.getElementById("vue-pirnt-nb-previewBox");if(n){let r=this,o=n.querySelector("iframe");this.settings.previewBeforeOpenCallback(),this.addEvent(o,"load",function(){r.previewBoxShow(),r.removeCanvasImg(),r.settings.previewOpenCallback()}),this.addEvent(n.querySelector(".previewBodyUtilPrintBtn"),"click",function(){r.settings.beforeOpenCallback(),r.settings.openCallback(),o.contentWindow.print(),r.settings.closeCallback()})}}removeCanvasImg(){let n=this;try{if(n.elsdom){let r=n.elsdom.querySelectorAll(".canvasImg");for(let o=0;o<r.length;o++)r[o].remove()}}catch(r){console.log(r)}}print(n){var r=this;let o=document.getElementById(this.settings.id)||n.f,a=document.getElementById(this.settings.id).contentWindow||n.f.contentWindow;r.settings.beforeOpenCallback(),r.addEvent(o,"load",function(){a.focus(),r.settings.openCallback(),a.print(),o.remove(),r.settings.closeCallback(),r.removeCanvasImg()})}write(n){n.open(),n.write(`${this.docType()}<html>${this.getHead()}${this.getBody()}</html>`),n.close()}docType(){return this.settings.standard===this.standards.html5?"<!DOCTYPE html>":`<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01${this.settings.standard===this.standards.loose?" Transitional":""}//EN" "http://www.w3.org/TR/html4/${this.settings.standard===this.standards.loose?"loose":"strict"}.dtd">`}getHead(){let n="",r="",o="";this.settings.extraHead&&this.settings.extraHead.replace(/([^,]+)/g,l=>{n+=l}),[].forEach.call(document.querySelectorAll("link"),function(l){l.href.indexOf(".css")>=0&&(r+=`<link type="text/css" rel="stylesheet" href="${l.href}" >`)});let a=document.styleSheets;if(a&&a.length>0)for(let l=0;l<a.length;l++)try{if(a[l].cssRules||a[l].rules){let c=a[l].cssRules||a[l].rules;for(let i=0;i<c.length;i++)o+=c[i].cssText}}catch(c){console.log(a[l].href+c)}return this.settings.extraCss&&this.settings.extraCss.replace(/([^,\s]+)/g,l=>{r+=`<link type="text/css" rel="stylesheet" href="${l}">`}),`<head><title>${this.settings.popTitle}</title>${n}${r}<style type="text/css">${o}</style></head>`}getBody(){let n=this.settings.ids;return n=n.replace(new RegExp("#","g"),""),this.elsdom=this.beforeHanler(document.getElementById(n)),"<body>"+this.getFormData(this.elsdom).outerHTML+"</body>"}beforeHanler(n){let r=n.querySelectorAll("canvas");for(let o=0;o<r.length;o++)if(!r[o].style.display){let a=r[o].parentNode,l=r[o].toDataURL("image/png"),c=new Image;c.className="canvasImg",c.style.display="none",c.src=l,a.appendChild(c)}return n}getFormData(n){let r=n.cloneNode(!0),o=r.querySelectorAll("input,select,textarea"),a=r.querySelectorAll(".canvasImg,canvas"),l=-1;for(let c=0;c<a.length;c++){let i=a[c].parentNode,s=a[c];s.tagName.toLowerCase()==="canvas"?i.removeChild(s):s.style.display="block"}for(let c=0;c<o.length;c++){let i=o[c],s=i.getAttribute("type"),d=o[c];if(s||(s=i.tagName==="SELECT"?"select":i.tagName==="TEXTAREA"?"textarea":""),i.tagName==="INPUT")s==="radio"||s==="checkbox"?i.checked&&d.setAttribute("checked",i.checked):(d.value=i.value,d.setAttribute("value",i.value));else if(s==="select"){l++;for(let f=0;f<n.querySelectorAll("select").length;f++){let p=n.querySelectorAll("select")[f];if(!p.getAttribute("newbs")&&p.setAttribute("newbs",f),p.getAttribute("newbs")==l){let u=n.querySelectorAll("select")[l].selectedIndex;i.options[u].setAttribute("selected",!0)}}}else d.innerHTML=i.value,d.setAttribute("html",i.value)}return r}getPrintWindow(n){var r=this.Iframe(n);return{f:r,win:r.contentWindow||r,doc:r.doc}}previewBoxShow(){let n=document.getElementById("vue-pirnt-nb-previewBox");n&&(document.querySelector("html").setAttribute("style","overflow: hidden"),n.style.display="block")}previewBoxHide(){let n=document.getElementById("vue-pirnt-nb-previewBox");n&&(document.querySelector("html").setAttribute("style","overflow: visible;"),n.querySelector("iframe")&&n.querySelector("iframe").remove(),n.style.display="none")}previewBox(){let n=document.getElementById("vue-pirnt-nb-previewBox"),r="previewBody";if(n)return n.querySelector("iframe")&&n.querySelector("iframe").remove(),{close:n.querySelector(".previewClose"),previewBody:n.querySelector(".previewBody")};let o=document.createElement("div");o.setAttribute("id","vue-pirnt-nb-previewBox"),o.setAttribute("style","position: fixed;top: 0px;left: 0px;width: 100%;height: 100%;background: white;display:none"),o.style.zIndex=this.settings.zIndex;let a=document.createElement("div");a.setAttribute("class","previewHeader"),a.setAttribute("style","padding: 5px 20px;"),a.innerHTML=this.settings.previewTitle,o.appendChild(a),this.close=document.createElement("div");let l=this.close;l.setAttribute("class","previewClose"),l.setAttribute("style","position: absolute;top: 5px;right: 20px;width: 25px;height: 20px;cursor: pointer;");let c=document.createElement("div"),i=document.createElement("div");c.setAttribute("class","closeBefore"),c.setAttribute("style","position: absolute;width: 3px;height: 100%;background: #040404;transform: rotate(45deg); top: 0px;left: 50%;"),i.setAttribute("class","closeAfter"),i.setAttribute("style","position: absolute;width: 3px;height: 100%;background: #040404;transform: rotate(-45deg); top: 0px;left: 50%;"),l.appendChild(c),l.appendChild(i),a.appendChild(l),this.previewBody=document.createElement("div");let s=this.previewBody;s.setAttribute("class",r),s.setAttribute("style","display: flex;flex-direction: column; height: 100%;"),o.appendChild(s);let d=document.createElement("div");d.setAttribute("class","previewBodyUtil"),d.setAttribute("style","height: 32px;background: #474747;position: relative;"),s.appendChild(d),this.previewBodyUtilPrintBtn=document.createElement("div");let f=this.previewBodyUtilPrintBtn;return f.setAttribute("class","previewBodyUtilPrintBtn"),f.innerHTML=this.settings.previewPrintBtnLabel,f.setAttribute("style","position: absolute;padding: 2px 10px;margin-top: 3px;left: 24px;font-size: 14px;color: white;cursor: pointer;background-color: rgba(0,0,0,.12);background-image: linear-gradient(hsla(0,0%,100%,.05),hsla(0,0%,100%,0));background-clip: padding-box;border: 1px solid rgba(0,0,0,.35);border-color: rgba(0,0,0,.32) rgba(0,0,0,.38) rgba(0,0,0,.42);box-shadow: inset 0 1px 0 hsla(0,0%,100%,.05), inset 0 0 1px hsla(0,0%,100%,.15), 0 1px 0 hsla(0,0%,100%,.05);"),d.appendChild(f),document.body.appendChild(o),{close:this.close,previewBody:this.previewBody}}iframeBox(n,r){let o=document.createElement("iframe");return o.style.border="0px",o.style.position="absolute",o.style.width="0px",o.style.height="0px",o.style.right="0px",o.style.top="0px",o.setAttribute("id",n),o.setAttribute("src",r),o}Iframe(n){let r=this.settings.id;n=n||new Date().getTime();let o=this,a=this.iframeBox(r,n);try{if(this.settings.preview){a.setAttribute("style","border: 0px;flex: 1;");let l=this.previewBox(),c=l.previewBody,i=l.close;c.appendChild(a),this.addEvent(i,"click",function(){o.previewBoxHide()})}else document.body.appendChild(a);a.doc=null,a.doc=a.contentDocument?a.contentDocument:a.contentWindow?a.contentWindow.document:a.document}catch(l){throw new Error(l+". iframes may not be supported in this browser.")}if(a.doc==null)throw new Error("Cannot find document.");return a}};var Ki={directiveName:"print",mounted(t,n,r){let o=n.instance,a="";var l,c,i;c="click",i=()=>{if(typeof n.value=="string")a=n.value;else{if(typeof n.value!="object"||!n.value.id)return void window.print();{a=n.value.id;let d=a.replace(new RegExp("#","g"),"");document.getElementById(d)||(console.log("id in Error"),a="")}}s()},(l=t).addEventListener?l.addEventListener(c,i,!1):l.attachEvent?l.attachEvent("on"+c,i):l["on"+c]=i;const s=()=>{new Yu({ids:a,vue:o,url:n.value.url,standard:"",extraHead:n.value.extraHead,extraCss:n.value.extraCss,zIndex:n.value.zIndex||20002,previewTitle:n.value.previewTitle||"打印预览",previewPrintBtnLabel:n.value.previewPrintBtnLabel||"打印",popTitle:n.value.popTitle,preview:n.value.preview||!1,asyncUrl:n.value.asyncUrl,previewBeforeOpenCallback(){n.value.previewBeforeOpenCallback&&n.value.previewBeforeOpenCallback(o)},previewOpenCallback(){n.value.previewOpenCallback&&n.value.previewOpenCallback(o)},openCallback(){n.value.openCallback&&n.value.openCallback(o)},closeCallback(){n.value.closeCallback&&n.value.closeCallback(o)},beforeOpenCallback(){n.value.beforeOpenCallback&&n.value.beforeOpenCallback(o)}})}},install:function(t){t.directive("print",Ki)}},Ye=(t=>(t.Text="text",t.Select="select",t.Date="date",t.DateTime="datetime",t.CheckBox="checkbox",t.Switch="switch",t.Radio="radio",t.Textarea="textarea",t.Nnumber="number",t.NumberRange="numberRange",t.Cascader="cascader",t.Daterange="daterange",t.DateTimeRange="datetimerange",t.File="file",t.TreeSelect="treeSelect",t.Year="year",t.Hr="hr",t.Slot="slot",t.Editor="editor",t.Password="password",t.Json="json",t.Markdown="markdown",t.Rate="rate",t))(Ye||{});let Xr=(t=21)=>crypto.getRandomValues(new Uint8Array(t)).reduce((n,r)=>(r&=63,r<36?n+=r.toString(36):r<62?n+=(r-26).toString(36).toUpperCase():r>62?n+="-":n+="_",n),"");const ke=ct.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:{}}),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}},actions:{setSacle(t){this.scale=t/100},setSketchRuleLine(t,n){this.sketchRuleLine.h=t,this.sketchRuleLine.v=n},clearSketchRuleLine(){this.sketchRuleLine={h:[],v:[]}},setTargetWidget(t){this.targetsWidget=t},setWidgetList(t){this.widgetConfg.list=t},setWidgetHoverIds(t){this.widgetHoverIds=t},delWidgetItem(t){this.setWidgetList(this.getWidgetList.filter(n=>!t.includes(n.id))),this.setTargetWidget(this.getTargetWidget.filter(n=>!t.includes(n.id)))},copyWidgetItem(t){this.pasteWidget=[],t.forEach(n=>{const r=this.getWidgetList.find(o=>o.id==n);r&&this.pasteWidget.push(r)})},pasteWidgetItem(){this.pasteWidget.forEach(r=>{const o=JSON.parse(JSON.stringify(r));let a=o.x,l=o.y;o.x+40>this.stageWidth-o.w?a=this.stageWidth-o.w-40:a+=40,o.y+40>this.stageHeight-o.h?l=this.stageHeight-o.h-40:l+=40,this.widgetConfg.list.unshift({...o,id:Xr(),x:a,y:l,z:this.widgetConfg.list.length+1,locked:!1})})},sortWidgetList(){this.widgetConfg.list.sort((t,n)=>n.z-t.z)},setCreateLoading(t){this.createLoading=t,t&&(this.targetsWidget=[],this.clearSketchRuleLine())},setRightPannel(t){this.showRightPannel=t},setStageWidth(t){this.stageWidth=t,this.widgetConfg.config.stageWidth=t},setStageHeight(t){this.stageHeight=t,this.widgetConfg.config.stageHeight=t},setTheme(){this.theme=this.theme=="dark"?"":"dark",document.getElementsByTagName("html")[0].className=this.theme,localStorage.setItem("design-theme",this.theme)},setChartData(t){this.chartData=t}}});/*!
|
|
2
2
|
* Compressor.js v1.2.1
|
|
3
3
|
* https://fengyuanchen.github.io/compressorjs
|
|
4
4
|
*
|
|
@@ -795,7 +795,7 @@ ${p} {
|
|
|
795
795
|
}`,h&&(d.innerHTML+=`
|
|
796
796
|
${p} div ,${p} span,${p} a,${p} * {
|
|
797
797
|
font-size: ${h}px;
|
|
798
|
-
}`))}}const O4=e.defineComponent({__name:"preview",props:{config:{default:""},renderStyle:{default:{}}},setup(t){var d,f;const n=t,{proxy:r}=e.getCurrentInstance(),{chartJsonFormat:o,resetUrl:a}=r.$globalUtils,l=e.ref(null),c=e.ref({});l.value=o(n.config);const i=((d=e.unref(l).config)==null?void 0:d.stageWidth)||1920,s=((f=e.unref(l).config)==null?void 0:f.stageHeight)||1080;return e.onMounted(()=>{if(i==1920&&s==1080)Li.init({el:"#render",resize:!0,dh:s,dw:i});else if(JSON.stringify(n.renderStyle)=="{}"){const p=Math.min(window.outerWidth/i,1);c.value={"transform-origin":"0px 0px",width:`${i}px`,height:`${s}px`,transform:`scale(${p})`,position:"absolute",overflowY:"auto"}}}),(p,u)=>{var h,m,_,g,y,b;return e.openBlock(),e.createElementBlock("div",{id:"render",class:"fixed top-0 left-0 w-full h-full",style:e.normalizeStyle({backgroundColor:(h=e.unref(l))==null?void 0:h.config.backgroundColor,backgroundImage:`url(${e.unref(a)((m=e.unref(l))==null?void 0:m.config.backgroundImage)})`,backgroundSize:(_=e.unref(l))==null?void 0:_.config.backgroundSize,backgroundRepeat:(g=e.unref(l))==null?void 0:g.config.backgroundRepeat,backgroundPosition:(y=e.unref(l))==null?void 0:y.config.backgroundPosition,...p.renderStyle,...e.unref(c)})},[e.createElementVNode("div",{class:"ml-auto mr-auto",style:e.normalizeStyle({width:e.unref(i)+"px"})},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList((b=e.unref(l))==null?void 0:b.list,v=>(e.openBlock(),e.createElementBlock("div",{key:v.id,class:"absolute",style:e.normalizeStyle(e.unref(ha)(v))},[e.createVNode(Ti,{config:v},null,8,["config"])],4))),128))],4)],4)}}}),I4={
|
|
798
|
+
}`))}}const O4=e.defineComponent({__name:"preview",props:{config:{default:""},renderStyle:{default:{}}},setup(t){var d,f;const n=t,{proxy:r}=e.getCurrentInstance(),{chartJsonFormat:o,resetUrl:a}=r.$globalUtils,l=e.ref(null),c=e.ref({});l.value=o(n.config);const i=((d=e.unref(l).config)==null?void 0:d.stageWidth)||1920,s=((f=e.unref(l).config)==null?void 0:f.stageHeight)||1080;return e.onMounted(()=>{if(i==1920&&s==1080)Li.init({el:"#render",resize:!0,dh:s,dw:i});else if(JSON.stringify(n.renderStyle)=="{}"){const p=Math.min(window.outerWidth/i,1);c.value={"transform-origin":"0px 0px",width:`${i}px`,height:`${s}px`,transform:`scale(${p})`,position:"absolute",overflowY:"auto"}}}),(p,u)=>{var h,m,_,g,y,b;return e.openBlock(),e.createElementBlock("div",{id:"render",class:"fixed top-0 left-0 w-full h-full",style:e.normalizeStyle({backgroundColor:(h=e.unref(l))==null?void 0:h.config.backgroundColor,backgroundImage:`url(${e.unref(a)((m=e.unref(l))==null?void 0:m.config.backgroundImage)})`,backgroundSize:(_=e.unref(l))==null?void 0:_.config.backgroundSize,backgroundRepeat:(g=e.unref(l))==null?void 0:g.config.backgroundRepeat,backgroundPosition:(y=e.unref(l))==null?void 0:y.config.backgroundPosition,...p.renderStyle,...e.unref(c)})},[e.createElementVNode("div",{class:"ml-auto mr-auto",style:e.normalizeStyle({width:e.unref(i)+"px"})},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList((b=e.unref(l))==null?void 0:b.list,v=>(e.openBlock(),e.createElementBlock("div",{key:v.id,class:"absolute",style:e.normalizeStyle(e.unref(ha)(v))},[e.createVNode(Ti,{config:v},null,8,["config"])],4))),128))],4)],4)}}}),I4={class:"fixed top-0 left-0 w-full h-full"},z4=["id"],R4={class:"fixed right-0 flex justify-end w-full overflow-hidden thumb bottom-5 gap-x-2"},M4=["onClick"],A4=["src"],L4={key:0,class:"fixed top-0 left-0 z-10 flex items-center justify-center w-full h-full"},F4=e.defineComponent({__name:"preview-slide",props:{renderStyle:{default:{}},autoplay:{type:Boolean,default:!0},interval:{default:5e3},isOpen:{type:Boolean,default:!0},id:{default:null}},setup(t){const n=t,{proxy:r}=e.getCurrentInstance(),o=e.ref(null),{chartJsonFormat:a,resetUrl:l}=r.$globalUtils,c=e.ref(n.isOpen),i=e.ref([]),s=e.ref(!0),d=e.ref(0),f=(p,u)=>{d.value=p};return r.$baseHttp.get("/api/ace-data-center/screen/list",{params:{descs:"create_time",projectId:r.$baseGetCurrentProjectId(),current:1,size:1e3}}).then(p=>{if(p.data.records.forEach(u=>{var h,m;u.widgetConfig=a(u.config),u.stageWidth=((h=u.widgetConfig.config)==null?void 0:h.stageWidth)||1920,u.stageHeight=((m=u.widgetConfig.config)==null?void 0:m.stageHeight)||1080}),i.value=p.data.records,s.value=!1,n.id){const u=e.unref(i).findIndex(h=>h.id==n.id);d.value=u<=0?0:u}e.nextTick(()=>{i.value.forEach((u,h)=>{Li.init({el:`#render_${h}`,resize:!0,dh:u.stageHeight,dw:u.stageHeight})})})}),(p,u)=>{const h=e.resolveComponent("AppEmpty");return e.openBlock(),e.createBlock(e.unref(C.ElSkeleton),{loading:e.unref(s)},{default:e.withCtx(()=>[e.createElementVNode("div",I4,[e.createVNode(e.unref(C.ElCarousel),{height:"100%","motion-blur":"",ref_key:"carouselRef",ref:o,onChange:f,"indicator-position":"outside",autoplay:n.autoplay,interval:n.interval,"initial-index":e.unref(d)},{default:e.withCtx(()=>[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(e.unref(i),(m,_)=>(e.openBlock(),e.createBlock(e.unref(C.ElCarouselItem),{key:m},{default:e.withCtx(()=>{var g,y,b,v,x,V;return[e.createElementVNode("div",{id:`render_${_}`,class:"absolute top-0 left-0 w-full h-full",style:e.normalizeStyle({backgroundColor:(g=m==null?void 0:m.widgetConfig)==null?void 0:g.config.backgroundColor,backgroundImage:`url(${e.unref(l)((y=m==null?void 0:m.widgetConfig)==null?void 0:y.config.backgroundImage)})`,backgroundSize:(b=m==null?void 0:m.widgetConfig)==null?void 0:b.config.backgroundSize,backgroundRepeat:(v=m==null?void 0:m.widgetConfig)==null?void 0:v.config.backgroundRepeat,backgroundPosition:(x=m==null?void 0:m.widgetConfig)==null?void 0:x.config.backgroundPosition,...n.renderStyle})},[_==e.unref(d)?(e.openBlock(),e.createElementBlock("div",{key:0,class:"ml-auto mr-auto",style:e.normalizeStyle({width:m.stageWidth+"px"})},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList((V=m.widgetConfig)==null?void 0:V.list,S=>(e.openBlock(),e.createElementBlock("div",{key:S.id,class:"absolute",style:e.normalizeStyle(e.unref(ha)(S))},[e.createVNode(Ti,{config:S},null,8,["config"])],4))),128))],4)):e.createCommentVNode("",!0)],12,z4)]}),_:2},1024))),128))]),_:1},8,["autoplay","interval","initial-index"]),e.createElementVNode("div",R4,[e.unref(c)?(e.openBlock(!0),e.createElementBlock(e.Fragment,{key:0},e.renderList(e.unref(i),(m,_)=>(e.openBlock(),e.createElementBlock("div",{onClick:g=>e.unref(o).setActiveItem(_),class:e.normalizeClass(["thumb-item",{active:_==e.unref(d)}])},[e.createElementVNode("img",{src:e.unref(l)(m.imageUrl??"")},null,8,A4)],10,M4))),256)):e.createCommentVNode("",!0),e.createElementVNode("div",{class:e.normalizeClass(["slide",{isOpen:e.unref(c)}]),onClick:u[0]||(u[0]=m=>c.value=!e.unref(c))},[e.createElementVNode("i",{class:e.normalizeClass(e.unref(c)?"ri-arrow-right-s-fill":"ri-arrow-left-s-fill")},null,2)],2)])]),e.unref(i).length?e.createCommentVNode("",!0):(e.openBlock(),e.createElementBlock("div",L4,[e.createVNode(h,{description:"暂无数据"})]))]),_:1},8,["loading"])}}}),l6="",j4=be(F4,[["__scopeId","data-v-159a341e"]]),U4={class:""},W4={class:"text-color-warning text-xs"},P4=e.defineComponent({__name:"useIndicators",setup(t,{expose:n}){const{proxy:r}=e.getCurrentInstance(),o=e.ref(!1),a=e.ref([]);return n({init:async c=>{const i=await ge(r).listIndicatorsApply({reportId:c.id});i&&(a.value=i.data,o.value=!0)}}),(c,i)=>{const s=e.resolveComponent("AppEmpty"),d=e.resolveComponent("AppDrawer");return e.openBlock(),e.createBlock(d,{modelValue:e.unref(o),"onUpdate:modelValue":i[0]||(i[0]=f=>e.isRef(o)?o.value=f:null),title:"指标报告使用库",size:800},{default:e.withCtx(()=>[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(e.unref(a),f=>(e.openBlock(),e.createElementBlock("div",{class:"item flex p-3 justify-between w-full",key:f.id},[e.createElementVNode("div",U4,e.toDisplayString(f.indicatorsName),1),e.createElementVNode("div",W4,e.toDisplayString(f.title),1)]))),128)),e.unref(a).length==0?(e.openBlock(),e.createBlock(s,{key:0,description:"暂无数据"})):e.createCommentVNode("",!0)]),_:1},8,["modelValue"])}}}),i6="",G4=be(P4,[["__scopeId","data-v-7754ca30"]]);var Eu={exports:{}};(function(t,n){(function(r,o){o()})(Ur,function(){function r(d,f){return typeof f>"u"?f={autoBom:!1}:typeof f!="object"&&(console.warn("Deprecated: Expected third argument to be a object"),f={autoBom:!f}),f.autoBom&&/^\s*(?:text\/\S*|application\/xml|\S*\/\S*\+xml)\s*;.*charset\s*=\s*utf-8/i.test(d.type)?new Blob(["\uFEFF",d],{type:d.type}):d}function o(d,f,p){var u=new XMLHttpRequest;u.open("GET",d),u.responseType="blob",u.onload=function(){s(u.response,f,p)},u.onerror=function(){console.error("could not download file")},u.send()}function a(d){var f=new XMLHttpRequest;f.open("HEAD",d,!1);try{f.send()}catch{}return 200<=f.status&&299>=f.status}function l(d){try{d.dispatchEvent(new MouseEvent("click"))}catch{var f=document.createEvent("MouseEvents");f.initMouseEvent("click",!0,!0,window,0,0,0,80,20,!1,!1,!1,!1,0,null),d.dispatchEvent(f)}}var c=typeof window=="object"&&window.window===window?window:typeof self=="object"&&self.self===self?self:typeof Ur=="object"&&Ur.global===Ur?Ur:void 0,i=c.navigator&&/Macintosh/.test(navigator.userAgent)&&/AppleWebKit/.test(navigator.userAgent)&&!/Safari/.test(navigator.userAgent),s=c.saveAs||(typeof window!="object"||window!==c?function(){}:"download"in HTMLAnchorElement.prototype&&!i?function(d,f,p){var u=c.URL||c.webkitURL,h=document.createElement("a");f=f||d.name||"download",h.download=f,h.rel="noopener",typeof d=="string"?(h.href=d,h.origin===location.origin?l(h):a(h.href)?o(d,f,p):l(h,h.target="_blank")):(h.href=u.createObjectURL(d),setTimeout(function(){u.revokeObjectURL(h.href)},4e4),setTimeout(function(){l(h)},0))}:"msSaveOrOpenBlob"in navigator?function(d,f,p){if(f=f||d.name||"download",typeof d!="string")navigator.msSaveOrOpenBlob(r(d,p),f);else if(a(d))o(d,f,p);else{var u=document.createElement("a");u.href=d,u.target="_blank",setTimeout(function(){l(u)})}}:function(d,f,p,u){if(u=u||open("","_blank"),u&&(u.document.title=u.document.body.innerText="downloading..."),typeof d=="string")return o(d,f,p);var h=d.type==="application/octet-stream",m=/constructor/i.test(c.HTMLElement)||c.safari,_=/CriOS\/[\d]+/.test(navigator.userAgent);if((_||h&&m||i)&&typeof FileReader<"u"){var g=new FileReader;g.onloadend=function(){var v=g.result;v=_?v:v.replace(/^data:[^;]*;/,"data:attachment/file;"),u?u.location.href=v:location=v,u=null},g.readAsDataURL(d)}else{var y=c.URL||c.webkitURL,b=y.createObjectURL(d);u?u.location=b:location.href=b,u=null,setTimeout(function(){y.revokeObjectURL(b)},4e4)}});c.saveAs=s.saveAs=s,t.exports=s})})(Eu);var H4=Eu.exports;const Y4=["innerHTML"],Nu=e.defineComponent({__name:"preview",setup(t,{expose:n}){const{proxy:r}=e.getCurrentInstance(),{getModelIndicatorsData:o,setSingleValue:a}=lt(),{resetUrl:l}=r.$globalUtils,c=e.ref(!1),i=e.ref({}),s=e.ref({id:"preview-content",openCallback(){console.log("点击了按钮")},closeCallback(){document.title=e.unref(f)}}),d=()=>{var _;const h=`
|
|
799
799
|
Content-Type: text/html; charset="utf-8"
|
|
800
800
|
<!DOCTYPE html>
|
|
801
801
|
<html xmlns:v="urn:schemas-microsoft-com:vml"
|