1 line
13 KiB
JavaScript
1 line
13 KiB
JavaScript
(window["webpackJsonp"]=window["webpackJsonp"]||[]).push([["chunk-274abd28"],{3770:function(t,e,a){},"5c62":function(t,e,a){"use strict";a.r(e);var i=function(){var t=this,e=t.$createElement,a=t._self._c||e;return a("div",{staticClass:"divBox"},[a("el-card",{staticClass:"box-card"},[a("div",{staticClass:"mb20"},[a("el-button",{attrs:{size:"small",type:"primary"},on:{click:t.onAdd}},[t._v("添加专场")])],1),t._v(" "),a("el-table",{directives:[{name:"loading",rawName:"v-loading",value:t.loading,expression:"loading"}],attrs:{data:t.tableData.data,size:"small"}},[t._l(t.columns,(function(e,i){return a("el-table-column",{key:i,attrs:{prop:e.key,label:e.title,"min-width":e.minWidth},scopedSlots:t._u([{key:"default",fn:function(i){return[["img","image","pic"].indexOf(e.key)>-1||e.key.indexOf("pic")>-1||e.key.indexOf("img")>-1||e.key.indexOf("image")>-1||e.key.indexOf("banner")>-1?a("div",{staticClass:"demo-image__preview"},[Array.isArray(i.row[e.key])?a("div",t._l(i.row[e.key],(function(t,e){return a("span",{key:e},[a("el-image",{staticStyle:{width:"36px",height:"36px","margin-right":"5px"},attrs:{src:t}})],1)})),0):a("div",[a("el-image",{staticStyle:{width:"36px",height:"36px"},attrs:{src:i.row[e.key]}})],1)]):"type"==e.key?a("span",[t._v("\n "+t._s(1==i.row[e.key]?"小图":2==i.row[e.key]?"中图":"大图")+"\n ")]):a("span",[t._v(t._s(i.row[e.key]))])]}}],null,!0)})})),t._v(" "),a("el-table-column",{attrs:{prop:"status",label:"是否显示","min-width":"100"},scopedSlots:t._u([{key:"default",fn:function(e){return[a("el-switch",{attrs:{"active-value":1,"inactive-value":0,width:55,"active-text":"显示","inactive-text":"隐藏"},on:{change:function(a){return t.onchangeIsShow(e.row)}},model:{value:e.row.status,callback:function(a){t.$set(e.row,"status",a)},expression:"scope.row.status"}})]}}])}),t._v(" "),a("el-table-column",{attrs:{label:"操作","min-width":"100",fixed:"right"},scopedSlots:t._u([{key:"default",fn:function(e){return[a("el-button",{attrs:{type:"text",size:"small"},on:{click:function(a){return t.onEdit(e.row.group_data_id)}}},[t._v("编辑")]),t._v(" "),a("el-button",{attrs:{type:"text",size:"small"},on:{click:function(a){return t.handleDelete(e.row.group_data_id,e.$index)}}},[t._v("删除")])]}}])})],2),t._v(" "),a("div",{staticClass:"block"},[a("el-pagination",{attrs:{background:"","page-size":t.tableData.limit,"current-page":t.tableData.page,layout:"total, prev, pager, next, jumper",total:t.tableData.total},on:{"size-change":t.handleSizeChange,"current-change":t.pageChange}})],1)],1),t._v(" "),a("el-dialog",{attrs:{title:t.titles,visible:t.dialogVisible,width:"650px","before-close":t.handleClose,"append-to-body":!0},on:{"update:visible":function(e){t.dialogVisible=e}}},[a("el-form",{directives:[{name:"loading",rawName:"v-loading",value:t.fullscreenLoading,expression:"fullscreenLoading"}],ref:"formValidate",staticClass:"formValidate mt20",attrs:{"label-width":"120px",rules:t.ruleValidate,model:t.formValidate,size:"small"},nativeOn:{submit:function(t){t.preventDefault()}}},[a("el-form-item",{attrs:{label:"关联标签:",prop:"label_id"}},[a("el-select",{staticClass:"width100",attrs:{clearable:"",filterable:"",size:"small",placeholder:"请选择"},model:{value:t.formValidate.label_id,callback:function(e){t.$set(t.formValidate,"label_id",e)},expression:"formValidate.label_id"}},t._l(t.labelList,(function(t){return a("el-option",{key:t.id,attrs:{label:t.name,value:t.id}})})),1)],1),t._v(" "),a("el-form-item",{attrs:{label:"活动名称:",prop:"name"}},[a("el-input",{attrs:{size:"small",placeholder:"请输入活动名称"},model:{value:t.formValidate.name,callback:function(e){t.$set(t.formValidate,"name",e)},expression:"formValidate.name"}})],1),t._v(" "),a("el-form-item",{attrs:{label:"活动列表图:",prop:"pic"}},[a("div",{staticClass:"acea-row row-middle"},[a("div",{staticClass:"upLoadPicBox mr15",attrs:{title:"710*340px"},on:{click:function(e){return t.modalPicTap("1",0)}}},[t.formValidate.pic?a("div",{staticClass:"pictrue"},[a("img",{attrs:{src:t.formValidate.pic}})]):a("div",{staticClass:"upLoad"},[a("i",{staticClass:"iconfont iconjiahao"})])]),t._v(" "),a("div",{staticStyle:{color:"#ccc","font-size":"12px"}},[t._v("\n 建议尺寸710*340px\n "),a("el-popover",{attrs:{placement:"bottom",title:"","min-width":"200",trigger:"hover"}},[a("img",{staticStyle:{height:"270px"},attrs:{src:t.baseURL+"/statics/system/topic94_01.jpg",alt:""}}),t._v(" "),a("el-button",{attrs:{slot:"reference",type:"text"},slot:"reference"},[t._v("查看示例")])],1)],1)])]),t._v(" "),a("el-form-item",{attrs:{label:"活动轮播图:"}},[a("div",{staticClass:"acea-row row-middle"},[a("div",{staticClass:"acea-row"},[t._l(t.formValidate.banner,(function(e,i){return a("div",{key:i,staticClass:"pictrue"},[a("img",{attrs:{src:e}}),t._v(" "),a("i",{staticClass:"el-icon-error btndel",on:{click:function(e){return t.handleRemove(i)}}})])})),t._v(" "),t.formValidate.banner.length<5?a("div",{staticClass:"upLoadPicBox mr15",on:{click:function(e){return t.modalPicTap("2")}}},[a("div",{staticClass:"upLoad"},[a("i",{staticClass:"iconfont iconjiahao"})])]):t._e()],2),t._v(" "),a("div",{staticStyle:{color:"#ccc","font-size":"12px"}},[t._v("\n 建议尺寸750*750px\n "),a("el-popover",{attrs:{placement:"bottom",title:"","min-width":"200",trigger:"hover"}},[a("img",{staticStyle:{height:"270px"},attrs:{src:t.baseURL+"/statics/system/topic94_02.jpg",alt:""}}),t._v(" "),a("el-button",{attrs:{slot:"reference",type:"text"},slot:"reference"},[t._v("查看示例")])],1)],1)])]),t._v(" "),a("el-form-item",{attrs:{label:"活动主题:",prop:"image"}},[a("div",{staticClass:"acea-row row-middle"},[a("div",{staticClass:"upLoadPicBox mr15",attrs:{title:"710*340px"},on:{click:function(e){return t.modalPicTap("1",1)}}},[t.formValidate.image?a("div",{staticClass:"pictrue"},[a("img",{attrs:{src:t.formValidate.image}})]):a("div",{staticClass:"upLoad"},[a("i",{staticClass:"iconfont iconjiahao"})])]),t._v(" "),a("div",{staticStyle:{color:"#ccc","font-size":"12px"}},[t._v("\n 建议尺寸710*340px\n "),a("el-popover",{attrs:{placement:"bottom",title:"","min-width":"200",trigger:"hover"}},[a("img",{staticStyle:{height:"270px"},attrs:{src:t.baseURL+"/statics/system/topic94_03.jpg",alt:""}}),t._v(" "),a("el-button",{attrs:{slot:"reference",type:"text"},slot:"reference"},[t._v("查看示例")])],1)],1)])]),t._v(" "),a("el-form-item",{attrs:{label:"活动背景色:"}},[a("div",{staticClass:"acea-row row-middle"},[a("el-color-picker",{model:{value:t.formValidate.color,callback:function(e){t.$set(t.formValidate,"color",e)},expression:"formValidate.color"}})],1),t._v(" "),a("div",{staticStyle:{color:"#ccc","font-size":"12px"}},[t._v("\n 若未设置背景色,则为默认色\n "),a("el-popover",{attrs:{placement:"bottom",title:"","min-width":"200",trigger:"hover"}},[a("img",{staticStyle:{height:"270px"},attrs:{src:t.baseURL+"/statics/system/topic94_04.jpg",alt:""}}),t._v(" "),a("el-button",{attrs:{slot:"reference",type:"text"},slot:"reference"},[t._v("查看示例")])],1)],1)]),t._v(" "),a("el-form-item",{attrs:{label:"商品布局:"}},[a("el-radio-group",{model:{value:t.formValidate.type,callback:function(e){t.$set(t.formValidate,"type",e)},expression:"formValidate.type"}},[a("el-radio",{attrs:{label:1}},[t._v("小图")]),t._v(" "),a("el-radio",{attrs:{label:2}},[t._v("中图")]),t._v(" "),a("el-radio",{attrs:{label:3}},[t._v("大图")])],1)],1),t._v(" "),a("el-form-item",{attrs:{label:"是否显示:"}},[a("el-switch",{attrs:{width:60,"active-value":1,"inactive-value":0,"active-text":"开启","inactive-text":"关闭"},model:{value:t.formValidate.status,callback:function(e){t.$set(t.formValidate,"status",e)},expression:"formValidate.status"}})],1),t._v(" "),a("el-form-item",{attrs:{label:"排序:"}},[a("el-input-number",{staticStyle:{width:"200px"},attrs:{placeholder:"请输入排序序号","controls-position":"right"},model:{value:t.formValidate.sort,callback:function(e){t.$set(t.formValidate,"sort",e)},expression:"formValidate.sort"}})],1)],1),t._v(" "),a("span",{staticClass:"dialog-footer",attrs:{slot:"footer"},slot:"footer"},[a("el-button",{attrs:{size:"small"},on:{click:function(e){t.dialogVisible=!1}}},[t._v("取 消")]),t._v(" "),a("el-button",{attrs:{type:"primary",size:"small"},on:{click:function(e){return t.handleSubmit("formValidate")}}},[t._v("确 定")])],1)],1)],1)},l=[],s=(a("c5f6"),a("55dd"),a("c80c")),r=(a("96cf"),a("3b8d")),o=(a("7f7f"),a("ac6a"),a("8593")),n=a("c4c8"),c=a("bbcc"),d={name:"Data",data:function(){return{baseURL:c["a"].httpUrl||"http://localhost:8080",tableData:{page:1,limit:20,data:[],total:0},loading:!1,groupId:null,groupDetail:null,dialogVisible:!1,fullscreenLoading:!1,titles:"",topicId:"",ruleValidate:{activity_name:[{required:!0,message:"请输入活动名称",trigger:"blur"}],pic:[{required:!0,message:"请上传活动背景图",trigger:"change"}],label_id:[{required:!0,message:"请选择关联标签",trigger:"change"}]},labelList:[],formValidate:{status:1,type:1,banner:[],image:"",pic:"",label_id:"",name:"",color:"",sort:""}}},computed:{columns:function(){if(!this.groupDetail)return[];var t=[{title:"ID",key:"group_data_id",minWidth:60}];return this.groupDetail.fields.forEach((function(e){t.push({title:e.name,key:e.field,minWidth:80})})),t.push({title:"添加时间",key:"create_time",minWidth:200}),t}},watch:{"$route.params.id":function(t){this.groupId=t},groupId:function(t){this.getGroupDetail(t)}},mounted:function(){this.groupId=this.$route.params.id,this.getLabelLst()},methods:{getGroupDetail:function(t){var e=this;Object(o["u"])(t).then((function(t){e.groupDetail=t.data,e.tableData.page=1,e.getList()}))},getList:function(){var t=this;this.loading=!0,Object(o["t"])(this.$route.params.id,this.tableData.page,this.tableData.limit).then((function(e){t.tableData.data=e.data.list,t.tableData.total=e.data.count,t.loading=!1})).catch((function(e){t.loading=!1,t.$message.error(e.message)}))},pageChange:function(t){this.tableData.page=t,this.getList()},handleSizeChange:function(t){this.tableData.limit=t,this.getList()},onAdd:function(){this.titles="添加专场",this.topicId="",this.dialogVisible=!0,this.formValidate={status:1,type:1,banner:[],image:"",pic:"",label_id:"",name:"",color:"",sort:""}},getLabelLst:function(){var t=this;Object(n["A"])().then((function(e){t.labelList=e.data})).catch((function(e){t.$message.error(e.message)}))},modalPicTap:function(t,e,a){var i=this;this.$modalUpload((function(a){"1"===t&&(0==e?i.formValidate.pic=a[0]:i.formValidate.image=a[0]),"2"===t&&a.map((function(t){i.formValidate.banner.push(t),i.formValidate.banner.length>5&&(i.formValidate.banner.length=5)}))}),t)},handleRemove:function(t){this.formValidate.banner.splice(t,1)},handleSubmit:function(t){var e=this;this.$refs[t].validate((function(t){t&&(e.fullscreenLoading=!0,e.topicId?Object(o["M"])(e.groupId,e.topicId,e.formValidate).then(function(){var t=Object(r["a"])(Object(s["a"])().mark((function t(a){return Object(s["a"])().wrap((function(t){while(1)switch(t.prev=t.next){case 0:e.fullscreenLoading=!1,e.$message.success(a.message),e.dialogVisible=!1,e.getList();case 4:case"end":return t.stop()}}),t)})));return function(e){return t.apply(this,arguments)}}()).catch((function(t){e.fullscreenLoading=!1,e.$message.error(t.message)})):Object(o["K"])(e.groupId,e.formValidate).then(function(){var t=Object(r["a"])(Object(s["a"])().mark((function t(a){return Object(s["a"])().wrap((function(t){while(1)switch(t.prev=t.next){case 0:e.fullscreenLoading=!1,e.$message.success(a.message),e.dialogVisible=!1,e.getList();case 4:case"end":return t.stop()}}),t)})));return function(e){return t.apply(this,arguments)}}()).catch((function(t){e.fullscreenLoading=!1,e.$message.error(t.message)})))}))},handleClose:function(){this.dialogVisible=!1},onEdit:function(t){var e=this;Object(o["L"])(t).then(function(){var a=Object(r["a"])(Object(s["a"])().mark((function a(i){var l;return Object(s["a"])().wrap((function(a){while(1)switch(a.prev=a.next){case 0:e.topicId=t,e.titles="编辑专场",e.dialogVisible=!0,l=i.data.value,e.formValidate={sort:i.data.sort,status:i.data.status,type:Number(i.data.value.type),banner:l.banner,image:l.image,pic:l.pic,label_id:l.label_id,name:l.name,color:l.color};case 5:case"end":return a.stop()}}),a)})));return function(t){return a.apply(this,arguments)}}()).catch((function(t){e.$message.error(t.message)}))},onchangeIsShow:function(t){var e=this;Object(o["s"])(t.group_data_id,t.status).then((function(t){var a=t.message;e.$message.success(a)})).catch((function(t){var a=t.message;e.$message.error(a)}))},handleDelete:function(t,e){var a=this;this.$modalSure("删除该专场").then((function(){Object(o["o"])(t).then((function(t){var i=t.message;a.$message.success(i),a.tableData.data.splice(e,1)})).catch((function(t){var e=t.message;a.$message.error(e)}))}))}}},u=d,m=(a("e933"),a("2877")),p=Object(m["a"])(u,i,l,!1,null,"2313fe86",null);e["default"]=p.exports},e933:function(t,e,a){"use strict";a("3770")}}]); |