<template>
  <el-dialog :title="'新增算法'" :close-on-click-modal="false" :visible.sync="visible">
    <el-form :model="dataForm" :rules="dataRule" ref="dataForm" @keyup.enter.native="dataFormSubmit()"
      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: "/normalalg-create" });
      } else {
        // 如果为智能算法
        this.$router.replace({ path: "/intelalg-create" });
      }
    },
  },
};
</script>
