UserRights.5f0739a9.js 16 KB

1
  1. (window["webpackJsonp"]=window["webpackJsonp"]||[]).push([["UserRights"],{"27b9":function(e,t,a){"use strict";a("908d")},2909:function(e,t,a){"use strict";a.d(t,"a",(function(){return i}));var n=a("6b75");function r(e){if(Array.isArray(e))return Object(n["a"])(e)}a("a4d3"),a("e01a"),a("d28b"),a("a630"),a("d3b7"),a("3ca3"),a("ddb0");function l(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}var o=a("06c5");a("d9e2");function s(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function i(e){return r(e)||l(e)||Object(o["a"])(e)||s()}},87282:function(e,t,a){"use strict";a("a1f2")},"908d":function(e,t,a){},a1f2:function(e,t,a){},c179:function(e,t,a){"use strict";a.r(t);a("ac1f"),a("841c"),a("498a");var n=function(){var e,t=this,a=t._self._c;return a("div",{directives:[{name:"loading",rawName:"v-loading",value:t.pictLoading,expression:"pictLoading"}],staticClass:"view",attrs:{id:"review_Email","element-loading-background":"rgba(43, 48, 67, 0.65)","element-loading-spinner":"el-icon-loading"}},[a("div",{staticClass:"crm_search"},[a("el-form",{ref:"form",attrs:{model:t.search,"label-position":"","label-width":""}},[a("el-row",[a("el-col",{attrs:{lg:24,md:24,span:24}},[a("el-form-item",[a("el-select",{staticClass:"crm_search_down crm-border-radius-no",attrs:{placeholder:t.$t("Placeholder.Choose"),size:"small"},model:{value:t.search.tag,callback:function(e){t.$set(t.search,"tag",e)},expression:"search.tag"}},[a("el-option",{attrs:{label:t.$t("card.Info.t21"),value:1}}),a("el-option",{attrs:{label:t.$t("card.Info.t22"),value:2}}),a("el-option",{attrs:{label:t.$t("card.Info.t29"),value:3}}),a("el-option",{attrs:{label:t.$t("card.Info.t30"),value:4}})],1)],1),a("el-form-item",[1==t.search.tag?a("el-input",{staticClass:"crm-border-left-no crm-border-radius-no",attrs:{placeholder:t.$t("Placeholder.Input"),clearable:"",size:"small"},nativeOn:{keyup:function(e){return!e.type.indexOf("key")&&t._k(e.keyCode,"enter",13,e.key,"Enter")?null:t.toSearch.apply(null,arguments)}},model:{value:t.search.cIdRegexp,callback:function(e){t.$set(t.search,"cIdRegexp","string"===typeof e?e.trim():e)},expression:"search.cIdRegexp"}}):t._e(),2==t.search.tag?a("el-select",{staticClass:"crm-border-left-no crm-border-radius-no",attrs:{placeholder:t.$t("Placeholder.Choose"),clearable:"",size:"small"},on:{change:t.toSearch},model:{value:t.search.enableStatus,callback:function(e){t.$set(t.search,"enableStatus",e)},expression:"search.enableStatus"}},[a("el-option",{attrs:{label:t.$t("Documentary.tradingCenter.item47"),value:0}}),a("el-option",{attrs:{label:t.$t("Documentary.tradingCenter.item46"),value:1}})],1):t._e(),3==t.search.tag?a("el-input",{staticClass:"crm-border-left-no crm-border-radius-no",attrs:{placeholder:t.$t("Placeholder.Input"),clearable:"",size:"small"},nativeOn:{keyup:function(e){return!e.type.indexOf("key")&&t._k(e.keyCode,"enter",13,e.key,"Enter")?null:t.toSearch.apply(null,arguments)}},model:{value:t.search.cIdRegexp,callback:function(e){t.$set(t.search,"cIdRegexp","string"===typeof e?e.trim():e)},expression:"search.cIdRegexp"}}):t._e(),4==t.search.tag?a("el-input",{staticClass:"crm-border-left-no crm-border-radius-no",attrs:{placeholder:t.$t("Placeholder.Input"),clearable:"",size:"small"},nativeOn:{keyup:function(e){return!e.type.indexOf("key")&&t._k(e.keyCode,"enter",13,e.key,"Enter")?null:t.toSearch.apply(null,arguments)}},model:{value:t.search.cIdRegexp,callback:function(e){t.$set(t.search,"cIdRegexp","string"===typeof e?e.trim():e)},expression:"search.cIdRegexp"}}):t._e()],1),a("el-form-item",[a("el-button",{staticClass:"crm-border-radius-no crm-border-left-no",attrs:{icon:"el-icon-search",size:"small"},on:{click:t.toSearch}})],1)],1)],1),null!==(e=t.display["R-UserRights-Add"])&&void 0!==e&&e.show?a("el-form-item",[a("div",{staticClass:"search_action_btn"},[a("span",{staticClass:"crm-cursor delete active",on:{click:t.approvalAll}},[a("span",{directives:[{name:"t",rawName:"v-t",value:"R-UserRights-Add",expression:"'R-UserRights-Add'"}]})])])]):t._e()],1),a("div",{staticClass:"card-mock-demo",staticStyle:{margin:"30px 0"}},[a("el-table",{staticStyle:{"margin-top":"20px",width:"100%"},attrs:{data:t.mock_tableData,stripe:""},on:{"selection-change":t.handleSelectionChange}},[a("el-table-column",{attrs:{label:t.$t("card.Info.t21"),align:"left",prop:"cIdRegexp"}}),a("el-table-column",{attrs:{label:t.$t("card.Info.t30"),align:"left",prop:"phoneRegexp"}}),a("el-table-column",{attrs:{label:t.$t("card.Info.t29"),align:"left",prop:"emailRegexp"}}),a("el-table-column",{attrs:{label:t.$t("Apply_info.AddressInfo.Country"),align:"left",prop:"emailRegexp"},scopedSlots:t._u([{key:"default",fn:function(e){return[t._v(" "+t._s("cn"==t.Session.Get("lang")?e.row.countryNames:e.row.countryEnNames)+" ")]}}])}),a("el-table-column",{attrs:{label:t.$t("Apply_info.AddressInfo.Region"),align:"left",prop:"emailRegexp"},scopedSlots:t._u([{key:"default",fn:function(e){return[t._v(" "+t._s("cn"==t.Session.Get("lang")?e.row.stateNames:e.row.stateEnNames)+" ")]}}])}),a("el-table-column",{attrs:{label:t.$t("Apply_info.AddressInfo.City"),align:"left",prop:"emailRegexp"},scopedSlots:t._u([{key:"default",fn:function(e){return[t._v(" "+t._s("cn"==t.Session.Get("lang")?e.row.cityNames:e.row.cityEnNames)+" ")]}}])}),a("el-table-column",{attrs:{label:t.$t("card.Info.t23"),align:"left",prop:"addTime"}}),a("el-table-column",{attrs:{label:t.$t("card.Info.t22"),align:"left",prop:"enableStatus"},scopedSlots:t._u([{key:"default",fn:function(e){return[a("el-switch",{staticClass:"crm_switch",attrs:{"active-text":t.$t("Documentary.tradingCenter.item46"),"active-value":1,"inactive-text":t.$t("Documentary.tradingCenter.item47"),"inactive-value":0,"active-color":"#368FEC","inactive-color":"#EB3F57"},on:{change:function(a){return t.selectChange(e.row)}},model:{value:e.row.enableStatus,callback:function(a){t.$set(e.row,"enableStatus",a)},expression:"scope.row.enableStatus"}})]}}])}),a("el-table-column",{attrs:{label:t.$i18n.t("Label.Action"),align:"center",prop:""},scopedSlots:t._u([{key:"default",fn:function(e){var n;return[a("el-dropdown",{attrs:{trigger:"click"},on:{command:t.handleCommand}},[a("span",{staticClass:"el-dropdown-link crm-cursor"},[a("i",{staticClass:"iconfont iconcaidan",staticStyle:{"font-weight":"bold","font-size":"20px"}})]),a("el-dropdown-menu",{attrs:{slot:"dropdown"},slot:"dropdown"},[null!==(n=t.display["R-UserRights-Delete"])&&void 0!==n&&n.show?a("el-dropdown-item",{attrs:{command:{type:1,row:e.row}}},[a("i",{staticClass:"el-icon-s-operation"}),a("span",{directives:[{name:"t",rawName:"v-t",value:"R-UserRights-Delete",expression:"'R-UserRights-Delete'"}]})]):t._e()],1)],1)]}}])})],1)],1)],1),t.pagerInfo.rowTotal?a("div",{staticClass:"crm_pagination"},[a("div",{staticClass:"crm_page_total"},[a("span",{directives:[{name:"t",rawName:"v-t",value:"Page.total.item1",expression:"'Page.total.item1'"}]}),a("span",[t._v(t._s(t.pagerInfo.rowTotal))]),a("span",{directives:[{name:"t",rawName:"v-t",value:"Page.total.item2",expression:"'Page.total.item2'"}]})]),a("el-pagination",{staticClass:"page",attrs:{"page-size":t.pagerInfo.row,"page-sizes":[10,20,50,100],total:t.pagerInfo.rowTotal,background:"",layout:"sizes, prev, pager, next"},on:{"current-change":t.handleCurrentChange,"size-change":t.handleSizeChange}})],1):t._e(),t.approvalAllDialog?a("el-dialog",{attrs:{rules:t.rules,title:t.$t("card.Info.t26"),visible:t.approvalAllDialog,width:"900px"},on:{"update:visible":function(e){t.approvalAllDialog=e}}},[a("el-form",{staticClass:"business-edit-form",attrs:{model:t.form,rules:t.rules,"label-position":"right","label-width":"150px"}},[a("el-form-item",{attrs:{label:t.$t("card.Info.t21")+":",prop:"cIdRegexp"}},[a("el-input",{attrs:{placeholder:t.$t("Placeholder.Input"),size:"small"},model:{value:t.form.cIdRegexp,callback:function(e){t.$set(t.form,"cIdRegexp",e)},expression:"form.cIdRegexp"}})],1),a("el-form-item",{attrs:{label:t.$t("card.Info.t29")+":",prop:"emailRegexp"}},[a("el-input",{attrs:{placeholder:t.$t("Placeholder.Input"),size:"small"},model:{value:t.form.emailRegexp,callback:function(e){t.$set(t.form,"emailRegexp",e)},expression:"form.emailRegexp"}})],1),a("el-form-item",{attrs:{label:t.$t("card.Info.t30")+":",prop:"phoneRegexp"}},[a("el-input",{attrs:{placeholder:t.$t("Placeholder.Input"),size:"small"},model:{value:t.form.phoneRegexp,callback:function(e){t.$set(t.form,"phoneRegexp",e)},expression:"form.phoneRegexp"}})],1),a("el-form-item",{attrs:{label:t.$t("card.Info.t31")+":",prop:"areaList"}},[a("el-cascader",{staticClass:"crm_search_down width-100",attrs:{"show-all-levels":!1,options:t.options,filterable:"",size:"small",placeholder:t.$t("Placeholder.Choose"),props:t.cascaderProps,clearable:""},model:{value:t.form.areaList,callback:function(e){t.$set(t.form,"areaList",e)},expression:"form.areaList"}})],1),a("el-form-item",{staticClass:"crm_switch",attrs:{label:t.$t("card.Info.t22")+":",prop:"enableStatus"}},[a("el-switch",{staticClass:"crm_switch",attrs:{"active-text":t.$t("Documentary.tradingCenter.item46"),"active-value":1,"inactive-text":t.$t("Documentary.tradingCenter.item47"),"inactive-value":0,"active-color":"#368FEC","inactive-color":"#EB3F57"},model:{value:t.form.enableStatus,callback:function(e){t.$set(t.form,"enableStatus",e)},expression:"form.enableStatus"}})],1)],1),a("div",{staticClass:"dialog-footer",attrs:{slot:"footer"},slot:"footer"},[a("el-button",{on:{click:function(e){t.approvalAllDialog=!1}}},[a("span",{directives:[{name:"t",rawName:"v-t",value:"Ucard.Business.p32",expression:"'Ucard.Business.p32'"}]})]),a("el-button",{directives:[{name:"t",rawName:"v-t",value:"card.Btn.Confirm",expression:"'card.Btn.Confirm'"}],attrs:{type:"primary"},on:{click:t.permissionAdd}})],1)],1):t._e()],1)},r=[],l=a("5530"),o=a("2909"),s=a("c7eb"),i=a("1da1"),c=(a("99af"),a("a15b"),a("d81d"),a("14d9"),a("b0c0"),a("e9f5"),a("7d54"),a("ab43"),a("b64b"),a("d3b7"),a("6062"),a("1e70"),a("79a4"),a("c1a1"),a("8b00"),a("a4e7"),a("1e5a"),a("72c3"),a("3ca3"),a("159b"),a("ddb0"),a("c6e4")),p=a("f121"),u=a.n(p),d=a("91ce"),m=u.a.Code,g={name:"UserRights",data:function(){return{pictLoading:!1,approvalAllDialog:!1,multipleSelection:[],search:{tag:1,enableStatus:"",cIdRegexp:"",emailRegexp:"",phoneRegexp:""},mock_tableData:[],pagerInfo:{row:10,current:1,pageTotal:0,rowTotal:0},form:{cIdRegexp:null,enableStatus:1,emailRegexp:null,phoneRegexp:null,areaList:null},reasons:{},options:[],rules:{enableStatus:[{required:!0,message:this.$i18n.t("vaildate.select.empty"),trigger:"blur"}],cIdRegexp:[{message:this.$i18n.t("vaildate.input.empty"),trigger:"blur"}],emailRegexp:[{message:this.$i18n.t("vaildate.input.empty"),trigger:"blur"}],phoneRegexp:[{message:this.$i18n.t("vaildate.input.empty"),trigger:"blur"}]},cascaderProps:{multiple:!0,checkStrictly:!0,lazy:!0,lazyLoad:function(e,t){var a=e.value,n=a.split(",")[0];c["a"].countryGet({pid:n}).then((function(e){if(e.code==m.StatusOK){var a=e.data.map((function(e){var t,a="cn"==d["a"].Get("lang")?e.name:e.enName;return{id:e.id,label:a,value:"".concat(e.id,",").concat(e.name,",").concat(e.enName,",").concat(null!==(t=e.code)&&void 0!==t?t:""),leaf:e.leaf}}));t(a)}else t([])}))}}}},computed:{display:function(){return this.Session.GetDisplay()},user:function(){return JSON.parse(this.Session.Get("user",!0))}},methods:{handleCommand:function(e){var t=this;1==e.type&&this.$confirm(this.$t("card.Msg.m14"),this.$t("card.Msg.m13"),{confirmButtonText:this.$t("card.Btn.Confirm"),cancelButtonText:this.$t("card.Btn.Cancel"),type:"warning"}).then(Object(i["a"])(Object(s["a"])().mark((function a(){var n;return Object(s["a"])().wrap((function(a){while(1)switch(a.prev=a.next){case 0:return a.next=2,c["a"].permissionDelete({id:e.row.id,cId:t.user.cId});case 2:n=a.sent,200==n.code?(t.$pigeon.MessageOK(t.$i18n.t("Msg.DeleteSuccess")),t.toSearch()):t.$pigeon.MessageError(n.msg);case 4:case"end":return a.stop()}}),a)}))))},selectChange:function(e){var t=this;return Object(i["a"])(Object(s["a"])().mark((function a(){var n;return Object(s["a"])().wrap((function(a){while(1)switch(a.prev=a.next){case 0:return a.prev=0,a.next=3,c["a"].permissionUpdate({id:e.id,enableStatus:e.enableStatus,cId:t.user.cId});case 3:n=a.sent,200==n.code?(t.$pigeon.MessageOK(t.$i18n.t("card.Info.t27")),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.SystemError"));case 10:case"end":return a.stop()}}),a,null,[[0,7]])})))()},handleSelectionChange:function(e){var t=this;this.multipleSelection=[],e.forEach((function(e){"2"!=e.approveStatus&&"3"!=e.approveStatus&&t.multipleSelection.push(e.id)}))},checkSelectable:function(e){return"1"==e.approveStatus},approvalAll:function(){this.approvalAllDialog=!0,this.form={cIdRegexp:null,enableStatus:1,emailRegexp:null,phoneRegexp:null,areaList:null}},permissionAdd:function(){var e=this;return Object(i["a"])(Object(s["a"])().mark((function t(){var a,n,r,l,i,p,u,d,m,g,f,h,b,v,x,w,y,S;return Object(s["a"])().wrap((function(t){while(1)switch(t.prev=t.next){case 0:return a=e.form,n=a.cIdRegexp,r=a.enableStatus,l=a.emailRegexp,i=a.phoneRegexp,p=a.areaList,u=[],d=[],m=[],g=[],f=[],h=[],b=[],v=[],x=[],w=[],p&&p.length&&p.forEach((function(e){e&&e.length&&e.forEach((function(e,t){if(console.log(t),e){var a,n,r,l,o=e.split(",");if(0===t)v.push(null!==(a=o[0])&&void 0!==a?a:""),f.push(null!==(n=o[1])&&void 0!==n?n:""),u.push(null!==(r=o[2])&&void 0!==r?r:""),m.push(null!==(l=o[3])&&void 0!==l?l:"");else if(1===t){var s,i,c;x.push(null!==(s=o[0])&&void 0!==s?s:""),h.push(null!==(i=o[1])&&void 0!==i?i:""),d.push(null!==(c=o[2])&&void 0!==c?c:"")}else{var p,y,S;w.push(null!==(p=o[0])&&void 0!==p?p:""),b.push(null!==(y=o[1])&&void 0!==y?y:""),g.push(null!==(S=o[2])&&void 0!==S?S:"")}}}))})),y={cId:e.user.cId,cIdRegexp:n,enableStatus:r,emailRegexp:l,phoneRegexp:i,countryEnNames:Object(o["a"])(new Set(u)).join(","),countryCodes:Object(o["a"])(new Set(m)).join(","),stateEnNames:Object(o["a"])(new Set(d)).join(","),cityEnNames:Object(o["a"])(new Set(g)).join(","),countryNames:Object(o["a"])(new Set(f)).join(","),stateNames:Object(o["a"])(new Set(h)).join(","),cityNames:Object(o["a"])(new Set(b)).join(",")},t.next=6,c["a"].permissionAdd(y);case 6:S=t.sent,200==S.code?(e.form={cIdRegexp:null,enableStatus:1,approveStatus:null,emailRegexp:null,phoneRegexp:null,areaList:null},e.approvalAllDialog=!1,e.$pigeon.MessageOK(e.$i18n.t("card.Info.t28")),e.toSearch()):e.$pigeon.MessageError(S.msg);case 8:case"end":return t.stop()}}),t)})))()},toSearch:function(){this.pagerInfo.current=1,this.searchFunc()},searchFunc:function(){var e=this;return Object(i["a"])(Object(s["a"])().mark((function t(){var a,n;return Object(s["a"])().wrap((function(t){while(1)switch(t.prev=t.next){case 0:if(e.pictLoading=!0,null!==(a=e.display["R-UserRights-Search"])&&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,c["a"].permissionPage(Object(l["a"])(Object(l["a"])({},e.search),{},{page:{current:e.pagerInfo.current,row:e.pagerInfo.row}}));case 7:n=t.sent,n.code==m.StatusOK?(e.mock_tableData=n.data,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)})))()},handleSizeChange:function(e){this.pagerInfo.row=e,this.searchFunc()},handleCurrentChange:function(e){this.pagerInfo.current=e,this.searchFunc()},getCountry:function(){var e=this;return Object(i["a"])(Object(s["a"])().mark((function t(){var a;return Object(s["a"])().wrap((function(t){while(1)switch(t.prev=t.next){case 0:return t.next=2,c["a"].countryGet({});case 2:a=t.sent,a.code==m.StatusOK?(console.log(a.data),e.options=a.data.map((function(e){var t,a="cn"==d["a"].Get("lang")?e.name:e.enName;return{id:e.id,label:a,value:"".concat(e.id,",").concat(e.name,",").concat(e.enName,",").concat(null!==(t=e.code)&&void 0!==t?t:"")}}))):e.$pigeon.MessageError(a.msg);case 4:case"end":return t.stop()}}),t)})))()}},mounted:function(){this.searchFunc(),this.getCountry()},watch:{"search.tag":function(){this.search.cIdRegexp="",this.search.enableStatus="",this.search.emailRegexp="",this.search.phoneRegexp=""}}},f=g,h=(a("87282"),a("27b9"),a("2877")),b=Object(h["a"])(f,n,r,!1,null,"1a40f42e",null);t["default"]=b.exports}}]);