1 line
2.3 KiB
JavaScript
1 line
2.3 KiB
JavaScript
|
(window["webpackJsonp"]=window["webpackJsonp"]||[]).push([["chunk-2d0c8a44"],{"566c":function(t,e,a){"use strict";a.r(e);var n=function(){var t=this,e=t.$createElement,a=t._self._c||e;return a("div",{staticClass:"divBox"},[a("el-card",{staticClass:"box-card"},[t.FormData?a("form-create",{directives:[{name:"loading",rawName:"v-loading",value:t.loading,expression:"loading"}],ref:"fc",staticClass:"formBox",attrs:{option:t.option,rule:t.FormData.rule,"handle-icon":"false"},on:{submit:t.onSubmit}}):t._e()],1)],1)},s=[],i=a("c80c"),o=(a("96cf"),a("3b8d")),r=(a("ac6a"),a("30ba")),c=a.n(r),u=a("b7be"),d=a("0c6d"),l=a("83d6"),h={name:"CreatCoupon",data:function(){return{option:{form:{labelWidth:"150px"},submitBtn:{loading:!1},global:{upload:{props:{onSuccess:function(t,e){200===t.status&&(e.url=t.data.src)}}}}},FormData:null,loading:!1,titles:""}},components:{formCreate:c.a.$form()},mounted:function(){this.getFrom()},watch:{"$route.path":{handler:function(){this.getFrom()},immediate:!1,deep:!0}},methods:{setTagsViewTitle:function(){this.deepTraversal(this.menuList,"children");var t=Object.assign({},this.tempRoute,{title:this.titles});this.$store.dispatch("tagsView/updateVisitedView",t)},deepTraversal:function(t,e){var a=this;function n(t){t.forEach((function(t){-1===t.path.indexOf("Basics")||t.path!==a.$route.path?t[e]&&t[e].length&&n(t[e]):a.titles=t.title}))}n(t)},getFrom:function(){var t=this;this.loading=!0,Object(u["K"])().then(function(){var e=Object(o["a"])(Object(i["a"])().mark((function e(a){return Object(i["a"])().wrap((function(e){while(1)switch(e.prev=e.next){case 0:t.FormData=a.data,t.loading=!1,t.$store.dispatch("settings/setEdit",!0);case 3:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}()).catch((function(e){t.$message.error(e.message),t.loading=!1}))},onSubmit:function(t){var e=this;this.$refs.fc.$f.btn.loading(!0),d["a"][this.FormData.method.toLowerCase()](this.FormData.api,t).then((function(t){e.$refs.fc.$f.btn.loading(!1),e.$message.success(t.message||"提交成功"),e.$store.dispatch("settings/setEdit",!1),e.$router.push({path:"".concat(l["roterPre"],"/marketing/studio/list")})})).catch((function(t){e.$refs.fc.$f.btn.loading(!1),e.$message.error(t.message||"提交失败")}))}}},f=h,m=a("2877"),p=Object(m["a"])(f,n,s,!1,null,"4d6c1e76",null);e["default"]=p.exports}}]);
|