UNPKG

beehole-store-server

Version:

www.bee-hole.com

1 lines 6.74 kB
(window["webpackJsonp"]=window["webpackJsonp"]||[]).push([["chunk-7d00b296"],{"1b6c":function(t,e,n){"use strict";n.d(e,"a",(function(){return o})),n.d(e,"b",(function(){return s}));var c=n("5530"),i=n("bf0f");function o(t,e){return function(){return Object(i["b"])(t,Object(c["a"])({},e))}}function s(t,e){return Object(i["b"])(t,Object(c["a"])({},e))}},a62d:function(t,e,n){"use strict";n.r(e);var c=n("5530"),i=n("c7a1"),o=n("b9ab"),s=n("5d9e"),a=n("2f62"),r=n("1b6c");e["default"]={name:"pushConfig",data:function(){return{formData:{business_no:"",secret:"",wms_id:"",shop_code:""}}},components:{CountryList:o["a"],AdvanceTable:s["a"]},computed:Object(c["a"])({},Object(a["c"])(["shopId"])),created:function(){this.getList()},methods:{getList:function(){var t=this;Object(i["b"])({shop_id:this.shopId,name:"pushConfig"}).then((function(e){e.list&&e.list.length&&(t.config=JSON.parse(e.list[0].config),t.formData.business_no=t.config.business_no,t.formData.secret=t.config.secret,t.formData.wms_id=t.config.wms_id,t.formData.shop_code=t.config.shop_code)}))},onSubmit:function(){var t=this,e=this;return this.formData.business_no&&this.formData.secret?void Object(i["a"])({config:JSON.stringify(this.formData),shop_id:e.shopId,lang:"zh-CN",name:"pushConfig",is_default:1}).then((function(n){t.$message.info(Object(r["b"])("view.config.pushconfig.submit.callback")),e.getList()})):(this.$message.info(Object(r["b"])("view.config.pushconfig.please_input")),!1)}}}},b9ab:function(t,e,n){"use strict";n("d3b7"),n("ddb0"),n("b0c0");var c=function(){var t=this,e=t._self._c;return e("div",[t.hiddenBtn?t._e():e("a-button",{attrs:{type:"primary"},on:{click:function(e){return e.target!==e.currentTarget?null:t.openModal.apply(null,arguments)}}},[t._v(" "+t._s(t.$t("compoent.countryList.btn"))+" ")]),t.open?e("ant-modal",{attrs:{visible:t.open,"modal-title":t.formTitle,"adjust-size":!0,modalHeight:"580",modalWidth:t.getWidth},on:{cancel:t.cancel,ok:t.backChecked}},[e("div",{attrs:{slot:"content"},slot:"content"},[e("a-tree",{attrs:{checkable:"","tree-data":t.treeData,"replace-fields":t.fieldNames,selectedKeys:t.keys,checkedKeys:t.checkedKeys},on:{select:t.onSelect,check:t.onCheck},scopedSlots:t._u([{key:"title",fn:function(n){var c=n.name,i=n.key;return["0-0-1"===i?e("span",{staticStyle:{color:"#1890ff"}},[t._v(t._s(c))]):[t._v(t._s(c))]]}}],null,!1,3052740220)})],1)]):t._e()],1)},i=[],o=n("5530"),s=n("53ca"),a=(n("d81d"),n("c740"),n("a434"),n("d9a1")),r=n("2dd7"),d=n("5d9e"),u=n("1b6c"),h=n("c7a1"),f=n("2f62"),l={name:"catCheckbox",components:{AntModal:r["a"],AdvanceTable:d["a"]},computed:Object(o["a"])(Object(o["a"])({},Object(f["c"])(["shopId","isMobile"])),{},{getWidth:function(){return this.isMobile?"350":"1200"}}),data:function(){return{open:!1,formTitle:Object(u["b"])("compoent.countryList.modal.title"),loading:!1,defaults:[{value:1,key:"1",name:"默认"},{value:0,key:"0",name:"不默认"}],fieldNames:[],treeData:[],keys:[],selectedCountry:[],formData:{shop_id:"",lang:"zh-CN",name:"PsCountry"},checkedKeys:[]}},props:{type:{default:"radio"},hiddenBtn:!1,checked:[]},created:function(){this.initColunmns()},methods:{openModal:function(){var t=this;this.open=!0,this.getList(),this.selectedRowKeys=[],this.selectedRows=[],"checkbox"===this.type&&this.checked&&this.checked.length&&("object"===Object(s["a"])(this.checked[0])?this._.map(this.checked,(function(e){t.selectedRowKeys.push(e.id),t.selectedRows.push(e)})):"string"===typeof this.checked[0]&&"number"===typeof this.checked[0]&&(this.selectedRowKeys=this.checked))},getList:function(){var t=this;Object(a["b"])().then((function(e){t.fieldNames={children:"child",title:"name"},Object(h["b"])({name:t.formData.name,shop_id:t.shopId}).then((function(e){if(e.list&&e.list.length)try{t.checkedKeys=[];var n=JSON.parse(e.list[0].config);t.selectedCountry=n,t._.map(n,(function(e){t.checkedKeys.push(e.key)}))}catch(c){}})),t.treeData=e.list}))},cancel:function(){this.open=!1},backChecked:function(){var t=this,e=JSON.parse(JSON.stringify(this.formData)),n={config:JSON.stringify(this.selectedCountry),shop_id:this.shopId,lang:"zh-CN",name:e.name,is_default:1};Object(h["a"])(n).then((function(e){t.$message.info(Object(u["b"])("api.info.operation")),t.$emit("ok",t.selectedCountry),t.cancel()}))},initColunmns:function(){this.getList()},onSelect:function(t,e){},onCheck:function(t,e){var n=this;this.checkedKeys=t;var c=e.checked,i=e.node.dataRef;if(c)if(i.child){var o=i.child[0];o.child?this._.map(i.child,(function(t){t.child&&n._.map(t.child,(function(t){var e=n._.findIndex(n.selectedCountry,{key:t.key});-1===e&&n.selectedCountry.push(t)}))})):this._.map(i.child,(function(t){var e=n._.findIndex(n.selectedCountry,{key:t.key});-1===e&&n.selectedCountry.push(t)}))}else this.selectedCountry.push(i);else if(i.child){var s=i.child[0];s.child?this._.map(i.child,(function(t){t.child&&n._.map(t.child,(function(t){var e=n._.findIndex(n.selectedCountry,{key:t.key});-1!==e&&n.selectedCountry.splice(e,1)}))})):this._.map(i.child,(function(t){var e=n._.findIndex(n.selectedCountry,{key:t.key});-1!==e&&n.selectedCountry.splice(e,1)}))}else{var a=this._.findIndex(this.selectedCountry,{key:i.key});-1!==a&&this.selectedCountry.splice(a,1)}},changeLang:function(){},changeDefault:function(){}}},p=Object(o["a"])({},l),b=p,m=n("2877"),y=Object(m["a"])(b,c,i,!1,null,null,null);e["a"]=y.exports},c7a1:function(t,e,n){"use strict";n.d(e,"a",(function(){return o})),n.d(e,"b",(function(){return s})),n.d(e,"d",(function(){return a})),n.d(e,"e",(function(){return r})),n.d(e,"f",(function(){return d})),n.d(e,"g",(function(){return u})),n.d(e,"c",(function(){return h}));var c=n("b775"),i={configAdd:"/mallconfig/save",configList:"/mallconfig/list",huobiGet:"/pmethod/currency/get",huobiSet:"/pmethod/currencyrates/set",systemGet:"/config/sys/get",systemSet:"/config/sys/set",copyrightApi:"/config/copyright"};function o(t){return Object(c["b"])({url:i.configAdd,method:"post",data:t})}function s(t){return Object(c["b"])({url:i.configList,method:"post",params:t})}function a(t){return Object(c["b"])({url:i.huobiGet,method:"get",params:t})}function r(t){return Object(c["b"])({url:i.huobiSet,method:"post",params:t})}function d(t){return Object(c["b"])({url:i.systemGet,method:"post",params:t})}function u(t){return Object(c["b"])({url:i.systemSet,method:"post",data:t})}function h(t){return Object(c["b"])({url:i.copyrightApi,method:"post",data:t})}},d9a1:function(t,e,n){"use strict";n.d(e,"a",(function(){return i})),n.d(e,"b",(function(){return o}));var c=n("b775");function i(t){return Object(c["b"])({url:"/benefit_code/country_list",method:"post",params:t})}function o(t){return Object(c["b"])({url:"/benefit_code/zend_country_list",method:"post",params:t})}}}]);