1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
| <template>
| <div class="form-index-container">
| <el-card class="header-container">
| <el-row align="middle" type="flex" :gutter="5" style="height: 50px">
| <i class="el-icon-back" @click="$router.back(-2)" />
| <el-col />
| <el-button type="primary" icon="el-icon-view" @click="previewDialogVisible = true"> 预览 </el-button>
| </el-row>
| </el-card>
|
| <FormDesign :question-mode="true" />
|
| <el-dialog :visible.sync="previewDialogVisible" :before-close="handleClose">
| <pre-view :key="previewKey" :preview-qrcode="true" />
| </el-dialog>
| </div>
| </template>
| <script>
| import TduckForm, { FormDesign } from "tduck-form-generator";
| import "tduck-form-generator/dist/TduckForm.css";
| import mixin from "./TduckFormMixin.js";
| import PreView from './preview'
|
| export default {
| inject: ["reload"],
| name: "FormEditor",
| components: {
| FormDesign,
| PreView
| },
| mixins: [mixin],
| data() {
| return {
| previewDialogVisible: false,
| previewKey: +new Date(),
| };
| },
| computed: {},
| methods: {
| handleClose() {
| this.reload();
| this.previewDialogVisible = false;
| },
| },
| };
| </script>
|
| <style lang='scss'>
| </style>
|
|