UNPKG

beehole-store-server

Version:

www.bee-hole.com

1 lines 8.44 kB
(window["webpackJsonp"]=window["webpackJsonp"]||[]).push([["chunk-d757ac5e"],{"6be3":function(t,e,i){"use strict";i("b0c0");var a=function(){var t=this,e=t._self._c;return e("div",[t.catLists&&t.catLists.length?e("a-select",{attrs:{placeholder:"请选择","allow-clear":"",getPopupContainer:function(t){return t.parentNode},disabled:0!=t.readOnly},on:{change:t.back},model:{value:t.checkedcatId,callback:function(e){t.checkedcatId=e},expression:"checkedcatId"}},[0!=t.readOnly?e("div",{attrs:{slot:"suffixIcon"},slot:"suffixIcon"}):t._e(),t._l(t.catLists,(function(i,a){return e("a-select-option",{key:a,attrs:{value:i.cat_id}},[t._v(t._s(t.$t(i.name)))])}))],2):t._e()],1)},n=[],c=i("5530"),d=i("dcb0"),s=i("2f62"),o={name:"CatSelect",props:{viewId:{default:""},pCatId:{default:0},readOnly:{default:0}},computed:Object(c["a"])({},Object(s["c"])(["shopId"])),data:function(){return{catLists:[],checkedcatId:this.pCatId}},created:function(){this.initLit()},watch:{viewId:function(t,e){t!==e&&this.initLit()}},methods:{initLit:function(){var t=this;Object(d["f"])({shop_id:this.shopId,view_id:this.viewId}).then((function(e){e.list.unshift({cat_id:0,name:"view.test.list.form.pcat_1"}),t.catLists=e.list}))},back:function(){this.$emit("update:pCatId",this.checkedcatId),this.$emit("change",this.checkedcatId)}}},r=Object(c["a"])({},o),u=r,h=i("2877"),l=Object(h["a"])(u,a,n,!1,null,null,null);e["a"]=l.exports},"8ebd":function(t,e,i){"use strict";var a=function(){var t=this,e=t._self._c;return e("a-tooltip",[e("template",{slot:"title"},[t._v(" "+t._s(t.$t("app.form.ai.ts"))+" ")]),e("a-switch",{attrs:{"checked-children":t.$t("app.form.ai.open"),"un-checked-children":t.$t("app.form.ai.close")},on:{change:t.back},model:{value:t.checked,callback:function(e){t.checked=e},expression:"checked"}})],2)},n=[],c=i("5530"),d={name:"ai",props:{value:{default:1},id:{default:-1}},data:function(){return{checked:!0}},watch:{value:function(){this.checked=!!this.value}},created:function(){-1!==this.id&&void 0!==this.id||this.back()},methods:{back:function(){var t=0;this.checked&&(t=1),this.$emit("update:value",t),this.$emit("change",t)}}},s=Object(c["a"])({},d),o=s,r=i("2877"),u=Object(r["a"])(o,a,n,!1,null,null,null);e["a"]=u.exports},"8f0e":function(t,e,i){"use strict";var a=i("5530"),n=(i("a9e3"),i("d81d"),i("7db0"),i("d3b7"),i("d047")),c=i("2f62");e["a"]={name:"ViewSelect",props:{viewId:{type:Number,default:0},lang:{type:String},backVal:{type:String,default:"viewId"}},computed:Object(a["a"])({},Object(c["c"])(["shopId"])),data:function(){return{viewLists:[],checkedViewId:0,checkedLang:""}},created:function(){this.checkedViewId||(this.checkedViewId=this.viewId),this.checkedLang&&""!==this.checkedLang||(this.checkedLang=this.lang),this.initLit()},methods:{initLit:function(){var t=this;Object(n["i"])({ShopId:this.shopId,limit:100,page:1}).then((function(e){t._.map(e.list,(function(e){1===e.is_default&&t.$emit("update:defaultLang",e.language)})),"viewId"===t.backVal?(t.viewLists=e.list,e.list&&(t.checkedLang=t.viewLists[0].language,t.checkedViewId=t.viewLists[0].view_id,t.back())):(t.viewLists=e.list,t.viewList&&(t.checkedLang=t.viewLists[0].language,t.checkedViewId=t.viewLists[0].view_id,t.back()))}))},back:function(t){var e=this,i=this.viewLists.find((function(t){return"viewId"===e.backVal?t.view_id===e.checkedViewId:t.language===e.checkedLang}));"viewId"===this.backVal?(this.checkedLang=i.language,this.$emit("change",this.checkedViewId,this.checkedLang)):(this.checkedViewId=i.view_id,this.$emit("change",this.checkedLang,this.checkedViewId)),this.$emit("changeView",i)}}}},bf9b:function(t,e,i){"use strict";i("b0c0");var a=function(){var t=this,e=t._self._c;return e("div",[t.viewLists&&t.viewLists.length?["viewId"==t.backVal?e("a-tabs",{attrs:{animated:!1},on:{change:t.back},model:{value:t.checkedViewId,callback:function(e){t.checkedViewId=e},expression:"checkedViewId"}},t._l(t.viewLists,(function(t){return e("a-tab-pane",{key:t.view_id,attrs:{tab:t.name}})})),1):e("a-tabs",{attrs:{animated:!1},on:{change:t.back},model:{value:t.checkedLang,callback:function(e){t.checkedLang=e},expression:"checkedLang"}},t._l(t.viewLists,(function(t){return e("a-tab-pane",{key:t.language,attrs:{tab:t.name}})})),1)]:t._e()],2)},n=[],c=i("5530"),d=i("8f0e"),s=Object(c["a"])({},d["a"]),o=s,r=i("2877"),u=Object(r["a"])(o,a,n,!1,null,null,null);e["a"]=u.exports},c2f7:function(t,e,i){"use strict";i.r(e);var a=i("5530"),n=(i("b0c0"),i("2dd7")),c=i("dcb0"),d=i("1b6c"),s=i("2f62"),o=i("fb04"),r=i("bf9b"),u=i("6be3"),h=i("8ebd"),l=i("50af");e["default"]={name:"CareteCat",components:{AntModal:n["a"],AttachList:o["a"],ViewTabs:r["a"],CatList:u["a"],ai:h["a"],aiTs:l["a"]},props:{viewId:0},computed:Object(a["a"])({},Object(s["c"])(["shopId","isMobile"])),data:function(){return{open:!1,formData:{name:"",p_cat_id:0},formTitle:"",rules:{name:[{required:!0,message:Object(d["a"])("分类名不能为空"),trigger:"blur"}]},image_url:Object(d["a"])("view.test.list.form.image_url"),catname:Object(d["a"])("view.test.list.form.name"),view_id:this.viewId,aiTsUpdate:!1,lang:"",defaultLang:""}},created:function(){},methods:{handleAdd:function(){this.open=!0,this.formTitle=Object(d["b"])("view.test.form.add.modal.title")},handleEdit:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},e=this,i={cat_id:t.cat_id};t.view_id&&(i.view_id=t.view_id),Object(c["c"])(i).then((function(t){e.formData=t,e.open=!0,e.formTitle="编辑"+t.name}))},cancel:function(){this.open=!1,this.$emit("close")},submitForm:function(){var t=this,e=this;this.$refs.form.validate((function(i){if(i){if(t.aiTsUpdate)return t.$message.warning(t.$t("view.test.form.add.message.aiUpdate")),!1;var a=JSON.parse(JSON.stringify(t.formData));e.shopId&&(a.shop_id=e.shopId),a.cat_id&&(a.view_id=e.view_id),Object(c["a"])(a).then((function(t){if("ok"===t.result){e.$message.info(e.$t("view.test.form.add.message.success"));var i=new Date,n=i.getFullYear()+"-"+(1+i.getMonth())+"-"+i.getDate();a.cat_id,e.$emit("ok",Object.assign({id:Math.random(100),created_at:n},a))}}))}}))},changeView:function(t,e){this.view_id=t,this.lang=e,this.handleEdit({cat_id:this.formData.cat_id,view_id:t})}}}},d047:function(t,e,i){"use strict";i.d(e,"i",(function(){return c})),i.d(e,"h",(function(){return d})),i.d(e,"b",(function(){return s})),i.d(e,"f",(function(){return o})),i.d(e,"a",(function(){return r})),i.d(e,"d",(function(){return u})),i.d(e,"g",(function(){return h})),i.d(e,"e",(function(){return l})),i.d(e,"c",(function(){return f}));var a=i("b775"),n={list:"/shop/view/list"};function c(t){return Object(a["b"])({url:n.list,method:"post",data:t})}function d(t){return Object(a["b"])({url:"/shop/view/add",method:"post",data:t})}function s(t){return Object(a["b"])({url:"/shop/view/close_auto_trans",method:"post",data:t})}function o(t){return Object(a["b"])({url:"/shop/view/open_auto_trans",method:"post",data:t})}function r(t){return Object(a["b"])({url:"/trans_task/add_shop_job",method:"post",data:t})}function u(t){return Object(a["b"])({url:"/shop/getinfo",method:"post",data:t})}function h(t){return Object(a["b"])({url:"/mall_config/save",method:"post",data:t})}function l(t){return Object(a["b"])({url:"/lang/get",method:"post",data:t})}function f(t){return Object(a["b"])({url:"/mall_config/get",method:"post",data:t})}},dcb0:function(t,e,i){"use strict";i.d(e,"d",(function(){return c})),i.d(e,"a",(function(){return d})),i.d(e,"c",(function(){return s})),i.d(e,"b",(function(){return o})),i.d(e,"g",(function(){return r})),i.d(e,"e",(function(){return u})),i.d(e,"f",(function(){return h}));var a=i("b775"),n={catlist:"/cat/list",catadd:"/cat/add",catInfo:"/cat/info",catDelete:"/cat/delete",publicCatList:"/standard/cat",infoList:"/good/info/list",parentList:"/cat/parent/list",cartSubAdd:"/cat/sub/add"};function c(t){return Object(a["b"])({url:n.catlist,method:"post",params:t})}function d(t){var e=t.view_id?n.cartSubAdd:n.catadd;return Object(a["b"])({url:e,method:"post",params:t}).then((function(){return{result:"ok",cat_id:12}}))}function s(t){return Object(a["b"])({url:n.catInfo,method:"post",params:t})}function o(t){return Object(a["b"])({url:n.catDelete,method:"post",params:t})}function r(t){return Object(a["b"])({url:n.publicCatList,method:"post",params:t})}function u(t){return Object(a["b"])({url:n.infoList,method:"post",params:t})}function h(t){return Object(a["b"])({url:n.parentList,method:"post",params:t})}}}]);