| 1 |
- (window["webpackJsonp"]=window["webpackJsonp"]||[]).push([["chunk-7f795fe9"],{2543:function(e,t,r){"use strict";r.d(t,"f",function(){return s}),r.d(t,"g",function(){return u}),r.d(t,"d",function(){return c}),r.d(t,"h",function(){return l}),r.d(t,"e",function(){return d}),r.d(t,"a",function(){return p}),r.d(t,"b",function(){return m}),r.d(t,"c",function(){return f});var n=r("b775"),a=r("4328"),o=r.n(a),i="/api-web";function s(e){return Object(n["a"])({url:i+"/goods/queryPage",method:"get",params:e})}function u(e){return Object(n["a"])({url:i+"/goods/get/".concat(e),method:"get"})}function c(e){return Object(n["a"])({url:i+"/goods/add",method:"post",data:o.a.stringify(e)})}function l(e){return Object(n["a"])({url:i+"/goods/update",method:"post",data:o.a.stringify(e)})}function d(e){return Object(n["a"])({url:i+"/goods/del/".concat(e),method:"post"})}function p(e){return Object(n["a"])({url:i+"/category/queryPage",method:"get",params:e})}function m(e){return Object(n["a"])({url:i+"/category/upset",method:"post",data:e})}function f(e){return Object(n["a"])({url:i+"/category/del",method:"post",data:o.a.stringify(e)})}},"95c6":function(e,t,r){"use strict";r.r(t);var n=function(){var e=this,t=e.$createElement,r=e._self._c||t;return r("div",{staticClass:"m-container"},[r("h2",[r("el-page-header",{attrs:{content:("create"==e.pageType?"添加":"修改")+e.typeChange(e.type)},on:{back:e.onCancel}})],1),e._v(" "),r("div",{staticClass:"m-core"},[r("el-form",{ref:"form",staticStyle:{width:"100%"},attrs:{model:e.form,rules:e.rules,"label-width":"120px"}},[r("el-form-item",{attrs:{label:"品牌",prop:"brand"}},[r("el-input",{model:{value:e.form.brand,callback:function(t){e.$set(e.form,"brand",t)},expression:"form.brand"}})],1),e._v(" "),r("el-form-item",{attrs:{label:"商品名称",prop:"name"}},[r("el-input",{model:{value:e.form.name,callback:function(t){e.$set(e.form,"name",t)},expression:"form.name"}})],1),e._v(" "),r("el-form-item",{attrs:{label:"商品图片",prop:"image"}},[r("el-upload",{staticClass:"avatar-uploader",attrs:{action:"/api-web/uploadFile",headers:e.headers,"show-file-list":!1,"on-success":e.handleAvatarSuccess,"before-upload":e.beforeAvatarUpload}},[e.form.image?r("img",{staticClass:"avatar",attrs:{src:e.form.image}}):r("i",{staticClass:"el-icon-plus avatar-uploader-icon"})])],1),e._v(" "),r("el-form-item",{attrs:{label:"商品描述",prop:"desc"}}),e._v(" "),r("el-form-item",[r("el-button",{attrs:{type:"primary"},on:{click:function(t){return e.onSubmit("form")}}},[e._v("立即"+e._s("create"==e.pageType?"创建":"修改"))]),e._v(" "),r("el-button",{on:{click:function(t){return e.onReSet("form")}}},[e._v("重置")])],1)],1)],1)])},a=[],o=(r("7f7f"),r("2543")),i=r("4360"),s=r("5f87"),u={components:{quillEditor:quillEditor},data:function(){return{categoryList:[],type:this.$route.query.type,pageType:this.$route.query.pageType,organId:i["a"].getters.organ,headers:{Authorization:Object(s["a"])()},content:"<h2>I am Example</h2>",editorOption:{},form:{brand:null,name:null,type:null,goodsCategoryId:null,specification:null,marketPrice:null,groupPurchasePrice:null,discountPrice:null,image:null,desc:null},rules:{brand:[{required:!0,message:"请输入品牌",trigger:"blur"},{min:3,max:30,message:"长度在 3 到 30 个字符",trigger:"blur"}]}}},mounted:function(){},methods:{onSubmit:function(e){console.log(this.editorContent)},messageTips:function(e,t){200==t.code?(this.$message({message:e+"成功",type:"success"}),this.$router.push({path:"/contentManager/contentManager",query:{type:this.typeIndex(this.type)}})):this.$message.error(t.msg)},onCancel:function(){this.$router.push({path:"/contentManager/contentManager",query:{type:this.typeIndex(this.type)}})},onReSet:function(e){this.$refs[e].resetFields()},getList:function(){var e=this;if("create"==this.pageType)return!1;Object(o["g"])(this.$route.query.id).then(function(t){if(200==t.code){var r=t.data;e.form={id:r.id,brand:r.brand,name:r.name,type:r.type,goodsCategoryId:r.goodsCategoryId,specification:r.specification,marketPrice:r.marketPrice,groupPurchasePrice:r.groupPurchasePrice,discountPrice:r.discountPrice,image:r.image,desc:r.desc}}})},handleAvatarSuccess:function(e,t){this.form.image=e.data.url},beforeAvatarUpload:function(e){var t={"image/png":!0,"image/jpeg":!0},r=t[e.type],n=e.size/1024/1024<2;return r||this.$message.error("只能上传图片格式!"),n||this.$message.error("上传头像图片大小不能超过 2MB!"),r&&n},typeChange:function(e){var t={1:"精彩活动",2:"热门资讯",3:"活动列表"};return t[e]},typeIndex:function(e){var t={3:0,1:1,2:2};return t[e]}}},c=u,l=(r("d2ee"),r("2877")),d=Object(l["a"])(c,n,a,!1,null,"4086cb3a",null);t["default"]=d.exports},ae4d:function(e,t,r){},d2ee:function(e,t,r){"use strict";var n=r("ae4d"),a=r.n(n);a.a}}]);
|