fix(接口测试): 【接口测试】首次安装登录-密码提示信息导致页面展示重叠

--bug=1045600 --user=白奇 【接口测试】首次安装登录-密码提示信息导致页面展示重叠 https://www.tapd.cn/55049933/s/1567750
This commit is contained in:
baiqi 2024-08-22 16:13:27 +08:00 committed by 建国
parent 1c13d56d09
commit 10229b3bf2
6 changed files with 97 additions and 75 deletions

View File

@ -1,6 +1,6 @@
<template>
<ms-container v-if="isShow && !loading">
<ms-aside-container pageKey="API_EDIT_BASE_INFO" >
<ms-aside-container pageKey="API_EDIT_BASE_INFO">
<api-base-info
ref="apiBaseInfo"
:api-template="apiTemplate"
@ -10,8 +10,7 @@
:form="currentApi"
:is-form-alive="isFormAlive"
:maintainer-options="maintainerOptions"
:module-options="moduleOptions"
/>
:module-options="moduleOptions" />
</ms-aside-container>
<ms-main-container class="ms-api-main-container">
<el-button-group v-if="currentApi.id" style="z-index: 10; position: fixed">
@ -204,13 +203,17 @@ export default {
this.apiTemplate = template;
store.apiTemplate = this.apiTemplate;
if (this.currentApi.fields) {
this.currentApi.fields.forEach(i => {
this.currentApi.fields.forEach((i) => {
parseCustomFilesForItem(i);
});
}
this.customFieldForm = parseCustomField(this.currentApi, this.apiTemplate, this.customFieldRules);
});
if (this.currentApi.id && (this.currentProtocol === 'HTTP' || this.currentProtocol === 'TCP') && hasPermissions('PROJECT_API_DEFINITION:READ+MOCK')) {
if (
this.currentApi.id &&
(this.currentProtocol === 'HTTP' || this.currentProtocol === 'TCP') &&
hasPermissions('PROJECT_API_DEFINITION:READ+MOCK')
) {
this.mockSetting();
}
this.formatApi();
@ -378,11 +381,11 @@ export default {
this.currentValidateName = '';
return false;
}
if(this.currentApi.isCopy && this.apiTemplate && Array.isArray(this.apiTemplate.customFields)){
this.apiTemplate.customFields.forEach(item => {
if (this.currentApi.isCopy && this.apiTemplate && Array.isArray(this.apiTemplate.customFields)) {
this.apiTemplate.customFields.forEach((item) => {
delete item.isEdit;
delete item.hasParse;
})
});
}
buildCustomFields(this.currentApi, data, this.apiTemplate);
this.$refs.apiConfig.saveApi(data);
@ -531,10 +534,10 @@ export default {
}
:deep(.ms-opt-btn) {
position: fixed;
position: absolute;
z-index: 999;
right: 50px;
top: 85px;
top: 0;
float: right;
margin-right: 20px;
margin-top: 5px;

View File

@ -45,13 +45,21 @@
@compare="compare"
@checkout="checkout"
@create="create"
@del="del"/>
<el-button type="primary" size="small" @click="saveApi" :disabled="disableSaveBtn" v-prevent-re-click title="ctrl + s"
v-permission="[
'PROJECT_API_DEFINITION:READ+EDIT_API',
'PROJECT_API_DEFINITION:READ+CREATE_API',
'PROJECT_API_DEFINITION:READ+COPY_API'
]">{{ $t('commons.save') }}</el-button>
@del="del" />
<el-button
type="primary"
size="small"
@click="saveApi"
:disabled="disableSaveBtn"
v-prevent-re-click
title="ctrl + s"
v-permission="[
'PROJECT_API_DEFINITION:READ+EDIT_API',
'PROJECT_API_DEFINITION:READ+CREATE_API',
'PROJECT_API_DEFINITION:READ+COPY_API',
]"
>{{ $t('commons.save') }}</el-button
>
</div>
</el-col>
</el-row>
@ -99,7 +107,8 @@ import {
delDefinitionByRefId,
getDefinitionById,
getDefinitionByIdAndRefId,
getDefinitionVersions, updateDefinitionFollows,
getDefinitionVersions,
updateDefinitionFollows,
} from '@/api/definition';
import MsBasisApi from './BasisApi';
import MsBasisParameters from '../request/dubbo/BasisParameters';
@ -112,8 +121,8 @@ import { createComponent } from '.././jmeter/components';
import { TYPE_TO_C } from '@/business/automation/scenario/Setting';
import MsDialogFooter from 'metersphere-frontend/src/components/MsDialogFooter';
import { useApiStore } from '@/store';
import {apiTestCaseCount} from '@/api/api-test-case';
import {getDefaultVersion, setLatestVersionById} from 'metersphere-frontend/src/api/version';
import { apiTestCaseCount } from '@/api/api-test-case';
import { getDefaultVersion, setLatestVersionById } from 'metersphere-frontend/src/api/version';
const store = useApiStore();
const { Body } = require('@/business/definition/model/ApiTestModel');
@ -185,7 +194,7 @@ export default {
createNewVersionVisible: false,
latestVersionId: '',
hasLatest: false,
disableSaveBtn: false
disableSaveBtn: false,
};
},
methods: {
@ -246,11 +255,10 @@ export default {
}
},
getDefaultVersion() {
getDefaultVersion(this.basisData.projectId)
.then(response => {
this.latestVersionId = response.data;
this.getVersionHistory();
});
getDefaultVersion(this.basisData.projectId).then((response) => {
this.latestVersionId = response.data;
this.getVersionHistory();
});
},
getVersionHistory() {
getDefinitionVersions(this.basisData.id).then((response) => {
@ -261,7 +269,7 @@ export default {
}
let latestVersionData = response.data.filter((v) => v.versionId === this.latestVersionId);
if (latestVersionData.length > 0) {
this.hasLatest = false
this.hasLatest = false;
} else {
this.hasLatest = true;
}
@ -438,14 +446,13 @@ export default {
projectId: this.basisData.projectId,
type: 'API',
versionId: row.id,
resourceId: this.basisData.id
}
resourceId: this.basisData.id,
};
setLatestVersionById(param).then(() => {
this.$success(this.$t('commons.modify_success'));
this.checkout(row);
});
},
},
computed: {},
@ -454,9 +461,9 @@ export default {
<style scoped>
.ms-opt-btn {
position: fixed;
position: absolute;
right: 0px !important;
z-index: 120;
top: 85px;
top: 0;
}
</style>

View File

@ -54,10 +54,10 @@
v-prevent-re-click
title="ctrl + s"
v-permission="[
'PROJECT_API_DEFINITION:READ+EDIT_API',
'PROJECT_API_DEFINITION:READ+CREATE_API',
'PROJECT_API_DEFINITION:READ+COPY_API'
]"
'PROJECT_API_DEFINITION:READ+EDIT_API',
'PROJECT_API_DEFINITION:READ+CREATE_API',
'PROJECT_API_DEFINITION:READ+COPY_API',
]"
>{{ $t('commons.save') }}
</el-button>
<el-dropdown
@ -1156,9 +1156,7 @@ export default {
if (!this.basisData.environmentId) {
this.basisData.environmentId = '';
}
if (this.basisData.moduleId &&
this.basisData.moduleId === 'default-module' &&
this.moduleOptions) {
if (this.basisData.moduleId && this.basisData.moduleId === 'default-module' && this.moduleOptions) {
this.basisData.moduleId = this.moduleOptions[0].id;
}
if (this.basisData.isCopy) {
@ -1208,13 +1206,13 @@ export default {
}
.ms-opt-btn {
position: fixed;
position: absolute;
right: 10px !important;
z-index: 9999;
top: 85px;
top: 0;
float: right;
margin-right: 20px;
margin-top: 5px
margin-top: 5px;
}
/*.base-info .el-form-item :deep(.el-form-item__content) {*/

View File

@ -46,12 +46,20 @@
@create="create"
@setLatest="setLatest"
@del="del" />
<el-button type="primary" size="small" @click="saveApi" title="ctrl + s" :disabled="disableSaveBtn" v-prevent-re-click
v-permission="[
'PROJECT_API_DEFINITION:READ+EDIT_API',
'PROJECT_API_DEFINITION:READ+CREATE_API',
'PROJECT_API_DEFINITION:READ+COPY_API'
]">{{ $t('commons.save') }}</el-button>
<el-button
type="primary"
size="small"
@click="saveApi"
title="ctrl + s"
:disabled="disableSaveBtn"
v-prevent-re-click
v-permission="[
'PROJECT_API_DEFINITION:READ+EDIT_API',
'PROJECT_API_DEFINITION:READ+CREATE_API',
'PROJECT_API_DEFINITION:READ+COPY_API',
]"
>{{ $t('commons.save') }}</el-button
>
</div>
</el-col>
</el-row>
@ -108,15 +116,15 @@ import MsBasisApi from './BasisApi';
import MsBasisParameters from '../request/database/BasisParameters';
import MsChangeHistory from '@/business/history/ApiHistory';
import ApiOtherInfo from '@/business/definition/components/complete/ApiOtherInfo';
import {getCurrentProjectID, getCurrentUser} from 'metersphere-frontend/src/utils/token';
import {hasLicense} from 'metersphere-frontend/src/utils/permission';
import { getCurrentProjectID, getCurrentUser } from 'metersphere-frontend/src/utils/token';
import { hasLicense } from 'metersphere-frontend/src/utils/permission';
import SQLApiVersionDiff from './version/SQLApiVersionDiff';
import { createComponent } from '.././jmeter/components';
import { TYPE_TO_C } from '@/business/automation/scenario/Setting';
import MsDialogFooter from 'metersphere-frontend/src/components/MsDialogFooter';
import { useApiStore } from '@/store';
import {apiTestCaseCount} from '@/api/api-test-case';
import {getDefaultVersion, setLatestVersionById} from 'metersphere-frontend/src/api/version';
import { apiTestCaseCount } from '@/api/api-test-case';
import { getDefaultVersion, setLatestVersionById } from 'metersphere-frontend/src/api/version';
const store = useApiStore();
const { Body } = require('@/business/definition/model/ApiTestModel');
@ -174,7 +182,7 @@ export default {
createNewVersionVisible: false,
latestVersionId: '',
hasLatest: false,
disableSaveBtn: false
disableSaveBtn: false,
};
},
created() {
@ -256,11 +264,10 @@ export default {
}
},
getDefaultVersion() {
getDefaultVersion(getCurrentProjectID())
.then(response => {
this.latestVersionId = response.data;
this.getVersionHistory();
});
getDefaultVersion(getCurrentProjectID()).then((response) => {
this.latestVersionId = response.data;
this.getVersionHistory();
});
},
getVersionHistory() {
getDefinitionVersions(this.basisData.id).then((response) => {
@ -271,7 +278,7 @@ export default {
}
let latestVersionData = response.data.filter((v) => v.versionId === this.latestVersionId);
if (latestVersionData.length > 0) {
this.hasLatest = false
this.hasLatest = false;
} else {
this.hasLatest = true;
}
@ -450,23 +457,22 @@ export default {
projectId: getCurrentProjectID(),
type: 'API',
versionId: row.id,
resourceId: this.basisData.id
}
resourceId: this.basisData.id,
};
setLatestVersionById(param).then(() => {
this.$success(this.$t('commons.modify_success'));
this.checkout(row);
});
},
},
};
</script>
<style scoped>
.ms-opt-btn {
position: fixed;
position: absolute;
right: 10px !important;
z-index: 120;
top: 85px;
top: 0;
}
</style>

