|
@@ -277,6 +277,7 @@
|
|
|
v-model="curPaperTemp"
|
|
|
placeholder="请选择试卷模板"
|
|
|
value-key="id"
|
|
|
+ @change="paperTempChange"
|
|
|
>
|
|
|
<el-option
|
|
|
v-for="item in paperTempList"
|
|
@@ -310,6 +311,12 @@
|
|
|
</el-select>
|
|
|
</el-form-item>
|
|
|
</el-form>
|
|
|
+ <paper-build-config
|
|
|
+ v-if="exportModel.exportContent === 'PAPER'"
|
|
|
+ ref="PaperBuildConfig"
|
|
|
+ :config-sources="configSources"
|
|
|
+ :show-confirm-btn="false"
|
|
|
+ ></paper-build-config>
|
|
|
<div slot="footer">
|
|
|
<el-button
|
|
|
type="primary"
|
|
@@ -397,6 +404,7 @@
|
|
|
</template>
|
|
|
|
|
|
<script>
|
|
|
+import PaperBuildConfig from "../../paper-export/components/PaperBuildConfig.vue";
|
|
|
import { QUESTION_API } from "@/constants/constants";
|
|
|
import { LEVEL_TYPE, PUBLICITY_LIST } from "../constants/constants";
|
|
|
import { mapState } from "vuex";
|
|
@@ -405,8 +413,12 @@ import {
|
|
|
paperTemplateListApi,
|
|
|
paperPdfDownloadApi,
|
|
|
} from "../../paper-export/api";
|
|
|
+import { deepCopy } from "@/plugins/utils";
|
|
|
|
|
|
export default {
|
|
|
+ components: {
|
|
|
+ PaperBuildConfig,
|
|
|
+ },
|
|
|
data() {
|
|
|
return {
|
|
|
templateList: [],
|
|
@@ -476,6 +488,8 @@ export default {
|
|
|
downloading: false,
|
|
|
curPaperTemp: null,
|
|
|
paperTempList: [],
|
|
|
+ configSources: [],
|
|
|
+ configModalForm: {},
|
|
|
};
|
|
|
},
|
|
|
computed: {
|
|
@@ -987,12 +1001,49 @@ export default {
|
|
|
const res = await paperTemplateListApi("PAPER_EXPORT");
|
|
|
this.paperTempList = res.data;
|
|
|
},
|
|
|
- toDownloadPaperPdf() {
|
|
|
+ paperTempChange(paperTemp) {
|
|
|
+ // console.log(paperTemp);
|
|
|
+ let paperTempJson = paperTemp.content
|
|
|
+ ? JSON.parse(paperTemp.content)
|
|
|
+ : { pages: [], pageConfig: {} };
|
|
|
+ this.getConfigSources(paperTempJson.pages);
|
|
|
+ },
|
|
|
+ getConfigSources(pages) {
|
|
|
+ let sources = [],
|
|
|
+ fieldAble = {};
|
|
|
+ pages.forEach((page) => {
|
|
|
+ page.columns.forEach((column) => {
|
|
|
+ column.elements.forEach((element) => {
|
|
|
+ if (element.type !== "PAPER_PROPS") return;
|
|
|
+ if (!sources.length) {
|
|
|
+ sources = deepCopy(element.props);
|
|
|
+ }
|
|
|
+ element.props.forEach((prop) => {
|
|
|
+ fieldAble[prop.field] = fieldAble[prop.field] || prop.enable;
|
|
|
+ });
|
|
|
+ });
|
|
|
+ });
|
|
|
+ });
|
|
|
+
|
|
|
+ sources.forEach((item) => {
|
|
|
+ item.enable = fieldAble[item.field];
|
|
|
+ });
|
|
|
+ this.configSources = sources;
|
|
|
+ },
|
|
|
+ async toDownloadPaperPdf() {
|
|
|
+ const valid = await this.$refs.PaperBuildConfig.checkData().catch(
|
|
|
+ () => {}
|
|
|
+ );
|
|
|
+ if (!valid) return;
|
|
|
+
|
|
|
if (this.downloading) return;
|
|
|
this.downloading = true;
|
|
|
+
|
|
|
+ const configModalForm = this.$refs.PaperBuildConfig.getData();
|
|
|
window.paperSet = {
|
|
|
paperTemp: this.curPaperTemp,
|
|
|
seqMode: this.exportModel.seqMode,
|
|
|
+ configModalForm,
|
|
|
};
|
|
|
const url = this.getRouterPath({
|
|
|
name: "PaperTemplateBuild",
|