|
|
@@ -616,33 +616,18 @@ export default {
|
|
|
dialogVisible: false, // 新增编辑界面是否显示
|
|
|
departmentList: [], // 选中公司的所有部门的集合
|
|
|
deptInfo: {}, //选中机构的基本信息
|
|
|
- user_statusoptions: JSON.parse(
|
|
|
- localStorage.getItem("user_statusoptions")
|
|
|
- ),
|
|
|
- roles: JSON.parse(localStorage.getItem("find_all")),
|
|
|
- option: [], //机构列表
|
|
|
+ option: [], //机构列表
|
|
|
dialogPassword: false, //密码是否明文
|
|
|
postOption:[]
|
|
|
};
|
|
|
},
|
|
|
created() {
|
|
|
- this.$api.role.postViewAll().then((res) => {
|
|
|
- res.data.forEach(ele=>{
|
|
|
- ele.postId=ele.postId+''
|
|
|
- })
|
|
|
- this.postOption = res.data
|
|
|
- })
|
|
|
// this.$api.role.findAll().then((res) => {
|
|
|
// this.roles = res.data
|
|
|
// })
|
|
|
//获取所有下拉框数据(字典)
|
|
|
// this.getDictItems("sex");
|
|
|
// this.getDictItems("user_status");
|
|
|
- this.findLeftTreeData(); // 获取机构树的数据
|
|
|
- },
|
|
|
- mounted() {
|
|
|
- //用像素初始化左边的split的宽度
|
|
|
- this.changeTreeWidth(240); // 初始化树的宽度
|
|
|
},
|
|
|
watch: {
|
|
|
containsSubDeptChecked() {
|
|
|
@@ -674,34 +659,6 @@ export default {
|
|
|
// return row.sex+'1'
|
|
|
// console.log(val,1)
|
|
|
},
|
|
|
- changeTreeWidth(widthVal) {
|
|
|
- // 初始化树的宽度
|
|
|
- this.leftSplitWidth = Math.ceil(
|
|
|
- (widthVal / this.$refs.elMain.$el.clientWidth) * 100
|
|
|
- );
|
|
|
- this.rightSplitWidth = 100 - this.leftSplitWidth;
|
|
|
- },
|
|
|
- findLeftTreeData: function () {
|
|
|
- this.$api.dept.findDeptTree().then((res) => {
|
|
|
- this.treeDataRecursion(res.data, 2);
|
|
|
- this.ztreeNodes = res.data;
|
|
|
- });
|
|
|
- },
|
|
|
- //树过滤五级机构递归
|
|
|
- treeDataRecursion(data, num,one) {
|
|
|
- data = data || this.ztreeNodes;
|
|
|
- one = one || 0;
|
|
|
- one++;
|
|
|
- for (let i = 0; i < data.length; i++) {
|
|
|
- if (data[i].comlevel == 5 && data[i].managementSource != num) {
|
|
|
- // console.log(data[i].managementSource!=num)
|
|
|
- data.splice(i, 1);
|
|
|
- i = i - 1;
|
|
|
- } else {
|
|
|
- this.treeDataRecursion(data[i].children, num, one);
|
|
|
- }
|
|
|
- }
|
|
|
- },
|
|
|
onZTreeClick: function (evt, treeId, treeNode) {
|
|
|
// 点击事件
|
|
|
this.currentTreeNode = evt;
|