<template>
  <div class="view-print">
    <div class="print-wrap">
      <form_normalform
        :openParams="params"
        v-if="hackReset"
        @openNewpage="doAction"
        @add-tab="doAction"
      />
      <!-- <view_delegate :openParams="{appId:$route.query.appId, actionContent: $route.query.actionContent}" :showtype="$route.query.opentarget"/> -->
      <!-- {{$route.query}} -->
    </div>
  </div>
</template>

<script>
import form_normalform from "@/components/form_normalform.vue";
export default {
  props: [
  ],
  components: {
    form_normalform,  
  },
  data: function() {
    return {
      view:'',
      params:'',
      hackReset: true,
    };
  },
  created() {
    let op = this.$route.query;
    this.doAction(op);
  },
  mounted(){
    
  },
  computed: {
  
  },
  methods: {
    doAction: function(params) {
      // this.paramsHistory.push(params);
      this.params = params;
      if(params.isCurrentPageOpen) { //当是按钮为当前页打开时重新刷新页面加载数据，是视图按钮，或者表单按钮
        this.hackReset = false
        this.$nextTick(() => {
          this.hackReset = true
        })
      }
    },
    getviewData() {
      let appId = this.$route.query.appId;
      let obj = {
            appId,
            viewId: this.$route.query.actionContent,
            test: this.$route.query.paramValue,
            containTitle: this.$route.query.name,
          };
      if(this.$route.query.paramKey) {
        obj[this.$route.query.paramKey] = this.$route.query.paramValue;
      }
    },
  }
}
</script>

<style lang="scss">
  .view-print {
    background: #ffffff;
  }
</style>
