|
|
@@ -13,7 +13,10 @@
|
|
|
style="margin-bottom: 20px"
|
|
|
/>
|
|
|
</div>
|
|
|
- <div class="head-container">
|
|
|
+ <div class="tree-container">
|
|
|
+ <div style="margin-bottom: 10px;">
|
|
|
+ <el-checkbox v-model="queryParams.checkSub" @change="changeCheckBox">是否关联下级机构</el-checkbox>
|
|
|
+ </div>
|
|
|
<el-tree
|
|
|
:data="deptOptions"
|
|
|
:props="defaultProps"
|
|
|
@@ -21,7 +24,8 @@
|
|
|
:filter-node-method="filterNode"
|
|
|
ref="tree"
|
|
|
node-key="id"
|
|
|
- :default-expanded-keys="[2283]"
|
|
|
+ :default-expanded-keys="defaultKeys"
|
|
|
+ :default-checked-keys="defaultKeys"
|
|
|
highlight-current
|
|
|
@node-click="handleNodeClick"
|
|
|
/>
|
|
|
@@ -29,6 +33,8 @@
|
|
|
</el-col>
|
|
|
<!--用户数据-->
|
|
|
<el-col :span="20" :xs="24">
|
|
|
+
|
|
|
+ <!-- 搜索条件 -->
|
|
|
<el-form :model="queryParams" ref="queryForm" size="small" :inline="true" v-show="showSearch" label-width="68px">
|
|
|
<el-form-item label="用户名称" prop="username">
|
|
|
<el-input
|
|
|
@@ -80,6 +86,7 @@
|
|
|
</el-form-item>
|
|
|
</el-form>
|
|
|
|
|
|
+ <!-- 按纽 -->
|
|
|
<el-row :gutter="10" class="mb8">
|
|
|
<el-col :span="1.5">
|
|
|
<el-button
|
|
|
@@ -113,26 +120,26 @@
|
|
|
v-hasPermi="['system:user:remove']"
|
|
|
>删除</el-button>
|
|
|
</el-col>
|
|
|
- <el-col :span="1.5">
|
|
|
- <el-button
|
|
|
- type="info"
|
|
|
- plain
|
|
|
- icon="el-icon-upload2"
|
|
|
- size="mini"
|
|
|
- @click="handleImport"
|
|
|
- v-hasPermi="['system:user:import']"
|
|
|
- >导入</el-button>
|
|
|
- </el-col>
|
|
|
- <el-col :span="1.5">
|
|
|
- <el-button
|
|
|
- type="warning"
|
|
|
- plain
|
|
|
- icon="el-icon-download"
|
|
|
- size="mini"
|
|
|
- @click="handleExport"
|
|
|
- v-hasPermi="['system:user:export']"
|
|
|
- >导出</el-button>
|
|
|
- </el-col>
|
|
|
+<!-- <el-col :span="1.5">-->
|
|
|
+<!-- <el-button-->
|
|
|
+<!-- type="info"-->
|
|
|
+<!-- plain-->
|
|
|
+<!-- icon="el-icon-upload2"-->
|
|
|
+<!-- size="mini"-->
|
|
|
+<!-- @click="handleImport"-->
|
|
|
+<!-- v-hasPermi="['system:user:import']"-->
|
|
|
+<!-- >导入</el-button>-->
|
|
|
+<!-- </el-col>-->
|
|
|
+<!-- <el-col :span="1.5">-->
|
|
|
+<!-- <el-button-->
|
|
|
+<!-- type="warning"-->
|
|
|
+<!-- plain-->
|
|
|
+<!-- icon="el-icon-download"-->
|
|
|
+<!-- size="mini"-->
|
|
|
+<!-- @click="handleExport"-->
|
|
|
+<!-- v-hasPermi="['system:user:export']"-->
|
|
|
+<!-- >导出</el-button>-->
|
|
|
+<!-- </el-col>-->
|
|
|
<right-toolbar :showSearch.sync="showSearch" @queryTable="getList" :columns="columns"></right-toolbar>
|
|
|
</el-row>
|
|
|
|
|
|
@@ -384,6 +391,8 @@ export default {
|
|
|
roleOptions: [],
|
|
|
// 表单参数
|
|
|
form: {},
|
|
|
+ //是否关联下级
|
|
|
+ checked: false,
|
|
|
defaultProps: {
|
|
|
children: "children",
|
|
|
label: "name"
|
|
|
@@ -407,10 +416,11 @@ export default {
|
|
|
queryParams: {
|
|
|
pageNum: 1,
|
|
|
pageSize: 10,
|
|
|
- username: undefined,
|
|
|
- phone: undefined,
|
|
|
- status: undefined,
|
|
|
- deptId: undefined
|
|
|
+ username: null,
|
|
|
+ phone: null,
|
|
|
+ status: null,
|
|
|
+ orgId: null,
|
|
|
+ checkSub:false
|
|
|
},
|
|
|
// 列信息
|
|
|
columns: [
|
|
|
@@ -449,7 +459,9 @@ export default {
|
|
|
trigger: "blur"
|
|
|
}
|
|
|
]
|
|
|
- }
|
|
|
+ },
|
|
|
+ //默认选中节点
|
|
|
+ defaultKeys:[]
|
|
|
};
|
|
|
},
|
|
|
watch: {
|
|
|
@@ -459,29 +471,38 @@ export default {
|
|
|
}
|
|
|
},
|
|
|
created() {
|
|
|
- this.getList();
|
|
|
this.getDeptTree();
|
|
|
this.getConfigKey("sys.user.initPassword").then(response => {
|
|
|
this.initPassword = response.msg;
|
|
|
});
|
|
|
},
|
|
|
methods: {
|
|
|
+ /** 下穿状态改变*/
|
|
|
+ changeCheckBox(){
|
|
|
+ this.getList();
|
|
|
+ },
|
|
|
/** 查询用户列表 */
|
|
|
- getList() {
|
|
|
+ getList(id) {
|
|
|
this.loading = true;
|
|
|
- console.log(111);
|
|
|
- console.log(this.queryParams);
|
|
|
+ console.log(this.queryParams,111);
|
|
|
+ console.log(this.addDateRange(this.queryParams, this.dateRange),2222);
|
|
|
listUser(this.addDateRange(this.queryParams, this.dateRange)).then(response => {
|
|
|
this.userList = response.rows;
|
|
|
this.total = response.total;
|
|
|
this.loading = false;
|
|
|
}
|
|
|
- );
|
|
|
+ ).catch(err=>{
|
|
|
+ this.loading = false;
|
|
|
+ })
|
|
|
},
|
|
|
/** 查询部门下拉树结构 */
|
|
|
getDeptTree() {
|
|
|
deptTreeSelect().then(response => {
|
|
|
this.deptOptions = response.data;
|
|
|
+ this.defaultKeys.push(response.data[0].id);
|
|
|
+ console.log( this.defaultKeys,' this.defaultKeys')
|
|
|
+ this.queryParams.orgId = response.data[0].id;
|
|
|
+ this.handleQuery();
|
|
|
});
|
|
|
},
|
|
|
// 筛选节点
|
|
|
@@ -514,7 +535,7 @@ export default {
|
|
|
reset() {
|
|
|
this.form = {
|
|
|
userId: undefined,
|
|
|
- deptId: undefined,
|
|
|
+ orgId: undefined,
|
|
|
userName: undefined,
|
|
|
nickName: undefined,
|
|
|
password: undefined,
|
|
|
@@ -537,7 +558,7 @@ export default {
|
|
|
resetQuery() {
|
|
|
this.dateRange = [];
|
|
|
this.resetForm("queryForm");
|
|
|
- this.queryParams.deptId = undefined;
|
|
|
+ this.queryParams.orgId = undefined;
|
|
|
this.$refs.tree.setCurrentKey(null);
|
|
|
this.handleQuery();
|
|
|
},
|
|
|
@@ -673,3 +694,9 @@ export default {
|
|
|
}
|
|
|
};
|
|
|
</script>
|
|
|
+<style lang="scss">
|
|
|
+
|
|
|
+</style>
|
|
|
+<style lang="scss" scoped>
|
|
|
+
|
|
|
+</style>
|