index.vue 30 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739
  1. <template>
  2. <section>
  3. <el-col :span="4" class="left" :style="'height:'+ (tableHeight + 113) + 'px'">
  4. <div class="department">
  5. <span>部门</span>
  6. <div v-on:click="createDepartment(-1)">
  7. <i class="fa fa-plus-circle"></i>
  8. 创建部门
  9. </div>
  10. </div>
  11. <div class="tree" :style="'height:'+ (tableHeight + 83) + 'px'">
  12. <el-tree :data="data" :props="defaultProps" @node-click="handleNodeClick" accordion></el-tree>
  13. </div>
  14. </el-col>
  15. <el-col :span="20" class="right">
  16. <!--工具条-->
  17. <el-col :span="24" class="toolbar" style="padding-bottom: 0px;">
  18. <el-form :inline="true">
  19. <el-form-item>
  20. <div v-if="depData == null || depData.id == -1" class="nowTime" style="cursor:unset">
  21. <i class="fa fa-home"></i>全部人员
  22. </div>
  23. <div v-else-if="depData.id == 0" class="nowTime" style="cursor:unset">
  24. <i class="fa fa-home"></i>未分配
  25. </div>
  26. <div v-else-if="depData != null && depData.id != -1 && depData.id != 0" class="nowTime" @click="createDepartment(0)">
  27. <i class="fa fa-pencil-square-o"></i>
  28. {{depData!=null?depData.label:''}}
  29. </div>
  30. </el-form-item>
  31. <el-form-item style="float:right;">
  32. <el-link type="primary" :underline="false" @click="openInsertDialog(null)">添加人员</el-link>
  33. </el-form-item>
  34. <el-form-item style="float:right;" v-if="depData != null && depData.id != -1 && depData.id != 0">
  35. <el-upload ref="upload" action="#" :limit="1" :http-request="importUser" :show-file-list="false">
  36. <el-link type="primary" :underline="false">批量导入</el-link>
  37. </el-upload>
  38. </el-form-item>
  39. <el-form-item style="float:right;">
  40. <el-link type="primary" :underline="false" href="./upload/人员导入模板.xlsx" download="人员导入模板.xlsx">模板下载</el-link>
  41. </el-form-item>
  42. <el-form-item v-if="depData != null && depData.id != -1 && depData.id != 0" style="float:right;border: 0.5px solid #20a0ff;height: 27px;margin-top: 6px;">
  43. </el-form-item>
  44. <el-form-item style="float:right;">
  45. <el-link type="danger" v-if="depData != null && depData.id != -1 && depData.id != 0" :underline="false" @click="deleteDep(null)">删除部门</el-link>
  46. </el-form-item>
  47. <el-form-item style="float:right;">
  48. <el-link type="primary" v-if="depData != null && depData.id != -1 && depData.id != 0" :underline="false" @click="createDepartment(-1)">新增子部门</el-link>
  49. </el-form-item>
  50. </el-form>
  51. </el-col>
  52. <!--列表-->
  53. <el-table :data="list" highlight-current-row v-loading="listLoading" :height="tableHeight" style="width: 100%;">
  54. <el-table-column type="index" width="40"></el-table-column>
  55. <el-table-column prop="name" label="姓名" sortable></el-table-column>
  56. <el-table-column prop="phone" label="手机" width="120"></el-table-column>
  57. <el-table-column prop="departmentName" label="部门" sortable></el-table-column>
  58. <el-table-column label="角色" width="100">
  59. <template slot-scope="scope">{{scope.row.role == 0 ? "普通员工" : scope.row.role == 1 ? "负责人" : "管理员"}}</template>
  60. </el-table-column>
  61. <el-table-column prop="cost" label="成本" sortable>
  62. <template slot-scope="scope">{{scope.row.cost==null?0:scope.row.cost}} 元 / 小时</template>
  63. </el-table-column>
  64. <el-table-column label="操作" width="280">
  65. <template slot-scope="scope">
  66. <el-button size="small" v-if="scope.row.role == 0 && user.role == 1" @click="switchRole(scope.$index)">切换为管理员</el-button>
  67. <el-button size="small" v-if="scope.row.role == 2 && user.role == 1" @click="switchRole(scope.$index)">切换为员工</el-button>
  68. <el-button size="small" type="primary" v-if="scope.row.role != 1" @click="openInsertDialog(scope.$index)">编辑</el-button>
  69. <el-button size="small" type="primary" v-if="scope.row.role == 1" @click="openInsertDialog1(scope.$index)">编辑</el-button>
  70. <el-button size="small" type="danger" v-if="scope.row.role == 0" @click="deleteUser(scope.$index)">删除</el-button>
  71. </template>
  72. </el-table-column>
  73. </el-table>
  74. <!--工具条-->
  75. <el-col :span="24" class="toolbar">
  76. <el-pagination
  77. @size-change="handleSizeChange"
  78. @current-change="handleCurrentChange"
  79. :page-sizes="[20 , 50 , 80 , 100]"
  80. :page-size="20"
  81. layout="total, sizes, prev, pager, next"
  82. :total="total"
  83. style="float:right;"
  84. ></el-pagination>
  85. </el-col>
  86. </el-col>
  87. <!-- 新增部门 -->
  88. <el-dialog :title="depTitle" :visible.sync="departmentVisible" width="400px">
  89. <el-form ref="depForm" :model="depForm" :rules="depRules" label-width="80px">
  90. <el-form-item label="部门名称" prop="name">
  91. <el-input v-model="depForm.name" placeholder="请输入部门名称" clearable></el-input>
  92. </el-form-item>
  93. </el-form>
  94. <span slot="footer" class="dialog-footer">
  95. <el-button @click="departmentVisible = false">取消</el-button>
  96. <el-button type="primary" @click="submitDepartment">提交</el-button>
  97. </span>
  98. </el-dialog>
  99. <!-- 新增单个人员的Dialog -->
  100. <el-dialog :title="title" :visible.sync="dialogVisible" width="400px">
  101. <el-form ref="form1" :model="insertForm" :rules="rules" label-width="60px">
  102. <el-form-item label="名字" prop="name">
  103. <el-input v-model="insertForm.name" placeholder="请输入姓名" clearable></el-input>
  104. </el-form-item>
  105. <el-form-item label="电话" prop="phone">
  106. <el-input v-model="insertForm.phone" placeholder="请输入电话号码" clearable></el-input>
  107. </el-form-item>
  108. <el-form-item label="成本" prop="cost">
  109. <el-input v-model.number="insertForm.cost" placeholder="请输入成本 单位:元/小时" clearable></el-input>
  110. </el-form-item>
  111. <el-form-item label="部门" prop="departmentId">
  112. <el-cascader v-model="insertForm.departmentId" placeholder="请选择部门" style="width: 100%"
  113. :options="option" :props="{ checkStrictly: true }" :show-all-levels="false" clearable></el-cascader>
  114. </el-form-item>
  115. <el-form-item label="角色" prop="role">
  116. <el-select v-model="insertForm.role" placeholder="请选择角色" style="width: 100%">
  117. <el-option label="普通员工" :value="0"></el-option>
  118. <el-option label="管理员" :value="2"></el-option>
  119. </el-select>
  120. </el-form-item>
  121. </el-form>
  122. <span slot="footer" class="dialog-footer">
  123. <el-button @click="dialogVisible=false">取消</el-button>
  124. <el-button type="primary" @click="submitInsert">提交</el-button>
  125. </span>
  126. </el-dialog>
  127. <el-dialog title="修改成本" :visible.sync="dialogVisible1" width="400px">
  128. <el-form ref="form1" :model="insertForm" :rules="rules" label-width="60px">
  129. <el-form-item label="成本" prop="cost">
  130. <el-input v-model.number="insertForm.cost" placeholder="请输入成本 单位:元/小时" clearable></el-input>
  131. </el-form-item>
  132. <el-form-item label="部门" prop="departmentId">
  133. <el-cascader v-model="insertForm.departmentId" placeholder="请选择部门" style="width: 100%"
  134. :options="option" :props="{ checkStrictly: true }" :show-all-levels="false" clearable></el-cascader>
  135. </el-form-item>
  136. </el-form>
  137. <span slot="footer" class="dialog-footer">
  138. <el-button @click="dialogVisible1=false">取消</el-button>
  139. <el-button type="primary" @click="submitInsert1">提交</el-button>
  140. </span>
  141. </el-dialog>
  142. </section>
  143. </template>
  144. <script>
  145. export default {
  146. data() {
  147. return {
  148. user: JSON.parse(sessionStorage.getItem("user")),
  149. tableHeight: 0,
  150. listLoading: false,
  151. total: 0,
  152. page: 1,
  153. size: 20,
  154. list: [],
  155. data: [
  156. {
  157. id: -1,
  158. label: '全部人员',
  159. },
  160. {
  161. id: 0,
  162. label: '未分配',
  163. }
  164. ],
  165. option: [],
  166. depData: {
  167. id: -1,
  168. label: '全部人员',
  169. },
  170. defaultProps: {
  171. children: 'children',
  172. label: 'label'
  173. },
  174. dialogVisible: false,
  175. title: "",
  176. insertForm: {
  177. id: null,
  178. name: null,
  179. phone: null,
  180. role: null,
  181. cost: null,
  182. departmentId: null,
  183. },
  184. rules: {
  185. name: [{ required: true, message: "请输入姓名", trigger: "blur" }],
  186. phone: [{ required: true, message: "请输入电话", trigger: "blur" }],
  187. role: [{ required: true, message: "请选择角色", trigger: "blur" }],
  188. cost: [{ required: true, message: "请输入成本", trigger: "blur" }]
  189. },
  190. dialogVisible1: false,
  191. departmentVisible: false,
  192. depTitle: '',
  193. depForm: {
  194. id: null,
  195. name: null,
  196. parentId: null,
  197. },
  198. depRules: {
  199. name: [{ required: true, message: "请输入部门名称", trigger: "blur" }],
  200. },
  201. };
  202. },
  203. methods: {
  204. // 批量导入人员
  205. importUser(item) {
  206. //首先判断文件类型
  207. let str = item.file.name.split(".");
  208. let format = str[str.length - 1];
  209. if (format != "xls" && format != "xlsx") {
  210. this.$message({
  211. message: "请选择.xls或.xlsx文件",
  212. type: "error"
  213. });
  214. } else {
  215. this.listLoading = true;
  216. let formData = new FormData();
  217. formData.append("file", item.file);
  218. formData.append("departmentId", this.depData.id);
  219. this.http.uploadFile( this.port.manage.import, formData,
  220. res => {
  221. this.$refs.upload.clearFiles();
  222. this.listLoading = false;
  223. if (res.code == "ok") {
  224. this.$message({
  225. message: "导入成功",
  226. type: "success"
  227. });
  228. //重新读取列表
  229. this.getUser();
  230. } else {
  231. this.$message({
  232. message: res.msg,
  233. type: "error"
  234. });
  235. }
  236. },
  237. error => {
  238. this.$refs.upload.clearFiles();
  239. this.listLoading = false;
  240. this.$message({
  241. message: error,
  242. type: "error"
  243. });
  244. });
  245. }
  246. },
  247. //分页
  248. handleCurrentChange(val) {
  249. this.page = val;
  250. this.getUser();
  251. },
  252. handleSizeChange(val) {
  253. this.size = val;
  254. this.getUser();
  255. },
  256. //获取所有员工的列表
  257. getUser() {
  258. this.listLoading = true;
  259. this.http.post( this.port.manage.list, {
  260. departmentId: this.depData.id,
  261. pageIndex: this.page,
  262. pageSize: this.size
  263. },
  264. res => {
  265. this.listLoading = false;
  266. if (res.code == "ok") {
  267. this.list = res.data.records;
  268. this.total = res.data.total;
  269. } else {
  270. this.$message({
  271. message: res.msg,
  272. type: "error"
  273. });
  274. }
  275. },
  276. error => {
  277. this.listLoading = false;
  278. this.$message({
  279. message: error,
  280. type: "error"
  281. });
  282. });
  283. },
  284. // 新增、编辑人员
  285. openInsertDialog(i) {
  286. if (i != null) {
  287. var list = JSON.parse(JSON.stringify(this.list[i])) , arr = [] , array = [];
  288. if(list.departmentCascade!='0' && list.departmentCascade!=null) {
  289. if(list.departmentCascade.indexOf(",")>-1) {
  290. arr = list.departmentCascade.split(",");
  291. } else {
  292. arr = [].concat(list.departmentCascade)
  293. }
  294. }
  295. for(var i in arr) {
  296. array.push(parseInt(arr[i]))
  297. }
  298. this.insertForm = {
  299. id: list.id,
  300. name: list.name,
  301. phone: list.phone,
  302. role: list.role,
  303. cost: list.cost,
  304. departmentId: array,
  305. };
  306. this.title = "编辑人员"
  307. } else {
  308. this.insertForm = {
  309. id: null,
  310. name: null,
  311. phone: null,
  312. role: null,
  313. cost: null,
  314. departmentId: null,
  315. };
  316. this.title = "新增人员"
  317. }
  318. this.dialogVisible = true;
  319. },
  320. submitInsert() {
  321. this.$refs.form1.validate(valid => {
  322. if (valid) {
  323. this.listLoading = true;
  324. var form = {
  325. name: this.insertForm.name,
  326. phone: this.insertForm.phone,
  327. role: this.insertForm.role,
  328. cost: this.insertForm.cost
  329. };
  330. if (this.insertForm.id != null) {
  331. form.id = this.insertForm.id;
  332. }
  333. if (this.insertForm.departmentId != null) {
  334. form.departmentId = this.insertForm.departmentId[this.insertForm.departmentId.length-1];
  335. }
  336. this.http.post( this.port.manage.insert, form,
  337. res => {
  338. this.listLoading = false;
  339. if (res.code == "ok") {
  340. this.$message({
  341. message: this.insertForm.id != null ? "修改" : "创建" + "成功",
  342. type: "success"
  343. });
  344. this.dialogVisible = false;
  345. this.getUser();
  346. } else {
  347. this.$message({
  348. message: res.msg,
  349. type: "error"
  350. });
  351. }
  352. },
  353. error => {
  354. this.listLoading = false;
  355. this.$message({
  356. message: error,
  357. type: "error"
  358. });
  359. });
  360. }
  361. });
  362. },
  363. // 切换角色
  364. switchRole(index) {
  365. this.listLoading = true;
  366. this.http.post( this.port.manage.permission, { id: this.list[index].id },
  367. res => {
  368. this.listLoading = false;
  369. if (res.code == "ok") {
  370. this.$message({
  371. message: "切换角色成功",
  372. type: "success"
  373. });
  374. //重新读取列表
  375. this.getUser();
  376. } else {
  377. this.$message({
  378. message: res.msg,
  379. type: "error"
  380. });
  381. }
  382. },
  383. error => {
  384. this.listLoading = false;
  385. this.$message({
  386. message: error,
  387. type: "error"
  388. });
  389. });
  390. },
  391. // 删除用户
  392. deleteUser(index) {
  393. this.$confirm( "确定要删除用户" + this.list[index].name + "吗?", "删除用户", {
  394. confirmButtonText: "确定",
  395. cancelButtonText: "取消",
  396. type: "warning"
  397. })
  398. .then(() => {
  399. this.listLoading = true;
  400. this.http.post( this.port.manage.delete, { userId: this.list[index].id },
  401. res => {
  402. this.listLoading = false;
  403. if (res.code == "ok") {
  404. this.$message({
  405. message: "删除成功",
  406. type: "success"
  407. });
  408. //重新读取列表
  409. this.getUser();
  410. } else {
  411. this.$message({
  412. message: res.msg,
  413. type: "error"
  414. });
  415. }
  416. },
  417. error => {
  418. this.listLoading = false;
  419. this.$message({
  420. message: error,
  421. type: "error"
  422. });
  423. });
  424. })
  425. .catch(() => {});
  426. },
  427. // 修改老板的成本
  428. openInsertDialog1(i) {
  429. var list1 = JSON.parse(JSON.stringify(this.list[i])) , arr1 = [] , array1 = [];
  430. if(list1.departmentCascade!='0' && list1.departmentCascade!=null) {
  431. if(list1.departmentCascade.indexOf(",")>-1) {
  432. arr1 = list1.departmentCascade.split(",");
  433. } else {
  434. arr1 = [].concat(list1.departmentCascade)
  435. }
  436. }
  437. for(var i in arr1) {
  438. array1.push(parseInt(arr1[i]))
  439. }
  440. this.insertForm = {
  441. id: this.list[i].id,
  442. name: this.list[i].name,
  443. phone: this.list[i].phone,
  444. role: this.list[i].role,
  445. cost: this.list[i].cost,
  446. departmentId: array1,
  447. };
  448. this.dialogVisible1 = true;
  449. },
  450. submitInsert1() {
  451. this.$refs.form1.validate(valid => {
  452. if (valid) {
  453. this.listLoading = true;
  454. var form = {
  455. id: this.insertForm.id,
  456. name: this.insertForm.name,
  457. phone: this.insertForm.phone,
  458. role: this.insertForm.role,
  459. cost: this.insertForm.cost
  460. };
  461. if (this.insertForm.departmentId != null) {
  462. form.departmentId = this.insertForm.departmentId[this.insertForm.departmentId.length-1];
  463. }
  464. this.http.post( this.port.manage.insert, form,
  465. res => {
  466. this.listLoading = false;
  467. if (res.code == "ok") {
  468. this.$message({
  469. message: "修改成功",
  470. type: "success"
  471. });
  472. this.dialogVisible1 = false;
  473. //重新读取列表
  474. this.getUser();
  475. } else {
  476. this.$message({
  477. message: res.msg,
  478. type: "error"
  479. });
  480. }
  481. },
  482. error => {
  483. this.listLoading = false;
  484. this.$message({
  485. message: error,
  486. type: "error"
  487. });
  488. });
  489. }
  490. });
  491. },
  492. // 获取部门列表
  493. getDepartment() {
  494. this.http.post( this.port.manage.depList, {},
  495. res => {
  496. if (res.code == "ok") {
  497. var list = res.data , list1 = JSON.parse(JSON.stringify(res.data));
  498. list.splice(0,0,{
  499. id: -1,
  500. label: '全部人员',
  501. })
  502. list.push({
  503. id: 0,
  504. label: '未分配',
  505. })
  506. this.data = list;
  507. this.option = this.changeArr(list1);
  508. } else {
  509. this.$message({
  510. message: res.msg,
  511. type: "error"
  512. });
  513. }
  514. },
  515. error => {
  516. this.$message({
  517. message: error,
  518. type: "error"
  519. });
  520. });
  521. },
  522. // 修改数组
  523. changeArr(arr) {
  524. for (var i = 0; i < arr.length; i++) {
  525. if(arr[i].id != -1 && arr[i].id != 0) {
  526. if (arr[i].children != null && arr[i].children.length>0) {
  527. arr[i].children = this.changeArr(arr[i].children);
  528. }
  529. arr[i].id && (arr[i].value = arr[i].id);
  530. delete arr[i].id;
  531. }
  532. }
  533. for(var i in arr) {
  534. if(arr[i].id == -1 || arr[i].id == 0) {
  535. arr.splice(i,1)
  536. }
  537. }
  538. return arr;
  539. },
  540. // 部门列表点击
  541. handleNodeClick(data) {
  542. if(this.depData == null || data.id != this.depData.id) {
  543. this.depData = data;
  544. this.getUser();
  545. }
  546. },
  547. // 新增、修改部门
  548. createDepartment(i) {
  549. if(i == -1) {
  550. this.depForm = {
  551. id: null,
  552. name: null,
  553. parentId: null,
  554. }
  555. if(this.depData.id != -1 && this.depData.id != 0) {
  556. this.depForm.parentId = this.depData.id;
  557. }
  558. this.depTitle = "新增部门";
  559. } else {
  560. this.depForm = {
  561. id: this.depData.id,
  562. name: this.depData.label,
  563. parentId: this.depData.parentId,
  564. }
  565. this.depTitle = "编辑部门";
  566. }
  567. this.departmentVisible = true;
  568. },
  569. submitDepartment() {
  570. this.$refs.depForm.validate(valid => {
  571. if (valid) {
  572. var form = {
  573. name: this.depForm.name,
  574. };
  575. if(this.depForm.id != null) {
  576. form.id = this.depForm.id
  577. }
  578. if(this.depForm.parentId != null) {
  579. form.parentId = this.depForm.parentId
  580. }
  581. this.http.post( this.depForm.id==null?this.port.manage.add:this.port.manage.edit, form,
  582. res => {
  583. if (res.code == "ok") {
  584. this.$message({
  585. message: this.depForm.id==null?"新增成功":"修改成功",
  586. type: "success"
  587. });
  588. this.departmentVisible = false;
  589. this.depData.label = form.name;
  590. this.getDepartment();
  591. } else {
  592. this.$message({
  593. message: res.msg,
  594. type: "error"
  595. });
  596. }
  597. },
  598. error => {
  599. this.listLoading = false;
  600. this.$message({
  601. message: error,
  602. type: "error"
  603. });
  604. });
  605. }
  606. });
  607. },
  608. // 删除部门
  609. deleteDep() {
  610. this.$confirm( "确定要删除部门" + this.depData.label + "吗?", "删除部门", {
  611. confirmButtonText: "确定",
  612. cancelButtonText: "取消",
  613. type: "warning"
  614. })
  615. .then(() => {
  616. this.listLoading = true;
  617. this.http.post( this.port.manage.del, { id: this.depData.id },
  618. res => {
  619. this.listLoading = false;
  620. if (res.code == "ok") {
  621. this.$message({
  622. message: "删除成功",
  623. type: "success"
  624. });
  625. this.depData = {
  626. id: -1,
  627. label: '全部人员',
  628. }
  629. this.getDepartment();
  630. this.getUser();
  631. } else {
  632. this.$message({
  633. message: res.msg,
  634. type: "error"
  635. });
  636. }
  637. },
  638. error => {
  639. this.listLoading = false;
  640. this.$message({
  641. message: error,
  642. type: "error"
  643. });
  644. });
  645. })
  646. .catch(() => {});
  647. },
  648. },
  649. created() {
  650. let height = window.innerHeight;
  651. this.tableHeight = height - 195;
  652. const that = this;
  653. window.onresize = function temp() {
  654. that.tableHeight = window.innerHeight - 195;
  655. };
  656. },
  657. mounted() {
  658. this.getDepartment();
  659. this.getUser();
  660. }
  661. };
  662. </script>
  663. <style lang="scss" scoped>
  664. .left {
  665. border: 1px solid #f2f2f2;
  666. overflow: hidden;
  667. .department {
  668. color: #8f8f8f;
  669. margin: 15px 0 10px;
  670. line-height: 30px;
  671. padding: 0 10px;
  672. font-size: 16px;
  673. div {
  674. float: right;
  675. color: #20a0ff;
  676. font-size: 14px;
  677. cursor: pointer;
  678. }
  679. }
  680. .tree {
  681. overflow: auto;
  682. }
  683. }
  684. .nowTime {
  685. height: 40px;
  686. line-height: 40px;
  687. font-size: 16px;
  688. color: #20a0ff;
  689. margin-left: 10px;
  690. cursor: pointer;
  691. i {
  692. margin-right: 10px;
  693. }
  694. }
  695. </style>
  696. <style lang="scss">
  697. .tree {
  698. .el-tree-node__label {
  699. overflow-x: hidden;
  700. white-space: nowrap;
  701. text-overflow: ellipsis;
  702. }
  703. }
  704. </style>