chunk-14445430.c6f06bf2.js
10.2 KB
(window["webpackJsonp"]=window["webpackJsonp"]||[]).push([["chunk-14445430"],{"311f":function(t,e,a){},"54a1":function(t,e,a){"use strict";var n=function(){var t=this,e=t.$createElement,a=t._self._c||e;return a("div",{staticClass:"module-box single-img"},[a("div",{staticClass:"single-img__box"},[a("el-upload",{attrs:{drag:"",action:t.fileUploadApi.fileUpload,"on-success":t.handleAvatarSuccess,"before-upload":t.beforeAvatarUpload,"show-file-list":!1}},[t.imageUrl?a("img",{staticClass:"single-img__img",attrs:{src:t.imageUrl}}):a("i",{staticClass:"el-icon-upload"},[a("div",{staticClass:"el-upload__text"},[a("em",[t._v("选择图片")])]),a("div",{staticClass:"el-upload__tip",attrs:{slot:"tip"},slot:"tip"},[t._v(t._s(t.tip))])])]),t.imageUrl?a("div",{staticClass:"overlay"},[a("i",{staticClass:"iconfont icon-chakan",on:{click:t.showImage}}),a("i",{staticClass:"iconfont icon-shanchu1",on:{click:t.delImage}})]):t._e()],1),a("el-dialog",{attrs:{title:"图片展示",visible:t.dialogVisible},on:{"update:visible":function(e){t.dialogVisible=e}}},[a("img",{attrs:{width:"100%",src:t.dialogImageUrl,alt:""}})])],1)},o=[],i=a("7a32"),s=a("f270"),l={name:"tool-single-img",mixins:[s["b"]],data:function(){return{dialogVisible:!1,dialogImageUrl:"",fileUploadApi:{fileUpload:""}}},props:{imageUrl:{type:String,default:""},tip:{type:String,default:"建议尺寸: 1080*900px, 高度自适应"}},mounted:function(){console.log(i["a"]),this.fileUploadApi=i["a"]},methods:{handleAvatarSuccess:function(t,e){this.$emit("update:imageUrl",t.data.url)},beforeAvatarUpload:function(t){var e=t.size/1024/1024<1;return e||this.$message.error("上传图片大小不能超过 1MB!"),e},showImage:function(){this.dialogImageUrl=this.imageUrl,this.dialogVisible=!0},delImage:function(){this.$emit("update:imageUrl","")}}},c=l,r=(a("7c05"),a("2877")),u=Object(r["a"])(c,n,o,!1,null,"7d74df17",null);e["a"]=u.exports},"607e":function(t,e,a){},"629e":function(t,e,a){"use strict";a.d(e,"a",(function(){return s}));var n=a("5530"),o=a("2f62"),i={computed:Object(n["a"])({},Object(o["b"])(["activeComponent","componentsData"])),methods:Object(n["a"])({},Object(o["c"])({setComponentsData:"SET_COMPONENTSDATA"})),beforeDestroy:function(){},watch:{"activeComponent.componentContent":{handler:function(t,e){console.log(t)},deep:!0}}},s=Object(n["a"])({},i)},"6b3f":function(t,e,a){"use strict";function n(t){for(var e=0;e<t.length;e++)0===t[e].childs.length?t[e].childs="":n(t[e].childs)}a.d(e,"a",(function(){return n}))},"7c05":function(t,e,a){"use strict";a("b57d")},"82e8":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:"categoryTool"},[a("h3",{staticClass:"toolTit"},[t._v("类别列表")]),a("div",{staticClass:"toolBox"},[a("div",{staticClass:"itemBox"},[a("label",[t._v("标题")]),a("el-input",{attrs:{placeholder:"请输入内容"},model:{value:t.activeComponent.componentContent.title,callback:function(e){t.$set(t.activeComponent.componentContent,"title",e)},expression:"activeComponent.componentContent.title"}})],1),a("tool-select",{attrs:{linkValue:t.activeComponent.componentContent.textAlign,title:"文字对齐方式",options:t.alignList},on:{"update:linkValue":function(e){return t.$set(t.activeComponent.componentContent,"textAlign",e)},"update:link-value":function(e){return t.$set(t.activeComponent.componentContent,"textAlign",e)}}}),a("div",{staticClass:"textTit"},[t._v("添加类别")]),a("div",{staticClass:"categoryListBox"},[a("draggable",{model:{value:t.activeComponent.componentContent.categoryData,callback:function(e){t.$set(t.activeComponent.componentContent,"categoryData",e)},expression:"activeComponent.componentContent.categoryData"}},t._l(t.activeComponent.componentContent.categoryData,(function(e,n){return a("div",{key:n,staticClass:"item"},[a("div",{staticClass:"listItemBox"},[a("div",{staticClass:"addImgTit",on:{click:function(a){return t.openAddCategory(e,n)}}},[a("div",{staticClass:"titLeft"},[a("span",{staticClass:"iconfont"},[t._v("")]),a("span",{staticClass:"iconfont"},[t._v("")]),a("span",[t._v("类别")])]),a("div",{staticClass:"titRight"},[a("span",{staticClass:"iconfont",on:{click:function(a){return a.stopPropagation(),t.deleteItem(e,n)}}},[t._v("")]),a("span",{staticClass:"iconfont",domProps:{innerHTML:t._s(t.categoryCurrent===n?"":"")}})])]),a("div",{directives:[{name:"show",rawName:"v-show",value:t.categoryCurrent===n,expression:"categoryCurrent === index"}],staticClass:"addBox"},[a("div",{staticClass:"addContent"},[a("tool-single-img",{attrs:{imageUrl:e.img,tip:"建议尺寸5:4等比例图片"},on:{"update:imageUrl":function(a){return t.$set(e,"img",a)},"update:image-url":function(a){return t.$set(e,"img",a)}}}),e.selClassData.categoryName?a("div",{staticClass:"categoryName"},[a("span",[t._v(t._s(e.selClassData.categoryName))]),a("div",{staticClass:"operation"},[a("span",{staticClass:"iconfont",on:{click:function(e){return t.replaceCategory(n)}}},[t._v("")]),a("span",{staticClass:"iconfont",on:{click:function(e){return t.deleteCategory(n)}}},[t._v("")])])]):a("div",{staticClass:"addCategoryBox",on:{click:function(a){return t.addItemCategory(e,n)}}},[a("span",{staticClass:"iconfont"},[t._v("")]),t._v("添加类别")])],1),a("div",{staticClass:"deleteItem",on:{click:function(a){return t.deleteItem(e,n)}}},[a("span",{staticClass:"iconfont"},[t._v("")]),t._v("删除内容")])])])])})),0)],1)],1),a("div",{directives:[{name:"show",rawName:"v-show",value:t.activeComponent.componentContent.categoryData.length<6,expression:"activeComponent.componentContent.categoryData.length < 6"}],staticClass:"addImgBtn",on:{click:t.addCategory}},[a("span",{staticClass:"iconfont"},[t._v("")]),t._v("添加类别")]),a("div",{directives:[{name:"show",rawName:"v-show",value:6===t.activeComponent.componentContent.categoryData.length,expression:"activeComponent.componentContent.categoryData.length === 6"}],staticClass:"addImgBtn"},[a("span",{staticClass:"iconfont"},[t._v("")]),t._v("最多只能添加6个")]),a("el-dialog",{attrs:{title:"提示",visible:t.dialogVisible,width:"30%","before-close":t.deleteItem},on:{"update:visible":function(e){t.dialogVisible=e}}},[a("span",[t._v("点击确定删除此项")]),a("span",{staticClass:"dialog-footer",attrs:{slot:"footer"},slot:"footer"},[a("el-button",{on:{click:function(e){t.dialogVisible=!1}}},[t._v("取 消")]),a("el-button",{attrs:{type:"primary"},on:{click:function(e){t.dialogVisible=!1}}},[t._v("确 定")])],1)]),a("el-dialog",{attrs:{title:"选择类别",visible:t.dialogCategory,width:"480px"},on:{"update:visible":function(e){t.dialogCategory=e}}},[a("category-select",{ref:"categorySelect"}),a("span",{staticClass:"dialog-footer",attrs:{slot:"footer"},slot:"footer"},[a("el-button",{on:{click:function(e){t.dialogCategory=!1}}},[t._v("取 消")]),a("el-button",{attrs:{type:"primary"},on:{click:t.categoryChanged}},[t._v("确 定")])],1)],1)],1)},o=[],i=(a("a434"),a("b76a")),s=a.n(i),l=a("629e"),c=a("9644"),r=a("54a1"),u=a("f6af"),d={mixins:[l["a"]],name:"categoryTool",components:{ToolSelect:u["a"],ToolSingleImg:r["a"],CategorySelect:c["a"],Draggable:s.a},data:function(){return{title:"",alignList:[{id:1,label:"居左",value:"left"},{id:2,label:"居中",value:"center"},{id:3,label:"居右",value:"right"}],textAlign:"left",categoryCurrent:null,dialogVisible:!1,dialogCategory:!1,currentCategory:null}},computed:{},methods:{openAddCategory:function(t,e){if(this.categoryCurrent===e)return this.categoryCurrent=null,!1;this.categoryCurrent=e},addCategory:function(){this.activeComponent.componentContent.categoryData.push({selClassData:[],img:""})},deleteItem:function(t,e){var a=this;this.$confirm("确定删除此项?").then((function(t){a.activeComponent.componentContent.categoryData.splice(e,1)})).catch((function(t){}))},addItemCategory:function(t,e){this.dialogCategory=!0,this.categoryCurrent=e},replaceCategory:function(t){this.dialogCategory=!0,this.categoryCurrent=t,console.log(this.categoryCurrent)},deleteCategory:function(t){this.activeComponent.componentContent.categoryData[t].selClassData=""},categoryChanged:function(){var t=this.$refs.categorySelect.$refs["cascader"].getCheckedNodes();if(console.log(t,this.categoryCurrent),t){var e=t[0].data;this.dialogCategory=!1,this.activeComponent.componentContent.categoryData[this.categoryCurrent].id=e.id,this.activeComponent.componentContent.categoryData[this.categoryCurrent].selClassData=e}}}},g=d,p=(a("ab3b"),a("2877")),m=Object(p["a"])(g,n,o,!1,null,"6cbc379a",null);e["default"]=m.exports},"8ebf":function(t,e,a){"use strict";a("311f")},9644:function(t,e,a){"use strict";var n=function(){var t=this,e=t.$createElement,a=t._self._c||e;return a("el-cascader",{ref:"cascader",staticStyle:{width:"100%"},attrs:{options:t.categoryList,props:{checkStrictly:!0,label:"categoryName",value:"id",children:"childs"},clearable:""}})},o=[],i=a("7a32"),s=a("f270"),l=a("6b3f"),c={name:"category-select",mixins:[s["b"]],data:function(){return{categoryList:[]}},mounted:function(){this.getCategory()},methods:{getCategory:function(){var t=this,e={url:i["a"].getClassify,method:"GET"};this.sendReq(e,(function(e){t.categoryList=e.data,Object(l["a"])(t.categoryList)}))}}},r=c,u=a("2877"),d=Object(u["a"])(r,n,o,!1,null,null,null);e["a"]=d.exports},ab3b:function(t,e,a){"use strict";a("607e")},b57d:function(t,e,a){},f6af:function(t,e,a){"use strict";var n=function(){var t=this,e=t.$createElement,a=t._self._c||e;return a("div",{staticClass:"module-box link-select"},[a("div",{staticClass:"module-box__title"},[a("label",{staticClass:"module-box__label"},[t._v(t._s(t.title))])]),a("el-select",{staticClass:"link-select__select",attrs:{"popper-append-to-body":!1,placeholder:"请选择跳转到的页面"},on:{change:t.selectChanged},model:{value:t.selsectValue,callback:function(e){t.selsectValue=e},expression:"selsectValue"}},t._l(t.options,(function(t){return a("el-option",{key:t.value,attrs:{label:t.label,value:t.value}})})),1)],1)},o=[],i={name:"tool-select",data:function(){return{selsectValue:""}},props:{title:{type:String,default:"标题"},linkValue:{type:String,default:""},options:{type:Array,default:function(){return[]}}},mounted:function(){this.selsectValue=this.linkValue},methods:{selectChanged:function(t){this.$emit("update:linkValue",t)}}},s=i,l=(a("8ebf"),a("2877")),c=Object(l["a"])(s,n,o,!1,null,"50d1d6a7",null);e["a"]=c.exports}}]);