fix(测试跟踪): 测试计划-报告统计-编辑】 报告总结编辑时,输入超长内容,点击保存,页面数据显示不全

--bug=1027541 --user=白奇 【测试跟踪】github#25340,测试跟踪-测试计划-报告统计-编辑】 报告总结编辑时,输入超长内容,点击保存,页面数据显示不全 https://www.tapd.cn/55049933/s/1389207
This commit is contained in:
baiqi 2023-07-04 14:24:34 +08:00 committed by 刘瑞斌
parent d3423a1b9a
commit fbc23ebfcb

View File

@ -1,11 +1,18 @@
<template>
<test-plan-report-container id='summary' :title="$t('test_track.report.report_summary')">
<test-plan-report-container
id="summary"
:title="$t('test_track.report.report_summary')"
>
<template v-slot:title>
<el-link class="edit-link" v-if="showEdit && !isEdit" @click="isEdit = true">
<i class="el-icon-edit">{{ $t('commons.edit') }}</i>
<el-link
class="edit-link"
v-if="showEdit && !isEdit"
@click="isEdit = true"
>
<i class="el-icon-edit">{{ $t("commons.edit") }}</i>
</el-link>
<el-link class="edit-link" v-if="showEdit && isEdit" @click="saveSummary">
<i class="el-icon-circle-check">{{ $t('commons.save') }}</i>
<i class="el-icon-circle-check">{{ $t("commons.save") }}</i>
</el-link>
</template>
<el-form class="form-info" v-loading="loading">
@ -13,23 +20,22 @@
<div class="rich-text-content" v-html="report.summary"></div>
</div>
<div v-else>
<ms-rich-text :content.sync="report.summary"/>
<ms-rich-text :content.sync="report.summary" />
</div>
</el-form>
</test-plan-report-container>
</template>
<script>
import MsFormDivider from "metersphere-frontend/src/components/MsFormDivider";
import {editPlanReport} from "@/api/remote/plan/test-plan";
import { editPlanReport } from "@/api/remote/plan/test-plan";
import TestPlanReportContainer from "@/business/plan/view/comonents/report/detail/TestPlanReportContainer";
import MsRichText from "@/business/case/components/MsRichText";
import {testPlanDbReportEdit} from "@/api/remote/plan/test-plan-report";
import {hasPermission} from "@/business/utils/sdk-utils";
import { testPlanDbReportEdit } from "@/api/remote/plan/test-plan-report";
import { hasPermission } from "@/business/utils/sdk-utils";
export default {
name: "TestPlanSummaryReport",
components: {MsRichText, TestPlanReportContainer, MsFormDivider},
components: { MsRichText, TestPlanReportContainer, MsFormDivider },
props: {
planId: String,
report: Object,
@ -40,31 +46,35 @@ export default {
data() {
return {
loading: false,
isEdit: false
}
isEdit: false,
};
},
computed: {
showEdit() {
return !this.isTemplate && !this.isShare && hasPermission("PROJECT_TRACK_REPORT:READ+EDIT");
}
return (
!this.isTemplate &&
!this.isShare &&
hasPermission("PROJECT_TRACK_REPORT:READ+EDIT")
);
},
},
methods: {
saveSummary() {
if (this.isDb) {
testPlanDbReportEdit({
testPlanReportId: this.report.id,
summary: this.report.summary || ''
summary: this.report.summary || "",
});
} else {
editPlanReport({
id: this.planId,
reportSummary: this.report.summary || ''
reportSummary: this.report.summary || "",
});
}
this.isEdit = false;
}
}
}
},
},
};
</script>
<style scoped>
@ -82,9 +92,12 @@ export default {
margin-left: 10px;
}
.rich-text-content {
word-wrap: break-word;
}
.rich-text-content :deep(.table td) {
border: solid 1px #e6e6e6;
min-width: 2em;
padding: .4em;
padding: 0.4em;
}
</style>