You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
wkcrm/static/js/chunk-7eaf.91d6d2b1.js

1 line
7.4 KiB

(window.webpackJsonp=window.webpackJsonp||[]).push([["chunk-7eaf"],{"20Z4":function(t,a,e){"use strict";e.r(a);var i=e("QbLZ"),s=e.n(i),n=e("t3Un");var l={name:"AddressBookIndex",components:{XhStructureCell:e("UCfG").a},data:function(){return{bookType:"",initStrucValue:[],listData:[],tableMap:[{label:"手机",key:"mobile"},{label:"部门",key:"structure_name"},{label:"岗位",key:"post"}],tableHeight:0,specialRowArr:[],currentPage:1,pageSizes:[15,30,60],pageSize:10,total:0,loading:!1,params:null}},created:function(){var t=this;this.bookType=this.$route.params.type,this.params=this.getDefaultParams(this.bookType),this.getList(),this.$nextTick(function(){t.tableHeight=document.getElementsByClassName("container-hook")[0].clientHeight-94})},beforeRouteUpdate:function(t,a,e){this.bookType=t.params.type,this.params=this.getDefaultParams(this.bookType),this.initStrucValue=[],this.listData=[],this.getList(),e()},methods:{getList:function(){var t,a=this;this.loading=!0,(t=this.params,Object(n.a)({url:"oa/addresslist/queryList",method:"post",data:t,headers:{"Content-Type":"application/json;charset=UTF-8"}})).then(function(t){a.loading=!1,a.total=t.data.totalRow,a.listData=t.data.list||[]}).catch(function(){a.loading=!1})},getDefaultParams:function(t){var a={page:1,limit:15,structure_id:"",search:"",initials:1};return"attention"==this.bookType&&(a.star_type=1),a},formatList:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[];if(this.specialRowArr=[],this.listData=[],0===t.length)return[];var a=[],e={structure_id:"",deptName:"",mobile:"",postName:"",realname:""};a.push(s()({},e,{initials:t[0].initials})),this.specialRowArr.push(0),a.push(t[0]);for(var i=1;i<t.length;i++){var n=t[i];n.initials===a[a.length-1].initials?a.push(n):(this.specialRowArr.push(a.length),a.push(s()({},e,{initials:n.initials})),a.push(n))}this.listData=a},getRowClass:function(t){return this.specialRowArr.includes(t.rowIndex)?"special-row":""},sortTableList:function(t){"ascending"===t.order?this.params.initials=1:"descending"===t.order&&(this.params.initials=2),this.getList()},toggleStar:function(t,a){var e,i=this;this.loading=!0,(e={target_id:this.listData[t].id,type:"admin_user"},Object(n.a)({url:"oa/addresslist/userStar",method:"post",data:e})).then(function(){i.loading=!1,i.listData[t].star=0===a?1:0,i.$set(i.listData,t,i.listData[t])}).catch(function(){i.loading=!1})},handleSizeChange:function(t){this.params.limit=t,this.getList()},handleCurrentChange:function(t){this.params.page=t,this.getList()},structureChange:function(t){this.initStrucValue=t.value,this.params.page=1,this.params.structure_id=t.value.length?t.value[0].id:"",this.getList()}}},r=(e("fF07"),e("KHd+")),o=Object(r.a)(l,function(){var t=this,a=t.$createElement,i=t._self._c||a;return i("div",{staticClass:"address-book-index"},[i("div",{staticClass:"header"},[i("flexbox",{staticClass:"title"},[i("img",{staticClass:"pic",attrs:{src:e("r9DG"),alt:""}}),t._v(" "),i("span",{staticClass:"text"},[t._v("通讯录")])]),t._v(" "),i("el-input",{attrs:{placeholder:"请输入员工姓名/手机号"},model:{value:t.params.search,callback:function(a){t.$set(t.params,"search",a)},expression:"params.search"}},[i("el-button",{attrs:{slot:"append",type:"primary"},on:{click:t.getList},slot:"append"},[t._v("\n 搜索\n ")])],1)],1),t._v(" "),i("div",{staticClass:"container container-hook"},[i("flexbox",{staticClass:"filter"},[i("span",{staticClass:"filter__label"},[t._v("选择部门")]),t._v(" "),i("xh-structure-cell",{staticClass:"xh-structure-cell",attrs:{value:t.initStrucValue,radio:""},on:{"value-change":t.structureChange}})],1),t._v(" "),i("el-table",{directives:[{name:"loading",rawName:"v-loading",value:t.loading,expression:"loading"}],staticClass:"n-table--border",attrs:{data:t.listData,height:t.tableHeight,stripe:"",border:""},on:{"sort-change":t.sortTableList}},[i("el-table-column",{attrs:{label:"字母",align:"center",prop:"initials",width:"90"}}),t._v(" "),i("el-table-column",{attrs:{prop:"realname",label:"姓名"},scopedSlots:t._u([{key:"default",fn:function(a){return[i("flexbox",{staticClass:"user-box"},[i("xr-avatar",{staticClass:"user-img",attrs:{name:a.row.realname,id:a.row.id,size:30,src:a.row.img}}),t._v(" "),i("span",[t._v(t._s(a.row.realname))])],1)]}}])}),t._v(" "),t._l(t.tableMap,function(t,a){return i("el-table-column",{key:a,attrs:{prop:t.key,label:t.label}})}),t._v(" "),i("el-table-column",{attrs:{fixed:"right",prop:"star",label:"关注",align:"center",width:"120"},scopedSlots:t._u([{key:"default",fn:function(a){return[i("span",{staticClass:"wk wk-focus-on focus-icon",class:{active:1===a.row.star},on:{click:function(e){t.toggleStar(a.$index,a.row.star)}}})]}}])})],2),t._v(" "),i("div",{staticClass:"p-contianer"},[i("el-pagination",{staticClass:"p-bar",attrs:{"current-page":t.currentPage,"page-sizes":t.pageSizes,"page-size":t.pageSize,"pager-count":5,total:t.total,background:"",layout:"prev, pager, next, sizes, total, jumper"},on:{"update:pageSize":function(a){t.pageSize=a},"size-change":t.handleSizeChange,"current-change":t.handleCurrentChange}})],1)],1)])},[],!1,null,"5e2cbfa8",null);o.options.__file="index.vue";a.default=o.exports},"J+Vq":function(t,a,e){},fF07:function(t,a,e){"use strict";var i=e("J+Vq");e.n(i).a},r9DG:function(t,a){t.exports="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADgAAAA4CAYAAACohjseAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAyFpVFh0WE1MOmNvbS5hZG9iZS54bXAAAAAAADw/eHBhY2tldCBiZWdpbj0i77u/IiBpZD0iVzVNME1wQ2VoaUh6cmVTek5UY3prYzlkIj8+IDx4OnhtcG1ldGEgeG1sbnM6eD0iYWRvYmU6bnM6bWV0YS8iIHg6eG1wdGs9IkFkb2JlIFhNUCBDb3JlIDUuNi1jMTQyIDc5LjE2MDkyNCwgMjAxNy8wNy8xMy0wMTowNjozOSAgICAgICAgIj4gPHJkZjpSREYgeG1sbnM6cmRmPSJodHRwOi8vd3d3LnczLm9yZy8xOTk5LzAyLzI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