|
@@ -33,8 +33,38 @@
|
|
|
<el-row>
|
|
|
<el-col :span="24">
|
|
|
<el-form-item label="选择用户">
|
|
|
+ <!-- <div>
|
|
|
+ <el-input
|
|
|
+ v-model="deptName"
|
|
|
+ placeholder="请输入用户名称"
|
|
|
+ clearable
|
|
|
+ size="small"
|
|
|
+ prefix-icon="el-icon-search"
|
|
|
+ style="margin-bottom: 20px"
|
|
|
+ />
|
|
|
+ </div> -->
|
|
|
+ <!-- <div class="head-container" >
|
|
|
+ <div align="right">
|
|
|
+ <el-checkbox v-model="checked" @change="checkedAll"/> 全选/反选
|
|
|
+ </div>
|
|
|
+ <el-tree
|
|
|
+ show-checkbox
|
|
|
+ node-key="code"
|
|
|
+ :data="userList"
|
|
|
+ :props="defaultProps"
|
|
|
+ :filter-node-method="filterNode"
|
|
|
+ ref="tree"
|
|
|
+ default-expand-all
|
|
|
+ @node-click="handleNodeClick"
|
|
|
+ />
|
|
|
+ </div> -->
|
|
|
+ <!-- <treeselect :normalizer="normalizer" :multiple="true" v-model="deptNamety" @select="djieskle" @deselect="deselect" :options="userList" placeholder="请选择归属部门" /> -->
|
|
|
<el-select v-model="deptNamety" :multiple ="true" clearable placeholder="请选择用户" @visible-change = "visiblechange" @change="changetr" @blur="blurkde" filterable>
|
|
|
+ <div style="margin-left: 20px;">
|
|
|
+ <el-checkbox v-model="checked" @change="checkedAll"/> 全选/反选
|
|
|
+ </div>
|
|
|
<el-option
|
|
|
+ ref="tree"
|
|
|
v-for="item in userList"
|
|
|
:key="item.userId"
|
|
|
:label="item.nickName"
|
|
@@ -93,6 +123,7 @@ export default {
|
|
|
return {
|
|
|
// 遮罩层
|
|
|
loading: true,
|
|
|
+ checked:false,
|
|
|
// 选中数组
|
|
|
ids: [],
|
|
|
// 非单个禁用
|
|
@@ -133,7 +164,7 @@ export default {
|
|
|
form: {},
|
|
|
defaultProps: {
|
|
|
children: "children",
|
|
|
- label: "label"
|
|
|
+ label: "nickName",
|
|
|
},
|
|
|
// 用户导入参数
|
|
|
upload: {
|
|
@@ -173,7 +204,8 @@ export default {
|
|
|
{ required: true, message: "内容不能为空", trigger: "blur" }
|
|
|
],
|
|
|
|
|
|
- }
|
|
|
+ },
|
|
|
+ huej:[]
|
|
|
};
|
|
|
},
|
|
|
watch: {
|
|
@@ -202,8 +234,10 @@ export default {
|
|
|
this.loading = true;
|
|
|
listUser(this.addDateRange(this.queryParams, this.dateRange)).then(response => {
|
|
|
this.userList = response.rows;
|
|
|
+ // this.userList = this.handleTree(response.rows, "id");
|
|
|
this.total = response.total;
|
|
|
this.loading = false;
|
|
|
+ // console.log(this.userList)
|
|
|
//
|
|
|
}
|
|
|
);
|
|
@@ -223,21 +257,63 @@ export default {
|
|
|
this.deptOptions = response.data;
|
|
|
});
|
|
|
},
|
|
|
+ checkedAll(){
|
|
|
+ let juegf = []
|
|
|
+ if (this.checked) {
|
|
|
+ for(var i = 0 ; i < this.userList.length; i++ ){
|
|
|
+ juegf.push(this.userList[i].userId)
|
|
|
+ console.log(juegf)
|
|
|
+ }
|
|
|
+ this.deptNamety = juegf
|
|
|
+ this.form.userList = this.userList
|
|
|
+ //全选
|
|
|
+ // this.$refs.tree.setCheckedNodes(this.userList);
|
|
|
+ console.log(this.userList)
|
|
|
+ }else{
|
|
|
+ //取消选中
|
|
|
+ this.deptNamety = ''
|
|
|
+ this.form.userList = []
|
|
|
+ // this.$refs.tree.setCheckedKeys([]);
|
|
|
+ }
|
|
|
+ },
|
|
|
// 筛选节点
|
|
|
filterNode(value, data) {
|
|
|
+ // console.log(value,data)
|
|
|
if (!value) return true;
|
|
|
- return data.label.indexOf(value) !== -1;
|
|
|
+ return data.nickName.indexOf(value) !== -1;
|
|
|
},
|
|
|
// 节点单击事件
|
|
|
handleNodeClick(data) {
|
|
|
- this.queryParams.deptId = data.id;
|
|
|
- this.getList();
|
|
|
+ // this.queryParams.deptId = data.id;
|
|
|
+ // this.getList();
|
|
|
+ console.log(data)
|
|
|
},
|
|
|
// 下拉框出现/隐藏时触发
|
|
|
visiblechange(val){
|
|
|
console.log(val)
|
|
|
},
|
|
|
+ djieskle(node, instanceId) {
|
|
|
+ // this.personnel(node.id);
|
|
|
+ // let huej = []
|
|
|
+ this.huej.push(node)
|
|
|
+ this.form.userList = this.huej
|
|
|
+ console.log(node, instanceId);
|
|
|
+ console.log(this.form.userList);
|
|
|
+ },
|
|
|
+ deselect(node, instanceId){
|
|
|
+ if(this.form.userList !== undefined){
|
|
|
+ for (let i = this.form.userList.length - 1; i >= 0; i--) {
|
|
|
+ if (this.form.userList[i].userId == node.userId) {
|
|
|
+ this.form.userList.splice(i, 1);
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ console.log(this.form.userList);
|
|
|
+ console.log(node, instanceId);
|
|
|
+ },
|
|
|
+
|
|
|
changetr(val){
|
|
|
+ console.log(this.deptNamety)
|
|
|
let name = []
|
|
|
let huej = []
|
|
|
name = val
|
|
@@ -268,6 +344,15 @@ export default {
|
|
|
console.log(val)
|
|
|
console.log(huej)
|
|
|
},
|
|
|
+ normalizer(node) {
|
|
|
+ // if (node.children && !node.children.length) {
|
|
|
+ // delete node.children;
|
|
|
+ // }
|
|
|
+ return {
|
|
|
+ id: node.userId,
|
|
|
+ label: node.nickName,
|
|
|
+ };
|
|
|
+ },
|
|
|
changetrtwo(val){
|
|
|
console.log(val)
|
|
|
this.form.textMessageId = val
|