chunk-3bd14959.5bf4b67c.js 18 KB

1
  1. (window["webpackJsonp"]=window["webpackJsonp"]||[]).push([["chunk-3bd14959"],{"15fd":function(e,t,a){"use strict";a.d(t,"a",(function(){return i}));a("a4d3");function n(e,t){if(null==e)return{};var a={};for(var n in e)if({}.hasOwnProperty.call(e,n)){if(-1!==t.indexOf(n))continue;a[n]=e[n]}return a}function i(e,t){if(null==e)return{};var a,i,c=n(e,t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);for(i=0;i<r.length;i++)a=r[i],-1===t.indexOf(a)&&{}.propertyIsEnumerable.call(e,a)&&(c[a]=e[a])}return c}},"3bc1":function(e,t,a){"use strict";var n=function(){var e=this,t=e._self._c;return e.pageInfo.rowTotal?t("div",{staticClass:"crm_pagination"},[t("div",{staticClass:"crm_page_total"},[t("span",{directives:[{name:"t",rawName:"v-t",value:"Page.total.item1",expression:"'Page.total.item1'"}]}),t("span",[e._v(e._s(e.pageInfo.rowTotal))]),t("span",{directives:[{name:"t",rawName:"v-t",value:"Page.total.item2",expression:"'Page.total.item2'"}]})]),t("el-pagination",{staticClass:"page",attrs:{background:"",layout:"sizes, prev, pager, next","page-sizes":[10,20,50,100],"page-size":e.pageInfo.row,total:e.pageInfo.rowTotal},on:{"current-change":e.handleCurrentChange,"size-change":e.handleSizeChange}})],1):e._e()},i=[],c={name:"PagePagination",components:{},props:{pagerInfo:{type:Object,required:!0}},computed:{pageInfo:function(){return this.pagerInfo}},methods:{handleCurrentChange:function(e){this.$emit("current-change",e)},handleSizeChange:function(e){this.$emit("size-change",e)}}},r=c,l=a("2877"),o=Object(l["a"])(r,n,i,!1,null,"3121aa56",null);t["a"]=o.exports},6593:function(e,t,a){},9743:function(e,t,a){"use strict";a.r(t);a("99af"),a("ac1f"),a("841c"),a("498a");var n=function(){var e,t,a=this,n=a._self._c;return n("div",{directives:[{name:"loading",rawName:"v-loading",value:a.pictLoading,expression:"pictLoading"}],staticClass:"view",attrs:{id:"card_Blockchain","element-loading-background":"rgba(43, 48, 67, 0.65)","element-loading-spinner":"el-icon-loading"}},[n("div",{staticClass:"crm_search"},[n("el-form",{ref:"form",attrs:{"label-position":"",model:a.search,"label-width":""}},[n("el-row",[n("el-col",{attrs:{span:24,md:24,lg:24}},[n("el-form-item",{staticStyle:{"margin-right":"10px"}},[n("el-input",{staticClass:"crm-border-radius-no",staticStyle:{"margin-top":"5px"},attrs:{clearable:"",size:"small",placeholder:a.$t("Placeholder.Input")},nativeOn:{keyup:function(e){return!e.type.indexOf("key")&&a._k(e.keyCode,"enter",13,e.key,"Enter")?null:a.toSearch.apply(null,arguments)}},model:{value:a.search.alias,callback:function(e){a.$set(a.search,"alias","string"===typeof e?e.trim():e)},expression:"search.alias"}},[n("template",{slot:"prepend"},[n("span",{staticClass:"crm-cursor crm-border-radius-no"},[a._v(" "+a._s(a.$t("Ucard.Blockchain.pageT1"))+" ")])])],2)],1),n("el-form-item",{staticStyle:{"margin-right":"10px"}},[n("el-select",{staticClass:"crm-border-radius-no",attrs:{clearable:"",size:"small",placeholder:a.$t("Ucard.Blockchain.pageT2")},on:{change:a.toSearch},model:{value:a.search.blockchain,callback:function(e){a.$set(a.search,"blockchain",e)},expression:"search.blockchain"}},a._l(a.opts,(function(e,t){return n("el-option",{key:t,attrs:{label:e,value:e}})})),1)],1),n("el-form-item",[n("el-select",{staticClass:"crm-border-radius-no",attrs:{clearable:"",size:"small",placeholder:a.$t("Ucard.Blockchain.pageT3")},on:{change:a.toSearch},model:{value:a.search.enableStatus,callback:function(e){a.$set(a.search,"enableStatus",e)},expression:"search.enableStatus"}},a._l(a.enableStatus,(function(e,t){return n("el-option",{key:t,attrs:{label:a.$t(e),value:t}})})),1)],1),n("el-form-item",[n("el-button",{staticClass:"crm-border-radius-no crm-border-left-no",attrs:{size:"small",icon:"el-icon-search"},on:{click:a.toSearch}})],1)],1)],1),n("el-form-item",[null!==(e=a.display["R-Card-Blockchain-Add"])&&void 0!==e&&e.show?n("el-button",{attrs:{size:"small",type:"primary",icon:"el-icon-plus"},on:{click:a.openAddDialog}},[a._v(" "+a._s(a.$t("R-Card-Blockchain-Add"))+" ")]):a._e(),null!==(t=a.display["R-Card-Blockchain-Delete"])&&void 0!==t&&t.show?n("el-button",{attrs:{size:"small",disabled:!a.multipleSelection.length,type:a.multipleSelection.length?"primary":"info",icon:"el-icon-minus"},on:{click:a.toDelete}},[a._v(" "+a._s(a.$t("R-Card-Blockchain-Delete"))+" ")]):a._e()],1)],1)],1),n("el-table",{staticStyle:{width:"100%"},attrs:{data:a.mock_tableData,stripe:""},on:{"selection-change":a.handleSelectionChange}},[n("el-table-column",{attrs:{align:"left",type:"selection",width:"55"}}),n("el-table-column",{attrs:{prop:"alias",align:"left",label:a.$t("Ucard.Blockchain.pageT1")},scopedSlots:a._u([{key:"default",fn:function(e){return[a._v(" "+a._s(e.row.alias||"--")+" ")]}}])}),n("el-table-column",{attrs:{prop:"blockchain",align:"left",label:a.$t("Ucard.Blockchain.pageT2")},scopedSlots:a._u([{key:"default",fn:function(e){return[a._v(" "+a._s(e.row.blockchain||"--")+" ")]}}])}),n("el-table-column",{attrs:{prop:"contractAddress",align:"left",label:a.$t("Ucard.Blockchain.pageT8")},scopedSlots:a._u([{key:"default",fn:function(e){return[a._v(" "+a._s(e.row.contractAddress||"--")+" ")]}}])}),n("el-table-column",{attrs:{prop:"fromAddress",align:"left",label:a.$t("Ucard.Blockchain.pageT9")},scopedSlots:a._u([{key:"default",fn:function(e){return[a._v(" "+a._s(e.row.fromAddress||"--")+" ")]}}])}),n("el-table-column",{attrs:{prop:"enableStatus",align:"left",label:a.$t("Ucard.Blockchain.pageT3")},scopedSlots:a._u([{key:"default",fn:function(e){var t;return[n("el-switch",{staticClass:"crm_switch crm_switch_width",attrs:{disabled:!(null!==(t=a.display["R-Card-Blockchain-Edit"])&&void 0!==t&&t.show),"active-text":a.$t(a.enableStatus[1]),"active-value":1,"inactive-text":a.$t(a.enableStatus[0]),"inactive-value":0,"active-color":"#368FEC","inactive-color":"#EB3F57"},on:{change:function(t){return a.changeEnable(e.row)}},model:{value:e.row.enableStatus,callback:function(t){a.$set(e.row,"enableStatus",t)},expression:"scope.row.enableStatus"}})]}}])}),n("el-table-column",{attrs:{prop:"ctrl",align:"center",label:a.$t("Label.Action")},scopedSlots:a._u([{key:"default",fn:function(e){var t,i;return[n("el-dropdown",{attrs:{trigger:"click"},on:{command:a.handleCommand}},[n("span",{staticClass:"el-dropdown-link crm-cursor"},[n("i",{staticClass:"iconfont iconcaidan",staticStyle:{"font-weight":"bold","font-size":"20px"}})]),n("el-dropdown-menu",{attrs:{slot:"dropdown"},slot:"dropdown"},[null!==(t=a.display["R-Card-Blockchain-Edit"])&&void 0!==t&&t.show?n("el-dropdown-item",{attrs:{command:{type:"editor",row:e.row}}},[n("i",{staticClass:"el-icon-s-operation"}),n("span",[a._v(a._s(a.$t("R-Card-Blockchain-Edit")))])]):a._e(),null!==(i=a.display["R-Card-Blockchain-Delete"])&&void 0!==i&&i.show?n("el-dropdown-item",{attrs:{command:{type:"delete",row:e.row}}},[n("i",{staticClass:"el-icon-delete"}),n("span",[a._v(a._s(a.$t("R-Card-Blockchain-Delete")))])]):a._e()],1)],1)]}}])})],1),n("PagePagination",{attrs:{"pager-info":a.pagerInfo},on:{"current-change":a.handleCurrentChange,"size-change":a.handleSizeChange}}),n("el-dialog",{attrs:{title:a.$t(a.isEdit?"Ucard.Blockchain.title1":"Ucard.Blockchain.title2"),visible:a.addDialogVisible,width:"500px","close-on-click-modal":!1},on:{"update:visible":function(e){a.addDialogVisible=e}}},[n("el-form",{ref:"addForm",attrs:{model:a.addForm,rules:a.addRules,"label-width":"120px"}},[n("el-form-item",{attrs:{label:"".concat(a.$t("Ucard.Blockchain.pageT1"),":"),prop:"alias"}},[n("el-input",{attrs:{placeholder:a.$t("Ucard.Blockchain.addP1")},model:{value:a.addForm.alias,callback:function(e){a.$set(a.addForm,"alias",e)},expression:"addForm.alias"}})],1),n("el-form-item",{attrs:{label:"".concat(a.$t("Ucard.Blockchain.pageT2"),":"),prop:"blockchain"}},[n("el-select",{attrs:{disabled:a.isEdit,placeholder:a.$t("Ucard.Blockchain.addP2")},model:{value:a.addForm.blockchain,callback:function(e){a.$set(a.addForm,"blockchain",e)},expression:"addForm.blockchain"}},a._l(a.opts,(function(e){return n("el-option",{key:e,attrs:{label:e,value:e}})})),1)],1),n("el-form-item",{attrs:{label:"".concat(a.$t("Ucard.Blockchain.pageT8"),":"),prop:"contractAddress"}},[n("el-input",{attrs:{placeholder:a.$t("Ucard.Blockchain.addP7"),maxlength:100,clearable:""},model:{value:a.addForm.contractAddress,callback:function(e){a.$set(a.addForm,"contractAddress",e)},expression:"addForm.contractAddress"}})],1),n("el-form-item",{attrs:{label:"".concat(a.$t("Ucard.Blockchain.pageT9"),":"),prop:"fromAddress"}},[n("el-input",{attrs:{placeholder:a.$t("Ucard.Blockchain.addP8"),maxlength:100,clearable:""},model:{value:a.addForm.fromAddress,callback:function(e){a.$set(a.addForm,"fromAddress",e)},expression:"addForm.fromAddress"}})],1),n("el-form-item",{staticStyle:{"text-align":"left"},attrs:{label:"".concat(a.$t("Ucard.Blockchain.pageT3"),":"),prop:"enableStatus"}},[n("el-switch",{staticClass:"crm_switch crm_switch_width",attrs:{"active-text":a.$t(a.enableStatus[1]),"active-value":1,"inactive-text":a.$t(a.enableStatus[0]),"inactive-value":0,"active-color":"#368FEC","inactive-color":"#EB3F57"},model:{value:a.addForm.enableStatus,callback:function(e){a.$set(a.addForm,"enableStatus",e)},expression:"addForm.enableStatus"}})],1),n("el-form-item",{attrs:{label:"".concat(a.$t("Ucard.Blockchain.pageT5"),":"),prop:"whitelist"}},[n("el-select",{attrs:{multiple:"",placeholder:a.$t("Ucard.Blockchain.addP5")},model:{value:a.addForm.whitelist,callback:function(e){a.$set(a.addForm,"whitelist",e)},expression:"addForm.whitelist"}},a._l(a.userList,(function(e){return n("el-option",{key:e.uniqueId,attrs:{label:"".concat(e.cId," / ").concat(e.email),value:e.uniqueId}})})),1)],1),n("el-form-item",{attrs:{label:"".concat(a.$t("Ucard.Blockchain.pageT6"),":"),prop:"blacklist"}},[n("el-select",{attrs:{multiple:"",placeholder:a.$t("Ucard.Blockchain.addP6")},model:{value:a.addForm.blacklist,callback:function(e){a.$set(a.addForm,"blacklist",e)},expression:"addForm.blacklist"}},a._l(a.userList,(function(e){return n("el-option",{key:e.uniqueId,attrs:{label:"".concat(e.cId," / ").concat(e.email),value:e.uniqueId}})})),1)],1)],1),n("div",{staticClass:"dialog-footer",attrs:{slot:"footer"},slot:"footer"},[n("el-button",{on:{click:function(e){a.addDialogVisible=!1}}},[a._v(a._s(a.$t("Btn.Cancel"))+" ")]),n("el-button",{attrs:{type:"primary",loading:a.addLoading},on:{click:a.handleAddConfirm}},[a._v(a._s(a.$t("Btn.Confirm"))+" ")])],1)],1)],1)},i=[],c=a("c7eb"),r=a("15fd"),l=a("5530"),o=a("1da1"),s=(a("4de4"),a("caad"),a("a15b"),a("d81d"),a("14d9"),a("e9f5"),a("910d"),a("7d54"),a("ab43"),a("d3b7"),a("2532"),a("466d"),a("159b"),a("c6e4")),d=a("f121"),u=a.n(d),p=a("c5fa"),h=a("a4a2"),b=a("3bc1"),f=["whitelist","blacklist"],g=["blacklist","whitelist"],m=["blacklist","enableStatus","whitelist"],k=u.a.Code,v={name:"Blockchain",components:{PagePagination:b["a"]},data:function(){return{opts:[],userList:[],enableStatus:p["a"],listType:h["b"],pictLoading:!1,mock_tableData:[],search:{alias:"",blockchain:"",enableStatus:""},pagerInfo:{row:10,current:1,pageTotal:0,rowTotal:0},isEdit:!1,addDialogVisible:!1,addForm:{alias:"",blockchain:"",contractAddress:"",fromAddress:"",enableStatus:0,listType:void 0,whitelist:[],blacklist:[]},multipleSelection:[],addRules:{alias:[{required:!0,message:this.$i18n.t("Ucard.Blockchain.addP1"),trigger:"blur"}],blockchain:[{required:!0,message:this.$i18n.t("Ucard.Blockchain.addP2"),trigger:"blur"}],enableStatus:[{required:!0,message:this.$i18n.t("Ucard.Blockchain.addP3"),trigger:"blur"}],fromAddress:[{required:!0,message:this.$i18n.t("Ucard.Blockchain.addP8"),trigger:"blur"}]},addLoading:!1}},computed:{display:function(){return this.Session.GetDisplay()}},methods:{searchFunc:function(){var e=this;return Object(o["a"])(Object(c["a"])().mark((function t(){var a,n;return Object(c["a"])().wrap((function(t){while(1)switch(t.prev=t.next){case 0:if(e.pictLoading=!0,null!==(a=e.display["R-Card-Blockchain-Page"])&&void 0!==a&&a.show){t.next=5;break}return e.$pigeon.MessageWarning(e.$i18n.t("Msg.NotDisplay")),e.pictLoading=!1,t.abrupt("return");case 5:return t.next=7,s["a"].getBlockchainPage(Object(l["a"])(Object(l["a"])({},e.search),{},{page:{current:e.pagerInfo.current,row:e.pagerInfo.row}}));case 7:n=t.sent,n.code==k.StatusOK?(e.mock_tableData=n.data.map((function(e){var t=e.whitelist,a=e.blacklist,n=Object(r["a"])(e,f);return Object(l["a"])(Object(l["a"])({},n),{},{whitelist:(null===t||void 0===t?void 0:t.match(/[^,]+/g))||[],blacklist:(null===a||void 0===a?void 0:a.match(/[^,]+/g))||[]})})),null!=n.page?(e.pagerInfo.rowTotal=n.page.rowTotal,e.pagerInfo.pageTotal=n.page.pageTotal):e.pagerInfo.rowTotal=0,e.$pigeon.MessageOK(e.$i18n.t("Msg.SearchSuccess"))):e.$pigeon.MessageError(n.msg),e.pictLoading=!1;case 10:case"end":return t.stop()}}),t)})))()},handleSelectionChange:function(e){var t=this;this.multipleSelection=[],e.forEach((function(e){t.multipleSelection.push(e.id)}))},toDelete:function(){this.handleDelete(this.multipleSelection)},changeType:function(){},toSearch:function(){this.pagerInfo.current=1,this.searchFunc()},getBlockchainList:function(){var e=this;return Object(o["a"])(Object(c["a"])().mark((function t(){var a;return Object(c["a"])().wrap((function(t){while(1)switch(t.prev=t.next){case 0:return t.next=2,s["a"].getBlockchains();case 2:a=t.sent,a.code==k.StatusOK?e.opts=a.data:e.$pigeon.MessageError(a.msg);case 4:case"end":return t.stop()}}),t)})))()},getUserList:function(){var e=this;return Object(o["a"])(Object(c["a"])().mark((function t(){var a;return Object(c["a"])().wrap((function(t){while(1)switch(t.prev=t.next){case 0:return t.next=2,s["a"].cardUserList();case 2:a=t.sent,a.code==k.StatusOK?e.userList=a.data:e.$pigeon.MessageError(a.msg);case 4:case"end":return t.stop()}}),t)})))()},handleSizeChange:function(e){this.pagerInfo.row=e,this.searchFunc()},handleCurrentChange:function(e){this.pagerInfo.current=e,this.searchFunc()},handleCommand:function(e){"editor"===e.type?(console.log(e.row),this.addForm=Object(l["a"])({},e.row),console.log(this.addForm),this.isEdit=!0,this.addDialogVisible=!0):"delete"===e.type&&this.handleDelete([e.row.id])},openAddDialog:function(){this.addForm={alias:"",blockchain:"",enableStatus:0,whitelist:[],blacklist:[]},this.isEdit=!1,this.addDialogVisible=!0},getListValue:function(e){var t=e.listType,a=e.blacklist,n=e.whitelist;return t?"1"==t?this.userList.filter((function(e){return n.includes(e.uniqueId)})):"2"==t?this.userList.filter((function(e){return a.includes(e.uniqueId)})):void 0:[]},changeEnable:function(e){var t=this;return Object(o["a"])(Object(c["a"])().mark((function a(){var n,i,o,d;return Object(c["a"])().wrap((function(a){while(1)switch(a.prev=a.next){case 0:return a.prev=0,n=e.blacklist,i=e.whitelist,o=Object(r["a"])(e,g),a.next=4,s["a"].updateBlockchain(Object(l["a"])(Object(l["a"])({},o),{},{whitelist:null===i||void 0===i?void 0:i.join(","),blacklist:null===n||void 0===n?void 0:n.join(",")}));case 4:d=a.sent,200==d.code?(t.$pigeon.MessageOK(t.$i18n.t("card.Info.t27")),t.searchFunc()):t.$pigeon.MessageError(d.msg),a.next=11;break;case 8:a.prev=8,a.t0=a["catch"](0),t.$pigeon.MessageError(t.$i18n.t("Msg.SystemError"));case 11:case"end":return a.stop()}}),a,null,[[0,8]])})))()},handleAddConfirm:function(){var e=this;return Object(o["a"])(Object(c["a"])().mark((function t(){return Object(c["a"])().wrap((function(t){while(1)switch(t.prev=t.next){case 0:e.$refs.addForm.validate(function(){var t=Object(o["a"])(Object(c["a"])().mark((function t(a){var n,i,o,d,u,p,h;return Object(c["a"])().wrap((function(t){while(1)switch(t.prev=t.next){case 0:if(!a){t.next=24;break}if(e.addLoading=!0,t.prev=2,n=e.addForm,i=n.blacklist,o=n.enableStatus,d=n.whitelist,u=Object(r["a"])(n,m),p=Object(l["a"])(Object(l["a"])({},u),{},{enableStatus:o,whitelist:d.join(","),blacklist:i.join(",")}),!e.isEdit){t.next=11;break}return t.next=8,s["a"].updateBlockchain(p);case 8:t.t0=t.sent,t.next=14;break;case 11:return t.next=13,s["a"].addBlockchain(p);case 13:t.t0=t.sent;case 14:h=t.t0,h.code==k.StatusOK?(e.$pigeon.MessageOK(e.$i18n.t("Msg.SaveSuccess")),e.addDialogVisible=!1,e.searchFunc()):e.$pigeon.MessageError(h.msg),t.next=21;break;case 18:t.prev=18,t.t1=t["catch"](2),e.$pigeon.MessageError(e.$i18n.t("Msg.SaveFail"));case 21:return t.prev=21,e.addLoading=!1,t.finish(21);case 24:case"end":return t.stop()}}),t,null,[[2,18,21,24]])})));return function(e){return t.apply(this,arguments)}}());case 1:case"end":return t.stop()}}),t)})))()},handleDelete:function(e){var t=this;return Object(o["a"])(Object(c["a"])().mark((function a(){return Object(c["a"])().wrap((function(a){while(1)switch(a.prev=a.next){case 0:t.$confirm(t.$t("Ucard.Blockchain.deleteConfirm"),t.$t("Ucard.Blockchain.deleteTitle"),{confirmButtonText:t.$t("Btn.Confirm"),cancelButtonText:t.$t("Btn.Cancel"),type:"warning"}).then(Object(o["a"])(Object(c["a"])().mark((function a(){var n;return Object(c["a"])().wrap((function(a){while(1)switch(a.prev=a.next){case 0:return a.prev=0,a.next=3,s["a"].deleteBlockchain({ids:e});case 3:n=a.sent,n.code==k.StatusOK?(t.$pigeon.MessageOK(t.$i18n.t("Msg.DeleteSuccess")),t.searchFunc()):t.$pigeon.MessageError(n.msg),a.next=10;break;case 7:a.prev=7,a.t0=a["catch"](0),t.$pigeon.MessageError(t.$i18n.t("Msg.DeleteFail"));case 10:case"end":return a.stop()}}),a,null,[[0,7]])})))).catch((function(){}));case 1:case"end":return a.stop()}}),a)})))()}},beforeMount:function(){this.getBlockchainList(),this.getUserList()},mounted:function(){this.searchFunc()}},w=v,$=(a("b435"),a("cca2"),a("2877")),_=Object($["a"])(w,n,i,!1,null,"3f802d01",null);t["default"]=_.exports},"9a28":function(e,t,a){},a4a2:function(e,t,a){"use strict";a.d(t,"b",(function(){return n})),a.d(t,"a",(function(){return i}));var n={1:"Ucard.Blockchain.pageT5",2:"Ucard.Blockchain.pageT6"},i={1:"Ucard.BlockchainTransaction.e1",2:"Ucard.BlockchainTransaction.e2"}},b435:function(e,t,a){"use strict";a("9a28")},c5fa:function(e,t,a){"use strict";a.d(t,"a",(function(){return n})),a.d(t,"c",(function(){return i})),a.d(t,"d",(function(){return c})),a.d(t,"b",(function(){return r}));var n={0:"Ucard.Blockchain.unEnable",1:"Ucard.Blockchain.enabled"},i={0:"Ucard.DepositAddress.noRest",1:"Ucard.DepositAddress.isRest"},c={wait_process:"State.ToBeProcessed",processing:"State.InTheProcessing",success:"State.Success",fail:"State.Fail"},r={cn:"Web_info.cn",zhHant:"Web_info.zhHant",en:"Web_info.en",vn:"Web_info.vn",th:"Web_info.th",ar:"Web_info.ar",de:"Web_info.de",es:"Web_info.es",id:"Web_info.id",ms:"Web_info.ms",ko:"Web_info.ko",pt:"Web_info.pt",fa:"Web_info.fa",tr:"Web_info.tr"}},cca2:function(e,t,a){"use strict";a("6593")}}]);