1 Star 0 Fork 0

阿炸克斯/approval-data-admin

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
该仓库未声明开源许可证文件(LICENSE),使用请关注具体项目描述及其代码上游依赖。
克隆/下载
576.async.js 9.99 KB
一键复制 编辑 原始数据 按行查看 历史
GitHub Action 提交于 2024-11-04 03:32 . update
"use strict";(self.webpackChunk=self.webpackChunk||[]).push([[576],{40761:function(L,A,e){e.d(A,{Z:function(){return n}});var F=e(57213),g=e.n(F),d=e(54306),y=e.n(d),D=e(95520),j={editor:"editor___r8Zg7"},O=e(65886),K=e(44861),B=e(56214),H=e(44749),M=e(7637),w=e.n(M),f=e(93236),Y={},b=e(16112),m=e(62086);K.Boot.registerModule(w());function R(t){var u=t.value,v=t.placeholder,E=t.className,c=t.style,x=t.onChange,Z=(0,f.useState)(null),W=y()(Z,2),S=W[0],N=W[1],I=(0,f.useState)(""),T=y()(I,2),U=T[0],i=T[1];(0,f.useEffect)(function(){i(u||"")},[u]);var s={},a={placeholder:v,hoverbarKeys:{attachment:{menuKeys:["downloadAttachment"]}},MENU_CONF:{uploadImage:{customUpload:function(r,h){b.f.uploadFile(r,"images").then(function(p){var P=p.url;h(P,r.name,P)})}},uploadVideo:{customUpload:function(r,h){b.f.uploadFile(r,"videos").then(function(p){var P=p.url;h(P)})}}}};return(0,f.useEffect)(function(){return function(){S!==null&&(S.destroy(),N(null))}},[S]),(0,m.jsx)(m.Fragment,{children:(0,m.jsxs)("div",{className:"wang-editor-container",children:[(0,m.jsx)(B.o,{editor:S,defaultConfig:s,className:"wang-editor-toolbar"}),(0,m.jsx)(B.M,{defaultConfig:a,value:U,onCreated:N,onChange:function(r){var h=r.getHtml();h==="<p><br></p>"&&(h=""),x==null||x(h)},style:c,className:(0,D.yI)(E)})]})})}function n(t){var u=t.value,v=u===void 0?"":u,E=t.onChange,c=t.className,x=c===void 0?"":c,Z=t.style,W=(0,f.useState)({open:!1,content:""}),S=y()(W,2),N=S[0],I=S[1];return(0,m.jsxs)(m.Fragment,{children:[(0,m.jsx)("div",{dangerouslySetInnerHTML:{__html:v},className:(0,D.yI)(x,j.editor),style:Z,onClick:function(U){console.log("value: ",v),I({open:!0,content:v})}}),(0,m.jsxs)(O.Z,{open:N.open,width:1200,title:"\u7F16\u8F91",onCancel:function(){I({open:!1,content:""})},destroyOnClose:!0,onOk:function(){E==null||E(N.content),I(function(U){return g()(g()({},U),{},{open:!1})})},forceRender:!0,children:[(0,m.jsx)("br",{}),(0,m.jsx)(R,{value:N.content,style:{height:400},onChange:function(U){I(function(i){return g()(g()({},i),{},{content:U})})}})]})]})}},89865:function(L,A,e){e.d(A,{Z:function(){return D}});var F=e(93236),g=e(27988),d={headerContainer:"headerContainer___Rg8_e"},y=e(62086);function D(j){var O,K=j.title,B=j.children,H=(0,g.Ov)(),M=H.routes,w=(O=Object.values(M).find(function(f){return"/approval-data-admin"+f.path===location.pathname}))===null||O===void 0?void 0:O.title;return(0,y.jsxs)("div",{className:"".concat(d.headerContainer," header"),children:[(0,y.jsx)("div",{className:d.title,children:K||w}),(0,y.jsx)("div",{children:B})]})}},54263:function(L,A,e){e.d(A,{Z:function(){return y}});var F=e(93236),g={},d=e(62086);function y(D){var j=D.children;return(0,d.jsx)("div",{className:g.pageContainer,children:j})}},3219:function(L,A,e){e.d(A,{PO:function(){return d},Zr:function(){return F},kK:function(){return g}});var F="token",g="OSS_ENV",d="/",y={SMS:{id:"sms",label:"\u624B\u673A\u77ED\u4FE1"},EMAIL:{id:"email",label:"\u90AE\u7BB1"}}},16112:function(L,A,e){e.d(A,{f:function(){return U},j:function(){return t}});var F=e(3219),g=e(25359),d=e.n(g),y=e(49811),D=e.n(y),j=e(21140),O=e.n(j),K=e(63466),B=e.n(K),H=e(51224),M=e(73669),w=e(27988),f=M.Z.create({baseURL:"/"}),Y=["/login"].map(function(i){return"/".concat(i)});f.interceptors.request.use(function(i){var s=localStorage.getItem(F.Zr);return s&&i.headers.set("token",s),i}),f.interceptors.response.use(function(i){return Promise.resolve(i)},function(i){var s=i.response||{},a=s.config||{},o=s.data||{};return o.statusCode!==200&&(a.ignoreNotice||H.t6.error({message:o.message}),!a.ignoreLogin&&o.statusCode===401&&!Y.includes(w.m8.location.pathname)&&w.m8.push("/login")),Promise.reject(i)});var b=function(){function i(){O()(this,i)}return B()(i,[{key:"get",value:function(a,o){return f.get(a,o)}},{key:"post",value:function(a,o,r){return f.post(a,o,r)}},{key:"put",value:function(a,o,r){return f.put(a,o,r)}},{key:"delete",value:function(a,o){return f.delete(a,o)}}]),i}();function m(i){return R.apply(this,arguments)}function R(){return R=_asyncToGenerator(_regeneratorRuntime().mark(function i(s){var a;return _regeneratorRuntime().wrap(function(r){for(;;)switch(r.prev=r.next){case 0:return r.prev=0,r.next=3,s();case 3:return a=r.sent,r.abrupt("return",[null,a]);case 7:return r.prev=7,r.t0=r.catch(0),r.abrupt("return",[r.t0,null]);case 10:case"end":return r.stop()}},i,null,[[0,7]])})),R.apply(this,arguments)}var n=new b,t=function(){return n.post("".concat(F.PO,"/outlogin")).then(function(){localStorage.removeItem(F.Zr)})},u=e(52510),v=e.n(u),E=e(21156),c=e.n(E),x=e(67006),Z=e.n(x),W=e(37516),S=e(62086),N=localStorage.getItem(F.kK)||"test",I="".concat(N,"/wxa"),T=function(){function i(){O()(this,i),v()(this,"client",void 0),this.init(this.getConfig())}return B()(i,[{key:"init",value:function(a){if(!a){location.pathname.includes("/login")||(window.location.href="/approval-data-admin/login");return}return this.client=new(c())(a),this.client}},{key:"validate",value:function(a){var o=this;return new Promise(function(){var r=D()(d()().mark(function h(p,P){var l;return d()().wrap(function(C){for(;;)switch(C.prev=C.next){case 0:if(C.prev=0,l=o.init(a),l){C.next=5;break}return P("client is null"),C.abrupt("return");case 5:return C.next=7,l.put("/___log",new Blob([Date.now().toString()]));case 7:p(null),C.next=14;break;case 10:C.prev=10,C.t0=C.catch(0),console.log("e: ",C.t0),P(C.t0);case 14:case"end":return C.stop()}},h,null,[[0,10]])}));return function(h,p){return r.apply(this,arguments)}}())}},{key:"getConfig",value:function(){var a=localStorage.getItem("accessKeyId"),o=localStorage.getItem("accessKeySecret"),r=localStorage.getItem("region"),h=localStorage.getItem("bucket");if(a)return{accessKeyId:a,accessKeySecret:o,region:r,bucket:h}}},{key:"formatUrl",value:function(a){return a.startsWith("http://")||a.startsWith("https://")?a:a.startsWith("/")?I+a:I+"/"+a}},{key:"getData",value:function(a){var o=this.client.signatureUrl(this.formatUrl(a));return n.get(o)}},{key:"updateData",value:function(){var s=D()(d()().mark(function o(r,h){var p;return d()().wrap(function(l){for(;;)switch(l.prev=l.next){case 0:return p=new Blob([JSON.stringify(h)]),l.prev=1,l.next=4,this.client.put(this.formatUrl(r),p);case 4:l.next=10;break;case 6:throw l.prev=6,l.t0=l.catch(1),W.ZP.error({content:(0,S.jsx)(S.Fragment,{children:(0,S.jsx)("div",{children:"\u66F4\u65B0\u5931\u8D25"})})}),l.t0;case 10:case"end":return l.stop()}},o,this,[[1,6]])}));function a(o,r){return s.apply(this,arguments)}return a}()},{key:"uploadFile",value:function(){var s=D()(d()().mark(function o(r,h){var p;return d()().wrap(function(l){for(;;)switch(l.prev=l.next){case 0:return l.next=2,this.client.put(this.formatUrl("/files/".concat(h,"/").concat(Z()().format("YYYYMMDD"),"/").concat(r.name)),r);case 2:return p=l.sent,p.url.startsWith("http://")&&(p.url=p.url.replace(/^(http:\/\/)/gi,"https://")),l.abrupt("return",p);case 5:case"end":return l.stop()}},o,this)}));function a(o,r){return s.apply(this,arguments)}return a}()}]),i}(),U=new T},95520:function(L,A,e){e.d(A,{Ad:function(){return b},HJ:function(){return R},yI:function(){return w}});var F=e(37635),g=e.n(F),d=e(54306),y=e.n(d);function D(n){var t=n.current,u=n.pageSize;return{current:t||1,page_size:u||10}}var j={descend:"DESC",ascend:"ASC"};function O(n){var t=Object.entries(n).map(function(u){var v=_slicedToArray(u,2),E=v[0],c=v[1];return c?{order_key:E,order_type:j[c]}:{}});return t[0]}var K=function(t){return new Promise(function(u,v){try{var E;if(location.href.startsWith("https://")&&typeof((E=window.navigator.clipboard)===null||E===void 0?void 0:E.writeText)=="function")window.navigator.clipboard.writeText(t).then(u).catch(v);else{var c=document.createElement("textarea");c.value=t,document.body.appendChild(c),c.style.position="absolute",c.style.width="10px",c.style.height="10px",c.style.left="-9999px",c.style.opacity="0",c.select(),document.execCommand("Copy"),setTimeout(function(){c.remove()}),u(!0)}}catch(x){message.error("\u590D\u5236\u5931\u8D25"),v(x)}})};function B(n,t){var u=document.createElement("a");u.href=n,u.download=t||n.split("/").reverse()[0],u.target="_blank",u.click(),u.remove()}function H(n){try{var t=JSON.parse(n);return _typeof(t)==="object"&&t?t:!1}catch(u){return!1}}function M(n){return n<=4?1:n>4&&n<=9?2:n>9&&n<=14?3:4}function w(){for(var n=arguments.length,t=new Array(n),u=0;u<n;u++)t[u]=arguments[u];return t.filter(function(v){return!!v}).join(" ")}function f(){var n=0;return function(){return n+=1,n+""}}var Y=f();function b(n){var t=new Image;return t.src=URL.createObjectURL(n),new Promise(function(u,v){t.onload=function(){console.log(t.width,t.height),u({width:t.width,height:t.height})},t.onerror=function(){v("\u56FE\u7247\u52A0\u8F7D\u5931\u8D25")}})}function m(n,t){return t===0?n:m(t,n%t)}function R(n,t){if(typeof t.width=="number"&&n.width!==t.width)return"\u5BBD\u5EA6\u4E0D\u6B63\u786E\uFF0C\u5F53\u524D\u4E3A ".concat(n.width," px\uFF0C\u5E94\u4E3A ").concat(t.width," px");if(typeof t.height=="number"&&n.height!==t.height)return"\u9AD8\u5EA6\u4E0D\u6B63\u786E\uFF0C\u5F53\u524D\u4E3A ".concat(n.height," px\uFF0C\u5E94\u4E3A ").concat(t.height," px");if(typeof t.minWidth=="number"&&n.width<t.minWidth)return"\u5BBD\u5EA6\u4E0D\u6B63\u786E\uFF0C\u5F53\u524D\u4E3A ".concat(n.width," px\uFF0C\u6700\u5C0F\u5E94\u4E3A ").concat(t.minWidth," px");if(typeof t.minHeight=="number"&&n.height<t.minHeight)return"\u9AD8\u5EA6\u4E0D\u6B63\u786E\uFF0C\u5F53\u524D\u4E3A ".concat(n.height," px\uFF0C\u6700\u5C0F\u5E94\u4E3A ").concat(t.minHeight," px");if(typeof t.maxWidth=="number"&&n.width>t.maxWidth)return"\u5BBD\u5EA6\u4E0D\u6B63\u786E\uFF0C\u5F53\u524D\u4E3A ".concat(n.width," px\uFF0C\u6700\u5927\u5E94\u4E3A ").concat(t.maxWidth," px");if(typeof t.maxHeight=="number"&&n.height>t.maxHeight)return"\u9AD8\u5EA6\u4E0D\u6B63\u786E\uFF0C\u5F53\u524D\u4E3A ".concat(n.height," px\uFF0C\u6700\u5927\u5E94\u4E3A ").concat(t.maxHeight," px");if(Array.isArray(t.scale)){var u=m(t.scale[0],t.scale[1]);if(n.width/u!==t.scale[0]||n.height/u!==t.scale[1])return"\u6BD4\u4F8B\u4E0D\u6B63\u786E\uFF0C\u5F53\u524D\u4E3A ".concat(n.width/u," / ").concat(n.height/u,"\uFF0C\u5E94\u4E3A ").concat(t.scale.join("/"))}return!1}}}]);
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
TypeScript
1
https://gitee.com/ajax_lv/approval-data-admin.git
git@gitee.com:ajax_lv/approval-data-admin.git
ajax_lv
approval-data-admin
approval-data-admin
gh-pages

搜索帮助