From 7c20fd15b7fbc2bd5756b39d5ab655cc849ffcc3 Mon Sep 17 00:00:00 2001 From: zhanghua <314079846@qq.com> Date: 星期三, 16 七月 2025 22:39:23 +0800 Subject: [PATCH] 添加时间筛选 --- src/views/systemSetting/baseSetting/department/createUser/index.vue | 129 ++++++++++++++++++++++++++---------------- 1 files changed, 80 insertions(+), 49 deletions(-) diff --git a/src/views/systemSetting/baseSetting/department/createUser/index.vue b/src/views/systemSetting/baseSetting/department/createUser/index.vue index 3efa87b..bd9769c 100644 --- a/src/views/systemSetting/baseSetting/department/createUser/index.vue +++ b/src/views/systemSetting/baseSetting/department/createUser/index.vue @@ -19,14 +19,14 @@ </el-form-item> <!-- 涓婄骇閮ㄩ棬 --> <el-form-item class="optionItems" label="涓婄骇閮ㄩ棬:" prop="parentId"> - <el-select v-model="depart.parentId" placeholder="璇疯緭鍏ヤ笂绾ч儴闂�"> - <el-option :value="mylabel"> + <el-select ref="projectApplicant" v-model="depart.parentId" placeholder="璇疯緭鍏ヤ笂绾ч儴闂�"> + <el-option :value="mylabel"> <el-tree ref="tree" :check-strictly="true" :data="departList" :props="defaultProps" - show-checkbox + @node-click="handleCheck" @check-change="handleCheck" default-expand-all node-key="id" @@ -74,12 +74,18 @@ <li class="li-btn"> <i class="el-icon-plus" @click="openUser = true"></i> </li> + <li class="li-btn"> + <el-tooltip class="item" effect="light" content="娓呴櫎閫変腑浜哄憳" placement="top" :enterable="false"> + <i class="el-icon-minus" @click="clrarUser"></i> + </el-tooltip> + + </li> </ul> <div class="card" v-if="openUser"> <el-card class="box-card"> <div slot="header" class="myclear"> <span>宸ヤ綔浜哄憳</span> - <div @click="addUser">纭</div> + <div class="box-card-sub" @click="addUser">纭</div> </div> <div class="scrollWrap"> <el-checkbox-group v-model="checkedUser"> @@ -88,7 +94,7 @@ :label="user.id" :key="user.id" > - {{ user.username}} + {{ user.username }} </el-checkbox> </el-checkbox-group> </div> @@ -267,8 +273,12 @@ } }); }); - this.checkedList[0].leader = true; + if (this.checkedList.length > 0) this.checkedList[0].leader = true; this.openUser = false; + }, + // 娓呴櫎閫変腑鐢ㄦ埛 + clrarUser(){ + this.checkedUser=[] }, handleClose() { this.$emit("changMyDialog", { flag: false }); @@ -278,32 +288,42 @@ this.departTypeList = await getTypeList(1, "08"); }, handleCheck(data, checked) { - this.depart.parentId = data.departName; - // 鑾峰彇褰撳墠閫夋嫨鐨刬d鍦ㄦ暟缁勪腑鐨勭储寮� - const indexs = this.selectOrg.orgsid.indexOf(data.id); - // 濡傛灉涓嶅瓨鍦ㄦ暟缁勪腑锛屽苟涓旀暟缁勪腑宸茬粡鏈変竴涓猧d骞朵笖checked涓簍rue鐨勬椂鍊欙紝浠h〃涓嶈兘鍐嶆閫夋嫨銆� - if (indexs < 0 && this.selectOrg.orgsid.length === 1 && checked) { - this.$message({ - message: "鍙兘閫夋嫨涓�涓儴闂紒", - type: "warning", - showClose: true, - }); - // 璁剧疆宸查�夋嫨鐨勮妭鐐逛负false 寰堥噸瑕� - this.$refs.tree.setChecked(data, false); - } else if (this.selectOrg.orgsid.length === 0 && checked) { - // 鍙戠幇鏁扮粍涓虹┖ 骞朵笖鏄凡閫夋嫨 - // 闃叉鏁扮粍鏈夊�硷紝棣栧厛娓呯┖锛屽啀push - this.selectOrg.orgsid = []; - this.selectOrg.orgsid.push(data.id); - } else if ( - indexs >= 0 && - this.selectOrg.orgsid.length === 1 && - !checked - ) { - // 鍐嶆鐩存帴杩涜璧嬪�间负绌烘搷浣� - this.selectOrg.orgsid = []; - this.depart.parentId = ""; + if(checked.childNodes.length == 0){ + this.depart.parentId = data.departName; + let _this = this; + _this.$refs.projectApplicant.blur(); + this.selectOrg.orgsid = [] + this.selectOrg.orgsid.push(data.id) + }else { + return } + + // this.depart.parentId = data.departName; + // // 鑾峰彇褰撳墠閫夋嫨鐨刬d鍦ㄦ暟缁勪腑鐨勭储寮� + // const indexs = this.selectOrg.orgsid.indexOf(data.id); + // // 濡傛灉涓嶅瓨鍦ㄦ暟缁勪腑锛屽苟涓旀暟缁勪腑宸茬粡鏈変竴涓猧d骞朵笖checked涓簍rue鐨勬椂鍊欙紝浠h〃涓嶈兘鍐嶆閫夋嫨銆� + // if (indexs < 0 && this.selectOrg.orgsid.length === 1 && checked) { + // this.$message({ + // message: "鍙兘閫夋嫨涓�涓儴闂紒", + // type: "warning", + // showClose: true, + // }); + // // 璁剧疆宸查�夋嫨鐨勮妭鐐逛负false 寰堥噸瑕� + // this.$refs.tree.setChecked(data, false); + // } else if (this.selectOrg.orgsid.length === 0 && checked) { + // // 鍙戠幇鏁扮粍涓虹┖ 骞朵笖鏄凡閫夋嫨 + // // 闃叉鏁扮粍鏈夊�硷紝棣栧厛娓呯┖锛屽啀push + // this.selectOrg.orgsid = []; + // this.selectOrg.orgsid.push(data.id); + // } else if ( + // indexs >= 0 && + // this.selectOrg.orgsid.length === 1 && + // !checked + // ) { + // // 鍐嶆鐩存帴杩涜璧嬪�间负绌烘搷浣� + // this.selectOrg.orgsid = []; + // this.depart.parentId = ""; + // } }, // 璁剧疆棰嗗 setLeader(idx) { @@ -318,12 +338,12 @@ <style lang="scss" scoped> .createUser { border-radius: 1px; - background-color: #09152f; + // background-color: #09152f; main { text-align: left; padding: 0 55px; - background-color: #09152f; + // background-color: #09152f; padding-bottom: 50px; .mainContent { @@ -331,19 +351,19 @@ justify-content: center; padding-top: 50px; - &::v-deep .el-form-item__label { - color: #4b9bb7; - } + // &::v-deep .el-form-item__label { + // color: #4b9bb7; + // } - &::v-deep .el-input__inner { - background-color: #09152f; - border: 1px solid #17324c; - } + // &::v-deep .el-input__inner { + // background-color: #09152f; + // border: 1px solid #17324c; + // } - &::v-deep .el-textarea__inner { - background-color: #09152f; - border: 1px solid #17324c; - } + // &::v-deep .el-textarea__inner { + // background-color: #09152f; + // border: 1px solid #17324c; + // } .addPerson { display: flex; @@ -370,6 +390,12 @@ width: 36px; height: 36px; border-radius: 50%; + .el-icon-plus{ + cursor: pointer; + } + .el-icon-minus{ + cursor: pointer; + } } .el-form-item__content { width: 400px; @@ -405,7 +431,7 @@ min-height: 240px; max-height: 260px; overflow: hidden; - background-color: #09152f; + // background-color: #09152f; position: relative; max-width: 220px; @@ -413,7 +439,7 @@ overflow: scroll; height: 180px; position: relative; - color: #4b9bb7; + // color: #4b9bb7; .el-checkbox-group { display: flex; @@ -428,9 +454,14 @@ .myclear { width: 100%; line-height: 20px; - color: #4b9bb7; + // color: #4b9bb7; display: flex; justify-content: space-between; + .box-card-sub{ + color: #2f54eb; + margin-left: 5px; + cursor: pointer; + } } .hidebar { @@ -439,7 +470,7 @@ right: 20px; width: 20px; height: 180px; - background-color: #09152f; + // background-color: #09152f; } .item { @@ -470,4 +501,4 @@ padding-right: 20px; } } -</style> \ No newline at end of file +</style> -- Gitblit v1.8.0