hotime/example/tpt/js/chunk-10a72523.f9d2509e.js
2022-02-28 09:59:05 +08:00

1 line
14 KiB
JavaScript

(window.webpackJsonp=window.webpackJsonp||[]).push([["chunk-10a72523"],{"04f0":function(e,t,a){},"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(r,o,i,c,u,e){var b=i+r.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 r;case"`":return o.slice(0,i);case"'":return o.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})}},"2ba7":function(e,t,a){},"392a":function(e,t,a){"use strict";a("04f0")},5319:function(e,t,a){"use strict";var l=a("d784"),n=a("d039"),g=a("825a"),w=a("a691"),x=a("50c4"),L=a("577e"),r=a("1d80"),D=a("8aa5"),U=a("0cb2"),$=a("14c3"),o=a("b622")("replace"),V=Math.max,T=Math.min,a="$0"==="a".replace(/./,"$0"),i=!!/./[o]&&""===/./[o]("a","$0");l("replace",function(e,v,y){var k=i?"$":"$0";return[function(e,t){var a=r(this),l=null==e?void 0:e[o];return void 0!==l?l.call(e,a,t):v.call(L(a),e,t)},function(e,t){var a=g(this),l=L(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=L(t));var r,o=a.global;o&&(r=a.unicode,a.lastIndex=0);for(var i=[];;){if(null===(d=$(a,l)))break;if(i.push(d),!o)break;""===L(d[0])&&(a.lastIndex=D(l,x(a.lastIndex),r))}for(var c,u="",b=0,s=0;s<i.length;s++){for(var d=i[s],f=L(d[0]),p=V(T(w(d.index),l.length),0),m=[],h=1;h<d.length;h++)m.push(void 0===(c=d[h])?c:String(c));var j,O=d.groups,O=n?(j=[f].concat(m,p,l),void 0!==O&&j.push(O),L(t.apply(void 0,j))):U(f,l,p,m,O,t);b<=p&&(u+=l.slice(b,p)+O,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||i)},7060:function(e,t,a){"use strict";a("2ba7")},"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)}},b50c:function(e,t,a){"use strict";a.r(t);a("b0c0");var O=a("9f9f");var b=a("b85c");a("a9e3"),a("159b"),a("4de4"),a("fb6a"),a("ac1f"),a("5319"),a("9911");Object(O.O)("data-v-3a110a5c");var v=["src"],y={key:1,class:"el-icon-plus avatar-uploader-icon"},k=Object(O.r)("上传文件"),g=["title"],w={key:1,class:"radio-wrap"},x=Object(O.r)("立即修改"),L=Object(O.r)("取消");Object(O.M)();var l=a("acf7"),o=a("2934"),n=a("b775"),s=a("83c5"),r={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(o.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(o.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,r=window.Hotime;if(null!=r.mapData[this.routerPath]?(this.templateData=r.mapData[this.routerPath],this.id=this.routerId):(this.templateData=r.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(o.d)(r.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(o.e)(r.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");r.render=function(e,t,a,l,n,r){var o=Object(O.U)("el-button"),i=Object(O.U)("el-form-item"),c=Object(O.U)("el-input"),u=Object(O.U)("el-input-number"),b=Object(O.U)("el-date-picker"),s=Object(O.U)("el-upload"),d=Object(O.U)("BasicForm"),f=Object(O.U)("el-option"),p=Object(O.U)("el-select"),m=Object(O.U)("el-radio"),h=Object(O.U)("el-affix"),j=Object(O.U)("el-form");return Object(O.L)(),Object(O.l)(j,{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(O.jb)(function(){return[(Object(O.L)(!0),Object(O.n)(O.b,null,Object(O.S)(n.templateData.columns,function(t){return Object(O.L)(),Object(O.n)("div",{key:t.type},[null!=t.link?(Object(O.L)(),Object(O.n)(O.b,{key:0},[0!=t.edit?(Object(O.L)(),Object(O.l)(i,{key:0,label:t.label+":"},{default:Object(O.jb)(function(){return[Object(O.s)(o,{icon:"el-icon-link",href:"javascript:;",onClick:function(e){return r.clickLink(t,n.form)}},{default:Object(O.jb)(function(){return[Object(O.r)(Object(O.Y)(n.form[t.link]?n.form[t.link][t.value]:"选择"),1)]}),_:2},1032,["onClick"])]}),_:2},1032,["label"])):Object(O.m)("",!0)],64)):Object(O.m)("",!0),null==t.link?(Object(O.L)(),Object(O.n)(O.b,{key:1},[0!=t.edit?(Object(O.L)(),Object(O.l)(i,{key:0,label:t.label+":"},{default:Object(O.jb)(function(){return[null==t.options?(Object(O.L)(),Object(O.n)(O.b,{key:0},["password"==t.type?(Object(O.L)(),Object(O.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(O.m)("",!0),"text"==t.type?(Object(O.L)(),Object(O.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(O.m)("",!0),"number"==t.type?(Object(O.L)(),Object(O.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(O.m)("",!0),"time"==t.type?(Object(O.L)(),Object(O.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(O.m)("",!0),"image"==t.type?(Object(O.L)(),Object(O.l)(s,{key:4,action:"#","show-file-list":!1,"before-upload":function(e){return r.beforeAvatarUpload(e,t.value)}},{default:Object(O.jb)(function(){return[n.form[t.value]?(Object(O.L)(),Object(O.n)("img",{key:0,src:n.baseurl+n.form[t.value]},null,8,v)):(Object(O.L)(),Object(O.n)("i",y))]}),_:2},1032,["before-upload"])):Object(O.m)("",!0),"file"==t.type?(Object(O.L)(),Object(O.l)(s,{key:5,class:"file-upload",action:"#","show-file-list":!1,style:{width:"400px"},"before-upload":function(e){return r.beforeAvatarUpload(e,t.value)}},{default:Object(O.jb)(function(){return[Object(O.s)(o,{type:"primary"},{default:Object(O.jb)(function(){return[k]}),_:1}),Object(O.o)("span",{class:"file-name",title:n.fileName},Object(O.Y)(n.fileName),9,g)]}),_:2},1032,["before-upload"])):Object(O.m)("",!0),"form"==t.type&&n.form[t.value]?(Object(O.L)(),Object(O.l)(d,{key:6,ref:"basicForm",basicForm:n.form[t.value]},null,8,["basicForm"])):Object(O.m)("",!0)],64)):Object(O.m)("",!0),null!=t.options?(Object(O.L)(),Object(O.n)(O.b,{key:1},[3<t.options.length?(Object(O.L)(),Object(O.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(O.jb)(function(){return[(Object(O.L)(!0),Object(O.n)(O.b,null,Object(O.S)(t.options,function(e){return Object(O.L)(),Object(O.l)(f,{key:e.value,label:e.name,value:e.value},null,8,["label","value"])}),128))]}),_:2},1032,["modelValue","onUpdate:modelValue"])):Object(O.m)("",!0),t.options.length<4?(Object(O.L)(),Object(O.n)("div",w,[(Object(O.L)(!0),Object(O.n)(O.b,null,Object(O.S)(t.options,function(e){return Object(O.L)(),Object(O.l)(m,{key:e,modelValue:n.form[t.value],"onUpdate:modelValue":function(e){return n.form[t.value]=e},label:e.value},{default:Object(O.jb)(function(){return[Object(O.r)(Object(O.Y)(e.name),1)]}),_:2},1032,["modelValue","onUpdate:modelValue","label"])}),128))])):Object(O.m)("",!0)],64)):Object(O.m)("",!0)]}),_:2},1032,["label"])):Object(O.m)("",!0)],64)):Object(O.m)("",!0)])}),128)),Object(O.s)(h,{position:"bottom",offset:0,style:{width:"100%"}},{default:Object(O.jb)(function(){return[Object(O.s)(i,{style:{background:"white","padding-bottom":"10px"}},{default:Object(O.jb)(function(){return[Object(O.s)(o,{type:"primary",onClick:r.onSubmit},{default:Object(O.jb)(function(){return[x]}),_:1},8,["onClick"]),Object(O.s)(o,{onClick:r.close},{default:Object(O.jb)(function(){return[L]}),_:1},8,["onClick"])]}),_:1})]}),_:1})]}),_:1},8,["model"])},r.__scopeId="data-v-3a110a5c";var i=r,l=a("8f33"),r=a("0748"),a=a("d0c8"),i={props:{routerPath:String,routerId:Number,close:Function},name:"Tabs",components:{Add:a.default,Table:r.default,Info:l.a,Edit:i},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,o=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 r,i=Object(b.a)(e.byLink);try{for(i.s();!(r=i.n()).done;){var c,u=r.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){i.e(e)}finally{i.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;o.tabs.forEach(function(e){e.path==t.path&&e.id==t.id&&(a=!0)}),a||(t.closable=!0,t.query=e.query,o.tabs.push(t)),o.activeName=t.path+t.id}),s.a.$off("tabs-close"),s.a.$on("tabs-close",function(a){var l=o.activeName,n=-1,r=o.tabs;r.forEach(function(e,t){e.path!=a.path||e.id!=a.id||(t=r[(n=t)-1]||r[t+1])&&(l=t.path+t.id)}),1==r[n].closable?(o.activeName=l,o.tabs=r.filter(function(e,t){return t!==n})):1==n?o.activeName=l:null!=o.close?o.close():o.$router.go(-1)})},render:function(e,t,a,l,n,r){var o=Object(O.U)("Edit"),i=Object(O.U)("Info"),c=Object(O.U)("Table"),u=Object(O.U)("Add"),b=Object(O.U)("el-tab-pane"),s=Object(O.U)("el-tabs");return Object(O.L)(),Object(O.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:r.removeTab},{default:Object(O.jb)(function(){return[(Object(O.L)(!0),Object(O.n)(O.b,null,Object(O.S)(n.tabs,function(e){return Object(O.L)(),Object(O.l)(b,{key:e.name,label:e.label,name:e.path+e.id,lazy:"",closable:1==e.closable},{default:Object(O.jb)(function(){return["edit"==e.tabType?(Object(O.L)(),Object(O.l)(o,{key:0,"router-path":e.path,"router-id":e.id},null,8,["router-path","router-id"])):Object(O.m)("",!0),"info"==e.tabType?(Object(O.L)(),Object(O.l)(i,{key:1,"router-path":e.path,"router-id":e.id},null,8,["router-path","router-id"])):Object(O.m)("",!0),"table"==e.tabType?(Object(O.L)(),Object(O.l)(c,{key:2,"router-query":e.query,"router-path":e.path},null,8,["router-query","router-path"])):Object(O.m)("",!0),"add"==e.tabType?(Object(O.L)(),Object(O.l)(u,{key:3,"router-query":e.query,"router-path":e.path},null,8,["router-query","router-path"])):Object(O.m)("",!0)]}),_:2},1032,["label","name","closable"])}),128))]}),_:1},8,["modelValue","onTabRemove"])}};t.default=i}}]);