fix: 修复无xpack版源码运行,文档模块会报错的问题

修复无xpack版源码运行,文档模块会报错的问题
This commit is contained in:
song.tianyang 2021-03-08 14:46:32 +08:00
parent 0e8a371eb9
commit 9ac38f6035
1 changed files with 6 additions and 3 deletions

View File

@ -24,7 +24,8 @@
</el-select>
<el-input :placeholder="$t('api_test.definition.document.search_by_api_name')" @blur="initApiDocSimpleList()" style="float: right;width: 180px;margin-right: 5px" size="small"
@keyup.enter.native="initApiDocSimpleList()" v-model="apiSearch.name"/>
<api-document-batch-share v-xpack @shareApiDocument="shareApiDocument" :project-id="projectId" :share-url="batchShareUrl" style="float: right;margin: 6px;font-size: 17px"/>
<api-document-batch-share v-xpack v-if="showXpackCompnent" @shareApiDocument="shareApiDocument" :project-id="projectId" :share-url="batchShareUrl" style="float: right;margin: 6px;font-size: 17px"/>
<!-- <api-document-batch-share v-xpack v-if="showXpackCompnent"/>-->
</el-row>
<el-divider></el-divider>
<div ref="apiDocInfoDiv" @scroll="handleScroll" >
@ -300,6 +301,7 @@ export default {
shareUrl:"",
batchShareUrl:"",
apiStepIndex: 0,
showXpackCompnent:false,
apiInfoArray: [],
modes: ['text', 'json', 'xml', 'html'],
formParamTypes: ['form-data', 'x-www-from-urlencoded', 'BINARY'],
@ -349,6 +351,9 @@ export default {
}
},
created: function () {
if(requireComponent!=null && JSON.stringify(apiDocumentBatchShare) != '{}'){
this.showXpackCompnent = true;
}
this.initApiDocSimpleList();
this.clientHeight = `${document.documentElement.clientHeight}`;//
let that = this;
@ -601,7 +606,6 @@ export default {
}
if(apiInfo == null || !apiInfo.selectedFlag){
let apiId = apiInfo.id;
console.log(apiInfo.isSearching+":"+apiId);
if(!apiInfo.isSearching){
apiInfo.isSearching = true;
this.selectApiInfo(beforeIndex,apiId);
@ -616,7 +620,6 @@ export default {
}
if(apiInfo == null || !apiInfo.selectedFlag){
let apiId = apiInfo.id;
console.log(apiInfo.isSearching+":"+apiId);
if(!apiInfo.isSearching) {
apiInfo.isSearching = true;
this.selectApiInfo(afterIndex,apiId);