<template>
  <el-dialog :title="'新增度量'" :close-on-click-modal="false" :visible.sync="visible">
    <el-form :model="dataForm" ref ='dataForm'
      label-width="100px">
      <el-form-item label="步骤" size="mini">
        <el-radio-group v-model="datasetStatus">
          <el-radio :label="1">1.创建度量标准</el-radio>
          <el-radio :label="2">2.创建任务</el-radio>
        </el-radio-group>
      </el-form-item>
    </el-form>
    <span slot="footer" class="dialog-footer">
      <el-button @click="visible = false">取消</el-button>
      <el-button type="primary" @click="visible=false;creatDataSetHandle()">确定</el-button>
    </span>
  </el-dialog>
</template>

<script>
export default {
  data () {
    return {
      visible: false,
      datasetStatus: 1,
      dataForm: {}
    }
  },
  methods: {
    init () {
      this.visible = true
      this.$nextTick(() => {
        this.$refs.dataForm.resetFields()
      })
    },
    // 创建measure
    creatDataSetHandle () {
      // 如果为传统算法
      if (this.datasetStatus === 1) {
        this.$router.replace({ path: '/snoop-measure' })
      } else {
        // 如果为智能算法
        this.$router.replace({ path: '/snoop-job' })
      }
    }
  }
}
</script>
