1 |
- (window.webpackJsonp=window.webpackJsonp||[]).push([["chunk-c1dc"],{"155J":function(t,e,i){"use strict";var r=i("rOv4");i.n(r).a},HziX:function(t,e,i){"use strict";(function(t){i.d(e,"a",function(){return o});var r=function(){return"undefined"!=typeof window?window:t},o=function(){var t=r();return t&&t.tinymce?t.tinymce:null}}).call(this,i("yLpj"))},PALo:function(t,e,i){"use strict";i.r(e);var r=i("QbLZ"),o=i.n(r),a=i("P2sY"),n=i.n(a),s=i("xA6U"),l=i("xAVR"),u=i("ip1f"),c=i("rs3x"),d=i("mRed"),p=i("XJYT"),g=i("X4fA"),m={name:"GoodsUpsert",components:{Editor:d.a},data:function(){return{uploadPath:c.b,freightList:[],imgsFileList:[],categoryList:[],categoryIds:[],goods:{imgList:[],priceRaw:0},attributeVisiable:!1,attributeForm:{attribute:"",value:""},attributes:[],skuVisiable:!1,skuForm:{img:void 0},skuList:[],rules:{status:[{required:!0,message:"请选择商品状态",trigger:"blur"}],title:[{required:!0,message:"商品名称不能为空",trigger:"blur"}],priceRaw:[{required:!0,message:"商品现价不能为空",trigger:"blur"}],originalPriceRaw:[{required:!0,message:"商品原价不能为空",trigger:"blur"}],vipPriceRaw:[{required:!0,message:"商品ViP价格不能为空",trigger:"blur"}],unit:[{required:!0,message:"物件单位不能为空",trigger:"blur"}],detail:[{required:!0,message:"请填写商品详情",trigger:"blur"}]},skuRules:{barCode:[{required:!0,message:"类型条码不能为空",trigger:"blur"}],title:[{required:!0,message:"类型名称不能为空",trigger:"blur"}],priceRaw:[{required:!0,message:"类型现价不能为空",trigger:"blur"}],originalPriceRaw:[{required:!0,message:"类型原价不能为空",trigger:"blur"}],vipPriceRaw:[{required:!0,message:"类型VIP价格不能为空",trigger:"blur"}],stock:[{required:!0,message:"类型库存不能为空",trigger:"blur"}]},attrRules:{attribute:[{required:!0,message:"属性名称不能为空",trigger:"blur"}],value:[{required:!0,message:"属性值不能为空",trigger:"blur"}]},editorInit:{language:"zh_CN",convert_urls:!1,plugins:["advlist anchor autolink autosave code codesample colorpicker colorpicker contextmenu directionality emoticons fullscreen hr image imagetools importcss insertdatetime link lists media nonbreaking noneditable pagebreak paste preview print save searchreplace spellchecker tabfocus table template textcolor textpattern visualblocks visualchars wordcount"],toolbar:["searchreplace bold italic underline strikethrough alignleft aligncenter alignright outdent indent blockquote undo redo removeformat subscript superscript code codesample","hr bullist numlist link image charmap preview anchor pagebreak insertdatetime media table emoticons forecolor backcolor fullscreen"],images_upload_handler:function(t,e,i){var r=new FormData;r.append("file",t.blob()),Object(c.a)(r).then(function(t){e(t.data.url)}).catch(function(){i("上传失败,请重新上传")})}}}},computed:{headers:function(){return{accessToken:Object(g.a)()}}},created:function(){this.init()},methods:{init:function(){var t=this,e=this.$route.query.id;e&&Object(s.c)(e).then(function(e){e.data.data.priceRaw=e.data.data.price/100,e.data.data.originalPriceRaw=e.data.data.originalPrice/100,e.data.data.vipPriceRaw=e.data.data.vipPrice/100,t.goods=n()({},e.data.data),t.attributes=e.data.data.attributeList?e.data.data.attributeList:[],t.categoryIds=e.data.data.categoryIds.reverse(),t.skuList=e.data.data.skuList,t.imgsFileList=[];for(var i=0;i<t.goods.imgList.length;i++)t.imgsFileList.push({url:t.goods.imgList[i]});if(t.goods.skuList)for(var r=0;r<t.goods.skuList.length;r++)t.skuList[r].priceRaw=t.skuList[r].price/100,t.skuList[r].originalPriceRaw=t.skuList[r].originalPrice/100,t.skuList[r].vipPriceRaw=t.skuList[r].vipPrice/100}),Object(l.b)().then(function(e){t.categoryList=e.data.data}),Object(u.c)().then(function(e){t.freightList=e.data.data})},handleCategoryChange:function(t){this.goods.categoryId=t[t.length-1]},handleCancel:function(){this.$router.push({path:"/goods/list"})},handleCreate:function(){var t=this;this.$refs.dataForm.validate(function(e){if(e)if(void 0===t.goods.freightTemplateId||null===t.goods.freightTemplateId)t.$notify.error({title:"失败",message:"请添加运费模板"});else if(0===t.skuList.length)t.$notify.error({title:"失败",message:"请添加类型(Sku)"});else if(3!==t.categoryIds.length)t.$notify.error({title:"失败",message:"请选择类目"});else if(0===t.goods.imgList.length)t.$notify.error({title:"失败",message:"请上传至少一张图片"});else{t.goods.categoryId=t.categoryIds[2],t.goods.price=parseInt(100*t.goods.priceRaw),t.goods.originalPrice=parseInt(100*t.goods.originalPriceRaw),t.goods.vipPrice=parseInt(100*t.goods.vipPriceRaw);var i=o()({},t.goods,{attributeList:t.attributes,skuList:t.skuList});Object(s.a)(i).then(function(e){t.$notify.success({title:"成功",message:"添加成功"}),t.$router.push({path:"/goods/list"})}).catch(function(t){p.MessageBox.alert("业务错误:"+t.data.errmsg,"警告",{confirmButtonText:"确定",type:"error"})})}else t.$notify.error({title:"失败",message:"请完善以上表单"})})},handleEdit:function(){var t=this;this.$refs.dataForm.validate(function(e){if(e)if(0===t.skuList.length)t.$notify.error({title:"失败",message:"请添加类型(Sku)"});else if(3!==t.categoryIds.length)t.$notify.error({title:"失败",message:"请选择类目"});else if(0===t.goods.imgList.length)t.$notify.error({title:"失败",message:"请上传至少一张图片"});else{t.goods.categoryId=t.categoryIds[2],t.goods.price=parseInt(100*t.goods.priceRaw),t.goods.originalPrice=parseInt(100*t.goods.originalPriceRaw),t.goods.vipPrice=parseInt(100*t.goods.vipPriceRaw);var i=o()({},t.goods,{attributeList:t.attributes,skuList:t.skuList});Object(s.d)(i).then(function(e){t.$notify.success({title:"成功",message:"编辑成功"}),t.$router.push({path:"/goods/list"})}).catch(function(t){p.MessageBox.alert("业务错误:"+t.data.errmsg,"警告",{confirmButtonText:"确定",type:"error"})})}else t.$notify.error({title:"失败",message:"请完善表单"})})},uploadOverrun:function(){this.$message({type:"error",message:"上传文件个数超出限制!最多上传5张图片!"})},handleimgsUrl:function(t,e,i){200===t.errno&&(this.goods.imgList.push(t.url),this.goods.img=this.goods.imgList[0])},handleRemove:function(t,e){for(var i=0;i<this.goods.imgList.length;i++){var r;r=void 0===t.response?t.url:t.response.url,this.goods.imgList[i]===r&&this.goods.imgList.splice(i,1)}this.goods.imgList.length>0&&(this.goods.img=this.goods.imgList[0])},handleSkuImgSuccess:function(t,e){this.skuForm.img=t.url,this.skuVisiable=!1,this.skuVisiable=!0},handleAttributeShow:function(){this.attributeForm={},this.attributeVisiable=!0},handleAttributeAdd:function(){var t=this;this.$refs.attributeForm.validate(function(e){e&&(t.attributes.unshift(t.attributeForm),t.attributeVisiable=!1)})},handleAttributeDelete:function(t){var e=this.attributes.indexOf(t);this.attributes.splice(e,1)},handleSkuShow:function(){this.skuFrom={},this.skuVisiable=!0},handleSkuAdd:function(){var t=this;this.$refs.skuForm.validate(function(e){if(e){t.skuForm.price=parseInt(100*t.skuForm.priceRaw),t.skuForm.originalPrice=parseInt(100*t.skuForm.originalPriceRaw),t.skuForm.vipPrice=parseInt(100*t.skuForm.vipPriceRaw);var i=n()({},t.skuForm);t.skuList.unshift(i),t.skuVisiable=!1}})},handleSkuDelete:function(t){var e=this.skuList.indexOf(t);this.skuList.splice(e,1)}}},f=(i("155J"),i("KHd+")),b=Object(f.a)(m,function(){var t=this,e=t.$createElement,i=t._self._c||e;return i("div",{staticClass:"app-container"},[i("el-card",{staticClass:"box-card"},[i("h3",[t._v("商品(Spu)介绍")]),t._v(" "),i("el-form",{ref:"dataForm",attrs:{rules:t.rules,model:t.goods,"label-width":"150px"}},[i("el-form-item",{attrs:{label:"商品名称",prop:"title"}},[i("el-input",{model:{value:t.goods.title,callback:function(e){t.$set(t.goods,"title",e)},expression:"goods.title"}})],1),t._v(" "),i("el-form-item",{attrs:{label:"原始价格",prop:"originalPriceRaw"}},[i("el-input",{attrs:{placeholder:"0.00"},model:{value:t.goods.originalPriceRaw,callback:function(e){t.$set(t.goods,"originalPriceRaw",e)},expression:"goods.originalPriceRaw"}},[i("template",{slot:"append"},[t._v("元")])],2)],1),t._v(" "),i("el-form-item",{attrs:{label:"当前价格",prop:"priceRaw"}},[i("el-input",{attrs:{placeholder:"0.00"},model:{value:t.goods.priceRaw,callback:function(e){t.$set(t.goods,"priceRaw",e)},expression:"goods.priceRaw"}},[i("template",{slot:"append"},[t._v("元")])],2)],1),t._v(" "),i("el-form-item",{attrs:{label:"VIP价格",prop:"vipPriceRaw"}},[i("el-input",{attrs:{placeholder:"0.00"},model:{value:t.goods.vipPriceRaw,callback:function(e){t.$set(t.goods,"vipPriceRaw",e)},expression:"goods.vipPriceRaw"}},[i("template",{slot:"append"},[t._v("元")])],2)],1),t._v(" "),i("el-form-item",{attrs:{label:"剩余库存",prop:"stock"}},[i("el-input",{attrs:{disabled:!0,placeholder:"0"},model:{value:t.goods.stock,callback:function(e){t.$set(t.goods,"stock",e)},expression:"goods.stock"}})],1),t._v(" "),i("el-form-item",{attrs:{label:"运费模板",prop:"freightTemplate"}},[i("el-select",{attrs:{placeholder:"选择商品运费模板"},model:{value:t.goods.freightTemplateId,callback:function(e){t.$set(t.goods,"freightTemplateId",e)},expression:"goods.freightTemplateId"}},t._l(t.freightList,function(t,e){return i("el-option",{key:e,attrs:{label:t.freightTemplateDO.templateName,value:t.freightTemplateDO.id}})}))],1),t._v(" "),i("el-form-item",{attrs:{label:"是否在售",prop:"status"}},[i("el-radio-group",{model:{value:t.goods.status,callback:function(e){t.$set(t.goods,"status",e)},expression:"goods.status"}},[i("el-radio",{attrs:{label:1}},[t._v("在售")]),t._v(" "),i("el-radio",{attrs:{label:0}},[t._v("下架")])],1)],1),t._v(" "),i("el-form-item",{attrs:{label:"商品图片"}},[i("el-upload",{attrs:{action:t.uploadPath,headers:t.headers,limit:5,"file-list":t.imgsFileList,"on-exceed":t.uploadOverrun,"on-success":t.handleimgsUrl,"on-remove":t.handleRemove,multiple:"",accept:".jpg, .jpeg, .png, .gif","list-type":"picture-card"}},[i("i",{staticClass:"el-icon-plus"})])],1),t._v(" "),i("el-form-item",{attrs:{label:"商品单位",prop:"unit"}},[i("el-input",{attrs:{placeholder:"件 / 个 / 盒"},model:{value:t.goods.unit,callback:function(e){t.$set(t.goods,"unit",e)},expression:"goods.unit"}})],1),t._v(" "),i("el-form-item",{attrs:{label:"所属类目",prop:"category"}},[i("el-cascader",{attrs:{options:t.categoryList,"expand-trigger":"hover"},on:{change:t.handleCategoryChange},model:{value:t.categoryIds,callback:function(e){t.categoryIds=e},expression:"categoryIds"}})],1),t._v(" "),i("el-form-item",{attrs:{label:"商品简介",prop:"description"}},[i("el-input",{model:{value:t.goods.description,callback:function(e){t.$set(t.goods,"description",e)},expression:"goods.description"}})],1),t._v(" "),i("el-form-item",{attrs:{label:"商品详细介绍",prop:"detail"}},[i("editor",{attrs:{init:t.editorInit},model:{value:t.goods.detail,callback:function(e){t.$set(t.goods,"detail",e)},expression:"goods.detail"}})],1)],1)],1),t._v(" "),i("el-card",{staticClass:"box-card"},[i("h3",[t._v("商品类型(sku)")]),t._v(" "),i("el-button",{attrs:{plain:!0,type:"primary"},on:{click:t.handleSkuShow}},[t._v("添加")]),t._v(" "),i("el-table",{attrs:{data:t.skuList}},[i("el-table-column",{attrs:{property:"id",label:"SkuId"}}),t._v(" "),i("el-table-column",{attrs:{property:"barCode",label:"Sku条形码"}}),t._v(" "),i("el-table-column",{attrs:{property:"title",label:"类型名"}}),t._v(" "),i("el-table-column",{attrs:{property:"originalPriceRaw",label:"原价"}}),t._v(" "),i("el-table-column",{attrs:{property:"priceRaw",label:"现价"}}),t._v(" "),i("el-table-column",{attrs:{property:"vipPriceRaw",label:"VIP价"}}),t._v(" "),i("el-table-column",{attrs:{property:"stock",label:"库存"}}),t._v(" "),i("el-table-column",{attrs:{align:"center",label:"操作",width:"100","class-name":"small-padding fixed-width"},scopedSlots:t._u([{key:"default",fn:function(e){return[i("el-button",{attrs:{type:"danger",size:"mini"},on:{click:function(i){t.handleSkuDelete(e.row)}}},[t._v("删除")])]}}])})],1),t._v(" "),i("el-dialog",{attrs:{visible:t.skuVisiable,title:"添加商品类型(Sku)"},on:{"update:visible":function(e){t.skuVisiable=e}}},[i("el-form",{ref:"skuForm",staticStyle:{width:"400px","margin-left":"50px"},attrs:{model:t.skuForm,rules:t.skuRules,"status-icon":"","label-position":"left","label-width":"100px"}},[i("el-form-item",{attrs:{label:"类型条码",prop:"barCode"}},[i("el-input",{model:{value:t.skuForm.barCode,callback:function(e){t.$set(t.skuForm,"barCode",e)},expression:"skuForm.barCode"}})],1),t._v(" "),i("el-form-item",{attrs:{label:"类型名称",prop:"title"}},[i("el-input",{model:{value:t.skuForm.title,callback:function(e){t.$set(t.skuForm,"title",e)},expression:"skuForm.title"}})],1),t._v(" "),i("el-form-item",{attrs:{label:"图片(可空)"}},[i("el-upload",{staticClass:"avatar-uploader",attrs:{action:t.uploadPath,"show-file-list":!1,"on-success":t.handleSkuImgSuccess}},[t.skuForm.img?i("img",{staticClass:"avatar",attrs:{src:t.skuForm.img}}):i("i",{staticClass:"el-icon-plus avatar-uploader-icon"})])],1),t._v(" "),i("el-form-item",{attrs:{label:"原始价格",prop:"originalPriceRaw"}},[i("el-input",{attrs:{placeholder:"0.00"},model:{value:t.skuForm.originalPriceRaw,callback:function(e){t.$set(t.skuForm,"originalPriceRaw",e)},expression:"skuForm.originalPriceRaw"}},[i("template",{slot:"append"},[t._v("元")])],2)],1),t._v(" "),i("el-form-item",{attrs:{label:"当前价格",prop:"priceRaw"}},[i("el-input",{attrs:{placeholder:"0.00"},model:{value:t.skuForm.priceRaw,callback:function(e){t.$set(t.skuForm,"priceRaw",e)},expression:"skuForm.priceRaw"}},[i("template",{slot:"append"},[t._v("元")])],2)],1),t._v(" "),i("el-form-item",{attrs:{label:"VIP价格",prop:"vipPriceRaw"}},[i("el-input",{attrs:{placeholder:"0.00"},model:{value:t.skuForm.vipPriceRaw,callback:function(e){t.$set(t.skuForm,"vipPriceRaw",e)},expression:"skuForm.vipPriceRaw"}},[i("template",{slot:"append"},[t._v("元")])],2)],1),t._v(" "),i("el-form-item",{attrs:{label:"库存",prop:"stock"}},[i("el-input",{model:{value:t.skuForm.stock,callback:function(e){t.$set(t.skuForm,"stock",e)},expression:"skuForm.stock"}})],1)],1),t._v(" "),i("div",{staticClass:"dialog-footer",attrs:{slot:"footer"},slot:"footer"},[i("el-button",{on:{click:function(e){t.skuVisiable=!1}}},[t._v("取消")]),t._v(" "),i("el-button",{attrs:{type:"primary"},on:{click:t.handleSkuAdd}},[t._v("确定")])],1)],1)],1),t._v(" "),i("el-card",{staticClass:"box-card"},[i("h3",[t._v("商品参数")]),t._v(" "),i("el-button",{attrs:{plain:!0,type:"primary"},on:{click:t.handleAttributeShow}},[t._v("添加")]),t._v(" "),i("el-table",{attrs:{data:t.attributes}},[i("el-table-column",{attrs:{property:"attribute",label:"商品参数名称"}}),t._v(" "),i("el-table-column",{attrs:{property:"value",label:"商品参数值"}}),t._v(" "),i("el-table-column",{attrs:{align:"center",label:"操作",width:"100","class-name":"small-padding fixed-width"},scopedSlots:t._u([{key:"default",fn:function(e){return[i("el-button",{attrs:{type:"danger",size:"mini"},on:{click:function(i){t.handleAttributeDelete(e.row)}}},[t._v("删除")])]}}])})],1),t._v(" "),i("el-dialog",{attrs:{visible:t.attributeVisiable,title:"设置商品参数"},on:{"update:visible":function(e){t.attributeVisiable=e}}},[i("el-form",{ref:"attributeForm",staticStyle:{width:"400px","margin-left":"50px"},attrs:{model:t.attributeForm,rules:t.attrRules,data:t.attributes,"status-icon":"","label-position":"left","label-width":"100px"}},[i("el-form-item",{attrs:{label:"商品参数名称",prop:"attribute"}},[i("el-input",{model:{value:t.attributeForm.attribute,callback:function(e){t.$set(t.attributeForm,"attribute",e)},expression:"attributeForm.attribute"}})],1),t._v(" "),i("el-form-item",{attrs:{label:"商品参数值",prop:"value"}},[i("el-input",{model:{value:t.attributeForm.value,callback:function(e){t.$set(t.attributeForm,"value",e)},expression:"attributeForm.value"}})],1)],1),t._v(" "),i("div",{staticClass:"dialog-footer",attrs:{slot:"footer"},slot:"footer"},[i("el-button",{on:{click:function(e){t.attributeVisiable=!1}}},[t._v("取消")]),t._v(" "),i("el-button",{attrs:{type:"primary"},on:{click:t.handleAttributeAdd}},[t._v("确定")])],1)],1)],1),t._v(" "),i("div",{staticClass:"op-container"},[i("el-button",{on:{click:t.handleCancel}},[t._v("取消")]),t._v(" "),t.goods.id?t._e():i("el-button",{attrs:{type:"primary"},on:{click:t.handleCreate}},[t._v("保存商品")]),t._v(" "),t.goods.id?i("el-button",{attrs:{type:"primary"},on:{click:t.handleEdit}},[t._v("更新商品")]):t._e()],1)],1)},[],!1,null,null,null);b.options.__file="upsert.vue";e.default=b.exports},"gDS+":function(t,e,i){t.exports={default:i("oh+g"),__esModule:!0}},ip1f:function(t,e,i){"use strict";i.d(e,"c",function(){return c}),i.d(e,"a",function(){return d}),i.d(e,"b",function(){return p}),i.d(e,"d",function(){return g});var r=i("gDS+"),o=i.n(r),a=i("QbLZ"),n=i.n(a),s=i("t3Un"),l=i("Qyje"),u=i.n(l);function c(t){return Object(s.a)({method:"get",params:{_gp:"admin.freight",_mt:"getAllFreightTemplate"}})}function d(t){return Object(s.a)({method:"post",data:u.a.stringify(n()({_gp:"admin.freight",_mt:"addFreightTemplate"},t,{freightTemplateCarriageDOList:o()(t.freightTemplateCarriageDOList)}))})}function p(t){return Object(s.a)({method:"post",data:u.a.stringify({_gp:"admin.freight",_mt:"deleteFreightTemplate",templateId:t})})}function g(t){return Object(s.a)({method:"post",data:u.a.stringify(n()({_gp:"admin.freight",_mt:"updateFreightTemplate"},t,{freightTemplateCarriageDOList:o()(t.freightTemplateCarriageDOList)}))})}},mRed:function(t,e,i){"use strict";var r=["onActivate","onAddUndo","onBeforeAddUndo","onBeforeExecCommand","onBeforeGetContent","onBeforeRenderUI","onBeforeSetContent","onBeforePaste","onBlur","onChange","onClearUndos","onClick","onContextMenu","onCopy","onCut","onDblclick","onDeactivate","onDirty","onDrag","onDragDrop","onDragEnd","onDragGesture","onDragOver","onDrop","onExecCommand","onFocus","onFocusIn","onFocusOut","onGetContent","onHide","onInit","onKeyDown","onKeyPress","onKeyUp","onLoadContent","onMouseDown","onMouseEnter","onMouseLeave","onMouseMove","onMouseOut","onMouseOver","onMouseUp","onNodeChange","onObjectResizeStart","onObjectResized","onObjectSelected","onPaste","onPostProcess","onPostRender","onPreProcess","onProgressState","onRedo","onRemove","onReset","onSaveContent","onSelectionChange","onSetAttrib","onSetContent","onShow","onSubmit","onUndo","onVisualAid"],o=function(t){return-1!==r.indexOf(t)},a=function(t,e,i){var r=e.$props.value?e.$props.value:"",a=e.$props.initialValue?e.$props.initialValue:"";i.setContent(r||a),e.$listeners.input&&function(t,e){var i,r=t.$props.modelEvents?t.$props.modelEvents:null,o=Array.isArray(r)?r.join(" "):r;t.$watch("value",function(t,r){e&&"string"==typeof t&&t!==i&&t!==r&&(e.setContent(t),i=t)}),e.on(o||"change keyup undo redo",function(){i=e.getContent(),t.$emit("input",i)})}(e,i),function(t,e,i){Object.keys(e).filter(o).forEach(function(r){var o=e[r];"function"==typeof o&&("onInit"===r?o(t,i):i.on(r.substring(2),function(t){return o(t,i)}))})}(t,e.$listeners,i)},n=0,s=function(t){var e=(new Date).getTime();return t+"_"+Math.floor(1e9*Math.random())+ ++n+String(e)},l=function(t){return void 0===t||""===t?[]:Array.isArray(t)?t:t.split(" ")},u=i("HziX"),c={apiKey:String,cloudChannel:String,id:String,init:Object,initialValue:String,inline:Boolean,modelEvents:[String,Array],plugins:[String,Array],tagName:String,toolbar:[String,Array],value:String,disabled:Boolean},d=Object.assign||function(t){for(var e,i=1,r=arguments.length;i<r;i++)for(var o in e=arguments[i])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t},p={listeners:[],scriptId:s("tiny-script"),scriptLoaded:!1},g=function(t){return function(){var e=d({},t.$props.init,{readonly:t.$props.disabled,selector:"#"+t.elementId,plugins:function(t,e){return l(t).concat(l(e))}(t.$props.init&&t.$props.init.plugins,t.$props.plugins),toolbar:t.$props.toolbar||t.$props.init&&t.$props.init.toolbar,inline:t.inlineEditor,setup:function(e){t.editor=e,e.on("init",function(i){return a(i,t,e)}),t.$props.init&&"function"==typeof t.$props.init.setup&&t.$props.init.setup(e)}});(function(t){return null!==t&&"textarea"===t.tagName.toLowerCase()})(t.element)&&(t.element.style.visibility=""),Object(u.a)().init(e)}},m={props:c,created:function(){this.elementId=this.$props.id||s("tiny-vue"),this.inlineEditor=this.$props.init&&this.$props.init.inline||this.$props.inline},watch:{disabled:function(){this.editor.setMode(this.disabled?"readonly":"design")}},mounted:function(){if(this.element=this.$el,null!==Object(u.a)())g(this)();else if(this.element){var t=this.element.ownerDocument,e=this.$props.cloudChannel?this.$props.cloudChannel:"stable",i=this.$props.apiKey?this.$props.apiKey:"";!function(t,e,i,r){t.scriptLoaded?r():(t.listeners.push(r),e.getElementById(t.scriptId)||function(t,e,i,r){var o=e.createElement("script");o.type="application/javascript",o.id=t,o.addEventListener("load",r),o.src=i,e.head.appendChild(o)}(t.scriptId,e,i,function(){t.listeners.forEach(function(t){return t()}),t.scriptLoaded=!0}))}(p,t,"https://cloud.tinymce.com/"+e+"/tinymce.min.js?apiKey="+i,g(this))}},beforeDestroy:function(){null!==Object(u.a)()&&Object(u.a)().remove(this.editor)},render:function(t){return this.inlineEditor?function(t,e,i){return t(i||"div",{attrs:{id:e}})}(t,this.elementId,this.$props.tagName):function(t,e){return t("textarea",{attrs:{id:e},style:{visibility:"hidden"}})}(t,this.elementId)}};e.a=m},"oh+g":function(t,e,i){var r=i("WEpk"),o=r.JSON||(r.JSON={stringify:JSON.stringify});t.exports=function(t){return o.stringify.apply(o,arguments)}},rOv4:function(t,e,i){},rs3x:function(t,e,i){"use strict";i.d(e,"b",function(){return o}),i.d(e,"a",function(){return a});var r=i("t3Un"),o="https://api.diy-factoies.com/upload/admin";function a(t){return Object(r.a)({url:o,method:"post",data:t})}},xA6U:function(t,e,i){"use strict";i.d(e,"g",function(){return c}),i.d(e,"f",function(){return d}),i.d(e,"d",function(){return p}),i.d(e,"b",function(){return g}),i.d(e,"a",function(){return m}),i.d(e,"c",function(){return f}),i.d(e,"e",function(){return b});var r=i("gDS+"),o=i.n(r),a=i("QbLZ"),n=i.n(a),s=i("t3Un"),l=i("Qyje"),u=i.n(l);function c(){return Object(s.a)({method:"get",params:{_gp:"admin.goods",_mt:"getSpuBigTree"}})}function d(t){return Object(s.a)({method:"get",params:n()({_gp:"admin.goods",_mt:"list"},t)})}function p(t){return Object(s.a)({method:"post",data:u.a.stringify({_gp:"admin.goods",_mt:"edit",spuDTO:o()(t)})})}function g(t){return Object(s.a)({method:"post",params:{_gp:"admin.goods",_mt:"delete",spuId:t}})}function m(t){return Object(s.a)({method:"post",data:u.a.stringify({_gp:"admin.goods",_mt:"create",spuDTO:o()(t)})})}function f(t){return Object(s.a)({method:"get",params:{_gp:"admin.goods",_mt:"detail",spuId:t}})}function b(t,e){return Object(s.a)({method:"post",params:{_gp:"admin.goods",_mt:"freezeOrActivation",spuId:t,status:e}})}},xAVR:function(t,e,i){"use strict";i.d(e,"a",function(){return l}),i.d(e,"b",function(){return u}),i.d(e,"e",function(){return c}),i.d(e,"c",function(){return d}),i.d(e,"f",function(){return p}),i.d(e,"d",function(){return g});var r=i("QbLZ"),o=i.n(r),a=i("t3Un"),n=i("Qyje"),s=i.n(n);function l(){return Object(a.a)({method:"get",params:{_gp:"admin.category",_mt:"categorySecondLevelTree"}})}function u(){return Object(a.a)({method:"get",params:{_gp:"admin.category",_mt:"categoryTree"}})}function c(t){return Object(a.a)({method:"get",params:o()({_gp:"admin.category",_mt:"queryCategory"},t)})}function d(t){return Object(a.a)({method:"post",data:s.a.stringify(o()({_gp:"admin.category",_mt:"addCategory"},t))})}function p(t){return Object(a.a)({method:"post",data:s.a.stringify(o()({_gp:"admin.category",_mt:"updateCategory"},t))})}function g(t){return Object(a.a)({method:"post",params:{_gp:"admin.category",_mt:"deleteCategory",id:t}})}}}]);
|