diff --git a/escheduler-api/src/main/java/cn/escheduler/api/service/AccessTokenService.java b/escheduler-api/src/main/java/cn/escheduler/api/service/AccessTokenService.java index 4adde8ad60..df7990149a 100644 --- a/escheduler-api/src/main/java/cn/escheduler/api/service/AccessTokenService.java +++ b/escheduler-api/src/main/java/cn/escheduler/api/service/AccessTokenService.java @@ -58,15 +58,16 @@ public class AccessTokenService extends BaseService { public Map queryAccessTokenList(User loginUser, String searchVal, Integer pageNo, Integer pageSize) { Map result = new HashMap<>(5); - if (check(result, !isAdmin(loginUser), Status.USER_NO_OPERATION_PERM, Constants.STATUS)) { - return result; - } - - Integer count = accessTokenMapper.countAccessTokenPaging(searchVal); - PageInfo pageInfo = new PageInfo<>(pageNo, pageSize); - - List accessTokenList = accessTokenMapper.queryAccessTokenPaging(searchVal, pageInfo.getStart(), pageSize); + Integer count; + List accessTokenList; + if (loginUser.getUserType() == UserType.ADMIN_USER){ + count = accessTokenMapper.countAccessTokenPaging(0,searchVal); + accessTokenList = accessTokenMapper.queryAccessTokenPaging(0,searchVal, pageInfo.getStart(), pageSize); + }else { + count = accessTokenMapper.countAccessTokenPaging(loginUser.getId(),searchVal); + accessTokenList = accessTokenMapper.queryAccessTokenPaging(loginUser.getId(),searchVal, pageInfo.getStart(), pageSize); + } pageInfo.setTotalCount(count); pageInfo.setLists(accessTokenList); diff --git a/escheduler-api/src/main/java/cn/escheduler/api/service/TenantService.java b/escheduler-api/src/main/java/cn/escheduler/api/service/TenantService.java index 8fc49d379a..91b7f7b133 100644 --- a/escheduler-api/src/main/java/cn/escheduler/api/service/TenantService.java +++ b/escheduler-api/src/main/java/cn/escheduler/api/service/TenantService.java @@ -80,6 +80,10 @@ public class TenantService extends BaseService{ Tenant tenant = new Tenant(); Date now = new Date(); + if (!tenantCode.matches("^[0-9a-zA-Z_.]{1,}$") || tenantCode.startsWith("-")){ + putMsg(result, Status.VERIFY_TENANT_CODE_ERROR); + return result; + } tenant.setTenantCode(tenantCode); tenant.setTenantName(tenantName); tenant.setQueueId(queueId); diff --git a/escheduler-dao/src/main/java/cn/escheduler/dao/mapper/AccessTokenMapper.java b/escheduler-dao/src/main/java/cn/escheduler/dao/mapper/AccessTokenMapper.java index aa196561b5..a9a17b8b7d 100644 --- a/escheduler-dao/src/main/java/cn/escheduler/dao/mapper/AccessTokenMapper.java +++ b/escheduler-dao/src/main/java/cn/escheduler/dao/mapper/AccessTokenMapper.java @@ -74,7 +74,8 @@ public interface AccessTokenMapper { @Result(property = "updateTime", column = "update_time", javaType = Timestamp.class, jdbcType = JdbcType.DATE) }) @SelectProvider(type = AccessTokenMapperProvider.class, method = "queryAccessTokenPaging") - List queryAccessTokenPaging(@Param("searchVal") String searchVal, + List queryAccessTokenPaging(@Param("userId") Integer userId, + @Param("searchVal") String searchVal, @Param("offset") Integer offset, @Param("pageSize") Integer pageSize); @@ -84,5 +85,6 @@ public interface AccessTokenMapper { * @return */ @SelectProvider(type = AccessTokenMapperProvider.class, method = "countAccessTokenPaging") - Integer countAccessTokenPaging(@Param("searchVal") String searchVal); + Integer countAccessTokenPaging(@Param("userId") Integer userId + ,@Param("searchVal") String searchVal); } diff --git a/escheduler-dao/src/main/java/cn/escheduler/dao/mapper/AccessTokenMapperProvider.java b/escheduler-dao/src/main/java/cn/escheduler/dao/mapper/AccessTokenMapperProvider.java index 2e4f92f79b..7aa8e61b70 100644 --- a/escheduler-dao/src/main/java/cn/escheduler/dao/mapper/AccessTokenMapperProvider.java +++ b/escheduler-dao/src/main/java/cn/escheduler/dao/mapper/AccessTokenMapperProvider.java @@ -97,6 +97,9 @@ public class AccessTokenMapperProvider { FROM(TABLE_NAME + " t,t_escheduler_user u"); Object searchVal = parameter.get("searchVal"); WHERE("u.id = t.user_id"); + if(parameter.get("userId") != null && (int)parameter.get("userId") != 0){ + WHERE(" u.id = #{userId}"); + } if(searchVal != null && StringUtils.isNotEmpty(searchVal.toString())){ WHERE(" u.user_name like concat('%', #{searchVal}, '%')"); } @@ -115,6 +118,9 @@ public class AccessTokenMapperProvider { FROM(TABLE_NAME + " t,t_escheduler_user u"); Object searchVal = parameter.get("searchVal"); WHERE("u.id = t.user_id"); + if(parameter.get("userId") != null && (int)parameter.get("userId") != 0){ + WHERE(" u.id = #{userId}"); + } if(searchVal != null && StringUtils.isNotEmpty(searchVal.toString())){ WHERE(" u.user_name like concat('%', #{searchVal}, '%') "); } diff --git a/escheduler-dao/src/test/java/cn/escheduler/dao/mapper/AccessTokenMapperTest.java b/escheduler-dao/src/test/java/cn/escheduler/dao/mapper/AccessTokenMapperTest.java index d5dfdcb1ec..7b1be50dfe 100644 --- a/escheduler-dao/src/test/java/cn/escheduler/dao/mapper/AccessTokenMapperTest.java +++ b/escheduler-dao/src/test/java/cn/escheduler/dao/mapper/AccessTokenMapperTest.java @@ -51,10 +51,10 @@ public class AccessTokenMapperTest { @Test public void testListPaging(){ - Integer count = accessTokenMapper.countAccessTokenPaging(""); + Integer count = accessTokenMapper.countAccessTokenPaging(1,""); Assert.assertEquals(count, (Integer) 5); - List accessTokenList = accessTokenMapper.queryAccessTokenPaging("", 0, 2); + List accessTokenList = accessTokenMapper.queryAccessTokenPaging(1,"", 0, 2); Assert.assertEquals(accessTokenList.size(), 5); } diff --git a/escheduler-ui/src/js/conf/home/pages/dag/_source/formModel/formModel.vue b/escheduler-ui/src/js/conf/home/pages/dag/_source/formModel/formModel.vue index f185ba80f5..c60896e8f3 100644 --- a/escheduler-ui/src/js/conf/home/pages/dag/_source/formModel/formModel.vue +++ b/escheduler-ui/src/js/conf/home/pages/dag/_source/formModel/formModel.vue @@ -128,6 +128,7 @@ v-if="taskType === 'SQL'" @on-params="_onParams" ref="SQL" + :create-node-id="id" :backfill-item="backfillItem"> @@ -429,7 +430,9 @@ } this.isContentBox = true }, - mounted () {}, + mounted () { + + }, updated () { }, beforeDestroy () { diff --git a/escheduler-ui/src/js/conf/home/pages/dag/_source/formModel/tasks/sql.vue b/escheduler-ui/src/js/conf/home/pages/dag/_source/formModel/tasks/sql.vue index 5d85089720..cac1343826 100644 --- a/escheduler-ui/src/js/conf/home/pages/dag/_source/formModel/tasks/sql.vue +++ b/escheduler-ui/src/js/conf/home/pages/dag/_source/formModel/tasks/sql.vue @@ -29,15 +29,15 @@ @@ -132,7 +132,8 @@ }, mixins: [disabledState], props: { - backfillItem: Object + backfillItem: Object, + createNodeId: Number }, methods: { /** @@ -238,7 +239,14 @@ return editor }, _getReceiver () { - this.store.dispatch('dag/getReceiver', { processDefinitionId: this.item.id }).then(res => { + let param = {} + let current = this.router.history.current + if (current.name === 'projects-definition-details') { + param.processDefinitionId = current.params.id + } else { + param.processInstanceId = current.params.id + } + this.store.dispatch('dag/getReceiver', param).then(res => { this.receivers = res.receivers && res.receivers.split(',') || [] this.receiversCc = res.receiversCc && res.receiversCc.split(',') || [] }) @@ -286,8 +294,8 @@ this.receivers = o.params.receivers && o.params.receivers.split(',') || [] this.receiversCc = o.params.receiversCc && o.params.receiversCc.split(',') || [] } - // - if (this.router.history.current.name === 'definition-create') { + if (!_.some(this.store.state.dag.tasks, { id: this.createNodeId }) && + this.router.history.current.name !== 'definition-create') { this._getReceiver() } }, diff --git a/escheduler-ui/src/js/conf/home/pages/projects/pages/definition/pages/list/_source/email.vue b/escheduler-ui/src/js/conf/home/pages/projects/pages/definition/pages/list/_source/email.vue index c0405d2075..cc6cb57646 100644 --- a/escheduler-ui/src/js/conf/home/pages/projects/pages/definition/pages/list/_source/email.vue +++ b/escheduler-ui/src/js/conf/home/pages/projects/pages/definition/pages/list/_source/email.vue @@ -1,9 +1,9 @@ @@ -63,7 +63,11 @@ }, props: { activeList: Array, - repeatData: Array + repeatData: Array, + disabled: { + type: Boolean, + default: false + } }, model: { prop: 'activeList', @@ -317,6 +321,14 @@ padding-left: 4px; } } + &.disabled { + .tag-wrapper { + background: #d9d9d9; + } + .email-input { + background: none; + } + } } } .email-list-model { diff --git a/escheduler-ui/src/js/conf/home/pages/projects/pages/index/_source/projectChart.vue b/escheduler-ui/src/js/conf/home/pages/projects/pages/index/_source/projectChart.vue index 4479a9a77e..6d7ca15574 100644 --- a/escheduler-ui/src/js/conf/home/pages/projects/pages/index/_source/projectChart.vue +++ b/escheduler-ui/src/js/conf/home/pages/projects/pages/index/_source/projectChart.vue @@ -1,7 +1,7 @@