From 48ba7d5ed69c932fa9bfcc28ca29a9f2c81d2465 Mon Sep 17 00:00:00 2001
From: RuoYi <yzz_ivy@163.com>
Date: 星期五, 12 六月 2020 13:45:27 +0800
Subject: [PATCH] 修改用户管理复选框宽度,防止部分浏览器出现省略号
---
ruoyi-ui/src/views/system/dept/index.vue | 24 +++++++++---------------
1 files changed, 9 insertions(+), 15 deletions(-)
diff --git a/ruoyi-ui/src/views/system/dept/index.vue b/ruoyi-ui/src/views/system/dept/index.vue
index cca08b2..4d4d978 100644
--- a/ruoyi-ui/src/views/system/dept/index.vue
+++ b/ruoyi-ui/src/views/system/dept/index.vue
@@ -46,7 +46,7 @@
default-expand-all
:tree-props="{children: 'children', hasChildren: 'hasChildren'}"
>
- <el-table-column prop="deptName" label="部门名称" width="200"></el-table-column>
+ <el-table-column prop="deptName" label="部门名称" width="260"></el-table-column>
<el-table-column prop="orderNum" label="排序" width="200"></el-table-column>
<el-table-column prop="status" label="状态" :formatter="statusFormat" width="100"></el-table-column>
<el-table-column label="创建时间" align="center" prop="createTime" width="200">
@@ -83,7 +83,7 @@
</el-table>
<!-- 添加或修改部门对话框 -->
- <el-dialog :title="title" :visible.sync="open" width="600px">
+ <el-dialog :title="title" :visible.sync="open" width="600px" append-to-body>
<el-form ref="form" :model="form" :rules="rules" label-width="80px">
<el-row>
<el-col :span="24" v-if="form.parentId !== 0">
@@ -138,7 +138,7 @@
</template>
<script>
-import { listDept, getDept, delDept, addDept, updateDept } from "@/api/system/dept";
+import { listDept, getDept, delDept, addDept, updateDept, listDeptExcludeChild } from "@/api/system/dept";
import Treeselect from "@riophae/vue-treeselect";
import "@riophae/vue-treeselect/dist/vue-treeselect.css";
@@ -220,12 +220,6 @@
children: node.children
};
},
- /** 查询部门下拉树结构 */
- getTreeselect() {
- listDept().then(response => {
- this.deptOptions = this.handleTree(response.data, "deptId");
- });
- },
// 字典状态字典翻译
statusFormat(row, column) {
return this.selectDictLabel(this.statusOptions, row.status);
@@ -256,21 +250,25 @@
/** 新增按钮操作 */
handleAdd(row) {
this.reset();
- this.getTreeselect();
if (row != undefined) {
this.form.parentId = row.deptId;
}
this.open = true;
this.title = "添加部门";
+ listDept().then(response => {
+ this.deptOptions = this.handleTree(response.data, "deptId");
+ });
},
/** 修改按钮操作 */
handleUpdate(row) {
this.reset();
- this.getTreeselect();
getDept(row.deptId).then(response => {
this.form = response.data;
this.open = true;
this.title = "修改部门";
+ });
+ listDeptExcludeChild(row.deptId).then(response => {
+ this.deptOptions = this.handleTree(response.data, "deptId");
});
},
/** 提交按钮 */
@@ -283,8 +281,6 @@
this.msgSuccess("修改成功");
this.open = false;
this.getList();
- } else {
- this.msgError(response.msg);
}
});
} else {
@@ -293,8 +289,6 @@
this.msgSuccess("新增成功");
this.open = false;
this.getList();
- } else {
- this.msgError(response.msg);
}
});
}
--
Gitblit v1.9.2