EmployeeSelector.vue 24 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893
  1. <template>
  2. <el-dialog
  3. :title="title"
  4. :visible.sync="visible_"
  5. :close-on-click-modal="false"
  6. :before-close="close_before"
  7. append-to-body
  8. @open="openDialog"
  9. width="640px"
  10. top="5%"
  11. class="employee_select_dialog"
  12. >
  13. <slot name="header"></slot>
  14. <div class="search-box flex-box-ce" v-if="can_select_employee">
  15. <div class="search flex-box">
  16. <el-cascader
  17. v-show="can_select_employee && deptId == 0"
  18. v-model="dept_id"
  19. ref="dept"
  20. :options="dept_list"
  21. :props="{ checkStrictly: true, value: 'dept_id', label: 'name', children: '_child' }"
  22. clearable
  23. :disabled="deptId > 0"
  24. placeholder="全公司"
  25. ></el-cascader>
  26. </div>
  27. <div class="search flex-box"><el-input prefix-icon="el-icon-search" v-model="keyword" placeholder="请输入姓名" clearable></el-input></div>
  28. </div>
  29. <div class="dept_path scroll-bar flex-box flex-d-wrap" v-if="can_select_dept">
  30. <template v-if="pid_list_arr.length > 0">
  31. <div @click="back_by_index(0)" class="blue" style="cursor: pointer;">全公司</div>
  32. <div v-for="(item, index) in pid_list_arr" :key="index" @click="back_by_index(index + 1, item)" class="font-flex-word" style="max-width: 120px;">
  33. <i class="el-icon-arrow-right"></i>
  34. <span class="blue" style="cursor: pointer;">{{ item.name }}</span>
  35. </div>
  36. </template>
  37. </div>
  38. <div class="employee_selector_box" v-if="visible_">
  39. <div class="flex-box-ce">
  40. <div class="scroller-box flex-1">
  41. <!-- 人员 -->
  42. <div v-if="can_select_employee && isChecKedAll && multi" class="option-box flex-box flex-box-ce" style="padding-left: 22px;">
  43. <el-checkbox v-model="checked" @change="checkedChange">全选</el-checkbox>
  44. </div>
  45. <el-scrollbar :native="false" v-loading="table_loading" :style="styleObject">
  46. <div class="choose_left">
  47. <template v-if="can_select_dept">
  48. <div class="persons_box" v-if="dept_list.length > 0">
  49. <div v-for="(item, index) in dept_list" :key="index">
  50. <div class="flex-box flex-v-ce deptList" @click="select_dept(item, index)" v-show="item.name.indexOf(keyword) >= 0">
  51. <div :class="[item.checked ? 'showCheckbox' : '']" class="checkbox"><span class="isCheckbox"></span></div>
  52. <div class="employee_name flex-1 font-flex-word">{{ item.name }}</div>
  53. <div v-if="item._child" class="blue" @click.stop="show_child(item)">| 下级</div>
  54. </div>
  55. </div>
  56. </div>
  57. </template>
  58. <template v-if="can_select_employee">
  59. <div class="persons_box" v-if="list.length > 0">
  60. <div class="employee_cell" @click.prevent.stop="select_employee(item)" v-for="(item, index) in list" :key="index" v-show="item.id">
  61. <div class="employee_checkbox"><el-checkbox v-model="item.checked"></el-checkbox></div>
  62. <div class="employee_img_url"><img :src="item.img_url" class="employee_cell_head_img" /></div>
  63. <div class="employee_name">{{ item.name }}</div>
  64. <div class="employee_cell_clear"></div>
  65. </div>
  66. </div>
  67. <div v-else class="fontColorC" style="text-align: center;margin-top: 50px;">暂无可选人员</div>
  68. </template>
  69. </div>
  70. </el-scrollbar>
  71. </div>
  72. <div class="col-line"><span style="opacity: 0;">空</span></div>
  73. <div class="scroller-box flex-1">
  74. <div class="option-box flex-box-ce flex-d-center">
  75. <span v-if="multi && can_select_employee">
  76. 已选择
  77. <span class="blue" style="padding: 0 2px;">{{ employee_selected_list.length }}</span>
  78. 个员工
  79. </span>
  80. <span></span>
  81. <el-button size="small" class="dangerBtn" @click="clear_data">清空</el-button>
  82. </div>
  83. <el-scrollbar :native="false" style="height: 405px;">
  84. <div class="choose_right">
  85. <div class="employee_cell" v-for="(item, index) in dept_selected_list" :key="index">
  86. <div class="employee_name">{{ item.dept_name }}</div>
  87. <div class="employee_delete"><el-button type="default" size="mini" @click="dept_delete(item, index)" icon="el-icon-close" circle></el-button></div>
  88. <div class="employee_cell_clear"></div>
  89. </div>
  90. <div class="employee_cell" v-for="(item, index) in employee_selected_list" :key="index">
  91. <div class="employee_img_url" v-if="item.img_url"><img :src="item.img_url" class="employee_cell_head_img" /></div>
  92. <div class="employee_img_url" v-else><img src="@/assets/image/head_default.png" class="employee_cell_head_img" /></div>
  93. <div class="employee_name">{{ item.name }}</div>
  94. <div class="employee_delete"><el-button type="default" size="mini" @click="employee_cancel(item, true)" icon="el-icon-close" circle></el-button></div>
  95. <div class="employee_cell_clear"></div>
  96. </div>
  97. </div>
  98. </el-scrollbar>
  99. </div>
  100. </div>
  101. </div>
  102. <!-- <div class="fontColorD" style="text-align: center;">以上人员列表只显示“在职”人员</div> -->
  103. <span slot="footer" class="dialog-footer">
  104. <el-button @click="close">取 消</el-button>
  105. <el-button type="primary" @click="confirm">确 定</el-button>
  106. </span>
  107. </el-dialog>
  108. </template>
  109. <script>
  110. export default {
  111. props: {
  112. title: {
  113. // 标题
  114. type: String,
  115. default: '选择部门和员工'
  116. },
  117. deptId: {
  118. //指定部门ID,人员列表就是该部门的
  119. type: Number,
  120. default: 0
  121. },
  122. visible: {
  123. // 是否显示组件
  124. type: Boolean,
  125. default: false
  126. },
  127. can_select_dept: {
  128. // 是否只能选择部门(单选择部门,不能选择人员)
  129. type: Boolean,
  130. default: false
  131. },
  132. dept_not_select: {
  133. // 排除部门ID
  134. type: Array,
  135. default: () => {
  136. return [];
  137. }
  138. },
  139. dept_multi: {
  140. // 指定部门是否能多选
  141. type: Boolean,
  142. default: true
  143. },
  144. dept_children: {
  145. //选择部门时是否包含子部门
  146. type: Boolean,
  147. default: true
  148. },
  149. can_select_employee: {
  150. // 指定是否能选择员工
  151. type: Boolean,
  152. default: true
  153. },
  154. employee_not_select: {
  155. // 排除员工的ID,包含ID时不出现在选择列表中
  156. type: Array,
  157. default: () => {
  158. return [];
  159. }
  160. },
  161. selected: {
  162. // 已经选择的员工和部门
  163. type: Object,
  164. default: () => {
  165. return { employee: [], dept: [] };
  166. }
  167. },
  168. isChecKedAll: {
  169. //是否全选
  170. type: Boolean,
  171. default: true
  172. },
  173. multi: {
  174. // 指定员工是否能多选
  175. type: Boolean,
  176. default: true
  177. },
  178. max: {
  179. //选择的人数限制
  180. type: Number,
  181. default: 0
  182. },
  183. is_employee_list: {
  184. // 为true时,employee_list才生效
  185. type: Boolean,
  186. default: false
  187. },
  188. employee_list: {
  189. // 指定显示的员工列表,注意:传值后组件的员工数据将不是统一向服务器获取的,而是指定的员工列表,格式是:[{id: 1, name: “张三”, img_url: “”}]
  190. type: Array,
  191. default: () => {
  192. return [];
  193. }
  194. },
  195. close_clear_data: {
  196. //关闭时是否清除选择的数据
  197. type: Boolean,
  198. default: true
  199. },
  200. is_filtration_creator: {
  201. //是否去除创始人
  202. type: Boolean,
  203. default: true
  204. },
  205. include_self: {
  206. //是否显示自己
  207. type: Boolean,
  208. default: true
  209. },
  210. isRequired: {
  211. //是否必须选择人员或者部门
  212. type: Boolean,
  213. default: false
  214. }
  215. },
  216. name: 'EmployeeSelector',
  217. data() {
  218. return {
  219. // 基础配置
  220. table_loading: false,
  221. searchBox: [], //用于搜索的全部人员
  222. keyword: '',
  223. checked: false,
  224. visible_: false,
  225. // 选择人员相关
  226. employee_selected_list: [],
  227. employee_selected: [],
  228. list: [],
  229. // 选择部门相关
  230. dept_selected_list: [],
  231. dept_name: '',
  232. dept_id: [],
  233. dept_select_id: 0,
  234. dept_list: [],
  235. dept_list_all: [], //备用全部部门
  236. pid_list_arr: [],
  237. styleObject: {
  238. height: '405px'
  239. }
  240. };
  241. },
  242. watch: {
  243. visible(val) {
  244. this.visible_ = JSON.parse(JSON.stringify(val));
  245. if (val) {
  246. setTimeout(() => {
  247. this.get_user_list();
  248. this.get_dept_list();
  249. }, 200);
  250. }
  251. },
  252. dept_id(val) {
  253. this.dept_select_id = val[val.length - 1];
  254. this.$nextTick(() => {
  255. if (this.can_select_employee) {
  256. this.$refs.dept.dropDownVisible = false;
  257. }
  258. this.get_user_list();
  259. this.checked = false;
  260. });
  261. },
  262. keyword(val) {
  263. this.list = this.searchBox.filter(item => item.name.includes(this.keyword));
  264. if (!val) {
  265. this.checked = false;
  266. }
  267. }
  268. },
  269. methods: {
  270. //打开Dialog的回调,用刷每次打开都初始化selected
  271. openDialog() {
  272. if (this.deptId != 0) {
  273. this.dept_id = [this.deptId];
  274. this.dept_select_id = this.deptId;
  275. }
  276. let selected = this.selected;
  277. this.employee_selected = [];
  278. this.employee_selected_list = JSON.parse(JSON.stringify(selected.employee));
  279. this.dept_selected_list = JSON.parse(JSON.stringify(selected.dept));
  280. for (let i in selected.employee) {
  281. this.employee_selected.push(selected.employee[i].id);
  282. }
  283. if (this.can_select_employee && this.isChecKedAll && this.multi) {
  284. this.styleObject = {
  285. height: '405px'
  286. };
  287. } else {
  288. this.styleObject = {
  289. height: '455px'
  290. };
  291. }
  292. },
  293. close_before(done) {
  294. this.close();
  295. done();
  296. },
  297. // 全选(只用选择人员)
  298. checkedChange(val) {
  299. if (val) {
  300. this.$nextTick(() => {
  301. let employeeSelectedList = JSON.parse(JSON.stringify(this.employee_selected_list)); //获取选择的人员
  302. let employeeSelectedIds = [],total = 0;
  303. employeeSelectedList.forEach(element => {
  304. employeeSelectedIds.push(element.id);
  305. });
  306. for (let i in this.list) {
  307. this.$set(this.list[i], 'checked', true);
  308. if (!employeeSelectedIds.includes(this.list[i].id)) {
  309. //去除已经选择的人员
  310. this.employee_selected_list.push(this.list[i]);
  311. }
  312. }
  313. });
  314. } else {
  315. this.employee_selected_list = [];
  316. this.employee_selected = [];
  317. for (let i in this.list) {
  318. this.$set(this.list[i], 'checked', false);
  319. }
  320. }
  321. },
  322. // 点击部门导航
  323. back_by_index(index, item) {
  324. this.pid_list_arr.splice(index, 100);
  325. if (index == 0) {
  326. this.dept_list = this.dept_list_all;
  327. return false;
  328. }
  329. if (item._child) {
  330. this.dept_list = item._child;
  331. }
  332. },
  333. //下一级
  334. show_child(item) {
  335. if (item._child) {
  336. this.dept_list = item._child;
  337. }
  338. this.pid_list_arr.push(item);
  339. },
  340. //获取一个部门的下的所有子部门
  341. getChildrens(list) {
  342. var dept_list = [];
  343. list.forEach(item => {
  344. item.checked = true;
  345. dept_list.push({ dept_id: item.dept_id, dept_name: item.name, avatar: '@/assets/image/e66f.jpg' });
  346. if (item._child) {
  347. dept_list.push(...this.getChildrens(item._child));
  348. }
  349. });
  350. return dept_list;
  351. },
  352. //选择部门
  353. select_dept(item, index) {
  354. if (item.checked) {
  355. this.dept_cancel(item);
  356. } else {
  357. if (!this.dept_multi) {
  358. //是否能多选
  359. this.dept_selected_list = [];
  360. for (let i in this.dept_list_all) {
  361. this.dept_cancel(this.dept_list_all[i], true);
  362. }
  363. }
  364. item.checked = true;
  365. if (item._child && this.dept_children) {
  366. //是否存在子部门
  367. this.dept_selected_list.push({ dept_id: item.dept_id, dept_name: item.name, avatar: '@/assets/image/e66f.jpg' });
  368. var arr = this.getChildrens(item._child);
  369. this.dept_selected_list.push(...arr);
  370. } else {
  371. this.dept_selected_list.push({ dept_id: item.dept_id, dept_name: item.name, avatar: '@/assets/image/e66f.jpg' });
  372. }
  373. }
  374. },
  375. //清除选择的部门
  376. dept_cancel(item, is) {
  377. item.checked = false;
  378. if (item._child) {
  379. //左边
  380. item._child.forEach(childrens => {
  381. this.dept_cancel(childrens);
  382. });
  383. }
  384. if (is) {
  385. return false;
  386. }
  387. var deptSelectedList = this.dept_selected_list;
  388. deptSelectedList.forEach((dept, index) => {
  389. //右边
  390. if (dept.dept_id == item.dept_id) {
  391. deptSelectedList.splice(index, 1);
  392. }
  393. });
  394. },
  395. //删除部门
  396. dept_delete(item) {
  397. var dept_list = this.dept_list;
  398. var obj = this.getDeptz(item.dept_id, dept_list); //递归找到所属部门
  399. this.dept_cancel(obj);
  400. },
  401. // 递归获取指定ID部门
  402. getDeptz(id, arr) {
  403. var obj = {};
  404. for (let i = 0; i < arr.length; i++) {
  405. if (id == arr[i].dept_id) {
  406. obj = arr[i];
  407. break;
  408. } else if (arr[i]._child) {
  409. if (this.getDeptz(id, arr[i]._child).dept_id) {
  410. obj = this.getDeptz(id, arr[i]._child);
  411. }
  412. }
  413. }
  414. return obj;
  415. },
  416. //清除选择的人员
  417. employee_cancel(item) {
  418. this.checked = false;
  419. this.employee_selected.splice(this.employee_selected.indexOf(item.id), 1);
  420. let delete_index = -1;
  421. for (let i in this.employee_selected_list) {
  422. if (this.employee_selected.indexOf(this.employee_selected_list[i].id) < 0) {
  423. delete_index = i;
  424. }
  425. }
  426. if (delete_index >= 0) {
  427. for (let i in this.list) {
  428. if (this.list[i].id == item.id) {
  429. this.$set(this.list[i], 'checked', false);
  430. }
  431. }
  432. for (let i in this.employee_selected_list) {
  433. if (this.employee_selected_list[i].id == item.id) {
  434. this.employee_selected_list.splice(i, 1);
  435. }
  436. }
  437. }
  438. },
  439. //选择人员
  440. select_employee(item) {
  441. if (item.checked) {
  442. item.checked = false;
  443. this.employee_cancel(item);
  444. } else {
  445. if (!this.multi) {
  446. this.employee_selected = [];
  447. this.employee_selected_list = [];
  448. for (let i in this.list) {
  449. this.$set(this.list[i], 'checked', false);
  450. }
  451. }
  452. if (this.max > 0 && this.employee_selected.length == this.max && this.multi) {
  453. this.$message.error('最多只能选择' + this.max + '人');
  454. return false;
  455. }
  456. this.employee_selected.push(item.id);
  457. this.employee_selected_list.push({ id: item.id, name: item.name, img_url: item.img_url });
  458. item.checked = true;
  459. }
  460. },
  461. //清空
  462. clear_data() {
  463. this.checked = false;
  464. this.employee_selected = [];
  465. this.employee_selected_list = [];
  466. this.dept_selected_list = [];
  467. for (let i in this.list) {
  468. this.$set(this.list[i], 'checked', false);
  469. }
  470. for (let i in this.dept_list) {
  471. this.$set(this.dept_list[i], 'checked', false);
  472. }
  473. },
  474. //关闭||清空数据
  475. close() {
  476. this.$emit('update:visible', false);
  477. if (this.close_clear_data) {
  478. this.checked = false;
  479. this.keyword = '';
  480. this.employee_selected = [];
  481. this.employee_selected_list = [];
  482. this.dept_selected_list = [];
  483. for (let i in this.list) {
  484. this.$set(this.list[i], 'checked', false);
  485. }
  486. for (let i in this.dept_list) {
  487. this.$set(this.dept_list[i], 'checked', false);
  488. }
  489. }
  490. },
  491. // 确定
  492. confirm() {
  493. if (this.isRequired) {
  494. if (this.employee_selected_list.length == 0) {
  495. this.$message.error('请选择人员');
  496. return false;
  497. }
  498. }
  499. this.$emit('confirm', {
  500. employee: this.employee_selected_list,
  501. dept: this.dept_selected_list
  502. });
  503. this.close();
  504. },
  505. // 获取部门
  506. get_dept_list() {
  507. this.$axios('get', '/api/per/user/department').then(res => {
  508. var list = res.data.data.dept_tree;
  509. var dept_list = [];
  510. // 排除部门
  511. if (this.dept_not_select.length > 0) {
  512. dept_list = list.filter(item => {
  513. return this.dept_not_select.indexOf(item.id) == -1;
  514. });
  515. } else {
  516. dept_list = list;
  517. }
  518. dept_list = this.getTreeData(dept_list); //过滤children
  519. //默认选中部门
  520. if (this.dept_selected_list.length > 0) {
  521. this.dept_selected_list.forEach(item => {
  522. this.setDeptChecked(item.dept_id, dept_list);
  523. });
  524. }
  525. this.dept_list = dept_list;
  526. this.dept_list_all = this.dept_list;
  527. });
  528. },
  529. //设置默认部门
  530. setDeptChecked(id, arr) {
  531. for (let i = 0; i < arr.length; i++) {
  532. if (id == arr[i].dept_id) {
  533. arr[i].checked = true;
  534. break;
  535. } else if (arr[i]._child) {
  536. this.setDeptChecked(id, arr[i]._child);
  537. }
  538. }
  539. },
  540. getTreeData(data) {
  541. for (var i = 0; i < data.length; i++) {
  542. data[i].checked = false;
  543. if (data[i]._child.length < 1) {
  544. // _child若为空数组,则将_child设为undefined
  545. data[i]._child = undefined;
  546. } else {
  547. // _child若不为空数组,则继续 递归调用 本方法
  548. this.getTreeData(data[i]._child);
  549. }
  550. }
  551. return data;
  552. },
  553. // 默认选择中的人勾上
  554. parse_list(data) {
  555. let _list = [];
  556. data.map(item => {
  557. item['checked'] = false;
  558. for (var i in this.employee_selected_list) {
  559. //判断传进来的员工是否是员工集合里的,是就设为已点击状态
  560. if (this.employee_selected_list[i].id == item.id) {
  561. item['checked'] = true;
  562. }
  563. }
  564. if (item.img_url == '') {
  565. item.img_url = require('@/assets/image/head_default.png');
  566. }
  567. });
  568. this.searchBox = data;
  569. this.list = data;
  570. },
  571. //获取人员
  572. get_user_list() {
  573. this.table_loading = true;
  574. this.$axios('get', '/api/per/user/employee_list', { dept_id: this.dept_select_id,page: 1, page_size: 10000,official:1})
  575. .then(res => {
  576. let list = this.filtration(res.data.data.list);
  577. // 当有指定显示列表时
  578. if (this.is_employee_list) {
  579. var employee_list = this.employee_list;
  580. var userData = [];
  581. list.map(item => {
  582. // 列表数据是否是自己的管理范围
  583. employee_list.map(item2 => {
  584. if (item.id == item2.id) {
  585. userData.push(item);
  586. }
  587. });
  588. });
  589. this.parse_list(userData);
  590. } else {
  591. // 没有指定人员列表
  592. this.parse_list(list);
  593. }
  594. })
  595. .finally(() => {
  596. this.table_loading = false;
  597. });
  598. },
  599. // 过滤各种条件:如:自己,创始人
  600. filtration(data) {
  601. var list = data;
  602. // 过滤自己
  603. if (!this.include_self) {
  604. const currUserId = this.$getUserData().id;
  605. for (let i = 0; i < list.length; i++) {
  606. if (list[i].id == currUserId) {
  607. list.splice(i, 1);
  608. i--;
  609. }
  610. }
  611. }
  612. // 过滤创始人
  613. if (this.is_filtration_creator) {
  614. for (let i = 0; i < list.length; i++) {
  615. if (list[i].is_creator == 1) {
  616. list.splice(i, 1);
  617. i--;
  618. }
  619. }
  620. }
  621. //过滤指定人员[]
  622. if (this.employee_not_select.length > 0) {
  623. for (let i = 0; i < list.length; i++) {
  624. if (this.employee_not_select.indexOf(list[i].id) >= 0) {
  625. list.splice(i, 1);
  626. i--;
  627. }
  628. }
  629. }
  630. return list;
  631. }
  632. },
  633. created() {}
  634. };
  635. </script>
  636. <style scoped>
  637. ::v-deep .el-dialog__header {
  638. text-align: center;
  639. background-color: #ecf5ff;
  640. }
  641. ::v-deep .el-dialog__body {
  642. padding: 20px;
  643. }
  644. .showCheckbox .isCheckbox {
  645. height: 7px;
  646. width: 7px;
  647. background-color: #26a2ff;
  648. display: inline-block;
  649. border-radius: 2px;
  650. line-height: 14px;
  651. position: relative;
  652. top: -3px;
  653. }
  654. .showCheckbox {
  655. border: 1px solid #26a2ff !important;
  656. }
  657. .checkbox {
  658. height: 14px;
  659. width: 14px;
  660. border: 1px solid #dcdfe6;
  661. background: #fff;
  662. border-radius: 2px;
  663. position: relative;
  664. box-sizing: border-box;
  665. text-align: center;
  666. }
  667. .deptList {
  668. padding: 12px 0;
  669. border-bottom: 1px solid #f1f1f1;
  670. cursor: pointer;
  671. }
  672. .employee_selector_box {
  673. width: 600px;
  674. box-sizing: border-box;
  675. margin: 0 auto;
  676. }
  677. /* 搜索框 */
  678. .search {
  679. min-height: 36px;
  680. margin-right: 10px;
  681. }
  682. .search-box button {
  683. display: inline-block;
  684. vertical-align: middle;
  685. margin-left: 10px;
  686. width: auto;
  687. padding: 0;
  688. background: none;
  689. border-radius: 0px;
  690. border: none;
  691. }
  692. /* 左边框 */
  693. .employee_selector_box .choose_left {
  694. padding: 8px 10px 8px 10px;
  695. }
  696. .employee_selector_box .choose_left .employee_cell {
  697. border-bottom: 1px #f1f1f1 solid;
  698. }
  699. .employee_selector_box .choose_left .employee_checkbox {
  700. padding-left: 8px;
  701. }
  702. .employee_selector_box .choose_left .employee_img_url {
  703. padding-left: 8px;
  704. }
  705. .employee_selector_box .choose_left .employee_name {
  706. padding-left: 8px;
  707. }
  708. .employee_selector_box ::v-deep .el-scrollbar__thumb {
  709. width: 2px;
  710. margin: 15px 0 0 6px;
  711. background: #409eff;
  712. }
  713. /* 左边框 */
  714. /* 右边距 */
  715. .employee_selector_box .choose_right {
  716. padding: 8px 10px;
  717. }
  718. .employee_selector_box .choose_right .employee_delete .el-button {
  719. transform: scale(0.5);
  720. background: #c0c4cc;
  721. }
  722. .employee_selector_box .choose_right .employee_delete .el-button ::v-deep .el-icon-close {
  723. color: #fff;
  724. }
  725. .employee_selector_box .choose_right .employee_delete .el-button:active {
  726. background: #409eff;
  727. }
  728. .employee_selector_box .choose_right .employee_delete .el-button:active ::v-deep .el-icon-close {
  729. color: #fff;
  730. }
  731. .employee_selector_box .choose_right .employee_cell .employee_name {
  732. padding-left: 8px;
  733. }
  734. .employee_selector_box .choose_right .employee_cell .employee_img_url {
  735. padding-left: 8px;
  736. }
  737. /* 右边距 */
  738. .employee_selector_box ::v-deep .employee_cell {
  739. padding: 10px 0;
  740. border-bottom: 1px #f1f1f1 solid;
  741. }
  742. .employee_selector_box ::v-deep .employee_cell:hover {
  743. background: #ecf5ff;
  744. }
  745. .employee_cell {
  746. display: -webkit-inline-box;
  747. cursor: pointer;
  748. width: 100%;
  749. color: #606266;
  750. padding: 8px 0;
  751. background-color: transparent;
  752. }
  753. .employee_cell .employee_cell_clear {
  754. clear: both;
  755. }
  756. .employee_cell .employee_img_url {
  757. display: table-cell;
  758. vertical-align: middle;
  759. width: 30px;
  760. padding-left: 0px;
  761. }
  762. .employee_cell .employee_img_url img {
  763. width: 24px;
  764. height: 24px;
  765. border-radius: 50%;
  766. }
  767. .employee_cell .employee_checkbox {
  768. display: table-cell;
  769. vertical-align: middle;
  770. width: 30px;
  771. text-align: center;
  772. }
  773. .employee_cell .employee_name {
  774. display: table-cell;
  775. vertical-align: middle;
  776. color: #606266;
  777. }
  778. .employee_delete {
  779. display: table-cell;
  780. text-align: right;
  781. padding-right: 0px;
  782. }
  783. .employee_cell_a {
  784. display: block;
  785. }
  786. .employee_cell_a:hover {
  787. background-color: #ecf5ff;
  788. border-radius: 4px;
  789. }
  790. .dept_child_cell {
  791. display: table-cell;
  792. vertical-align: middle;
  793. }
  794. .dept_child_cell span {
  795. float: right;
  796. padding-right: 8px;
  797. }
  798. .dept_child_cell span:hover {
  799. color: #1c1c1c;
  800. }
  801. .dept_child_cell span:active {
  802. color: #1c1c1c;
  803. }
  804. .scroller-box {
  805. height: 440px;
  806. padding-right: 0px !important;
  807. background-color: #fdfdfd;
  808. border: 1px solid #eee;
  809. border-radius: 4px;
  810. overflow: hidden;
  811. }
  812. .col-line {
  813. position: relative;
  814. height: 400px;
  815. padding: 0 10px;
  816. }
  817. .col-line:before {
  818. content: ' ';
  819. width: 1px;
  820. height: 400px;
  821. position: absolute;
  822. top: 0;
  823. bottom: 0;
  824. left: 50%;
  825. background-color: #eee;
  826. }
  827. .search-box {
  828. background-color: #fff;
  829. margin-bottom: 20px;
  830. }
  831. .option-box {
  832. padding: 5px;
  833. background-color: #fff;
  834. border-bottom: 1px solid #eee;
  835. height: 50px;
  836. box-sizing: border-box;
  837. }
  838. .child_btn {
  839. color: #409eff;
  840. }
  841. .dept_path {
  842. padding: 10px 0;
  843. min-height: 37px;
  844. }
  845. .scrollbarHeight1 {
  846. height: 310px;
  847. }
  848. .scrollbarHeight2 {
  849. height: 350px;
  850. }
  851. </style>