"use strict";(self.webpackChunkmy_package_ext=self.webpackChunkmy_package_ext||[]).push([[5394],{45394:function(e,t,a){a.r(t),a.d(t,{default:function(){return l}}),t=a(98263);var i=a(13974),l=(t={name:"transfer",mixins:[t.Z],props:{value:null,mode:{default:"edit"},selectMode:{default:"single"},sourceTitle:{default:"数据源"},targetTitle:{default:"目标"},transferFilterable:{type:Boolean,default:!1},filterPlacehold:{default:"搜索名称"},filterFieldName:{default:"name"},height:{default:400},width:{default:600},pagingable:{type:Boolean,default:!1},pageSizes:{},placeholder:{default:""}},data:function(){return{defaultvalue:[],data:[],currentPage:1,tableData:[],pageSize:10,total:0,keyword:"",showPicker:!1,isMobile:!0}},watch:{value:function(e){this.$emit("slectVale",e)},options:function(e){e.length&&(this.pagingable?(this.pageSize=this.currentPageSize[0],this.getList()):this.tableData=this.datalist)},keyword:function(e){this.tableData=e&&""!==e?this.datalist.filter((function(t){return t&&t.label&&t.label.includes(e)})):(0,i.cloneDeep)(this.datalist)}},computed:{localValue:{get:function(){return this.value?"single"===this.selectMode?this.value:this.value.split(","):null},set:function(e){var t;e&&Array.isArray(e)?(t=e.join(this.separator),this.$emit("input",t),this.localUpdateEntityModel(t),this.$emit("slectVale",t)):this.$emit("input",e)}},transferStyle:function(){return{width:this.width+"px",height:this.height+"px","--height":this.height-100+"px","--width":(this.width-122)/2+"px"}},valueLength:function(){return this.value&&this.value.split(",").length||0},titles:function(){return[this.sourceTitle,this.targetTitle]},currentPageSize:function(){return JSON.parse(this.pageSizes)},localDisabled:function(){return this.disabled||this.readonly},datalist:function(){var e=this;return this.options&&this.options.map((function(t,a){return{label:t.label,key:t.value,_data:t._data,disabled:e.localDisabled}}))||[]},pageCount:function(){return this.total%this.pageSize==0?this.total/this.pageSize:this.total/this.pageSize+1}},created:function(){"single"===this.selectMode?this.valueKey=this.value:this.valueKey=this.value.split(",")||[]},methods:{openPop:function(){this.disabled||this.readonly||(this.showPicker=!0)},handleSizeChange:function(e){this.currentPage=1,this.pageSize=e,this.getList()},handleCurrentChange:function(e){this.currentPage=e,this.getList()},getList:function(){var e,t,a=this;this.total=this.datalist.length,this.tableData=this.getNeedArr(this.datalist,this.pageSize)[this.currentPage-1],this.isMobile||("single"===this.selectMode?this.value.length&&this.tableData.find((function(e){return e.key!==a.value[0]}))&&this.tableData.push(this.datalist.filter((function(e){return e.key===a.value[0]}))[0]):this.value.length&&(e=this.datalist.filter((function(e){return a.value.includes(e.key)})),t=this.tableData.concat(e),this.tableData=Array.from(new Set(t.map((function(e){return e.key})))).map((function(e){return t.find((function(t){return t.key===e}))}))))},getNeedArr:function(e,t){var a=e.length;if(!a||!t||t<1)return[];for(var i=0,l=0,n=new Array(Math.ceil(a/t));i<a;)n[l++]=e.slice(i,i+=t);return n}}},(0,a(51900).Z)(t,(function(){var e=this,t=e._self._c;return t("div",{staticClass:"ext-transfer"},[t("div",{staticClass:"select-top",class:{"pr-15":!e.disabled&&!e.readonly,result:!0},staticStyle:{height:"24px"},on:{click:function(t){return t.preventDefault(),e.openPop.apply(null,arguments)}}},[e.disabled||e.readonly?e._e():t("i",{staticClass:"van-icon van-icon-arrow"}),e._v(" "),e.value?[e._v("\n      "+e._s(e.showContentMobile)+"\n    ")]:t("div",{staticClass:"placeholder"},[e._v("\n      "+e._s(e.placeholder)+"\n    ")])],2),e._v(" "),t("van-popup",{attrs:{round:"",position:"bottom"},model:{value:e.showPicker,callback:function(t){e.showPicker=t},expression:"showPicker"}},[e.transferFilterable?t("van-search",{attrs:{clearable:"",placeholder:e.filterPlacehold},model:{value:e.keyword,callback:function(t){e.keyword=t},expression:"keyword"}}):e._e(),e._v(" "),t("div",{staticClass:"content"},["single"===e.selectMode?t("div",[t("van-radio-group",{model:{value:e.valueKey,callback:function(t){e.valueKey=t},expression:"valueKey"}},e._l(e.tableData,(function(a){return t("van-radio",{attrs:{name:a.key}},[e._v(e._s(a.label))])})),1)],1):t("div",[t("van-checkbox-group",{model:{value:e.valueKey,callback:function(t){e.valueKey=t},expression:"valueKey"}},e._l(e.tableData,(function(a){return t("van-checkbox",{attrs:{name:a.key,shape:"square"}},[e._v(e._s(a.label))])})),1)],1)]),e._v(" "),t("span",{staticClass:"selected-title"},[e._v("已选择 "),t("span",{staticClass:"selected"},[e._v(e._s(e.valueLength))]),e._v(" 个")]),e._v(" "),e.pagingable?t("van-pagination",{staticClass:"page-bottom",attrs:{"page-count":e.pageCount,mode:"simple"},on:{change:e.handleCurrentChange},model:{value:e.currentPage,callback:function(t){e.currentPage=t},expression:"currentPage"}}):e._e()],1)],1)}),[],!1,null,"7d075a68",null).exports)}}]);