RepoBucketAppTable.vue 1.71 KB
Newer Older
wangdanlei's avatar
wangdanlei committed
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 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90
/**
* @Description: 文件服务-存储库关联应用列表
* @author wx
* @date 2021/10/29
*/
<template>
  <div>
    <dee-table
      ref="multipleTable"
      :index-row="indexRow"
      :columns="tableColums"
      :data="tableData"
      tooltip-effect="light"
    />
  </div>
</template>
<script>
import { getAppList } from '@/api/model'
export default {
  name: 'RepoBucketAppTableVue',
  displayName: '关联应用列表',
  modelRelationObjs: ['RepoBucket'],
  components: { },
  props: {
    basicData: {
      type: Object,
      default: () => null
    },
    permissions: {
      type: [Object, Array],
      default: () => null
    }
  },
  data() {
    return {
      index: 0,
      indexRow: {
        title: '序号',
        align: 'center',
        width: '70'
      },
      tableColums: [
        { title: '业务域id', key: 'id', align: 'center', hideTip: true, minWidth: 110 },
        { title: '业务域名称', key: 'displayName', align: 'center', hideTip: true, minWidth: 260 }
      ],
      tableData: []
    }
  },
  computed: {

  },
  watch: {
    basicData: {
      immediate: true,
      deep: true,
      handler: function(val) {
        if (val && val.id) {
          this.index++
          this.getTableData()
        }
      }
    }

  },
  created() {

  },
  mounted() {
  },
  methods: {
    getTableData() {
      const arr = this.basicData.bizDomain ? this.basicData.bizDomain.split(',') : []
      getAppList().then(res => {
        this.tableData = []
        res.items.forEach((el) => {
          arr.forEach((r) => {
            if (el.id + '' === r + '') {
              this.tableData.push(el)
            }
          })
        })
      })
    }
  }
}
</script>

<style lang="scss" >

</style>