<template>
  <el-dialog :title="'新增数据集'" :close-on-click-modal="false" :visible.sync="visible">
<!--    <el-form :model="dataForm" :rules="dataRule" ref="dataForm" @keyup.enter.native="dataFormSubmit()"   -->
    <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">静态数据集</el-radio>
          <el-radio :label="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()
      })
    },
    // 创建数据集处理函数
    creatDataSetHandle () {
      // 如果为静态数据集
      if (this.datasetStatus === 1) {
        this.$router.replace({ path: '/datasetstatus1-create' })
      } else {
        // 如果为动态数据集
        this.$router.replace({ path: '/datasetstatus2-create' })
      }
    }
  }
}
</script>
