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
3.2 KiB

(window["webpackJsonp"]=window["webpackJsonp"]||[]).push([["chunk-5d2efc9f"],{4191: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:"applet-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)},o=[],r=(n("99af"),n("4de4"),n("7db0"),n("4160"),n("d81d"),n("b0c0"),n("159b"),n("96cf"),n("1da1")),i=n("5530"),s=n("2f62"),c=n("b3f3"),m=n("161d"),u=n("6d0e"),p={components:{CreationCampComponent:c["a"]},data:function(){return{customParams:{current:1,map:{},model:{config:"",isCustom:!0,isDelete:0,name:""},order:"descending",size:100,sort:"id"},componentTemplateId:null}},computed:Object(i["a"])({},Object(s["c"])("creationCamp",["diyComponents","footerComponent"])),beforeDestroy:function(){this.initComponents([])},created:function(){this.init(),this.getTemplatePage()},methods:Object(i["a"])(Object(i["a"])({},Object(s["b"])("creationCamp",["initComponents","initTemplatePage","setFooterComponents","initFooterComponents"])),{},{init:function(){var e=this;return Object(r["a"])(regeneratorRuntime.mark((function t(){var n,a,o,r,i,s,c;return regeneratorRuntime.wrap((function(t){while(1)switch(t.prev=t.next){case 0:return t.next=2,m["a"].getPlatformTemplate();case 2:n=t.sent,a=n.data.data,o=a.config,r=[];try{i=JSON.parse(o),r=i instanceof Array?i:[]}catch(u){r=[]}s=r.find((function(e){return"Footer"===e.keyCode})),s?(c=s.content,e.setFooterComponents(c)):e.initFooterComponents(),r=r.filter((function(e){return"Footer"!==e.keyCode})),e.initComponents(r),e.componentTemplateId=a.id;case 12:case"end":return t.stop()}}),t)})))()},getTemplatePage:function(){var e=this;return Object(r["a"])(regeneratorRuntime.mark((function t(){var n,a,o;return regeneratorRuntime.wrap((function(t){while(1)switch(t.prev=t.next){case 0:return t.next=2,u["a"].cmsTemplatePage(e.customParams);case 2:n=t.sent,a=n.data.data.records||[],o=a.map((function(e){var t=e.name,n=e.id;return{value:n,label:t,isCustom:!0}})),e.initTemplatePage(o);case 6:case"end":return t.stop()}}),t)})))()},saveDiyComponent:function(){var e=this;return Object(r["a"])(regeneratorRuntime.mark((function t(){var n,a,o,r,i,s,c;return regeneratorRuntime.wrap((function(t){while(1)switch(t.prev=t.next){case 0:if(n={keyCode:"Footer",name:"底部导航",content:e.footerComponent},a=e.diyComponents.concat(n),o=!1,r=JSON.stringify(a),a.length&&a.forEach((function(t){var n=t.content;if(n.list&&!n.list.length||n.goodsList&&!n.goodsList.length||n.categoryList&&!n.categoryList.length)return o=!0,e.$message({message:"".concat(t.name,"组件内容不能为空"),type:"error"})})),!o){t.next=7;break}return t.abrupt("return");case 7:return t.next=9,m["a"].updateTemplate({config:r,sCustom:!1,id:e.componentTemplateId});case 9:i=t.sent,s=i.data,c=s.code,0===c&&e.$message({message:e.$t("tips.saveSuccess"),type:"success"});case 13:case"end":return t.stop()}}),t)})))()}})},d=p,f=(n("dde9"),n("2877")),l=Object(f["a"])(d,a,o,!1,null,"a4e1da3e",null);t["default"]=l.exports},dde9:function(e,t,n){"use strict";var a=n("fffe"),o=n.n(a);o.a},fffe:function(e,t,n){}}]);