RelatedCA.vue 1.21 KB
<template>
  <dee-static-cmp
    :cmp-options="tableLayout"
    :result-data="tableData"
  />
</template>

<script>
import { get } from '@/utils/http'
export default {
  name: 'RelatedCA',
  displayName: '相关CA',
  modelRelationObjs: ['DxDocument', 'DxPart'],
  props: {
    modelName: {
      type: String,
      default: () => ''
    },
    basicData: {
      type: Object,
      default: () => null
    }
  },
  data() {
    return {
      tableLayout: {
        typeName: 'DxChangeActivity',
        value: 'RelatedCA'
      },
      tableData: []
    }
  },
  computed: {},
  watch: {
    basicData: {
      deep: true,
      handler: function() {
        this.getTableData()
      }
    }

  },
  // 生命周期 - 创建完成(访问当前this实例)
  created() {},
  // 生命周期 - 挂载完成(访问DOM元素)
  mounted() {
    if (this.basicData) {
      this.getTableData()
    }
  },
  methods: {
    getTableData() {
      if (!this.basicData) {
        return
      }
      const id = this.basicData.versionId
      get(`/DxChangeActivity/findByAfterAffectedId/${id}`).then(res => {
        this.tableData = res.items
      })
    }
  }
}
</script>
<style lang="scss">
/* @import url(); 引入css类 */

</style>