|
|
@@ -50,6 +50,8 @@ const logoUrl = ref<string | undefined>(undefined)
|
|
|
const exporting = ref(false)
|
|
|
// 定时保存handler
|
|
|
const timeIntervalHandler = ref<number | null>(null)
|
|
|
+//报告状态
|
|
|
+const reportStatus = ref<number>(0)
|
|
|
|
|
|
function onMetaChange(data: ReportMetadataItem[]) {
|
|
|
metadata.value = data;
|
|
|
@@ -195,11 +197,23 @@ function onSaveTemplate(modalData: ReportTemplateModal) {
|
|
|
})
|
|
|
}
|
|
|
|
|
|
+function updateStatus() {
|
|
|
+ if (report.value) {
|
|
|
+ reportService.updateStatus(report.value.id)
|
|
|
+ getStatus();
|
|
|
+ }
|
|
|
+}
|
|
|
+
|
|
|
+function getStatus(){
|
|
|
+ reportStatus.value = reportStatus.value == 0 ? 1 : 0;
|
|
|
+}
|
|
|
+
|
|
|
onMounted(() => {
|
|
|
const id = parseInt(route.params.id as string);
|
|
|
if (id && id > 0) {
|
|
|
reportService.get(id).then((data) => {
|
|
|
report.value = data;
|
|
|
+ reportStatus.value = data.status
|
|
|
const chapters = report.value.chapters;
|
|
|
chapterManager.setChapters(chapters);
|
|
|
// 设置Logo信息
|
|
|
@@ -257,7 +271,11 @@ onUnmounted(() => {
|
|
|
</a-button>
|
|
|
</div>
|
|
|
<div class="bottom-button-group">
|
|
|
- <a-space>
|
|
|
+ <a-space v-if="report">
|
|
|
+ <a-checkbox @change="updateStatus()" :checked="reportStatus == 1">
|
|
|
+ <span v-if="reportStatus == 0">未完成</span>
|
|
|
+ <span v-if="reportStatus == 1">已完成</span>
|
|
|
+ </a-checkbox>
|
|
|
<a-button type="primary" @click="onSave" :loading="saveLoading">保存</a-button>
|
|
|
<a-button @click="onPreview">预览</a-button>
|
|
|
<a-button @click="onExport" :loading="exporting">导出</a-button>
|