fix(接口自动化): 修复接口复制重复保存问题;优化操作日志页面

--bug=1007956 --user=赵勇 【接口测试】复制接口后多次点保存会提示接口地址已存在 https://www.tapd.cn/55049933/s/1068905
This commit is contained in:
fit2-zhao 2021-11-17 11:28:33 +08:00 committed by fit2-zhao
parent 095cdd5baa
commit e8337b7ffa
4 changed files with 301 additions and 311 deletions

View File

@ -57,7 +57,7 @@
left join `user` t1 ON t.user_id = t1.id left join `user` t1 ON t.user_id = t1.id
left join test_resource_pool t2 on t.actuator = t2.id left join test_resource_pool t2 on t.actuator = t2.id
left join api_test_case t4 on t4.id = t.resource_id left join api_test_case t4 on t4.id = t.resource_id
where t4.id=#{id} and t.content != "" LIMIT 5; where t4.id=#{id} and t.content != "" order by t.create_time desc LIMIT 5;
</select> </select>
<select id="getScenario" resultType="io.metersphere.task.dto.TaskCenterDTO" parameterType="java.lang.String"> <select id="getScenario" resultType="io.metersphere.task.dto.TaskCenterDTO" parameterType="java.lang.String">

View File

@ -115,7 +115,6 @@
}, },
addListener() { addListener() {
document.addEventListener("keydown", this.createCtrlSHandle); document.addEventListener("keydown", this.createCtrlSHandle);
// document.addEventListener("keydown", (even => handleCtrlSEvent(even, this.$refs.httpApi.saveApi)));
}, },
removeListener() { removeListener() {
document.removeEventListener("keydown", this.createCtrlSHandle); document.removeEventListener("keydown", this.createCtrlSHandle);
@ -123,14 +122,11 @@
createCtrlSHandle(event) { createCtrlSHandle(event) {
if (this.$refs.httpApi) { if (this.$refs.httpApi) {
handleCtrlSEvent(event, this.$refs.httpApi.saveApi); handleCtrlSEvent(event, this.$refs.httpApi.saveApi);
} } else if (this.$refs.tcpApi) {
else if (this.$refs.tcpApi) {
handleCtrlSEvent(event, this.$refs.tcpApi.saveApi); handleCtrlSEvent(event, this.$refs.tcpApi.saveApi);
} } else if (this.$refs.dubboApi) {
else if (this.$refs.dubboApi) {
handleCtrlSEvent(event, this.$refs.dubboApi.saveApi); handleCtrlSEvent(event, this.$refs.dubboApi.saveApi);
} } else if (this.$refs.sqlApi) {
else if (this.$refs.sqlApi) {
handleCtrlSEvent(event, this.$refs.sqlApi.saveApi); handleCtrlSEvent(event, this.$refs.sqlApi.saveApi);
} }
}, },
@ -271,14 +267,11 @@
handleSave() { handleSave() {
if (this.$refs.httpApi) { if (this.$refs.httpApi) {
this.$refs.httpApi.saveApi(); this.$refs.httpApi.saveApi();
} } else if (this.$refs.tcpApi) {
else if (this.$refs.tcpApi) {
this.$refs.tcpApi.saveApi(); this.$refs.tcpApi.saveApi();
} } else if (this.$refs.dubboApi) {
else if (this.$refs.dubboApi) {
this.$refs.dubboApi.saveApi(); this.$refs.dubboApi.saveApi();
} } else if (this.$refs.sqlApi) {
else if (this.$refs.sqlApi) {
this.$refs.sqlApi.saveApi(); this.$refs.sqlApi.saveApi();
} }
}, },
@ -318,10 +311,7 @@
if (param.files) { if (param.files) {
param.files.forEach(item => { param.files.forEach(item => {
if (item.file) { if (item.file) {
// let fileId = getUUID().substring(0, 8);
item.name = item.file.name; item.name = item.file.name;
// item.id = fileId;
// data.bodyUploadIds.push(fileId);
bodyUploadFiles.push(item.file); bodyUploadFiles.push(item.file);
} }
}); });

View File

@ -249,6 +249,7 @@ export default {
} }
} }
Object.assign(this.currentApi, data); Object.assign(this.currentApi, data);
this.currentApi.isCopy = false;
this.mockSetting(); this.mockSetting();
this.reload(); this.reload();
}, },

View File

@ -84,7 +84,6 @@
</el-row> </el-row>
</el-form> </el-form>
</div> </div>
</template> </template>
<el-table border class="adjust-table" :data="tableData" ref="operLog" <el-table border class="adjust-table" :data="tableData" ref="operLog"
:height="screenHeight"> :height="screenHeight">
@ -149,7 +148,7 @@ export default {
condition: {}, condition: {},
tableData: [], tableData: [],
userList: [], userList: [],
screenHeight: 'calc(100vh - 215px)', screenHeight: 'calc(100vh - 270px)',
LOG_TYPE: new LOG_TYPE(this), LOG_TYPE: new LOG_TYPE(this),
LOG_TYPE_MAP: new LOG_TYPE_MAP(this), LOG_TYPE_MAP: new LOG_TYPE_MAP(this),
sysList: sysList, sysList: sysList,