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.
 
 
 
 
 
crmeb_php/public/mer/js/chunk-2d0d3300.8be0cd39.js

1 lines
4.5 KiB

(window["webpackJsonp"]=window["webpackJsonp"]||[]).push([["chunk-2d0d3300"],{"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:"clearfix",attrs:{slot:"header"},slot:"header"},[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"}],staticStyle:{width:"100%"},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,"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:{"page-sizes":[20,40,60,80],"page-size":t.tableData.limit,"current-page":t.tableData.page,layout:"total, sizes, prev, pager, next, jumper",total:t.tableData.total},on:{"size-change":t.handleSizeChange,"current-change":t.pageChange}})],1)],1)],1)},n=[],s=(a("7f7f"),a("ac6a"),a("8593")),o={name:"Data",data:function(){return{tableData:{page:1,limit:20,data:[],total:0},loading:!1,groupId:null,groupDetail:null}},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},methods:{getGroupDetail:function(t){var e=this;Object(s["t"])(t).then((function(t){e.groupDetail=t.data,e.tableData.page=1,e.getList()}))},getList:function(){var t=this;this.loading=!0,Object(s["s"])(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(){var t=this;this.$modalForm(Object(s["m"])(this.$route.params.id)).then((function(){return t.getList()}))},onEdit:function(t){var e=this;this.$modalForm(Object(s["J"])(this.$route.params.id,t)).then((function(){return e.getList()}))},onchangeIsShow:function(t){var e=this;Object(s["r"])(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(s["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)}))}))}}},r=o,l=a("2877"),c=Object(l["a"])(r,i,n,!1,null,"174ef35a",null);e["default"]=c.exports}}]);