1 line
9.4 KiB
JavaScript
1 line
9.4 KiB
JavaScript
(window["webpackJsonp"]=window["webpackJsonp"]||[]).push([["chunk-6e1e6edf"],{"0d21":function(e,t,a){},2045:function(e,t,a){"use strict";var n=a("3703"),r=a.n(n);r.a},"2ee5":function(e,t,a){e.exports=a.p+"static/img/gz.6514d1ea.png"},3703:function(e,t,a){},"762f":function(e,t,a){"use strict";a.d(t,"d",(function(){return r})),a.d(t,"a",(function(){return i})),a.d(t,"c",(function(){return s})),a.d(t,"b",(function(){return c}));var n=a("b775");function r(e){return Object(n["a"])({url:"channel/drag/get-drag-list",method:"get",params:e})}function i(e){return Object(n["a"])({url:"channel/drag/change-drag",method:"post",data:e})}function s(e){return Object(n["a"])({url:"channel/drag/drag-save",method:"post",data:e})}function c(e){return Object(n["a"])({url:"channel/drag/drag-del",method:"post",data:e})}},"81f7":function(e,t,a){e.exports=a.p+"static/img/sy.a74c0550.png"},"82c7":function(e,t,a){"use strict";var n=a("0d21"),r=a.n(n);r.a},b9ca:function(e,t,a){e.exports=a.p+"static/img/zy.e10c982f.png"},c152:function(e,t,a){"use strict";a.r(t);var n=function(){var e=this,t=e.$createElement,a=e._self._c||t;return a("div",{staticClass:"outmain ba_f"},[a("el-tabs",{on:{"tab-click":e.handleClick},model:{value:e.activeName,callback:function(t){e.activeName=t},expression:"activeName"}},[a("el-tab-pane",{attrs:{label:"装修列表",name:"1"}})],1),a("div",{staticClass:"flex-bet mar_t20 pad_lr_20"},[a("div",[a("el-button",{attrs:{type:"primary",size:"medium"},on:{click:e.handleEdit}},[e._v("添加页面")])],1),a("div")]),a("div",{staticClass:"tabledata mar_t20"},[a("el-table",{directives:[{name:"loading",rawName:"v-loading",value:e.listLoading,expression:"listLoading"}],staticStyle:{width:"100%"},attrs:{data:e.list,"element-loading-text":e.elementLoadingText,stripe:""}},[a("el-table-column",{attrs:{prop:"sort",label:"排序"}}),a("el-table-column",{attrs:{prop:"name",label:"页面名称"}}),a("el-table-column",{attrs:{prop:"page",label:"页面类型"},scopedSlots:e._u([{key:"default",fn:function(t){return[a("div",["1"==t.row.page?a("div",[a("el-tag",{attrs:{effect:"dark",size:"mini"}},[e._v("门店首页")])],1):e._e(),"2"==t.row.page?a("div",[a("el-tag",{attrs:{effect:"dark",type:"success",size:"mini"}},[e._v("个人中心")])],1):e._e(),"3"==t.row.page?a("div",[a("el-tag",{attrs:{effect:"dark",type:"warning",size:"mini"}},[e._v("自定义页面")])],1):e._e()])]}}])}),a("el-table-column",{attrs:{prop:"changeAt",label:"修改时间"}}),a("el-table-column",{attrs:{prop:"display",label:"状态"},scopedSlots:e._u([{key:"default",fn:function(t){return[a("el-switch",{attrs:{"active-value":"1","inactive-value":"2"},on:{change:function(a){return e.changeSwitch(t.row)}},model:{value:t.row.display,callback:function(a){e.$set(t.row,"display",a)},expression:"scope.row.display"}})]}}])}),a("el-table-column",{attrs:{label:"操作"},scopedSlots:e._u([{key:"default",fn:function(t){return[a("div",{staticClass:"flex"},[a("el-button",{attrs:{type:"text"},on:{click:function(a){return e.handleEdit(t.row)}}},[e._v("编辑")]),a("el-button",{attrs:{type:"text"},on:{click:function(a){return e.handleEditClick(t.row)}}},[e._v("装修")]),a("el-button",{attrs:{type:"text"},on:{click:function(a){return e.handleDelete(t.row)}}},[e._v("删除")])],1)]}}])})],1),a("el-pagination",{attrs:{background:"",layout:"prev, pager, next",total:e.page.total,"page-size":e.page.size,"current-page":e.page.currentPage},on:{"update:currentPage":function(t){return e.$set(e.page,"currentPage",t)},"update:current-page":function(t){return e.$set(e.page,"currentPage",t)},"current-change":e.handleCurrentChange}}),a("edit",{ref:"edit",on:{fetchData:e.fetchData}})],1)],1)},r=[],i=(a("d81d"),a("b0c0"),a("ac1f"),a("466d"),a("96cf"),a("1da1")),s=function(){var e=this,t=e.$createElement,a=e._self._c||t;return a("div",{},[a("el-dialog",{attrs:{title:e.title,visible:e.dialogFormVisible,width:"800px","close-on-click-modal":!1},on:{"update:visible":function(t){e.dialogFormVisible=t},close:e.close}},[a("el-form",{ref:"form",attrs:{model:e.form,"label-width":"120px"}},[a("el-form-item",{directives:[{name:"show",rawName:"v-show",value:"编辑"!=e.title,expression:"title!='编辑'"}],attrs:{label:"页面类型",prop:"page"}},[a("div",{staticClass:"flex"},e._l(e.typeMod,(function(t,n){return a("div",{key:n,staticClass:"pageType",class:{menu_active:n==e.current},on:{click:function(t){return e.selectType(n)}}},[a("i",{directives:[{name:"show",rawName:"v-show",value:n==e.current,expression:"index==current"}],staticClass:"check-icon iconfont iconcheck-icon"}),a("div",{staticClass:"type-container"},[a("img",{staticClass:"wid hei",attrs:{src:t.img}})]),a("div",{staticClass:"typeText"},[a("span",{staticClass:"wei fon_14"},[e._v(e._s(t.name))])])])})),0)]),a("el-form-item",{attrs:{label:"排序",prop:"sort"}},[a("el-input",{attrs:{autocomplete:"off",placeholder:"请输入排序",type:"number"},model:{value:e.form.sort,callback:function(t){e.$set(e.form,"sort","string"===typeof t?t.trim():t)},expression:"form.sort"}})],1),a("el-form-item",{attrs:{label:"页面名称",prop:"name"}},[a("el-input",{attrs:{autocomplete:"off",placeholder:"请输入页面名称"},model:{value:e.form.name,callback:function(t){e.$set(e.form,"name","string"===typeof t?t.trim():t)},expression:"form.name"}})],1)],1),a("div",{staticClass:"dialog-footer",attrs:{slot:"footer"},slot:"footer"},[a("el-button",{attrs:{size:"medium"},on:{click:e.close}},[e._v("取 消")]),a("el-button",{attrs:{size:"medium",type:"primary"},on:{click:e.save}},[e._v("确 定")])],1)],1)],1)},c=[],o=a("762f"),l={name:"labelSave",created:function(){},data:function(){return{current:0,form:{id:"",sort:"1",name:"",type:"",page:""},title:"",dialogFormVisible:!1,typeMod:[{id:"1",icon:"1",name:"首页",img:a("81f7")},{id:"2",icon:"2",name:"个人中心",img:a("2ee5")},{id:"3",icon:"3",name:"自定义页面",img:a("b9ca")}]}},components:{},methods:{showEdit:function(e){e?(this.title="编辑",this.form=Object.assign({},e)):this.title="添加",this.dialogFormVisible=!0},close:function(){this.$refs["form"].resetFields(),this.form=this.$options.data().form,this.dialogFormVisible=!1},selectType:function(e){this.current=e,this.form.page=e},save:function(){var e=this;this.$refs["form"].validate(function(){var t=Object(i["a"])(regeneratorRuntime.mark((function t(a){var n,r,i;return regeneratorRuntime.wrap((function(t){while(1)switch(t.prev=t.next){case 0:if(!a){t.next=14;break}return e.form.page=e.current+1,n={},n=Object.assign({},e.form),"编辑"==e.title&&(delete n.page,console.log(n)),t.next=7,Object(o["c"])(n);case 7:r=t.sent,i=r.msg,e.$baseMessage(i,"success"),e.$emit("fetchData"),e.close(),t.next=15;break;case 14:return t.abrupt("return",!1);case 15:case"end":return t.stop()}}),t)})));return function(e){return t.apply(this,arguments)}}())}}},u=l,d=(a("2045"),a("2877")),f=Object(d["a"])(u,s,c,!1,null,"5a625518",null),m=f.exports,p=a("365c"),g={components:{Edit:m},created:function(){this.fetchData()},data:function(){return{list:[],selectRows:"",elementLoadingText:"正在加载...",page:{total:0,size:10,currentPage:1},activeName:"1",formInline:{name:"",display:"",page_type:"1",id:"22"},options:[{label:"全部",value:"1"},{label:"应用中",value:"2"},{label:"未应用",value:"3"}]}},methods:{handleClick:function(){this.fetchData(),"2"==this.activeName&&this.$router.push("/templatemall")},handleEditClick:function(e){var t="https://bkycms.com/addons/yb_wm/views/common/drag/index.html",a=p["a"].isDev?t:location.href.match(/(\S*)views/)[1]+"views/common/drag/index.html";window.open(a+"?page="+e.page+"&id="+e.id+"&name="+e.name,"_blank")},onSearch:function(){this.fetchData()},fetchData:function(){var e=this;return Object(i["a"])(regeneratorRuntime.mark((function t(){var a,n,r,i;return regeneratorRuntime.wrap((function(t){while(1)switch(t.prev=t.next){case 0:return e.listLoading=!0,a={page:e.page.currentPage,name:e.formInline.name,display:e.formInline.display},t.next=4,Object(o["d"])(a);case 4:n=t.sent,r=n.data,i=n.count,e.list=r,e.page.total=i,e.listLoading=!1;case 10:case"end":return t.stop()}}),t)})))()},setSelectRows:function(e){this.selectRows=e},handleEdit:function(e){e.id?this.$refs["edit"].showEdit(e):this.$refs["edit"].showEdit()},handleDelete:function(e){var t=this;if(e.id)this.$baseConfirm("你确定要删除当前项吗",null,Object(i["a"])(regeneratorRuntime.mark((function a(){var n,r;return regeneratorRuntime.wrap((function(a){while(1)switch(a.prev=a.next){case 0:return a.next=2,Object(o["b"])({id:e.id});case 2:n=a.sent,r=n.msg,t.$baseMessage(r,"success"),t.fetchData();case 6:case"end":return a.stop()}}),a)}))));else{if(!(this.selectRows.length>0))return this.$baseMessage("未选中任何行","error"),!1;var a=this.selectRows.map((function(e){return e.id}));this.$baseConfirm("你确定要删除选中项吗",null,Object(i["a"])(regeneratorRuntime.mark((function e(){var n,r;return regeneratorRuntime.wrap((function(e){while(1)switch(e.prev=e.next){case 0:return e.next=2,Object(o["b"])({id:a});case 2:n=e.sent,r=n.msg,t.$baseMessage(r,"success"),t.fetchData();case 6:case"end":return e.stop()}}),e)}))))}},changeSwitch:function(e){var t=this;return Object(i["a"])(regeneratorRuntime.mark((function a(){var n,r;return regeneratorRuntime.wrap((function(a){while(1)switch(a.prev=a.next){case 0:return a.next=2,Object(o["a"])({id:e.id,display:e.display});case 2:n=a.sent,r=n.msg,t.$baseMessage(r,"success"),t.fetchData();case 6:case"end":return a.stop()}}),a)})))()},handleCurrentChange:function(e){this.page.currentPage=e,this.fetchData()}}},h=g,b=(a("82c7"),Object(d["a"])(h,n,r,!1,null,"06967040",null));t["default"]=b.exports}}]); |