<template>

  <el-dialog :title=" '条件节点'" :close-on-click-modal="false" :visible.sync="visible">
    <el-form :model="conditionForm"  ref="conditionForm" @keyup.enter.native="dataFormSubmit()"
      label-width="80px" >
      <el-form-item label="输入条件" prop="inputcondition">
        <el-input v-model="conditionForm.inputcondition" placeholder="请输入条件" ></el-input>
      </el-form-item>
      <!-- <el-form-item label="密码" prop="password" :class="{ 'is-required': !dataForm.id }">
        <el-input v-model="dataForm.password" type="password" placeholder="密码"></el-input>
      </el-form-item>
      <el-form-item label="确认密码" prop="comfirmPassword" :class="{ 'is-required': !dataForm.id }">
        <el-input v-model="dataForm.comfirmPassword" type="password" placeholder="确认密码"></el-input>
      </el-form-item> -->

      <!-- <el-form-item label="手机号" prop="mobile">
        <el-input v-model="dataForm.mobile" placeholder="手机号"></el-input>
      </el-form-item> -->
      <el-form-item label="参数列表" size="mini" prop="sourcedatalist">
        <el-radio-group v-model="conditionForm.sourcedatalist">
          <el-radio v-for="sourcedata in sourcedatalist" :key="sourcedata.name" :label="sourcedata.name">{{ sourcedata.name }}
            <!-- 此处的sourcedatalist  为   下方this.sourcedatalist -->
          </el-radio>
        </el-radio-group>
      </el-form-item>
      
      <!-- <el-form-item label="状态" size="mini" prop="status">
        <el-radio-group v-model="dataForm.status">
          <el-radio :label="0">禁用</el-radio>
          <el-radio :label="1">正常</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">确定</el-button>
    </span>
  </el-dialog>
</template>


<script>
export default {
  data() {
    return {
      visible: false,
      // 获取所有类别列表
      categoryList: [],
      sourcedatalist: [],
      conditionForm: {
        inputcondition: "",
        sourcedatalist: [],

      },
    };
  },
  mounted(){
    this.init(sourcedatalist);
  },
  methods: {
    init(sourcedatalist,inputcondition){
      this.visible=true;
      // this.conditionForm.sourcedatalist =sourcedatalist;
      this.sourcedatalist = sourcedatalist;
      this.conditionForm.inputcondition = inputcondition;
      console.log(sourcedatalist)
      console.log("sourcedatalist");
      console.log(this.conditionForm.sourcedatalist);
    }
    // init(id) {
    //   this.dataForm.id = id || 0;
    //   this.$http({
    //     url: this.$http.adornUrl("/category/select"),
    //     method: "get",
    //     params: this.$http.adornParams(),
    //   })
    //   // 这块修改为获取类别
    //     .then(({ data }) => {
    //       this.categoryList = data && data.code === 0 ? data.list : [];
    //     })
    //     .then(() => {
    //       this.visible = true;
    //       this.$nextTick(() => {
    //         this.$refs["dataForm"].resetFields();
    //       });
    //     })
    //     .then(() => {
    //       if (this.dataForm.id) {
    //         this.$http({
    //           url: this.$http.adornUrl(`/algs/models/info/${this.dataForm.id}`),
    //           method: "get",
    //           params: this.$http.adornParams(),
    //         }).then(({ data }) => {
    //           if (data && data.code === 0) {
    //             this.dataForm.modelName = data.model.modelName;
    //             this.dataForm.categoryId = data.model.categoryId;
    //             this.dataForm.remark = data.model.remark;
    //             // 模板文件地址
    //             // this.dataForm.dfsUrlv = data.temp.dfsUrlv;
    //           }
    //         });
    //       }
    //     });
    // },
  },
};
</script>
