<template>
  <div class="siteManage-main groupInfo">
    <el-form
      :model="ruleForm"
      :rules="rules"
      ref="ruleForm"
      label-width="100px"
      class="demo-ruleForm"
    >
          <div class="grid-content bg-purple">
            <div class="el-form-item blockTitle">
               分组信息
             </div>
            <div></div>
            <el-form-item label="分组名称" prop="name" label-width="130px">
              <el-input v-model="ruleForm.name"></el-input>
            </el-form-item>

          
            <el-form-item>
              <el-button type="primary" @click="submitForm('ruleForm')"
                >保存</el-button>
            
            </el-form-item>

          </div>
       
    </el-form>
  </div>
</template>

<script>
export default {
  name: "GroupInfoCom",
  data() {
    return {
      dialogImageUrl: "",
      dialogVisible: false,
      disabled: false,
      ruleForm: {
        name: "分组1",
       
      },
      rules: {
       
        name: [
          { required: true, message: "请输入站点名称", trigger: "blur" },
          { min: 3, max: 5, message: "长度在 3 到 5 个字符", trigger: "blur" },
        ],
      },
    };
  },
  methods: {
    handleRemove(file) {
      console.log(file);
    },
    handlePictureCardPreview(file) {
      this.dialogImageUrl = file.url;
      this.dialogVisible = true;
    },
    submitForm(formName) {
      this.$refs[formName].validate((valid) => {
        if (valid) {
          alert("submit!");
        } else {
          console.log("error submit!!");
          return false;
        }
      });
    },
  },
};
</script>
<style scoped lang="scss">
</style>
