@ajaxjs/ui 1.5.2 → 1.5.3

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 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const o=require("vue"),C={},m=(e,t)=>{const l=e.__vccOpts||e;for(const[r,n]of t)l[r]=n;return l};function y(e,t,l,r,n,s){return o.openBlock(),o.createElementBlock("button",null,"hihi")}const p=m(C,[["render",y]]),g=o.defineComponent({name:"HtmlEditor",props:{modelValue:String,uploadImageActionUrl:String,isIonicons:Boolean},emits:["update:modelValue","onchange"],data(){return{isShowCode:!1,iframeEl:null,sourceEditor:null}},mounted(){this.iframeEl=this.$el.querySelector("iframe"),this.sourceEditor=this.$el.querySelector("textarea"),this.iframeEl.contentWindow.onload=e=>{this.iframeDoc=this.iframeEl.contentWindow.document,this.iframeDoc.designMode="on",this.iframeDoc.addEventListener("paste",k.bind(this)),new MutationObserver((t,l)=>{this.isShowCode||(this.sourceEditor.value=this.iframeDoc.body.innerHTML,this.$emit("onchange",this.sourceEditor.value)),this.$emit("update:modelValue",this.iframeDoc.body.innerHTML)}).observe(this.iframeDoc.body,{attributes:!0,childList:!0,subtree:!0,characterData:!0})},this.sourceEditor.oninput=e=>{this.isShowCode&&this.sourceEditor.value&&(this.setIframeBody(this.sourceEditor.value),this.$emit("onchange",this.sourceEditor.value))}},methods:{setIframeBody(e){this.iframeDoc&&this.iframeDoc.body&&(this.iframeDoc.body.innerHTML=e)},getValue(e,t){let l=this.iframeDoc.body.innerHTML;return e&&(l=E(l)),t&&(l=encodeURIComponent(l)),l},createLink(){const e=prompt("请输入 URL 地址");e&&this.format("createLink",e)},insertImage(){window.isCreate?alert("请保存记录后再上传图片。"):this.uploadImgMgr.show(e=>{e&&e.isOk&&this.format("insertImage",e.fullUrl)})},cleanHTML(){this.setIframeBody(HtmlSanitizer.SanitizeHtml(this.iframeDoc.body.innerHTML))},saveRemoteImage2Local(){const e=this.iframeDoc.querySelectorAll("img"),t=new Array,l=[];for(let r=0,n=e.length;r<n;r++){const s=e[r],i=s.getAttribute("src");i!=null&&/^http/.test(i)&&(t.push(s),l.push(i))}l.length||console.log("未发现有远程图片")},onCmdClk(e){const t=e.target,l=t.className.split(" ").shift();this.format(l)},format(e,t){t?this.iframeDoc.execCommand(e,!1,t):this.iframeDoc.execCommand(e,!1)},onFontsizeChoserClk(e){const t=e.target,l=e.currentTarget.children;let r,n;for(r=0,n=l.length;r<n&&t!=l[r];r++);this.format("fontsize",r+"")},onFontfamilyChoserClk(e){const t=e.target;this.format("fontname",t.innerHTML);const l=t.parentNode;l.style.display="none",setTimeout(()=>l.style.display="",300)},createColorPickerHTML(){const e=["00","33","66","99","CC","FF"];let t,l,r,n;const s=['<div class="colorhead"><span class="colortitle">颜色选择</span></div><div class="colorbody"><table cellspaci="0" cellpadding="0"><tr>'];for(let i=0;i<6;++i){s.push('<td><table class="colorpanel" cellspacing="0" cellpadding="0">');for(let a=0,f=e[i];a<6;++a){s.push("<tr>");for(let d=0,u=e[a];d<6;++d)t=e[d],r=d==5&&i!=2&&i!=5?";border-right:none;":"",n=a==5&&i<3?";border-bottom:none":"",l="#"+f+t+u,s.push('<td unselectable="on" style="background-color: '+l+r+n+'" title="'+l+'"></td>');s.push("</tr>")}s.push("</table></td>"),e[i]=="66"&&s.push("</tr><tr>")}return s.push("</tr></table></div>"),s.join("")}},watch:{modelValue(e,t){t||this.setIframeBody(e)},isShowCode(e){e?(this.iframeEl.classList.add("hide"),this.sourceEditor.classList.add("show"),c.call(this,!0)):(this.iframeEl.classList.remove("hide"),this.sourceEditor.classList.remove("show"),c.call(this,!1))}}});function k(e){if(!this.uploadImageActionUrl){alert("未提供图片上传地址");return}const t=e.clipboardData&&e.clipboardData.items;if(!t||!t.length)return;let l=null;for(let s=0;s<t.length;s++){const i=t[s];if(i.type.indexOf("image")!==-1){l=i.getAsFile();break}}if(!l)return;e.preventDefault();const r=new FormData;r.append("file",l,l.name);const n=new XMLHttpRequest;n.addEventListener("load",s=>{if(n.status>=200&&n.status<300){const i=JSON.parse(n.responseText);console.log("Success:",i),this.format("insertImage",i.data.url)}else console.error("Upload failed with status:",n.status),alert("Upload failed!")}),n.addEventListener("error",function(s){console.error("Network error during upload:",s),alert("Upload failed due to a network error!")}),n.open("POST",this.uploadImageActionUrl),n.send(r)}function c(e){this.$el.querySelectorAll(".toolbar i").forEach(t=>{t.className.indexOf("switchMode")==-1&&(t.style.color=e?"lightgray":"")})}function E(e){return e=e.replace(/<(\/)*(\\?xml:|meta|link|span|font|del|ins|st1:|[ovwxp]:)((.|\s)*?)>/gi,""),e=e.replace(/(class|style|type|start)=("(.*?)"|(\w*))/gi,""),e=e.replace(/<style(.*?)style>/gi,""),e=e.replace(/<script(.*?)script>/gi,""),e=e.replace(/<!--(.*?)-->/gi,""),e}const h={class:"aj-form-html-editor"},v={class:"toolbar"},N={class:"dorpdown"},V={class:"dorpdown"},w={class:"dorpdown"},b=["innerHTML"],I={class:"dorpdown"},L=["innerHTML"];function A(e,t,l,r,n,s){return o.openBlock(),o.createElementBlock("div",h,[o.createElementVNode("ul",v,[o.createElementVNode("li",N,[t[20]||(t[20]=o.createElementVNode("i",{title:"字体",class:"text-icon"},"A",-1)),o.createElementVNode("div",{class:"fontfamilyChoser",onClick:t[0]||(t[0]=(...i)=>e.onFontfamilyChoserClk&&e.onFontfamilyChoserClk(...i))},[...t[19]||(t[19]=[o.createStaticVNode('<a style="font-family:&#39;宋体&#39;;">宋体</a><a style="font-family:&#39;黑体&#39;;">黑体</a><a style="font-family:&#39;楷体&#39;;">楷体</a><a style="font-family:&#39;隶书&#39;;">隶书</a><a style="font-family:&#39;幼圆&#39;;">幼圆</a><a style="font-family:&#39;Microsoft YaHei&#39;;">Microsoft YaHei</a><a style="font-family:Arial;">Arial</a><a style="font-family:&#39;Arial Narrow&#39;;">Arial Narrow</a><a style="font-family:&#39;Arial Black&#39;;">Arial Black</a><a style="font-family:&#39;Comic Sans MS&#39;;">Comic Sans MS</a><a style="font-family:Courier;">Courier</a><a style="font-family:System;">System</a><a style="font-family:&#39;Times New Roman&#39;;">Times New Roman</a><a style="font-family:Verdana;">Verdana</a>',14)])])]),o.createElementVNode("li",V,[t[22]||(t[22]=o.createElementVNode("i",{title:"字号",class:"text-icon"},"H",-1)),o.createElementVNode("div",{class:"fontsizeChoser",onClick:t[1]||(t[1]=(...i)=>e.onFontsizeChoserClk&&e.onFontsizeChoserClk(...i))},[...t[21]||(t[21]=[o.createStaticVNode('<a style="font-size:xx-small;">极小</a><a style="font-size:x-small;">特小</a><a style="font-size:small;">小</a><a style="font-size:medium;">中</a><a style="font-size:large;">大</a><a style="font-size:x-large;">特大</a><a style="font-size:xx-large;line-height:140%;">极大</a>',7)])])]),o.createElementVNode("li",{onClick:t[2]||(t[2]=(...i)=>e.onCmdClk&&e.onCmdClk(...i))},[...t[23]||(t[23]=[o.createElementVNode("i",{title:"加粗",class:"bold text-icon"},"B",-1)])]),o.createElementVNode("li",{onClick:t[3]||(t[3]=(...i)=>e.onCmdClk&&e.onCmdClk(...i))},[...t[24]||(t[24]=[o.createElementVNode("i",{title:"斜体",class:"italic text-icon",style:{"font-style":"italic"}},"I",-1)])]),o.createElementVNode("li",{onClick:t[4]||(t[4]=(...i)=>e.onCmdClk&&e.onCmdClk(...i))},[...t[25]||(t[25]=[o.createElementVNode("i",{title:"下划线",class:"underline text-icon",style:{"text-decoration":"underline"}},"U",-1)])]),o.createElementVNode("li",{onClick:t[5]||(t[5]=(...i)=>e.onCmdClk&&e.onCmdClk(...i))},[o.createElementVNode("i",{title:"左对齐",class:o.normalizeClass("justifyleft "+(e.isIonicons?"ivu-icon ivu-icon-bingo-menu-fold":"fontAwesome fa-align-left"))},null,2)]),o.createElementVNode("li",{onClick:t[6]||(t[6]=(...i)=>e.onCmdClk&&e.onCmdClk(...i))},[o.createElementVNode("i",{title:"中间对齐",class:o.normalizeClass("justifycenter "+(e.isIonicons?"ivu-icon ivu-icon-md-menu":"fontAwesome fa-align-center"))},null,2)]),o.createElementVNode("li",{onClick:t[7]||(t[7]=(...i)=>e.onCmdClk&&e.onCmdClk(...i))},[o.createElementVNode("i",{title:"右对齐",class:o.normalizeClass("justifyright "+(e.isIonicons?"ivu-icon ivu-icon-bingo-menu-unfold":"fontAwesome fa-align-right"))},null,2)]),o.createElementVNode("li",{onClick:t[8]||(t[8]=(...i)=>e.onCmdClk&&e.onCmdClk(...i))},[o.createElementVNode("i",{title:"数字编号",class:o.normalizeClass("insertorderedlist "+(e.isIonicons?"ivu-icon ivu-icon-md-list":"fontAwesome fa-list-ol"))},null,2)]),o.createElementVNode("li",{onClick:t[9]||(t[9]=(...i)=>e.onCmdClk&&e.onCmdClk(...i))},[o.createElementVNode("i",{title:"项目编号",class:o.normalizeClass("insertunorderedlist "+(e.isIonicons?"ivu-icon ivu-icon-ios-list":"fontAwesome fa-list-ul"))},null,2)]),o.createElementVNode("li",{onClick:t[10]||(t[10]=(...i)=>e.onCmdClk&&e.onCmdClk(...i))},[o.createElementVNode("i",{title:"增加缩进",class:o.normalizeClass("outdent "+(e.isIonicons?"ivu-icon ivu-icon-ios-return-left":"fontAwesome fa-outdent"))},null,2)]),o.createElementVNode("li",{onClick:t[11]||(t[11]=(...i)=>e.onCmdClk&&e.onCmdClk(...i))},[o.createElementVNode("i",{title:"减少缩进",class:o.normalizeClass("indent "+(e.isIonicons?"ivu-icon ivu-icon-ios-return-right":"fontAwesome fa-indent"))},null,2)]),o.createElementVNode("li",w,[o.createElementVNode("i",{title:"字体颜色",class:o.normalizeClass(e.isIonicons?"ivu-icon ivu-icon-md-brush":"fontAwesome fa-paint-brush")},null,2),o.createElementVNode("div",{class:"colorPicker",innerHTML:e.createColorPickerHTML(),onClick:t[12]||(t[12]=i=>e.format("foreColor",i.target.title))},null,8,b)]),o.createElementVNode("li",I,[o.createElementVNode("i",{title:"背景颜色",class:o.normalizeClass(e.isIonicons?"ivu-icon ivu-icon-ios-brush-outline":"fontAwesome fa-pencil")},null,2),o.createElementVNode("div",{class:"colorPicker",innerHTML:e.createColorPickerHTML(),onClick:t[13]||(t[13]=i=>e.format("backColor",i.target.title))},null,8,L)]),o.createElementVNode("li",{onClick:t[14]||(t[14]=(...i)=>e.createLink&&e.createLink(...i))},[o.createElementVNode("i",{title:"增加链接",class:o.normalizeClass(e.isIonicons?"ivu-icon ivu-icon-ios-link":"fontAwesome fa-link")},null,2)]),o.createElementVNode("li",{onClick:t[15]||(t[15]=(...i)=>e.insertImage&&e.insertImage(...i))},[o.createElementVNode("i",{title:"增加图片",class:o.normalizeClass(e.isIonicons?"ivu-icon ivu-icon-md-images":"fontAwesome fa-regular fa-image")},null,2)]),o.createElementVNode("li",{onClick:t[16]||(t[16]=(...i)=>e.saveRemoteImage2Local&&e.saveRemoteImage2Local(...i))},[o.createElementVNode("i",{title:"一键存图",class:o.normalizeClass(e.isIonicons?"ivu-icon ivu-icon-md-photos":"fontAwesome fa-camera")},null,2)]),o.createElementVNode("li",{onClick:t[17]||(t[17]=(...i)=>e.cleanHTML&&e.cleanHTML(...i))},[o.createElementVNode("i",{title:"清理 HTML",class:o.normalizeClass(e.isIonicons?"ivu-icon ivu-icon-md-done-all":"fontAwesome fa-eraser")},null,2)]),o.createElementVNode("li",{onClick:t[18]||(t[18]=i=>e.isShowCode=!e.isShowCode)},[o.createElementVNode("i",{title:"切换到代码",class:o.normalizeClass((e.isIonicons?"ivu-icon ivu-icon-md-code":"fontAwesome fa-code")+" switchMode")},null,2)])]),t[26]||(t[26]=o.createElementVNode("div",{class:"editorBody"},[o.createElementVNode("iframe",{srcdoc:"<html><body></body></html>"}),o.createElementVNode("textarea")],-1))])}const M=m(g,[["render",A]]);function z(e,t){const r=(t?parent.location:window.location).search.substring(1).split("&");for(let n=0;n<r.length;n++){const s=r[n].split("=");if(s[0]==e)return s[1]}return null}const H={};function S(e,t){return o.openBlock(),o.createElementBlock("div",null,"hi")}const T=m(H,[["render",S]]),D={HomePage:T};exports.HtmlEditor=M;exports.MyButton=p;exports.admin=D;exports.getQueryParam=z;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const o=require("vue"),g={},c=(e,t)=>{const i=e.__vccOpts||e;for(const[s,l]of t)i[s]=l;return i};function y(e,t,i,s,l,r){return o.openBlock(),o.createElementBlock("button",null,"hihi")}const h=c(g,[["render",y]]),E=o.defineComponent({name:"HtmlEditor",props:{modelValue:String,uploadImageActionUrl:String,isIonicons:Boolean},emits:["update:modelValue","onchange"],data(){return{isShowCode:!1,iframeEl:null,sourceEditor:null}},mounted(){this.iframeEl=this.$el.querySelector("iframe"),this.sourceEditor=this.$el.querySelector("textarea"),this.iframeEl.contentWindow.onload=e=>{this.iframeDoc=this.iframeEl.contentWindow.document,this.iframeDoc.designMode="on",this.iframeDoc.addEventListener("paste",k.bind(this)),new MutationObserver((t,i)=>{this.isShowCode||(this.sourceEditor.value=this.iframeDoc.body.innerHTML,this.$emit("onchange",this.sourceEditor.value)),this.$emit("update:modelValue",this.iframeDoc.body.innerHTML)}).observe(this.iframeDoc.body,{attributes:!0,childList:!0,subtree:!0,characterData:!0})},this.sourceEditor.oninput=e=>{this.isShowCode&&this.sourceEditor.value&&(this.setIframeBody(this.sourceEditor.value),this.$emit("onchange",this.sourceEditor.value))}},methods:{setIframeBody(e){this.iframeDoc&&this.iframeDoc.body&&(this.iframeDoc.body.innerHTML=e)},getValue(e,t){let i=this.iframeDoc.body.innerHTML;return e&&(i=v(i)),t&&(i=encodeURIComponent(i)),i},createLink(){const e=prompt("请输入 URL 地址");e&&this.format("createLink",e)},insertImage(){window.isCreate?alert("请保存记录后再上传图片。"):this.uploadImgMgr.show(e=>{e&&e.isOk&&this.format("insertImage",e.fullUrl)})},cleanHTML(){this.setIframeBody(HtmlSanitizer.SanitizeHtml(this.iframeDoc.body.innerHTML))},saveRemoteImage2Local(){const e=this.iframeDoc.querySelectorAll("img"),t=new Array,i=[];for(let s=0,l=e.length;s<l;s++){const r=e[s],n=r.getAttribute("src");n!=null&&/^http/.test(n)&&(t.push(r),i.push(n))}i.length||console.log("未发现有远程图片")},onCmdClk(e){const t=e.target,i=t.className.split(" ").shift();this.format(i)},format(e,t){t?this.iframeDoc.execCommand(e,!1,t):this.iframeDoc.execCommand(e,!1)},onFontsizeChoserClk(e){const t=e.target,i=e.currentTarget.children;let s,l;for(s=0,l=i.length;s<l&&t!=i[s];s++);this.format("fontsize",s+"")},onFontfamilyChoserClk(e){const t=e.target;this.format("fontname",t.innerHTML);const i=t.parentNode;i.style.display="none",setTimeout(()=>i.style.display="",300)},createColorPickerHTML(){const e=["00","33","66","99","CC","FF"];let t,i,s,l;const r=['<div class="colorhead"><span class="colortitle">颜色选择</span></div><div class="colorbody"><table cellspaci="0" cellpadding="0"><tr>'];for(let n=0;n<6;++n){r.push('<td><table class="colorpanel" cellspacing="0" cellpadding="0">');for(let a=0,u=e[n];a<6;++a){r.push("<tr>");for(let m=0,f=e[a];m<6;++m)t=e[m],s=m==5&&n!=2&&n!=5?";border-right:none;":"",l=a==5&&n<3?";border-bottom:none":"",i="#"+u+t+f,r.push('<td unselectable="on" style="background-color: '+i+s+l+'" title="'+i+'"></td>');r.push("</tr>")}r.push("</table></td>"),e[n]=="66"&&r.push("</tr><tr>")}return r.push("</tr></table></div>"),r.join("")}},watch:{modelValue(e,t){t||this.setIframeBody(e)},isShowCode(e){e?(this.iframeEl.classList.add("hide"),this.sourceEditor.classList.add("show"),p.call(this,!0)):(this.iframeEl.classList.remove("hide"),this.sourceEditor.classList.remove("show"),p.call(this,!1))}}});function k(e){if(!this.uploadImageActionUrl){alert("未提供图片上传地址");return}const t=e.clipboardData&&e.clipboardData.items;if(!t||!t.length)return;let i=null;for(let r=0;r<t.length;r++){const n=t[r];if(n.type.indexOf("image")!==-1){i=n.getAsFile();break}}if(!i)return;e.preventDefault();const s=new FormData;s.append("file",i,i.name);const l=new XMLHttpRequest;l.addEventListener("load",r=>{if(l.status>=200&&l.status<300){const n=JSON.parse(l.responseText);console.log("Success:",n),this.format("insertImage",n.data.url)}else console.error("Upload failed with status:",l.status),alert("Upload failed!")}),l.addEventListener("error",function(r){console.error("Network error during upload:",r),alert("Upload failed due to a network error!")}),l.open("POST",this.uploadImageActionUrl),l.send(s)}function p(e){this.$el.querySelectorAll(".toolbar i").forEach(t=>{t.className.indexOf("switchMode")==-1&&(t.style.color=e?"lightgray":"")})}function v(e){return e=e.replace(/<(\/)*(\\?xml:|meta|link|span|font|del|ins|st1:|[ovwxp]:)((.|\s)*?)>/gi,""),e=e.replace(/(class|style|type|start)=("(.*?)"|(\w*))/gi,""),e=e.replace(/<style(.*?)style>/gi,""),e=e.replace(/<script(.*?)script>/gi,""),e=e.replace(/<!--(.*?)-->/gi,""),e}const w={class:"aj-form-html-editor"},N={class:"toolbar"},V={class:"dorpdown"},b={class:"dorpdown"},I={class:"dorpdown"},S=["innerHTML"],L={class:"dorpdown"},T=["innerHTML"];function $(e,t,i,s,l,r){return o.openBlock(),o.createElementBlock("div",w,[o.createElementVNode("ul",N,[o.createElementVNode("li",V,[t[20]||(t[20]=o.createElementVNode("i",{title:"字体",class:"text-icon"},"A",-1)),o.createElementVNode("div",{class:"fontfamilyChoser",onClick:t[0]||(t[0]=(...n)=>e.onFontfamilyChoserClk&&e.onFontfamilyChoserClk(...n))},[...t[19]||(t[19]=[o.createStaticVNode('<a style="font-family:&#39;宋体&#39;;">宋体</a><a style="font-family:&#39;黑体&#39;;">黑体</a><a style="font-family:&#39;楷体&#39;;">楷体</a><a style="font-family:&#39;隶书&#39;;">隶书</a><a style="font-family:&#39;幼圆&#39;;">幼圆</a><a style="font-family:&#39;Microsoft YaHei&#39;;">Microsoft YaHei</a><a style="font-family:Arial;">Arial</a><a style="font-family:&#39;Arial Narrow&#39;;">Arial Narrow</a><a style="font-family:&#39;Arial Black&#39;;">Arial Black</a><a style="font-family:&#39;Comic Sans MS&#39;;">Comic Sans MS</a><a style="font-family:Courier;">Courier</a><a style="font-family:System;">System</a><a style="font-family:&#39;Times New Roman&#39;;">Times New Roman</a><a style="font-family:Verdana;">Verdana</a>',14)])])]),o.createElementVNode("li",b,[t[22]||(t[22]=o.createElementVNode("i",{title:"字号",class:"text-icon"},"H",-1)),o.createElementVNode("div",{class:"fontsizeChoser",onClick:t[1]||(t[1]=(...n)=>e.onFontsizeChoserClk&&e.onFontsizeChoserClk(...n))},[...t[21]||(t[21]=[o.createStaticVNode('<a style="font-size:xx-small;">极小</a><a style="font-size:x-small;">特小</a><a style="font-size:small;">小</a><a style="font-size:medium;">中</a><a style="font-size:large;">大</a><a style="font-size:x-large;">特大</a><a style="font-size:xx-large;line-height:140%;">极大</a>',7)])])]),o.createElementVNode("li",{onClick:t[2]||(t[2]=(...n)=>e.onCmdClk&&e.onCmdClk(...n))},[...t[23]||(t[23]=[o.createElementVNode("i",{title:"加粗",class:"bold text-icon"},"B",-1)])]),o.createElementVNode("li",{onClick:t[3]||(t[3]=(...n)=>e.onCmdClk&&e.onCmdClk(...n))},[...t[24]||(t[24]=[o.createElementVNode("i",{title:"斜体",class:"italic text-icon",style:{"font-style":"italic"}},"I",-1)])]),o.createElementVNode("li",{onClick:t[4]||(t[4]=(...n)=>e.onCmdClk&&e.onCmdClk(...n))},[...t[25]||(t[25]=[o.createElementVNode("i",{title:"下划线",class:"underline text-icon",style:{"text-decoration":"underline"}},"U",-1)])]),o.createElementVNode("li",{onClick:t[5]||(t[5]=(...n)=>e.onCmdClk&&e.onCmdClk(...n))},[o.createElementVNode("i",{title:"左对齐",class:o.normalizeClass("justifyleft "+(e.isIonicons?"ivu-icon ivu-icon-bingo-menu-fold":"fontAwesome fa-align-left"))},null,2)]),o.createElementVNode("li",{onClick:t[6]||(t[6]=(...n)=>e.onCmdClk&&e.onCmdClk(...n))},[o.createElementVNode("i",{title:"中间对齐",class:o.normalizeClass("justifycenter "+(e.isIonicons?"ivu-icon ivu-icon-md-menu":"fontAwesome fa-align-center"))},null,2)]),o.createElementVNode("li",{onClick:t[7]||(t[7]=(...n)=>e.onCmdClk&&e.onCmdClk(...n))},[o.createElementVNode("i",{title:"右对齐",class:o.normalizeClass("justifyright "+(e.isIonicons?"ivu-icon ivu-icon-bingo-menu-unfold":"fontAwesome fa-align-right"))},null,2)]),o.createElementVNode("li",{onClick:t[8]||(t[8]=(...n)=>e.onCmdClk&&e.onCmdClk(...n))},[o.createElementVNode("i",{title:"数字编号",class:o.normalizeClass("insertorderedlist "+(e.isIonicons?"ivu-icon ivu-icon-md-list":"fontAwesome fa-list-ol"))},null,2)]),o.createElementVNode("li",{onClick:t[9]||(t[9]=(...n)=>e.onCmdClk&&e.onCmdClk(...n))},[o.createElementVNode("i",{title:"项目编号",class:o.normalizeClass("insertunorderedlist "+(e.isIonicons?"ivu-icon ivu-icon-ios-list":"fontAwesome fa-list-ul"))},null,2)]),o.createElementVNode("li",{onClick:t[10]||(t[10]=(...n)=>e.onCmdClk&&e.onCmdClk(...n))},[o.createElementVNode("i",{title:"增加缩进",class:o.normalizeClass("outdent "+(e.isIonicons?"ivu-icon ivu-icon-ios-return-left":"fontAwesome fa-outdent"))},null,2)]),o.createElementVNode("li",{onClick:t[11]||(t[11]=(...n)=>e.onCmdClk&&e.onCmdClk(...n))},[o.createElementVNode("i",{title:"减少缩进",class:o.normalizeClass("indent "+(e.isIonicons?"ivu-icon ivu-icon-ios-return-right":"fontAwesome fa-indent"))},null,2)]),o.createElementVNode("li",I,[o.createElementVNode("i",{title:"字体颜色",class:o.normalizeClass(e.isIonicons?"ivu-icon ivu-icon-md-brush":"fontAwesome fa-paint-brush")},null,2),o.createElementVNode("div",{class:"colorPicker",innerHTML:e.createColorPickerHTML(),onClick:t[12]||(t[12]=n=>e.format("foreColor",n.target.title))},null,8,S)]),o.createElementVNode("li",L,[o.createElementVNode("i",{title:"背景颜色",class:o.normalizeClass(e.isIonicons?"ivu-icon ivu-icon-ios-brush-outline":"fontAwesome fa-pencil")},null,2),o.createElementVNode("div",{class:"colorPicker",innerHTML:e.createColorPickerHTML(),onClick:t[13]||(t[13]=n=>e.format("backColor",n.target.title))},null,8,T)]),o.createElementVNode("li",{onClick:t[14]||(t[14]=(...n)=>e.createLink&&e.createLink(...n))},[o.createElementVNode("i",{title:"增加链接",class:o.normalizeClass(e.isIonicons?"ivu-icon ivu-icon-ios-link":"fontAwesome fa-link")},null,2)]),o.createElementVNode("li",{onClick:t[15]||(t[15]=(...n)=>e.insertImage&&e.insertImage(...n))},[o.createElementVNode("i",{title:"增加图片",class:o.normalizeClass(e.isIonicons?"ivu-icon ivu-icon-md-images":"fontAwesome fa-regular fa-image")},null,2)]),o.createElementVNode("li",{onClick:t[16]||(t[16]=(...n)=>e.saveRemoteImage2Local&&e.saveRemoteImage2Local(...n))},[o.createElementVNode("i",{title:"一键存图",class:o.normalizeClass(e.isIonicons?"ivu-icon ivu-icon-md-photos":"fontAwesome fa-camera")},null,2)]),o.createElementVNode("li",{onClick:t[17]||(t[17]=(...n)=>e.cleanHTML&&e.cleanHTML(...n))},[o.createElementVNode("i",{title:"清理 HTML",class:o.normalizeClass(e.isIonicons?"ivu-icon ivu-icon-md-done-all":"fontAwesome fa-eraser")},null,2)]),o.createElementVNode("li",{onClick:t[18]||(t[18]=n=>e.isShowCode=!e.isShowCode)},[o.createElementVNode("i",{title:"切换到代码",class:o.normalizeClass((e.isIonicons?"ivu-icon ivu-icon-md-code":"fontAwesome fa-code")+" switchMode")},null,2)])]),t[26]||(t[26]=o.createElementVNode("div",{class:"editorBody"},[o.createElementVNode("iframe",{srcdoc:"<html><body></body></html>"}),o.createElementVNode("textarea")],-1))])}const A=c(E,[["render",$]]);function z(e,t){const s=(t?parent.location:window.location).search.substring(1).split("&");for(let l=0;l<s.length;l++){const r=s[l].split("=");if(r[0]==e)return r[1]}return null}const M={};function H(e,t){return o.openBlock(),o.createElementBlock("div",null,"hi")}const P=c(M,[["render",H]]);function d(e,t,i,s,l){let r={};if(l)for(const a in l)r[a]=l[a];t=t.toUpperCase();let n=i;i&&(t==="POST"||t==="PUT")&&(r["Content-Type"]=="application/json"?n=JSON.stringify(i):r["Content-Type"]=="application/x-www-form-urlencoded"&&(n=O(i))),fetch(e,{method:t,headers:r,body:n,credentials:"include"}).then(a=>{if(a.status===404)throw new Error("Not found 404: "+e);if(a.status===500)throw new Error("Server error: "+e);if(!a.ok)throw new Error(`Unexpected status: ${a.status}`);return a.json()}).then(a=>{s&&s(a)}).catch(a=>{console.error("Network error when fetching from: "+e,a)})}function O(e){const t=[];for(const[i,s]of Object.entries(e))s!=null&&typeof s!="function"&&t.push(`${encodeURIComponent(i)}=${encodeURIComponent(String(s))}`);return t.join("&")}function j(e,t,i){d(e,"GET",null,t,i)}function D(e,t,i,s){d(e,"POST",t,i,Object.assign({"Content-Type":"application/json"},s))}function B(e,t,i,s){d(e,"POST",t,i,Object.assign({"Content-Type":"application/x-www-form-urlencoded"},s))}function U(e,t,i,s){d(e,"PUT",t,i,Object.assign({"Content-Type":"application/json"},s))}function F(e,t,i,s){d(e,"PUT",t,i,Object.assign({"Content-Type":"application/x-www-form-urlencoded"},s))}function q(e,t,i){d(e,"DELETE",null,t,i)}var C=Object.freeze({__proto__:null,del:q,get:j,post:D,postForm:B,put:U,putForm:F});const R=o.defineComponent({data(){return{msg:"",autoLogin:!1}},methods:{hide(){this.$emit("hide")},handleSubmit(e,{username:t,password:i}){if(e){const s={grant_type:"password",username:t,password:i,client_id:"fvccgrfl3fzA7lrFyCpDA",client_secret:"zKvmM4Km8ghCIijl9ubqpHm1"};C.postForm("/iam_api/oidc/ropc_token",s,l=>{l.status?C.get("/iam_api/user/info",r=>{console.log(r),this.msg="登录成功",localStorage.setItem("isLoggedIn","true"),localStorage.setItem("userInfo",JSON.stringify(r.data)),setTimeout(()=>{this.$router.push("/?login_ok=1")},2e3)}):this.msg=l.message||"登录失败"})}},forgetPsw(){this.msg="请联系管理员重置密码"}}}),J={class:"mask"},K={class:"auto-login"},Q={class:"msg"};function W(e,t,i,s,l,r){const n=o.resolveComponent("UserName"),a=o.resolveComponent("Password"),u=o.resolveComponent("Submit"),m=o.resolveComponent("Login",!0);return o.openBlock(),o.createElementBlock("div",J,[o.createVNode(m,{onOnSubmit:e.handleSubmit,class:"login"},{default:o.withCtx(()=>[t[2]||(t[2]=o.createElementVNode("h1",null,"欢迎登录歪觅机器人管理后台",-1)),o.createVNode(n,{name:"username"}),o.createVNode(a,{name:"password"}),o.createElementVNode("div",K,[o.createElementVNode("span",Q,o.toDisplayString(e.msg),1),t[1]||(t[1]=o.createTextVNode("   ",-1)),o.createElementVNode("a",{onClick:t[0]||(t[0]=(...f)=>e.forgetPsw&&e.forgetPsw(...f))},"忘记密码")]),o.createVNode(u)]),_:1},8,["onOnSubmit"])])}const Y=c(R,[["render",W],["__scopeId","data-v-2149b790"]]),G={HomePage:P,Login:Y};exports.HtmlEditor=A;exports.MyButton=h;exports.admin=G;exports.getQueryParam=z;
@@ -1,14 +1,14 @@
1
- import { openBlock as m, createElementBlock as u, defineComponent as k, createElementVNode as t, createStaticVNode as C, normalizeClass as a } from "vue";
2
- const h = {}, c = (i, e) => {
3
- const s = i.__vccOpts || i;
4
- for (const [r, n] of e)
5
- s[r] = n;
6
- return s;
1
+ import { openBlock as p, createElementBlock as C, defineComponent as b, createElementVNode as n, createStaticVNode as k, normalizeClass as d, resolveComponent as m, createVNode as c, withCtx as I, toDisplayString as L, createTextVNode as S } from "vue";
2
+ const T = {}, g = (e, o) => {
3
+ const i = e.__vccOpts || e;
4
+ for (const [s, l] of o)
5
+ i[s] = l;
6
+ return i;
7
7
  };
8
- function v(i, e, s, r, n, l) {
9
- return m(), u("button", null, "hihi");
8
+ function $(e, o, i, s, l, r) {
9
+ return p(), C("button", null, "hihi");
10
10
  }
11
- const F = /* @__PURE__ */ c(h, [["render", v]]), w = k({
11
+ const ie = /* @__PURE__ */ g(T, [["render", $]]), A = b({
12
12
  name: "HtmlEditor",
13
13
  props: {
14
14
  modelValue: String,
@@ -28,11 +28,11 @@ const F = /* @__PURE__ */ c(h, [["render", v]]), w = k({
28
28
  };
29
29
  },
30
30
  mounted() {
31
- this.iframeEl = this.$el.querySelector("iframe"), this.sourceEditor = this.$el.querySelector("textarea"), this.iframeEl.contentWindow.onload = (i) => {
32
- this.iframeDoc = this.iframeEl.contentWindow.document, this.iframeDoc.designMode = "on", this.iframeDoc.addEventListener("paste", b.bind(this)), new MutationObserver((e, s) => {
31
+ this.iframeEl = this.$el.querySelector("iframe"), this.sourceEditor = this.$el.querySelector("textarea"), this.iframeEl.contentWindow.onload = (e) => {
32
+ this.iframeDoc = this.iframeEl.contentWindow.document, this.iframeDoc.designMode = "on", this.iframeDoc.addEventListener("paste", E.bind(this)), new MutationObserver((o, i) => {
33
33
  this.isShowCode || (this.sourceEditor.value = this.iframeDoc.body.innerHTML, this.$emit("onchange", this.sourceEditor.value)), this.$emit("update:modelValue", this.iframeDoc.body.innerHTML);
34
34
  }).observe(this.iframeDoc.body, { attributes: !0, childList: !0, subtree: !0, characterData: !0 });
35
- }, this.sourceEditor.oninput = (i) => {
35
+ }, this.sourceEditor.oninput = (e) => {
36
36
  this.isShowCode && this.sourceEditor.value && (this.setIframeBody(this.sourceEditor.value), this.$emit("onchange", this.sourceEditor.value));
37
37
  };
38
38
  },
@@ -42,8 +42,8 @@ const F = /* @__PURE__ */ c(h, [["render", v]]), w = k({
42
42
  *
43
43
  * @param html
44
44
  */
45
- setIframeBody(i) {
46
- this.iframeDoc && this.iframeDoc.body && (this.iframeDoc.body.innerHTML = i);
45
+ setIframeBody(e) {
46
+ this.iframeDoc && this.iframeDoc.body && (this.iframeDoc.body.innerHTML = e);
47
47
  },
48
48
  /**
49
49
  * 获取内容的 HTML
@@ -51,17 +51,17 @@ const F = /* @__PURE__ */ c(h, [["render", v]]), w = k({
51
51
  * @param cleanWord 是否清理冗余标签
52
52
  * @param encode 是否 URL 编码
53
53
  */
54
- getValue(i, e) {
55
- let s = this.iframeDoc.body.innerHTML;
56
- return i && (s = I(s)), e && (s = encodeURIComponent(s)), s;
54
+ getValue(e, o) {
55
+ let i = this.iframeDoc.body.innerHTML;
56
+ return e && (i = M(i)), o && (i = encodeURIComponent(i)), i;
57
57
  },
58
58
  createLink() {
59
- const i = prompt("请输入 URL 地址");
60
- i && this.format("createLink", i);
59
+ const e = prompt("请输入 URL 地址");
60
+ e && this.format("createLink", e);
61
61
  },
62
62
  insertImage() {
63
- window.isCreate ? alert("请保存记录后再上传图片。") : this.uploadImgMgr.show((i) => {
64
- i && i.isOk && this.format("insertImage", i.fullUrl);
63
+ window.isCreate ? alert("请保存记录后再上传图片。") : this.uploadImgMgr.show((e) => {
64
+ e && e.isOk && this.format("insertImage", e.fullUrl);
65
65
  });
66
66
  },
67
67
  /**
@@ -74,21 +74,21 @@ const F = /* @__PURE__ */ c(h, [["render", v]]), w = k({
74
74
  * 一键存图
75
75
  */
76
76
  saveRemoteImage2Local() {
77
- const i = this.iframeDoc.querySelectorAll("img"), e = new Array(), s = [];
78
- for (let r = 0, n = i.length; r < n; r++) {
79
- const l = i[r], o = l.getAttribute("src");
80
- o != null && /^http/.test(o) && (e.push(l), s.push(o));
77
+ const e = this.iframeDoc.querySelectorAll("img"), o = new Array(), i = [];
78
+ for (let s = 0, l = e.length; s < l; s++) {
79
+ const r = e[s], t = r.getAttribute("src");
80
+ t != null && /^http/.test(t) && (o.push(r), i.push(t));
81
81
  }
82
- s.length || console.log("未发现有远程图片");
82
+ i.length || console.log("未发现有远程图片");
83
83
  },
84
84
  /**
85
85
  * 当工具条点击的时候触发
86
86
  *
87
87
  * @param ev
88
88
  */
89
- onCmdClk(i) {
90
- const e = i.target, s = e.className.split(" ").shift();
91
- this.format(s);
89
+ onCmdClk(e) {
90
+ const o = e.target, i = o.className.split(" ").shift();
91
+ this.format(i);
92
92
  },
93
93
  /**
94
94
  * 通过 document.execCommand() 来操纵可编辑内容区域的元素
@@ -96,50 +96,50 @@ const F = /* @__PURE__ */ c(h, [["render", v]]), w = k({
96
96
  * @param type 命令的名称
97
97
  * @param para 一些命令(例如 insertImage)需要额外的参数(insertImage 需要提供插入 image 的 url),默认为 null
98
98
  */
99
- format(i, e) {
100
- e ? this.iframeDoc.execCommand(i, !1, e) : this.iframeDoc.execCommand(i, !1);
99
+ format(e, o) {
100
+ o ? this.iframeDoc.execCommand(e, !1, o) : this.iframeDoc.execCommand(e, !1);
101
101
  },
102
102
  /**
103
103
  * 选择字号大小
104
104
  *
105
105
  * @param ev
106
106
  */
107
- onFontsizeChoserClk(i) {
108
- const e = i.target, s = i.currentTarget.children;
109
- let r, n;
110
- for (r = 0, n = s.length; r < n && e != s[r]; r++)
107
+ onFontsizeChoserClk(e) {
108
+ const o = e.target, i = e.currentTarget.children;
109
+ let s, l;
110
+ for (s = 0, l = i.length; s < l && o != i[s]; s++)
111
111
  ;
112
- this.format("fontsize", r + "");
112
+ this.format("fontsize", s + "");
113
113
  },
114
114
  /**
115
115
  * 选择字体
116
116
  *
117
117
  * @param ev
118
118
  */
119
- onFontfamilyChoserClk(i) {
120
- const e = i.target;
121
- this.format("fontname", e.innerHTML);
122
- const s = e.parentNode;
123
- s.style.display = "none", setTimeout(() => s.style.display = "", 300);
119
+ onFontfamilyChoserClk(e) {
120
+ const o = e.target;
121
+ this.format("fontname", o.innerHTML);
122
+ const i = o.parentNode;
123
+ i.style.display = "none", setTimeout(() => i.style.display = "", 300);
124
124
  },
125
125
  /**
126
126
  * 创建颜色选择器
127
127
  */
128
128
  createColorPickerHTML() {
129
- const i = ["00", "33", "66", "99", "CC", "FF"];
130
- let e, s, r, n;
131
- const l = ['<div class="colorhead"><span class="colortitle">颜色选择</span></div><div class="colorbody"><table cellspaci="0" cellpadding="0"><tr>'];
132
- for (let o = 0; o < 6; ++o) {
133
- l.push('<td><table class="colorpanel" cellspacing="0" cellpadding="0">');
134
- for (let d = 0, p = i[o]; d < 6; ++d) {
135
- l.push("<tr>");
136
- for (let f = 0, g = i[d]; f < 6; ++f)
137
- e = i[f], r = f == 5 && o != 2 && o != 5 ? ";border-right:none;" : "", n = d == 5 && o < 3 ? ";border-bottom:none" : "", s = "#" + p + e + g, l.push('<td unselectable="on" style="background-color: ' + s + r + n + '" title="' + s + '"></td>');
138
- l.push("</tr>");
129
+ const e = ["00", "33", "66", "99", "CC", "FF"];
130
+ let o, i, s, l;
131
+ const r = ['<div class="colorhead"><span class="colortitle">颜色选择</span></div><div class="colorbody"><table cellspaci="0" cellpadding="0"><tr>'];
132
+ for (let t = 0; t < 6; ++t) {
133
+ r.push('<td><table class="colorpanel" cellspacing="0" cellpadding="0">');
134
+ for (let a = 0, y = e[t]; a < 6; ++a) {
135
+ r.push("<tr>");
136
+ for (let f = 0, h = e[a]; f < 6; ++f)
137
+ o = e[f], s = f == 5 && t != 2 && t != 5 ? ";border-right:none;" : "", l = a == 5 && t < 3 ? ";border-bottom:none" : "", i = "#" + y + o + h, r.push('<td unselectable="on" style="background-color: ' + i + s + l + '" title="' + i + '"></td>');
138
+ r.push("</tr>");
139
139
  }
140
- l.push("</table></td>"), i[o] == "66" && l.push("</tr><tr>");
140
+ r.push("</table></td>"), e[t] == "66" && r.push("</tr><tr>");
141
141
  }
142
- return l.push("</tr></table></div>"), l.join("");
142
+ return r.push("</tr></table></div>"), r.join("");
143
143
  }
144
144
  },
145
145
  watch: {
@@ -148,256 +148,368 @@ const F = /* @__PURE__ */ c(h, [["render", v]]), w = k({
148
148
  // if (!oldHtml) // 当没有值的时候输入,就是在初始化的时候(第一次)
149
149
  // this.setIframeBody(newHtml);
150
150
  // },
151
- modelValue(i, e) {
152
- e || this.setIframeBody(i);
151
+ modelValue(e, o) {
152
+ o || this.setIframeBody(e);
153
153
  },
154
154
  /**
155
155
  * 切換 HTML 編輯 or 可視化編輯
156
156
  *
157
157
  * @param n
158
158
  */
159
- isShowCode(i) {
160
- i ? (this.iframeEl.classList.add("hide"), this.sourceEditor.classList.add("show"), y.call(this, !0)) : (this.iframeEl.classList.remove("hide"), this.sourceEditor.classList.remove("show"), y.call(this, !1));
159
+ isShowCode(e) {
160
+ e ? (this.iframeEl.classList.add("hide"), this.sourceEditor.classList.add("show"), w.call(this, !0)) : (this.iframeEl.classList.remove("hide"), this.sourceEditor.classList.remove("show"), w.call(this, !1));
161
161
  }
162
162
  }
163
163
  });
164
- function b(i) {
164
+ function E(e) {
165
165
  if (!this.uploadImageActionUrl) {
166
166
  alert("未提供图片上传地址");
167
167
  return;
168
168
  }
169
- const e = i.clipboardData && i.clipboardData.items;
170
- if (!e || !e.length)
169
+ const o = e.clipboardData && e.clipboardData.items;
170
+ if (!o || !o.length)
171
171
  return;
172
- let s = null;
173
- for (let l = 0; l < e.length; l++) {
174
- const o = e[l];
175
- if (o.type.indexOf("image") !== -1) {
176
- s = o.getAsFile();
172
+ let i = null;
173
+ for (let r = 0; r < o.length; r++) {
174
+ const t = o[r];
175
+ if (t.type.indexOf("image") !== -1) {
176
+ i = t.getAsFile();
177
177
  break;
178
178
  }
179
179
  }
180
- if (!s)
180
+ if (!i)
181
181
  return;
182
- i.preventDefault();
183
- const r = new FormData();
184
- r.append("file", s, s.name);
185
- const n = new XMLHttpRequest();
186
- n.addEventListener("load", (l) => {
187
- if (n.status >= 200 && n.status < 300) {
188
- const o = JSON.parse(n.responseText);
189
- console.log("Success:", o), this.format("insertImage", o.data.url);
182
+ e.preventDefault();
183
+ const s = new FormData();
184
+ s.append("file", i, i.name);
185
+ const l = new XMLHttpRequest();
186
+ l.addEventListener("load", (r) => {
187
+ if (l.status >= 200 && l.status < 300) {
188
+ const t = JSON.parse(l.responseText);
189
+ console.log("Success:", t), this.format("insertImage", t.data.url);
190
190
  } else
191
- console.error("Upload failed with status:", n.status), alert("Upload failed!");
192
- }), n.addEventListener("error", function(l) {
193
- console.error("Network error during upload:", l), alert("Upload failed due to a network error!");
194
- }), n.open("POST", this.uploadImageActionUrl), n.send(r);
191
+ console.error("Upload failed with status:", l.status), alert("Upload failed!");
192
+ }), l.addEventListener("error", function(r) {
193
+ console.error("Network error during upload:", r), alert("Upload failed due to a network error!");
194
+ }), l.open("POST", this.uploadImageActionUrl), l.send(s);
195
195
  }
196
- function y(i) {
197
- this.$el.querySelectorAll(".toolbar i").forEach((e) => {
198
- e.className.indexOf("switchMode") == -1 && (e.style.color = i ? "lightgray" : "");
196
+ function w(e) {
197
+ this.$el.querySelectorAll(".toolbar i").forEach((o) => {
198
+ o.className.indexOf("switchMode") == -1 && (o.style.color = e ? "lightgray" : "");
199
199
  });
200
200
  }
201
- function I(i) {
202
- return i = i.replace(/<(\/)*(\\?xml:|meta|link|span|font|del|ins|st1:|[ovwxp]:)((.|\s)*?)>/gi, ""), i = i.replace(/(class|style|type|start)=("(.*?)"|(\w*))/gi, ""), i = i.replace(/<style(.*?)style>/gi, ""), i = i.replace(/<script(.*?)script>/gi, ""), i = i.replace(/<!--(.*?)-->/gi, ""), i;
201
+ function M(e) {
202
+ return e = e.replace(/<(\/)*(\\?xml:|meta|link|span|font|del|ins|st1:|[ovwxp]:)((.|\s)*?)>/gi, ""), e = e.replace(/(class|style|type|start)=("(.*?)"|(\w*))/gi, ""), e = e.replace(/<style(.*?)style>/gi, ""), e = e.replace(/<script(.*?)script>/gi, ""), e = e.replace(/<!--(.*?)-->/gi, ""), e;
203
203
  }
204
- const L = { class: "aj-form-html-editor" }, A = { class: "toolbar" }, M = { class: "dorpdown" }, H = { class: "dorpdown" }, E = { class: "dorpdown" }, S = ["innerHTML"], T = { class: "dorpdown" }, D = ["innerHTML"];
205
- function $(i, e, s, r, n, l) {
206
- return m(), u("div", L, [
207
- t("ul", A, [
208
- t("li", M, [
209
- e[20] || (e[20] = t("i", {
204
+ const H = { class: "aj-form-html-editor" }, P = { class: "toolbar" }, D = { class: "dorpdown" }, N = { class: "dorpdown" }, O = { class: "dorpdown" }, j = ["innerHTML"], U = { class: "dorpdown" }, z = ["innerHTML"];
205
+ function F(e, o, i, s, l, r) {
206
+ return p(), C("div", H, [
207
+ n("ul", P, [
208
+ n("li", D, [
209
+ o[20] || (o[20] = n("i", {
210
210
  title: "字体",
211
211
  class: "text-icon"
212
212
  }, "A", -1)),
213
- t("div", {
213
+ n("div", {
214
214
  class: "fontfamilyChoser",
215
- onClick: e[0] || (e[0] = (...o) => i.onFontfamilyChoserClk && i.onFontfamilyChoserClk(...o))
216
- }, [...e[19] || (e[19] = [
217
- C('<a style="font-family:&#39;宋体&#39;;">宋体</a><a style="font-family:&#39;黑体&#39;;">黑体</a><a style="font-family:&#39;楷体&#39;;">楷体</a><a style="font-family:&#39;隶书&#39;;">隶书</a><a style="font-family:&#39;幼圆&#39;;">幼圆</a><a style="font-family:&#39;Microsoft YaHei&#39;;">Microsoft YaHei</a><a style="font-family:Arial;">Arial</a><a style="font-family:&#39;Arial Narrow&#39;;">Arial Narrow</a><a style="font-family:&#39;Arial Black&#39;;">Arial Black</a><a style="font-family:&#39;Comic Sans MS&#39;;">Comic Sans MS</a><a style="font-family:Courier;">Courier</a><a style="font-family:System;">System</a><a style="font-family:&#39;Times New Roman&#39;;">Times New Roman</a><a style="font-family:Verdana;">Verdana</a>', 14)
215
+ onClick: o[0] || (o[0] = (...t) => e.onFontfamilyChoserClk && e.onFontfamilyChoserClk(...t))
216
+ }, [...o[19] || (o[19] = [
217
+ k('<a style="font-family:&#39;宋体&#39;;">宋体</a><a style="font-family:&#39;黑体&#39;;">黑体</a><a style="font-family:&#39;楷体&#39;;">楷体</a><a style="font-family:&#39;隶书&#39;;">隶书</a><a style="font-family:&#39;幼圆&#39;;">幼圆</a><a style="font-family:&#39;Microsoft YaHei&#39;;">Microsoft YaHei</a><a style="font-family:Arial;">Arial</a><a style="font-family:&#39;Arial Narrow&#39;;">Arial Narrow</a><a style="font-family:&#39;Arial Black&#39;;">Arial Black</a><a style="font-family:&#39;Comic Sans MS&#39;;">Comic Sans MS</a><a style="font-family:Courier;">Courier</a><a style="font-family:System;">System</a><a style="font-family:&#39;Times New Roman&#39;;">Times New Roman</a><a style="font-family:Verdana;">Verdana</a>', 14)
218
218
  ])])
219
219
  ]),
220
- t("li", H, [
221
- e[22] || (e[22] = t("i", {
220
+ n("li", N, [
221
+ o[22] || (o[22] = n("i", {
222
222
  title: "字号",
223
223
  class: "text-icon"
224
224
  }, "H", -1)),
225
- t("div", {
225
+ n("div", {
226
226
  class: "fontsizeChoser",
227
- onClick: e[1] || (e[1] = (...o) => i.onFontsizeChoserClk && i.onFontsizeChoserClk(...o))
228
- }, [...e[21] || (e[21] = [
229
- C('<a style="font-size:xx-small;">极小</a><a style="font-size:x-small;">特小</a><a style="font-size:small;">小</a><a style="font-size:medium;">中</a><a style="font-size:large;">大</a><a style="font-size:x-large;">特大</a><a style="font-size:xx-large;line-height:140%;">极大</a>', 7)
227
+ onClick: o[1] || (o[1] = (...t) => e.onFontsizeChoserClk && e.onFontsizeChoserClk(...t))
228
+ }, [...o[21] || (o[21] = [
229
+ k('<a style="font-size:xx-small;">极小</a><a style="font-size:x-small;">特小</a><a style="font-size:small;">小</a><a style="font-size:medium;">中</a><a style="font-size:large;">大</a><a style="font-size:x-large;">特大</a><a style="font-size:xx-large;line-height:140%;">极大</a>', 7)
230
230
  ])])
231
231
  ]),
232
- t("li", {
233
- onClick: e[2] || (e[2] = (...o) => i.onCmdClk && i.onCmdClk(...o))
234
- }, [...e[23] || (e[23] = [
235
- t("i", {
232
+ n("li", {
233
+ onClick: o[2] || (o[2] = (...t) => e.onCmdClk && e.onCmdClk(...t))
234
+ }, [...o[23] || (o[23] = [
235
+ n("i", {
236
236
  title: "加粗",
237
237
  class: "bold text-icon"
238
238
  }, "B", -1)
239
239
  ])]),
240
- t("li", {
241
- onClick: e[3] || (e[3] = (...o) => i.onCmdClk && i.onCmdClk(...o))
242
- }, [...e[24] || (e[24] = [
243
- t("i", {
240
+ n("li", {
241
+ onClick: o[3] || (o[3] = (...t) => e.onCmdClk && e.onCmdClk(...t))
242
+ }, [...o[24] || (o[24] = [
243
+ n("i", {
244
244
  title: "斜体",
245
245
  class: "italic text-icon",
246
246
  style: { "font-style": "italic" }
247
247
  }, "I", -1)
248
248
  ])]),
249
- t("li", {
250
- onClick: e[4] || (e[4] = (...o) => i.onCmdClk && i.onCmdClk(...o))
251
- }, [...e[25] || (e[25] = [
252
- t("i", {
249
+ n("li", {
250
+ onClick: o[4] || (o[4] = (...t) => e.onCmdClk && e.onCmdClk(...t))
251
+ }, [...o[25] || (o[25] = [
252
+ n("i", {
253
253
  title: "下划线",
254
254
  class: "underline text-icon",
255
255
  style: { "text-decoration": "underline" }
256
256
  }, "U", -1)
257
257
  ])]),
258
- t("li", {
259
- onClick: e[5] || (e[5] = (...o) => i.onCmdClk && i.onCmdClk(...o))
258
+ n("li", {
259
+ onClick: o[5] || (o[5] = (...t) => e.onCmdClk && e.onCmdClk(...t))
260
260
  }, [
261
- t("i", {
261
+ n("i", {
262
262
  title: "左对齐",
263
- class: a("justifyleft " + (i.isIonicons ? "ivu-icon ivu-icon-bingo-menu-fold" : "fontAwesome fa-align-left"))
263
+ class: d("justifyleft " + (e.isIonicons ? "ivu-icon ivu-icon-bingo-menu-fold" : "fontAwesome fa-align-left"))
264
264
  }, null, 2)
265
265
  ]),
266
- t("li", {
267
- onClick: e[6] || (e[6] = (...o) => i.onCmdClk && i.onCmdClk(...o))
266
+ n("li", {
267
+ onClick: o[6] || (o[6] = (...t) => e.onCmdClk && e.onCmdClk(...t))
268
268
  }, [
269
- t("i", {
269
+ n("i", {
270
270
  title: "中间对齐",
271
- class: a("justifycenter " + (i.isIonicons ? "ivu-icon ivu-icon-md-menu" : "fontAwesome fa-align-center"))
271
+ class: d("justifycenter " + (e.isIonicons ? "ivu-icon ivu-icon-md-menu" : "fontAwesome fa-align-center"))
272
272
  }, null, 2)
273
273
  ]),
274
- t("li", {
275
- onClick: e[7] || (e[7] = (...o) => i.onCmdClk && i.onCmdClk(...o))
274
+ n("li", {
275
+ onClick: o[7] || (o[7] = (...t) => e.onCmdClk && e.onCmdClk(...t))
276
276
  }, [
277
- t("i", {
277
+ n("i", {
278
278
  title: "右对齐",
279
- class: a("justifyright " + (i.isIonicons ? "ivu-icon ivu-icon-bingo-menu-unfold" : "fontAwesome fa-align-right"))
279
+ class: d("justifyright " + (e.isIonicons ? "ivu-icon ivu-icon-bingo-menu-unfold" : "fontAwesome fa-align-right"))
280
280
  }, null, 2)
281
281
  ]),
282
- t("li", {
283
- onClick: e[8] || (e[8] = (...o) => i.onCmdClk && i.onCmdClk(...o))
282
+ n("li", {
283
+ onClick: o[8] || (o[8] = (...t) => e.onCmdClk && e.onCmdClk(...t))
284
284
  }, [
285
- t("i", {
285
+ n("i", {
286
286
  title: "数字编号",
287
- class: a("insertorderedlist " + (i.isIonicons ? "ivu-icon ivu-icon-md-list" : "fontAwesome fa-list-ol"))
287
+ class: d("insertorderedlist " + (e.isIonicons ? "ivu-icon ivu-icon-md-list" : "fontAwesome fa-list-ol"))
288
288
  }, null, 2)
289
289
  ]),
290
- t("li", {
291
- onClick: e[9] || (e[9] = (...o) => i.onCmdClk && i.onCmdClk(...o))
290
+ n("li", {
291
+ onClick: o[9] || (o[9] = (...t) => e.onCmdClk && e.onCmdClk(...t))
292
292
  }, [
293
- t("i", {
293
+ n("i", {
294
294
  title: "项目编号",
295
- class: a("insertunorderedlist " + (i.isIonicons ? "ivu-icon ivu-icon-ios-list" : "fontAwesome fa-list-ul"))
295
+ class: d("insertunorderedlist " + (e.isIonicons ? "ivu-icon ivu-icon-ios-list" : "fontAwesome fa-list-ul"))
296
296
  }, null, 2)
297
297
  ]),
298
- t("li", {
299
- onClick: e[10] || (e[10] = (...o) => i.onCmdClk && i.onCmdClk(...o))
298
+ n("li", {
299
+ onClick: o[10] || (o[10] = (...t) => e.onCmdClk && e.onCmdClk(...t))
300
300
  }, [
301
- t("i", {
301
+ n("i", {
302
302
  title: "增加缩进",
303
- class: a("outdent " + (i.isIonicons ? "ivu-icon ivu-icon-ios-return-left" : "fontAwesome fa-outdent"))
303
+ class: d("outdent " + (e.isIonicons ? "ivu-icon ivu-icon-ios-return-left" : "fontAwesome fa-outdent"))
304
304
  }, null, 2)
305
305
  ]),
306
- t("li", {
307
- onClick: e[11] || (e[11] = (...o) => i.onCmdClk && i.onCmdClk(...o))
306
+ n("li", {
307
+ onClick: o[11] || (o[11] = (...t) => e.onCmdClk && e.onCmdClk(...t))
308
308
  }, [
309
- t("i", {
309
+ n("i", {
310
310
  title: "减少缩进",
311
- class: a("indent " + (i.isIonicons ? "ivu-icon ivu-icon-ios-return-right" : "fontAwesome fa-indent"))
311
+ class: d("indent " + (e.isIonicons ? "ivu-icon ivu-icon-ios-return-right" : "fontAwesome fa-indent"))
312
312
  }, null, 2)
313
313
  ]),
314
- t("li", E, [
315
- t("i", {
314
+ n("li", O, [
315
+ n("i", {
316
316
  title: "字体颜色",
317
- class: a(i.isIonicons ? "ivu-icon ivu-icon-md-brush" : "fontAwesome fa-paint-brush")
317
+ class: d(e.isIonicons ? "ivu-icon ivu-icon-md-brush" : "fontAwesome fa-paint-brush")
318
318
  }, null, 2),
319
- t("div", {
319
+ n("div", {
320
320
  class: "colorPicker",
321
- innerHTML: i.createColorPickerHTML(),
322
- onClick: e[12] || (e[12] = (o) => i.format("foreColor", o.target.title))
323
- }, null, 8, S)
321
+ innerHTML: e.createColorPickerHTML(),
322
+ onClick: o[12] || (o[12] = (t) => e.format("foreColor", t.target.title))
323
+ }, null, 8, j)
324
324
  ]),
325
- t("li", T, [
326
- t("i", {
325
+ n("li", U, [
326
+ n("i", {
327
327
  title: "背景颜色",
328
- class: a(i.isIonicons ? "ivu-icon ivu-icon-ios-brush-outline" : "fontAwesome fa-pencil")
328
+ class: d(e.isIonicons ? "ivu-icon ivu-icon-ios-brush-outline" : "fontAwesome fa-pencil")
329
329
  }, null, 2),
330
- t("div", {
330
+ n("div", {
331
331
  class: "colorPicker",
332
- innerHTML: i.createColorPickerHTML(),
333
- onClick: e[13] || (e[13] = (o) => i.format("backColor", o.target.title))
334
- }, null, 8, D)
332
+ innerHTML: e.createColorPickerHTML(),
333
+ onClick: o[13] || (o[13] = (t) => e.format("backColor", t.target.title))
334
+ }, null, 8, z)
335
335
  ]),
336
- t("li", {
337
- onClick: e[14] || (e[14] = (...o) => i.createLink && i.createLink(...o))
336
+ n("li", {
337
+ onClick: o[14] || (o[14] = (...t) => e.createLink && e.createLink(...t))
338
338
  }, [
339
- t("i", {
339
+ n("i", {
340
340
  title: "增加链接",
341
- class: a(i.isIonicons ? "ivu-icon ivu-icon-ios-link" : "fontAwesome fa-link")
341
+ class: d(e.isIonicons ? "ivu-icon ivu-icon-ios-link" : "fontAwesome fa-link")
342
342
  }, null, 2)
343
343
  ]),
344
- t("li", {
345
- onClick: e[15] || (e[15] = (...o) => i.insertImage && i.insertImage(...o))
344
+ n("li", {
345
+ onClick: o[15] || (o[15] = (...t) => e.insertImage && e.insertImage(...t))
346
346
  }, [
347
- t("i", {
347
+ n("i", {
348
348
  title: "增加图片",
349
- class: a(i.isIonicons ? "ivu-icon ivu-icon-md-images" : "fontAwesome fa-regular fa-image")
349
+ class: d(e.isIonicons ? "ivu-icon ivu-icon-md-images" : "fontAwesome fa-regular fa-image")
350
350
  }, null, 2)
351
351
  ]),
352
- t("li", {
353
- onClick: e[16] || (e[16] = (...o) => i.saveRemoteImage2Local && i.saveRemoteImage2Local(...o))
352
+ n("li", {
353
+ onClick: o[16] || (o[16] = (...t) => e.saveRemoteImage2Local && e.saveRemoteImage2Local(...t))
354
354
  }, [
355
- t("i", {
355
+ n("i", {
356
356
  title: "一键存图",
357
- class: a(i.isIonicons ? "ivu-icon ivu-icon-md-photos" : "fontAwesome fa-camera")
357
+ class: d(e.isIonicons ? "ivu-icon ivu-icon-md-photos" : "fontAwesome fa-camera")
358
358
  }, null, 2)
359
359
  ]),
360
- t("li", {
361
- onClick: e[17] || (e[17] = (...o) => i.cleanHTML && i.cleanHTML(...o))
360
+ n("li", {
361
+ onClick: o[17] || (o[17] = (...t) => e.cleanHTML && e.cleanHTML(...t))
362
362
  }, [
363
- t("i", {
363
+ n("i", {
364
364
  title: "清理 HTML",
365
- class: a(i.isIonicons ? "ivu-icon ivu-icon-md-done-all" : "fontAwesome fa-eraser")
365
+ class: d(e.isIonicons ? "ivu-icon ivu-icon-md-done-all" : "fontAwesome fa-eraser")
366
366
  }, null, 2)
367
367
  ]),
368
- t("li", {
369
- onClick: e[18] || (e[18] = (o) => i.isShowCode = !i.isShowCode)
368
+ n("li", {
369
+ onClick: o[18] || (o[18] = (t) => e.isShowCode = !e.isShowCode)
370
370
  }, [
371
- t("i", {
371
+ n("i", {
372
372
  title: "切换到代码",
373
- class: a((i.isIonicons ? "ivu-icon ivu-icon-md-code" : "fontAwesome fa-code") + " switchMode")
373
+ class: d((e.isIonicons ? "ivu-icon ivu-icon-md-code" : "fontAwesome fa-code") + " switchMode")
374
374
  }, null, 2)
375
375
  ])
376
376
  ]),
377
- e[26] || (e[26] = t("div", { class: "editorBody" }, [
378
- t("iframe", { srcdoc: "<html><body></body></html>" }),
379
- t("textarea")
377
+ o[26] || (o[26] = n("div", { class: "editorBody" }, [
378
+ n("iframe", { srcdoc: "<html><body></body></html>" }),
379
+ n("textarea")
380
380
  ], -1))
381
381
  ]);
382
382
  }
383
- const U = /* @__PURE__ */ c(w, [["render", $]]);
384
- function V(i, e) {
385
- const r = (e ? parent.location : window.location).search.substring(1).split("&");
386
- for (let n = 0; n < r.length; n++) {
387
- const l = r[n].split("=");
388
- if (l[0] == i)
389
- return l[1];
383
+ const ne = /* @__PURE__ */ g(A, [["render", F]]);
384
+ function se(e, o) {
385
+ const s = (o ? parent.location : window.location).search.substring(1).split("&");
386
+ for (let l = 0; l < s.length; l++) {
387
+ const r = s[l].split("=");
388
+ if (r[0] == e)
389
+ return r[1];
390
390
  }
391
391
  return null;
392
392
  }
393
- const z = {};
394
- function B(i, e) {
395
- return m(), u("div", null, "hi");
393
+ const B = {};
394
+ function V(e, o) {
395
+ return p(), C("div", null, "hi");
396
396
  }
397
- const N = /* @__PURE__ */ c(z, [["render", B]]), R = { HomePage: N };
397
+ const R = /* @__PURE__ */ g(B, [["render", V]]);
398
+ function u(e, o, i, s, l) {
399
+ let r = {};
400
+ if (l)
401
+ for (const a in l)
402
+ r[a] = l[a];
403
+ o = o.toUpperCase();
404
+ let t = i;
405
+ i && (o === "POST" || o === "PUT") && (r["Content-Type"] == "application/json" ? t = JSON.stringify(i) : r["Content-Type"] == "application/x-www-form-urlencoded" && (t = q(i))), fetch(e, {
406
+ method: o,
407
+ headers: r,
408
+ body: t,
409
+ credentials: "include"
410
+ }).then((a) => {
411
+ if (a.status === 404)
412
+ throw new Error("Not found 404: " + e);
413
+ if (a.status === 500)
414
+ throw new Error("Server error: " + e);
415
+ if (!a.ok)
416
+ throw new Error(`Unexpected status: ${a.status}`);
417
+ return a.json();
418
+ }).then((a) => {
419
+ s && s(a);
420
+ }).catch((a) => {
421
+ console.error("Network error when fetching from: " + e, a);
422
+ });
423
+ }
424
+ function q(e) {
425
+ const o = [];
426
+ for (const [i, s] of Object.entries(e))
427
+ s != null && typeof s != "function" && o.push(`${encodeURIComponent(i)}=${encodeURIComponent(String(s))}`);
428
+ return o.join("&");
429
+ }
430
+ function J(e, o, i) {
431
+ u(e, "GET", null, o, i);
432
+ }
433
+ function K(e, o, i, s) {
434
+ u(e, "POST", o, i, Object.assign({ "Content-Type": "application/json" }, s));
435
+ }
436
+ function W(e, o, i, s) {
437
+ u(e, "POST", o, i, Object.assign({ "Content-Type": "application/x-www-form-urlencoded" }, s));
438
+ }
439
+ function Y(e, o, i, s) {
440
+ u(e, "PUT", o, i, Object.assign({ "Content-Type": "application/json" }, s));
441
+ }
442
+ function G(e, o, i, s) {
443
+ u(e, "PUT", o, i, Object.assign({ "Content-Type": "application/x-www-form-urlencoded" }, s));
444
+ }
445
+ function Q(e, o, i) {
446
+ u(e, "DELETE", null, o, i);
447
+ }
448
+ var v = /* @__PURE__ */ Object.freeze({
449
+ __proto__: null,
450
+ del: Q,
451
+ get: J,
452
+ post: K,
453
+ postForm: W,
454
+ put: Y,
455
+ putForm: G
456
+ });
457
+ const X = b({
458
+ data() {
459
+ return {
460
+ msg: "",
461
+ autoLogin: !1
462
+ };
463
+ },
464
+ methods: {
465
+ hide() {
466
+ this.$emit("hide");
467
+ },
468
+ handleSubmit(e, { username: o, password: i }) {
469
+ if (e) {
470
+ const s = { grant_type: "password", username: o, password: i, client_id: "fvccgrfl3fzA7lrFyCpDA", client_secret: "zKvmM4Km8ghCIijl9ubqpHm1" };
471
+ v.postForm("/iam_api/oidc/ropc_token", s, (l) => {
472
+ l.status ? v.get("/iam_api/user/info", (r) => {
473
+ console.log(r), this.msg = "登录成功", localStorage.setItem("isLoggedIn", "true"), localStorage.setItem("userInfo", JSON.stringify(r.data)), setTimeout(() => {
474
+ this.$router.push("/?login_ok=1");
475
+ }, 2e3);
476
+ }) : this.msg = l.message || "登录失败";
477
+ });
478
+ }
479
+ },
480
+ forgetPsw() {
481
+ this.msg = "请联系管理员重置密码";
482
+ }
483
+ }
484
+ }), Z = { class: "mask" }, x = { class: "auto-login" }, _ = { class: "msg" };
485
+ function ee(e, o, i, s, l, r) {
486
+ const t = m("UserName"), a = m("Password"), y = m("Submit"), f = m("Login", !0);
487
+ return p(), C("div", Z, [
488
+ c(f, {
489
+ onOnSubmit: e.handleSubmit,
490
+ class: "login"
491
+ }, {
492
+ default: I(() => [
493
+ o[2] || (o[2] = n("h1", null, "欢迎登录歪觅机器人管理后台", -1)),
494
+ c(t, { name: "username" }),
495
+ c(a, { name: "password" }),
496
+ n("div", x, [
497
+ n("span", _, L(e.msg), 1),
498
+ o[1] || (o[1] = S("   ", -1)),
499
+ n("a", {
500
+ onClick: o[0] || (o[0] = (...h) => e.forgetPsw && e.forgetPsw(...h))
501
+ }, "忘记密码")
502
+ ]),
503
+ c(y)
504
+ ]),
505
+ _: 1
506
+ }, 8, ["onOnSubmit"])
507
+ ]);
508
+ }
509
+ const oe = /* @__PURE__ */ g(X, [["render", ee], ["__scopeId", "data-v-2149b790"]]), le = { HomePage: R, Login: oe };
398
510
  export {
399
- U as HtmlEditor,
400
- F as MyButton,
401
- R as admin,
402
- V as getQueryParam
511
+ ne as HtmlEditor,
512
+ ie as MyButton,
513
+ le as admin,
514
+ se as getQueryParam
403
515
  };
@@ -1 +1 @@
1
- (function(a,o){typeof exports=="object"&&typeof module<"u"?o(exports,require("vue")):typeof define=="function"&&define.amd?define(["exports","vue"],o):(a=typeof globalThis<"u"?globalThis:a||self,o(a.ajaxjs_ui={},a.Vue))})(this,(function(a,o){"use strict";const u={},c=(e,t)=>{const l=e.__vccOpts||e;for(const[r,n]of t)l[r]=n;return l};function C(e,t,l,r,n,s){return o.openBlock(),o.createElementBlock("button",null,"hihi")}const y=c(u,[["render",C]]),p=o.defineComponent({name:"HtmlEditor",props:{modelValue:String,uploadImageActionUrl:String,isIonicons:Boolean},emits:["update:modelValue","onchange"],data(){return{isShowCode:!1,iframeEl:null,sourceEditor:null}},mounted(){this.iframeEl=this.$el.querySelector("iframe"),this.sourceEditor=this.$el.querySelector("textarea"),this.iframeEl.contentWindow.onload=e=>{this.iframeDoc=this.iframeEl.contentWindow.document,this.iframeDoc.designMode="on",this.iframeDoc.addEventListener("paste",g.bind(this)),new MutationObserver((t,l)=>{this.isShowCode||(this.sourceEditor.value=this.iframeDoc.body.innerHTML,this.$emit("onchange",this.sourceEditor.value)),this.$emit("update:modelValue",this.iframeDoc.body.innerHTML)}).observe(this.iframeDoc.body,{attributes:!0,childList:!0,subtree:!0,characterData:!0})},this.sourceEditor.oninput=e=>{this.isShowCode&&this.sourceEditor.value&&(this.setIframeBody(this.sourceEditor.value),this.$emit("onchange",this.sourceEditor.value))}},methods:{setIframeBody(e){this.iframeDoc&&this.iframeDoc.body&&(this.iframeDoc.body.innerHTML=e)},getValue(e,t){let l=this.iframeDoc.body.innerHTML;return e&&(l=k(l)),t&&(l=encodeURIComponent(l)),l},createLink(){const e=prompt("请输入 URL 地址");e&&this.format("createLink",e)},insertImage(){window.isCreate?alert("请保存记录后再上传图片。"):this.uploadImgMgr.show(e=>{e&&e.isOk&&this.format("insertImage",e.fullUrl)})},cleanHTML(){this.setIframeBody(HtmlSanitizer.SanitizeHtml(this.iframeDoc.body.innerHTML))},saveRemoteImage2Local(){const e=this.iframeDoc.querySelectorAll("img"),t=new Array,l=[];for(let r=0,n=e.length;r<n;r++){const s=e[r],i=s.getAttribute("src");i!=null&&/^http/.test(i)&&(t.push(s),l.push(i))}l.length||console.log("未发现有远程图片")},onCmdClk(e){const t=e.target,l=t.className.split(" ").shift();this.format(l)},format(e,t){t?this.iframeDoc.execCommand(e,!1,t):this.iframeDoc.execCommand(e,!1)},onFontsizeChoserClk(e){const t=e.target,l=e.currentTarget.children;let r,n;for(r=0,n=l.length;r<n&&t!=l[r];r++);this.format("fontsize",r+"")},onFontfamilyChoserClk(e){const t=e.target;this.format("fontname",t.innerHTML);const l=t.parentNode;l.style.display="none",setTimeout(()=>l.style.display="",300)},createColorPickerHTML(){const e=["00","33","66","99","CC","FF"];let t,l,r,n;const s=['<div class="colorhead"><span class="colortitle">颜色选择</span></div><div class="colorbody"><table cellspaci="0" cellpadding="0"><tr>'];for(let i=0;i<6;++i){s.push('<td><table class="colorpanel" cellspacing="0" cellpadding="0">');for(let d=0,D=e[i];d<6;++d){s.push("<tr>");for(let m=0,$=e[d];m<6;++m)t=e[m],r=m==5&&i!=2&&i!=5?";border-right:none;":"",n=d==5&&i<3?";border-bottom:none":"",l="#"+D+t+$,s.push('<td unselectable="on" style="background-color: '+l+r+n+'" title="'+l+'"></td>');s.push("</tr>")}s.push("</table></td>"),e[i]=="66"&&s.push("</tr><tr>")}return s.push("</tr></table></div>"),s.join("")}},watch:{modelValue(e,t){t||this.setIframeBody(e)},isShowCode(e){e?(this.iframeEl.classList.add("hide"),this.sourceEditor.classList.add("show"),f.call(this,!0)):(this.iframeEl.classList.remove("hide"),this.sourceEditor.classList.remove("show"),f.call(this,!1))}}});function g(e){if(!this.uploadImageActionUrl){alert("未提供图片上传地址");return}const t=e.clipboardData&&e.clipboardData.items;if(!t||!t.length)return;let l=null;for(let s=0;s<t.length;s++){const i=t[s];if(i.type.indexOf("image")!==-1){l=i.getAsFile();break}}if(!l)return;e.preventDefault();const r=new FormData;r.append("file",l,l.name);const n=new XMLHttpRequest;n.addEventListener("load",s=>{if(n.status>=200&&n.status<300){const i=JSON.parse(n.responseText);console.log("Success:",i),this.format("insertImage",i.data.url)}else console.error("Upload failed with status:",n.status),alert("Upload failed!")}),n.addEventListener("error",function(s){console.error("Network error during upload:",s),alert("Upload failed due to a network error!")}),n.open("POST",this.uploadImageActionUrl),n.send(r)}function f(e){this.$el.querySelectorAll(".toolbar i").forEach(t=>{t.className.indexOf("switchMode")==-1&&(t.style.color=e?"lightgray":"")})}function k(e){return e=e.replace(/<(\/)*(\\?xml:|meta|link|span|font|del|ins|st1:|[ovwxp]:)((.|\s)*?)>/gi,""),e=e.replace(/(class|style|type|start)=("(.*?)"|(\w*))/gi,""),e=e.replace(/<style(.*?)style>/gi,""),e=e.replace(/<script(.*?)script>/gi,""),e=e.replace(/<!--(.*?)-->/gi,""),e}const E={class:"aj-form-html-editor"},h={class:"toolbar"},N={class:"dorpdown"},V={class:"dorpdown"},w={class:"dorpdown"},b=["innerHTML"],I={class:"dorpdown"},L=["innerHTML"];function A(e,t,l,r,n,s){return o.openBlock(),o.createElementBlock("div",E,[o.createElementVNode("ul",h,[o.createElementVNode("li",N,[t[20]||(t[20]=o.createElementVNode("i",{title:"字体",class:"text-icon"},"A",-1)),o.createElementVNode("div",{class:"fontfamilyChoser",onClick:t[0]||(t[0]=(...i)=>e.onFontfamilyChoserClk&&e.onFontfamilyChoserClk(...i))},[...t[19]||(t[19]=[o.createStaticVNode('<a style="font-family:&#39;宋体&#39;;">宋体</a><a style="font-family:&#39;黑体&#39;;">黑体</a><a style="font-family:&#39;楷体&#39;;">楷体</a><a style="font-family:&#39;隶书&#39;;">隶书</a><a style="font-family:&#39;幼圆&#39;;">幼圆</a><a style="font-family:&#39;Microsoft YaHei&#39;;">Microsoft YaHei</a><a style="font-family:Arial;">Arial</a><a style="font-family:&#39;Arial Narrow&#39;;">Arial Narrow</a><a style="font-family:&#39;Arial Black&#39;;">Arial Black</a><a style="font-family:&#39;Comic Sans MS&#39;;">Comic Sans MS</a><a style="font-family:Courier;">Courier</a><a style="font-family:System;">System</a><a style="font-family:&#39;Times New Roman&#39;;">Times New Roman</a><a style="font-family:Verdana;">Verdana</a>',14)])])]),o.createElementVNode("li",V,[t[22]||(t[22]=o.createElementVNode("i",{title:"字号",class:"text-icon"},"H",-1)),o.createElementVNode("div",{class:"fontsizeChoser",onClick:t[1]||(t[1]=(...i)=>e.onFontsizeChoserClk&&e.onFontsizeChoserClk(...i))},[...t[21]||(t[21]=[o.createStaticVNode('<a style="font-size:xx-small;">极小</a><a style="font-size:x-small;">特小</a><a style="font-size:small;">小</a><a style="font-size:medium;">中</a><a style="font-size:large;">大</a><a style="font-size:x-large;">特大</a><a style="font-size:xx-large;line-height:140%;">极大</a>',7)])])]),o.createElementVNode("li",{onClick:t[2]||(t[2]=(...i)=>e.onCmdClk&&e.onCmdClk(...i))},[...t[23]||(t[23]=[o.createElementVNode("i",{title:"加粗",class:"bold text-icon"},"B",-1)])]),o.createElementVNode("li",{onClick:t[3]||(t[3]=(...i)=>e.onCmdClk&&e.onCmdClk(...i))},[...t[24]||(t[24]=[o.createElementVNode("i",{title:"斜体",class:"italic text-icon",style:{"font-style":"italic"}},"I",-1)])]),o.createElementVNode("li",{onClick:t[4]||(t[4]=(...i)=>e.onCmdClk&&e.onCmdClk(...i))},[...t[25]||(t[25]=[o.createElementVNode("i",{title:"下划线",class:"underline text-icon",style:{"text-decoration":"underline"}},"U",-1)])]),o.createElementVNode("li",{onClick:t[5]||(t[5]=(...i)=>e.onCmdClk&&e.onCmdClk(...i))},[o.createElementVNode("i",{title:"左对齐",class:o.normalizeClass("justifyleft "+(e.isIonicons?"ivu-icon ivu-icon-bingo-menu-fold":"fontAwesome fa-align-left"))},null,2)]),o.createElementVNode("li",{onClick:t[6]||(t[6]=(...i)=>e.onCmdClk&&e.onCmdClk(...i))},[o.createElementVNode("i",{title:"中间对齐",class:o.normalizeClass("justifycenter "+(e.isIonicons?"ivu-icon ivu-icon-md-menu":"fontAwesome fa-align-center"))},null,2)]),o.createElementVNode("li",{onClick:t[7]||(t[7]=(...i)=>e.onCmdClk&&e.onCmdClk(...i))},[o.createElementVNode("i",{title:"右对齐",class:o.normalizeClass("justifyright "+(e.isIonicons?"ivu-icon ivu-icon-bingo-menu-unfold":"fontAwesome fa-align-right"))},null,2)]),o.createElementVNode("li",{onClick:t[8]||(t[8]=(...i)=>e.onCmdClk&&e.onCmdClk(...i))},[o.createElementVNode("i",{title:"数字编号",class:o.normalizeClass("insertorderedlist "+(e.isIonicons?"ivu-icon ivu-icon-md-list":"fontAwesome fa-list-ol"))},null,2)]),o.createElementVNode("li",{onClick:t[9]||(t[9]=(...i)=>e.onCmdClk&&e.onCmdClk(...i))},[o.createElementVNode("i",{title:"项目编号",class:o.normalizeClass("insertunorderedlist "+(e.isIonicons?"ivu-icon ivu-icon-ios-list":"fontAwesome fa-list-ul"))},null,2)]),o.createElementVNode("li",{onClick:t[10]||(t[10]=(...i)=>e.onCmdClk&&e.onCmdClk(...i))},[o.createElementVNode("i",{title:"增加缩进",class:o.normalizeClass("outdent "+(e.isIonicons?"ivu-icon ivu-icon-ios-return-left":"fontAwesome fa-outdent"))},null,2)]),o.createElementVNode("li",{onClick:t[11]||(t[11]=(...i)=>e.onCmdClk&&e.onCmdClk(...i))},[o.createElementVNode("i",{title:"减少缩进",class:o.normalizeClass("indent "+(e.isIonicons?"ivu-icon ivu-icon-ios-return-right":"fontAwesome fa-indent"))},null,2)]),o.createElementVNode("li",w,[o.createElementVNode("i",{title:"字体颜色",class:o.normalizeClass(e.isIonicons?"ivu-icon ivu-icon-md-brush":"fontAwesome fa-paint-brush")},null,2),o.createElementVNode("div",{class:"colorPicker",innerHTML:e.createColorPickerHTML(),onClick:t[12]||(t[12]=i=>e.format("foreColor",i.target.title))},null,8,b)]),o.createElementVNode("li",I,[o.createElementVNode("i",{title:"背景颜色",class:o.normalizeClass(e.isIonicons?"ivu-icon ivu-icon-ios-brush-outline":"fontAwesome fa-pencil")},null,2),o.createElementVNode("div",{class:"colorPicker",innerHTML:e.createColorPickerHTML(),onClick:t[13]||(t[13]=i=>e.format("backColor",i.target.title))},null,8,L)]),o.createElementVNode("li",{onClick:t[14]||(t[14]=(...i)=>e.createLink&&e.createLink(...i))},[o.createElementVNode("i",{title:"增加链接",class:o.normalizeClass(e.isIonicons?"ivu-icon ivu-icon-ios-link":"fontAwesome fa-link")},null,2)]),o.createElementVNode("li",{onClick:t[15]||(t[15]=(...i)=>e.insertImage&&e.insertImage(...i))},[o.createElementVNode("i",{title:"增加图片",class:o.normalizeClass(e.isIonicons?"ivu-icon ivu-icon-md-images":"fontAwesome fa-regular fa-image")},null,2)]),o.createElementVNode("li",{onClick:t[16]||(t[16]=(...i)=>e.saveRemoteImage2Local&&e.saveRemoteImage2Local(...i))},[o.createElementVNode("i",{title:"一键存图",class:o.normalizeClass(e.isIonicons?"ivu-icon ivu-icon-md-photos":"fontAwesome fa-camera")},null,2)]),o.createElementVNode("li",{onClick:t[17]||(t[17]=(...i)=>e.cleanHTML&&e.cleanHTML(...i))},[o.createElementVNode("i",{title:"清理 HTML",class:o.normalizeClass(e.isIonicons?"ivu-icon ivu-icon-md-done-all":"fontAwesome fa-eraser")},null,2)]),o.createElementVNode("li",{onClick:t[18]||(t[18]=i=>e.isShowCode=!e.isShowCode)},[o.createElementVNode("i",{title:"切换到代码",class:o.normalizeClass((e.isIonicons?"ivu-icon ivu-icon-md-code":"fontAwesome fa-code")+" switchMode")},null,2)])]),t[26]||(t[26]=o.createElementVNode("div",{class:"editorBody"},[o.createElementVNode("iframe",{srcdoc:"<html><body></body></html>"}),o.createElementVNode("textarea")],-1))])}const M=c(p,[["render",A]]);function z(e,t){const r=(t?parent.location:window.location).search.substring(1).split("&");for(let n=0;n<r.length;n++){const s=r[n].split("=");if(s[0]==e)return s[1]}return null}const H={};function S(e,t){return o.openBlock(),o.createElementBlock("div",null,"hi")}const T={HomePage:c(H,[["render",S]])};a.HtmlEditor=M,a.MyButton=y,a.admin=T,a.getQueryParam=z,Object.defineProperty(a,Symbol.toStringTag,{value:"Module"})}));
1
+ (function(d,o){typeof exports=="object"&&typeof module<"u"?o(exports,require("vue")):typeof define=="function"&&define.amd?define(["exports","vue"],o):(d=typeof globalThis<"u"?globalThis:d||self,o(d.ajaxjs_ui={},d.Vue))})(this,(function(d,o){"use strict";const y={},f=(e,t)=>{const i=e.__vccOpts||e;for(const[s,l]of t)i[s]=l;return i};function h(e,t,i,s,l,r){return o.openBlock(),o.createElementBlock("button",null,"hihi")}const E=f(y,[["render",h]]),k=o.defineComponent({name:"HtmlEditor",props:{modelValue:String,uploadImageActionUrl:String,isIonicons:Boolean},emits:["update:modelValue","onchange"],data(){return{isShowCode:!1,iframeEl:null,sourceEditor:null}},mounted(){this.iframeEl=this.$el.querySelector("iframe"),this.sourceEditor=this.$el.querySelector("textarea"),this.iframeEl.contentWindow.onload=e=>{this.iframeDoc=this.iframeEl.contentWindow.document,this.iframeDoc.designMode="on",this.iframeDoc.addEventListener("paste",w.bind(this)),new MutationObserver((t,i)=>{this.isShowCode||(this.sourceEditor.value=this.iframeDoc.body.innerHTML,this.$emit("onchange",this.sourceEditor.value)),this.$emit("update:modelValue",this.iframeDoc.body.innerHTML)}).observe(this.iframeDoc.body,{attributes:!0,childList:!0,subtree:!0,characterData:!0})},this.sourceEditor.oninput=e=>{this.isShowCode&&this.sourceEditor.value&&(this.setIframeBody(this.sourceEditor.value),this.$emit("onchange",this.sourceEditor.value))}},methods:{setIframeBody(e){this.iframeDoc&&this.iframeDoc.body&&(this.iframeDoc.body.innerHTML=e)},getValue(e,t){let i=this.iframeDoc.body.innerHTML;return e&&(i=N(i)),t&&(i=encodeURIComponent(i)),i},createLink(){const e=prompt("请输入 URL 地址");e&&this.format("createLink",e)},insertImage(){window.isCreate?alert("请保存记录后再上传图片。"):this.uploadImgMgr.show(e=>{e&&e.isOk&&this.format("insertImage",e.fullUrl)})},cleanHTML(){this.setIframeBody(HtmlSanitizer.SanitizeHtml(this.iframeDoc.body.innerHTML))},saveRemoteImage2Local(){const e=this.iframeDoc.querySelectorAll("img"),t=new Array,i=[];for(let s=0,l=e.length;s<l;s++){const r=e[s],n=r.getAttribute("src");n!=null&&/^http/.test(n)&&(t.push(r),i.push(n))}i.length||console.log("未发现有远程图片")},onCmdClk(e){const t=e.target,i=t.className.split(" ").shift();this.format(i)},format(e,t){t?this.iframeDoc.execCommand(e,!1,t):this.iframeDoc.execCommand(e,!1)},onFontsizeChoserClk(e){const t=e.target,i=e.currentTarget.children;let s,l;for(s=0,l=i.length;s<l&&t!=i[s];s++);this.format("fontsize",s+"")},onFontfamilyChoserClk(e){const t=e.target;this.format("fontname",t.innerHTML);const i=t.parentNode;i.style.display="none",setTimeout(()=>i.style.display="",300)},createColorPickerHTML(){const e=["00","33","66","99","CC","FF"];let t,i,s,l;const r=['<div class="colorhead"><span class="colortitle">颜色选择</span></div><div class="colorbody"><table cellspaci="0" cellpadding="0"><tr>'];for(let n=0;n<6;++n){r.push('<td><table class="colorpanel" cellspacing="0" cellpadding="0">');for(let a=0,u=e[n];a<6;++a){r.push("<tr>");for(let c=0,p=e[a];c<6;++c)t=e[c],s=c==5&&n!=2&&n!=5?";border-right:none;":"",l=a==5&&n<3?";border-bottom:none":"",i="#"+u+t+p,r.push('<td unselectable="on" style="background-color: '+i+s+l+'" title="'+i+'"></td>');r.push("</tr>")}r.push("</table></td>"),e[n]=="66"&&r.push("</tr><tr>")}return r.push("</tr></table></div>"),r.join("")}},watch:{modelValue(e,t){t||this.setIframeBody(e)},isShowCode(e){e?(this.iframeEl.classList.add("hide"),this.sourceEditor.classList.add("show"),C.call(this,!0)):(this.iframeEl.classList.remove("hide"),this.sourceEditor.classList.remove("show"),C.call(this,!1))}}});function w(e){if(!this.uploadImageActionUrl){alert("未提供图片上传地址");return}const t=e.clipboardData&&e.clipboardData.items;if(!t||!t.length)return;let i=null;for(let r=0;r<t.length;r++){const n=t[r];if(n.type.indexOf("image")!==-1){i=n.getAsFile();break}}if(!i)return;e.preventDefault();const s=new FormData;s.append("file",i,i.name);const l=new XMLHttpRequest;l.addEventListener("load",r=>{if(l.status>=200&&l.status<300){const n=JSON.parse(l.responseText);console.log("Success:",n),this.format("insertImage",n.data.url)}else console.error("Upload failed with status:",l.status),alert("Upload failed!")}),l.addEventListener("error",function(r){console.error("Network error during upload:",r),alert("Upload failed due to a network error!")}),l.open("POST",this.uploadImageActionUrl),l.send(s)}function C(e){this.$el.querySelectorAll(".toolbar i").forEach(t=>{t.className.indexOf("switchMode")==-1&&(t.style.color=e?"lightgray":"")})}function N(e){return e=e.replace(/<(\/)*(\\?xml:|meta|link|span|font|del|ins|st1:|[ovwxp]:)((.|\s)*?)>/gi,""),e=e.replace(/(class|style|type|start)=("(.*?)"|(\w*))/gi,""),e=e.replace(/<style(.*?)style>/gi,""),e=e.replace(/<script(.*?)script>/gi,""),e=e.replace(/<!--(.*?)-->/gi,""),e}const V={class:"aj-form-html-editor"},b={class:"toolbar"},I={class:"dorpdown"},S={class:"dorpdown"},L={class:"dorpdown"},T=["innerHTML"],$={class:"dorpdown"},A=["innerHTML"];function z(e,t,i,s,l,r){return o.openBlock(),o.createElementBlock("div",V,[o.createElementVNode("ul",b,[o.createElementVNode("li",I,[t[20]||(t[20]=o.createElementVNode("i",{title:"字体",class:"text-icon"},"A",-1)),o.createElementVNode("div",{class:"fontfamilyChoser",onClick:t[0]||(t[0]=(...n)=>e.onFontfamilyChoserClk&&e.onFontfamilyChoserClk(...n))},[...t[19]||(t[19]=[o.createStaticVNode('<a style="font-family:&#39;宋体&#39;;">宋体</a><a style="font-family:&#39;黑体&#39;;">黑体</a><a style="font-family:&#39;楷体&#39;;">楷体</a><a style="font-family:&#39;隶书&#39;;">隶书</a><a style="font-family:&#39;幼圆&#39;;">幼圆</a><a style="font-family:&#39;Microsoft YaHei&#39;;">Microsoft YaHei</a><a style="font-family:Arial;">Arial</a><a style="font-family:&#39;Arial Narrow&#39;;">Arial Narrow</a><a style="font-family:&#39;Arial Black&#39;;">Arial Black</a><a style="font-family:&#39;Comic Sans MS&#39;;">Comic Sans MS</a><a style="font-family:Courier;">Courier</a><a style="font-family:System;">System</a><a style="font-family:&#39;Times New Roman&#39;;">Times New Roman</a><a style="font-family:Verdana;">Verdana</a>',14)])])]),o.createElementVNode("li",S,[t[22]||(t[22]=o.createElementVNode("i",{title:"字号",class:"text-icon"},"H",-1)),o.createElementVNode("div",{class:"fontsizeChoser",onClick:t[1]||(t[1]=(...n)=>e.onFontsizeChoserClk&&e.onFontsizeChoserClk(...n))},[...t[21]||(t[21]=[o.createStaticVNode('<a style="font-size:xx-small;">极小</a><a style="font-size:x-small;">特小</a><a style="font-size:small;">小</a><a style="font-size:medium;">中</a><a style="font-size:large;">大</a><a style="font-size:x-large;">特大</a><a style="font-size:xx-large;line-height:140%;">极大</a>',7)])])]),o.createElementVNode("li",{onClick:t[2]||(t[2]=(...n)=>e.onCmdClk&&e.onCmdClk(...n))},[...t[23]||(t[23]=[o.createElementVNode("i",{title:"加粗",class:"bold text-icon"},"B",-1)])]),o.createElementVNode("li",{onClick:t[3]||(t[3]=(...n)=>e.onCmdClk&&e.onCmdClk(...n))},[...t[24]||(t[24]=[o.createElementVNode("i",{title:"斜体",class:"italic text-icon",style:{"font-style":"italic"}},"I",-1)])]),o.createElementVNode("li",{onClick:t[4]||(t[4]=(...n)=>e.onCmdClk&&e.onCmdClk(...n))},[...t[25]||(t[25]=[o.createElementVNode("i",{title:"下划线",class:"underline text-icon",style:{"text-decoration":"underline"}},"U",-1)])]),o.createElementVNode("li",{onClick:t[5]||(t[5]=(...n)=>e.onCmdClk&&e.onCmdClk(...n))},[o.createElementVNode("i",{title:"左对齐",class:o.normalizeClass("justifyleft "+(e.isIonicons?"ivu-icon ivu-icon-bingo-menu-fold":"fontAwesome fa-align-left"))},null,2)]),o.createElementVNode("li",{onClick:t[6]||(t[6]=(...n)=>e.onCmdClk&&e.onCmdClk(...n))},[o.createElementVNode("i",{title:"中间对齐",class:o.normalizeClass("justifycenter "+(e.isIonicons?"ivu-icon ivu-icon-md-menu":"fontAwesome fa-align-center"))},null,2)]),o.createElementVNode("li",{onClick:t[7]||(t[7]=(...n)=>e.onCmdClk&&e.onCmdClk(...n))},[o.createElementVNode("i",{title:"右对齐",class:o.normalizeClass("justifyright "+(e.isIonicons?"ivu-icon ivu-icon-bingo-menu-unfold":"fontAwesome fa-align-right"))},null,2)]),o.createElementVNode("li",{onClick:t[8]||(t[8]=(...n)=>e.onCmdClk&&e.onCmdClk(...n))},[o.createElementVNode("i",{title:"数字编号",class:o.normalizeClass("insertorderedlist "+(e.isIonicons?"ivu-icon ivu-icon-md-list":"fontAwesome fa-list-ol"))},null,2)]),o.createElementVNode("li",{onClick:t[9]||(t[9]=(...n)=>e.onCmdClk&&e.onCmdClk(...n))},[o.createElementVNode("i",{title:"项目编号",class:o.normalizeClass("insertunorderedlist "+(e.isIonicons?"ivu-icon ivu-icon-ios-list":"fontAwesome fa-list-ul"))},null,2)]),o.createElementVNode("li",{onClick:t[10]||(t[10]=(...n)=>e.onCmdClk&&e.onCmdClk(...n))},[o.createElementVNode("i",{title:"增加缩进",class:o.normalizeClass("outdent "+(e.isIonicons?"ivu-icon ivu-icon-ios-return-left":"fontAwesome fa-outdent"))},null,2)]),o.createElementVNode("li",{onClick:t[11]||(t[11]=(...n)=>e.onCmdClk&&e.onCmdClk(...n))},[o.createElementVNode("i",{title:"减少缩进",class:o.normalizeClass("indent "+(e.isIonicons?"ivu-icon ivu-icon-ios-return-right":"fontAwesome fa-indent"))},null,2)]),o.createElementVNode("li",L,[o.createElementVNode("i",{title:"字体颜色",class:o.normalizeClass(e.isIonicons?"ivu-icon ivu-icon-md-brush":"fontAwesome fa-paint-brush")},null,2),o.createElementVNode("div",{class:"colorPicker",innerHTML:e.createColorPickerHTML(),onClick:t[12]||(t[12]=n=>e.format("foreColor",n.target.title))},null,8,T)]),o.createElementVNode("li",$,[o.createElementVNode("i",{title:"背景颜色",class:o.normalizeClass(e.isIonicons?"ivu-icon ivu-icon-ios-brush-outline":"fontAwesome fa-pencil")},null,2),o.createElementVNode("div",{class:"colorPicker",innerHTML:e.createColorPickerHTML(),onClick:t[13]||(t[13]=n=>e.format("backColor",n.target.title))},null,8,A)]),o.createElementVNode("li",{onClick:t[14]||(t[14]=(...n)=>e.createLink&&e.createLink(...n))},[o.createElementVNode("i",{title:"增加链接",class:o.normalizeClass(e.isIonicons?"ivu-icon ivu-icon-ios-link":"fontAwesome fa-link")},null,2)]),o.createElementVNode("li",{onClick:t[15]||(t[15]=(...n)=>e.insertImage&&e.insertImage(...n))},[o.createElementVNode("i",{title:"增加图片",class:o.normalizeClass(e.isIonicons?"ivu-icon ivu-icon-md-images":"fontAwesome fa-regular fa-image")},null,2)]),o.createElementVNode("li",{onClick:t[16]||(t[16]=(...n)=>e.saveRemoteImage2Local&&e.saveRemoteImage2Local(...n))},[o.createElementVNode("i",{title:"一键存图",class:o.normalizeClass(e.isIonicons?"ivu-icon ivu-icon-md-photos":"fontAwesome fa-camera")},null,2)]),o.createElementVNode("li",{onClick:t[17]||(t[17]=(...n)=>e.cleanHTML&&e.cleanHTML(...n))},[o.createElementVNode("i",{title:"清理 HTML",class:o.normalizeClass(e.isIonicons?"ivu-icon ivu-icon-md-done-all":"fontAwesome fa-eraser")},null,2)]),o.createElementVNode("li",{onClick:t[18]||(t[18]=n=>e.isShowCode=!e.isShowCode)},[o.createElementVNode("i",{title:"切换到代码",class:o.normalizeClass((e.isIonicons?"ivu-icon ivu-icon-md-code":"fontAwesome fa-code")+" switchMode")},null,2)])]),t[26]||(t[26]=o.createElementVNode("div",{class:"editorBody"},[o.createElementVNode("iframe",{srcdoc:"<html><body></body></html>"}),o.createElementVNode("textarea")],-1))])}const M=f(k,[["render",z]]);function H(e,t){const s=(t?parent.location:window.location).search.substring(1).split("&");for(let l=0;l<s.length;l++){const r=s[l].split("=");if(r[0]==e)return r[1]}return null}const P={};function j(e,t){return o.openBlock(),o.createElementBlock("div",null,"hi")}const O=f(P,[["render",j]]);function m(e,t,i,s,l){let r={};if(l)for(const a in l)r[a]=l[a];t=t.toUpperCase();let n=i;i&&(t==="POST"||t==="PUT")&&(r["Content-Type"]=="application/json"?n=JSON.stringify(i):r["Content-Type"]=="application/x-www-form-urlencoded"&&(n=D(i))),fetch(e,{method:t,headers:r,body:n,credentials:"include"}).then(a=>{if(a.status===404)throw new Error("Not found 404: "+e);if(a.status===500)throw new Error("Server error: "+e);if(!a.ok)throw new Error(`Unexpected status: ${a.status}`);return a.json()}).then(a=>{s&&s(a)}).catch(a=>{console.error("Network error when fetching from: "+e,a)})}function D(e){const t=[];for(const[i,s]of Object.entries(e))s!=null&&typeof s!="function"&&t.push(`${encodeURIComponent(i)}=${encodeURIComponent(String(s))}`);return t.join("&")}function B(e,t,i){m(e,"GET",null,t,i)}function U(e,t,i,s){m(e,"POST",t,i,Object.assign({"Content-Type":"application/json"},s))}function F(e,t,i,s){m(e,"POST",t,i,Object.assign({"Content-Type":"application/x-www-form-urlencoded"},s))}function q(e,t,i,s){m(e,"PUT",t,i,Object.assign({"Content-Type":"application/json"},s))}function R(e,t,i,s){m(e,"PUT",t,i,Object.assign({"Content-Type":"application/x-www-form-urlencoded"},s))}function J(e,t,i){m(e,"DELETE",null,t,i)}var g=Object.freeze({__proto__:null,del:J,get:B,post:U,postForm:F,put:q,putForm:R});const K=o.defineComponent({data(){return{msg:"",autoLogin:!1}},methods:{hide(){this.$emit("hide")},handleSubmit(e,{username:t,password:i}){if(e){const s={grant_type:"password",username:t,password:i,client_id:"fvccgrfl3fzA7lrFyCpDA",client_secret:"zKvmM4Km8ghCIijl9ubqpHm1"};g.postForm("/iam_api/oidc/ropc_token",s,l=>{l.status?g.get("/iam_api/user/info",r=>{console.log(r),this.msg="登录成功",localStorage.setItem("isLoggedIn","true"),localStorage.setItem("userInfo",JSON.stringify(r.data)),setTimeout(()=>{this.$router.push("/?login_ok=1")},2e3)}):this.msg=l.message||"登录失败"})}},forgetPsw(){this.msg="请联系管理员重置密码"}}}),Q={class:"mask"},W={class:"auto-login"},Y={class:"msg"};function G(e,t,i,s,l,r){const n=o.resolveComponent("UserName"),a=o.resolveComponent("Password"),u=o.resolveComponent("Submit"),c=o.resolveComponent("Login",!0);return o.openBlock(),o.createElementBlock("div",Q,[o.createVNode(c,{onOnSubmit:e.handleSubmit,class:"login"},{default:o.withCtx(()=>[t[2]||(t[2]=o.createElementVNode("h1",null,"欢迎登录歪觅机器人管理后台",-1)),o.createVNode(n,{name:"username"}),o.createVNode(a,{name:"password"}),o.createElementVNode("div",W,[o.createElementVNode("span",Y,o.toDisplayString(e.msg),1),t[1]||(t[1]=o.createTextVNode("   ",-1)),o.createElementVNode("a",{onClick:t[0]||(t[0]=(...p)=>e.forgetPsw&&e.forgetPsw(...p))},"忘记密码")]),o.createVNode(u)]),_:1},8,["onOnSubmit"])])}const X={HomePage:O,Login:f(K,[["render",G],["__scopeId","data-v-2149b790"]])};d.HtmlEditor=M,d.MyButton=E,d.admin=X,d.getQueryParam=H,Object.defineProperty(d,Symbol.toStringTag,{value:"Module"})}));
@@ -4,5 +4,16 @@ export { default as MyButton } from './components/MyButton.vue';
4
4
  export { default as HtmlEditor } from './components/html-editor/HtmlEditor.vue';
5
5
  export declare const admin: {
6
6
  HomePage: import('vue').DefineComponent<{}, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {}, string, import('vue').PublicProps, Readonly<{}> & Readonly<{}>, {}, {}, {}, {}, string, import('vue').ComponentProvideOptions, true, {}, HTMLDivElement>;
7
+ Login: import('vue').DefineComponent<{}, {}, {
8
+ msg: string;
9
+ autoLogin: boolean;
10
+ }, {}, {
11
+ hide(): void;
12
+ handleSubmit(valid: boolean, { username, password }: {
13
+ username: string;
14
+ password: string;
15
+ }): void;
16
+ forgetPsw(): void;
17
+ }, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {}, string, import('vue').PublicProps, Readonly<{}> & Readonly<{}>, {}, {}, {}, {}, string, import('vue').ComponentProvideOptions, true, {}, any>;
7
18
  };
8
19
  export { getQueryParam } from './utils/utils';
package/dist/ui.css CHANGED
@@ -1 +1 @@
1
- .aj-form-html-editor ul.toolbar{border:1px solid #C5C5C5;border-radius:4px 4px 0 0;border-bottom:0;background-color:#e8e7e4;width:100%;min-height:30px;margin:0;box-sizing:border-box;padding:3px 4px}.aj-form-html-editor ul.toolbar>li{list-style:none;float:left;cursor:pointer}.aj-form-html-editor ul.toolbar>li>i{border:1px solid transparent;min-width:25px;height:20px;line-height:20px;text-align:center;display:block}.aj-form-html-editor ul.toolbar>li>i.text-icon{font-family:Times New Roman;font-weight:700;font-style:normal}.aj-form-html-editor ul.toolbar>li>i.fontAwesome{padding-top:2px;font: 18px/1 FontAwesome}.aj-form-html-editor ul.toolbar>li>i:hover{border-right-color:#aaa;border-bottom-color:#aaa;border-top-color:#fff;border-left-color:#fff}.aj-form-html-editor ul.toolbar>li>i:active{border-right-color:#f3f8fc;border-bottom-color:#f3f8fc;border-top-color:#ccc;border-left-color:#ccc}.aj-form-html-editor ul.toolbar>li ul li{padding:3px;cursor:pointer}.aj-form-html-editor ul.toolbar>li ul li:hover{background-color:#d3d3d3}.aj-form-html-editor ul.toolbar>li .cleanHTML{background-size:16px 16px}.aj-form-html-editor ul.toolbar>li .noBg{background-image:none}.aj-form-html-editor .editorBody iframe,.aj-form-html-editor .editorBody textarea{border:1px solid #C5C5C5;border-radius:0 0 4px 4px;border-top-width:0;box-sizing:border-box;background-color:#fff;min-height:300px;width:100%}.aj-form-html-editor .editorBody iframe.hide{display:none}.aj-form-html-editor .editorBody textarea{resize:none;display:none}.aj-form-html-editor .editorBody textarea.show{display:block}.aj-form-html-editor .colorPicker{width:210px;border:1px solid #D3D3D3;position:absolute}.aj-form-html-editor .colorPicker table{border-collapse:collapse}.aj-form-html-editor .colorPicker .colorhead{height:23px;line-height:23px;font-weight:700;width:100%}.aj-form-html-editor .colorPicker .colortitle{margin-left:6px;font-size:12px}.aj-form-html-editor .colorPicker .colorpanel td{border:1px solid #000;height:10px;width:10px;overflow:hidden;font-size:1px;cursor:pointer}.aj-form-html-editor .fontfamilyChoser a,.aj-form-html-editor .fontsizeChoser a{display:block;padding:2px;color:#000;line-height:120%;text-decoration:none}.aj-form-html-editor .fontfamilyChoser a:hover,.aj-form-html-editor .fontsizeChoser a:hover{background:#e5e5e5}.aj-form-html-editor .dorpdown{position:relative}.aj-form-html-editor .dorpdown:hover .fontfamilyChoser,.aj-form-html-editor .dorpdown .fontfamilyChoser:hover,.aj-form-html-editor .dorpdown:hover .fontsizeChoser,.aj-form-html-editor .dorpdown .fontsizeChoser:hover,.aj-form-html-editor .dorpdown:hover .colorPicker,.aj-form-html-editor .dorpdown .colorPicker:hover{display:block}.aj-form-html-editor .dorpdown>div{display:none;position:absolute;top:22px;left:0;background-color:#f5f5f5;border:1px solid lightgray;border-top:0;padding:5px;width:230px}.aj-form-html-editor .dorpdown .fontsizeChoser{top:inherit;right:0}
1
+ .aj-form-html-editor ul.toolbar{border:1px solid #C5C5C5;border-radius:4px 4px 0 0;border-bottom:0;background-color:#e8e7e4;width:100%;min-height:30px;margin:0;box-sizing:border-box;padding:3px 4px}.aj-form-html-editor ul.toolbar>li{list-style:none;float:left;cursor:pointer}.aj-form-html-editor ul.toolbar>li>i{border:1px solid transparent;min-width:25px;height:20px;line-height:20px;text-align:center;display:block}.aj-form-html-editor ul.toolbar>li>i.text-icon{font-family:Times New Roman;font-weight:700;font-style:normal}.aj-form-html-editor ul.toolbar>li>i.fontAwesome{padding-top:2px;font: 18px/1 FontAwesome}.aj-form-html-editor ul.toolbar>li>i:hover{border-right-color:#aaa;border-bottom-color:#aaa;border-top-color:#fff;border-left-color:#fff}.aj-form-html-editor ul.toolbar>li>i:active{border-right-color:#f3f8fc;border-bottom-color:#f3f8fc;border-top-color:#ccc;border-left-color:#ccc}.aj-form-html-editor ul.toolbar>li ul li{padding:3px;cursor:pointer}.aj-form-html-editor ul.toolbar>li ul li:hover{background-color:#d3d3d3}.aj-form-html-editor ul.toolbar>li .cleanHTML{background-size:16px 16px}.aj-form-html-editor ul.toolbar>li .noBg{background-image:none}.aj-form-html-editor .editorBody iframe,.aj-form-html-editor .editorBody textarea{border:1px solid #C5C5C5;border-radius:0 0 4px 4px;border-top-width:0;box-sizing:border-box;background-color:#fff;min-height:300px;width:100%}.aj-form-html-editor .editorBody iframe.hide{display:none}.aj-form-html-editor .editorBody textarea{resize:none;display:none}.aj-form-html-editor .editorBody textarea.show{display:block}.aj-form-html-editor .colorPicker{width:210px;border:1px solid #D3D3D3;position:absolute}.aj-form-html-editor .colorPicker table{border-collapse:collapse}.aj-form-html-editor .colorPicker .colorhead{height:23px;line-height:23px;font-weight:700;width:100%}.aj-form-html-editor .colorPicker .colortitle{margin-left:6px;font-size:12px}.aj-form-html-editor .colorPicker .colorpanel td{border:1px solid #000;height:10px;width:10px;overflow:hidden;font-size:1px;cursor:pointer}.aj-form-html-editor .fontfamilyChoser a,.aj-form-html-editor .fontsizeChoser a{display:block;padding:2px;color:#000;line-height:120%;text-decoration:none}.aj-form-html-editor .fontfamilyChoser a:hover,.aj-form-html-editor .fontsizeChoser a:hover{background:#e5e5e5}.aj-form-html-editor .dorpdown{position:relative}.aj-form-html-editor .dorpdown:hover .fontfamilyChoser,.aj-form-html-editor .dorpdown .fontfamilyChoser:hover,.aj-form-html-editor .dorpdown:hover .fontsizeChoser,.aj-form-html-editor .dorpdown .fontsizeChoser:hover,.aj-form-html-editor .dorpdown:hover .colorPicker,.aj-form-html-editor .dorpdown .colorPicker:hover{display:block}.aj-form-html-editor .dorpdown>div{display:none;position:absolute;top:22px;left:0;background-color:#f5f5f5;border:1px solid lightgray;border-top:0;padding:5px;width:230px}.aj-form-html-editor .dorpdown .fontsizeChoser{top:inherit;right:0}.mask[data-v-2149b790]{position:fixed;top:0;left:0;width:100%;height:100%;z-index:9999;-webkit-backdrop-filter:blur(2px) opacity(.7);backdrop-filter:blur(2px) opacity(.7);background:#000000b3}.login[data-v-2149b790]{width:400px;margin:10% auto 0;background-color:#fff;padding:3%;border-radius:5px;box-shadow:2px 4px 5px #0006}.login h1[data-v-2149b790]{font-size:20px;letter-spacing:2px;margin-bottom:20px}.login .auto-login[data-v-2149b790]{margin-bottom:14px;text-align:left}.login .auto-login span[data-v-2149b790]{color:red}.login a[data-v-2149b790]{float:right}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ajaxjs/ui",
3
- "version": "1.5.2",
3
+ "version": "1.5.3",
4
4
  "private": false,
5
5
  "publishConfig": {
6
6
  "access": "public"