123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150 |
- <template>
- <div id="dataInfo">
- <el-row>
- <el-col :span="24" class="main">
- <el-col :span="24" class="top">
- <el-button type="primary" size="mini" @click="download">PDF下载</el-button>
- <el-button type="primary" size="mini" @click="back">返回</el-button>
- </el-col>
- <el-col :span="24" class="down">
- <div id="demo">
- <el-col :span="24" class="common one">
- <one :form="form"></one>
- </el-col>
- <el-col :span="24" class="common two">
- <two :form="form"></two>
- </el-col>
- <el-col :span="24" class="common thr">
- <thr :form="form"></thr>
- </el-col>
- <el-col :span="24" class="common four">
- <four :form="form"></four>
- </el-col>
- <el-col :span="24" class="common five">
- <five :form="form"></five>
- </el-col>
- <el-col :span="24" class="common six">
- <six :form="form"></six>
- </el-col>
- <el-col :span="24" class="common seven">
- <seven :form="form"></seven>
- </el-col>
- <el-col :span="24" class="common eight">
- <eight :form="form"></eight>
- </el-col>
- </div>
- </el-col>
- </el-col>
- </el-row>
- </div>
- </template>
- <script>
- import one from './infoParts/one.vue';
- import two from './infoParts/two.vue';
- import thr from './infoParts/thr.vue';
- import four from './infoParts/four.vue';
- import five from './infoParts/five.vue';
- import six from './infoParts/six.vue';
- import seven from './infoParts/seven.vue';
- import eight from './infoParts/eight.vue';
- import htmlToPdf from '@/unit/htmlToPdf.js';
- import { mapState, createNamespacedHelpers } from 'vuex';
- const { mapActions: achieveApply } = createNamespacedHelpers('achieveApply');
- export default {
- name: 'dataInfo',
- props: {},
- // components: { one, two, thr, four, five, six, seven, eight },
- components: { one, two, thr, four, five, six, seven, eight },
- data: function() {
- return {
- form: {
- // 基本信息
- basic: {},
- // 信息简介
- brief: {},
- // 参加人员
- research: [],
- // 图片
- file: {},
- },
- };
- },
- async created() {
- await this.search();
- },
- methods: {
- ...achieveApply(['fetch', 'update']),
- async search() {
- if (this.id) {
- let res = await this.fetch(this.id);
- if (this.$checkRes(res)) {
- console.log(res.data);
- this.$set(this, 'form', res.data);
- }
- }
- },
- // PDF下载
- download() {
- htmlToPdf.downloadPDF(document.querySelector('#demo'), '测试');
- },
- // 返回
- back() {
- this.$router.push({ path: '/adminCate' });
- },
- },
- computed: {
- ...mapState(['user']),
- id() {
- return this.$route.query.id;
- },
- },
- metaInfo() {
- return { title: this.$route.meta.title };
- },
- watch: {
- test: {
- deep: true,
- immediate: true,
- handler(val) {},
- },
- },
- };
- </script>
- <style lang="less" scoped>
- .main {
- .top {
- text-align: center;
- margin: 0 0 15px 0;
- }
- .down {
- padding: 0 20%;
- #demo {
- width: 100%;
- height: 11108px;
- border: 1px solid #ff0000;
- .one {
- padding: 0;
- }
- .two {
- height: 1389px;
- padding: 60px 30px;
- }
- .thr {
- height: 1390px;
- padding: 60px 30px;
- }
- .four {
- height: 1389px;
- }
- }
- }
- }
- .common {
- width: 100%;
- height: 1388px;
- border-bottom: 1px solid #666666;
- padding: 40px 20px;
- }
- </style>
|