|
|
@@ -6,7 +6,9 @@ import { CompLog } from "@/libs/log.lib";
|
|
|
import { ChapterManager } from "@/models/report.model";
|
|
|
import * as reportTemplateService from "@/services/reportTemplate.service"
|
|
|
import ReportTemplateName from "./components/ReportTemplateName.vue"
|
|
|
-import ReportTemplateLabel from "./components/ReportTemplateLabel.vue"
|
|
|
+import ReportTemplateLabel from "./components/ReportTemplateTags.vue"
|
|
|
+import RelationCompanyInput from '../report/components/report-create/RelationCompanyInput.vue';
|
|
|
+import ReportField from "../report/components/report-create/ReportField.vue"
|
|
|
import type { Chapter, ChapterType, ReportMetadataItem, ReportTemplateSave } from "@/types/report.types";
|
|
|
import { PlusOutlined } from "@ant-design/icons-vue";
|
|
|
import PageHeader from '@/components/PageHeader.vue';
|
|
|
@@ -79,6 +81,12 @@ function onSave() {
|
|
|
}
|
|
|
}
|
|
|
|
|
|
+function onCompanyChange(companyId: number) {
|
|
|
+ if (reportTemplate.value) {
|
|
|
+ reportTemplate.value.companyId = companyId;
|
|
|
+ }
|
|
|
+}
|
|
|
+
|
|
|
onMounted(() => {
|
|
|
const id = parseInt(route.params.id as string)
|
|
|
if (id) {
|
|
|
@@ -91,11 +99,13 @@ onMounted(() => {
|
|
|
<PageHeader title="报告模板编辑" />
|
|
|
<a-row :gutter="24" v-if="reportTemplate">
|
|
|
<a-col :span="12">
|
|
|
- <div class="metadata-wrap">
|
|
|
- <ReportTemplateName v-model="reportTemplate.name"></ReportTemplateName>
|
|
|
- <ReportTemplateLabel v-model="reportTemplate.tags"> </ReportTemplateLabel>
|
|
|
+ <a-space class="metadata-wrap" direction="vertical">
|
|
|
+ <ReportTemplateName v-model="reportTemplate.name" />
|
|
|
+ <ReportTemplateLabel v-model="reportTemplate.tags" />
|
|
|
+ <RelationCompanyInput v-model:id="reportTemplate.companyId" @change="onCompanyChange" ref="relationCompanyEl" />
|
|
|
+ <ReportField name="项目名称" v-model="reportTemplate.reportName" />
|
|
|
<DynamicMeta v-model:data="reportTemplate.metadata" @change="onMetaChange" />
|
|
|
- </div>
|
|
|
+ </a-space>
|
|
|
</a-col>
|
|
|
<a-col :span="12">
|
|
|
<LogoComponent />
|
|
|
@@ -129,6 +139,9 @@ onMounted(() => {
|
|
|
</template>
|
|
|
|
|
|
<style scoped lang="scss">
|
|
|
+.metadata-wrap {
|
|
|
+ width: 100%;
|
|
|
+}
|
|
|
|
|
|
.add-chapter-wrap {
|
|
|
margin-top: 3em;
|