UNPKG

beehole-store-server

Version:

www.bee-hole.com

1 lines 8.33 kB
(window["webpackJsonp"]=window["webpackJsonp"]||[]).push([["chunk-7d015d92"],{"1b6c":function(e,t,n){"use strict";n.d(t,"a",(function(){return o})),n.d(t,"b",(function(){return s}));var c=n("5530"),i=n("bf0f");function o(e,t){return function(){return Object(i["b"])(e,Object(c["a"])({},t))}}function s(e,t){return Object(i["b"])(e,Object(c["a"])({},t))}},abbd:function(e,t,n){"use strict";n.r(t);var c=n("5530"),i=(n("d81d"),n("c740"),n("a434"),n("b0c0"),n("c7a1")),o=n("b9ab"),s=n("5d9e"),a=n("1b6c"),r=n("5880");t["default"]={name:"PsArea",data:function(){return{labelCol:{span:6},wrapperCol:{span:18},formData:{shop_id:"",lang:"zh-CN",name:"PsCountry"},countryList:[],selectedRowKeys:[],List:[],queryParam:{page:1,limit:10},columns:[{title:Object(a["a"])("view.config.psArea.table.columns.id"),dataIndex:"key",width:"100px",scopedSlots:{customRender:"key"}},{title:Object(a["a"])("view.config.psArea.table.columns.code"),dataIndex:"simple_speech",width:"200px",scopedSlots:{customRender:"simple_speech"}},{title:Object(a["a"])("view.config.psArea.table.columns.country"),dataIndex:"name",width:"200px",scopedSlots:{customRender:"name"}},{title:Object(a["a"])("view.config.psArea.table.columns.open.id"),dataIndex:"id_card",scopedSlots:{customRender:"id_card"}}],loading:!1}},components:{CountryList:o["a"],AdvanceTable:s["a"]},computed:Object(c["a"])({},Object(r["mapGetters"])(["shopId"])),created:function(){this.getList()},methods:{getList:function(){var e=this;Object(i["b"])({shop_id:this.shopId,name:"PsCountry"}).then((function(t){t.list&&t.list.length&&(e.countryList=JSON.parse(t.list[0].config))}))},onSelectChange:function(e,t){this.selectedRowKeys=e},changeSize:function(e,t){this.queryParam.page=e,this.queryParam.limit=t,this.getList()},deleteKeys:function(){var e=this;this.$confirm({title:this.$t("view.config.psArea.confirm.delete.title"),content:this.$t("view.config.psArea.confirm.delete.context"),onOk:function(){e._.map(e.selectedRowKeys,(function(t){var n=e._.findIndex(e.countryList,{key:t});-1!==n&&e.countryList.splice(n,1)})),Object(i["a"])({config:JSON.stringify(e.countryList),shop_id:e.shopId,lang:"zh-CN",name:"PsCountry",is_default:1}).then((function(t){e.getList()}))},onCancel:function(){}})},changeIdCard:function(e,t){var n=this,c="",o="";e?(c="确认开启身份验证?",o="开启身份验证后,客户从商城下单收货地址填写当前国家后,则需要填写身份信息,否则无法完成下单。"):(c="确认关闭身份验证?",o="关闭身份验证后,客户无需填写身份信息即可完成下单。"),this.$confirm({title:c,content:o,okText:"确认",cancelText:"取消",onOk:function(){for(var c in t.is_open=e?"1":"2",n.countryList)n.countryList[c].key===t.key?n.countryList[c].is_open=t.is_open:n.countryList[c].is_open||(n.countryList[c].is_open="2");var o=JSON.parse(JSON.stringify(n.formData)),s={config:JSON.stringify(n.countryList),shop_id:n.shopId,lang:"zh-CN",name:o.name,is_default:1};Object(i["a"])(s).then((function(e){n.getList()}))},onCancel:function(){}})}}}},b9ab:function(e,t,n){"use strict";n("d3b7"),n("ddb0"),n("b0c0");var c=function(){var e=this,t=e._self._c;return t("div",[e.hiddenBtn?e._e():t("a-button",{attrs:{type:"primary"},on:{click:function(t){return t.target!==t.currentTarget?null:e.openModal.apply(null,arguments)}}},[e._v(" "+e._s(e.$t("compoent.countryList.btn"))+" ")]),e.open?t("ant-modal",{attrs:{visible:e.open,"modal-title":e.formTitle,"adjust-size":!0,modalHeight:"580",modalWidth:e.getWidth},on:{cancel:e.cancel,ok:e.backChecked}},[t("div",{attrs:{slot:"content"},slot:"content"},[t("a-tree",{attrs:{checkable:"","tree-data":e.treeData,"replace-fields":e.fieldNames,selectedKeys:e.keys,checkedKeys:e.checkedKeys},on:{select:e.onSelect,check:e.onCheck},scopedSlots:e._u([{key:"title",fn:function(n){var c=n.name,i=n.key;return["0-0-1"===i?t("span",{staticStyle:{color:"#1890ff"}},[e._v(e._s(c))]):[e._v(e._s(c))]]}}],null,!1,3052740220)})],1)]):e._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"),l=n("c7a1"),h=n("5880"),f={name:"catCheckbox",components:{AntModal:r["a"],AdvanceTable:d["a"]},computed:Object(o["a"])(Object(o["a"])({},Object(h["mapGetters"])(["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 e=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(t){e.selectedRowKeys.push(t.id),e.selectedRows.push(t)})):"string"===typeof this.checked[0]&&"number"===typeof this.checked[0]&&(this.selectedRowKeys=this.checked))},getList:function(){var e=this;Object(a["b"])().then((function(t){e.fieldNames={children:"child",title:"name"},Object(l["b"])({name:e.formData.name,shop_id:e.shopId}).then((function(t){if(t.list&&t.list.length)try{e.checkedKeys=[];var n=JSON.parse(t.list[0].config);e.selectedCountry=n,e._.map(n,(function(t){e.checkedKeys.push(t.key)}))}catch(c){}})),e.treeData=t.list}))},cancel:function(){this.open=!1},backChecked:function(){var e=this,t=JSON.parse(JSON.stringify(this.formData)),n={config:JSON.stringify(this.selectedCountry),shop_id:this.shopId,lang:"zh-CN",name:t.name,is_default:1};Object(l["a"])(n).then((function(t){e.$message.info(Object(u["b"])("api.info.operation")),e.$emit("ok",e.selectedCountry),e.cancel()}))},initColunmns:function(){this.getList()},onSelect:function(e,t){},onCheck:function(e,t){var n=this;this.checkedKeys=e;var c=t.checked,i=t.node.dataRef;if(c)if(i.child){var o=i.child[0];o.child?this._.map(i.child,(function(e){e.child&&n._.map(e.child,(function(e){var t=n._.findIndex(n.selectedCountry,{key:e.key});-1===t&&n.selectedCountry.push(e)}))})):this._.map(i.child,(function(e){var t=n._.findIndex(n.selectedCountry,{key:e.key});-1===t&&n.selectedCountry.push(e)}))}else this.selectedCountry.push(i);else if(i.child){var s=i.child[0];s.child?this._.map(i.child,(function(e){e.child&&n._.map(e.child,(function(e){var t=n._.findIndex(n.selectedCountry,{key:e.key});-1!==t&&n.selectedCountry.splice(t,1)}))})):this._.map(i.child,(function(e){var t=n._.findIndex(n.selectedCountry,{key:e.key});-1!==t&&n.selectedCountry.splice(t,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"])({},f),m=p,y=n("2877"),b=Object(y["a"])(m,c,i,!1,null,null,null);t["a"]=b.exports},c7a1:function(e,t,n){"use strict";n.d(t,"a",(function(){return o})),n.d(t,"b",(function(){return s})),n.d(t,"d",(function(){return a})),n.d(t,"e",(function(){return r})),n.d(t,"f",(function(){return d})),n.d(t,"g",(function(){return u})),n.d(t,"c",(function(){return l}));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(e){return Object(c["b"])({url:i.configAdd,method:"post",data:e})}function s(e){return Object(c["b"])({url:i.configList,method:"post",params:e})}function a(e){return Object(c["b"])({url:i.huobiGet,method:"get",params:e})}function r(e){return Object(c["b"])({url:i.huobiSet,method:"post",params:e})}function d(e){return Object(c["b"])({url:i.systemGet,method:"post",params:e})}function u(e){return Object(c["b"])({url:i.systemSet,method:"post",data:e})}function l(e){return Object(c["b"])({url:i.copyrightApi,method:"post",data:e})}},d9a1:function(e,t,n){"use strict";n.d(t,"a",(function(){return i})),n.d(t,"b",(function(){return o}));var c=n("b775");function i(e){return Object(c["b"])({url:"/benefit_code/country_list",method:"post",params:e})}function o(e){return Object(c["b"])({url:"/benefit_code/zend_country_list",method:"post",params:e})}}}]);