{"size": 11550, "ext": "js", "max_stars_repo_path": "mycf/static/js/chunk-17eb9477.25046054.js", "max_stars_repo_name": "fuxiaohui1997/coffeehouse", "max_stars_repo_stars_event_min_datetime": "2020-04-09T01:39:40.000Z", "max_stars_repo_stars_event_max_datetime": "2020-04-09T01:39:40.000Z", "max_issues_repo_path": "mycf/static/js/chunk-17eb9477.25046054.js", "max_issues_repo_name": "fuxiaohui1997/coffeehouse", "max_issues_repo_issues_event_min_datetime": null, "max_issues_repo_issues_event_max_datetime": null, "max_forks_repo_path": "mycf/static/js/chunk-17eb9477.25046054.js", "max_forks_repo_name": "fuxiaohui1997/coffeehouse", "max_forks_repo_forks_event_min_datetime": null, "max_forks_repo_forks_event_max_datetime": null}
{"max_stars_count": 1, "max_issues_count": null, "max_forks_count": null, "avg_line_length": 11550.0, "max_line_length": 11550, "alphanum_fraction": 0.6601731602}
(window["webpackJsonp"]=window["webpackJsonp"]||[]).push([["chunk-17eb9477"],{"0598":function(t,e,o){"use strict";var i=o("58d1"),a=o.n(i);a.a},"28cc":function(t,e,o){},"370f":function(t,e,o){"use strict";o.r(e);var i=function(){var t=this,e=t.$createElement,o=t._self._c||e;return o("div",{staticClass:"tab-container"},[o("el-tabs",{staticStyle:{height:"600px"},attrs:{"tab-position":"left",type:"border-card"}},[o("el-tab-pane",{attrs:{label:"基本参数"}},[o("basic-parameters",{attrs:{"child-data":t.goodsMsg},on:{"child-event":t.goodMsg}})],1),t._v(" "),o("el-tab-pane",{attrs:{label:"商品图片"}},[o("pictures",{attrs:{"child-data":t.goodsMsg},on:{"child-event":t.goodMsg}})],1),t._v(" "),o("el-tab-pane",{attrs:{label:"商品描述"}},[o("description",{attrs:{"child-data":t.goodsMsg},on:{"child-event":t.goodMsg}})],1),t._v(" "),o("el-tab-pane",{attrs:{label:"商品详情"}},[o("good-details",{attrs:{"child-data":t.goodsMsg},on:{"child-event":t.goodMsg}})],1)],1),t._v(" "),o("el-button",{staticStyle:{float:"right",margin:"10px"},attrs:{type:"primary"},on:{click:t.addGood}},[t._v("\n    "+t._s("add"===t.type?"添加商品":"保存")+"\n  ")])],1)},a=[],n=(o("96cf"),o("3b8d")),l=o("db72"),s=o("2f62"),r=function(){var t=this,e=t.$createElement,o=t._self._c||e;return o("div",[o("el-row",{staticClass:"item"},[o("el-col",{staticStyle:{height:"36px",overflow:"hidden","line-height":"36px","text-align":"center"},attrs:{span:3}},[t._v("\n      商品名称\n    ")]),t._v(" "),o("el-col",{attrs:{span:21}},[o("el-input",{attrs:{placeholder:"请输入商品名称"},model:{value:t.good.name,callback:function(e){t.$set(t.good,"name",e)},expression:"good.name"}})],1)],1),t._v(" "),o("el-row",{staticClass:"item"},[o("el-col",{staticStyle:{height:"36px",overflow:"hidden","line-height":"36px","text-align":"center"},attrs:{span:3}},[t._v("\n      商品价格\n    ")]),t._v(" "),o("el-col",{attrs:{span:21}},[o("el-input",{attrs:{placeholder:"请输入商品价格"},model:{value:t.good.price,callback:function(e){t.$set(t.good,"price",e)},expression:"good.price"}})],1)],1),t._v(" "),o("el-row",{staticClass:"item"},[o("el-col",{staticStyle:{height:"36px",overflow:"hidden","line-height":"36px","text-align":"center"},attrs:{span:3}},[t._v("\n      商品数量\n    ")]),t._v(" "),o("el-col",{attrs:{span:21}},[o("el-input",{attrs:{type:"number",placeholder:"请输入商品数量"},model:{value:t.good.num,callback:function(e){t.$set(t.good,"num",e)},expression:"good.num"}})],1)],1),t._v(" "),o("el-row",{staticClass:"item"},[o("el-col",{staticStyle:{height:"36px",overflow:"hidden","line-height":"36px","text-align":"center"},attrs:{span:3}},[t._v("\n      商品种类\n    ")]),t._v(" "),o("el-col",{attrs:{span:21}},[o("el-select",{staticStyle:{width:"100%"},attrs:{multiple:"",filterable:"","allow-create":"",placeholder:"请选择种类"},model:{value:t.good.category,callback:function(e){t.$set(t.good,"category",e)},expression:"good.category"}},t._l(t.options,(function(e){return o("el-option-group",{key:e.label,attrs:{label:e.label}},t._l(e.options,(function(t){return o("el-option",{key:t.value,attrs:{label:t.label,value:t.value}})})),1)})),1)],1)],1)],1)},c=[],d={props:{childData:{type:Object,default:function(){return{}}}},data:function(){return{options:[{label:"促销种类",options:[{value:"推荐",label:"推荐"},{value:"品牌",label:"品牌"},{value:"折扣",label:"折扣"},{value:"实惠",label:"实惠"},{value:"销量",label:"销量"}]},{label:"品牌种类",options:[{value:"纯咖啡",label:"纯咖啡"},{value:"白咖啡",label:"白咖啡"},{value:"意大利咖啡",label:"意大利咖啡"},{value:"蓝山咖啡",label:"蓝山咖啡"},{value:"曼特宁咖啡",label:"曼特宁咖啡"},{value:"哥伦比亚咖啡",label:"哥伦比亚咖啡"},{value:"越南咖啡",label:"越南咖啡"},{value:"猫屎咖啡",label:"猫屎咖啡"},{value:"摩卡咖啡",label:"摩卡咖啡"}]}],good:{name:"",price:"",num:"",category:[]}}},watch:{good:{handler:function(){this.$emit("child-event",this.good)},deep:!0}},created:function(){var t=this.$route.query.active;if("edit"===t)for(var e in this.good)this.childData[e]&&(this.good[e]=this.childData[e])}},u=d,h=(o("a8f2"),o("2877")),g=Object(h["a"])(u,r,c,!1,null,"02ef07f2",null),p=g.exports,f=function(){var t=this,e=t.$createElement,o=t._self._c||e;return o("div",[o("el-upload",{attrs:{id:"upload",action:"#","list-type":"picture-card","auto-upload":!1,"on-change":t.uploadImg,"on-remove":t.removeImg,"file-list":t.filelists},scopedSlots:t._u([{key:"file",fn:function(e){var i=e.file;return o("div",{},[o("img",{staticClass:"el-upload-list__item-thumbnail",attrs:{src:i.url,alt:""}}),t._v(" "),o("span",{staticClass:"el-upload-list__item-actions"},[o("span",{staticClass:"el-upload-list__item-preview",on:{click:function(e){return t.handlePictureCardPreview(i)}}},[o("i",{staticClass:"el-icon-zoom-in"})]),t._v(" "),t.disabled?t._e():o("span",{staticClass:"el-upload-list__item-delete",on:{click:function(e){return t.removeImg(i)}}},[o("i",{staticClass:"el-icon-delete"})])])])}}])},[o("i",{staticClass:"el-icon-plus",attrs:{slot:"default"},slot:"default"})]),t._v(" "),o("el-dialog",{attrs:{visible:t.dialogVisible},on:{"update:visible":function(e){t.dialogVisible=e}}},[o("img",{attrs:{width:"100%",src:t.dialogImageUrl,alt:""}})])],1)},v=[],m=(o("20d6"),o("7f7f"),o("ac6a"),{props:{childData:{type:Object,default:function(){return{}}}},data:function(){return{dialogImageUrl:"",dialogVisible:!1,disabled:!1,filelists:[],good:{imgList:[]}}},watch:{good:{handler:function(){this.$emit("child-event",this.good)},deep:!0}},created:function(){var t=this,e=this.$route.query.active;if("edit"===e){for(var o in this.good)this.childData[o]&&(this.good[o]=this.childData[o]);if(!this.good.imgList)return;this.good.imgList.forEach((function(e){var o={url:e.src};t.filelists.push(o)}))}},mounted:function(){var t=this.$route.query.active;if("edit"===t){if(!this.good.imgList)return;this.good.imgList.forEach((function(t,e){var o=new Image;o.src=t.src,o.onload=function(){var t=o.width,i=o.height,a=document.getElementById("upload"),n=a.querySelector(".el-upload-list--picture-card").children,l=150/i,s=t*l;n[e].style.width=s+"px",n[e].style.height="150px"}}))}},methods:{handlePictureCardPreview:function(t){this.dialogImageUrl=t.url,this.dialogVisible=!0},uploadImg:function(t,e){var o=this,i=this;this.getBase64(t.raw).then((function(e){o.good.imgList.push({name:t.name,id:t.uid,src:e});var i=new Image;i.src=e,i.onload=function(){var t=i.width,e=i.height,o=document.getElementById("upload"),a=o.querySelector(".el-upload-list").lastChild,n=150/e,l=t*n;a.style.width=l+"px",a.style.height="150px"}})),i.filelists=e},removeImg:function(t){var e=this.filelists.findIndex((function(e){return e.uid===t.uid}));this.filelists.splice(e,1);var o=this.good.imgList.findIndex((function(e){return e.id===t.uid}));this.good.imgList.splice(o,1)},getBase64:function(t){return new Promise((function(e,o){var i=new FileReader,a="";i.readAsDataURL(t),i.onload=function(){a=i.result},i.onerror=function(t){o(t)},i.onloadend=function(){e(a)}}))}}}),b=m,y=Object(h["a"])(b,f,v,!1,null,null,null),x=y.exports,_=function(){var t=this,e=t.$createElement,o=t._self._c||e;return o("div",[o("el-row",{staticClass:"item"},[o("el-col",{staticStyle:{height:"36px",overflow:"hidden","line-height":"36px","text-align":"center"},attrs:{span:3}},[t._v("\n      商品描述\n    ")]),t._v(" "),o("el-col",{attrs:{span:21}},[o("el-input",{attrs:{type:"textarea",rows:"20",placeholder:"请输入商品描述"},model:{value:t.good.description,callback:function(e){t.$set(t.good,"description",e)},expression:"good.description"}})],1)],1)],1)},w=[],$={props:{childData:{type:Object,default:function(){return{}}}},data:function(){return{good:{description:""}}},watch:{good:{handler:function(){this.$emit("child-event",this.good)},deep:!0}},created:function(){var t=this.$route.query.active;if("edit"===t)for(var e in this.good)this.childData[e]&&(this.good[e]=this.childData[e])}},k=$,C=(o("635d"),Object(h["a"])(k,_,w,!1,null,"91fdfe70",null)),O=C.exports,j=function(){var t=this,e=t.$createElement,o=t._self._c||e;return o("div",[o("el-row",{staticClass:"item"},[o("el-col",{staticStyle:{height:"36px",overflow:"hidden","line-height":"36px","text-align":"center"},attrs:{span:3}},[t._v("\n      制作过程\n    ")]),t._v(" "),o("el-col",{attrs:{span:21}},[o("el-input",{attrs:{type:"textarea",autosize:{minRows:3,maxRows:6},placeholder:"请输入制作过程"},model:{value:t.good.make,callback:function(e){t.$set(t.good,"make",e)},expression:"good.make"}})],1)],1),t._v(" "),o("el-row",{staticClass:"item"},[o("el-col",{staticStyle:{height:"36px",overflow:"hidden","line-height":"36px","text-align":"center"},attrs:{span:3}},[t._v("\n      出产来源\n    ")]),t._v(" "),o("el-col",{attrs:{span:21}},[o("el-input",{attrs:{type:"textarea",autosize:{minRows:3,maxRows:6},placeholder:"请输入出产来源"},model:{value:t.good.origin,callback:function(e){t.$set(t.good,"origin",e)},expression:"good.origin"}})],1)],1),t._v(" "),o("el-row",{staticClass:"item"},[o("el-col",{staticStyle:{height:"36px",overflow:"hidden","line-height":"36px","text-align":"center"},attrs:{span:3}},[t._v("\n      历史发展\n    ")]),t._v(" "),o("el-col",{attrs:{span:21}},[o("el-input",{attrs:{type:"textarea",autosize:{minRows:3,maxRows:6},placeholder:"请输入历史发展"},model:{value:t.good.history,callback:function(e){t.$set(t.good,"history",e)},expression:"good.history"}})],1)],1)],1)},S=[],I={props:{childData:{type:Object,default:function(){return{}}}},data:function(){return{good:{make:"",origin:"",history:""}}},watch:{good:{handler:function(){this.$emit("child-event",this.good)},deep:!0}},created:function(){var t=this.$route.query.active;if("edit"===t)for(var e in this.good)this.childData[e]&&(this.good[e]=this.childData[e])}},D=I,E=(o("5ee9"),Object(h["a"])(D,j,S,!1,null,"1b939f34",null)),M=E.exports,q=o("c40e"),R={components:{basicParameters:p,pictures:x,description:O,goodDetails:M},data:function(){return{type:"add",goods:{}}},computed:Object(l["a"])({},Object(s["b"])(["goodsMsg"])),created:function(){var t=this.$route.query.active;t&&(this.type=t)},methods:{goodMsg:function(t){for(var e in t)this.goods[e]=t[e]},addGood:function(){var t=this;this.$confirm("确认提交","确认操作",{confirmButtonText:"确认",cancelButtonText:"取消",type:"warning"}).then(Object(n["a"])(regeneratorRuntime.mark((function e(){var o;return regeneratorRuntime.wrap((function(e){while(1)switch(e.prev=e.next){case 0:o=JSON.parse(JSON.stringify(t.goods)),"add"===t.type?Object(q["a"])(o).then((function(e){t.$message({type:"success",message:"添加商品成功"}),t.$store.commit("goods/CHANGE_SETTING",{goods:{}}),t.$router.push({path:t.redirect||"/goods/addgood",query:t.otherQuery})})):(o.id=t.goodsMsg._id,Object(q["d"])(o).then((function(e){t.$message({type:"success",message:"添加商品成功"}),t.$store.commit("goods/CHANGE_SETTING",{goods:{}}),t.$router.push({path:t.redirect||"/goods/addgood",query:t.otherQuery})})));case 2:case"end":return e.stop()}}),e)})))).catch((function(t){console.log(t)}))}}},L=R,B=(o("0598"),Object(h["a"])(L,i,a,!1,null,"5c15dbb8",null));e["default"]=B.exports},5634:function(t,e,o){},"58d1":function(t,e,o){},"5ee9":function(t,e,o){"use strict";var i=o("c3da"),a=o.n(i);a.a},"635d":function(t,e,o){"use strict";var i=o("5634"),a=o.n(i);a.a},a8f2:function(t,e,o){"use strict";var i=o("28cc"),a=o.n(i);a.a},c3da:function(t,e,o){},c40e:function(t,e,o){"use strict";o.d(e,"a",(function(){return a})),o.d(e,"d",(function(){return n})),o.d(e,"b",(function(){return l})),o.d(e,"c",(function(){return s}));var i=o("b775");function a(t){return Object(i["a"])({url:"/goods/add",method:"post",data:t})}function n(t){return Object(i["a"])({url:"/goods/update",method:"post",data:t})}function l(t){return Object(i["a"])({url:"/goods/delete",method:"post",data:t})}function s(t){return Object(i["a"])({url:"/goods/list",method:"get",params:t})}}}]);