forked from golang/hotime
1 line
7.8 KiB
JavaScript
1 line
7.8 KiB
JavaScript
(window.webpackJsonp=window.webpackJsonp||[]).push([["chunk-7439f1d8"],{2934:function(e,t,n){"use strict";n.d(t,"e",function(){return u}),n.d(t,"d",function(){return r}),n.d(t,"b",function(){return l}),n.d(t,"c",function(){return c}),n.d(t,"a",function(){return i}),n.d(t,"f",function(){return d});var t=n("b0c0"),a=n("b775"),t=n("4328"),o=n.n(t);function u(e,t){return Object(a.b)({url:e,method:"GET",params:t})}function r(e,t){return Object(a.b)({url:e,method:"GET",params:t})}function l(e,t){return Object(a.b)({url:e,method:"DELETE",data:o.a.stringify(t)})}function c(e,t){return Object(a.b)({url:e,method:"PUT",data:o.a.stringify(t)})}function i(e,t){return Object(a.b)({url:e,method:"POST",data:o.a.stringify(t)})}function d(e){var t=new FormData;return t.append("file",e,e.name),Object(a.b)({url:"file",headers:{"Content-Type":"multipart/form-data"},method:"POST",data:t})}},"35b2":function(e,t,n){"use strict";n("cd7c")},"39bd":function(e,t,n){"use strict";n("b89f")},b775:function(e,t,n){"use strict";n.d(t,"a",function(){return c});var a=n("d3b7"),o=n("bc3a"),a=n.n(o),o=n("4328"),u=n.n(o),r=n("3fd4"),l=n("56d7"),c="";a.a.defaults.withCredentials=!0,a.a.defaults.headers.post["Content-Type"]="application/x-www-form-urlencoded;charset=UTF-8";a=a.a.create({baseURL:c,timeout:2e4});a.interceptors.request.use(function(e){return"get"===e.method&&(e.paramsSerializer=function(e){return u.a.stringify(e,{arrayFormat:"repeat"})}),e.withCredentials=!0,e},function(e){Promise.reject(e)}),a.interceptors.response.use(function(e){return 2!==e.data.statu?e.data:(r.a.Message({showClose:!0,message:"登录信息丢失,请重新登陆!",type:"error",duration:2e3,offset:100}),void l.app.$router.push({path:"/login"}))},function(e){var t="err:"+e,n={};return e.response?n=e.response.data:(-1!=t.indexOf("timeout")?(n.code=500,n.message="请求超时,请稍后再试"):-1!=t.indexOf("Network Error")?(n.code=500,n.message="网络错误,请稍后再试"):(n.code=500,n.message=""+e),n)}),t.b=a},b89f:function(e,t,n){},cd7c:function(e,t,n){},d0c8:function(e,t,n){"use strict";n.r(t);n("9911"),n("b0c0");var O=n("f2bf"),p=Object(O.hb)("data-v-08891adc");Object(O.I)("data-v-08891adc");var h={key:1,class:"el-icon-plus avatar-uploader-icon"},k=Object(O.n)("新建"),v=Object(O.n)("取消");Object(O.G)();var a=p(function(t,e,n,a,o,u){var r=Object(O.O)("el-option"),l=Object(O.O)("el-select"),c=Object(O.O)("el-form-item"),i=Object(O.O)("el-input"),d=Object(O.O)("el-input-number"),b=Object(O.O)("el-date-picker"),f=Object(O.O)("el-upload"),s=Object(O.O)("el-button"),m=Object(O.O)("el-affix"),j=Object(O.O)("el-form");return Object(O.F)(),Object(O.j)(j,{ref:"form",model:o.form,"label-width":"80px",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:p(function(){return[(Object(O.F)(!0),Object(O.j)(O.b,null,Object(O.M)(o.templateData.columns,function(t){return Object(O.F)(),Object(O.j)(O.b,{key:t.type},[null!=t.link?(Object(O.F)(),Object(O.j)(O.b,{key:0},[0!=t.add?(Object(O.F)(),Object(O.j)(c,{key:0,label:t.label+":"},{default:p(function(){return[Object(O.o)(l,{modelValue:o.form[t.name],"onUpdate:modelValue":function(e){return o.form[t.name]=e},placeholder:"请选择"},{default:p(function(){return[Object(O.o)(r,{label:"请选择",value:""}),null!=o.formLink[t.link]?(Object(O.F)(!0),Object(O.j)(O.b,{key:0},Object(O.M)(o.formLink[t.link],function(e){return Object(O.F)(),Object(O.j)(r,{key:e.id,label:e[t.value],value:e.id},null,8,["label","value"])}),128)):Object(O.k)("",!0)]}),_:2},1032,["modelValue","onUpdate:modelValue"])]}),_:2},1032,["label"])):Object(O.k)("",!0)],64)):Object(O.k)("",!0),null==t.link?(Object(O.F)(),Object(O.j)(O.b,{key:1},[0!=t.add?(Object(O.F)(),Object(O.j)(c,{key:0,label:t.label+":",style:{width:"290px"}},{default:p(function(){return[null==t.options?(Object(O.F)(),Object(O.j)(O.b,{key:0},["password"==t.type?(Object(O.F)(),Object(O.j)(i,{key:0,modelValue:o.form[t.value],"onUpdate:modelValue":function(e){return o.form[t.value]=e},"show-password":""},null,8,["modelValue","onUpdate:modelValue"])):Object(O.k)("",!0),"text"==t.type?(Object(O.F)(),Object(O.j)(i,{key:1,modelValue:o.form[t.value],"onUpdate:modelValue":function(e){return o.form[t.value]=e}},null,8,["modelValue","onUpdate:modelValue"])):Object(O.k)("",!0),"number"==t.type?(Object(O.F)(),Object(O.j)(d,{key:2,modelValue:o.form[t.value],"onUpdate:modelValue":function(e){return o.form[t.value]=e}},null,8,["modelValue","onUpdate:modelValue"])):Object(O.k)("",!0),"time"==t.type?(Object(O.F)(),Object(O.j)(b,{key:3,modelValue:o.form[t.value],"onUpdate:modelValue":function(e){return o.form[t.value]=e},align:"right",type:"datetime",placeholder:"选择日期","disabled-date":o.disabledDate,shortcuts:o.shortcuts},null,8,["modelValue","onUpdate:modelValue","disabled-date","shortcuts"])):Object(O.k)("",!0),"image"==t.type?(Object(O.F)(),Object(O.j)(f,{key:4,action:"#","show-file-list":!1,"before-upload":function(e){return u.beforeAvatarUpload(e,t.value)}},{default:p(function(){return[o.form[t.value]?(Object(O.F)(),Object(O.j)("img",{key:0,src:o.baseurl+o.form[t.value]},null,8,["src"])):(Object(O.F)(),Object(O.j)("i",h))]}),_:2},1032,["before-upload"])):Object(O.k)("",!0)],64)):Object(O.k)("",!0),null!=t.options?(Object(O.F)(),Object(O.j)(l,{key:1,modelValue:o.form[t.value],"onUpdate:modelValue":function(e){return o.form[t.value]=e},placeholder:"请选择"},{default:p(function(){return[(Object(O.F)(!0),Object(O.j)(O.b,null,Object(O.M)(t.options,function(e){return Object(O.F)(),Object(O.j)(r,{key:e.value,label:e.name,value:e.value},null,8,["label","value"])}),128))]}),_:2},1032,["modelValue","onUpdate:modelValue"])):Object(O.k)("",!0)]}),_:2},1032,["label"])):Object(O.k)("",!0)],64)):Object(O.k)("",!0)],64)}),128)),Object(O.o)(m,{position:"bottom",offset:0,style:{width:"100%"}},{default:p(function(){return[Object(O.o)(c,{style:{background:"white","padding-bottom":"10px"}},{default:p(function(){return[Object(O.o)(s,{type:"primary",onClick:u.onSubmit},{default:p(function(){return[k]}),_:1},8,["onClick"]),Object(O.o)(s,{onClick:e[1]||(e[1]=function(e){return t.$router.back(-1)})},{default:p(function(){return[v]}),_:1})]}),_:1})]}),_:1})]}),_:1},8,["model"])}),u=n("b85c"),r=n("2934"),o=n("b775"),l={data:function(){return{templateData:{},baseurl:o.a,formLink:{},form:{},disabledDate:function(e){return e.getTime()>Date.now()},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:{beforeAvatarUpload:function(e,t){var n=this;return null==e||Object(r.f)(e).then(function(e){n.form[t]=e.result}),!1},onSubmit:function(){var t=this;this.$confirm("此操作将进行新建操作,是否继续?","提示",{confirmButtonText:"确定",cancelButtonText:"取消",type:"warning"}).then(function(){var e=window.Hotime;Object(r.a)(e.data.name+"/"+t.templateData.name,t.form).then(function(e){0==e.status?(t.$message({type:"success",message:"新建成功!"}),t.$router.back(-1)):t.$message({type:"warn",message:e.error.msg})})})},routeInit:function(){var e=this,a=window.Hotime;if(this.templateData=a.mapData[this.$route.path.substring(0,this.$route.path.lastIndexOf("/add"))],null!=this.templateData){if(null!=this.templateData.columns){var o,t=Object(u.a)(this.templateData.columns);try{for(t.s();!(o=t.n()).done;)!function(){var t,n=o.value;null==n.value&&(n.value=n.name),null!=n.link&&(t=e,Object(r.e)(a.data.name+"/"+n.link,{pageSize:100}).then(function(e){0==e.status&&(t.formLink[n.link]=e.result.data)}))}()}catch(e){t.e(e)}finally{t.f()}}for(var n in this.$route.query)null==this.$route.query[n]?this.form[n]="":this.form[n]=this.$route.query[n]}}},watch:{},mounted:function(){this.routeInit()}};n("39bd"),n("35b2");l.render=a,l.__scopeId="data-v-08891adc";t.default=l}}]); |