Newer
Older
KaiFengPC / src / views / system / user / index.vue
@zhangdeliang zhangdeliang on 23 May 22 KB 初始化项目
  1. <template>
  2. <!-- 用户管理 -->
  3. <div class="publicContainer userPage">
  4. <el-row :gutter="20">
  5. <!--部门数据-->
  6. <el-col :span="4" :xs="24">
  7. <el-input v-model="deptName" placeholder="请输入部门名称" clearable prefix-icon="Search" style="margin-bottom: 10px; width: 100%" />
  8. <div class="head-container">
  9. <el-tree
  10. :data="deptOptions"
  11. :props="{ label: 'label', children: 'children' }"
  12. :expand-on-click-node="false"
  13. :filter-node-method="filterNode"
  14. ref="deptTreeRef"
  15. node-key="id"
  16. highlight-current
  17. default-expand-all
  18. @node-click="handleNodeClick"
  19. />
  20. </div>
  21. </el-col>
  22. <!--用户数据-->
  23. <el-col :span="20" :xs="24">
  24. <el-form :model="queryParams" ref="queryRef" :inline="true" v-show="showSearch">
  25. <el-form-item label="用户名称" prop="userName">
  26. <el-input
  27. v-model="queryParams.userName"
  28. placeholder="请输入用户名称"
  29. clearable
  30. style="width: 240px"
  31. @keyup.enter="handleQuery"
  32. />
  33. </el-form-item>
  34. <el-form-item label="手机号码" prop="phonenumber">
  35. <el-input
  36. v-model="queryParams.phonenumber"
  37. placeholder="请输入手机号码"
  38. clearable
  39. style="width: 240px"
  40. @keyup.enter="handleQuery"
  41. />
  42. </el-form-item>
  43. <el-form-item label="状态" prop="status">
  44. <el-select v-model="queryParams.status" placeholder="用户状态" clearable style="width: 240px">
  45. <el-option v-for="dict in sys_normal_disable" :key="dict.value" :label="dict.label" :value="dict.value" />
  46. </el-select>
  47. </el-form-item>
  48. <el-form-item label="创建时间" style="width: 308px">
  49. <el-date-picker
  50. v-model="dateRange"
  51. value-format="YYYY-MM-DD"
  52. type="daterange"
  53. range-separator="-"
  54. start-placeholder="开始日期"
  55. end-placeholder="结束日期"
  56. ></el-date-picker>
  57. </el-form-item>
  58. <el-form-item>
  59. <el-button type="primary" icon="Search" @click="handleQuery">搜索</el-button>
  60. <el-button type="success" icon="Refresh" @click="resetQuery">重置</el-button>
  61. </el-form-item>
  62. </el-form>
  63.  
  64. <el-row :gutter="10" class="mb8">
  65. <el-col :span="1.5">
  66. <el-button type="primary" plain icon="Plus" @click="handleAdd" v-hasPermi="['system:user:add']">新增</el-button>
  67. </el-col>
  68. <el-col :span="1.5">
  69. <el-button type="success" plain icon="Edit" :disabled="single" @click="handleUpdate" v-hasPermi="['system:user:edit']">
  70. 修改
  71. </el-button>
  72. </el-col>
  73. <el-col :span="1.5">
  74. <el-button type="danger" plain icon="Delete" :disabled="multiple" @click="handleDelete" v-hasPermi="['system:user:remove']">
  75. 删除
  76. </el-button>
  77. </el-col>
  78. <el-col :span="1.5">
  79. <el-button type="info" plain icon="Upload" @click="handleImport" v-hasPermi="['system:user:import']">导入</el-button>
  80. </el-col>
  81. <el-col :span="1.5">
  82. <el-button type="warning" plain icon="Download" @click="handleExport" v-hasPermi="['system:user:export']">导出</el-button>
  83. </el-col>
  84. <right-toolbar v-model:showSearch="showSearch" @queryTable="getList" :columns="columns"></right-toolbar>
  85. </el-row>
  86.  
  87. <el-table v-loading="loading" :data="userList" @selection-change="handleSelectionChange">
  88. <el-table-column type="selection" width="50" />
  89. <el-table-column label="用户编号" key="userId" prop="userId" v-if="columns[0].visible" />
  90. <el-table-column label="用户名称" key="userName" prop="userName" v-if="columns[1].visible" show-overflow-tooltip />
  91. <el-table-column label="用户昵称" key="nickName" prop="nickName" v-if="columns[2].visible" show-overflow-tooltip />
  92. <el-table-column label="部门" key="deptName" prop="dept.deptName" v-if="columns[3].visible" show-overflow-tooltip />
  93. <el-table-column label="手机号码" key="phonenumber" prop="phonenumber" v-if="columns[4].visible" width="120" />
  94. <el-table-column label="状态" key="status" v-if="columns[5].visible">
  95. <template #default="scope">
  96. <el-switch v-model="scope.row.status" active-value="0" inactive-value="1" @change="handleStatusChange(scope.row)"></el-switch>
  97. </template>
  98. </el-table-column>
  99. <el-table-column label="创建时间" prop="createTime" v-if="columns[6].visible" width="160">
  100. <template #default="scope">
  101. <span>{{ parseTime(scope.row.createTime) }}</span>
  102. </template>
  103. </el-table-column>
  104. <el-table-column label="操作" width="150" class-name="small-padding fixed-width">
  105. <template #default="scope">
  106. <el-tooltip content="修改" placement="top" v-if="scope.row.userId !== 1">
  107. <el-button link type="primary" icon="Edit" @click="handleUpdate(scope.row)" v-hasPermi="['system:user:edit']"></el-button>
  108. </el-tooltip>
  109. <el-tooltip content="删除" placement="top" v-if="scope.row.userId !== 1">
  110. <el-button
  111. link
  112. type="primary"
  113. icon="Delete"
  114. @click="handleDelete(scope.row)"
  115. v-hasPermi="['system:user:remove']"
  116. ></el-button>
  117. </el-tooltip>
  118. <el-tooltip content="重置密码" placement="top" v-if="scope.row.userId !== 1">
  119. <el-button
  120. link
  121. type="primary"
  122. icon="Key"
  123. @click="handleResetPwd(scope.row)"
  124. v-hasPermi="['system:user:resetPwd']"
  125. ></el-button>
  126. </el-tooltip>
  127. <el-tooltip content="分配角色" placement="top" v-if="scope.row.userId !== 1">
  128. <el-button
  129. link
  130. type="primary"
  131. icon="CircleCheck"
  132. @click="handleAuthRole(scope.row)"
  133. v-hasPermi="['system:user:edit']"
  134. ></el-button>
  135. </el-tooltip>
  136. </template>
  137. </el-table-column>
  138. </el-table>
  139. <pagination
  140. v-show="total > 0"
  141. :total="total"
  142. v-model:page="queryParams.pageNum"
  143. v-model:limit="queryParams.pageSize"
  144. @pagination="getList"
  145. />
  146. </el-col>
  147. </el-row>
  148.  
  149. <!-- 添加或修改用户配置对话框 -->
  150. <el-dialog :title="title" v-model="open" width="700px" append-to-body>
  151. <el-form :model="form" :rules="rules" ref="userRef" label-width="100px">
  152. <el-row>
  153. <el-col :span="12">
  154. <el-form-item label="用户昵称" prop="nickName">
  155. <el-input v-model="form.nickName" placeholder="请输入用户昵称" maxlength="30" />
  156. </el-form-item>
  157. </el-col>
  158. <el-col :span="12">
  159. <el-form-item label="归属部门" prop="deptId">
  160. <el-tree-select
  161. v-model="form.deptId"
  162. :data="deptOptions"
  163. :props="{ value: 'id', label: 'label', children: 'children' }"
  164. value-key="id"
  165. placeholder="请选择归属部门"
  166. check-strictly
  167. style="width: 100%"
  168. />
  169. </el-form-item>
  170. </el-col>
  171. </el-row>
  172. <el-row>
  173. <el-col :span="12">
  174. <el-form-item label="手机号码" prop="phonenumber">
  175. <el-input v-model="form.phonenumber" placeholder="请输入手机号码" maxlength="11" />
  176. </el-form-item>
  177. </el-col>
  178. <el-col :span="12">
  179. <el-form-item label="邮箱" prop="email">
  180. <el-input v-model="form.email" placeholder="请输入邮箱" maxlength="50" />
  181. </el-form-item>
  182. </el-col>
  183. </el-row>
  184. <el-row>
  185. <el-col :span="12">
  186. <el-form-item v-if="form.userId == undefined" label="用户名称" prop="userName">
  187. <el-input v-model="form.userName" placeholder="请输入用户名称" maxlength="30" />
  188. </el-form-item>
  189. </el-col>
  190. <el-col :span="12">
  191. <el-form-item v-if="form.userId == undefined" label="用户密码" prop="password">
  192. <el-input v-model="form.password" placeholder="8-20位大小写字母+数字+特殊符号" type="password" maxlength="20" show-password />
  193. </el-form-item>
  194. </el-col>
  195. </el-row>
  196. <el-row>
  197. <el-col :span="12">
  198. <el-form-item label="用户性别">
  199. <el-select v-model="form.sex" placeholder="请选择" style="width: 100%">
  200. <el-option v-for="dict in sys_user_sex" :key="dict.value" :label="dict.label" :value="dict.value"></el-option>
  201. </el-select>
  202. </el-form-item>
  203. </el-col>
  204. <el-col :span="12">
  205. <el-form-item label="状态">
  206. <el-radio-group v-model="form.status">
  207. <el-radio v-for="dict in sys_normal_disable" :key="dict.value" :label="dict.value">{{ dict.label }}</el-radio>
  208. </el-radio-group>
  209. </el-form-item>
  210. </el-col>
  211. </el-row>
  212. <el-row>
  213. <el-col :span="12">
  214. <el-form-item label="岗位" prop="postIds">
  215. <el-select v-model="form.postIds" multiple placeholder="请选择" style="width: 100%">
  216. <el-option
  217. v-for="item in postOptions"
  218. :key="item.postId"
  219. :label="item.postName"
  220. :value="item.postId"
  221. :disabled="item.status == 1"
  222. ></el-option>
  223. </el-select>
  224. </el-form-item>
  225. </el-col>
  226. <el-col :span="12">
  227. <el-form-item label="角色" prop="roleIds">
  228. <el-select v-model="form.roleIds" multiple placeholder="请选择" style="width: 100%">
  229. <el-option
  230. v-for="item in roleOptions"
  231. :key="item.roleId"
  232. :label="item.roleName"
  233. :value="item.roleId"
  234. :disabled="item.status == 1"
  235. ></el-option>
  236. </el-select>
  237. </el-form-item>
  238. </el-col>
  239. </el-row>
  240. <el-row>
  241. <el-col :span="24">
  242. <el-form-item label="备注">
  243. <el-input v-model="form.remark" type="textarea" placeholder="请输入内容"></el-input>
  244. </el-form-item>
  245. </el-col>
  246. </el-row>
  247. </el-form>
  248. <template #footer>
  249. <div class="dialog-footer">
  250. <el-button type="info" @click="cancel">取 消</el-button>
  251. <el-button type="primary" @click="submitForm">确 定</el-button>
  252. </div>
  253. </template>
  254. </el-dialog>
  255.  
  256. <!-- 用户导入对话框 -->
  257. <el-dialog :title="upload.title" v-model="upload.open" width="400px" append-to-body>
  258. <el-upload
  259. ref="uploadRef"
  260. :limit="1"
  261. accept=".xlsx, .xls"
  262. :headers="upload.headers"
  263. :action="upload.url + '?updateSupport=' + upload.updateSupport"
  264. :disabled="upload.isUploading"
  265. :on-progress="handleFileUploadProgress"
  266. :on-success="handleFileSuccess"
  267. :auto-upload="false"
  268. drag
  269. >
  270. <el-icon class="el-icon--upload"><upload-filled /></el-icon>
  271. <div class="el-upload__text">将文件拖到此处,或<em>点击上传</em></div>
  272. <template #tip>
  273. <div class="el-upload__tip text-center">
  274. <div class="el-upload__tip"><el-checkbox v-model="upload.updateSupport" />是否更新已经存在的用户数据</div>
  275. <span>仅允许导入xls、xlsx格式文件。</span>
  276. <el-link type="primary" :underline="false" style="font-size: 12px; vertical-align: baseline" @click="importTemplate">
  277. 下载模板
  278. </el-link>
  279. </div>
  280. </template>
  281. </el-upload>
  282. <template #footer>
  283. <div class="dialog-footer">
  284. <el-button type="info" @click="upload.open = false">取 消</el-button>
  285. <el-button type="primary" @click="submitFileForm">确 定</el-button>
  286. </div>
  287. </template>
  288. </el-dialog>
  289.  
  290. <!-- 分配角色弹窗 -->
  291. <el-dialog title="分配角色" v-model="dialogRole" width="900px" append-to-body>
  292. <UserRole v-if="dialogRole" :userId="userId" @childCloseRole="childCloseRole"></UserRole>
  293. </el-dialog>
  294. </div>
  295. </template>
  296.  
  297. <script setup name="userPage">
  298. import { getToken } from '@/utils/auth';
  299. import { EncryptAES } from '@/utils/AES.js';
  300. import { changeUserStatus, pageUser, resetUserPwd, delUser, getUser, updateUser, addUser, deptTreeSelect } from '@/api/system/user';
  301. import UserRole from './authRole'; //
  302.  
  303. const router = useRouter();
  304. const { proxy } = getCurrentInstance();
  305. const { sys_normal_disable, sys_user_sex } = proxy.useDict('sys_normal_disable', 'sys_user_sex');
  306.  
  307. const dialogRole = ref(false);
  308. const userList = ref([]);
  309. const userId = ref('');
  310. const open = ref(false);
  311. const loading = ref(true);
  312. const showSearch = ref(true);
  313. const ids = ref([]);
  314. const single = ref(true);
  315. const multiple = ref(true);
  316. const total = ref(0);
  317. const title = ref('');
  318. const dateRange = ref([]);
  319. const deptName = ref('');
  320. const deptOptions = ref(undefined);
  321. const initPassword = ref(undefined);
  322. const postOptions = ref([]);
  323. const roleOptions = ref([]);
  324. /*** 用户导入参数 */
  325. const upload = reactive({
  326. // 是否显示弹出层(用户导入)
  327. open: false,
  328. // 弹出层标题(用户导入)
  329. title: '',
  330. // 是否禁用上传
  331. isUploading: false,
  332. // 是否更新已经存在的用户数据
  333. updateSupport: 0,
  334. // 设置上传的请求头部
  335. headers: { Authorization: 'Bearer ' + getToken() },
  336. // 上传的地址
  337. url: import.meta.env.VITE_APP_BASE_API + '/system/user/importData',
  338. });
  339. // 列显隐信息
  340. const columns = ref([
  341. { key: 0, label: `用户编号`, visible: true },
  342. { key: 1, label: `用户名称`, visible: true },
  343. { key: 2, label: `用户昵称`, visible: true },
  344. { key: 3, label: `部门`, visible: true },
  345. { key: 4, label: `手机号码`, visible: true },
  346. { key: 5, label: `状态`, visible: true },
  347. { key: 6, label: `创建时间`, visible: true },
  348. ]);
  349.  
  350. const data = reactive({
  351. form: {},
  352. queryParams: {
  353. pageNum: 1,
  354. pageSize: 10,
  355. userName: undefined,
  356. phonenumber: undefined,
  357. status: undefined,
  358. deptId: undefined,
  359. },
  360. rules: {
  361. userName: [
  362. { required: true, message: '用户名称不能为空', trigger: 'blur' },
  363. {
  364. min: 2,
  365. max: 20,
  366. message: '用户名称长度必须介于 2 和 20 之间',
  367. trigger: 'blur',
  368. },
  369. ],
  370. postIds: [{ required: true, message: '岗位不能为空', trigger: 'change', type: 'array' }],
  371. roleIds: [{ required: true, message: '角色不能为空', trigger: 'change', type: 'array' }],
  372. nickName: [{ required: true, message: '用户昵称不能为空', trigger: 'blur' }],
  373. password: [
  374. {
  375. min: 8,
  376. max: 20,
  377. message: '8-20位大小写字母+数字+特殊符号',
  378. required: true,
  379. trigger: 'blur',
  380. validator: validPassword,
  381. },
  382. ],
  383. email: [
  384. {
  385. type: 'email',
  386. message: '请输入正确的邮箱地址',
  387. trigger: ['blur', 'change'],
  388. },
  389. ],
  390. phonenumber: [
  391. { required: true, message: '手机号不能为空' },
  392. {
  393. pattern: /^1[3|4|5|6|7|8|9][0-9]\d{8}$/,
  394. message: '请输入正确的手机号码',
  395. trigger: 'blur',
  396. },
  397. ],
  398. },
  399. });
  400. function validPassword(rule, value, callback) {
  401. // 密码校验 至少8位大小写英文字母+数字+特殊符号
  402. let reg = /^(?=.*?[A-Z])(?=.*?[a-z])(?=.*?[0-9])(?=.*?[^\w\s]).{8,20}$/;
  403. if (!reg.test(value)) {
  404. callback(new Error('密码8-20位大小写英文字母+数字+特殊符号'));
  405. } else {
  406. callback();
  407. }
  408. }
  409. const { queryParams, form, rules } = toRefs(data);
  410.  
  411. /** 通过条件过滤节点 */
  412. const filterNode = (value, data) => {
  413. if (!value) return true;
  414. return data.label.indexOf(value) !== -1;
  415. };
  416. /** 根据名称筛选部门树 */
  417. watch(deptName, val => {
  418. proxy.$refs['deptTreeRef'].filter(val);
  419. });
  420. /** 查询部门下拉树结构 */
  421. function getDeptTree() {
  422. deptTreeSelect().then(response => {
  423. deptOptions.value = response.data;
  424. });
  425. }
  426. /** 查询用户列表 */
  427. function getList() {
  428. loading.value = true;
  429. pageUser(proxy.addDateRange(queryParams.value, dateRange.value)).then(res => {
  430. loading.value = false;
  431. userList.value = res.data;
  432. total.value = res.total;
  433. });
  434. }
  435. /** 节点单击事件 */
  436. function handleNodeClick(data) {
  437. queryParams.value.deptId = data.id;
  438. handleQuery();
  439. }
  440. /** 搜索按钮操作 */
  441. function handleQuery() {
  442. queryParams.value.pageNum = 1;
  443. getList();
  444. }
  445. /** 重置按钮操作 */
  446. function resetQuery() {
  447. dateRange.value = [];
  448. proxy.resetForm('queryRef');
  449. queryParams.value.deptId = undefined;
  450. proxy.$refs.deptTreeRef.setCurrentKey(null);
  451. handleQuery();
  452. }
  453. /** 删除按钮操作 */
  454. function handleDelete(row) {
  455. const userIds = row.userId || ids.value;
  456. proxy.$modal
  457. .confirm('是否确认删除用户编号为"' + userIds + '"的数据项?')
  458. .then(function () {
  459. return delUser(userIds);
  460. })
  461. .then(() => {
  462. getList();
  463. proxy.$modal.msgSuccess('删除成功');
  464. })
  465. .catch(() => {});
  466. }
  467. /** 导出按钮操作 */
  468. function handleExport() {
  469. proxy.download(
  470. 'system/user/export',
  471. {
  472. ...queryParams.value,
  473. },
  474. `user_${new Date().getTime()}.xlsx`
  475. );
  476. }
  477. /** 用户状态修改 */
  478. function handleStatusChange(row) {
  479. let text = row.status === '0' ? '启用' : '停用';
  480. proxy.$modal
  481. .confirm('确认要"' + text + '""' + row.userName + '"用户吗?')
  482. .then(function () {
  483. return changeUserStatus(row.userId, row.status);
  484. })
  485. .then(() => {
  486. proxy.$modal.msgSuccess(text + '成功');
  487. })
  488. .catch(function () {
  489. row.status = row.status === '0' ? '1' : '0';
  490. });
  491. }
  492. /** 跳转角色分配 */
  493. function handleAuthRole(row) {
  494. userId.value = row.userId;
  495. // router.push('/system/user-auth/role/' + userId);
  496. dialogRole.value = true;
  497. }
  498. function childCloseRole() {
  499. dialogRole.value = false;
  500. getList();
  501. }
  502. /** 重置密码按钮操作 */
  503. function handleResetPwd(row) {
  504. proxy
  505. .$prompt('请输入"' + row.userName + '"的新密码', '提示', {
  506. confirmButtonText: '确定',
  507. cancelButtonText: '取消',
  508. closeOnClickModal: false,
  509. inputPattern: /^(?=.*?[A-Z])(?=.*?[a-z])(?=.*?[0-9])(?=.*?[^\w\s]).{8,20}$/,
  510. inputErrorMessage: '密码8-20位大小写英文字母+数字+特殊符号',
  511. })
  512. .then(({ value }) => {
  513. resetUserPwd(row.userId, EncryptAES(value)).then(response => {
  514. proxy.$modal.msgSuccess('修改成功,新密码是:' + value);
  515. });
  516. })
  517. .catch(() => {});
  518. }
  519. /** 选择条数 */
  520. function handleSelectionChange(selection) {
  521. ids.value = selection.map(item => item.userId);
  522. single.value = selection.length != 1;
  523. multiple.value = !selection.length;
  524. }
  525. /** 导入按钮操作 */
  526. function handleImport() {
  527. upload.title = '用户导入';
  528. upload.open = true;
  529. }
  530. /** 下载模板操作 */
  531. function importTemplate() {
  532. proxy.download('system/user/importTemplate', {}, `user_template_${new Date().getTime()}.xlsx`);
  533. }
  534. /**文件上传中处理 */
  535. const handleFileUploadProgress = (event, file, fileList) => {
  536. upload.isUploading = true;
  537. };
  538. /** 文件上传成功处理 */
  539. const handleFileSuccess = (response, file, fileList) => {
  540. upload.open = false;
  541. upload.isUploading = false;
  542. proxy.$refs['uploadRef'].handleRemove(file);
  543. proxy.$alert(
  544. "<div style='overflow: auto;overflow-x: hidden;max-height: 70vh;padding: 10px 20px 0;'>" + response.msg + '</div>',
  545. '导入结果',
  546. {
  547. dangerouslyUseHTMLString: true,
  548. }
  549. );
  550. getList();
  551. };
  552. /** 提交上传文件 */
  553. function submitFileForm() {
  554. proxy.$refs['uploadRef'].submit();
  555. }
  556. /** 重置操作表单 */
  557. function reset() {
  558. form.value = {
  559. userId: undefined,
  560. deptId: undefined,
  561. userName: undefined,
  562. nickName: undefined,
  563. password: undefined,
  564. phonenumber: undefined,
  565. email: undefined,
  566. sex: undefined,
  567. status: '0',
  568. remark: undefined,
  569. postIds: [],
  570. roleIds: [],
  571. };
  572. proxy.resetForm('userRef');
  573. }
  574. /** 取消按钮 */
  575. function cancel() {
  576. open.value = false;
  577. reset();
  578. }
  579. /** 新增按钮操作 */
  580. function handleAdd() {
  581. reset();
  582. getUser().then(response => {
  583. postOptions.value = response.data.posts;
  584. roleOptions.value = response.data.roles;
  585. open.value = true;
  586. title.value = '添加用户';
  587. form.value.password = initPassword.value;
  588. });
  589. }
  590. /** 修改按钮操作 */
  591. function handleUpdate(row) {
  592. reset();
  593. const userId = row.userId || ids.value;
  594. getUser(userId).then(response => {
  595. form.value = response.data.user;
  596. postOptions.value = response.data.posts;
  597. roleOptions.value = response.data.roles;
  598. form.value.postIds = response.data.postIds;
  599. let newRoleIds = [];
  600. newRoleIds =
  601. response.data.roleIds &&
  602. response.data.roleIds.map(val => {
  603. return Number(val);
  604. });
  605. console.log(newRoleIds);
  606. form.value.roleIds = newRoleIds;
  607. open.value = true;
  608. title.value = '修改用户';
  609. form.password = '';
  610. });
  611. }
  612. /** 提交按钮 */
  613. function submitForm() {
  614. proxy.$refs['userRef'].validate(valid => {
  615. if (valid) {
  616. let params = { ...form.value };
  617. params.password = EncryptAES(params.password);
  618. if (form.value.userId != undefined) {
  619. updateUser(params).then(response => {
  620. proxy.$modal.msgSuccess('修改成功');
  621. open.value = false;
  622. getList();
  623. });
  624. } else {
  625. addUser(params).then(response => {
  626. proxy.$modal.msgSuccess('新增成功');
  627. open.value = false;
  628. getList();
  629. });
  630. }
  631. }
  632. });
  633. }
  634.  
  635. getDeptTree();
  636. getList();
  637. </script>
  638.  
  639. <style lang="scss">
  640. .userPage {
  641. .head-container .el-tree {
  642. padding: 10px;
  643. height: calc(100vh - 160px);
  644. }
  645. .el-tree-node__label {
  646. overflow: hidden;
  647. white-space: nowrap; /* 防止文字换行 */
  648. text-overflow: ellipsis; /* 超出部分显示省略号 */
  649. }
  650. }
  651. </style>