iedc-go/example/tpt/js/chunk-33a591b6.b442fc2f.js

1 line
9.3 KiB
JavaScript

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