You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
1 lines
2.7 KiB
1 lines
2.7 KiB
(window["webpackJsonp"]=window["webpackJsonp"]||[]).push([["chunk-38f8a240"],{"57f8":function(e,t,n){"use strict";var a=n("dfff"),r=n.n(a);r.a},dfff:function(e,t,n){},f926:function(e,t,n){"use strict";n.r(t);var a=function(){var e=this,t=e.$createElement,n=e._self._c||t;return n("div",{staticClass:"container"},[n("div",{staticClass:"toolbar"},[n("el-button",{attrs:{type:"primary",size:"mini"},on:{click:e.saveDiyComponent}},[e._v("保存")])],1),n("CreationCampComponent",{staticClass:"right-content"})],1)},r=[],o=(n("d81d"),n("b0c0"),n("96cf"),n("1da1")),i=n("5530"),c=n("2f62"),s=n("b3f3"),u=n("161d"),m=n("6d0e"),p={components:{CreationCampComponent:s["a"]},data:function(){return{customParams:{current:1,map:{},model:{config:"",isCustom:!0,isDelete:0,name:""},order:"descending",size:100,sort:"id"},componentTemplateId:null,currentId:""}},computed:Object(i["a"])({},Object(c["c"])("creationCamp",["diyComponents"])),beforeDestroy:function(){this.initComponents([])},created:function(){this.init(),this.getTemplatePage()},methods:Object(i["a"])(Object(i["a"])({},Object(c["b"])("creationCamp",["initComponents","initTemplatePage","clearFooterComponents"])),{},{init:function(){var e=this;return Object(o["a"])(regeneratorRuntime.mark((function t(){var n,a,r,o,i;return regeneratorRuntime.wrap((function(t){while(1)switch(t.prev=t.next){case 0:if(e.clearFooterComponents(),e.initComponents([]),e.currentId=e.$route.params.id,e.currentId){t.next=5;break}return t.abrupt("return",!1);case 5:return t.next=7,u["a"].getCmsTemplate(e.currentId);case 7:n=t.sent,a=n.data.data,r=a.config,o=[];try{i=JSON.parse(r),o=i instanceof Array?i:[]}catch(c){o=[]}e.initComponents(o),e.componentTemplateId=a.id;case 14:case"end":return t.stop()}}),t)})))()},getTemplatePage:function(){var e=this;return Object(o["a"])(regeneratorRuntime.mark((function t(){var n,a,r;return regeneratorRuntime.wrap((function(t){while(1)switch(t.prev=t.next){case 0:return t.next=2,m["a"].cmsTemplatePage(e.customParams);case 2:n=t.sent,a=n.data.data.records||[],r=a.map((function(e){var t=e.name,n=e.config;return{value:n,label:t}})),e.initTemplatePage(r);case 6:case"end":return t.stop()}}),t)})))()},saveDiyComponent:function(){var e=this;return Object(o["a"])(regeneratorRuntime.mark((function t(){var n,a,r,o;return regeneratorRuntime.wrap((function(t){while(1)switch(t.prev=t.next){case 0:return n=JSON.stringify(e.diyComponents),t.next=3,u["a"].updateTemplate({config:n,id:e.componentTemplateId});case 3:a=t.sent,r=a.data,o=r.code,0===o&&e.$message({message:e.$t("tips.saveSuccess"),type:"success"});case 7:case"end":return t.stop()}}),t)})))()}})},d=p,f=(n("57f8"),n("2877")),l=Object(f["a"])(d,a,r,!1,null,"a30766f6",null);t["default"]=l.exports}}]); |