liuxiaolong
2019-05-06 f99bc8c6a1d10610373738edd7d0aa0181c81d99
1
webpackJsonp([4,15],{"2zcd":function(e,t){},Bam0:function(e,t){},HilT:function(e,t,s){"use strict";s("s967"),s("+BTi");var n=s("855/"),a={name:"ShareTree",data:function(){return{searchValue:"",nodeStatus:{}}},props:{data:{type:Array,default:function(){return[]},required:!0},option:{type:Object,default:function(){return{children:"children",label:"label"}}},isOpenAll:{default:!0,type:Boolean},index:{type:Number,required:!0,default:0}},watch:{data:{handler:function(e,t){console.log(e,"子组件监听实时变化数据")}}},methods:{handleNodeClick:function(e){console.log(e,"设备树勾选事件");var t=this.$refs.treeShare.getCheckedNodes();console.log(t,"selectNode",this.index,"index"),this.$emit("currentNode",t,this.index)},setCurrentKey:function(e){var t=this;console.log(e,"设置选中状态 ids"),this.$refs.treeShare.setCheckedKeys([]),e&&0!==e.length&&e.forEach(function(e,s){console.log(e,"设置选中状态 item"),t.$nextTick(function(){t.$refs.treeShare.setChecked(e.id,!0)})})},setCurrentKeyOne:function(e){console.log(e,"设置选中的集群节点"),this.$refs.treeShare.setChecked(e,!0)},setKeyOneAndClass:function(e){var t=this;console.log(e,"设置树节点颜色");var s={},n=[],a=[];this.nodeStatus={},e instanceof Array?e&&0!==e.length&&e.forEach(function(e){-1===e.isSuccess?(n.push(e.uuid),console.log(n,"errorkeys"),t.$set(s,"errorkeys",n)):(a.push(e.uuid),t.$set(s,"sukeys",a))}):e.notDataBase&&0!==e.notDataBase.length?(e.notDataBase.forEach(function(e){t.setCurrentKeyOne(e.uuid),a.push(e.uuid)}),this.$set(s,"sukeys",a)):e.existDataBase&&0!==e.existDataBase.length?(e.existDataBase.forEach(function(e){t.setCurrentKeyOne(e.uuid),n.push(e.uuid)}),this.$set(s,"errorkeys",n)):e.allDataBase&&0!==e.allDataBase.length&&e.allDataBase.forEach(function(e){t.setCurrentKeyOne(e.uuid)}),console.log(s,"keys"),this.nodeStatus=s},removeCurrentNode:function(e){var t=this;if(console.log(e,"进入清空选中状态"),e&&0!==e.length){var s=[];e.forEach(function(e){s.push(e)}),console.log(s,"存储的选中的keys"),s.forEach(function(e){t.$refs.treeShare.setChecked(e,!1)})}else this.$refs.treeShare.setCheckedKeys([])},handleSearch:function(){this.$refs.treeShare.filter(this.searchValue)},filterNode:function(e,t){return!e||-1!==t.name.indexOf(e)},getCurrentNode:function(){return this.$refs.treeShare.getCurrentNode()},getCurrentNodes:function(){return this.$refs.treeShare.getCheckedNodes()},unDisabled:function(e){console.log(e,"解除禁用"),this.data=e},renderContent:function(e,t){var s=t.node,n=t.data,a=(t.store,this.nodeStatus);if(0===Object.keys(a).length)return e("span",[s.label]);var r=a.sukeys,i=a.errorkeys;if(r&&0!==r.length){if(-1!==r.indexOf(n.id))return e("span",{style:"color:green"},[s.label]);if(-1===r.indexOf(n.id))return e("span",[s.label]);n.children&&0!==n.children.length&&n.children.forEach(function(t){return-1!==r.indexOf(t.id)?e("span",{style:"color:green"},[s.label]):-1===r.indexOf(t.id)?e("span",[s.label]):void(t&&0!==t.children.length&&t.children.forEach(function(t){return-1!==r.indexOf(t.id)?e("span",{style:"color:green"},[s.label]):e("span",[s.label])}))})}if(i&&0!==i.length){if(-1!==i.indexOf(n.id))return e("span",{style:"color:red"},[s.label]);if(-1===i.indexOf(n.id))return e("span",[s.label]);n.children&&0!==n.children.length&&n.children.forEach(function(t){return-1!==i.indexOf(t.id)?e("span",{style:"color:red"},[s.label]):-1===i.indexOf(t.id)?e("span",[s.label]):void(t&&0!==t.children.length&&t.children.forEach(function(t){return-1!==i.indexOf(t.id)?e("span",{style:"color:red"},[s.label]):e("span",[s.label])}))})}}},components:{Tree:s.n(n).a}},r=s("XyMi");var i=function(e){s("t2h7")},c=Object(r.a)(a,function(){var e=this.$createElement,t=this._self._c||e;return t("div",{attrs:{id:"tree-share"}},[t("Tree",{ref:"treeShare",attrs:{data:this.data,props:this.option,"show-checkbox":"","default-expand-all":this.isOpenAll,"highlight-current":"","check-on-click-node":!0,"check-strictly":!1,"render-content":this.renderContent,id:"tree","node-key":"id","filter-node-method":this.filterNode},on:{check:this.handleNodeClick}})],1)},[],!1,i,null,null);t.a=c.exports},OExm:function(e,t){},P5mG:function(e,t,s){"use strict";Object.defineProperty(t,"__esModule",{value:!0});s("jZDA"),s("+BTi");var n=s("91Nw"),a=s.n(n),r=(s("d7TW"),s("ajQY")),i=s.n(r),c=s("ziRP"),o=s("gKeS"),l={components:{elRow:i.a,elCol:a.a},data:function(){return{tableList:"",personList:[{personName:"李晓红",identity:0x1d246cfe4b3af40,list1:[{deviceName:"集群1-设备2",deviceLocation:"东门"},{deviceName:"集群2-设备3",deviceLocation:"西门"},{deviceName:"集群2-设备3",deviceLocation:"学校教学楼正门"}]},{personName:"李小红",identity:0x1d246cfe4b3af40,list1:[{deviceName:"集群1-设备2",deviceLocation:"东门"},{deviceName:"集群2-设备3",deviceLocation:"西门"},{deviceName:"集群2-设备3",deviceLocation:"学校教学楼正门"}]}]}},methods:{},mounted:function(){},created:function(){}},d=s("XyMi");var h=function(e){s("efra")},u=Object(d.a)(l,function(){var e=this,t=e.$createElement,s=e._self._c||t;return s("div",{staticClass:"bg-white"},[s("h5",{staticClass:"fb"},[e._v("分享成功人员")]),e._v(" "),s("div",{staticClass:"pl15"},e._l(e.personList,function(t,n){return s("b-row",{key:n,staticClass:"mt10 bg-purple"},[s("b-col",{staticClass:"text-center",attrs:{cols:"4"}},[s("div",{staticClass:"p10 text-center "},[s("httpLazyImg",{attrs:{src:e.headImgUrl,height:"28%",width:"46%",alt:""}})],1),e._v(" "),s("a",[e._v(e._s(t.personName))]),s("br"),e._v(" "),s("a",[e._v(e._s(t.identity))])]),e._v(" "),s("b-col",{attrs:{cols:"8"}},[s("div",{staticClass:"mt10"},[s("h5",{staticClass:"text-primary"},[e._v("已成功分享至以下设备:")]),e._v(" "),e._l(t.list1,function(t,n){return s("div",{key:n},[s("div",{staticClass:"text-left"},[e._v("\n             "+e._s(n+1)+"\n             "),s("a",[e._v("设备名称:"+e._s(t.deviceName))]),e._v(" "),s("a",{staticClass:"ml20"},[e._v("设备位置:"+e._s(t.deviceLocation))])])])})],2)])],1)}))])},[],!1,h,null,null).exports,f=(s("dmRH"),s("EKTV")),v={components:{elCheckbox:s.n(f).a},data:function(){return{selectClass:0,personList:[{id:"123",name:"刘子姗",check:!1},{id:"124",name:"张三",check:!1},{id:"125",name:"王二麻子",check:!1}],selectList:[]}},methods:{selectPerson:function(e){Array.from(this.personList,function(e){if(!0===e.check)return e}),this.selectClass=e}}};var p=function(e){s("Bam0")},m=Object(d.a)(v,function(){var e=this,t=e.$createElement,s=e._self._c||t;return s("div",[s("div",{},[s("h5",{staticClass:"fb"},[e._v("待分享人员")]),e._v(" "),e._l(e.personList,function(t,n){return s("div",{key:n},[s("el-checkbox",{attrs:{checked:e.personList[n].check},on:{change:function(t){e.selectPerson(n)}},model:{value:e.personList[n].check,callback:function(t){e.$set(e.personList[n],"check",t)},expression:"personList[index].check"}},[s("ul",[s("li",{class:{"text-primary":1==t.check},on:{click:function(t){e.selectPerson(n)}}},[e._v("\n             "+e._s(t.name)+"\n             "),s("span",{staticClass:"dis-inleblock bg-danger radius-circle circle"},[s("i",{staticClass:"fa fa-exclamation"})])])])])],1)})],2)])},[],!1,p,null,null).exports,g={props:{},components:{elRow:i.a,elCol:a.a},data:function(){return{dataList:[],isCheck:!1}},methods:{selectOne:function(e,t){console.log(e,"top-----",!t),this.dataList.forEach(function(e){e.selected=!1}),e.selected=!0,this.$emit("currentPerson",e,"select")},changeFunc:function(e){console.log(e.checked,"changeFunc"),this.$emit("currentPerson",e,"check")},checkAll:function(){var e=this.isCheck;console.log(e,"是否勾选"),e?this.dataList.forEach(function(e){e.checked=!0}):this.dataList.forEach(function(e){e.checked=!1})},showTop:function(e){var t=this;console.log(e,"shareTop data"),this.dataList=JSON.parse(JSON.stringify(e)),this.dataList.forEach(function(e){e&&""!==e.isSuccess&&void 0!==e.isSuccess?e.isSuccess?t.$set(e,"isSuccess","successColor"):t.$set(e,"isSuccess","borderErr"):t.$set(e,"isSuccess","")}),console.log(this.dataList,"this.dataList")},seachChecked:function(){var e=[];this.isCheck=!1;for(var t=0;t<this.dataList.length;t++)console.log(this.dataList[t].checked,"this.dataList[i]"),this.dataList[t].checked&&e.push(this.dataList[t]);return e}},mounted:function(){},created:function(){},computed:{},watch:{isCheck:function(e,t){console.log(e,"newVal",t,"oldVal"),"true"===e?this.dataList.forEach(function(e){e.checked=!0}):this.dataList.forEach(function(e){e.checked=!1})}}};var C=function(e){s("botQ")},b=Object(d.a)(g,function(){var e=this,t=e.$createElement,s=e._self._c||t;return s("div",[s("h5",{staticClass:"font-weight-bold f20"},[e._v("待分享人员")]),e._v(" "),s("b-form-checkbox",{attrs:{value:"true","unchecked-value":"false"},model:{value:e.isCheck,callback:function(t){e.isCheck=t},expression:"isCheck"}},[e._v("\n      全选\n    ")]),e._v(" "),s("div",{staticClass:"overflow-y mheight"},[s("el-row",{attrs:{gutter:20}},e._l(e.dataList,function(t,n){return s("el-col",{key:n,staticClass:"mt20",attrs:{span:4}},[s("div",{class:[t.selected?"shadowCla":"","commonCol",t.isSuccess],on:{click:function(s){e.selectOne(t)}}},[s("div",{staticClass:"checkClass ",on:{click:function(e){e.stopPropagation()}}},[s("b-form-checkbox",{on:{change:function(s){e.selectOne(t)}},model:{value:t.checked,callback:function(s){e.$set(t,"checked",s)},expression:"item.checked"}})],1),e._v(" "),s("div",{staticClass:"media flex-center"},[s("div",{staticClass:"flex-box flex-vertical-center"},[s("div",{staticClass:"cicleImg"},[s("httpImg",{attrs:{src:t.photos,height:"100%",alt:""}})],1),e._v(" "),s("div",{staticClass:"media-body line-height-condenced ml-3"},[s("span",{staticClass:"text-dark"},[e._v(e._s(t.name))])])])]),e._v(" "),s("div",{staticClass:"mt10"},[s("div",[e._v("\n                "+e._s(t.cardId)+"\n              ")]),e._v(" "),s("div",[e._v("\n                ID:"+e._s(t.id)+"\n              ")])])])])}))],1)],1)},[],!1,C,"data-v-724fb5b5",null).exports,k=s("mbiK"),_=s("B5y1"),x=s("HilT");function L(e){return function(){var t=e.apply(this,arguments);return new Promise(function(e,s){return function n(a,r){try{var i=t[a](r),c=i.value}catch(e){return void s(e)}if(!i.done)return Promise.resolve(c).then(function(e){n("next",e)},function(e){n("throw",e)});e(c)}("next")})}}var y={name:"share",metaInfo:{title:"人员分享"},components:{elRow:i.a,elCol:a.a,shareTree:x.a,personnelShareLeft01:o.default,personnelShareLeft02:u,personnelShareLeft03:m,personnelShareTop:b,personUpdate:k.a,vueSwiperSlider:_.a},data:function(){return{ishandeInfo:!0,lookPerson:null,personData:[{name:"刘子山",id:"123",idCard:123412511,sex:"男",url:""},{name:"王宝强",id:"1235",idCard:123412511,sex:"男",url:""},{name:"黄晓丽",id:"35",idCard:123412511,sex:"女",url:""},{name:"小皮衣",id:"3542",idCard:4523412511,sex:"男",url:""}],checkPerson:[],seachName:"",treeData1:[{id:1,label:"一级 1",children:[{id:4,label:"二级 1-1",children:[{id:9,label:"三级 1-1-1"},{id:10,label:"三级 1-1-2"}]}]}],treeData2:[{id:2,label:"一级 2",children:[{id:5,label:"二级 2-1"},{id:6,label:"二级 2-2"}]},{id:3,label:"一级 3",children:[{id:7,label:"二级 3-1"},{id:8,label:"二级 3-2"}]}],devTreeData:[],isCheck:!1,classValue:"",personList:[],tempList:[],resultList:[],currenPerson:{},resultPerson:[],lastPerson:[],shareCluList:[],onePersonClu:[],seachParam:"",seachClusterName:"",currentId:this.$route.query.currentId}},computed:{checkPersonIds:function(){return this.checkPerson.map(function(e){return e.id})}},methods:{checkPersonFN:function(e){var t=this.checkPersonIds.indexOf(e.id);-1===t?this.checkPerson=[].concat(function(e){if(Array.isArray(e)){for(var t=0,s=Array(e.length);t<e.length;t++)s[t]=e[t];return s}return Array.from(e)}(this.checkPerson),[e]):this.checkPerson.splice(t,1)},lookPersonFN:function(e){this.ishandeInfo=!1,this.lookPerson=e,console.log(e,"这是移入")},reciveData:function(){var e=this;return L(regeneratorRuntime.mark(function t(){var s,n;return regeneratorRuntime.wrap(function(t){for(;;)switch(t.prev=t.next){case 0:return s={contVal:e.seachParam},t.next=3,Object(c.h)(s);case 3:n=t.sent,console.log(n,"res 进入分享页面获取人员数据"),n&&n.success&&(e.personList=n.data,e.$refs.shareTop.showTop(n.data));case 6:case"end":return t.stop()}},t,e)}))()},seach:function(){var e=this;console.log(this.seachParam,"搜索条件seachParam"),this.resultList=[],this.tempList=this.personList;var t=this.seachParam,s=new RegExp(t);null!==s.source?(this.personList.forEach(function(t){null!==t.name.match(s)&&e.resultList.push(t),null!==t.cardId.match(s)&&e.resultList.push(t)}),console.log(this.resultList,"搜索后的数据"),this.$refs.shareTop.showTop(Array.from(new Set(this.resultList)))):this.$refs.shareTop.showTop(this.tempList)},seachCluster:function(){var e=this;return L(regeneratorRuntime.mark(function t(){var s,n;return regeneratorRuntime.wrap(function(t){for(;;)switch(t.prev=t.next){case 0:return s={likeName:e.seachClusterName},t.next=3,Object(c.f)(s);case 3:n=t.sent,console.log(n,"分享里面的设备集群查询"),n&&n.data&&void 0!==n.data&&(e.devTreeData=n.data,e.devTreeData&&0!==e.devTreeData.length&&e.devTreeData.forEach(function(e,t){e.disabled=!1,e&&0!==e.children.length&&e.children.forEach(function(e){e.disabled=!1,e.children&&0!==e.children.length&&e.children.forEach(function(e){e.disabled=!1})})})),console.log(e.devTreeData,"devTreeData");case 7:case"end":return t.stop()}},t,e)}))()},findPersonClu:function(e){var t=this;return L(regeneratorRuntime.mark(function s(){var n,a;return regeneratorRuntime.wrap(function(s){for(;;)switch(s.prev=s.next){case 0:return t.onePersonClu=[],n={personId:e.id},s.next=4,Object(c.i)(n);case 4:a=s.sent,console.log(a,"分享后数据格式"),a&&a.data&&("before"===a.data.dataBA?a.data.returnData&&0!==a.data.returnData.length&&a.data.returnData.forEach(function(e){t.onePersonClu=e.existDataBase,e.existDataBase&&0!==e.existDataBase.length?(t.$refs.shareTree.forEach(function(e){e.removeCurrentNode([])}),e.existDataBase.forEach(function(e){t.$refs.shareTree.forEach(function(t,s){e&&void 0!==e.uuid&&t.setCurrentKeyOne(e.uuid)})})):t.$refs.shareTree.forEach(function(e,t){e.removeCurrentNode([])})}):(t.$refs.shareTree.forEach(function(e){e.removeCurrentNode([])}),a.data.returnData&&0!==a.data.returnData.dbStatus.length&&a.data.returnData.dbStatus.forEach(function(e){t.$refs.shareTree.forEach(function(t,s){e.uuid&&void 0!==e.uuid&&t.setCurrentKeyOne(e.uuid)})})));case 7:case"end":return s.stop()}},s,t)}))()},sharePerson:function(e){var t=this;return L(regeneratorRuntime.mark(function s(){var n,a;return regeneratorRuntime.wrap(function(s){for(;;)switch(s.prev=s.next){case 0:return s.next=2,Object(c.s)(e);case 2:n=s.sent,console.log(n,"人员分享到集群"),console.log(t.personList,"确认分享之前的人员"),a=[],n&&n.data&&n.data.forEach(function(e){for(var s=0;s<t.personList.length;s++)e.personId===t.personList[s].id?(t.$set(t.personList[s],"dbStatus",e.dbStatus),t.$set(t.personList[s],"isSuccess",e.isSuccess),a.push(t.personList[s]),a=Array.from(new Set(a))):(a.push(t.personList[s]),a=Array.from(new Set(a)))}),console.log(a,"分享后人员的信息"),t.$refs.shareTop.showTop(a);case 9:case"end":return s.stop()}},s,t)}))()},currentNode:function(e,t){console.log(e,"分享页面的设备树选择"),0===e.length?this.shareCluList[t]=[]:(this.shareCluList[t]=[],this.shareCluList[t]=e),this.shareCluList&&0!==this.shareCluList.length&&(this.currenPerson.checkList=[],this.currenPerson.checkList=this.shareCluList)},currentPerson:function(e,t){var s=this;console.log(e,"分享的父组件获取当前选中的人"),this.currenPerson=JSON.parse(JSON.stringify(e)),console.log(this.currenPerson.checked,".checked"),this.findPersonClu(e),"check"===t&&e.checked&&(console.log("进入更改树状态方法"),this.devTreeData.forEach(function(e,t){e.disabled=!1,e&&0!==e.children.length&&e.children.forEach(function(e){e.disabled=!1,e.children&&0!==e.children.length&&e.children.forEach(function(e){e.disabled=!1})})}),this.$refs.shareTree.forEach(function(e,t){e.unDisabled(s.devTreeData)})),"select"!==t||e.checked||(this.devTreeData.forEach(function(e,t){e.disabled=!1,e&&0!==e.children.length&&e.children.forEach(function(e){e.disabled=!1,e.children&&0!==e.children.length&&e.children.forEach(function(e){e.disabled=!1})})}),this.$refs.shareTree.forEach(function(e,t){e.unDisabled(s.devTreeData)})),e&&e.dbStatus&&void 0!==e.dbStatus?(console.log(this.devTreeData,"data.dbStatus"),e.dbStatus.forEach(function(e){}),this.$refs.shareTree.forEach(function(t,s){t.setKeyOneAndClass(e.dbStatus)})):this.$refs.shareTree.forEach(function(e,t){e.setKeyOneAndClass(s.onePersonClu)}),e.checkList&&0!==e.checkList.length&&this.$refs.shareTree.forEach(function(t,s){t.setCurrentKey(e.checkList[s])}),this.shareCluList=[],this.lastPerson=this.currenPerson},sureShare:function(){var e=this.$refs.shareTop.seachChecked(),t=[],s=[];if(e&&0!==e.length)if(e.map(function(e){t.push(e.id)}),console.log(t,"list"),this.$refs.shareTree.forEach(function(e,t){var n=e.getCurrentNodes();n&&n.length&&n.forEach(function(e){s.push(e.id)})}),console.log(s,"jiqunList"),0===s.length)this.$toast({message:"请勾选待分享集群!",type:"error"});else{var n={persons:t,tableIds:s};this.sharePerson(n)}else this.$toast({message:"请勾选待分享人员!",type:"error"})}},mounted:function(){this.reciveData(),this.seachCluster()},created:function(){console.log(this.$route.query.currentId,"this.$route.query.currentId")}};var w=function(e){s("OExm")},P=Object(d.a)(y,function(){var e=this,t=this,s=t.$createElement,n=t._self._c||s;return n("div",[n("div",{staticClass:"mx-4 pt-4"},[n("div",{staticClass:"flex-row-between flex-center"},[n("div",{staticClass:"flex-row-left",staticStyle:{width:"70%"}},[n("h5",{staticClass:"font-weight-bold f20 mt10"},[t._v("人员分享")]),t._v(" "),n("div",{staticClass:"col-md-6 flex-row-left"},[n("b-input",{attrs:{type:"text",placeholder:"输入身份证号/人员姓名"},model:{value:t.seachParam,callback:function(e){t.seachParam=e},expression:"seachParam"}}),t._v(" "),n("b-button",{staticClass:"pl30 pr30 mx-4",attrs:{variant:"primary",size:"md"},on:{click:t.reciveData}},[t._v("搜索")])],1)]),t._v(" "),t._m(0)]),t._v(" "),n("b-card",{staticClass:"my-2 p10",attrs:{"no-body":""}},[n("personnelShareTop",{ref:"shareTop",on:{currentPerson:t.currentPerson}})],1),t._v(" "),n("h5",{staticClass:"font-weight-bold f20 mt-4"},[t._v("设备选择")]),t._v(" "),n("b-card",{staticClass:"my-2"},[n("div",{staticClass:" row",attrs:{solt:"header"}},[n("div",{staticClass:"col-md-6 flex-row-left"},[n("b-input",{attrs:{type:"text",placeholder:"输入集群名称/编码/位置"},model:{value:t.seachClusterName,callback:function(e){t.seachClusterName=e},expression:"seachClusterName"}}),t._v(" "),n("b-button",{staticClass:"pl30 pr30 mx-4",attrs:{variant:"primary",size:"md"},on:{click:t.seachCluster}},[t._v("搜索")])],1)]),t._v(" "),n("hr"),t._v(" "),n("div",{staticClass:"row py-4 overflow-auto",staticStyle:{"max-height":"18vh"}},t._l(t.devTreeData,function(e,s){return n("div",{key:s,staticClass:"col-md-4"},[n("share-tree",{ref:"shareTree",refInFor:!0,attrs:{data:t.devTreeData,index:s},on:{currentNode:t.currentNode}})],1)}))]),t._v(" "),n("div",{staticClass:"text-center py-4"},[n("b-button",{staticClass:"pl30 pr30 mx-4",attrs:{variant:"primary",size:"md"},on:{click:function(e){t.sureShare()}}},[t._v("确认分享")]),t._v(" "),n("b-button",{staticClass:"pl30 pr30 mx-4",attrs:{size:"md"},on:{click:function(){t.$router.push({path:"/personnel",query:{currentId:e.currentId}})}}},[t._v("关闭")])],1)],1)])},[function(){var e=this.$createElement,t=this._self._c||e;return t("div",{staticClass:"flex-row-right"},[t("div",{staticClass:"flex-center"},[t("div",{staticClass:"greeCicle mr10"}),t("span",[this._v("分享成功")]),this._v(" "),t("div",{staticClass:"redCicle mr10 ml20"}),t("span",[this._v("分享失败")])])])}],!1,w,"data-v-47911650",null);t.default=P.exports},botQ:function(e,t){},efra:function(e,t){},gKeS:function(e,t,s){"use strict";Object.defineProperty(t,"__esModule",{value:!0});s("jZDA"),s("+BTi");var n=s("91Nw"),a=s.n(n),r=(s("d7TW"),s("ajQY")),i={components:{elRow:s.n(r).a,elCol:a.a},data:function(){return{tableList:"",personList:[{id:"123",name:"刘子姗",identity:0x4eb7db1e64d1300,deviceName:"集群1-设备1",deviceLocation:"东门",check:!1},{id:"125",name:"王二麻子",identity:0x4eb7db1e64d1300,deviceName:"集群2-设备2",deviceLocation:"学校教学楼正门",check:!1}],checkAll:!1}},methods:{},mounted:function(){},created:function(){},watch:{checkAll:function(e,t){}}},c=s("XyMi");var o=function(e){s("2zcd")},l=Object(c.a)(i,function(){var e=this,t=e.$createElement,s=e._self._c||t;return s("div",[s("div",{staticClass:"px-4 grid-content bg-purple p20"},[s("h5",{staticClass:"text-danger"},[e._v("人员已存在待分享设备中,请选择要覆盖的设备,再次进行人员分享操作:")]),e._v(" "),s("b-row",[s("b-col",{attrs:{cols:"2"}},[s("b-form-checkbox",{attrs:{id:"checkbox1"},model:{value:e.checkAll,callback:function(t){e.checkAll=t},expression:"checkAll"}},[e._v("全选")])],1),e._v(" "),s("b-col",{staticClass:"text-center",attrs:{cols:"5"}},[s("p",{staticClass:"fb"},[e._v("分享设备")])]),e._v(" "),s("b-col",{staticClass:"text-center",attrs:{cols:"5"}},[s("p",{staticClass:"fb"},[e._v("人员库")])])],1),e._v(" "),e._l(e.personList,function(t,n){return s("b-row",{key:n,staticClass:"flex-center mt10"},[s("b-col",{staticClass:"flex-center",attrs:{cols:"1"}},[s("b-form-checkbox",{model:{value:e.personList[n].check,callback:function(t){e.$set(e.personList[n],"check",t)},expression:"personList[index].check"}})],1),e._v(" "),s("b-col",{staticClass:"text-center bg-blu p10"},[s("b-row",{staticClass:"bg-white",staticStyle:{"margin-left":"5px"}},[s("b-col",{staticClass:"flex-center col-height",attrs:{cols:"4"}},[s("div",{staticClass:"imageStyle"},[s("httpLazyImg",{attrs:{src:e.headImgUrl,alt:""}})],1)]),e._v(" "),s("b-col",{staticClass:"flex-center",attrs:{cols:"8"}},[s("div",{staticClass:"text-left"},[s("p",{staticClass:"pfont-size m-0"},[e._v("姓名:"+e._s(t.name))]),e._v(" "),s("div",{staticClass:"mt5"},[s("p",{staticClass:"pfont-size m-0"},[e._v("身份证号:"+e._s(t.identity))])]),e._v(" "),s("div",{staticClass:"mt5"},[s("p",{staticClass:"pfont-size m-0"},[e._v("设备名称:"+e._s(t.deviceName))])]),e._v(" "),s("div",{staticClass:"mt5"},[s("p",{staticClass:"pfont-size m-0"},[e._v("设备位置:"+e._s(t.deviceLocation))])])])])],1)],1),e._v(" "),s("b-col",{staticClass:"text-center bg-blu p10"},[s("b-row",{staticClass:"bg-white col-height",staticStyle:{"margin-left":"5px","margin-right":"5px"}},[s("b-col",{staticClass:"flex-center",attrs:{cols:"4"}},[s("div",{staticClass:"imageStyle"},[s("httpLazyImg",{attrs:{src:e.headImgUrl,alt:""}})],1)]),e._v(" "),s("b-col",{staticClass:"flex-center",attrs:{cols:"8"}},[s("div",{staticClass:"text-left"},[s("p",{staticClass:"pfont-size m-0"},[e._v("姓名:"+e._s(t.name))]),e._v(" "),s("div",{staticClass:"mt5"},[s("p",{staticClass:"pfont-size m-0"},[e._v("身份证号:"+e._s(t.identity))])]),e._v(" "),s("div",{staticClass:"mt5"},[s("p",{staticClass:"pfont-size m-0"},[e._v("设备名称:"+e._s(t.deviceName))])]),e._v(" "),s("div",{staticClass:"mt5"},[s("p",{staticClass:"pfont-size m-0"},[e._v("设备位置:"+e._s(t.deviceLocation))])])])])],1)],1)],1)})],2)])},[],!1,o,null,null);t.default=l.exports},mbiK:function(e,t,s){"use strict";s("jZDA"),s("+BTi");var n=s("91Nw"),a=s.n(n),r=(s("d7TW"),s("ajQY")),i=s.n(r),c=s("ziRP");function o(e){return function(){var t=e.apply(this,arguments);return new Promise(function(e,s){return function n(a,r){try{var i=t[a](r),c=i.value}catch(e){return void s(e)}if(!i.done)return Promise.resolve(c).then(function(e){n("next",e)},function(e){n("throw",e)});e(c)}("next")})}}var l={components:{vueSwiperSlider:s("B5y1").a,elRow:i.a,elCol:a.a},props:{},data:function(){return{swiperData:[{name:"11201120112011201120",id:"1120112011201120112011220",selected:!1},{name:"11201120112011201120",id:"123",selected:!1},{name:"11201120112011201120",id:"1120112011201120112011220",selected:!1}],checked:!1,checkAll:!1,personList:[]}},methods:{selectOne:function(e){var t=this;console.log(e,"选择某个人的事件selected"),this.personList&&this.personList.length&&this.personList.forEach(function(e){t.$set(e,"selected",!1),e.mergePersonList&&0!==e.mergePersonList.length&&e.mergePersonList.forEach(function(e){t.$set(e,"selected",!1)})}),e&&void 0!==e&&(e.selected?e.selected=!1:e.selected=!0,this.$set(e,"fatherPersonId",""),this.$emit("currentpersonupdate",e))},selectSwiper:function(e,t){var s=this;console.log(e,"选择某个人的事件selected"),this.personList&&this.personList.length&&this.personList.forEach(function(e){s.$set(e,"selected",!1),e.mergePersonList&&0!==e.mergePersonList.length&&e.mergePersonList.forEach(function(e){s.$set(e,"selected",!1)})}),e&&void 0!==e&&(e.selected?e.selected=!1:e.selected=!0,this.$set(e,"fatherPersonId",t),this.$emit("currentpersonupdate",e))},showUpdate:function(e){var t=this;console.log(e,"shareUpdate data"),this.personList=[],e&&0!==e.length&&(e.forEach(function(e){t.$set(e,"checked",!1),t.$set(e,"selected",!1),e.mergePersonList&&0!==e.mergePersonList.length&&e.mergePersonList.forEach(function(e){t.$set(e,"selected",!1),t.$set(e,"isSuccess","2")})}),this.personList=e)},getUpdatePersonInfo:function(){var e=this;return o(regeneratorRuntime.mark(function t(){var s,n;return regeneratorRuntime.wrap(function(t){for(;;)switch(t.prev=t.next){case 0:return s={},t.next=3,Object(c.k)(s);case 3:n=t.sent,console.log(n,"待更新人员信息"),n&&n.data?e.showUpdate(n.data):e.$toast({message:"获取待更新人员信息错误!",type:"error"});case 6:case"end":return t.stop()}},t,e)}))()},getCheckedPerson:function(){var e=[];return this.personList&&0!==this.personList.length&&this.personList.forEach(function(t){t.checked&&e.push(t)}),e},toUpdate:function(e){console.log(e.checked,"data 每一条后面的更新按钮"),e.checked?this.$emit("sureupdate",e):this.$toast({message:"请先勾选该条记录!",type:"error"})},toDelete:function(e){var t=this;return o(regeneratorRuntime.mark(function s(){var n,a;return regeneratorRuntime.wrap(function(s){for(;;)switch(s.prev=s.next){case 0:if(console.log(e,"删除人员的信息"),!e||void 0===e){s.next=8;break}return n={personId:e.personId},s.next=5,Object(c.b)(n);case 5:a=s.sent,console.log(a,"res 删除按钮返回的值"),a&&a.data?(t.$toast({message:a.message?a.message:"删除成功!",type:"success"}),t.$emit("reset")):t.$toast({message:a.message?a.message:"删除失败!",type:"error"});case 8:case"end":return s.stop()}},s,t)}))()},isStatus:function(e){if(console.log(e,"判断当前人的更新新状态"),e&&void 0!==e)return"2"===e.isSuccess?"commonClass":"1"===e.isSuccess||"0"===e.isSuccess?"borderSuc":"borderErr"},reciveUpdateInfo:function(e){var t=this;console.log(e,"data   处理更新状态"),e instanceof Array?(console.log(e,"多人更新后"),e.forEach(function(e){e.mergePersonList&&0!==e.mergePersonList.length&&e.mergePersonList.forEach(function(s){for(var n=0;n<t.personList.length;n++){var a=t.personList[n];e.personId===a.personId&&a.mergePersonList&&0!==a.mergePersonList.length&&a.mergePersonList.forEach(function(e){s.personId===e.personId&&t.$set(e,"isSuccess",s.isSuccess)})}})})):(console.log(e,"单个人更新后"),this.personList.forEach(function(s){if(e.hasOwnProperty(s.personId)){var n=e[s.personId];n&&0!==n.length&&n.forEach(function(e,n){e.personId===s.mergePersonList[n].personId&&t.$set(s.mergePersonList[n],"isSuccess",e.result)})}})),console.log(this.personList,"看看修改了更新状态的人员数据是否正确")}},created:function(){},mounted:function(){this.getUpdatePersonInfo()},computed:{isSuccess:function(){var e=this.personList;return e&&e.length,""}},watch:{checkAll:function(e,t){console.log(e,"newVal",t,"oldVal"),e?this.personList.forEach(function(e){e.checked=!0}):this.personList.forEach(function(e){e.checked=!1})}}},d=s("XyMi");var h=function(e){s("zU3d")},u=Object(d.a)(l,function(){var e=this,t=e.$createElement,s=e._self._c||t;return s("div",[s("el-row",[s("el-col",{staticClass:" shareCol1",attrs:{span:1}},[s("div",{staticClass:"flex-center"},[s("div",{},[e._v("\n          全选\n        ")]),e._v(" "),s("div",[s("b-form-checkbox",{staticClass:"mt5",attrs:{value:!0,"unchecked-value":!1},model:{value:e.checkAll,callback:function(t){e.checkAll=t},expression:"checkAll"}})],1)])]),e._v(" "),s("el-col",{attrs:{span:5}},[s("div",{staticClass:"flex-row-center"},[s("span",{staticClass:"f20 fb"},[e._v("更新后")])])]),e._v(" "),s("el-col",{attrs:{span:15}},[s("div",{staticClass:"flex-row-center"},[s("span",{staticClass:"f20 fb"},[e._v("待更新")])])]),e._v(" "),s("el-col",{attrs:{span:3}})],1),e._v(" "),s("div",{staticClass:"overflow-auto",staticStyle:{height:"30vh"}},e._l(e.personList,function(t,n){return s("el-row",{key:n,staticClass:"bg-blu flex-center mt10"},[s("el-col",{staticClass:" shareCol1",attrs:{span:1}},[s("div",{staticClass:"flex-center"},[s("div",{staticClass:"mr10"},[e._v(e._s(n+1))]),e._v(" "),s("div",[s("b-form-checkbox",{staticClass:"mt5",attrs:{value:!0,"unchecked-value":!1},model:{value:t.checked,callback:function(s){e.$set(t,"checked",s)},expression:"item.checked"}})],1)])]),e._v(" "),s("el-col",{class:["fontColor borderColor",t.selected?"shadowCla":""],attrs:{span:5},nativeOn:{click:function(s){e.selectOne(t)}}},[s("div",{staticClass:"flex-box flex-center pt10"},[s("div",{staticClass:"border-img"},[s("httpLazyImg",{attrs:{src:t.personPic,height:"60px",width:"60px",alt:"更新后人员照片"}})],1),e._v(" "),s("div",{staticClass:"ml10"},[s("a",[e._v(e._s(t.name))])])]),e._v(" "),s("div",{staticClass:"tc"},[s("div",{staticClass:"p10"},[s("a",[e._v(e._s(t.idcard))]),s("br"),e._v(" "),s("a",[e._v("ID:"+e._s(t.personId))])])])]),e._v(" "),s("el-col",{attrs:{span:15}},[s("div",{staticClass:"flex-center"},[s("vueSwiperSlider",{attrs:{slideWidth:"auto",data:t.mergePersonList},scopedSlots:e._u([{key:"default",fn:function(n){var a=n.data;return[s("div",{class:[a.selected?"shadowCla":"","commonClass",e.isStatus(a)],staticStyle:{width:"250px"},on:{click:function(s){e.selectSwiper(a,t.personId)}}},[s("div",{staticClass:"flex-box flex-center pt10"},[s("div",{staticClass:"border-img"},[s("httpImg",{attrs:{src:a.personPic,height:"60px",width:"60px",alt:"更新后人员照片"}})],1),e._v(" "),s("div",{staticClass:"ml10"},[s("a",[e._v(e._s(a.name))])])]),e._v(" "),s("div",{staticClass:"tc"},[s("div",{staticClass:"p10"},[s("a",[e._v(e._s(a.idcard||"--"))]),s("br"),e._v(" "),s("a",[e._v(" ID:"+e._s(a.personId||"--"))])])])])]}}])})],1)]),e._v(" "),s("el-col",{staticClass:"flex-center",attrs:{span:3}},[s("div",{staticClass:"flex-colu "},[s("b-button",{staticClass:"m10",attrs:{variant:"primary"},on:{click:function(s){e.toUpdate(t)}}},[e._v("更新")]),e._v(" "),s("b-button",{staticClass:"m10",attrs:{variant:"secondary"},on:{click:function(s){e.toDelete(t)}}},[e._v("删除")])],1)])],1)})),e._v(" "),s("div",{staticClass:"mt10"})],1)},[],!1,h,"data-v-707e2af1",null);t.a=u.exports},t2h7:function(e,t){},zU3d:function(e,t){}});