EmployeeSelector.vue 19 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758
  1. <template>
  2. <div>
  3. <div class="employee_selector_box">
  4. <el-row :gutter="10">
  5. <el-col :xs="11" :sm="11" :md="11" :lg="11" :xl="11" class="scroller-box one">
  6. <div class="search-box">
  7. <div class="search flex-box" style="margin-bottom: 7px;"><el-input v-model="keyword" placeholder="请输入姓名" clearable></el-input></div>
  8. <div class="search flex-box" v-if="can_select_dept">
  9. <el-cascader
  10. v-model="dept_id"
  11. ref="dept"
  12. :options="dept_list"
  13. :props="{ checkStrictly: true, value: 'id', label: 'name', children: '_child' }"
  14. clearable
  15. filterable
  16. placeholder="全公司"
  17. ></el-cascader>
  18. </div>
  19. </div>
  20. <div class="flex-box-end" style="padding: 10px;border-bottom: 1px solid #f1f1f1;height: 40px;box-sizing: border-box;">
  21. <el-checkbox v-if="isChecKedAll && multi" v-model="checked" @change="checkedChange" :indeterminate="indeterminate">全选</el-checkbox>
  22. </div>
  23. <el-scrollbar :style="{ height: can_select_dept ? '310px' : '350px' }" :native="false" v-loading="table_loading">
  24. <div class="choose_left">
  25. <div class="persons_box" v-if="list.length > 0">
  26. <div class="employee_cell_a" v-for="(item, index) in list" :key="index">
  27. <div class="employee_cell flex-box flex-v-ce" v-show="can_select_employee" @click.prevent.stop="select_employee(item)">
  28. <div class="employee_checkbox"><el-checkbox v-model="item.checked"></el-checkbox></div>
  29. <img :src="item.img_url" width="30" height="30" class="imgUrl" v-if="item.img_url">
  30. <div class="imgUrl" v-else style="background: #238DFA;color: #fff;">
  31. {{item.name}}
  32. <!-- {{item.name.substring(item.name.length-2)}} -->
  33. </div>
  34. <div class="employee_name">{{ item.name }}</div>
  35. </div>
  36. </div>
  37. </div>
  38. <div v-else class="fontColorC" style="text-align: center;margin-top: 50px;">暂无可选人员</div>
  39. </div>
  40. </el-scrollbar>
  41. </el-col>
  42. <el-col :xs="2" :sm="2" :md="2" :lg="2" :xl="2" class="col-line"><span style="opacity: 0;">空</span></el-col>
  43. <el-col :xs="11" :sm="11" :md="11" :lg="11" :xl="11" class="scroller-box">
  44. <div class="option-box flex-box flex-v-ce">
  45. <div class="fontColorC flex-1" v-show="multi">已选择{{ employee_selected_list.length }}个员工</div>
  46. <el-button type="type" @click="clear_data()">清空</el-button>
  47. </div>
  48. <el-scrollbar wrap-class="column-wrapper scrollable-items-container" :native="false" style="height: 390px;">
  49. <div class="choose_right">
  50. <div class="employee_cell flex-box flex-v-ce" v-for="(item, index) in dept_selected_list" :key="index">
  51. <div class="employee_name">{{ item.dept_name }}</div>
  52. <div class="employee_delete"><el-button type="default" size="mini" @click="dept_cancel(item)" icon="el-icon-close" circle></el-button></div>
  53. </div>
  54. <div class="flex-box-ce employee_cell2" v-for="(item, index) in employee_selected_list" :key="index">
  55. <div class="flex-box-ce flex-1">
  56. <img :src="item.img_url" width="30" height="30" style="margin-right: 8px;" class="imgUrl" v-if="item.img_url">
  57. <div class="imgUrl" v-else style="background: #238DFA;color: #fff;margin-right: 8px;">
  58. <span v-if="item.name">{{item.name.substring(item.name.length-2)}}</span>
  59. </div>
  60. <div class="userName font-flex-word">{{ item.name }}</div>
  61. </div>
  62. <i class="el-icon-error deleteUser" v-if="!item.is_creator || !createDimness" @click="employee_cancel(item, true)"></i>
  63. </div>
  64. </div>
  65. </el-scrollbar>
  66. </el-col>
  67. </el-row>
  68. </div>
  69. </div>
  70. </template>
  71. <script>
  72. // import Item from './Item'
  73. // import VirtualList from 'vue-virtual-scroll-list'
  74. export default {
  75. props: {
  76. can_select_dept: {
  77. //指定是否能选择部门
  78. type: Boolean,
  79. default: true
  80. },
  81. can_select_employee: {
  82. //指定是否能选择员工
  83. type: Boolean,
  84. default: true
  85. },
  86. selected: {
  87. //已经选择的员工和部门
  88. type: Object,
  89. default: () => {
  90. return {
  91. employee: [],
  92. dept: []
  93. };
  94. }
  95. },
  96. multi: {
  97. //指定员工是否能多选
  98. type: Boolean,
  99. default: true
  100. },
  101. dept_multi: {
  102. //指定部门是否能多选
  103. type: Boolean,
  104. default: true
  105. },
  106. employee_list: {
  107. //指定显示的员工列表,注意:传值后组件的员工数据将不是统一向服务器获取的,而是指定的员工列表,格式是:[{id: 1, name: “张三”, img_url: “”}]
  108. type: Array,
  109. default: () => {
  110. return [];
  111. }
  112. },
  113. close_clear_data: {
  114. //关闭时是否清空选择的数据
  115. type: Boolean,
  116. default: true
  117. },
  118. max: {
  119. //当multi为true时,用来限制选择人数,0不生效
  120. type: Number,
  121. default: 0
  122. },
  123. user_no_select: {
  124. //是否能选择系统管理员
  125. type: Boolean,
  126. default: true
  127. },
  128. isChecKedAll: {
  129. //是否能全人员
  130. type: Boolean,
  131. default: true
  132. },
  133. my_no_select: {
  134. //当前设置人的id,过滤某位人员,一般为自己
  135. type: Number,
  136. default: 0
  137. },
  138. isCreatorSelect: {
  139. //当employee_list为空时,依然显示空值而不是显示人员列表
  140. type: Boolean,
  141. default: false
  142. },
  143. use_Administrator_list: {
  144. //未指定员工并请求人员接口时,保留管理员,过滤员工
  145. type: Boolean,
  146. default: false
  147. },
  148. createDimness: {
  149. //组织架构设置上级专用-不清除系统管理员
  150. type: Boolean,
  151. default: false
  152. }
  153. },
  154. name: 'EmployeeSelector',
  155. data() {
  156. let selected = JSON.parse(JSON.stringify(this.selected));
  157. let user_no_select = JSON.parse(JSON.stringify(this.user_no_select));
  158. return {
  159. table_loading: false,
  160. employee_selected_list: selected.employee,
  161. dept_selected_list: selected.dept,
  162. employee_selected: [],
  163. dept_selected: [],
  164. com_height: '100%',
  165. list: [], //人员列表
  166. dept_name: '', //部门名称
  167. dept_id: 0, //部门ID
  168. pid: 0, //部门ID实传
  169. dept_list: [], //部门列表
  170. dept_list_arr: [], //收集的部门
  171. keyword: '', //搜索值
  172. checked: false, //是否全选
  173. indeterminate: false,
  174. not_user: user_no_select,
  175. all_list: [],
  176. searchBox: [], //用于搜索的全部人员
  177. };
  178. },
  179. watch: {
  180. dept_id(val) {
  181. if (val.length > 1) {
  182. this.pid = val[val.length - 1];
  183. } else {
  184. this.pid = val[0];
  185. }
  186. this.$nextTick(() => {
  187. this.$refs.dept.dropDownVisible = false;
  188. this.get_user_list();
  189. this.checked = false;
  190. });
  191. },
  192. selected(val) {
  193. let selected = JSON.parse(JSON.stringify(val));
  194. console.log(selected)
  195. this.employee_selected = [];
  196. this.dept_selected = [];
  197. this.employee_selected_list = selected.employee;
  198. this.dept_selected_list = selected.dept;
  199. for (let i in selected.employee) {
  200. this.employee_selected.push(selected.employee[i].id);
  201. }
  202. for (let i in selected.dept) {
  203. this.dept_selected.push(selected.dept[i].dept_id);
  204. }
  205. },
  206. //搜索
  207. keyword(val) {
  208. this.list = this.searchBox.filter(item => item.name.includes(this.keyword));
  209. if (!val) {
  210. this.checked = false;
  211. }
  212. }
  213. },
  214. methods: {
  215. //全选择
  216. checkedChange(val) {
  217. if (val) {
  218. this.$nextTick(() => {
  219. let employeeSelectedList = JSON.parse(JSON.stringify(this.employee_selected_list)); //获取选择的人员
  220. let employeeSelectedIds = [],total = 0;
  221. employeeSelectedList.forEach(element => {
  222. employeeSelectedIds.push(element.id);
  223. });
  224. for (let i in this.list) {
  225. this.$set(this.list[i], 'checked', true);
  226. if (!employeeSelectedIds.includes(this.list[i].id)) {
  227. //去除已经选择的人员
  228. this.employee_selected_list.push(this.list[i]);
  229. }
  230. }
  231. });
  232. // for (let i in this.list) {
  233. // this.$set(this.list[i], 'checked', true);
  234. // }
  235. // this.$nextTick(() => {
  236. // let employeeSelectedList = JSON.parse(JSON.stringify(this.employee_selected_list));
  237. // let employeeSelectedIds = [],total = 0;
  238. // employeeSelectedList.forEach(element => {
  239. // employeeSelectedIds.push(element.id);
  240. // });
  241. // for (const i in this.list) {
  242. // if (employeeSelectedIds.includes(this.list[i].id)) {
  243. // total += 1;
  244. // } else {
  245. // this.employee_selected_list.push(this.list[i]);
  246. // }
  247. // }
  248. // this.list.length == total ? (this.indeterminate = true) : (this.indeterminate = false);
  249. // });
  250. } else {
  251. this.clear_data();
  252. }
  253. },
  254. //添加或移除已添加的员工
  255. employee_cancel(item) {
  256. this.employee_selected_list.map((arr, index) => {
  257. if (arr.id == item.id) {
  258. this.employee_selected_list.splice(index, 1);
  259. }
  260. });
  261. this.list.map((arr, index) => {
  262. if (arr.id == item.id) {
  263. this.$set(arr, 'checked', false);
  264. }
  265. });
  266. },
  267. //获取部门
  268. get_dept_list() {
  269. this.$axios('get', '/api/department/tree').then(res => {
  270. this.dept_list = this.getTreeData(res.data.data.list);
  271. });
  272. },
  273. // 递归判断列表,把最后的children设为undefined
  274. getTreeData(data) {
  275. for (var i = 0; i < data.length; i++) {
  276. if (data[i]._child.length < 1) {
  277. // children若为空数组,则将children设为undefined
  278. data[i]._child = undefined;
  279. } else {
  280. // children若不为空数组,则继续 递归调用 本方法
  281. this.getTreeData(data[i]._child);
  282. }
  283. }
  284. return data;
  285. },
  286. //选择部门
  287. dept_cancel(item) {
  288. this.dept_selected.splice(this.dept_selected.indexOf(item.id), 1);
  289. let delete_index = -1;
  290. for (let i in this.dept_selected_list) {
  291. if (this.dept_selected.indexOf(this.dept_selected_list[i].id) < 0) {
  292. delete_index = i;
  293. }
  294. }
  295. if (delete_index >= 0) {
  296. this.dept_selected_list.splice(delete_index, 1);
  297. for (let i in this.dept_list) {
  298. if (this.dept_list[i].dept_id == item.id) {
  299. this.$set(this.dept_list[i], 'checked', false);
  300. }
  301. }
  302. }
  303. },
  304. //选择员工
  305. select_employee(item) {
  306. if (item.checked) {
  307. item.checked = false;
  308. this.employee_cancel(item);
  309. } else {
  310. if (!this.multi) {
  311. this.employee_selected = [];
  312. this.employee_selected_list = [];
  313. for (let i in this.list) {
  314. this.$set(this.list[i], 'checked', false);
  315. }
  316. }
  317. if (this.max > 0 && this.employee_selected_list.length == this.max && this.multi) {
  318. this.$message.error('最多只能选择' + this.max + '人');
  319. return false;
  320. }
  321. this.employee_selected.push(item.id);
  322. this.employee_selected_list.push({
  323. id: item.id,
  324. name: item.name,
  325. img_url: item.img_url
  326. });
  327. item.checked = true;
  328. }
  329. },
  330. clear_data() {
  331. this.employee_selected = [];
  332. if(this.createDimness){
  333. this.employee_selected_list = this.employee_selected_list.filter(x => x.is_creator);
  334. }else{
  335. this.employee_selected_list = [];
  336. }
  337. this.dept_selected = [];
  338. this.dept_selected_list = [];
  339. this.checked = false;
  340. for (let i in this.list) {
  341. this.$set(this.list[i], 'checked', false);
  342. }
  343. for (let i in this.dept_list) {
  344. this.$set(this.dept_list[i], 'checked', false);
  345. }
  346. },
  347. close() {
  348. if (this.close_clear_data) {
  349. this.employee_selected = [];
  350. this.employee_selected_list = [];
  351. this.dept_selected = [];
  352. this.dept_selected_list = [];
  353. for (let i in this.list) {
  354. this.$set(this.list[i], 'checked', false);
  355. }
  356. for (let i in this.dept_list) {
  357. this.$set(this.dept_list[i], 'checked', false);
  358. }
  359. }
  360. },
  361. confirm() {
  362. this.$emit('confirm', {
  363. employee: this.employee_selected_list,
  364. dept: this.dept_selected_list
  365. });
  366. this.close();
  367. },
  368. filtration() {
  369. //获取员工列表,限制已禁用的员工
  370. this.$axios('get', '/api/employee/index', { dept_id: this.pid, page: 0, page_size: 3000,is_official:1 })
  371. .then(res => {
  372. if (res.data.code == 1) {
  373. let list = res.data.data.list;
  374. let data = [];
  375. // list.forEach((item, index) => {
  376. // if (item.is_official == 1) {
  377. // data.push(item);
  378. // }
  379. // });
  380. this.userdatars(list);
  381. } else {
  382. this.userdatars();
  383. }
  384. })
  385. .catch(() => {
  386. this.userdatars();
  387. });
  388. },
  389. userdatars(userlist) {
  390. var employee_selected_list = this.employee_selected_list;
  391. let list = this.employee_list;
  392. if (userlist) {
  393. list = [...userlist].filter(x => [...list].some(y => y.id === x.id));
  394. //过滤已离职人员
  395. // employee_selected_list=[...userlist].filter(x => [...employee_selected_list].some(y => y.id === x.id));
  396. }
  397. // console.log(userlist,list)
  398. list.map(item => {
  399. item['checked'] = false;
  400. for (var i in employee_selected_list) {
  401. //判断传进来的员工是否是员工集合里的,是就设为已点击状态
  402. if (employee_selected_list[i].id == item.id) {
  403. item['checked'] = true;
  404. }
  405. }
  406. });
  407. this.employee_selected_list = employee_selected_list;
  408. this.list = list;
  409. this.searchBox=list;
  410. this.table_loading = false;
  411. },
  412. //获取员工详情
  413. get_user_list() {
  414. this.table_loading = true;
  415. var that = this;
  416. var employee_selected_list = this.employee_selected_list;
  417. if (this.employee_list.length > 0 || this.isCreatorSelect) {
  418. this.filtration();
  419. return false;
  420. }
  421. this.list = [];
  422. this.$axios('get', '/api/employee/index', { dept_id: this.pid, keywords: this.keyword, page: 0, page_size: 3000,is_official:1 }).then(res => {
  423. var employee = res.data.data.list || [];
  424. if (this.use_Administrator_list) {
  425. //使用管理员列表
  426. employee = this.useAdministratorList(employee);
  427. }
  428. var userAll = [];
  429. employee.forEach((item, i) => {
  430. if (!this.not_user && item.is_creator == 1) {
  431. //过滤系统管理员
  432. return null;
  433. } else if (this.my_no_select == item.id) {
  434. //过滤掉当前设置人
  435. return null;
  436. } else if (item.id) {
  437. userAll.push(item);
  438. }
  439. // 前端先隐藏过滤未开启的人员的功能
  440. // } else if (item.is_official == 1) {
  441. // userAll.push(item);
  442. // }
  443. });
  444. userAll.map(item => {
  445. item['checked'] = false;
  446. for (var i in employee_selected_list) {
  447. //判断传进来的员工是否是员工集合里的,是就设为已点击状态
  448. if (employee_selected_list[i].id == item.id) {
  449. item['checked'] = true;
  450. }
  451. }
  452. });
  453. that.list = userAll;
  454. this.searchBox=userAll;
  455. })
  456. .finally(() => {
  457. that.table_loading = false;
  458. });
  459. },
  460. useAdministratorList(list) {
  461. //过滤掉普通员工,返回管理员
  462. let arr = [];
  463. list.forEach((item, i) => {
  464. if (
  465. item.employee_detail.role_list.findIndex(
  466. value => value.name == 'dept_manager' || value.name == 'creator' || value.name == 'point_manager' || value.name == 'admin'
  467. ) >= 0
  468. ) {
  469. arr.push(item);
  470. }
  471. });
  472. return arr;
  473. }
  474. },
  475. created() {
  476. this.checked = false;
  477. setTimeout(() => {
  478. this.get_user_list();
  479. if (this.can_select_dept) {
  480. this.get_dept_list();
  481. }
  482. }, 200);
  483. }
  484. };
  485. </script>
  486. <style scoped>
  487. .deleteUser{
  488. font-size: 16px;
  489. padding: 8px;
  490. color: #777777;
  491. cursor: pointer;
  492. }
  493. .deleteUser:hover{
  494. color: #F56C6C;
  495. }
  496. .userName{
  497. width: 170px;
  498. }
  499. .employee_selector_box {
  500. width: 600px;
  501. padding: 20px;
  502. box-sizing: border-box;
  503. margin: 0 auto;
  504. }
  505. /* 搜索框 */
  506. .employee_selector_box .search {
  507. margin: 0 auto;
  508. width: 80%;
  509. }
  510. /* 左边框 */
  511. .employee_selector_box .choose_left {
  512. padding: 8px 10px;
  513. }
  514. .employee_selector_box .choose_left .employee_cell {
  515. border-bottom: 1px #f1f1f1 solid;
  516. }
  517. .employee_selector_box .choose_left .employee_checkbox {
  518. padding-left: 8px;
  519. }
  520. .employee_selector_box .choose_left .employee_img_url {
  521. padding-left: 8px;
  522. }
  523. .employee_selector_box .choose_left .employee_name {
  524. padding-left: 8px;
  525. }
  526. /* .employee_selector_box ::v-deep .el-scrollbar__thumb {
  527. width: 2px;
  528. margin: 15px 0 0 6px;
  529. background: #409eff;
  530. } */
  531. /* 右边距 */
  532. .employee_selector_box .option-box {
  533. padding: 14px;
  534. }
  535. .employee_selector_box .choose_right {
  536. padding: 8px 10px;
  537. }
  538. .employee_selector_box .choose_right .employee_delete .el-button {
  539. transform: scale(0.5);
  540. background: #c0c4cc;
  541. }
  542. .employee_selector_box .choose_right .employee_delete .el-button ::v-deep .el-icon-close {
  543. color: #fff;
  544. }
  545. .employee_selector_box .choose_right .employee_delete .el-button:active {
  546. background: #409eff;
  547. }
  548. .employee_selector_box .choose_right .employee_delete .el-button:active ::v-deep .el-icon-close {
  549. color: #fff;
  550. }
  551. .employee_selector_box .choose_right .employee_cell .employee_name {
  552. padding-left: 8px;
  553. }
  554. .employee_selector_box .choose_right .employee_cell .employee_img_url {
  555. padding-left: 8px;
  556. }
  557. /* 右边距 */
  558. .employee_cell2{
  559. padding: 8px 0;
  560. height: 50px;
  561. box-sizing: border-box;
  562. border-bottom: 1px #f1f1f1 solid;
  563. }
  564. .employee_selector_box ::v-deep .employee_cell {
  565. padding: 8px 0;
  566. height: 50px;
  567. box-sizing: border-box;
  568. }
  569. .employee_selector_box ::v-deep .employee_cell:hover {
  570. background: #ecf5ff;
  571. }
  572. .employee_cell {
  573. display: -webkit-inline-box;
  574. cursor: pointer;
  575. width: 100%;
  576. color: #606266;
  577. padding: 8px 0;
  578. background-color: transparent;
  579. border-bottom: 1px #f1f1f1 solid;
  580. }
  581. .employee_cell .employee_img_url {
  582. display: table-cell;
  583. vertical-align: middle;
  584. width: 30px;
  585. padding-left: 0px;
  586. }
  587. .employee_cell .employee_img_url img {
  588. width: 24px;
  589. height: 24px;
  590. border-radius: 50%;
  591. }
  592. .employee_cell .employee_checkbox {
  593. display: table-cell;
  594. vertical-align: middle;
  595. width: 30px;
  596. text-align: center;
  597. }
  598. .employee_cell .employee_name {
  599. display: table-cell;
  600. vertical-align: middle;
  601. color: #606266;
  602. }
  603. .employee_delete {
  604. display: table-cell;
  605. text-align: right;
  606. padding-right: 0px;
  607. }
  608. .employee_cell_a {
  609. display: block;
  610. }
  611. .employee_cell_a:hover {
  612. background-color: #ecf5ff;
  613. border-radius: 4px;
  614. }
  615. .dept_child_cell {
  616. display: table-cell;
  617. vertical-align: middle;
  618. }
  619. .dept_child_cell span {
  620. float: right;
  621. padding-right: 8px;
  622. }
  623. .dept_child_cell span:hover {
  624. color: #1c1c1c;
  625. }
  626. .dept_child_cell span:active {
  627. color: #1c1c1c;
  628. }
  629. .scroller-box {
  630. height: 440px;
  631. padding: 0px !important;
  632. background-color: #fdfdfd;
  633. border: 1px solid #eee;
  634. border-radius: 4px;
  635. overflow: hidden;
  636. }
  637. /* .scroller-box.one{
  638. height: 440px;
  639. } */
  640. .col-line {
  641. position: relative;
  642. height: 400px;
  643. }
  644. .col-line:before {
  645. content: ' ';
  646. width: 1px;
  647. height: 400px;
  648. position: absolute;
  649. top: 0;
  650. bottom: 0;
  651. left: 50%;
  652. background-color: #eee;
  653. }
  654. .search-box {
  655. background-color: #fff;
  656. padding: 10px 5px;
  657. border-bottom: 1px solid #eee;
  658. }
  659. .option-box {
  660. padding: 5px;
  661. background-color: #fff;
  662. border-bottom: 1px solid #eee;
  663. margin: 0 -5px;
  664. }
  665. .child_btn {
  666. color: #409eff;
  667. }
  668. .dept_path {
  669. margin: 10px 0;
  670. display: block;
  671. white-space: nowrap;
  672. overflow: auto;
  673. }
  674. /*滚动条的宽度*/
  675. .dept_path::-webkit-scrollbar {
  676. width: 5px;
  677. height: 5px;
  678. }
  679. /*外层轨道。可以用display:none让其不显示,也可以添加背景图片,颜色改变显示效果*/
  680. .dept_path::-webkit-scrollbar-track {
  681. width: 6px;
  682. background-color: #fff0;
  683. -webkit-border-radius: 2em;
  684. -moz-border-radius: 2em;
  685. border-radius: 2em;
  686. }
  687. /*滚动条的设置*/
  688. .dept_path::-webkit-scrollbar-thumb {
  689. background-color: #fff0;
  690. background-clip: padding-box;
  691. min-height: 28px;
  692. -webkit-border-radius: 2em;
  693. -moz-border-radius: 2em;
  694. border-radius: 2em;
  695. }
  696. /*滚动条移上去的背景*/
  697. .dept_path:hover::-webkit-scrollbar-thumb {
  698. background-color: rgba(144, 147, 153, 0.3);
  699. }
  700. .imgUrl{
  701. border-radius: 50%;
  702. height: 30px;
  703. width: 30px;
  704. box-sizing: border-box;
  705. text-align: center;
  706. line-height: 30px;
  707. font-size: 0.6rem;
  708. }
  709. </style>