徐总多门店
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.
 
 
 
 
 
 
jiuhaoshenghuo/public/view_admin/js/chunk-30d4acac.062e2ce2.js

1 lines
13 KiB

(window.webpackJsonp=window.webpackJsonp||[]).push([["chunk-30d4acac"],{"7f9c":function(t,e,s){"use strict";s.r(e);var o=s("a34a"),a=s.n(o),l=s("2f62"),i=s("c4c8");function r(t,e,s,o,a,l,i){try{var r=t[l](i),n=r.value}catch(t){return void s(t)}r.done?e(n):Promise.resolve(n).then(o,a)}function n(t,e){var s=Object.keys(t);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(t);e&&(o=o.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),s.push.apply(s,o)}return s}function c(t,e,s){return e in t?Object.defineProperty(t,e,{value:s,enumerable:!0,configurable:!0,writable:!0}):t[e]=s,t}var u={name:"product_label",data:function(){return{grid:{xl:7,lg:7,md:12,sm:24,xs:24},loading:!1,columns1:[{type:"selection",width:100,align:"center"},{title:"标签",slot:"label_name",width:250},{title:"是否开启",slot:"status",minWidth:140,align:"center"},{title:"移动端展示",slot:"is_show",minWidth:140,align:"center"},{title:"排序",key:"sort",minWidth:100,align:"center"},{title:"创建时间",key:"add_time",minWidth:150,align:"center"},{title:"操作",slot:"action",fixed:"right",minWidth:120}],labelFrom:{page:1,limit:15,label_cate:""},labelLists:[],total:0,theme3:"light",labelSort:[],sortName:"",current:0,modals:!1,form:{id:0,label_cate:"",label_name:"",style_type:1,color:"#e93323",bg_color:"#fff",border_color:"#e93323",sort:0,is_show:1,icon:"",status:1},checkSelect:[],modalPic:!1,rules:{name:[{required:!0,message:"请输入热词名称",trigger:"blur"},{min:2,max:6,message:"长度在 2 到 6 个字符",trigger:"blur"}],label_cate:[{required:!0,message:"请选择分组"}]},isEdit:!1,ids:""}},components:{uploadPictures:s("b0e7").a},computed:function(t){for(var e=1;e<arguments.length;e++){var s=null!=arguments[e]?arguments[e]:{};e%2?n(s,!0).forEach((function(e){c(t,e,s[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(s)):n(s).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(s,e))}))}return t}({},Object(l.e)("admin/layout",["isMobile"]),{labelWidth:function(){return this.isMobile?void 0:75},labelPosition:function(){return this.isMobile?"top":"right"}}),created:function(){this.getproductLabelAll(),this.getList()},methods:{add:function(){this.modals=!0},modalPicTap:function(){this.modalPic=!0},getPic:function(t){this.modalPic=!1,this.form.icon=t.att_dir},delImage:function(){this.form.icon=""},addWordsConfirm:function(){var t=this;this.$refs.form.validate((function(e){e&&Object(i.S)(t.form).then((function(e){t.$Message.success(e.msg),t.modals=!1,t.cancel(),t.labelFrom.page=1,t.getList()})).catch((function(e){t.$Message.error(e.msg)}))}))},cancel:function(){this.form={id:0,label_cate:"",label_name:"",style_type:1,color:"#e93323",bg_color:"#ffffff",border_color:"#e93323",sort:0,is_show:1,icon:"",status:1},this.isEdit=!1},getList:function(){var t=this;this.loading=!0,Object(i.X)(this.labelFrom).then(function(){var e,s=(e=a.a.mark((function e(s){var o;return a.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:o=s.data,t.labelLists=o.list,t.total=o.count,t.loading=!1;case 4:case"end":return e.stop()}}),e)})),function(){var t=this,s=arguments;return new Promise((function(o,a){var l=e.apply(t,s);function i(t){r(l,o,a,i,n,"next",t)}function n(t){r(l,o,a,i,n,"throw",t)}i(void 0)}))});return function(t){return s.apply(this,arguments)}}()).catch((function(e){t.loading=!1,t.$Message.error(e.msg)}))},pageChange:function(t){this.labelFrom.page=t,this.getList()},onSelectTab:function(t){if(t.length){var e=[];t.forEach((function(t){e.push(t.id)})),this.ids=e.join(",")}else this.ids=""},labelDel:function(){var t=this,e={ids:this.ids,all:0,where:this.labelFrom.label_cate};this.$Modal.confirm({title:"提示",content:"<p>确定要删除吗?</p><p>删除后将无法恢复,请谨慎操作!</p>",onOk:function(){Object(i.V)(e).then((function(e){t.$Message.success(e.msg),t.labelFrom.page=1,t.getList()})).catch((function(e){t.$Message.error(e.msg)}))}})},showChange:function(t){var e=this;Object(i.Y)({id:t.id,is_show:t.is_show}).then((function(t){e.$Message.success(t.msg)})).catch((function(t){e.$Message.error(t.msg)}))},statusChange:function(t){var e=this;Object(i.Z)({id:t.id,status:t.status}).then((function(t){e.$Message.success(t.msg)})).catch((function(t){e.$Message.error(t.msg)}))},edit:function(t){var e={id:t.id,label_cate:t.label_cate,label_name:t.label_name,style_type:t.style_type,color:t.color,bg_color:t.bg_color,border_color:t.border_color,sort:t.sort,is_show:t.is_show,icon:t.icon,status:t.status};this.form=e,this.modals=!0},delLabel:function(t,e,s){var o=this,a={title:e,num:s,url:"product/label/".concat(t.id),method:"DELETE",ids:""};this.$modalSure(a).then((function(t){o.$Message.success(t.msg),o.labelLists.splice(s,1),o.getList()})).catch((function(t){o.$Message.error(t.msg)}))},getproductLabelAll:function(t){var e=this;Object(i.U)().then((function(t){t.data.list.unshift({name:"全部",id:""}),t.data.list.map((function(t){e.$set(t,"status",!1)})),e.labelSort=t.data.list}))},showMenu:function(t){this.labelSort.forEach((function(e){e.id==t.id?e.status=!t.status:e.status=!1}))},labelEdit:function(t){var e=this;this.$modalForm(Object(i.W)(t.id)).then((function(){return e.getproductLabelAll()}))},addSort:function(){var t=this;this.$modalForm(Object(i.x)()).then((function(){return t.getproductLabelAll()}))},deleteSort:function(t,e,s){var o=this,a={title:e,num:s,url:"product/label_cate/".concat(t.id),method:"DELETE",ids:""};this.$modalSure(a).then((function(t){o.$Message.success(t.msg),o.labelSort.splice(s,1),o.labelSort=[],o.getproductLabelAll()})).catch((function(t){o.$Message.error(t.msg)}))},bindMenuItem:function(t,e){this.current=e,this.labelSort.forEach((function(t){t.status=!1})),this.labelFrom.label_cate=t.id,this.getList()},synLabel:function(){}}},d=(s("dcbf"),s("2877")),m=Object(d.a)(u,(function(){var t=this,e=t.$createElement,s=t._self._c||e;return s("div",[s("Row",{staticClass:"ivu-mt box-wrapper"},[s("Col",{staticClass:"left-wrapper",attrs:{span:"3"}},[s("Menu",{attrs:{width:"auto"}},[s("MenuGroup",t._l(t.labelSort,(function(e,o){return s("MenuItem",{key:o,staticClass:"menu-item",class:o===t.current?"showOn":"",attrs:{name:e.id},nativeOn:{click:function(s){return t.bindMenuItem(e,o)}}},[t._v("\n "+t._s(e.name)+"\n "),0!=o?s("div",{staticClass:"icon-box"},[s("Icon",{attrs:{type:"ios-more",size:"24"},on:{click:function(s){return s.stopPropagation(),t.showMenu(e)}}})],1):t._e(),0!=o&&e.status?s("div",{staticClass:"right-menu ivu-poptip-inner"},[s("div",{staticClass:"ivu-poptip-body",on:{click:function(s){return t.labelEdit(e)}}},[s("div",{staticClass:"ivu-poptip-body-content"},[s("div",{staticClass:"ivu-poptip-body-content-inner"},[t._v("编辑")])])]),s("div",{staticClass:"ivu-poptip-body",on:{click:function(s){return t.deleteSort(e,"删除分类",o)}}},[s("div",{staticClass:"ivu-poptip-body-content"},[s("div",{staticClass:"ivu-poptip-body-content-inner"},[t._v("删除")])])])]):t._e()])})),1)],1)],1),s("Col",{ref:"rightBox",attrs:{span:"21"}},[s("Card",{attrs:{bordered:!1,"dis-hover":""}},[s("div",{staticClass:"flex"},[s("Button",{attrs:{type:"primary"},on:{click:t.add}},[t._v("添加标签")]),s("Button",{staticClass:"ml-14",attrs:{type:"success"},on:{click:t.addSort}},[t._v("添加分组")]),s("Button",{staticClass:"ml-14",attrs:{disabled:!t.ids.length},on:{click:t.labelDel}},[t._v("批量删除")])],1),s("Table",{ref:"table",staticClass:"mt25",attrs:{columns:t.columns1,data:t.labelLists,loading:t.loading,"highlight-row":"","no-data-text":"暂无数据","no-filtered-data-text":"暂无筛选结果"},on:{"on-selection-change":t.onSelectTab},scopedSlots:t._u([{key:"label_name",fn:function(e){var o=e.row;return e.index,[1==o.style_type?s("div",{staticClass:"words_tag",style:{backgroundColor:o.bg_color,color:o.color,border:o.border_color?"1px solid "+o.border_color:"none"}},[s("span",[t._v(t._s(o.label_name))])]):s("img",{staticClass:"tag_img",attrs:{src:o.icon}})]}},{key:"is_show",fn:function(e){var o=e.row;return e.index,[s("i-switch",{attrs:{"true-value":1,"false-value":0,size:"large"},on:{"on-change":function(e){return t.showChange(o)}},model:{value:o.is_show,callback:function(e){t.$set(o,"is_show",e)},expression:"row.is_show"}},[s("span",{attrs:{slot:"open"},slot:"open"},[t._v("开启")]),s("span",{attrs:{slot:"close"},slot:"close"},[t._v("关闭")])])]}},{key:"status",fn:function(e){var o=e.row;return e.index,[s("i-switch",{attrs:{"true-value":1,"false-value":0,size:"large"},on:{"on-change":function(e){return t.statusChange(o)}},model:{value:o.status,callback:function(e){t.$set(o,"status",e)},expression:"row.status"}},[s("span",{attrs:{slot:"open"},slot:"open"},[t._v("开启")]),s("span",{attrs:{slot:"close"},slot:"close"},[t._v("关闭")])])]}},{key:"action",fn:function(e){var o=e.row,a=e.index;return[s("a",{on:{click:function(e){return t.edit(o)}}},[t._v("修改")]),s("Divider",{attrs:{type:"vertical"}}),s("a",{on:{click:function(e){return t.delLabel(o,"删除分组",a)}}},[t._v("删除")])]}}])}),s("div",{staticClass:"acea-row row-right page"},[s("Page",{attrs:{total:t.total,"show-elevator":"","show-total":"","page-size":t.labelFrom.limit},on:{"on-change":t.pageChange}})],1)],1)],1)],1),s("Modal",{attrs:{closable:"",title:t.isEdit?"编辑标签":"添加标签","mask-closable":!1,"z-index":10,width:"560"},on:{"on-cancel":t.cancel,"on-ok":t.addWordsConfirm},model:{value:t.modals,callback:function(e){t.modals=e},expression:"modals"}},[s("div",[s("Form",{ref:"form",attrs:{size:"small",rules:t.rules,model:t.form,"label-width":100}},[s("FormItem",{attrs:{label:"标签名称:",prop:"label_name"}},[s("Input",{staticClass:"w-420",model:{value:t.form.label_name,callback:function(e){t.$set(t.form,"label_name",e)},expression:"form.label_name"}})],1),s("FormItem",{attrs:{label:"分组选择:",prop:"label_cate"}},[s("Select",{staticClass:"w-420",attrs:{clearable:""},model:{value:t.form.label_cate,callback:function(e){t.$set(t.form,"label_cate",e)},expression:"form.label_cate"}},t._l(t.labelSort.slice(1),(function(e){return s("Option",{key:e.id,attrs:{value:e.id}},[t._v(t._s(e.name))])})),1)],1),s("FormItem",{attrs:{label:"移动端开展示:"}},[s("i-switch",{attrs:{"true-value":1,"false-value":0,size:"large"},model:{value:t.form.is_show,callback:function(e){t.$set(t.form,"is_show",e)},expression:"form.is_show"}},[s("span",{attrs:{slot:"open"},slot:"open"},[t._v("开启")]),s("span",{attrs:{slot:"close"},slot:"close"},[t._v("关闭")])])],1),s("FormItem",{attrs:{label:"效果设置:"}},[s("RadioGroup",{attrs:{"true-value":1,"false-value":2},model:{value:t.form.style_type,callback:function(e){t.$set(t.form,"style_type",e)},expression:"form.style_type"}},[s("Radio",{attrs:{label:1}},[t._v("自定义")]),s("Radio",{attrs:{label:2}},[t._v("图片")])],1)],1),1==t.form.style_type?s("FormItem",{attrs:{label:"字体颜色:"}},[s("ColorPicker",{attrs:{alpha:""},model:{value:t.form.color,callback:function(e){t.$set(t.form,"color",e)},expression:"form.color"}}),s("p",{staticClass:"desc"},[t._v("若未设置颜色,则为默认色")])],1):t._e(),1==t.form.style_type?s("FormItem",{attrs:{label:"背景颜色:"}},[s("ColorPicker",{attrs:{alpha:""},model:{value:t.form.bg_color,callback:function(e){t.$set(t.form,"bg_color",e)},expression:"form.bg_color"}}),s("p",{staticClass:"desc"},[t._v("若未设置颜色,则为默认色")])],1):t._e(),1==t.form.style_type?s("FormItem",{attrs:{label:"边框颜色:"}},[s("ColorPicker",{attrs:{alpha:""},model:{value:t.form.border_color,callback:function(e){t.$set(t.form,"border_color",e)},expression:"form.border_color"}}),s("p",{staticClass:"desc"},[t._v("若未设置颜色,则无边框")])],1):t._e(),2==t.form.style_type?s("FormItem",{attrs:{label:"上传图标"}},[t.form.icon?s("div",{staticClass:"upload-list"},[s("div",{staticClass:"upload-item"},[s("img",{attrs:{src:t.form.icon}}),s("Button",{attrs:{shape:"circle",icon:"ios-close"},on:{click:t.delImage}})],1)]):s("Button",{staticClass:"upload-select",attrs:{type:"dashed",icon:"ios-add"},on:{click:function(e){return t.modalPicTap("dan","image",1)}}}),s("p",{staticClass:"desc"},[t._v("建议尺寸:80px*30px,若未上传则为空白")])],1):t._e(),s("FormItem",{attrs:{label:"排序"}},[s("InputNumber",{staticClass:"selWidth",attrs:{min:0,max:999},model:{value:t.form.sort,callback:function(e){t.$set(t.form,"sort",e)},expression:"form.sort"}})],1),s("FormItem",{attrs:{label:"是否开启:"}},[s("i-switch",{attrs:{"true-value":1,"false-value":0,size:"large"},model:{value:t.form.status,callback:function(e){t.$set(t.form,"status",e)},expression:"form.status"}},[s("span",{attrs:{slot:"open"},slot:"open"},[t._v("开启")]),s("span",{attrs:{slot:"close"},slot:"close"},[t._v("关闭")])])],1)],1)],1)]),s("Modal",{attrs:{width:"960px",scrollable:"","footer-hide":"",closable:"",title:"上传图标","mask-closable":!1,"z-index":500},model:{value:t.modalPic,callback:function(e){t.modalPic=e},expression:"modalPic"}},[t.modalPic?s("uploadPictures",{attrs:{isChoice:"单选"},on:{getPic:t.getPic}}):t._e()],1)],1)}),[],!1,null,"1b28e29e",null);e.default=m.exports},af91:function(t,e,s){},dcbf:function(t,e,s){"use strict";var o=s("af91");s.n(o).a}}]);