feat(测试跟踪): 用例下创建缺陷,自定义字段下拉框选项支持远程搜索

This commit is contained in:
chenjianxing 2023-02-19 17:37:58 +08:00 committed by jianxing
parent 4d5492ad24
commit 2cae437b1a
2 changed files with 28 additions and 1 deletions

View File

@ -38,6 +38,8 @@
:form-label-width="formLabelWidth" :form-label-width="formLabelWidth"
:issue-template="issueTemplate" :issue-template="issueTemplate"
class="custom-case-form" class="custom-case-form"
@inputSearch="handleInputSearch"
ref="customFieldItem"
/> />
</el-form> </el-form>
<!-- 未开启第三方 --> <!-- 未开启第三方 -->
@ -146,7 +148,7 @@ import {
getFollow, getFollow,
getComments, getComments,
getTapdUser, getTapdUser,
getPlatformTransitions, getPlatformTransitions, getPlatformFormOption,
} from "@/api/issue"; } from "@/api/issue";
import { import {
uploadIssueAttachment, uploadIssueAttachment,
@ -447,6 +449,17 @@ export default {
// this.getComments(); // this.getComments();
}); });
}, },
handleInputSearch(data, query) {
getPlatformFormOption({
optionMethod: data.optionMethod,
workspaceId: getCurrentWorkspaceId(),
platform: this.issueTemplate.platform,
query
}).then((r) => {
data.options = r.data;
this.$refs.customFieldItem.stopLoading();
});
},
save(reset) { save(reset) {
let isValidate = true; let isValidate = true;
this.$refs["form"].validate((valid) => { this.$refs["form"].validate((valid) => {

View File

@ -21,6 +21,8 @@
:form="form" :form="form"
:default-open="defaultOpen" :default-open="defaultOpen"
:disabled="isPublic" :disabled="isPublic"
@inputSearch="handleInputSearch"
ref="customFiled"
/> />
</el-form-item> </el-form-item>
</div> </div>
@ -38,6 +40,8 @@
:data="item" :data="item"
:form="form" :form="form"
prop="defaultValue" prop="defaultValue"
@inputSearch="handleInputSearch"
ref="customFiled"
/> />
</el-form-item> </el-form-item>
</div> </div>
@ -104,6 +108,16 @@ export default {
}, },
}, },
}, },
methods: {
handleInputSearch(data, query) {
this.$emit('inputSearch', data, query);
},
stopLoading() {
this.$refs.customFiled.forEach(item => {
item.stopLoading();
});
},
},
computed: { computed: {
customFieldRowNums() { customFieldRowNums() {
let size = this.issueTemplate.customFields let size = this.issueTemplate.customFields