fix(接口测试): 接口文档增加接口备注的字段展示

--bug=1012730 --user=宋天阳
[接口定义]github#13003接口字段备注只有打开编辑状态可以看到备注,文档中或者分享页面都看不到接口的字段备注
https://www.tapd.cn/55049933/s/1172859
This commit is contained in:
song-tianyang 2022-06-02 17:41:28 +08:00 committed by f2c-ci-robot[bot]
parent 5e3f50c5ce
commit 5b849dcf0b
5 changed files with 81 additions and 1 deletions

View File

@ -46,4 +46,5 @@ public class ApiDocumentInfoDTO {
private String refId;
private String versionId;
private String remark;
}

View File

@ -402,6 +402,7 @@ public class ShareInfoService {
}
}
}
apiInfoDTO.setRemark(apiModel.getRemark());
}
if (!previewJsonArray.isEmpty()) {
if(previewJsonArray.size() == 1){

View File

@ -67,6 +67,8 @@
<!--响应状态码-->
<api-info-collapse :is-text="true" :string-data="getName(apiInfo.responseCode)"
:title="$t('api_test.definition.document.response_code')"/>
<!-- 备注 -->
<api-remark-show :data="apiInfo.remark"></api-remark-show>
<el-divider></el-divider>
</div>
</template>
@ -76,6 +78,7 @@ import {API_METHOD_COLOUR} from "@/business/components/api/definition/model/Json
import MsCodeEdit from "@/business/components/common/components/MsCodeEdit";
import ApiStatus from "@/business/components/api/definition/components/list/ApiStatus";
import MsJsonCodeEdit from "@/business/components/common/json-schema/JsonSchemaEditor";
import ApiRemarkShow from "@/business/components/api/definition/components/document/components/ApiRemarkShow";
import Api from "@/business/components/api/router";
import {generateApiDocumentShareInfo} from "@/network/share";
import ApiInfoCollapse from "@/business/components/api/definition/components/document/components/ApiInfoCollapse";
@ -90,7 +93,7 @@ export default {
components: {
Api,
MsJsonCodeEdit,
ApiStatus, MsCodeEdit, ApiInfoCollapse, ApiRequestInfo, ApiResponseInfo,
ApiStatus, MsCodeEdit, ApiInfoCollapse, ApiRequestInfo, ApiResponseInfo, ApiRemarkShow,
"ApiDocumentBatchShare": apiDocumentBatchShare.default
},
data() {

View File

@ -0,0 +1,73 @@
<template>
<div v-if="remarkObj">
<el-row class="apiInfoRow">
<div class="blackFontClass">
<el-row>
<div class="tip" style="float: left">
<span>{{$t("commons.remark")}}</span>
</div>
</el-row>
</div>
</el-row>
<el-row>
<el-form>
<form-rich-text-item class="remark-item" :disabled="true" :data="remarkObj" prop="remark" label-width="0"/>
</el-form>
</el-row>
</div>
</template>
<script>
import formRichTextItem from "@/business/components/track/case/components/FormRichTextItem";
export default {
name: "ApiRemarkShow",
components: {formRichTextItem},
data() {
return {
active: true,
remarkObj:null
};
},
props: {
data: String,
},
created() {
},
activated() {
},
mounted() {
},
computed: {},
watch: {
data(){
if(this.data){
this.remarkObj = {
"remark":this.data,
};
}
}
},
methods: {},
};
</script>
<style scoped>
.apiInfoRow {
margin: 10px 10px;
}
.apiInfoRow.el-row {
margin: 10px 10px;
}
.simpleFontClass {
font-weight: normal;
font-size: 14px;
margin-left: 10px;
}
.blackFontClass {
font-weight: bold;
font-size: 14px;
}
</style>

View File

@ -13,6 +13,8 @@ import JSONPathPicker from 'vue-jsonpath-picker';
Vue.use(JsonSchemaEditor);
import VuePapaParse from 'vue-papa-parse'
Vue.use(VuePapaParse)
import mavonEditor from 'mavon-editor'
Vue.use(mavonEditor)
Vue.use(ElementUI, {
i18n: (key, value) => i18n.t(key, value)