forked from golang/hotime
1 line
14 KiB
JavaScript
1 line
14 KiB
JavaScript
(window.webpackJsonp=window.webpackJsonp||[]).push([["chunk-550dc75a"],{"0cb2":function(e,t,a){var l=a("7b0b"),d=Math.floor,n="".replace,f=/\$([$&'`]|\d{1,2}|<[^>]*>)/g,p=/\$([$&'`]|\d{1,2})/g;e.exports=function(i,r,o,c,u,e){var b=o+i.length,s=c.length,t=p;return void 0!==u&&(u=l(u),t=f),n.call(e,t,function(e,t){var a;switch(t.charAt(0)){case"$":return"$";case"&":return i;case"`":return r.slice(0,o);case"'":return r.slice(b);case"<":a=u[t.slice(1,-1)];break;default:var l=+t;if(0==l)return e;if(s<l){var n=d(l/10);return 0===n?e:n<=s?void 0===c[n-1]?t.charAt(1):c[n-1]+t.charAt(1):e}a=c[l-1]}return void 0===a?"":a})}},"392a":function(e,t,a){"use strict";a("f465")},5319:function(e,t,a){"use strict";var l=a("d784"),n=a("d039"),g=a("825a"),w=a("a691"),T=a("50c4"),x=a("577e"),i=a("1d80"),D=a("8aa5"),$=a("0cb2"),K=a("14c3"),r=a("b622")("replace"),V=Math.max,I=Math.min,a="$0"==="a".replace(/./,"$0"),o=!!/./[r]&&""===/./[r]("a","$0");l("replace",function(e,v,y){var k=o?"$":"$0";return[function(e,t){var a=i(this),l=null==e?void 0:e[r];return void 0!==l?l.call(e,a,t):v.call(x(a),e,t)},function(e,t){var a=g(this),l=x(e);if("string"==typeof t&&-1===t.indexOf(k)&&-1===t.indexOf("$<")){e=y(v,a,l,t);if(e.done)return e.value}var n="function"==typeof t;n||(t=x(t));var i,r=a.global;r&&(i=a.unicode,a.lastIndex=0);for(var o=[];;){if(null===(d=K(a,l)))break;if(o.push(d),!r)break;""===x(d[0])&&(a.lastIndex=D(l,T(a.lastIndex),i))}for(var c,u="",b=0,s=0;s<o.length;s++){for(var d=o[s],f=x(d[0]),p=V(I(w(d.index),l.length),0),m=[],h=1;h<d.length;h++)m.push(void 0===(c=d[h])?c:String(c));var O,j=d.groups,j=n?(O=[f].concat(m,p,l),void 0!==j&&O.push(j),x(t.apply(void 0,O))):$(f,l,p,m,j,t);b<=p&&(u+=l.slice(b,p)+j,b=p+f.length)}return u+l.slice(b)}]},!!n(function(){var e=/./;return e.exec=function(){var e=[];return e.groups={a:"7"},e},"7"!=="".replace(e,"$<a>")})||!a||o)},7060:function(e,t,a){"use strict";a("93b0")},"8aa5":function(e,t,a){"use strict";var l=a("6547").charAt;e.exports=function(e,t,a){return t+(a?l(e,t).length:1)}},"93b0":function(e,t,a){},b50c:function(e,t,a){"use strict";a.r(t);a("b0c0");var j=a("f2bf");var b=a("b85c");a("a9e3"),a("159b"),a("4de4"),a("fb6a"),a("ac1f"),a("5319"),a("9911");Object(j.N)("data-v-3a110a5c");var v=["src"],y={key:1,class:"el-icon-plus avatar-uploader-icon"},k=Object(j.q)("上传文件"),g=["title"],w={key:1,class:"radio-wrap"},T=Object(j.q)("立即修改"),x=Object(j.q)("取消");Object(j.L)();var l=a("acf7"),r=a("2934"),n=a("b775"),s=a("83c5"),i={props:{routerPath:String,routerId:Number},components:{BasicForm:l.a},data:function(){return{fileName:"",id:null,templateData:{},baseurl:n.a,formLink:{},form:{},shortcuts:[{text:"今天",value:new Date},{text:"昨天",value:((e=new Date).setTime(e.getTime()-864e5),e)},{text:"一周前",value:((e=new Date).setTime(e.getTime()-6048e5),e)}]};var e},methods:{clickLink:function(t,a){var e={name:"Table",path:window.Hotime.tableMapData[t.link].path,title:window.Hotime.tableMapData[t.link].parent.label+"-"+window.Hotime.tableMapData[t.link].label};null!=this.editDialogPath?s.a.$emit("tabs-edit",e):(s.a.$emit("dialog-edit",e),s.a.$off("table:"+window.Hotime.tableMapData[t.link].path)),s.a.$on("table:"+window.Hotime.tableMapData[t.link].path,function(e){a[t.link]=e,a[t.name]=e.id})},closeDialog:function(){this.showDialog=!1,this.dialogDataPath=null,this.dialogDataId=null,this.dialogDataQuery={}},beforeAvatarUpload:function(e,t){var a=this;return null==e||Object(r.f)(e).then(function(e){a.form[t]=e.result}),!1},close:function(){s.a.$emit("tabs-close",{name:"Edit",path:this.templateData.path,id:this.id})},onSubmit:function(){var a=this,l=this;this.$confirm("此操作将进行修改操作,是否继续?","提示",{confirmButtonText:"确定",cancelButtonText:"取消",type:"warning"}).then(function(){var e,t=window.Hotime;a.$refs.basicForm&&(e=a.$refs.basicForm.form,l.form.rule=JSON.stringify(e)),Object(r.c)(t.data.name+"/"+a.templateData.name+"/"+a.id,l.form).then(function(e){0==e.status?(l.$message({type:"success",message:"修改成功!"}),l.close()):l.$message({type:"warn",message:e.error.msg})})})},routeInit:function(){var n=this,i=window.Hotime;if(null!=i.mapData[this.routerPath]?(this.templateData=i.mapData[this.routerPath],this.id=this.routerId):(this.templateData=i.mapData[this.$route.path.substring(0,this.$route.path.lastIndexOf("/edit"))],this.id=this.$route.query.id),null!=this.templateData){if(null!=this.templateData.columns){var e,t=Object(b.a)(this.templateData.columns);try{for(t.s();!(e=t.n()).done;){var a=e.value;null==a.value&&(a.value=a.name)}}catch(e){t.e(e)}finally{t.f()}}Object(r.d)(i.data.name+"/"+this.templateData.name+"/"+this.id).then(function(a){if(null!=n.templateData.columns){var e,t=Object(b.a)(n.templateData.columns);try{for(t.s();!(e=t.n()).done;)!function(){var t=e.value;null!=t.link&&Object(r.e)(i.data.name+"/"+t.link,{pageSize:100}).then(function(e){0==e.status&&(n.formLink[t.link]=e.result.data,null!=a.result[t.link]&&n.formLink[t.link].push(a.result[t.link]))})}()}catch(e){t.e(e)}finally{t.f()}}for(var l in a.result)a.result[l]instanceof Object?n.form[l]=a.result[l]:n.form[l]=a.result[l]+""})}}},watch:{},mounted:function(){this.routeInit()}};a("392a"),a("7060");i.render=function(e,t,a,l,n,i){var r=Object(j.T)("el-button"),o=Object(j.T)("el-form-item"),c=Object(j.T)("el-input"),u=Object(j.T)("el-input-number"),b=Object(j.T)("el-date-picker"),s=Object(j.T)("el-upload"),d=Object(j.T)("BasicForm"),f=Object(j.T)("el-option"),p=Object(j.T)("el-select"),m=Object(j.T)("el-radio"),h=Object(j.T)("el-affix"),O=Object(j.T)("el-form");return Object(j.K)(),Object(j.l)(O,{ref:"form",model:n.form,"label-width":"180px",style:{"padding-top":"10px","overflow-y":"auto",width:"90%","padding-right":"30px",background:"white",display:"block","flex-direction":"row","flex-wrap":"wrap","align-content":"flex-start","justify-content":"flex-start"}},{default:Object(j.ib)(function(){return[(Object(j.K)(!0),Object(j.n)(j.b,null,Object(j.R)(n.templateData.columns,function(t){return Object(j.K)(),Object(j.n)("div",{key:t.type},[null!=t.link?(Object(j.K)(),Object(j.n)(j.b,{key:0},[0!=t.edit?(Object(j.K)(),Object(j.l)(o,{key:0,label:t.label+":"},{default:Object(j.ib)(function(){return[Object(j.r)(r,{icon:"el-icon-link",href:"javascript:;",onClick:function(e){return i.clickLink(t,n.form)}},{default:Object(j.ib)(function(){return[Object(j.q)(Object(j.X)(n.form[t.link]?n.form[t.link][t.value]:"选择"),1)]}),_:2},1032,["onClick"])]}),_:2},1032,["label"])):Object(j.m)("",!0)],64)):Object(j.m)("",!0),null==t.link?(Object(j.K)(),Object(j.n)(j.b,{key:1},[0!=t.edit?(Object(j.K)(),Object(j.l)(o,{key:0,label:t.label+":"},{default:Object(j.ib)(function(){return[null==t.options?(Object(j.K)(),Object(j.n)(j.b,{key:0},["password"==t.type?(Object(j.K)(),Object(j.l)(c,{key:0,modelValue:n.form[t.value],"onUpdate:modelValue":function(e){return n.form[t.value]=e},"show-password":"",style:{width:"400px"}},null,8,["modelValue","onUpdate:modelValue"])):Object(j.m)("",!0),"text"==t.type?(Object(j.K)(),Object(j.l)(c,{key:1,modelValue:n.form[t.value],"onUpdate:modelValue":function(e){return n.form[t.value]=e},type:"textarea",style:{width:"400px"}},null,8,["modelValue","onUpdate:modelValue"])):Object(j.m)("",!0),"number"==t.type?(Object(j.K)(),Object(j.l)(u,{key:2,modelValue:n.form[t.value],"onUpdate:modelValue":function(e){return n.form[t.value]=e},style:{width:"400px"}},null,8,["modelValue","onUpdate:modelValue"])):Object(j.m)("",!0),"time"==t.type?(Object(j.K)(),Object(j.l)(b,{key:3,modelValue:n.form[t.value],"onUpdate:modelValue":function(e){return n.form[t.value]=e},align:"right",type:"datetime",placeholder:"选择日期","value-format":"X",shortcuts:n.shortcuts,style:{width:"400px"}},null,8,["modelValue","onUpdate:modelValue","shortcuts"])):Object(j.m)("",!0),"image"==t.type?(Object(j.K)(),Object(j.l)(s,{key:4,action:"#","show-file-list":!1,"before-upload":function(e){return i.beforeAvatarUpload(e,t.value)}},{default:Object(j.ib)(function(){return[n.form[t.value]?(Object(j.K)(),Object(j.n)("img",{key:0,src:n.baseurl+n.form[t.value]},null,8,v)):(Object(j.K)(),Object(j.n)("i",y))]}),_:2},1032,["before-upload"])):Object(j.m)("",!0),"file"==t.type?(Object(j.K)(),Object(j.l)(s,{key:5,class:"file-upload",action:"#","show-file-list":!1,style:{width:"400px"},"before-upload":function(e){return i.beforeAvatarUpload(e,t.value)}},{default:Object(j.ib)(function(){return[Object(j.r)(r,{type:"primary"},{default:Object(j.ib)(function(){return[k]}),_:1}),Object(j.o)("span",{class:"file-name",title:n.fileName},Object(j.X)(n.fileName),9,g)]}),_:2},1032,["before-upload"])):Object(j.m)("",!0),"form"==t.type&&n.form[t.value]?(Object(j.K)(),Object(j.l)(d,{key:6,ref:"basicForm",basicForm:n.form[t.value]},null,8,["basicForm"])):Object(j.m)("",!0)],64)):Object(j.m)("",!0),null!=t.options?(Object(j.K)(),Object(j.n)(j.b,{key:1},[3<t.options.length?(Object(j.K)(),Object(j.l)(p,{key:0,modelValue:n.form[t.value],"onUpdate:modelValue":function(e){return n.form[t.value]=e},placeholder:"请选择",style:{width:"400px"}},{default:Object(j.ib)(function(){return[(Object(j.K)(!0),Object(j.n)(j.b,null,Object(j.R)(t.options,function(e){return Object(j.K)(),Object(j.l)(f,{key:e.value,label:e.name,value:e.value},null,8,["label","value"])}),128))]}),_:2},1032,["modelValue","onUpdate:modelValue"])):Object(j.m)("",!0),t.options.length<4?(Object(j.K)(),Object(j.n)("div",w,[(Object(j.K)(!0),Object(j.n)(j.b,null,Object(j.R)(t.options,function(e){return Object(j.K)(),Object(j.l)(m,{key:e,modelValue:n.form[t.value],"onUpdate:modelValue":function(e){return n.form[t.value]=e},label:e.value},{default:Object(j.ib)(function(){return[Object(j.q)(Object(j.X)(e.name),1)]}),_:2},1032,["modelValue","onUpdate:modelValue","label"])}),128))])):Object(j.m)("",!0)],64)):Object(j.m)("",!0)]}),_:2},1032,["label"])):Object(j.m)("",!0)],64)):Object(j.m)("",!0)])}),128)),Object(j.r)(h,{position:"bottom",offset:0,style:{width:"100%"}},{default:Object(j.ib)(function(){return[Object(j.r)(o,{style:{background:"white","padding-bottom":"10px"}},{default:Object(j.ib)(function(){return[Object(j.r)(r,{type:"primary",onClick:i.onSubmit},{default:Object(j.ib)(function(){return[T]}),_:1},8,["onClick"]),Object(j.r)(r,{onClick:i.close},{default:Object(j.ib)(function(){return[x]}),_:1},8,["onClick"])]}),_:1})]}),_:1})]}),_:1},8,["model"])},i.__scopeId="data-v-3a110a5c";var o=i,l=a("8f33"),i=a("0748"),a=a("d0c8"),o={props:{routerPath:String,routerId:Number,close:Function},name:"Tabs",components:{Add:a.default,Table:i.default,Info:l.a,Edit:o},data:function(){return{activeName:"",tabs:[]}},methods:{removeTab:function(a){var l=this.tabs,n=this.activeName;l.forEach(function(e,t){e.path+e.id!==a||(t=l[t+1]||l[t-1])&&(n=t.path+t.id)}),this.activeName=n,this.tabs=l.filter(function(e){return e.path+e.id!==a})}},mounted:function(){var e,t,a,l=window.Hotime,r=this,n=null!=l.mapData[this.routerPath]?(e=l.mapData[this.routerPath],this.routerId):(e=l.mapData[this.$route.path],this.$route.query.id);if(e.id=n,e.path.lastIndexOf("/info")==e.path.length-5?(e.tabType="info",this.tabs.push(e),this.activeName=e.path+n,!0===(t=l.mapData[e.path.slice(0,e.path.lastIndexOf("/info"))+"/edit"]).Auth.edit&&(t.tabType="edit",t.id=n,this.tabs.push(t))):e.path.lastIndexOf("/edit")==e.path.length-5?(e.tabType="edit",this.tabs.push(e),this.activeName=e.path+n,!0===(a=l.mapData[e.path.slice(0,e.path.lastIndexOf("/edit"))+"/info"]).Auth.info&&(a.tabType="info",a.id=n,this.tabs.push(a))):(e.path.lastIndexOf("/add")==e.path.length-4?e.tabType="add":(e.tabType="table",a.id=n),this.tabs.push(e),this.activeName=e.path),null!=e.byLink&&null!=n){var i,o=Object(b.a)(e.byLink);try{for(o.s();!(i=o.n()).done;){var c,u=i.value;null!=l.tableMapData[u.table]&&((c=Object.assign({},l.tableMapData[u.table])).label="关联"+c.label.replace("管理","").replace("关联",""),c.tabType="table",c.query={},c.query[u.name]=n,this.tabs.push(c))}}catch(e){o.e(e)}finally{o.f()}}s.a.$off("tabs"),s.a.$on("tabs",function(e){var t=Object.assign({},l.mapData[e.path]);t.label="关联"+t.parent.label.replace("管理","").replace("关联","")+t.label.replace("管理","").replace("关联",""),t.tabType=t.path.slice(t.path.lastIndexOf("/")+1,t.path.length),t.id=e.id;var a=!1;r.tabs.forEach(function(e){e.path==t.path&&e.id==t.id&&(a=!0)}),a||(t.closable=!0,t.query=e.query,r.tabs.push(t)),r.activeName=t.path+t.id}),s.a.$off("tabs-close"),s.a.$on("tabs-close",function(a){var l=r.activeName,n=-1,i=r.tabs;i.forEach(function(e,t){e.path!=a.path||e.id!=a.id||(t=i[(n=t)-1]||i[t+1])&&(l=t.path+t.id)}),1==i[n].closable?(r.activeName=l,r.tabs=i.filter(function(e,t){return t!==n})):1==n?r.activeName=l:null!=r.close?r.close():r.$router.go(-1)})},render:function(e,t,a,l,n,i){var r=Object(j.T)("Edit"),o=Object(j.T)("Info"),c=Object(j.T)("Table"),u=Object(j.T)("Add"),b=Object(j.T)("el-tab-pane"),s=Object(j.T)("el-tabs");return Object(j.K)(),Object(j.l)(s,{modelValue:n.activeName,"onUpdate:modelValue":t[0]||(t[0]=function(e){return n.activeName=e}),type:"border-card",style:{width:"100%","overflow-y":"auto"},onTabRemove:i.removeTab},{default:Object(j.ib)(function(){return[(Object(j.K)(!0),Object(j.n)(j.b,null,Object(j.R)(n.tabs,function(e){return Object(j.K)(),Object(j.l)(b,{key:e.name,label:e.label,name:e.path+e.id,lazy:"",closable:1==e.closable},{default:Object(j.ib)(function(){return["edit"==e.tabType?(Object(j.K)(),Object(j.l)(r,{key:0,"router-path":e.path,"router-id":e.id},null,8,["router-path","router-id"])):Object(j.m)("",!0),"info"==e.tabType?(Object(j.K)(),Object(j.l)(o,{key:1,"router-path":e.path,"router-id":e.id},null,8,["router-path","router-id"])):Object(j.m)("",!0),"table"==e.tabType?(Object(j.K)(),Object(j.l)(c,{key:2,"router-query":e.query,"router-path":e.path},null,8,["router-query","router-path"])):Object(j.m)("",!0),"add"==e.tabType?(Object(j.K)(),Object(j.l)(u,{key:3,"router-query":e.query,"router-path":e.path},null,8,["router-query","router-path"])):Object(j.m)("",!0)]}),_:2},1032,["label","name","closable"])}),128))]}),_:1},8,["modelValue","onTabRemove"])}};t.default=o},f465:function(e,t,a){}}]); |