@ajaxjs/ui 1.4.8 → 1.4.9
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/README.md +7 -0
- package/dist/ajaxjs-ui.cjs.js +1 -1
- package/dist/ajaxjs-ui.es.js +23 -17
- package/dist/ajaxjs-ui.umd.js +1 -1
- package/dist/images/empty-avatar.png +0 -0
- package/dist/images/favicon.ico +0 -0
- package/dist/types/App.vue.d.ts +8 -0
- package/dist/types/common/route.d.ts +3 -0
- package/dist/types/components/common/FastiViewTable.vue.d.ts +84 -0
- package/dist/types/components/common/authStorage.d.ts +4 -0
- package/dist/types/components/common/common-ui.d.ts +40 -0
- package/dist/types/components/common/request.d.ts +17 -0
- package/dist/types/components/common/tokenRefresh.d.ts +18 -0
- package/dist/types/components/configurable-widget/common/icon-select.vue.d.ts +34 -0
- package/dist/types/components/configurable-widget/common/info-common.d.ts +64 -0
- package/dist/types/components/configurable-widget/form/form-loader.vue.d.ts +130 -0
- package/dist/types/components/configurable-widget/form/info/candidate-data.vue.d.ts +13 -0
- package/dist/types/components/configurable-widget/form/info/form-config.vue.d.ts +14 -0
- package/dist/types/components/configurable-widget/form/info/form-more-attrib.vue.d.ts +76 -0
- package/dist/types/components/configurable-widget/form/info/info.d.ts +398 -0
- package/dist/types/components/configurable-widget/form/info/info.vue.d.ts +2 -0
- package/dist/types/components/configurable-widget/form/list.vue.d.ts +269 -0
- package/dist/types/components/configurable-widget/form/renderer/form-factory-renderer.vue.d.ts +63 -0
- package/dist/types/components/configurable-widget/form/renderer/item-render.vue.d.ts +52 -0
- package/dist/types/components/configurable-widget/form/widgets/file-upload.vue.d.ts +25 -0
- package/dist/types/components/configurable-widget/list/info.vue.d.ts +737 -0
- package/dist/types/components/configurable-widget/list/list-factory-renderer.vue.d.ts +146 -0
- package/dist/types/components/configurable-widget/list/list-loader.vue.d.ts +250 -0
- package/dist/types/components/configurable-widget/list/list-more-attrib.vue.d.ts +23 -0
- package/dist/types/components/configurable-widget/list/list.vue.d.ts +388 -0
- package/dist/types/components/tree-table/index.d.ts +131 -0
- package/dist/types/components/tree-table/tree-selector.vue.d.ts +15 -0
- package/dist/types/index.d.ts +1 -0
- package/dist/types/main.d.ts +0 -0
- package/dist/types/pages/admin/Home.vue.d.ts +2 -0
- package/dist/types/pages/admin/Login.vue.d.ts +12 -0
- package/dist/types/pages/iam/profile/index.vue.d.ts +15 -0
- package/dist/types/pages/pages.d.ts +0 -0
- package/dist/types/pages/system/ArticleEdit.vue.d.ts +65 -0
- package/dist/types/pages/system/Schedule.vue.d.ts +241 -0
- package/package.json +9 -4
package/README.md
CHANGED
|
@@ -1,3 +1,10 @@
|
|
|
1
|
+
[](https://www.npmjs.com/package/@ajaxjs/ui)
|
|
2
|
+
[](https://www.typescriptlang.org/)
|
|
3
|
+
[](http://www.apache.org/licenses/LICENSE-2.0.txt)
|
|
4
|
+
[](mailto:frank@ajaxjs.com)
|
|
5
|
+
[](https://shang.qq.com/wpa/qunwpa?idkey=3877893a4ed3a5f0be01e809e7ac120e346102bd550deb6692239bb42de38e22)
|
|
6
|
+
|
|
7
|
+
|
|
1
8
|
# Ajaxjs UI Library
|
|
2
9
|
|
|
3
10
|
[](https://www.npmjs.com/package/@ajaxjs/ui)
|
package/dist/ajaxjs-ui.cjs.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const o=require("vue"),C={},c=(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=c(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"),m.call(this,!0)):(this.iframeEl.classList.remove("hide"),this.sourceEditor.classList.remove("show"),m.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 m(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:'宋体';">宋体</a><a style="font-family:'黑体';">黑体</a><a style="font-family:'楷体';">楷体</a><a style="font-family:'隶书';">隶书</a><a style="font-family:'幼圆';">幼圆</a><a style="font-family:'Microsoft YaHei';">Microsoft YaHei</a><a style="font-family:Arial;">Arial</a><a style="font-family:'Arial Narrow';">Arial Narrow</a><a style="font-family:'Arial Black';">Arial Black</a><a style="font-family:'Comic Sans MS';">Comic Sans MS</a><a style="font-family:Courier;">Courier</a><a style="font-family:System;">System</a><a style="font-family:'Times New Roman';">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(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}exports.HtmlEditor=M;exports.MyButton=p;exports.getQueryParam=z;
|
|
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:'宋体';">宋体</a><a style="font-family:'黑体';">黑体</a><a style="font-family:'楷体';">楷体</a><a style="font-family:'隶书';">隶书</a><a style="font-family:'幼圆';">幼圆</a><a style="font-family:'Microsoft YaHei';">Microsoft YaHei</a><a style="font-family:Arial;">Arial</a><a style="font-family:'Arial Narrow';">Arial Narrow</a><a style="font-family:'Arial Black';">Arial Black</a><a style="font-family:'Comic Sans MS';">Comic Sans MS</a><a style="font-family:Courier;">Courier</a><a style="font-family:System;">System</a><a style="font-family:'Times New Roman';">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]]);exports.HomePage=T;exports.HtmlEditor=M;exports.MyButton=p;exports.getQueryParam=z;
|
package/dist/ajaxjs-ui.es.js
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
|
-
import { openBlock as
|
|
2
|
-
const h = {},
|
|
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
3
|
const s = i.__vccOpts || i;
|
|
4
4
|
for (const [r, l] of e)
|
|
5
5
|
s[r] = l;
|
|
6
6
|
return s;
|
|
7
7
|
};
|
|
8
8
|
function v(i, e, s, r, l, n) {
|
|
9
|
-
return
|
|
9
|
+
return m(), u("button", null, "hihi");
|
|
10
10
|
}
|
|
11
|
-
const
|
|
11
|
+
const P = /* @__PURE__ */ c(h, [["render", v]]), w = k({
|
|
12
12
|
name: "HtmlEditor",
|
|
13
13
|
props: {
|
|
14
14
|
modelValue: String,
|
|
@@ -157,7 +157,7 @@ const B = /* @__PURE__ */ y(h, [["render", v]]), w = k({
|
|
|
157
157
|
* @param n
|
|
158
158
|
*/
|
|
159
159
|
isShowCode(i) {
|
|
160
|
-
i ? (this.iframeEl.classList.add("hide"), this.sourceEditor.classList.add("show"),
|
|
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));
|
|
161
161
|
}
|
|
162
162
|
}
|
|
163
163
|
});
|
|
@@ -193,7 +193,7 @@ function b(i) {
|
|
|
193
193
|
console.error("Network error during upload:", n), alert("Upload failed due to a network error!");
|
|
194
194
|
}), l.open("POST", this.uploadImageActionUrl), l.send(r);
|
|
195
195
|
}
|
|
196
|
-
function
|
|
196
|
+
function y(i) {
|
|
197
197
|
this.$el.querySelectorAll(".toolbar i").forEach((e) => {
|
|
198
198
|
e.className.indexOf("switchMode") == -1 && (e.style.color = i ? "lightgray" : "");
|
|
199
199
|
});
|
|
@@ -201,9 +201,9 @@ function u(i) {
|
|
|
201
201
|
function I(i) {
|
|
202
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;
|
|
203
203
|
}
|
|
204
|
-
const L = { class: "aj-form-html-editor" }, A = { class: "toolbar" }, M = { class: "dorpdown" },
|
|
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
205
|
function $(i, e, s, r, l, n) {
|
|
206
|
-
return
|
|
206
|
+
return m(), u("div", L, [
|
|
207
207
|
t("ul", A, [
|
|
208
208
|
t("li", M, [
|
|
209
209
|
e[20] || (e[20] = t("i", {
|
|
@@ -214,10 +214,10 @@ function $(i, e, s, r, l, n) {
|
|
|
214
214
|
class: "fontfamilyChoser",
|
|
215
215
|
onClick: e[0] || (e[0] = (...o) => i.onFontfamilyChoserClk && i.onFontfamilyChoserClk(...o))
|
|
216
216
|
}, [...e[19] || (e[19] = [
|
|
217
|
-
|
|
217
|
+
C('<a style="font-family:'宋体';">宋体</a><a style="font-family:'黑体';">黑体</a><a style="font-family:'楷体';">楷体</a><a style="font-family:'隶书';">隶书</a><a style="font-family:'幼圆';">幼圆</a><a style="font-family:'Microsoft YaHei';">Microsoft YaHei</a><a style="font-family:Arial;">Arial</a><a style="font-family:'Arial Narrow';">Arial Narrow</a><a style="font-family:'Arial Black';">Arial Black</a><a style="font-family:'Comic Sans MS';">Comic Sans MS</a><a style="font-family:Courier;">Courier</a><a style="font-family:System;">System</a><a style="font-family:'Times New Roman';">Times New Roman</a><a style="font-family:Verdana;">Verdana</a>', 14)
|
|
218
218
|
])])
|
|
219
219
|
]),
|
|
220
|
-
t("li",
|
|
220
|
+
t("li", H, [
|
|
221
221
|
e[22] || (e[22] = t("i", {
|
|
222
222
|
title: "字号",
|
|
223
223
|
class: "text-icon"
|
|
@@ -226,7 +226,7 @@ function $(i, e, s, r, l, n) {
|
|
|
226
226
|
class: "fontsizeChoser",
|
|
227
227
|
onClick: e[1] || (e[1] = (...o) => i.onFontsizeChoserClk && i.onFontsizeChoserClk(...o))
|
|
228
228
|
}, [...e[21] || (e[21] = [
|
|
229
|
-
|
|
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)
|
|
230
230
|
])])
|
|
231
231
|
]),
|
|
232
232
|
t("li", {
|
|
@@ -311,7 +311,7 @@ function $(i, e, s, r, l, n) {
|
|
|
311
311
|
class: a("indent " + (i.isIonicons ? "ivu-icon ivu-icon-ios-return-right" : "fontAwesome fa-indent"))
|
|
312
312
|
}, null, 2)
|
|
313
313
|
]),
|
|
314
|
-
t("li",
|
|
314
|
+
t("li", E, [
|
|
315
315
|
t("i", {
|
|
316
316
|
title: "字体颜色",
|
|
317
317
|
class: a(i.isIonicons ? "ivu-icon ivu-icon-md-brush" : "fontAwesome fa-paint-brush")
|
|
@@ -380,8 +380,8 @@ function $(i, e, s, r, l, n) {
|
|
|
380
380
|
], -1))
|
|
381
381
|
]);
|
|
382
382
|
}
|
|
383
|
-
const
|
|
384
|
-
function
|
|
383
|
+
const F = /* @__PURE__ */ c(w, [["render", $]]);
|
|
384
|
+
function U(i, e) {
|
|
385
385
|
const r = (e ? parent.location : window.location).search.substring(1).split("&");
|
|
386
386
|
for (let l = 0; l < r.length; l++) {
|
|
387
387
|
const n = r[l].split("=");
|
|
@@ -390,8 +390,14 @@ function P(i, e) {
|
|
|
390
390
|
}
|
|
391
391
|
return null;
|
|
392
392
|
}
|
|
393
|
+
const z = {};
|
|
394
|
+
function B(i, e) {
|
|
395
|
+
return m(), u("div", null, "hi");
|
|
396
|
+
}
|
|
397
|
+
const V = /* @__PURE__ */ c(z, [["render", B]]);
|
|
393
398
|
export {
|
|
394
|
-
|
|
395
|
-
|
|
396
|
-
P as
|
|
399
|
+
V as HomePage,
|
|
400
|
+
F as HtmlEditor,
|
|
401
|
+
P as MyButton,
|
|
402
|
+
U as getQueryParam
|
|
397
403
|
};
|
package/dist/ajaxjs-ui.umd.js
CHANGED
|
@@ -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={},f=(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=f(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,S=e[i];d<6;++d){s.push("<tr>");for(let m=0,H=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="#"+S+t+H,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 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 c(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:'宋体';">宋体</a><a style="font-family:'黑体';">黑体</a><a style="font-family:'楷体';">楷体</a><a style="font-family:'隶书';">隶书</a><a style="font-family:'幼圆';">幼圆</a><a style="font-family:'Microsoft YaHei';">Microsoft YaHei</a><a style="font-family:Arial;">Arial</a><a style="font-family:'Arial Narrow';">Arial Narrow</a><a style="font-family:'Arial Black';">Arial Black</a><a style="font-family:'Comic Sans MS';">Comic Sans MS</a><a style="font-family:Courier;">Courier</a><a style="font-family:System;">System</a><a style="font-family:'Times New Roman';">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=f(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}a.HtmlEditor=M,a.MyButton=y,a.getQueryParam=z,Object.defineProperty(a,Symbol.toStringTag,{value:"Module"})}));
|
|
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:'宋体';">宋体</a><a style="font-family:'黑体';">黑体</a><a style="font-family:'楷体';">楷体</a><a style="font-family:'隶书';">隶书</a><a style="font-family:'幼圆';">幼圆</a><a style="font-family:'Microsoft YaHei';">Microsoft YaHei</a><a style="font-family:Arial;">Arial</a><a style="font-family:'Arial Narrow';">Arial Narrow</a><a style="font-family:'Arial Black';">Arial Black</a><a style="font-family:'Comic Sans MS';">Comic Sans MS</a><a style="font-family:Courier;">Courier</a><a style="font-family:System;">System</a><a style="font-family:'Times New Roman';">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=c(H,[["render",S]]);a.HomePage=T,a.HtmlEditor=M,a.MyButton=y,a.getQueryParam=z,Object.defineProperty(a,Symbol.toStringTag,{value:"Module"})}));
|
|
Binary file
|
|
Binary file
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
declare const _default: import('vue').DefineComponent<{}, {}, {
|
|
2
|
+
userLoginId: string;
|
|
3
|
+
avatarUrl: string;
|
|
4
|
+
isCollapsed: boolean;
|
|
5
|
+
}, {
|
|
6
|
+
menuitemClasses(): string[];
|
|
7
|
+
}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {}, string, import('vue').PublicProps, Readonly<{}> & Readonly<{}>, {}, {}, {}, {}, string, import('vue').ComponentProvideOptions, true, {}, any>;
|
|
8
|
+
export default _default;
|
|
@@ -0,0 +1,84 @@
|
|
|
1
|
+
declare const _default: import('vue').DefineComponent<import('vue').ExtractPropTypes<{
|
|
2
|
+
widgetName: {
|
|
3
|
+
type: StringConstructor;
|
|
4
|
+
required: false;
|
|
5
|
+
};
|
|
6
|
+
columnsDef: {
|
|
7
|
+
type: ArrayConstructor;
|
|
8
|
+
required: false;
|
|
9
|
+
};
|
|
10
|
+
apiUrl: {
|
|
11
|
+
type: StringConstructor;
|
|
12
|
+
required: false;
|
|
13
|
+
};
|
|
14
|
+
listApiUrl: {
|
|
15
|
+
type: StringConstructor;
|
|
16
|
+
required: true;
|
|
17
|
+
};
|
|
18
|
+
createRoute: {
|
|
19
|
+
type: StringConstructor;
|
|
20
|
+
required: false;
|
|
21
|
+
};
|
|
22
|
+
editRoute: {
|
|
23
|
+
type: StringConstructor;
|
|
24
|
+
required: false;
|
|
25
|
+
};
|
|
26
|
+
pickup: {
|
|
27
|
+
type: BooleanConstructor;
|
|
28
|
+
required: false;
|
|
29
|
+
};
|
|
30
|
+
}>, {}, {
|
|
31
|
+
widgetName_: string | undefined;
|
|
32
|
+
colDefId: number;
|
|
33
|
+
list: TableListConfig;
|
|
34
|
+
}, {}, {
|
|
35
|
+
getData(): void;
|
|
36
|
+
onPageNoChange(pageNo: number): void;
|
|
37
|
+
/**
|
|
38
|
+
* 分页记录数
|
|
39
|
+
*/
|
|
40
|
+
handleChangePageSize(pageSize: number): void;
|
|
41
|
+
reset(): void;
|
|
42
|
+
/**
|
|
43
|
+
* 新建
|
|
44
|
+
*/
|
|
45
|
+
onCreate(): void;
|
|
46
|
+
/**
|
|
47
|
+
* 编辑
|
|
48
|
+
*/
|
|
49
|
+
onEdit(id: number): void;
|
|
50
|
+
doPickup(data: any): void;
|
|
51
|
+
deleteInfo(id: number, index: number): void;
|
|
52
|
+
}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {}, string, import('vue').PublicProps, Readonly<import('vue').ExtractPropTypes<{
|
|
53
|
+
widgetName: {
|
|
54
|
+
type: StringConstructor;
|
|
55
|
+
required: false;
|
|
56
|
+
};
|
|
57
|
+
columnsDef: {
|
|
58
|
+
type: ArrayConstructor;
|
|
59
|
+
required: false;
|
|
60
|
+
};
|
|
61
|
+
apiUrl: {
|
|
62
|
+
type: StringConstructor;
|
|
63
|
+
required: false;
|
|
64
|
+
};
|
|
65
|
+
listApiUrl: {
|
|
66
|
+
type: StringConstructor;
|
|
67
|
+
required: true;
|
|
68
|
+
};
|
|
69
|
+
createRoute: {
|
|
70
|
+
type: StringConstructor;
|
|
71
|
+
required: false;
|
|
72
|
+
};
|
|
73
|
+
editRoute: {
|
|
74
|
+
type: StringConstructor;
|
|
75
|
+
required: false;
|
|
76
|
+
};
|
|
77
|
+
pickup: {
|
|
78
|
+
type: BooleanConstructor;
|
|
79
|
+
required: false;
|
|
80
|
+
};
|
|
81
|
+
}>> & Readonly<{}>, {
|
|
82
|
+
pickup: boolean;
|
|
83
|
+
}, {}, {}, {}, string, import('vue').ComponentProvideOptions, true, {}, any>;
|
|
84
|
+
export default _default;
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
export declare const saveTokens: (accessToken: string, refreshToken: string) => Promise<void>;
|
|
2
|
+
export declare const getAccessToken: () => Promise<string | null>;
|
|
3
|
+
export declare const getRefreshToken: () => Promise<string>;
|
|
4
|
+
export declare const clearTokens: () => Promise<void>;
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
declare const _default: {
|
|
2
|
+
afterDelete(cb?: Function): Function;
|
|
3
|
+
delInfo(this: any, index: number): void;
|
|
4
|
+
/**
|
|
5
|
+
* id 列
|
|
6
|
+
*/
|
|
7
|
+
id: {
|
|
8
|
+
title: string;
|
|
9
|
+
width: number;
|
|
10
|
+
key: string;
|
|
11
|
+
align: string;
|
|
12
|
+
};
|
|
13
|
+
/**
|
|
14
|
+
* 创建日期
|
|
15
|
+
*/
|
|
16
|
+
createDate: {
|
|
17
|
+
title: string;
|
|
18
|
+
width: number;
|
|
19
|
+
align: string;
|
|
20
|
+
render(h: Function, params: any): any;
|
|
21
|
+
};
|
|
22
|
+
/**
|
|
23
|
+
* 分类标签
|
|
24
|
+
*/
|
|
25
|
+
tags: {
|
|
26
|
+
title: string;
|
|
27
|
+
minWidth: number;
|
|
28
|
+
key: string;
|
|
29
|
+
align: string;
|
|
30
|
+
ellipsis: boolean;
|
|
31
|
+
};
|
|
32
|
+
status: {
|
|
33
|
+
title: string;
|
|
34
|
+
width: number;
|
|
35
|
+
render(h: Function, params: any): any;
|
|
36
|
+
};
|
|
37
|
+
getPageList(self: any, listArray: iViewListData, callback?: Function): (j: ApiResponseResult) => void;
|
|
38
|
+
copyBeanClean(bean: {}): {};
|
|
39
|
+
};
|
|
40
|
+
export default _default;
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
export type HttpHeaders = {
|
|
2
|
+
[key: string]: string | number | boolean;
|
|
3
|
+
};
|
|
4
|
+
export type ResponseCallback = (data: any) => void;
|
|
5
|
+
/**
|
|
6
|
+
* HTTP GET 请求
|
|
7
|
+
*
|
|
8
|
+
* @param api API 地址
|
|
9
|
+
* @param callback
|
|
10
|
+
* @param header
|
|
11
|
+
*/
|
|
12
|
+
export declare function get(api: string, callback: ResponseCallback, header?: HttpHeaders): void;
|
|
13
|
+
export declare function post(api: string, bodyData: any, callback: ResponseCallback, header?: HttpHeaders): void;
|
|
14
|
+
export declare function postForm(api: string, bodyData: any, callback: ResponseCallback, header?: HttpHeaders): void;
|
|
15
|
+
export declare function put(api: string, bodyData: any, callback: ResponseCallback, header?: HttpHeaders): void;
|
|
16
|
+
export declare function putForm(api: string, bodyData: any, callback: ResponseCallback, header?: HttpHeaders): void;
|
|
17
|
+
export declare function del(api: string, callback: ResponseCallback, header?: HttpHeaders): void;
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
export default function refreshTokens(): Promise<{
|
|
2
|
+
accessToken: string;
|
|
3
|
+
refreshToken: string;
|
|
4
|
+
}>;
|
|
5
|
+
/**
|
|
6
|
+
* 对客户端ID和密钥进行基础认证编码。
|
|
7
|
+
*
|
|
8
|
+
* 该方法用于将客户端的ID和密钥组合成一个字符串,并对该字符串进行 Base64 编码,
|
|
9
|
+
* 以用于 HTTP 请求中的 Authorization 头,实现基础认证。
|
|
10
|
+
* 基础认证是一种简单的认证方式,其中客户端的ID和密钥以一定格式组合,并进行编码,
|
|
11
|
+
* 以此向服务器证明客户端的身份。
|
|
12
|
+
*
|
|
13
|
+
* @param clientId - 客户端ID,用于标识客户端
|
|
14
|
+
* @param clientSecret - 客户端密钥,用于验证客户端的身份
|
|
15
|
+
* @returns 返回编码后的字符串,格式为 "Basic base64编码的客户端ID:客户端密钥"
|
|
16
|
+
* @throws 如果 clientId 或 clientSecret 为空,则抛出错误
|
|
17
|
+
*/
|
|
18
|
+
export declare function encodeClient(clientId: string, clientSecret: string): string;
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
declare const _default: import('vue').DefineComponent<import('vue').ExtractPropTypes<{
|
|
2
|
+
data: {
|
|
3
|
+
type: StringConstructor;
|
|
4
|
+
default: string;
|
|
5
|
+
};
|
|
6
|
+
placeholder: {
|
|
7
|
+
type: StringConstructor;
|
|
8
|
+
default: string;
|
|
9
|
+
};
|
|
10
|
+
}>, {}, {
|
|
11
|
+
value: string;
|
|
12
|
+
iconList: never[];
|
|
13
|
+
modal: boolean;
|
|
14
|
+
iconName: string;
|
|
15
|
+
}, {}, {
|
|
16
|
+
filterIcons(e: Event): void;
|
|
17
|
+
selectedIcon(name: string): void;
|
|
18
|
+
onChange(event: any): void;
|
|
19
|
+
handleIcons(): void;
|
|
20
|
+
cancel(): void;
|
|
21
|
+
}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {}, string, import('vue').PublicProps, Readonly<import('vue').ExtractPropTypes<{
|
|
22
|
+
data: {
|
|
23
|
+
type: StringConstructor;
|
|
24
|
+
default: string;
|
|
25
|
+
};
|
|
26
|
+
placeholder: {
|
|
27
|
+
type: StringConstructor;
|
|
28
|
+
default: string;
|
|
29
|
+
};
|
|
30
|
+
}>> & Readonly<{}>, {
|
|
31
|
+
data: string;
|
|
32
|
+
placeholder: string;
|
|
33
|
+
}, {}, {}, {}, string, import('vue').ComponentProvideOptions, true, {}, any>;
|
|
34
|
+
export default _default;
|
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
type Common = {
|
|
2
|
+
id: number | null;
|
|
3
|
+
name: string;
|
|
4
|
+
config: any;
|
|
5
|
+
type: string;
|
|
6
|
+
datasourceId: number;
|
|
7
|
+
datasourceName: string;
|
|
8
|
+
tableName: string;
|
|
9
|
+
$route: any;
|
|
10
|
+
getData: () => {};
|
|
11
|
+
};
|
|
12
|
+
declare const _default: {
|
|
13
|
+
props: {
|
|
14
|
+
apiRoot: {
|
|
15
|
+
type: StringConstructor;
|
|
16
|
+
required: boolean;
|
|
17
|
+
};
|
|
18
|
+
api: {
|
|
19
|
+
type: StringConstructor;
|
|
20
|
+
required: boolean;
|
|
21
|
+
};
|
|
22
|
+
initId: NumberConstructor;
|
|
23
|
+
};
|
|
24
|
+
data(this: Common): {
|
|
25
|
+
id: any;
|
|
26
|
+
apiPrefix: any;
|
|
27
|
+
name: string;
|
|
28
|
+
isShowPerview: boolean;
|
|
29
|
+
datasourceId: number;
|
|
30
|
+
datasourceName: string;
|
|
31
|
+
tableName: string;
|
|
32
|
+
editIndex: number;
|
|
33
|
+
widgetType: string;
|
|
34
|
+
};
|
|
35
|
+
mounted(this: Common): void;
|
|
36
|
+
beforeUpdate(this: Common): void;
|
|
37
|
+
methods: {
|
|
38
|
+
/**
|
|
39
|
+
* 获取单个数据
|
|
40
|
+
*/
|
|
41
|
+
getDataBase(cb: Function): void;
|
|
42
|
+
/**
|
|
43
|
+
* 创建 api-> 持久化
|
|
44
|
+
*/
|
|
45
|
+
saveOrUpdate(this: Common): void;
|
|
46
|
+
/**
|
|
47
|
+
* 新增
|
|
48
|
+
*/
|
|
49
|
+
addRow_(this: Common, row: any): void;
|
|
50
|
+
/**
|
|
51
|
+
* 保存新增
|
|
52
|
+
*/
|
|
53
|
+
saveAddRow_(s1: string, s2: string): void;
|
|
54
|
+
/**
|
|
55
|
+
* 默认的清空数据方法,用于新建的状态。子类可以覆盖
|
|
56
|
+
*/
|
|
57
|
+
emptyData(): void;
|
|
58
|
+
/**
|
|
59
|
+
* 预览
|
|
60
|
+
*/
|
|
61
|
+
perview(): void;
|
|
62
|
+
};
|
|
63
|
+
};
|
|
64
|
+
export default _default;
|