feat: azure 支持根据父workItem过滤需求
This commit is contained in:
parent
1c1fc351e6
commit
7b5976dd16
|
@ -43,5 +43,7 @@ public class Project implements Serializable {
|
||||||
|
|
||||||
private Boolean isMockTcpOpen;
|
private Boolean isMockTcpOpen;
|
||||||
|
|
||||||
|
private String azureFilterId;
|
||||||
|
|
||||||
private static final long serialVersionUID = 1L;
|
private static final long serialVersionUID = 1L;
|
||||||
}
|
}
|
|
@ -1363,6 +1363,76 @@ public class ProjectExample {
|
||||||
addCriterion("is_mock_tcp_open not between", value1, value2, "isMockTcpOpen");
|
addCriterion("is_mock_tcp_open not between", value1, value2, "isMockTcpOpen");
|
||||||
return (Criteria) this;
|
return (Criteria) this;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public Criteria andAzureFilterIdIsNull() {
|
||||||
|
addCriterion("azure_filter_id is null");
|
||||||
|
return (Criteria) this;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Criteria andAzureFilterIdIsNotNull() {
|
||||||
|
addCriterion("azure_filter_id is not null");
|
||||||
|
return (Criteria) this;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Criteria andAzureFilterIdEqualTo(String value) {
|
||||||
|
addCriterion("azure_filter_id =", value, "azureFilterId");
|
||||||
|
return (Criteria) this;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Criteria andAzureFilterIdNotEqualTo(String value) {
|
||||||
|
addCriterion("azure_filter_id <>", value, "azureFilterId");
|
||||||
|
return (Criteria) this;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Criteria andAzureFilterIdGreaterThan(String value) {
|
||||||
|
addCriterion("azure_filter_id >", value, "azureFilterId");
|
||||||
|
return (Criteria) this;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Criteria andAzureFilterIdGreaterThanOrEqualTo(String value) {
|
||||||
|
addCriterion("azure_filter_id >=", value, "azureFilterId");
|
||||||
|
return (Criteria) this;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Criteria andAzureFilterIdLessThan(String value) {
|
||||||
|
addCriterion("azure_filter_id <", value, "azureFilterId");
|
||||||
|
return (Criteria) this;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Criteria andAzureFilterIdLessThanOrEqualTo(String value) {
|
||||||
|
addCriterion("azure_filter_id <=", value, "azureFilterId");
|
||||||
|
return (Criteria) this;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Criteria andAzureFilterIdLike(String value) {
|
||||||
|
addCriterion("azure_filter_id like", value, "azureFilterId");
|
||||||
|
return (Criteria) this;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Criteria andAzureFilterIdNotLike(String value) {
|
||||||
|
addCriterion("azure_filter_id not like", value, "azureFilterId");
|
||||||
|
return (Criteria) this;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Criteria andAzureFilterIdIn(List<String> values) {
|
||||||
|
addCriterion("azure_filter_id in", values, "azureFilterId");
|
||||||
|
return (Criteria) this;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Criteria andAzureFilterIdNotIn(List<String> values) {
|
||||||
|
addCriterion("azure_filter_id not in", values, "azureFilterId");
|
||||||
|
return (Criteria) this;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Criteria andAzureFilterIdBetween(String value1, String value2) {
|
||||||
|
addCriterion("azure_filter_id between", value1, value2, "azureFilterId");
|
||||||
|
return (Criteria) this;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Criteria andAzureFilterIdNotBetween(String value1, String value2) {
|
||||||
|
addCriterion("azure_filter_id not between", value1, value2, "azureFilterId");
|
||||||
|
return (Criteria) this;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public static class Criteria extends GeneratedCriteria {
|
public static class Criteria extends GeneratedCriteria {
|
||||||
|
|
|
@ -21,6 +21,7 @@
|
||||||
<result column="system_id" jdbcType="VARCHAR" property="systemId" />
|
<result column="system_id" jdbcType="VARCHAR" property="systemId" />
|
||||||
<result column="mock_tcp_port" jdbcType="INTEGER" property="mockTcpPort" />
|
<result column="mock_tcp_port" jdbcType="INTEGER" property="mockTcpPort" />
|
||||||
<result column="is_mock_tcp_open" jdbcType="BIT" property="isMockTcpOpen" />
|
<result column="is_mock_tcp_open" jdbcType="BIT" property="isMockTcpOpen" />
|
||||||
|
<result column="azure_filter_id" jdbcType="VARCHAR" property="azureFilterId" />
|
||||||
</resultMap>
|
</resultMap>
|
||||||
<sql id="Example_Where_Clause">
|
<sql id="Example_Where_Clause">
|
||||||
<where>
|
<where>
|
||||||
|
@ -83,7 +84,7 @@
|
||||||
<sql id="Base_Column_List">
|
<sql id="Base_Column_List">
|
||||||
id, workspace_id, `name`, description, create_time, update_time, tapd_id, jira_key,
|
id, workspace_id, `name`, description, create_time, update_time, tapd_id, jira_key,
|
||||||
zentao_id, azure_devops_id, `repeatable`, case_template_id, issue_template_id, custom_num,
|
zentao_id, azure_devops_id, `repeatable`, case_template_id, issue_template_id, custom_num,
|
||||||
scenario_custom_num, create_user, system_id, mock_tcp_port, is_mock_tcp_open
|
scenario_custom_num, create_user, system_id, mock_tcp_port, is_mock_tcp_open, azure_filter_id
|
||||||
</sql>
|
</sql>
|
||||||
<select id="selectByExample" parameterType="io.metersphere.base.domain.ProjectExample" resultMap="BaseResultMap">
|
<select id="selectByExample" parameterType="io.metersphere.base.domain.ProjectExample" resultMap="BaseResultMap">
|
||||||
select
|
select
|
||||||
|
@ -122,14 +123,14 @@
|
||||||
azure_devops_id, `repeatable`, case_template_id,
|
azure_devops_id, `repeatable`, case_template_id,
|
||||||
issue_template_id, custom_num, scenario_custom_num,
|
issue_template_id, custom_num, scenario_custom_num,
|
||||||
create_user, system_id, mock_tcp_port,
|
create_user, system_id, mock_tcp_port,
|
||||||
is_mock_tcp_open)
|
is_mock_tcp_open, azure_filter_id)
|
||||||
values (#{id,jdbcType=VARCHAR}, #{workspaceId,jdbcType=VARCHAR}, #{name,jdbcType=VARCHAR},
|
values (#{id,jdbcType=VARCHAR}, #{workspaceId,jdbcType=VARCHAR}, #{name,jdbcType=VARCHAR},
|
||||||
#{description,jdbcType=VARCHAR}, #{createTime,jdbcType=BIGINT}, #{updateTime,jdbcType=BIGINT},
|
#{description,jdbcType=VARCHAR}, #{createTime,jdbcType=BIGINT}, #{updateTime,jdbcType=BIGINT},
|
||||||
#{tapdId,jdbcType=VARCHAR}, #{jiraKey,jdbcType=VARCHAR}, #{zentaoId,jdbcType=VARCHAR},
|
#{tapdId,jdbcType=VARCHAR}, #{jiraKey,jdbcType=VARCHAR}, #{zentaoId,jdbcType=VARCHAR},
|
||||||
#{azureDevopsId,jdbcType=VARCHAR}, #{repeatable,jdbcType=BIT}, #{caseTemplateId,jdbcType=VARCHAR},
|
#{azureDevopsId,jdbcType=VARCHAR}, #{repeatable,jdbcType=BIT}, #{caseTemplateId,jdbcType=VARCHAR},
|
||||||
#{issueTemplateId,jdbcType=VARCHAR}, #{customNum,jdbcType=BIT}, #{scenarioCustomNum,jdbcType=BIT},
|
#{issueTemplateId,jdbcType=VARCHAR}, #{customNum,jdbcType=BIT}, #{scenarioCustomNum,jdbcType=BIT},
|
||||||
#{createUser,jdbcType=VARCHAR}, #{systemId,jdbcType=VARCHAR}, #{mockTcpPort,jdbcType=INTEGER},
|
#{createUser,jdbcType=VARCHAR}, #{systemId,jdbcType=VARCHAR}, #{mockTcpPort,jdbcType=INTEGER},
|
||||||
#{isMockTcpOpen,jdbcType=BIT})
|
#{isMockTcpOpen,jdbcType=BIT}, #{azureFilterId,jdbcType=VARCHAR})
|
||||||
</insert>
|
</insert>
|
||||||
<insert id="insertSelective" parameterType="io.metersphere.base.domain.Project">
|
<insert id="insertSelective" parameterType="io.metersphere.base.domain.Project">
|
||||||
insert into project
|
insert into project
|
||||||
|
@ -191,6 +192,9 @@
|
||||||
<if test="isMockTcpOpen != null">
|
<if test="isMockTcpOpen != null">
|
||||||
is_mock_tcp_open,
|
is_mock_tcp_open,
|
||||||
</if>
|
</if>
|
||||||
|
<if test="azureFilterId != null">
|
||||||
|
azure_filter_id,
|
||||||
|
</if>
|
||||||
</trim>
|
</trim>
|
||||||
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
||||||
<if test="id != null">
|
<if test="id != null">
|
||||||
|
@ -250,6 +254,9 @@
|
||||||
<if test="isMockTcpOpen != null">
|
<if test="isMockTcpOpen != null">
|
||||||
#{isMockTcpOpen,jdbcType=BIT},
|
#{isMockTcpOpen,jdbcType=BIT},
|
||||||
</if>
|
</if>
|
||||||
|
<if test="azureFilterId != null">
|
||||||
|
#{azureFilterId,jdbcType=VARCHAR},
|
||||||
|
</if>
|
||||||
</trim>
|
</trim>
|
||||||
</insert>
|
</insert>
|
||||||
<select id="countByExample" parameterType="io.metersphere.base.domain.ProjectExample" resultType="java.lang.Long">
|
<select id="countByExample" parameterType="io.metersphere.base.domain.ProjectExample" resultType="java.lang.Long">
|
||||||
|
@ -318,6 +325,9 @@
|
||||||
<if test="record.isMockTcpOpen != null">
|
<if test="record.isMockTcpOpen != null">
|
||||||
is_mock_tcp_open = #{record.isMockTcpOpen,jdbcType=BIT},
|
is_mock_tcp_open = #{record.isMockTcpOpen,jdbcType=BIT},
|
||||||
</if>
|
</if>
|
||||||
|
<if test="record.azureFilterId != null">
|
||||||
|
azure_filter_id = #{record.azureFilterId,jdbcType=VARCHAR},
|
||||||
|
</if>
|
||||||
</set>
|
</set>
|
||||||
<if test="_parameter != null">
|
<if test="_parameter != null">
|
||||||
<include refid="Update_By_Example_Where_Clause" />
|
<include refid="Update_By_Example_Where_Clause" />
|
||||||
|
@ -343,7 +353,8 @@
|
||||||
create_user = #{record.createUser,jdbcType=VARCHAR},
|
create_user = #{record.createUser,jdbcType=VARCHAR},
|
||||||
system_id = #{record.systemId,jdbcType=VARCHAR},
|
system_id = #{record.systemId,jdbcType=VARCHAR},
|
||||||
mock_tcp_port = #{record.mockTcpPort,jdbcType=INTEGER},
|
mock_tcp_port = #{record.mockTcpPort,jdbcType=INTEGER},
|
||||||
is_mock_tcp_open = #{record.isMockTcpOpen,jdbcType=BIT}
|
is_mock_tcp_open = #{record.isMockTcpOpen,jdbcType=BIT},
|
||||||
|
azure_filter_id = #{record.azureFilterId,jdbcType=VARCHAR}
|
||||||
<if test="_parameter != null">
|
<if test="_parameter != null">
|
||||||
<include refid="Update_By_Example_Where_Clause" />
|
<include refid="Update_By_Example_Where_Clause" />
|
||||||
</if>
|
</if>
|
||||||
|
@ -405,6 +416,9 @@
|
||||||
<if test="isMockTcpOpen != null">
|
<if test="isMockTcpOpen != null">
|
||||||
is_mock_tcp_open = #{isMockTcpOpen,jdbcType=BIT},
|
is_mock_tcp_open = #{isMockTcpOpen,jdbcType=BIT},
|
||||||
</if>
|
</if>
|
||||||
|
<if test="azureFilterId != null">
|
||||||
|
azure_filter_id = #{azureFilterId,jdbcType=VARCHAR},
|
||||||
|
</if>
|
||||||
</set>
|
</set>
|
||||||
where id = #{id,jdbcType=VARCHAR}
|
where id = #{id,jdbcType=VARCHAR}
|
||||||
</update>
|
</update>
|
||||||
|
@ -427,7 +441,8 @@
|
||||||
create_user = #{createUser,jdbcType=VARCHAR},
|
create_user = #{createUser,jdbcType=VARCHAR},
|
||||||
system_id = #{systemId,jdbcType=VARCHAR},
|
system_id = #{systemId,jdbcType=VARCHAR},
|
||||||
mock_tcp_port = #{mockTcpPort,jdbcType=INTEGER},
|
mock_tcp_port = #{mockTcpPort,jdbcType=INTEGER},
|
||||||
is_mock_tcp_open = #{isMockTcpOpen,jdbcType=BIT}
|
is_mock_tcp_open = #{isMockTcpOpen,jdbcType=BIT},
|
||||||
|
azure_filter_id = #{azureFilterId,jdbcType=VARCHAR}
|
||||||
where id = #{id,jdbcType=VARCHAR}
|
where id = #{id,jdbcType=VARCHAR}
|
||||||
</update>
|
</update>
|
||||||
</mapper>
|
</mapper>
|
|
@ -48,6 +48,7 @@
|
||||||
p.azure_devops_id,
|
p.azure_devops_id,
|
||||||
p.repeatable,
|
p.repeatable,
|
||||||
p.custom_num,
|
p.custom_num,
|
||||||
|
p.azure_filter_id,
|
||||||
user.name AS createUserName,
|
user.name AS createUserName,
|
||||||
p.mock_tcp_port AS mockTcpPort,
|
p.mock_tcp_port AS mockTcpPort,
|
||||||
p.is_mock_tcp_open AS isMockTcpOpen,
|
p.is_mock_tcp_open AS isMockTcpOpen,
|
||||||
|
|
|
@ -3,10 +3,13 @@ package io.metersphere.track.dto;
|
||||||
import lombok.Getter;
|
import lombok.Getter;
|
||||||
import lombok.Setter;
|
import lombok.Setter;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
@Setter
|
@Setter
|
||||||
@Getter
|
@Getter
|
||||||
public class DemandDTO {
|
public class DemandDTO {
|
||||||
private String id;
|
protected String id;
|
||||||
private String name;
|
protected String name;
|
||||||
private String platform;
|
protected String platform;
|
||||||
|
protected List<? extends DemandDTO> children;
|
||||||
}
|
}
|
||||||
|
|
|
@ -1 +1 @@
|
||||||
Subproject commit 09533c94661faf6b8a6b7695545e0850a52d07e6
|
Subproject commit a432acd823010a980e9976b4d386b4bd2d1c7354
|
|
@ -10,3 +10,4 @@ values (UUID(), 'ws_admin', 'WORKSPACE_PROJECT_MANAGER:READ+UPLOAD_JAR', 'WORKSP
|
||||||
insert into user_group_permission (id, group_id, permission_id, module_id)
|
insert into user_group_permission (id, group_id, permission_id, module_id)
|
||||||
values (UUID(), 'ws_member', 'WORKSPACE_PROJECT_MANAGER:READ+UPLOAD_JAR', 'WORKSPACE_PROJECT_MANAGER');
|
values (UUID(), 'ws_member', 'WORKSPACE_PROJECT_MANAGER:READ+UPLOAD_JAR', 'WORKSPACE_PROJECT_MANAGER');
|
||||||
|
|
||||||
|
ALTER TABLE project ADD COLUMN azure_filter_id varchar(50) NULL COMMENT 'azure 过滤需求的 parent workItem ID';
|
||||||
|
|
|
@ -142,6 +142,10 @@
|
||||||
<el-form-item :label-width="labelWidth" :label="$t('project.azureDevops_id')" v-if="azuredevops">
|
<el-form-item :label-width="labelWidth" :label="$t('project.azureDevops_id')" v-if="azuredevops">
|
||||||
<el-input v-model="form.azureDevopsId" autocomplete="off"></el-input>
|
<el-input v-model="form.azureDevopsId" autocomplete="off"></el-input>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
|
<el-form-item :label-width="labelWidth" :label="'AzureDevops过滤ID'" v-if="azuredevops">
|
||||||
|
<el-input v-model="form.azureFilterId" autocomplete="off"/>
|
||||||
|
<ms-instructions-icon content="非必填项,用例关联需求时,可以只筛选出,所填的 workItem 下的选项" effect="light"/>
|
||||||
|
</el-form-item>
|
||||||
<el-form-item :label-width="labelWidth" :label="$t('project.repeatable')" prop="repeatable">
|
<el-form-item :label-width="labelWidth" :label="$t('project.repeatable')" prop="repeatable">
|
||||||
<el-switch v-model="form.repeatable"></el-switch>
|
<el-switch v-model="form.repeatable"></el-switch>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
|
|
|
@ -13,15 +13,17 @@
|
||||||
<el-col :span="7">
|
<el-col :span="7">
|
||||||
<el-form-item :label="$t('test_track.related_requirements')" :label-width="labelWidth"
|
<el-form-item :label="$t('test_track.related_requirements')" :label-width="labelWidth"
|
||||||
prop="demandId">
|
prop="demandId">
|
||||||
<el-select filterable :disabled="readOnly" v-model="form.demandId" @visible-change="visibleChange"
|
<!-- <el-select filterable :disabled="readOnly" v-model="form.demandId" @visible-change="visibleChange"-->
|
||||||
:placeholder="$t('test_track.please_related_requirements')" class="ms-case-input">
|
<!-- :placeholder="$t('test_track.please_related_requirements')" class="ms-case-input">-->
|
||||||
<el-option
|
<!-- <el-option-->
|
||||||
v-for="item in demandOptions"
|
<!-- v-for="item in demandOptions"-->
|
||||||
:key="item.id"
|
<!-- :key="item.id"-->
|
||||||
:label="item.platform + ': '+item.name"
|
<!-- :label="item.platform + ': '+item.name"-->
|
||||||
:value="item.id">
|
<!-- :value="item.id">-->
|
||||||
</el-option>
|
<!-- </el-option>-->
|
||||||
</el-select>
|
<!-- </el-select>-->
|
||||||
|
|
||||||
|
<el-cascader v-model="demandValue" :show-all-levels="false" :options="demandOptions" clearable/>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
</el-col>
|
</el-col>
|
||||||
<el-col :span="7">
|
<el-col :span="7">
|
||||||
|
@ -106,6 +108,7 @@ export default {
|
||||||
tableData: [],
|
tableData: [],
|
||||||
demandOptions: [],
|
demandOptions: [],
|
||||||
relationshipCount: 0,
|
relationshipCount: 0,
|
||||||
|
demandValue: [],
|
||||||
//sysList:this.sysList,//一级选择框的数据
|
//sysList:this.sysList,//一级选择框的数据
|
||||||
props: {
|
props: {
|
||||||
multiple: true,
|
multiple: true,
|
||||||
|
@ -135,6 +138,13 @@ export default {
|
||||||
getRelationshipCountCase(this.caseId, (data) => {
|
getRelationshipCountCase(this.caseId, (data) => {
|
||||||
this.relationshipCount = data;
|
this.relationshipCount = data;
|
||||||
});
|
});
|
||||||
|
},
|
||||||
|
demandValue() {
|
||||||
|
if (this.demandValue.length > 0) {
|
||||||
|
this.form.demandId = this.demandValue[this.demandValue.length - 1];
|
||||||
|
} else {
|
||||||
|
this.form.demandId = null;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
|
@ -261,16 +271,42 @@ export default {
|
||||||
if (this.demandOptions.length === 0) {
|
if (this.demandOptions.length === 0) {
|
||||||
this.result = {loading: true};
|
this.result = {loading: true};
|
||||||
this.$get("demand/list/" + this.projectId).then(response => {
|
this.$get("demand/list/" + this.projectId).then(response => {
|
||||||
this.demandOptions = response.data.data;
|
this.demandOptions = [];
|
||||||
this.demandOptions.unshift({id: 'other', name: this.$t('test_track.case.other'), platform: 'Other'});
|
if (response.data.data && response.data.data.length > 0) {
|
||||||
|
this.buildDemandCascaderOptions(response.data.data, this.demandOptions, []);
|
||||||
|
}
|
||||||
|
this.demandOptions.unshift({value: 'other', label: 'Other: ' + this.$t('test_track.case.other'), platform: 'Other'});
|
||||||
|
if (this.form.demandId === 'other') {
|
||||||
|
this.demandValue = ['other'];
|
||||||
|
}
|
||||||
this.result = {loading: false};
|
this.result = {loading: false};
|
||||||
}).catch(() => {
|
}).catch(() => {
|
||||||
this.demandOptions.unshift({id: 'other', name: this.$t('test_track.case.other'), platform: 'Other'});
|
this.demandOptions.unshift({value: 'other', label: 'Other: ' + this.$t('test_track.case.other'), platform: 'Other'});
|
||||||
|
if (this.form.demandId === 'other') {
|
||||||
|
this.demandValue = ['other'];
|
||||||
|
}
|
||||||
this.result = {loading: false};
|
this.result = {loading: false};
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
buildDemandCascaderOptions(data, options, pathArray) {
|
||||||
|
data.forEach(item => {
|
||||||
|
let option = {
|
||||||
|
label: item.platform + ': ' + item.name,
|
||||||
|
value: item.id
|
||||||
|
}
|
||||||
|
options.push(option);
|
||||||
|
pathArray.push(item.id);
|
||||||
|
if (item.id === this.form.demandId) {
|
||||||
|
this.demandValue = [...pathArray]; // 回显级联选项
|
||||||
|
}
|
||||||
|
if (item.children && item.children.length > 0) {
|
||||||
|
option.children = [];
|
||||||
|
this.buildDemandCascaderOptions(item.children, option.children, pathArray);
|
||||||
|
}
|
||||||
|
pathArray.pop();
|
||||||
|
});
|
||||||
|
}
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
</script>
|
</script>
|
||||||
|
@ -291,6 +327,6 @@ export default {
|
||||||
|
|
||||||
.el-cascader >>> .el-input {
|
.el-cascader >>> .el-input {
|
||||||
cursor: pointer;
|
cursor: pointer;
|
||||||
width: 500px;
|
width: 250px;
|
||||||
}
|
}
|
||||||
</style>
|
</style>
|
||||||
|
|
Loading…
Reference in New Issue