refactor: 创建新接口版本时同步备注和依赖关系
This commit is contained in:
parent
37dbf0aad9
commit
057451ca0c
|
@ -44,7 +44,7 @@
|
||||||
<p class="tip">{{ $t('api_test.definition.request.req_param') }} </p>
|
<p class="tip">{{ $t('api_test.definition.request.req_param') }} </p>
|
||||||
<ms-basis-parameters :showScript="false" :request="request"/>
|
<ms-basis-parameters :showScript="false" :request="request"/>
|
||||||
|
|
||||||
<api-other-info :api="basisData"/>
|
<api-other-info :api="basisData" ref="apiOtherInfo"/>
|
||||||
<ms-change-history ref="changeHistory"/>
|
<ms-change-history ref="changeHistory"/>
|
||||||
<el-dialog
|
<el-dialog
|
||||||
:fullscreen="true"
|
:fullscreen="true"
|
||||||
|
@ -62,6 +62,25 @@
|
||||||
></dubbo-api-version-diff>
|
></dubbo-api-version-diff>
|
||||||
</el-dialog>
|
</el-dialog>
|
||||||
|
|
||||||
|
<el-dialog
|
||||||
|
:title="$t('commons.sync_other_info')"
|
||||||
|
:visible.sync="createNewVersionVisible"
|
||||||
|
:show-close="false"
|
||||||
|
width="30%"
|
||||||
|
>
|
||||||
|
<div>
|
||||||
|
<el-checkbox v-model="basisData.newVersionRemark">{{ $t('commons.remark') }}</el-checkbox>
|
||||||
|
<el-checkbox v-model="basisData.newVersionDeps">{{ $t('commons.relationship.name') }}</el-checkbox>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<template v-slot:footer>
|
||||||
|
<ms-dialog-footer
|
||||||
|
@cancel="cancelCreateNewVersion"
|
||||||
|
:title="$t('commons.edit_info')"
|
||||||
|
@confirm="saveApi">
|
||||||
|
</ms-dialog-footer>
|
||||||
|
</template>
|
||||||
|
</el-dialog>
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
|
@ -71,17 +90,19 @@ import MsBasisParameters from "../request/dubbo/BasisParameters";
|
||||||
import MsChangeHistory from "../../../../history/ChangeHistory";
|
import MsChangeHistory from "../../../../history/ChangeHistory";
|
||||||
import ApiOtherInfo from "@/business/components/api/definition/components/complete/ApiOtherInfo";
|
import ApiOtherInfo from "@/business/components/api/definition/components/complete/ApiOtherInfo";
|
||||||
import {getCurrentUser, hasLicense} from "@/common/js/utils";
|
import {getCurrentUser, hasLicense} from "@/common/js/utils";
|
||||||
|
import DubboApiVersionDiff from "./version/DubboApiVersionDiff";
|
||||||
|
import {createComponent} from ".././jmeter/components";
|
||||||
|
import {TYPE_TO_C} from "@/business/components/api/automation/scenario/Setting";
|
||||||
|
import MsDialogFooter from "@/business/components/common/components/MsDialogFooter";
|
||||||
|
|
||||||
const requireComponent = require.context('@/business/components/xpack/', true, /\.vue$/);
|
const requireComponent = require.context('@/business/components/xpack/', true, /\.vue$/);
|
||||||
const versionHistory = requireComponent.keys().length > 0 ? requireComponent("./version/VersionHistory.vue") : {};
|
const versionHistory = requireComponent.keys().length > 0 ? requireComponent("./version/VersionHistory.vue") : {};
|
||||||
import DubboApiVersionDiff from "./version/DubboApiVersionDiff"
|
|
||||||
import {createComponent } from ".././jmeter/components";
|
|
||||||
const {Body} = require("@/business/components/api/definition/model/ApiTestModel");
|
const {Body} = require("@/business/components/api/definition/model/ApiTestModel");
|
||||||
import { TYPE_TO_C} from "@/business/components/api/automation/scenario/Setting";
|
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
name: "MsApiDubboRequestForm",
|
name: "MsApiDubboRequestForm",
|
||||||
components: {
|
components: {
|
||||||
|
MsDialogFooter,
|
||||||
ApiOtherInfo,
|
ApiOtherInfo,
|
||||||
MsBasisApi, MsBasisParameters, MsChangeHistory,
|
MsBasisApi, MsBasisParameters, MsChangeHistory,
|
||||||
'MsVersionHistory': versionHistory.default,
|
'MsVersionHistory': versionHistory.default,
|
||||||
|
@ -135,12 +156,13 @@ export default {
|
||||||
return {
|
return {
|
||||||
validated: false,
|
validated: false,
|
||||||
showFollow: false,
|
showFollow: false,
|
||||||
dialogVisible:false,
|
dialogVisible: false,
|
||||||
newShowFollow:false,
|
newShowFollow: false,
|
||||||
versionData: [],
|
versionData: [],
|
||||||
newData:{},
|
newData: {},
|
||||||
oldRequest:{},
|
oldRequest: {},
|
||||||
oldResponse:{}
|
oldResponse: {},
|
||||||
|
createNewVersionVisible: false,
|
||||||
};
|
};
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
|
@ -293,7 +315,10 @@ export default {
|
||||||
stepArray[i].clazzName = TYPE_TO_C.get(stepArray[i].type);
|
stepArray[i].clazzName = TYPE_TO_C.get(stepArray[i].type);
|
||||||
}
|
}
|
||||||
if (stepArray[i].type === "Assertions" && !stepArray[i].document) {
|
if (stepArray[i].type === "Assertions" && !stepArray[i].document) {
|
||||||
stepArray[i].document = {type: "JSON", data: {xmlFollowAPI: false, jsonFollowAPI: false, json: [], xml: []}};
|
stepArray[i].document = {
|
||||||
|
type: "JSON",
|
||||||
|
data: {xmlFollowAPI: false, jsonFollowAPI: false, json: [], xml: []}
|
||||||
|
};
|
||||||
}
|
}
|
||||||
if (stepArray[i].hashTree && stepArray[i].hashTree.length > 0) {
|
if (stepArray[i].hashTree && stepArray[i].hashTree.length > 0) {
|
||||||
this.sort(stepArray[i].hashTree);
|
this.sort(stepArray[i].hashTree);
|
||||||
|
@ -301,6 +326,10 @@ export default {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
cancelCreateNewVersion() {
|
||||||
|
this.createNewVersionVisible = false;
|
||||||
|
this.getVersionHistory();
|
||||||
|
},
|
||||||
checkout(row) {
|
checkout(row) {
|
||||||
let api = this.versionData.filter(v => v.versionId === row.id)[0];
|
let api = this.versionData.filter(v => v.versionId === row.id)[0];
|
||||||
if (api.tags && api.tags.length > 0) {
|
if (api.tags && api.tags.length > 0) {
|
||||||
|
@ -311,7 +340,13 @@ export default {
|
||||||
create(row) {
|
create(row) {
|
||||||
// 创建新版本
|
// 创建新版本
|
||||||
this.basisData.versionId = row.id;
|
this.basisData.versionId = row.id;
|
||||||
|
this.basisData.newVersionRemark = !!this.basisData.remark;
|
||||||
|
this.basisData.newVersionDeps = this.$refs.apiOtherInfo.relationshipCount > 0;
|
||||||
|
if (this.$refs.apiOtherInfo.relationshipCount > 0 || this.basisData.remark) {
|
||||||
|
this.createNewVersionVisible = true;
|
||||||
|
} else {
|
||||||
this.saveApi();
|
this.saveApi();
|
||||||
|
}
|
||||||
},
|
},
|
||||||
del(row) {
|
del(row) {
|
||||||
this.$alert(this.$t('api_test.definition.request.delete_confirm') + ' ' + row.name + " ?", '', {
|
this.$alert(this.$t('api_test.definition.request.delete_confirm') + ' ' + row.name + " ?", '', {
|
||||||
|
|
|
@ -43,7 +43,7 @@
|
||||||
<p class="tip">{{ $t('api_test.definition.request.req_param') }} </p>
|
<p class="tip">{{ $t('api_test.definition.request.req_param') }} </p>
|
||||||
<ms-basis-parameters :showScript="false" :request="request"/>
|
<ms-basis-parameters :showScript="false" :request="request"/>
|
||||||
|
|
||||||
<api-other-info :api="basisData"/>
|
<api-other-info :api="basisData" ref="apiOtherInfo"/>
|
||||||
|
|
||||||
<ms-change-history ref="changeHistory"/>
|
<ms-change-history ref="changeHistory"/>
|
||||||
|
|
||||||
|
@ -63,6 +63,25 @@
|
||||||
></s-q-l-api-version-diff>
|
></s-q-l-api-version-diff>
|
||||||
</el-dialog>
|
</el-dialog>
|
||||||
|
|
||||||
|
<el-dialog
|
||||||
|
:title="$t('commons.sync_other_info')"
|
||||||
|
:visible.sync="createNewVersionVisible"
|
||||||
|
:show-close="false"
|
||||||
|
width="30%"
|
||||||
|
>
|
||||||
|
<div>
|
||||||
|
<el-checkbox v-model="basisData.newVersionRemark">{{ $t('commons.remark') }}</el-checkbox>
|
||||||
|
<el-checkbox v-model="basisData.newVersionDeps">{{ $t('commons.relationship.name') }}</el-checkbox>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<template v-slot:footer>
|
||||||
|
<ms-dialog-footer
|
||||||
|
@cancel="cancelCreateNewVersion"
|
||||||
|
:title="$t('commons.edit_info')"
|
||||||
|
@confirm="saveApi">
|
||||||
|
</ms-dialog-footer>
|
||||||
|
</template>
|
||||||
|
</el-dialog>
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
|
@ -72,9 +91,10 @@ import MsBasisParameters from "../request/database/BasisParameters";
|
||||||
import MsChangeHistory from "../../../../history/ChangeHistory";
|
import MsChangeHistory from "../../../../history/ChangeHistory";
|
||||||
import ApiOtherInfo from "@/business/components/api/definition/components/complete/ApiOtherInfo";
|
import ApiOtherInfo from "@/business/components/api/definition/components/complete/ApiOtherInfo";
|
||||||
import {getCurrentUser, hasLicense} from "@/common/js/utils";
|
import {getCurrentUser, hasLicense} from "@/common/js/utils";
|
||||||
import SQLApiVersionDiff from "./version/SQLApiVersionDiff"
|
import SQLApiVersionDiff from "./version/SQLApiVersionDiff";
|
||||||
import {createComponent } from ".././jmeter/components";
|
import {createComponent} from ".././jmeter/components";
|
||||||
import { TYPE_TO_C} from "@/business/components/api/automation/scenario/Setting";
|
import {TYPE_TO_C} from "@/business/components/api/automation/scenario/Setting";
|
||||||
|
import MsDialogFooter from "@/business/components/common/components/MsDialogFooter";
|
||||||
|
|
||||||
const requireComponent = require.context('@/business/components/xpack/', true, /\.vue$/);
|
const requireComponent = require.context('@/business/components/xpack/', true, /\.vue$/);
|
||||||
const versionHistory = requireComponent.keys().length > 0 ? requireComponent("./version/VersionHistory.vue") : {};
|
const versionHistory = requireComponent.keys().length > 0 ? requireComponent("./version/VersionHistory.vue") : {};
|
||||||
|
@ -84,6 +104,7 @@ const {Body} = require("@/business/components/api/definition/model/ApiTestModel"
|
||||||
export default {
|
export default {
|
||||||
name: "MsApiSqlRequestForm",
|
name: "MsApiSqlRequestForm",
|
||||||
components: {
|
components: {
|
||||||
|
MsDialogFooter,
|
||||||
ApiOtherInfo,
|
ApiOtherInfo,
|
||||||
MsBasisApi, MsBasisParameters, MsChangeHistory,
|
MsBasisApi, MsBasisParameters, MsChangeHistory,
|
||||||
'MsVersionHistory': versionHistory.default,
|
'MsVersionHistory': versionHistory.default,
|
||||||
|
@ -123,12 +144,13 @@ export default {
|
||||||
return {
|
return {
|
||||||
validated: false,
|
validated: false,
|
||||||
showFollow: false,
|
showFollow: false,
|
||||||
dialogVisible:false,
|
dialogVisible: false,
|
||||||
newShowFollow:false,
|
newShowFollow: false,
|
||||||
versionData: [],
|
versionData: [],
|
||||||
newData:{},
|
newData: {},
|
||||||
oldRequest:{},
|
oldRequest: {},
|
||||||
oldResponse:{}
|
oldResponse: {},
|
||||||
|
createNewVersionVisible: false,
|
||||||
};
|
};
|
||||||
},
|
},
|
||||||
created() {
|
created() {
|
||||||
|
@ -299,7 +321,10 @@ export default {
|
||||||
stepArray[i].clazzName = TYPE_TO_C.get(stepArray[i].type);
|
stepArray[i].clazzName = TYPE_TO_C.get(stepArray[i].type);
|
||||||
}
|
}
|
||||||
if (stepArray[i].type === "Assertions" && !stepArray[i].document) {
|
if (stepArray[i].type === "Assertions" && !stepArray[i].document) {
|
||||||
stepArray[i].document = {type: "JSON", data: {xmlFollowAPI: false, jsonFollowAPI: false, json: [], xml: []}};
|
stepArray[i].document = {
|
||||||
|
type: "JSON",
|
||||||
|
data: {xmlFollowAPI: false, jsonFollowAPI: false, json: [], xml: []}
|
||||||
|
};
|
||||||
}
|
}
|
||||||
if (stepArray[i].hashTree && stepArray[i].hashTree.length > 0) {
|
if (stepArray[i].hashTree && stepArray[i].hashTree.length > 0) {
|
||||||
this.sort(stepArray[i].hashTree);
|
this.sort(stepArray[i].hashTree);
|
||||||
|
@ -307,6 +332,10 @@ export default {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
cancelCreateNewVersion() {
|
||||||
|
this.createNewVersionVisible = false;
|
||||||
|
this.getVersionHistory();
|
||||||
|
},
|
||||||
checkout(row) {
|
checkout(row) {
|
||||||
let api = this.versionData.filter(v => v.versionId === row.id)[0];
|
let api = this.versionData.filter(v => v.versionId === row.id)[0];
|
||||||
if (api.tags && api.tags.length > 0) {
|
if (api.tags && api.tags.length > 0) {
|
||||||
|
@ -316,9 +345,14 @@ export default {
|
||||||
},
|
},
|
||||||
create(row) {
|
create(row) {
|
||||||
// 创建新版本
|
// 创建新版本
|
||||||
|
|
||||||
this.basisData.versionId = row.id;
|
this.basisData.versionId = row.id;
|
||||||
|
this.basisData.newVersionRemark = !!this.basisData.remark;
|
||||||
|
this.basisData.newVersionDeps = this.$refs.apiOtherInfo.relationshipCount > 0;
|
||||||
|
if (this.$refs.apiOtherInfo.relationshipCount > 0 || this.basisData.remark) {
|
||||||
|
this.createNewVersionVisible = true;
|
||||||
|
} else {
|
||||||
this.saveApi();
|
this.saveApi();
|
||||||
|
}
|
||||||
},
|
},
|
||||||
del(row) {
|
del(row) {
|
||||||
this.$alert(this.$t('api_test.definition.request.delete_confirm') + ' ' + row.name + " ?", '', {
|
this.$alert(this.$t('api_test.definition.request.delete_confirm') + ' ' + row.name + " ?", '', {
|
||||||
|
|
|
@ -71,7 +71,7 @@
|
||||||
:request="request"/>
|
:request="request"/>
|
||||||
<!-- <api-response-component :currentProtocol="apiCase.request.protocol" :api-item="apiCase"/>-->
|
<!-- <api-response-component :currentProtocol="apiCase.request.protocol" :api-item="apiCase"/>-->
|
||||||
</div>
|
</div>
|
||||||
<api-other-info :api="basisData"/>
|
<api-other-info :api="basisData" ref="apiOtherInfo"/>
|
||||||
|
|
||||||
<ms-change-history ref="changeHistory"/>
|
<ms-change-history ref="changeHistory"/>
|
||||||
<el-dialog
|
<el-dialog
|
||||||
|
@ -94,6 +94,26 @@
|
||||||
:method-types="methodTypes"
|
:method-types="methodTypes"
|
||||||
></t-c-p-api-version-diff>
|
></t-c-p-api-version-diff>
|
||||||
</el-dialog>
|
</el-dialog>
|
||||||
|
|
||||||
|
<el-dialog
|
||||||
|
:title="$t('commons.sync_other_info')"
|
||||||
|
:visible.sync="createNewVersionVisible"
|
||||||
|
:show-close="false"
|
||||||
|
width="30%"
|
||||||
|
>
|
||||||
|
<div>
|
||||||
|
<el-checkbox v-model="basisData.newVersionRemark">{{ $t('commons.remark') }}</el-checkbox>
|
||||||
|
<el-checkbox v-model="basisData.newVersionDeps">{{ $t('commons.relationship.name') }}</el-checkbox>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<template v-slot:footer>
|
||||||
|
<ms-dialog-footer
|
||||||
|
@cancel="cancelCreateNewVersion"
|
||||||
|
:title="$t('commons.edit_info')"
|
||||||
|
@confirm="saveApi">
|
||||||
|
</ms-dialog-footer>
|
||||||
|
</template>
|
||||||
|
</el-dialog>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
</template>
|
</template>
|
||||||
|
@ -104,9 +124,10 @@ import MsTcpFormatParameters from "../request/tcp/TcpFormatParameters";
|
||||||
import MsChangeHistory from "../../../../history/ChangeHistory";
|
import MsChangeHistory from "../../../../history/ChangeHistory";
|
||||||
import {getCurrentProjectID, getCurrentUser, hasLicense} from "@/common/js/utils";
|
import {getCurrentProjectID, getCurrentUser, hasLicense} from "@/common/js/utils";
|
||||||
import ApiOtherInfo from "@/business/components/api/definition/components/complete/ApiOtherInfo";
|
import ApiOtherInfo from "@/business/components/api/definition/components/complete/ApiOtherInfo";
|
||||||
import TCPApiVersionDiff from "./version/TCPApiVersionDiff"
|
import TCPApiVersionDiff from "./version/TCPApiVersionDiff";
|
||||||
import {createComponent } from ".././jmeter/components";
|
import {createComponent} from ".././jmeter/components";
|
||||||
import { TYPE_TO_C} from "@/business/components/api/automation/scenario/Setting";
|
import {TYPE_TO_C} from "@/business/components/api/automation/scenario/Setting";
|
||||||
|
import MsDialogFooter from "@/business/components/common/components/MsDialogFooter";
|
||||||
|
|
||||||
const {Body} = require("@/business/components/api/definition/model/ApiTestModel");
|
const {Body} = require("@/business/components/api/definition/model/ApiTestModel");
|
||||||
const requireComponent = require.context('@/business/components/xpack/', true, /\.vue$/);
|
const requireComponent = require.context('@/business/components/xpack/', true, /\.vue$/);
|
||||||
|
@ -117,6 +138,7 @@ const versionHistory = requireComponent.keys().length > 0 ? requireComponent("./
|
||||||
export default {
|
export default {
|
||||||
name: "MsAddCompleteTcpApi",
|
name: "MsAddCompleteTcpApi",
|
||||||
components: {
|
components: {
|
||||||
|
MsDialogFooter,
|
||||||
ApiOtherInfo, MsTcpBasicApi, MsTcpFormatParameters, MsChangeHistory,
|
ApiOtherInfo, MsTcpBasicApi, MsTcpFormatParameters, MsChangeHistory,
|
||||||
"esbDefinition": esbDefinition.default,
|
"esbDefinition": esbDefinition.default,
|
||||||
"esbDefinitionResponse": esbDefinitionResponse.default,
|
"esbDefinitionResponse": esbDefinitionResponse.default,
|
||||||
|
@ -147,13 +169,13 @@ export default {
|
||||||
],
|
],
|
||||||
showXpackCompnent: false,
|
showXpackCompnent: false,
|
||||||
versionData: [],
|
versionData: [],
|
||||||
dialogVisible:false,
|
dialogVisible: false,
|
||||||
newShowFollow:false,
|
newShowFollow: false,
|
||||||
newData:{},
|
newData: {},
|
||||||
oldRequest:{},
|
oldRequest: {},
|
||||||
oldResponse:{},
|
oldResponse: {},
|
||||||
oldApiProtocol: "TCP",
|
oldApiProtocol: "TCP",
|
||||||
|
createNewVersionVisible: false,
|
||||||
};
|
};
|
||||||
},
|
},
|
||||||
created: function () {
|
created: function () {
|
||||||
|
@ -421,7 +443,10 @@ export default {
|
||||||
stepArray[i].clazzName = TYPE_TO_C.get(stepArray[i].type);
|
stepArray[i].clazzName = TYPE_TO_C.get(stepArray[i].type);
|
||||||
}
|
}
|
||||||
if (stepArray[i].type === "Assertions" && !stepArray[i].document) {
|
if (stepArray[i].type === "Assertions" && !stepArray[i].document) {
|
||||||
stepArray[i].document = {type: "JSON", data: {xmlFollowAPI: false, jsonFollowAPI: false, json: [], xml: []}};
|
stepArray[i].document = {
|
||||||
|
type: "JSON",
|
||||||
|
data: {xmlFollowAPI: false, jsonFollowAPI: false, json: [], xml: []}
|
||||||
|
};
|
||||||
}
|
}
|
||||||
if (stepArray[i].hashTree && stepArray[i].hashTree.length > 0) {
|
if (stepArray[i].hashTree && stepArray[i].hashTree.length > 0) {
|
||||||
this.sort(stepArray[i].hashTree);
|
this.sort(stepArray[i].hashTree);
|
||||||
|
@ -429,6 +454,10 @@ export default {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
cancelCreateNewVersion() {
|
||||||
|
this.createNewVersionVisible = false;
|
||||||
|
this.getVersionHistory();
|
||||||
|
},
|
||||||
checkout(row) {
|
checkout(row) {
|
||||||
let api = this.versionData.filter(v => v.versionId === row.id)[0];
|
let api = this.versionData.filter(v => v.versionId === row.id)[0];
|
||||||
if (api.tags && api.tags.length > 0) {
|
if (api.tags && api.tags.length > 0) {
|
||||||
|
@ -439,7 +468,13 @@ export default {
|
||||||
create(row) {
|
create(row) {
|
||||||
// 创建新版本
|
// 创建新版本
|
||||||
this.basisData.versionId = row.id;
|
this.basisData.versionId = row.id;
|
||||||
|
this.basisData.newVersionRemark = !!this.basisData.remark;
|
||||||
|
this.basisData.newVersionDeps = this.$refs.apiOtherInfo.relationshipCount > 0;
|
||||||
|
if (this.$refs.apiOtherInfo.relationshipCount > 0 || this.basisData.remark) {
|
||||||
|
this.createNewVersionVisible = true;
|
||||||
|
} else {
|
||||||
this.saveApi();
|
this.saveApi();
|
||||||
|
}
|
||||||
},
|
},
|
||||||
del(row) {
|
del(row) {
|
||||||
this.$alert(this.$t('api_test.definition.request.delete_confirm') + ' ' + row.name + " ?", '', {
|
this.$alert(this.$t('api_test.definition.request.delete_confirm') + ' ' + row.name + " ?", '', {
|
||||||
|
|
Loading…
Reference in New Issue