From df5e70fd4ce7294a13b95e297c9151016a6d3a65 Mon Sep 17 00:00:00 2001 From: kun <1422840143@qq.com> Date: Sat, 25 May 2024 15:54:50 +0800 Subject: [PATCH 1/2] =?UTF-8?q?fix:=20BUG=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/store/index.js | 26 +- .../configManage/personnelAccess.vue | 476 ++++++++++++------ src/views/projectFront/entryCode/myHome.vue | 3 +- 3 files changed, 340 insertions(+), 165 deletions(-) diff --git a/src/store/index.js b/src/store/index.js index 5cf3643f..5c007c90 100644 --- a/src/store/index.js +++ b/src/store/index.js @@ -52,27 +52,27 @@ export default new Vuex.Store({ // FILEURL:'http://182.90.224.237:51234/image/', // UPLOADURL: "http://http://192.168.34.155:19111/upload/image/", // 洁本地 // FILEURL: "http://http://192.168.34.155:19111/image/", //洁本地 - // UPLOADURL:'http://192.168.34.221:9111/upload/image/',// 郭圣雄本地 - // FILEURL:'http://192.168.34.221:9111/image/',//郭圣雄本地 - // WORKFLOWURL: "http://192.168.34.138:88/#/workspace/forms", //坤工作流地址(本地) + UPLOADURL:'http://192.168.34.221:9111/upload/image/',// 郭圣雄本地 + FILEURL:'http://192.168.34.221:9111/image/',//郭圣雄本地 + WORKFLOWURL: "http://192.168.34.138:88/#/workspace/forms", //坤工作流地址(本地) // UPLOADURL:'http://182.90.224.237:51234/upload/image/',// 郭圣雄远程 // FILEURL:'http://182.90.224.237:51234/image/',//郭圣雄远程 // UPLOADURL:'http://jxj.zhgdyun.com:15551/upload/image',//测试 // FILEURL:'http://jxj.zhgdyun.com:15551/image/',//测试 - BASEURL: baseUrl - ? baseUrl - : window.location.protocol + "//" + window.location.host + "/", //正式环境 - UPLOADURL: - window.location.protocol + - "//" + - window.location.host + - "/upload/image", //正式环境 - FILEURL: window.location.protocol + "//" + window.location.host + "/image/", //正式环境 + // BASEURL: baseUrl + // ? baseUrl + // : window.location.protocol + "//" + window.location.host + "/", //正式环境 + // UPLOADURL: + // window.location.protocol + + // "//" + + // window.location.host + + // "/upload/image", //正式环境 + // FILEURL: window.location.protocol + "//" + window.location.host + "/image/", //正式环境 // WORKFLOWURL: 'http://47.93.215.234:19998/#/workspace/forms',//鞍钢平台工作流地址(弃用) // WORKFLOWURL: 'http://47.93.215.234:19098/#/workspace/forms',//鞍钢测试平台工作流地址(弃用) // WORKFLOWURL: 'http://42.180.188.17:19998/#/workspace/forms',//鞍钢平台工作流地址 - WORKFLOWURL: 'http://42.180.188.17:19098/#/workspace/forms',//鞍钢测试平台工作流地址 + // WORKFLOWURL: 'http://42.180.188.17:19098/#/workspace/forms',//鞍钢测试平台工作流地址 //--------------------------------------------------------------------------------------------- // BASEURL: baseUrl // ? baseUrl diff --git a/src/views/projectFront/configManage/personnelAccess.vue b/src/views/projectFront/configManage/personnelAccess.vue index 02bdd331..944194c7 100644 --- a/src/views/projectFront/configManage/personnelAccess.vue +++ b/src/views/projectFront/configManage/personnelAccess.vue @@ -28,15 +28,20 @@ --> - + - + @@ -48,7 +53,7 @@ v-model="workerName" :placeholder=" $t('message.projectInfo.placeholder') + - $t('message.projectInfo.name') + $t('message.projectInfo.name') " > @@ -57,7 +62,7 @@ {{ $t("message.alarmWarning.query") }} - + @@ -77,95 +82,104 @@ {{item.name}} --> -
- - - + + + - - - - - - - + + + + + + + - - +
+ + {{ $t("message.alarmValueSet.delete") }} +
+
+ + + - - + + + +
+ +
+ + + + {{ $t("message.projectInfo.allChoose") }} +
+
+ + +
+ +
+
+ + + 全选 {{ $t("message.projectInfo.allChoose") }}
@@ -372,7 +433,7 @@ - + --> ?,./])[a-zA-Z\d!@#$%^&*()_+~`\-={}[\]:";'<>?,./]{8,}$/, + pattern: + /^(?=.*\d)(?=.*[a-zA-Z])(?=.*[!@#$%^&*()_+~`\-={}[\]:";'<>?,./])[a-zA-Z\d!@#$%^&*()_+~`\-={}[\]:";'<>?,./]{8,}$/, message: "密码必须包含至少一个字母、一个数字、一个特殊字符以及长度至少为8位数", trigger: "blur", @@ -541,7 +611,8 @@ export default { trigger: "blur", }, { - pattern: /^(?=.*\d)(?=.*[a-zA-Z])(?=.*[!@#$%^&*()_+~`\-={}[\]:";'<>?,./])[a-zA-Z\d!@#$%^&*()_+~`\-={}[\]:";'<>?,./]{8,}$/, + pattern: + /^(?=.*\d)(?=.*[a-zA-Z])(?=.*[!@#$%^&*()_+~`\-={}[\]:";'<>?,./])[a-zA-Z\d!@#$%^&*()_+~`\-={}[\]:";'<>?,./]{8,}$/, message: "密码必须包含至少一个字母、一个数字、一个特殊字符以及长度至少为8位数", trigger: "blur", @@ -643,14 +714,66 @@ export default { // } // } // }, - workerSelect(){ - let findItem = this.personList.find(item => { - return item.id == this.addEditForm.workerId - }) - if(findItem){ - this.addEditForm.personMail = findItem.personMail + handleTreeCheckAllChange(val) { + this.isIndeterminate = false; + if (this.checkAll == true) { + for (let i = 0; i < this.treeDatas.length; i++) { + this.$refs.treeRef.setChecked(this.treeDatas[i].id, true, true); + } } else { - this.addEditForm.personMail = "" + this.$refs.treeRef.setCheckedKeys([]); + } + }, + // 获取当前选中的节点 + testCheckChange() { + const tree = this.$refs.treeRef; + let checkedCount = 0; + let disabledCount = 0; + let indeterminateFlag = false; + for (let i = 0; i < this.treeDatas.length; i++) { + if (tree.getNode(this.treeDatas[i]).disabled == true) { + disabledCount += 1; // 如果有置灰的节点,置灰变量加1 + } + if (tree.getNode(this.treeDatas[i]).checked == true) { + checkedCount += 1; // 如果有勾选的节点,勾选变量加1 + } + if (tree.getNode(this.treeDatas[i]).indeterminate == true) { + indeterminateFlag = true; // 如果有半选的节点,半选变量设为true + } + } + if (checkedCount == 0) { + this.isIndeterminate = false; + this.checkAll = false; // 如果勾选的一级节点数为0,则设置全选按钮样式不为半选样式,全选的值为false + if (indeterminateFlag == true) { + this.isIndeterminate = true; + this.checkAll = false; + } + } else if (checkedCount + disabledCount == this.treeDatas.length) { + this.isIndeterminate = false; + this.checkAll = true; + } else { + this.isIndeterminate = true; + this.checkAll = false; + } + return; + }, + getTreeEnterpriseList() { + selectHierarchyEnterpriseListApi({ + projectSn: this.$store.state.projectSn, + }).then((result) => { + if (result.success) { + this.treeDatas = result.result; + } + }); + }, + workerSelect() { + let findItem = this.personList.find((item) => { + return item.id == this.addEditForm.workerId; + }); + if (findItem) { + this.addEditForm.personMail = findItem.personMail; + } else { + this.addEditForm.personMail = ""; } }, getTreeList() { @@ -665,7 +788,7 @@ export default { // 树形控件点击 treeClick(data) { console.log(data); - if(data.status == 1){ + if (data.status == 1) { this.$message.warning("无法选中已禁用组织"); } else { this.selectVal = data.deptName; @@ -674,36 +797,54 @@ export default { // this.$refs.addEditForm.validateField("xzProjectOrgId") } }, - configFn(item) { + // 配置树形配置 + configTreeFn(item) { this.companyDialog = true; this.addEditForm = JSON.parse(JSON.stringify(item)); selectUserEnterpriseByUserIdApi({ userId: item.userId }).then((res) => { + let arr = []; if (res.result) { let id = res.result.enterpriseId; - console.log(id); - this.editComapnyDataId = res.result.id; - if (id.indexOf(",") != -1) { - let arr = []; - this.enterpriseListData.forEach((item) => { - for (let i = 0; i < id.split(",").length; i++) { - if (item.id == id.split(",")[i]) { - arr.push(id.split(",")[i]); - } - } - }); - this.selectCompanyData = arr; - } else { - this.selectCompanyData = [id]; + for (let i = 0; i < id.split(",").length; i++) { + arr.push(id.split(",")[i]); } - } else { - this.selectCompanyData = []; - this.editComapnyDataId = ""; + console.log(arr, 777888); + this.$nextTick(() => { + this.$refs.treeRef.setCheckedKeys(arr); + }); } - this.$nextTick(() => { - this.handleCheckedCompanyChange(); - }); }); }, + // configFn(item) { + // this.companyDialog = true; + // this.addEditForm = JSON.parse(JSON.stringify(item)); + // selectUserEnterpriseByUserIdApi({ userId: item.userId }).then((res) => { + // if (res.result) { + // let id = res.result.enterpriseId; + // console.log(id); + // this.editComapnyDataId = res.result.id; + // if (id.indexOf(",") != -1) { + // let arr = []; + // this.enterpriseListData.forEach((item) => { + // for (let i = 0; i < id.split(",").length; i++) { + // if (item.id == id.split(",")[i]) { + // arr.push(id.split(",")[i]); + // } + // } + // }); + // this.selectCompanyData = arr; + // } else { + // this.selectCompanyData = [id]; + // } + // } else { + // this.selectCompanyData = []; + // this.editComapnyDataId = ""; + // } + // this.$nextTick(() => { + // this.handleCheckedCompanyChange(); + // }); + // }); + // }, configFn2(item, devType) { this.configDevDialog = true; this.configDevType = devType; @@ -786,13 +927,29 @@ export default { console.log(checkedCount, checkedCount, arr.length); this.isIndeterminate = checkedCount > 0 && checkedCount < arr.length; }, - saveCompanyFn() { - let ids = ""; - if (this.selectCompanyData.length > 0) { - ids = this.selectCompanyData.join(","); - } + // saveCompanyFn() { + // let ids = ""; + // if (this.selectCompanyData.length > 0) { + // ids = this.selectCompanyData.join(","); + // } + // addOrEditUserEnterpriseApi({ + // enterpriseId: ids, + // userId: this.addEditForm.userId, + // id: this.editComapnyDataId, + // }).then((result) => { + // this.companyDialog = false; + // }); + // }, + saveTreeCompanyFn() { + const checked = this.$refs.treeRef.getCheckedNodes(); + const halfChecked = this.$refs.treeRef.getHalfCheckedNodes(); + const concatArr = checked.concat(halfChecked); + let ids = []; + concatArr.map(item => { + ids.push(item.id) + }) addOrEditUserEnterpriseApi({ - enterpriseId: ids, + enterpriseId: ids.join(","), userId: this.addEditForm.userId, id: this.editComapnyDataId, }).then((result) => { @@ -864,13 +1021,13 @@ export default { console.log("查询的参数", this.queryInfo); this.getList(); }, - filter(){ + filter() { console.log(this.queryInfo.enterpriseTypeId); getProjectChilderSystemUserListApi({ projectSn: this.$store.state.projectSn, enterpriseTypeId: this.queryInfo.enterpriseTypeId, }).then((res) => { - console.log("筛选参数"+res); + console.log("筛选参数" + res); }); }, add() { @@ -880,7 +1037,7 @@ export default { this.selectVal = ""; this.defaultExpandArr = []; this.$refs.groupTree.setCurrentKey(""); - }) + }); }, edit(obj) { console.log("编辑", obj); @@ -973,13 +1130,13 @@ export default { }, refresh() { this.workerName = ""; - this.screenStr = "" + this.screenStr = ""; this.getList(); }, getList() { getProjectChilderSystemUserListApi({ projectSn: this.$store.state.projectSn, - enterpriseTypeId:this.screenStr, + enterpriseTypeId: this.screenStr, workerName: this.workerName, }).then((result) => { if (result.success) { @@ -1010,6 +1167,21 @@ export default { width: 600px; height: auto; } +.dialog_tree_content { + width: 600px; + height: auto; + ::v-deep .el-checkbox__input { + position: static; + } + .selectAll-title { + display: flex; + align-items: center; + margin-left: 24px; + span { + margin-left: 10px; + } + } +} .el-checkbox-group { display: flex; flex-wrap: wrap; @@ -1054,10 +1226,12 @@ export default { ::v-deep .el-checkbox__input { position: absolute; } -/deep/.el-select-dropdown__item.hover,.el-select-dropdown__item.hover, .el-select-dropdown__item:hover{ +/deep/.el-select-dropdown__item.hover, +.el-select-dropdown__item.hover, +.el-select-dropdown__item:hover { background-color: transparent; } -.screen{ +.screen { margin-left: 10px; } diff --git a/src/views/projectFront/entryCode/myHome.vue b/src/views/projectFront/entryCode/myHome.vue index 0a0a2860..b8c3b597 100644 --- a/src/views/projectFront/entryCode/myHome.vue +++ b/src/views/projectFront/entryCode/myHome.vue @@ -408,7 +408,8 @@ export default { filters: { // 加密身份证号 hideIdNum (val) { - return `${val.substring(0, 3)}*************${val.substring(val.length - 2)}` + // return `${val.substring(0, 3)}*************${val.substring(val.length - 2)}` + return `${val.substring(0, 3)}***********${val.substring(val.length - 4)}` }, // 加密名字 hideName (val) { From 1ef743dca5a474edba8e57d00cd486688a786dce Mon Sep 17 00:00:00 2001 From: kun <1422840143@qq.com> Date: Sat, 25 May 2024 20:14:55 +0800 Subject: [PATCH 2/2] =?UTF-8?q?fix:=20BUG=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/assets/js/http.js | 4 +-- src/store/index.js | 4 +-- .../configManage/personnelAccess.vue | 31 ++++++++++++++++--- 3 files changed, 31 insertions(+), 8 deletions(-) diff --git a/src/assets/js/http.js b/src/assets/js/http.js index 4486d203..6778e31c 100644 --- a/src/assets/js/http.js +++ b/src/assets/js/http.js @@ -84,7 +84,7 @@ if (process.env.NODE_ENV == 'development') { // axios.defaults.baseURL ='http://101.43.164.214:45011/' //上海优益(上海建工) // axios.defaults.baseURL = 'http://192.168.34.221:28888/' //郭圣雄本地 // axios.defaults.baseURL = 'http://192.168.34.221:28889/' //郭圣雄本地 - // axios.defaults.baseURL ='http://192.168.34.221:9111/' //郭圣雄本地 + axios.defaults.baseURL ='http://192.168.34.221:9111/' //郭圣雄本地 // axios.defaults.baseURL = 'http://192.168.34.155:19111/' //彭洁本地 // axios.defaults.baseURL = 'http://182.90.224.237:51234' //郭圣雄远程 // axios.defaults.baseURL = 'http://jxj.zhgdyun.com:61212/' //彭洁远程 @@ -97,7 +97,7 @@ if (process.env.NODE_ENV == 'development') { // axios.defaults.baseURL = 'http://47.93.215.234:9809/'//鞍钢正式地址(弃用) // axios.defaults.baseURL = 'http://42.180.188.17:9809/'//鞍钢正式地址 // axios.defaults.baseURL = 'http://47.93.215.234:11211/'//鞍钢测试地址(弃用) - axios.defaults.baseURL = 'http://42.180.188.17:11211/'//鞍钢测试地址 + // axios.defaults.baseURL = 'http://42.180.188.17:11211/'//鞍钢测试地址 // axios.defaults.baseURL = 'http://jxj.zhgdyun.com:19814/'//测试地址 } else if (process.env.NODE_ENV == 'debug') { diff --git a/src/store/index.js b/src/store/index.js index 5c007c90..959b3c00 100644 --- a/src/store/index.js +++ b/src/store/index.js @@ -57,8 +57,8 @@ export default new Vuex.Store({ WORKFLOWURL: "http://192.168.34.138:88/#/workspace/forms", //坤工作流地址(本地) // UPLOADURL:'http://182.90.224.237:51234/upload/image/',// 郭圣雄远程 // FILEURL:'http://182.90.224.237:51234/image/',//郭圣雄远程 - // UPLOADURL:'http://jxj.zhgdyun.com:15551/upload/image',//测试 - // FILEURL:'http://jxj.zhgdyun.com:15551/image/',//测试 + // UPLOADURL:'http://42.180.188.17:11211/upload/image',//测试 + // FILEURL:'http://42.180.188.17:11211/image/',//测试 // BASEURL: baseUrl // ? baseUrl diff --git a/src/views/projectFront/configManage/personnelAccess.vue b/src/views/projectFront/configManage/personnelAccess.vue index 944194c7..51c4f00e 100644 --- a/src/views/projectFront/configManage/personnelAccess.vue +++ b/src/views/projectFront/configManage/personnelAccess.vue @@ -810,11 +810,34 @@ export default { } console.log(arr, 777888); this.$nextTick(() => { - this.$refs.treeRef.setCheckedKeys(arr); + this.$refs.treeRef.setCheckedKeys([]); + arr.map((item) => { + this.$refs.treeRef.setChecked(this.findNodeById(item),true); + }); }); } }); }, + findNodeById(id) { + function findNode(nodes, id) { + for(let i = 0;i 0 }; + } + if (nodes[i].children && nodes[i].children.length > 0) { + const found = findNode(nodes[i].children, id); + if (found) return found; + } + } + return null; + } + const result = findNode(this.treeDatas, id); + if (!result.hasChildren) { + return id; + } else { + return "" + } + }, // configFn(item) { // this.companyDialog = true; // this.addEditForm = JSON.parse(JSON.stringify(item)); @@ -945,9 +968,9 @@ export default { const halfChecked = this.$refs.treeRef.getHalfCheckedNodes(); const concatArr = checked.concat(halfChecked); let ids = []; - concatArr.map(item => { - ids.push(item.id) - }) + concatArr.map((item) => { + ids.push(item.id); + }); addOrEditUserEnterpriseApi({ enterpriseId: ids.join(","), userId: this.addEditForm.userId,