Files
amb_wechatapp/public/assets/vue/index.dc94f1de.js
T

2 lines
11 KiB
JavaScript

import{_ as x}from"./index.76a66f15.js";/* empty css *//* empty css *//* empty css */import{C as r,D as F,a$ as E,aJ as n,b2 as i,aV as m,E as C,aG as U,b5 as v,b1 as y,bp as I,bn as M,bF as A,cr as O,ci as j,bK as q,bS as L,bU as R,bs as T,bo as V,c4 as P,bP as D,bL as k,bm as G,bt as J,bB as K,bW as W,bR as Q}from"./arco.f3c60d68.js";import"./chart.a626c034.js";import"./vue.7d1f2b31.js";class X{constructor(t,l){this.text=t,this.style=l||{fontSize:"12px",color:"#fff"};let a=document.createElement("div");a.className="aliplayer-copyright-bg";let e=document.createElement("div");e.className="aliplayer-copyright paused",e.innerText=this.text,e.style=l||{fontSize:"12px",color:"#fff"},a.appendChild(e),this.html=e,this.parentHtml=a}createEl(t,l){t.appendChild(this.parentHtml)}ready(t,l){t.getOptions().autoplay===!1&&(this.html.style.animationPlayState="paused"),Object.keys(this.style).forEach(a=>this.html.style[a]=this.style[a]),this.parentHtml.style.width="100%"}playing(t,l){this.html.style.animationPlayState="running"}timeupdate(t,l){let a=t.el();a.querySelector(".aliplayer-copyright")||a.appendChild(this.parentHtml)}pause(t,l){this.html.style.animationPlayState="paused"}}class Y{constructor(t,l,a="random"){this.text=t,this.style=l||{fontSize:"14px",color:"#E67E23",backgroundColor:"gray",width:"100%"},this.bulletPosition=a;let e=document.createElement("div");e.innerHTML='<div class="bullet-screen paused"></div>',this.html=e.childNodes[0]}createEl(t=document.querySelector(".container-preview")){t||(console.warn("\u672A\u627E\u5230 .container-preview \u5BB9\u5668\uFF0C\u9ED8\u8BA4\u6DFB\u52A0\u5230 body"),t=document.body),this.html.innerText=this.text,Object.entries(this.style).forEach(([l,a])=>{a&&(this.html.style[l]=a)}),t.appendChild(this.html),this.ready()}ready(){Object.entries(this.style).forEach(([t,l])=>{l&&(this.html.style[t]=l)}),setTimeout(()=>{let t=300;this.applyPosition(t)},300)}applyPosition(t){if(this.bulletPosition==="bottom")this.html.style.bottom="0px",this.html.style.top="auto";else if(this.bulletPosition==="top")this.html.style.top="10px",this.html.style.bottom="auto";else{let l=this.randomTop(t);console.log("top",l),this.html.style.top=l,this.html.style.bottom="auto"}this.bulletPosition==="random"&&this.html.addEventListener("animationiteration",()=>{var a;let l=Math.max(parseInt(((a=this.html.parentElement)==null?void 0:a.offsetHeight)||"300px",10)-this.html.offsetHeight,10);this.html.style.top=this.randomTop(l)})}pause(t,l){this.html.style.animationPlayState="paused"}randomTop(t){return Math.floor(Math.random()*Math.max(t,10))+"px"}}const Z={props:{options:{type:Object,default:()=>{}}},data(){return{pageParams:{}}},watch:{options:{handler(o){this.removeElements(),this.initMarquee(o.copyright_text),this.initBulletScreen(o.bullet_color,o.bullet_font_size,o.bullet_opacity)},deep:!0}},methods:{removeElements(){const o=this.$refs.containerPreview;for(;o.firstChild;)o.removeChild(o.firstChild)},initMarquee(o){var t=document.querySelector(".container-preview");new X(o||"\u8BF7\u8F93\u5165\u7248\u6743\u63D0\u793A\u5185\u5BB9",{color:"#fff"}).createEl(t)},initBulletScreen(o,t,l){var a=document.querySelector(".container-preview");new Y("\u7528\u6237\u540D123456",{color:o,fontSize:t+"px",opacity:l},"random").createEl(a)}},mounted(){this.pageParams=this.$route.params,this.initMarquee(this.options.copyright_text),this.initBulletScreen(this.options.bullet_color,this.options.bullet_font_size,this.options.bullet_opacity)}};const tt={class:"container-preview",ref:"containerPreview"};function et(o,t,l,a,e,c){return r(),F("div",tt,null,512)}const ot=x(Z,[["render",et],["__scopeId","data-v-02e97173"]]),nt={components:{marqueePreview:ot},data(){return{loading:!1,pageParams:{},form:{bullet_status:1,bullet_color:"rgb(0, 0, 0)",bullet_font_size:14,bullet_opacity:1,copyright_status:1,copyright_text:""}}},methods:{validate(){return!0},handleSubmit(){if(!this.validate())return!1;this.loading=!0;var o=this;this.$request.post("admin/config/marquee/setConfig",{row:o.form}).then(t=>{this.loading=!1,this.$message.success(t.msg),this.getData()}).catch(t=>{this.loading=!1,this.$message.error(t.msg)})},getData(){this.loading=!0,this.$request.post("admin/config/marquee/getConfig",{}).then(o=>{o.code==1&&(this.form=o.data),this.loading=!1})}},mounted(){this.pageParams=this.$route.params,this.getData()}};const lt={class:"container"},it={class:"preview-container"},at={class:"form-submit-btn"};function st(o,t,l,a,e,c){const f=I,d=M,s=A,h=E("t-color-picker"),p=O,b=j,g=q,_=L,B=E("marquee-preview"),w=R,S=T,N=V,z=P,$=D,H=k;return r(),F("div",lt,[n(H,{class:"content-card"},{default:i(()=>[n($,{loading:e.loading,tip:"\u52A0\u8F7D\u4E2D...",style:{width:"100%"}},{default:i(()=>[n(S,{direction:"vertical",fill:"",size:20},{default:i(()=>[n(f,{title:"\u6CE8\u610F"},{default:i(()=>[...t[6]||(t[6]=[m(" \u7248\u6743\u7533\u660E\u663E\u793A\u7684\u9891\u7387\u662F\u95F4\u969415\u5206\u949F\uFF0C\u7528\u6237\u540D\u548CID\u8DD1\u9A6C\u706F\u663E\u793A\u7684\u9891\u7387\u662F\u95F4\u969430\u79D2\uFF0C\u518D\u6B21\u6EDA\u52A8",-1),C("br",null,null,-1)])]),_:1}),n(w,null,{default:i(()=>[n(_,{span:12,style:{"padding-right":"15px"}},{default:i(()=>[n(g,{model:e.form},{default:i(()=>[n(s,{field:"marqueeSwitch",label:"\u8DD1\u9A6C\u706F\u72B6\u6001:"},{default:i(()=>[n(d,{modelValue:e.form.bullet_status,"onUpdate:modelValue":t[0]||(t[0]=u=>e.form.bullet_status=u),"checked-value":"1","unchecked-value":"0",size:"small"},{checked:i(()=>[...t[7]||(t[7]=[m(" \u5F00\u542F ",-1)])]),unchecked:i(()=>[...t[8]||(t[8]=[m(" \u5173\u95ED ",-1)])]),_:1},8,["modelValue"])]),_:1}),e.form.bullet_status==1?(r(),F(U,{key:0},[n(s,{field:"marqueeColor",label:"\u8DD1\u9A6C\u706F\u989C\u8272:"},{default:i(()=>[n(h,{modelValue:e.form.bullet_color,"onUpdate:modelValue":t[1]||(t[1]=u=>e.form.bullet_color=u),"color-modes":["monochrome"],"show-primary-color-preview":!1},null,8,["modelValue"])]),_:1}),n(s,{field:"fontSize",label:"\u5B57\u4F53\u5927\u5C0F:"},{default:i(()=>[n(p,{style:{"margin-bottom":"0",width:"300px"},modelValue:e.form.bullet_font_size,"onUpdate:modelValue":t[2]||(t[2]=u=>e.form.bullet_font_size=u),min:12,max:16,step:2,marks:{12:"\u5C0F",14:"\u4E2D",16:"\u5927"}},null,8,["modelValue"])]),_:1}),n(s,{field:"opacity",label:"\u900F\u660E\u5EA6:"},{default:i(()=>[n(p,{style:{"margin-bottom":"0",width:"300px"},modelValue:e.form.bullet_opacity,"onUpdate:modelValue":t[3]||(t[3]=u=>e.form.bullet_opacity=u),min:.2,max:1,step:.2,marks:{.2:"20%",.4:"40%",.6:"60%",.8:"80%",1:"100%"}},null,8,["modelValue"])]),_:1})],64)):v("",!0),n(s,{field:"versionSwitch",label:"\u7248\u6743\u58F0\u660E\u5F00\u5173:"},{default:i(()=>[n(d,{modelValue:e.form.copyright_status,"onUpdate:modelValue":t[4]||(t[4]=u=>e.form.copyright_status=u),"checked-value":"1","unchecked-value":"0",size:"small"},{checked:i(()=>[...t[9]||(t[9]=[m(" \u663E\u793A ",-1)])]),unchecked:i(()=>[...t[10]||(t[10]=[m(" \u9690\u85CF ",-1)])]),_:1},8,["modelValue"])]),_:1}),e.form.copyright_status==1?(r(),y(s,{key:1,field:"versionContent",label:"\u7248\u6743\u58F0\u660E\u5185\u5BB9:"},{default:i(()=>[n(b,{modelValue:e.form.copyright_text,"onUpdate:modelValue":t[5]||(t[5]=u=>e.form.copyright_text=u)},null,8,["modelValue"])]),_:1})):v("",!0)]),_:1},8,["model"])]),_:1}),n(_,{span:12,style:{"padding-left":"15px"}},{default:i(()=>[C("div",it,[n(B,{options:e.form},null,8,["options"])])]),_:1})]),_:1})]),_:1}),n(z,{offsetBottom:0},{default:i(()=>[C("div",at,[n(S,null,{default:i(()=>[n(N,{onClick:c.handleSubmit,type:"primary"},{default:i(()=>[...t[11]||(t[11]=[m("\u4FDD\u5B58",-1)])]),_:1},8,["onClick"])]),_:1})])]),_:1})]),_:1},8,["loading"])]),_:1})])}const ut=x(nt,[["render",st],["__scopeId","data-v-813c27ea"]]),rt={data(){return{loading:!1,form:{login_terminal_limit:3}}},methods:{validate(){const o=Number(this.form.login_terminal_limit);return!Number.isFinite(o)||Number.isNaN(o)?(this.$message.error("\u8BF7\u8F93\u5165\u6709\u6548\u7684\u7EC8\u7AEF\u6570\u91CF"),!1):o<1||o>50?(this.$message.error("\u7EC8\u7AEF\u6570\u91CF\u9700\u5728 1-50 \u4E4B\u95F4"),!1):!0},handleSubmit(){if(!this.validate())return!1;this.loading=!0;const o={login_terminal_limit:String(this.form.login_terminal_limit)};this.$request.post("admin/config/terminal/setConfig",{row:o}).then(t=>{this.loading=!1,this.$message.success(t.msg),this.getData()}).catch(t=>{this.loading=!1,this.$message.error(t.msg)})},getData(){this.loading=!0,this.$request.post("admin/config/terminal/getConfig",{}).then(o=>{if(o.code==1&&o.data){const t=o.data.login_terminal_limit;let l=parseInt(t,10);(!Number.isFinite(l)||Number.isNaN(l))&&(l=3),l<1&&(l=1),l>50&&(l=50),this.form.login_terminal_limit=l}this.loading=!1}).catch(()=>{this.loading=!1})}},mounted(){this.getData()}};const mt={class:"container"},ct={class:"form-submit-btn"};function dt(o,t,l,a,e,c){const f=G,d=J,s=T,h=A,p=q,b=V,g=P,_=D,B=k;return r(),F("div",mt,[n(B,{class:"content-card",bordered:!1},{default:i(()=>[n(_,{loading:e.loading,tip:"\u52A0\u8F7D\u4E2D...",style:{width:"100%"}},{default:i(()=>[n(p,{model:e.form,"auto-label-width":""},{default:i(()=>[n(h,{field:"login_terminal_limit",label:"\u7EC8\u7AEF\u6570\u91CF\u9650\u5236"},{default:i(()=>[n(s,{direction:"vertical",fill:"",align:"start"},{default:i(()=>[n(f,{modelValue:e.form.login_terminal_limit,"onUpdate:modelValue":t[0]||(t[0]=w=>e.form.login_terminal_limit=w),min:1,max:50,step:1,precision:0,style:{width:"200px"},placeholder:"\u8BF7\u8F93\u5165 1-50 \u4E4B\u95F4\u7684\u6570\u5B57"},null,8,["modelValue"]),n(d,{type:"secondary",style:{"font-size":"12px",color:"rgb(var(--gray-6))"}},{default:i(()=>[...t[1]||(t[1]=[m(" \u9650\u5236\u5B66\u5458\u540C\u65F6\u767B\u5F55\u770B\u8BFE\u7EC8\u7AEF\u7684\u6570\u91CF\uFF0C\u4E00\u5B9A\u7A0B\u5EA6\u51CF\u5C11\u5B66\u5458\u5171\u4EAB\u540C\u4E00\u8D26\u53F7\u8FDB\u884C\u5B66\u4E60\u7684\u60C5\u51B5\u3002\u4F7F\u7528\u624B\u673A\u548C\u7535\u8111\u4E0A\u7684\u3010H5\u3001PC\u3001\u5C0F\u7A0B\u5E8F\u3011\u4F1A\u5360\u7528\u7EC8\u7AEF\u6570 ",-1)])]),_:1})]),_:1})]),_:1})]),_:1},8,["model"]),n(g,{offsetBottom:0},{default:i(()=>[C("div",ct,[n(s,null,{default:i(()=>[n(b,{onClick:c.handleSubmit,type:"primary",loading:e.loading},{default:i(()=>[...t[2]||(t[2]=[m(" \u4FDD\u5B58 ",-1)])]),_:1},8,["onClick","loading"])]),_:1})])]),_:1})]),_:1},8,["loading"])]),_:1})])}const pt=x(rt,[["render",dt],["__scopeId","data-v-ba6757a6"]]),_t={components:{marqueeTab:ut,terminalTab:pt},data(){return{controTab:"terminal",pageParams:{},loading:!1}},methods:{controlTabsChange(o){this.controTab=o}},mounted(){this.pageParams=this.$route.params}},ft={class:"container"};function ht(o,t,l,a,e,c){const f=K,d=D,s=W,h=Q,p=E("terminal-tab"),b=E("marquee-tab"),g=k;return r(),F("div",ft,[e.loading?(r(),y(d,{key:0,loading:e.loading,tip:"\u52A0\u8F7D\u4E2D...",style:{width:"100%"}},{default:i(()=>[n(f,{rows:10})]),_:1},8,["loading"])):(r(),y(g,{key:1,class:"content-card"},{default:i(()=>[n(h,{"default-active-key":e.controTab,modelValue:e.controTab,"onUpdate:modelValue":t[0]||(t[0]=_=>e.controTab=_),"hide-content":!0,onTabClick:c.controlTabsChange},{default:i(()=>[n(s,{key:"terminal",title:"\u7EC8\u7AEF\u9650\u5236"}),n(s,{key:"marquee",title:"\u8DD1\u9A6C\u706F"})]),_:1},8,["default-active-key","modelValue","onTabClick"]),e.controTab=="terminal"?(r(),y(p,{key:0})):v("",!0),e.controTab=="marquee"?(r(),y(b,{key:1})):v("",!0)]),_:1}))])}const xt=x(_t,[["render",ht]]);export{xt as default};