index.vue 1.09 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
<template>
  <dee-as-com
    :lay-config="layConfig"
    :form="form"
    :dis-business="true"
    @submitEvent="submitEvent"
    @on-cancel="cancel"
  />
</template>
<script>
import { post } from '@/utils/http'
export default {
  name: 'DxPbAbilityResTemplateCreate',
  componentName: '能力指标模板创建(资源分类)',
  props: {
    extraBaseParams: {
      type: Object,
      default: () => {}
    }
  },
  data() {
    return {
      form: {},
      layConfig: {
        typeName: 'DxPbResAbilityLink',
        layKey: 'defaultCreate'
      }
    }
  },
  methods: {
    submitEvent() {
      const selectedData = this.form.dxPbAbilityDefine || []
      if (selectedData.length === 0) {
        this.$message.warning('至少选择一条数据')
        return false
      }
      const params = selectedData.map(item => {
        return {
          source: this.extraBaseParams,
          target: item
        }
      })
      post('/DxPbResAbilityLink/recursions', params).then(res => {
        this.$emit('completeEven')
      })
    },
    cancel() {
      this.$emit('cancel')
    }
  }

}
</script>