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.
 
 
 
 

1 lines
18 KiB

(window["webpackJsonp"]=window["webpackJsonp"]||[]).push([["chunk-61d7431c"],{"09f4":function(e,t,a){"use strict";a.d(t,"a",(function(){return i})),Math.easeInOutQuad=function(e,t,a,r){return e/=r/2,e<1?a/2*e*e+t:(e--,-a/2*(e*(e-2)-1)+t)};var r=function(){return window.requestAnimationFrame||window.webkitRequestAnimationFrame||window.mozRequestAnimationFrame||function(e){window.setTimeout(e,1e3/60)}}();function n(e){document.documentElement.scrollTop=e,document.body.parentNode.scrollTop=e,document.body.scrollTop=e}function o(){return document.documentElement.scrollTop||document.body.parentNode.scrollTop||document.body.scrollTop}function i(e,t,a){var i=o(),c=e-i,s=20,u=0;t="undefined"===typeof t?500:t;var d=function e(){u+=s;var o=Math.easeInOutQuad(u,i,c,t);n(o),u<t?r(e):a&&"function"===typeof a&&a()};d()}},"27ae":function(e,t,a){(function(a){var r,n;(function(t,a){e.exports=a(t)})("undefined"!==typeof self?self:"undefined"!==typeof window?window:"undefined"!==typeof a?a:this,(function(a){"use strict";a=a||{};var o,i=a.Base64,c="2.6.4",s="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",u=function(e){for(var t={},a=0,r=e.length;a<r;a++)t[e.charAt(a)]=a;return t}(s),d=String.fromCharCode,l=function(e){if(e.length<2){var t=e.charCodeAt(0);return t<128?e:t<2048?d(192|t>>>6)+d(128|63&t):d(224|t>>>12&15)+d(128|t>>>6&63)+d(128|63&t)}t=65536+1024*(e.charCodeAt(0)-55296)+(e.charCodeAt(1)-56320);return d(240|t>>>18&7)+d(128|t>>>12&63)+d(128|t>>>6&63)+d(128|63&t)},p=/[\uD800-\uDBFF][\uDC00-\uDFFFF]|[^\x00-\x7F]/g,f=function(e){return e.replace(p,l)},g=function(e){var t=[0,2,1][e.length%3],a=e.charCodeAt(0)<<16|(e.length>1?e.charCodeAt(1):0)<<8|(e.length>2?e.charCodeAt(2):0),r=[s.charAt(a>>>18),s.charAt(a>>>12&63),t>=2?"=":s.charAt(a>>>6&63),t>=1?"=":s.charAt(63&a)];return r.join("")},m=a.btoa&&"function"==typeof a.btoa?function(e){return a.btoa(e)}:function(e){if(e.match(/[^\x00-\xFF]/))throw new RangeError("The string contains invalid characters.");return e.replace(/[\s\S]{1,3}/g,g)},h=function(e){return m(f(String(e)))},y=function(e){return e.replace(/[+\/]/g,(function(e){return"+"==e?"-":"_"})).replace(/=/g,"")},b=function(e,t){return t?y(h(e)):h(e)},v=function(e){return b(e,!0)};a.Uint8Array&&(o=function(e,t){for(var a="",r=0,n=e.length;r<n;r+=3){var o=e[r],i=e[r+1],c=e[r+2],u=o<<16|i<<8|c;a+=s.charAt(u>>>18)+s.charAt(u>>>12&63)+("undefined"!=typeof i?s.charAt(u>>>6&63):"=")+("undefined"!=typeof c?s.charAt(63&u):"=")}return t?y(a):a});var C,w=/[\xC0-\xDF][\x80-\xBF]|[\xE0-\xEF][\x80-\xBF]{2}|[\xF0-\xF7][\x80-\xBF]{3}/g,x=function(e){switch(e.length){case 4:var t=(7&e.charCodeAt(0))<<18|(63&e.charCodeAt(1))<<12|(63&e.charCodeAt(2))<<6|63&e.charCodeAt(3),a=t-65536;return d(55296+(a>>>10))+d(56320+(1023&a));case 3:return d((15&e.charCodeAt(0))<<12|(63&e.charCodeAt(1))<<6|63&e.charCodeAt(2));default:return d((31&e.charCodeAt(0))<<6|63&e.charCodeAt(1))}},O=function(e){return e.replace(w,x)},A=function(e){var t=e.length,a=t%4,r=(t>0?u[e.charAt(0)]<<18:0)|(t>1?u[e.charAt(1)]<<12:0)|(t>2?u[e.charAt(2)]<<6:0)|(t>3?u[e.charAt(3)]:0),n=[d(r>>>16),d(r>>>8&255),d(255&r)];return n.length-=[0,0,2,1][a],n.join("")},P=a.atob&&"function"==typeof a.atob?function(e){return a.atob(e)}:function(e){return e.replace(/\S{1,4}/g,A)},T=function(e){return P(String(e).replace(/[^A-Za-z0-9\+\/]/g,""))},k=function(e){return O(P(e))},S=function(e){return String(e).replace(/[-_]/g,(function(e){return"-"==e?"+":"/"})).replace(/[^A-Za-z0-9\+\/]/g,"")},N=function(e){return k(S(e))};a.Uint8Array&&(C=function(e){return Uint8Array.from(T(S(e)),(function(e){return e.charCodeAt(0)}))});var B=function(){var e=a.Base64;return a.Base64=i,e};if(a.Base64={VERSION:c,atob:T,btoa:m,fromBase64:N,toBase64:b,utob:f,encode:b,encodeURI:v,btou:O,decode:N,noConflict:B,fromUint8Array:o,toUint8Array:C},"function"===typeof Object.defineProperty){var R=function(e){return{value:e,enumerable:!1,writable:!0,configurable:!0}};a.Base64.extendString=function(){Object.defineProperty(String.prototype,"fromBase64",R((function(){return N(this)}))),Object.defineProperty(String.prototype,"toBase64",R((function(e){return b(this,e)}))),Object.defineProperty(String.prototype,"toBase64URI",R((function(){return b(this,!0)})))}}return a["Meteor"]&&(Base64=a.Base64),e.exports?e.exports.Base64=a.Base64:(r=[],n=function(){return a.Base64}.apply(t,r),void 0===n||(e.exports=n)),{Base64:a.Base64}}))}).call(this,a("c8ba"))},4736:function(e,t,a){},"48dc":function(e,t,a){},"4fad":function(e,t,a){var r=a("23e7"),n=a("6f53").entries;r({target:"Object",stat:!0},{entries:function(e){return n(e)}})},"6f53":function(e,t,a){var r=a("83ab"),n=a("df75"),o=a("fc6a"),i=a("d1e7").f,c=function(e){return function(t){var a,c=o(t),s=n(c),u=s.length,d=0,l=[];while(u>d)a=s[d++],r&&!i.call(c,a)||l.push(e?[a,c[a]]:c[a]);return l}};e.exports={entries:c(!0),values:c(!1)}},9256:function(e,t,a){"use strict";a("99af"),a("4160"),a("caad"),a("4fad"),a("d3b7"),a("159b");var r=a("5530"),n=a("bc3a"),o=a.n(n),i=a("5c96"),c=a("5657");a("27ae");function s(e,t){"ECONNABORTED"===e.code?Object(i["Message"])({message:"请求超时"}):e.response&&e.response.data?Object(i["Message"])({message:e.response.data}):e.message&&Object(i["Message"])({message:e.message}),t(e)}function u(e,t){e.data.isError&&(4e4===e.data.code||40001===e.data.code||40002===e.data.code||40003===e.data.code||40005===e.data.code||40006===e.data.code||40008===e.data.code?i["MessageBox"].alert(e.data.msg,"提醒",{confirmButtonText:"确定",callback:function(){window.location.hash="/login"}}):i["Message"].error(e.data.msg)),t(e)}o.a.interceptors.request.use((function(e){var t=!1!==e.headers["X-isToken"]||e.headers["X-isToken"],a=c["a"].get("TOKEN","");a&&t&&(e.headers.token="Bearer "+a);var r="ceres_admin_web",n="ceres_admin_web";return e.headers["Authorization"]="Basic ".concat("".concat(r,":").concat(n)),e}),(function(e){return Promise.reject(e)})),o.a.interceptors.response.use((function(e){return e}),(function(e){return Promise.reject(e)}));var d=function(e){console.log(e,"opts");var t={ts:Date.now()},a=e.method.toUpperCase(),n={method:a,url:"".concat("https://pos.admin.api.lotus-wallet.com").concat(e.url),responseType:e.responseType||"",timeout:2e4},i=["PUT","POST","PATCH"];i.includes(a)?n.data=e.data||{}:n.params=Object(r["a"])(Object(r["a"])({},t),e.data||{}),e.formData&&(n.transformRequest=[function(e){var t=new FormData;return e&&Object.entries(e).forEach((function(e){t.append(e[0],e[1])})),t}]);var c=new Promise((function(e,t){o()(n).then((function(t){u(t,e)})).catch((function(e){s(e,t)}))}));return c};t["a"]=d},bb7c:function(e,t,a){},bc3f:function(e,t,a){"use strict";a.r(t);var r=function(){var e=this,t=e.$createElement,a=e._self._c||t;return a("div",{staticClass:"classification-page"},[a("div",{staticClass:"toolbar"},[a("el-button",{attrs:{type:"success",size:"mini"},on:{click:e.addBar}},[e._v("添加一级类别")])],1),a("el-table",{staticStyle:{width:"100%"},attrs:{data:e.tableData.productCategoryList,border:"","row-key":"id","tree-props":{children:"childs"}}},[a("el-table-column",{attrs:{prop:"categoryName",label:"商品类别"}}),a("el-table-column",{attrs:{prop:"status",label:"操作"},scopedSlots:e._u([{key:"default",fn:function(t){return[a("el-button",{attrs:{type:"text",size:"small"},nativeOn:{click:function(a){return a.preventDefault(),e.checkRow(t.row)}}},[e._v(" 查看 ")]),a("el-button",{attrs:{type:"text",size:"small"},nativeOn:{click:function(a){return a.preventDefault(),e.updateRow(t.row)}}},[e._v(" 编辑 ")]),a("el-button",{attrs:{type:"text",size:"small"},nativeOn:{click:function(a){return a.preventDefault(),e.deleteRow(t.row)}}},[e._v(" 删除 ")])]}}])})],1),a("pagination",{directives:[{name:"show",rawName:"v-show",value:e.tableData.total>0,expression:"tableData.total > 0"}],attrs:{limit:e.formParams.pageSize,page:e.formParams.pageIndex,total:Number(e.tableData.total)},on:{"update:limit":function(t){return e.$set(e.formParams,"pageSize",t)},"update:page":function(t){return e.$set(e.formParams,"pageIndex",t)},pagination:e.fetch}}),a("edit-dialog",{ref:"edit",attrs:{"dialog-visible":e.dialog.isVisible,type:e.dialog.type},on:{close:e.editClose,success:e.getProductCategory}})],1)},n=[],o=(a("96cf"),a("1da1")),i=a("c754"),c=a("333d"),s=function(){var e=this,t=e.$createElement,a=e._self._c||t;return a("el-dialog",{staticClass:"group-dialog",attrs:{"close-on-click-modal":!1,title:e.title,type:e.type,visible:e.isVisible,width:"60%",top:"50px"},on:{"update:visible":function(t){e.isVisible=t}}},[a("div",{staticClass:"add-dialog-component"},["add"==e.type?a("el-form",{ref:"form",attrs:{model:e.form,"label-width":"120px"}},[a("el-form-item",{attrs:{label:"分类类型:"}},[a("el-select",{attrs:{placeholder:"请选择活动区域"},model:{value:e.form.region,callback:function(t){e.$set(e.form,"region",t)},expression:"form.region"}},[a("el-option",{attrs:{label:"普通餐饮",value:"NORMALSTORE"}}),a("el-option",{attrs:{label:"快消餐饮",value:"FASTSTORE"}})],1)],1)],1):a("el-form",{ref:"form",attrs:{model:e.forms,"label-width":"120px"}},[a("el-form-item",{attrs:{label:"分类类型2:"}},[a("el-select",{attrs:{placeholder:"请选择活动区域"},model:{value:e.forms.region,callback:function(t){e.$set(e.forms,"region",t)},expression:"forms.region"}},[a("el-option",{attrs:{label:"普通餐饮",value:"NORMALSTORE"}}),a("el-option",{attrs:{label:"快消餐饮",value:"FASTSTORE"}})],1)],1)],1),a("el-tree",{staticClass:"tree-box",attrs:{data:e.treeData,props:{children:"childs"},"node-key":"id","default-expand-all":"","expand-on-click-node":!1},scopedSlots:e._u([{key:"default",fn:function(t){var r=t.node,n=t.data;return a("div",{staticClass:"custom-tree-node"},[a("div",{staticClass:"content"},[n.depth<3?[a("el-input",{staticClass:"input",attrs:{disabled:e.isCheck,size:"mini",placeholder:e._f("placeholderTips")(n.depth)},model:{value:n.categoryName,callback:function(t){e.$set(n,"categoryName",t)},expression:"data.categoryName"}})]:[a("div",{staticClass:"level-3-wrap"},[a("div",{staticClass:"upload-wrap",class:e.isCheck?"disabled":""},[a("el-upload",{staticClass:"upload-uploader",attrs:{headers:e.headers,data:e.dataObj,multiple:!1,"show-file-list":!1,"file-list":n.categoryImgArray,"on-success":e.handleImageSuccess,action:e.action}},[n.categoryImgArray&&n.categoryImgArray[0].url?a("img",{attrs:{src:n.categoryImgArray&&n.categoryImgArray[0].url}}):a("i",{staticClass:"el-icon-plus"})])],1),a("el-input",{staticClass:"textarea-input",attrs:{type:"textarea",resize:"none",disabled:e.isCheck,size:"mini",placeholder:"输入三级类别名称"},model:{value:n.categoryName,callback:function(t){e.$set(n,"categoryName",t)},expression:"data.categoryName"}})],1)]],2),1*n.depth<3&&!e.isCheck?a("div",{staticClass:"setting-box"},[a("el-button",{attrs:{type:"text",size:"mini"},on:{click:function(){return e.append(n)}}},[e._v(" "+e._s(e._f("addTips")(n.depth))+" ")]),a("el-button",{attrs:{type:"text",size:"mini"},on:{click:function(){return e.remove(r,n)}}},[e._v(" 删除 ")])],1):e._e()])}}])}),a("div",{staticClass:"add-btn-wrap"},[e.isCheck?[a("el-button",{staticClass:"add",attrs:{type:"primary",size:"small"},on:{click:e.close}},[e._v("确定")])]:["add"===e.type?a("el-button",{staticClass:"add",attrs:{type:"primary",size:"small"},on:{click:e.addClassification}},[e._v("添加一级类别名称")]):e._e(),a("el-button",{attrs:{type:"primary",size:"small"},on:{click:e.onSubmit}},[e._v("保存")])]],2)],1)])},u=[],d=(a("c740"),a("d81d"),a("a434"),a("5657")),l=1e3,p=1,f={inject:["reload"],filters:{addTips:function(e){e+="";var t={1:"添加二级类别名称",2:"添加三级类别名称"};return t[e]},placeholderTips:function(e){e+="";var t={1:"输入一级类别名称",2:"输入二级类别名称"};return t[e]}},props:{dialogVisible:{type:Boolean,default:!1},type:{type:String,default:"add"}},data:function(){return{forms:{region:""},form:{region:"NORMALSTORE"},params:{categoryName:""},customParams:{current:1,map:{},model:{config:"",isCustom:!0,isDelete:0,name:""},order:"descending",size:100,sort:"id"},treeData:[],headers:{Authorization:""},action:"".concat("https://pos.admin.api.lotus-wallet.com","/file/upload"),dataObj:{folderId:1}}},computed:{isVisible:{get:function(){return this.dialogVisible},set:function(){this.close(),this.reset()}},title:function(){var e={add:"新建类别",edit:"修改类别",check:"查看类别"};return e[this.type]},isCheck:function(){return"check"===this.type}},created:function(){this.headers.token="Bearer "+d["a"].get("TOKEN",""),this.headers.tenant="0000"},methods:{queryOneCategory:function(e){var t=this;return Object(o["a"])(regeneratorRuntime.mark((function a(){var r,n,o;return regeneratorRuntime.wrap((function(a){while(1)switch(a.prev=a.next){case 0:return console.log(e),a.next=3,i["a"].queryOneCategory({id:e});case 3:r=a.sent,n=r.data.data,o=function e(t){var a=t.categoryName,r=t.categoryImg,n=t.categoryPath,o=t.parentName,i=t.depth,c=t.posType,s={depth:i,categoryName:a,categoryPath:n||"",parentName:o,posType:c};return 3===i&&(s.categoryImgArray=[{url:r}]),t.childs&&t.childs.length&&(s.childs=t.childs.map(e)),s},n?(console.log(n),t.forms.region=n.posType,console.log(t.forms.region),n.childs=n&&n.childs&&n.childs.map(o),t.treeData=[n]):t.treeData=[];case 7:case"end":return a.stop()}}),a)})))()},handleImageSuccess:function(e,t,a){var r=e.data.url;a[0].url=r},close:function(){this.$emit("close")},reset:function(){this.treeData=[]},addClassification:function(){this.treeData.push({placeholder:"输入一级类别名称",addTips:"添加二级类别名称",categoryName:"",categoryPath:"",depth:1,idx:l++})},append:function(e){console.log(e);var t,a=e.categoryName,r=e.depth+1;e.childs||this.$set(e,"childs",[]),t=r<3?{placeholder:"输入二级类别名称",addTips:"添加三级类别名称",depth:r,parentName:a,categoryName:"",categoryPath:"",childs:[],idx:l++}:{parentName:a,categoryImgArray:[{id:p++,url:""}],depth:3,categoryName:"",idx:l++},e.childs.push(t)},remove:function(e,t){var a=e.parent,r=a.data.childs||a.data,n=r.findIndex((function(e){return e.idx===t.idx}));r.splice(n,1)},onSubmit:function(){"add"===this.type?this.addGroup():this.updateGroup(),this.reload()},addGroup:function(){var e=this;return Object(o["a"])(regeneratorRuntime.mark((function t(){var a,r,n,o,c;return regeneratorRuntime.wrap((function(t){while(1)switch(t.prev=t.next){case 0:return a=function t(a){var r=a.categoryName,n=a.categoryImgArray,o=a.categoryPath,i=a.parentName,c=a.depth,s={depth:c,categoryName:r,categoryPath:o||"",parentName:i,posType:e.form.region};return n&&(s.categoryImg=n[0].url),a.childs&&a.childs.length&&(s.childs=a.childs.map(t)),s},r=e.treeData.map(a),t.next=4,i["a"].addCategory(r);case 4:n=t.sent,o=n.data,c=o.code,0===c&&(e.isVisible=!1,e.$message({message:e.$t("tips.createSuccess"),type:"success"}),e.$emit("success"));case 8:case"end":return t.stop()}}),t)})))()},updateGroup:function(){var e=this;return Object(o["a"])(regeneratorRuntime.mark((function t(){var a,r,n,o,c;return regeneratorRuntime.wrap((function(t){while(1)switch(t.prev=t.next){case 0:return console.log(e.forms.region),a=function t(a){var r=a.categoryName,n=a.categoryImgArray,o=a.categoryPath,i=a.parentName,c=a.depth,s=a.id,u={depth:c,categoryName:r,categoryPath:o||"",parentName:i,id:s,posType:e.forms.region};return n&&(u.categoryImg=n[0].url),a.childs&&a.childs.length&&(u.childs=a.childs.map(t)),u},r=e.treeData.map(a),t.next=5,i["a"].uploadCategory(r);case 5:n=t.sent,o=n.data,c=o.code,0===c&&(e.isVisible=!1,e.$message({message:e.$t("tips.updateSuccess"),type:"success"}),e.$emit("success"));case 9:case"end":return t.stop()}}),t)})))()},setParams:function(e){var t=e.id;this.queryOneCategory(t)}}},g=f,m=(a("ef6b"),a("f0e3"),a("2877")),h=Object(m["a"])(g,s,u,!1,null,"6257a972",null),y=h.exports,b={components:{EditDialog:y,Pagination:c["a"]},data:function(){return{dialogVisible:!1,formParams:{pageSize:10,pageIndex:1},tableData:{},dialog:{type:"add",isVisible:!1}}},created:function(){this.getProductCategory()},methods:{fetch:function(e){var t=e.limit,a=e.page;this.formParams.pageIndex=a||1,this.formParams.pageSize=t||10,this.getProductCategory()},addBar:function(){this.dialog={type:"add",isVisible:!0},this.$refs.edit.setParams({treeData:[]})},editClose:function(){this.dialog.isVisible=!1},updateRow:function(e){console.log(e),console.log(12385);var t=e.id;this.dialog={type:"edit",isVisible:!0},this.$refs.edit.setParams({id:t})},checkRow:function(e){var t=e.id;this.dialog={type:"check",isVisible:!0},this.$refs.edit.setParams({id:t})},deleteRow:function(e){var t=this,a=e.id;this.$confirm(this.$t("tips.confirmDelete"),this.$t("common.tips"),{confirmButtonText:this.$t("common.confirm"),cancelButtonText:this.$t("common.cancel"),type:"warning"}).then((function(){t.delete({id:a,depth:1})})).catch((function(){}))},delete:function(e){var t=this;return Object(o["a"])(regeneratorRuntime.mark((function a(){var r,n,o;return regeneratorRuntime.wrap((function(a){while(1)switch(a.prev=a.next){case 0:return a.next=2,i["a"].deletCategory(e);case 2:r=a.sent,n=r.data,o=n.code,0===o&&(t.$message({message:t.$t("tips.deleteSuccess"),type:"success"}),t.getProductCategory());case 6:case"end":return a.stop()}}),a)})))()},getProductCategory:function(){var e=this;return Object(o["a"])(regeneratorRuntime.mark((function t(){var a;return regeneratorRuntime.wrap((function(t){while(1)switch(t.prev=t.next){case 0:return t.next=2,i["a"].getProductCategory(e.formParams);case 2:a=t.sent,e.tableData=a.data.data;case 4:case"end":return t.stop()}}),t)})))()}}},v=b,C=(a("c321"),Object(m["a"])(v,r,n,!1,null,"493bd55c",null));t["default"]=C.exports},c321:function(e,t,a){"use strict";var r=a("4736"),n=a.n(r);n.a},c754:function(e,t,a){"use strict";var r=a("9256"),n={productCategory:"/productCategory/findPageCategory",addCategory:"/productCategory/addCategory",uploadCategory:"/productCategory/updateCategory",deletCategory:"/productCategory/delCategory",queryOneCategory:"/productCategory/queryOneCategory",queryChildCategory:"/productCategory/queryChildCategory"};t["a"]={deletCategory:function(e){return Object(r["a"])({method:"POST",url:n.deletCategory,data:e})},queryChildCategory:function(e){return Object(r["a"])({method:"POST",url:n.queryChildCategory,data:e})},queryOneCategory:function(e){return Object(r["a"])({method:"POST",url:n.queryOneCategory,data:e})},getProductCategory:function(e){return Object(r["a"])({method:"POST",url:n.productCategory,data:e})},addCategory:function(e){return Object(r["a"])({method:"POST",url:n.addCategory,data:e})},uploadCategory:function(e){return Object(r["a"])({method:"POST",url:n.uploadCategory,data:e})}}},ef6b:function(e,t,a){"use strict";var r=a("bb7c"),n=a.n(r);n.a},f0e3:function(e,t,a){"use strict";var r=a("48dc"),n=a.n(r);n.a}}]);