View File

@ -46,12 +46,20 @@
@create="create"
@setLatest="setLatest"
@del="del" />
<el-button type="primary" size="small" @click="saveApi" title="ctrl + s" :disabled="disableSaveBtn" v-prevent-re-click
v-permission="[
'PROJECT_API_DEFINITION:READ+EDIT_API',
'PROJECT_API_DEFINITION:READ+CREATE_API',
'PROJECT_API_DEFINITION:READ+COPY_API'
]">{{ $t('commons.save') }}</el-button>
<el-button
type="primary"
size="small"
@click="saveApi"
title="ctrl + s"
:disabled="disableSaveBtn"
v-prevent-re-click
v-permission="[
'PROJECT_API_DEFINITION:READ+EDIT_API',
'PROJECT_API_DEFINITION:READ+CREATE_API',
'PROJECT_API_DEFINITION:READ+COPY_API',
]"
>{{ $t('commons.save') }}</el-button
>
</div>
</el-col>
</el-row>
@ -172,7 +180,7 @@ export default {
createNewVersionVisible: false,
latestVersionId: '',
hasLatest: false,
disableSaveBtn: false
disableSaveBtn: false,
};
},
created: function () {
@ -525,9 +533,9 @@ export default {
}
.ms-opt-btn {
position: fixed;
position: absolute;
right: 10px !important;
z-index: 120;
top: 85px;
top: 0;
}
</style>

View File

@ -81,11 +81,11 @@
v-else
style="
margin-top: 5px;
position: fixed;
position: absolute;
float: right;
margin-right: 0px;
margin-left: 400px;
top: 90px;
top: 0;
right: 40px;
"
v-show="!isTemplate">