beehole-store-server
Version:
www.bee-hole.com
1 lines • 4.22 kB
JavaScript
(window["webpackJsonp"]=window["webpackJsonp"]||[]).push([["chunk-5d6c701b"],{"085f":function(t,e,n){"use strict";n.r(e);var i=n("5530"),a=n("5880"),o=n("1b6c"),s=n("b7d9"),r={props:{text:String},data:function(){return{value:this.text,editable:!1}},methods:{handleChange:function(t){var e=t.target.value;this.value=e},check:function(){this.editable=!1,this.$emit("change",this.value)},edit:function(){this.editable=!0}}};e["default"]={name:"synConfig",computed:Object(i["a"])({},Object(a["mapGetters"])(["shopId"])),components:{EditableCell:r},created:function(){this.getSynConfigList()},data:function(){return{dataSource:[],count:0,columns:[{title:Object(o["a"])("view.item.component.item.syn.syntype.title"),dataIndex:"syn_type"},{title:Object(o["a"])("view.item.component.item.syn.api_url.title"),dataIndex:"api_url"},{title:Object(o["a"])("view.item.component.item.syn.app_key.title"),dataIndex:"app_key"},{title:Object(o["a"])("view.item.component.item.syn.app_secret.title"),dataIndex:"app_secret"},{title:Object(o["a"])("view.item.component.item.syn.token.title"),dataIndex:"token"},{title:Object(o["a"])("view.item.component.item.syn.operation.title"),dataIndex:"operation",scopedSlots:{customRender:"operation"},width:"20%"}],ModalText:"",visible:!1,confirmLoading:!1,formData:{id:null,syntype:"",api_url:"",app_key:"",app_secret:"",token:"",data:{store_id:null}},platform:[{name:"dhf",value:"dhf"},{name:"shopify",value:"shopify"},{name:"amazon",value:"amazon"}]}},methods:{onDelete:function(t){var e=this;if(t.id){var n={id:t.id};Object(s["a"])(n).then((function(t){0===t.code&&(e.$message.info(Object(o["a"])("view.item.component.item.syn.operation.del.info")),e.getSynConfigList())}))}},getSynConfigList:function(){var t=this;Object(s["b"])().then((function(e){0===e.code&&e.list?(t.dataSource=e.list,t.count=e.list.length):t.dataSource=[]}))},getSynConfigOne:function(t){var e=this,n={id:t};Object(s["b"])(n).then((function(t){if(0===t.code&&t.list&&(e.visible=!0,e.formData.id=t.list[0].id,e.formData.syntype=t.list[0].syn_type,e.formData.api_url=t.list[0].api_url,e.formData.app_key=t.list[0].app_key,e.formData.app_secret=t.list[0].app_secret,e.formData.token=t.list[0].token,e.formData.data)){var n=JSON.parse(t.list[0].data);e.formData.data.store_id=n.store_id}}))},showModal:function(){this.visible=!0},handleOk:function(){var t=this;if(""!==this.formData.app_key&&""!==this.formData.app_secret){var e={syntype:this.formData.syntype,api_url:this.formData.api_url,app_key:this.formData.app_key,app_secret:this.formData.app_secret,token:this.formData.token};this.formData.data&&(e.data=JSON.stringify(this.formData.data)),this.formData.id&&(e.id=this.formData.id),Object(s["c"])(e).then((function(e){0===e.code?(t.$message.info(Object(o["a"])("view.item.component.item.syn.operation.add.info")),t.visible=!1,t.confirmLoading=!1,t.getSynConfigList(),t.formData={id:null,syntype:"",api_url:"",app_key:"",app_secret:"",token:"",data:{store_id:null}}):(t.$message.error(Object(o["a"])("view.item.component.item.syn.operation.add.error.info")),t.visible=!1,t.confirmLoading=!1)}))}else this.$message.error(Object(o["a"])("view.item.component.item.syn.operation.add.add.error.info"))},handleCancel:function(t){this.visible=!1,this.formData={id:null,syntype:"",api_url:"",app_key:"",app_secret:"",token:"",data:{store_id:null}}}}}},"1b6c":function(t,e,n){"use strict";n.d(e,"a",(function(){return o})),n.d(e,"b",(function(){return s}));var i=n("5530"),a=n("bf0f");function o(t,e){return function(){return Object(a["b"])(t,Object(i["a"])({},e))}}function s(t,e){return Object(a["b"])(t,Object(i["a"])({},e))}},b7d9:function(t,e,n){"use strict";n.d(e,"d",(function(){return o})),n.d(e,"b",(function(){return s})),n.d(e,"c",(function(){return r})),n.d(e,"a",(function(){return c}));var i=n("b775"),a={synTrigger:"/syngoods/trigger",synList:"/synconfig/list",synSave:"/synconfig/save",synDel:"/synconfig/del"};function o(t){return Object(i["b"])({url:a.synTrigger,method:"post",data:t})}function s(t){return Object(i["b"])({url:a.synList,method:"post",data:t})}function r(t){return Object(i["b"])({url:a.synSave,method:"post",data:t})}function c(t){return Object(i["b"])({url:a.synDel,method:"post",data:t})}}}]);