quanwei
3 days ago 04102f7237efefa744090ed7c25f7b5d0807b679
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
50
51
52
53
54
55
56
57
58
59
60
61
<template>
  <el-dialog title="表单详情" :visible.sync="dialogVisible" @close="dialogFormVisible" width="50%">
      <el-form size="small">
        <el-form-item label="表单名称:">
          <span class="gray">{{detail.tableM.name}}</span>
        </el-form-item>
        <el-form-item :label="item.name + ':'" v-for="(item,index) in detail.tableData" :key="index">
          <span class="gray" v-if="item.type!='image'">{{item.value}}</span>
          <a :href="item.value" target="_blank">
            <img v-if="item.type=='image'" :src="item.value" width="160" height="160"></img>
          </a>
        </el-form-item>
      </el-form>
    </el-dialog>
</template>
 
<script>
  import TableApi from '@/api/table.js';
  export default {
    data() {
      return {
        detail: {},
        /*是否显示*/
        dialogVisible: false,
        /*结果类别*/
        type: 'error',
      }
    },
    props: ['showTableRecord', 'table_record_id'],
    watch: {
      showTableRecord: function(n, o) {
        if (n != o) {
          this.dialogVisible = n;
           this.getData();
        }
      },
    },
    created() {
      
    },
    methods: {
      getData(){
        let self = this;
        TableApi.getDetail({table_record_id: self.table_record_id}, true)
          .then(res => {
              console.log(res);
            self.detail = res.data.detail;
          })
          .catch(error => {});
      },
      /*关闭弹窗*/
      dialogFormVisible(flag) {
        this.$emit('closeDialog', false);
      },
    }
  }
</script>
 
<style>
 
</style>