From 50003ad6f53eb1b45b0d75ccc84c9a79792b1fff Mon Sep 17 00:00:00 2001 From: qq787203167 <787203167@qq.com> Date: Sat, 2 Jul 2022 12:19:30 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E7=A6=85=E9=81=93=E5=B7=B2?= =?UTF-8?q?=E7=9F=A5bug?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/components/tableCollection/index.vue | 24 +++++++++++-- .../ParameterItemCollectionList.vue | 34 +++++++++++++++---- 2 files changed, 50 insertions(+), 8 deletions(-) diff --git a/jero-web/src/components/tableCollection/index.vue b/jero-web/src/components/tableCollection/index.vue index 5aec4838b..7ee83c1f0 100644 --- a/jero-web/src/components/tableCollection/index.vue +++ b/jero-web/src/components/tableCollection/index.vue @@ -139,6 +139,7 @@ import axios from 'axios' import Vue from 'vue' import VueDraggableResizable from 'vue-draggable-resizable' + import { mapGetters } from 'vuex' export default { name: 'index', @@ -266,6 +267,7 @@ } }, methods: { + ...mapGetters(['userInfo']), rowClassName(row, index) { if (row.changeFlag == '1') { return 'rowClassRedYellow' @@ -397,8 +399,26 @@ } getAction(this.url.getLoginUserType, params).then((res) => { if (res.success) { - this.getTableList(res.result[0].value) - this.$emit('LoginUserType', res.result, this.currentPersonRole) + this.getAndUserId(res.result) + } + }) + }, + getAndUserId(result) { + let query = { + paramsManifestId: this.$route.query.id, + projectId:this.$route.query.projectId, + userId: this.userInfo().id + } + getAction('/params/userTypeLog/queryCurrentType', query).then((res) => { + if (res.success) { + if (res.result && res.result.userType){ + this.getTableList(res.result.userType) + }else{ + this.getTableList(result[0].value) + } + this.$emit('LoginUserType', result, this.currentPersonRole,res.result.userType) + } else { + } }) }, diff --git a/jero-web/src/views/projectManagement/components/ParameterItemCollectionList.vue b/jero-web/src/views/projectManagement/components/ParameterItemCollectionList.vue index 9bc09aff5..2ee7d3388 100644 --- a/jero-web/src/views/projectManagement/components/ParameterItemCollectionList.vue +++ b/jero-web/src/views/projectManagement/components/ParameterItemCollectionList.vue @@ -363,6 +363,7 @@ import axios from 'axios' import { ACCESS_TOKEN } from '@/store/mutation-types' import Vue from 'vue' + import { mapGetters } from 'vuex' export default { name: 'ParameterItemCollectionList', @@ -506,14 +507,35 @@ document.title = `${this.paramsManifest.title}-` + this.$t('ParameteItemCollectionList') }, methods: { + ...mapGetters(['userInfo']), handleCancelRoleSwitching() { this.visibleRoleSwitching = false }, handleOkRoleSwitching() { - this.visibleRoleSwitching = false - this.currentPersonRole = this.formInlineRoleSwitching.roleSwitchingCode - localStorage.setItem('currentPersonRole', JSON.stringify(this.formInlineRoleSwitching.roleSwitchingCode)) - this.selectedRowKeysValue = [] + this.$refs.ruleFormRoleSwitching.validate(valid => { + if (valid) { + let query = { + userType: this.formInlineRoleSwitching.roleSwitchingCode, + paramsManifestId: this.$route.query.id, + projectId: this.$route.query.projectId, + userId: this.userInfo().id + } + this.confirmLoadingRoleSwitching = true + postAction('/params/userTypeLog/edit', query).then((res) => { + if (res.success) { + this.currentPersonRole = this.formInlineRoleSwitching.roleSwitchingCode + this.$message.success(this.$t('OperationSuccessful')) + this.visibleRoleSwitching = false + this.confirmLoadingRoleSwitching = false + localStorage.setItem('currentPersonRole', JSON.stringify(this.formInlineRoleSwitching.roleSwitchingCode)) + this.selectedRowKeysValue = [] + } else { + this.confirmLoadingRoleSwitching = false + this.$message.warning(this.$t('operationFailed')) + } + }) + } + }) }, roleSwitchingClick() { this.visibleRoleSwitching = true @@ -792,13 +814,13 @@ } return flag }, - LoginUserType(val, currentPersonRole) { + LoginUserType(val, currentPersonRole,userType) { this.RoleType = [] if (this.currentPersonRole == '') { this.currentPersonRole = val.length >= 1 ? val[0].value : '' } this.RoleType = val - this.formInlineRoleSwitching.roleSwitchingCode = currentPersonRole || val[0].value + this.formInlineRoleSwitching.roleSwitchingCode = currentPersonRole || userType || val[0].value this.formInlineRoleSwitching = { ...this.formInlineRoleSwitching } }, // 表格所选中得行内容