|
|
|
|
@ -186,6 +186,8 @@
|
|
|
|
|
v-hasPermi="['system:user:resetPwd']">重置密码</el-dropdown-item>
|
|
|
|
|
<el-dropdown-item command="handleAuthRole" icon="el-icon-circle-check"
|
|
|
|
|
v-hasPermi="['system:user:edit']">分配角色</el-dropdown-item>
|
|
|
|
|
<el-dropdown-item command="handleDataScope" icon="el-icon-circle-check"
|
|
|
|
|
v-hasPermi="['system:role:edit']">档案目录</el-dropdown-item>
|
|
|
|
|
</el-dropdown-menu>
|
|
|
|
|
</el-dropdown>
|
|
|
|
|
</template>
|
|
|
|
|
@ -337,11 +339,38 @@
|
|
|
|
|
<el-button @click="upload.open = false">取 消</el-button>
|
|
|
|
|
</div>
|
|
|
|
|
</el-dialog>
|
|
|
|
|
|
|
|
|
|
<!-- 档案目录对话框 -->
|
|
|
|
|
<el-dialog :title="title" :visible.sync="openDangAn" width="500px" append-to-body>
|
|
|
|
|
<el-form>
|
|
|
|
|
<el-form-item label="档案目录">
|
|
|
|
|
<el-checkbox v-model="dangAnExpand" @change="handleCheckedTreeExpand($event, 'dangAn')">展开/折叠</el-checkbox>
|
|
|
|
|
<el-checkbox v-model="dangAnNodeAll" @change="handleCheckedTreeNodeAll($event, 'dangAn')">全选/全不选</el-checkbox>
|
|
|
|
|
<el-checkbox v-model="dangAnCheck">父子联动</el-checkbox>
|
|
|
|
|
<el-tree
|
|
|
|
|
class="tree-border"
|
|
|
|
|
:data="dangAnOptions"
|
|
|
|
|
show-checkbox
|
|
|
|
|
default-expand-all
|
|
|
|
|
ref="dangAn"
|
|
|
|
|
node-key="id"
|
|
|
|
|
:check-strictly="!dangAnCheck"
|
|
|
|
|
empty-text="加载中,请稍候"
|
|
|
|
|
:props="defaultProps"
|
|
|
|
|
></el-tree>
|
|
|
|
|
</el-form-item>
|
|
|
|
|
</el-form>
|
|
|
|
|
<div slot="footer" class="dialog-footer">
|
|
|
|
|
<el-button type="primary" @click="submitDataScope">确 定</el-button>
|
|
|
|
|
<el-button @click="cancelDataScope">取 消</el-button>
|
|
|
|
|
</div>
|
|
|
|
|
</el-dialog>
|
|
|
|
|
|
|
|
|
|
</div>
|
|
|
|
|
</template>
|
|
|
|
|
|
|
|
|
|
<script>
|
|
|
|
|
import { listUser, getUser, delUser, addUser, updateUser, resetUserPwd, changeUserStatus, deptTreeSelect } from "@/api/system/user";
|
|
|
|
|
import { listUser, getUser, delUser, addUser, updateUser, resetUserPwd, changeUserStatus, deptTreeSelect, userMenuTreeselect, userMuRelation } from "@/api/system/user";
|
|
|
|
|
import { getToken } from "@/utils/auth";
|
|
|
|
|
import Treeselect from "@riophae/vue-treeselect";
|
|
|
|
|
import "@riophae/vue-treeselect/dist/vue-treeselect.css";
|
|
|
|
|
@ -450,7 +479,13 @@ export default {
|
|
|
|
|
trigger: "blur"
|
|
|
|
|
}
|
|
|
|
|
]
|
|
|
|
|
}
|
|
|
|
|
},
|
|
|
|
|
// 是否显示弹出层(档案目录)
|
|
|
|
|
openDangAn: false,
|
|
|
|
|
dangAnExpand: true,
|
|
|
|
|
dangAnNodeAll: false,
|
|
|
|
|
dangAnOptions: undefined,
|
|
|
|
|
dangAnCheck: false
|
|
|
|
|
};
|
|
|
|
|
},
|
|
|
|
|
watch: {
|
|
|
|
|
@ -555,6 +590,9 @@ export default {
|
|
|
|
|
case "handleAuthRole":
|
|
|
|
|
this.handleAuthRole(row);
|
|
|
|
|
break;
|
|
|
|
|
case "handleDataScope":
|
|
|
|
|
this.handleDataScope(row);
|
|
|
|
|
break;
|
|
|
|
|
default:
|
|
|
|
|
break;
|
|
|
|
|
}
|
|
|
|
|
@ -670,7 +708,77 @@ export default {
|
|
|
|
|
// 提交上传文件
|
|
|
|
|
submitFileForm() {
|
|
|
|
|
this.$refs.upload.submit();
|
|
|
|
|
},
|
|
|
|
|
// 树权限(展开/折叠)
|
|
|
|
|
handleCheckedTreeExpand(value, type) {
|
|
|
|
|
if (type == 'menu') {
|
|
|
|
|
let treeList = this.menuOptions;
|
|
|
|
|
for (let i = 0; i < treeList.length; i++) {
|
|
|
|
|
this.$refs.menu.store.nodesMap[treeList[i].id].expanded = value;
|
|
|
|
|
}
|
|
|
|
|
} else if (type == 'dept') {
|
|
|
|
|
let treeList = this.deptOptions;
|
|
|
|
|
for (let i = 0; i < treeList.length; i++) {
|
|
|
|
|
this.$refs.dept.store.nodesMap[treeList[i].id].expanded = value;
|
|
|
|
|
}
|
|
|
|
|
}else if (type == 'dangAn') {
|
|
|
|
|
let treeList = this.dangAnOptions;
|
|
|
|
|
for (let i = 0; i < treeList.length; i++) {
|
|
|
|
|
this.$refs.dangAn.store.nodesMap[treeList[i].id].expanded = value;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
},
|
|
|
|
|
// 树权限(全选/全不选)
|
|
|
|
|
handleCheckedTreeNodeAll(value, type) {
|
|
|
|
|
if (type == 'menu') {
|
|
|
|
|
this.$refs.menu.setCheckedNodes(value ? this.menuOptions: []);
|
|
|
|
|
} else if (type == 'dept') {
|
|
|
|
|
this.$refs.dept.setCheckedNodes(value ? this.deptOptions: []);
|
|
|
|
|
}else if (type == 'dangAn') {
|
|
|
|
|
this.$refs.dangAn.setCheckedNodes(value ? this.dangAnOptions: []);
|
|
|
|
|
}
|
|
|
|
|
},
|
|
|
|
|
// 树权限(父子联动)
|
|
|
|
|
handleCheckedTreeConnect(value, type) {
|
|
|
|
|
if (type == 'menu') {
|
|
|
|
|
this.form.menuCheckStrictly = value ? true: false;
|
|
|
|
|
} else if (type == 'dept') {
|
|
|
|
|
this.form.deptCheckStrictly = value ? true: false;
|
|
|
|
|
}
|
|
|
|
|
},
|
|
|
|
|
/** 分配档案目录操作 */
|
|
|
|
|
handleDataScope(row) {
|
|
|
|
|
this.reset();
|
|
|
|
|
this.openDangAn = true;
|
|
|
|
|
this.form = row;
|
|
|
|
|
userMenuTreeselect(row.userId).then(response => {
|
|
|
|
|
this.dangAnOptions = response.catalogs;
|
|
|
|
|
this.$refs.dangAn.setCheckedKeys(response.checkedKeys);
|
|
|
|
|
});
|
|
|
|
|
this.title = "分配档案目录";
|
|
|
|
|
},
|
|
|
|
|
/** 提交按钮(档案目录) */
|
|
|
|
|
submitDataScope() {
|
|
|
|
|
// 目前被选中的部门节点
|
|
|
|
|
let checkedKeys = this.$refs.dangAn.getCheckedKeys();
|
|
|
|
|
// 半选中的部门节点
|
|
|
|
|
let halfCheckedKeys = this.$refs.dangAn.getHalfCheckedKeys();
|
|
|
|
|
checkedKeys.unshift.apply(checkedKeys, halfCheckedKeys);
|
|
|
|
|
|
|
|
|
|
userMuRelation({
|
|
|
|
|
userId: this.form.userId,
|
|
|
|
|
muIds: checkedKeys
|
|
|
|
|
}).then(response => {
|
|
|
|
|
this.$modal.msgSuccess("修改成功");
|
|
|
|
|
this.openDangAn = false;
|
|
|
|
|
this.getList();
|
|
|
|
|
});
|
|
|
|
|
},
|
|
|
|
|
// 取消按钮(档案目录)
|
|
|
|
|
cancelDataScope() {
|
|
|
|
|
this.openDangAn = false;
|
|
|
|
|
this.reset();
|
|
|
|
|
},
|
|
|
|
|
}
|
|
|
|
|
};
|
|
|
|
|
</script>
|