detailDialog.vue 1.65 KB
<template>
  <!-- 编辑 -->
  <dialogBox title="编辑" @closeDialog="closeDialog" @submitForm="handleSubmit" v-model="myValue">
    <el-form :model="ruleForm" :rules="rules" ref="ruleForm" label-width="120px">
      <el-row>
        <el-col :span="6">
          <el-form-item label="规则编码" prop="gzbm">
            <el-input v-model="ruleForm.gzbm" placeholder="规则编码"></el-input>
          </el-form-item>
        </el-col>
        <el-col :span="6">
          <el-form-item label="规则名称" prop="gzmc">
            <el-input v-model="ruleForm.gzmc" placeholder="规则名称"></el-input>
          </el-form-item>
        </el-col>
        <el-col :span="6">
          <el-form-item label="是否启用" prop="isqy">
            <el-radio-group v-model="ruleForm.isqy">
              <el-radio :label="1"></el-radio>
              <el-radio :label="2"></el-radio>
            </el-radio-group>
          </el-form-item>
        </el-col>
      </el-row>
    </el-form>
  </dialogBox>
</template>

<script>
export default {
  props: {
    value: { type: Boolean, default: false },
  },
  data () {
    return {
      myValue: this.value,
      ruleForm: {
        gzbm: '',
        xzqmc: '',
        isqy: 1
      },
      rules: {
        gzbm: [
          { required: true, message: '规则编码', trigger: 'blur' }
        ],
        gzmc: [
          { required: true, message: '规则名称', trigger: 'blur' }
        ]
      }
    }
  },
  watch: {
    value (val) {
      this.myValue = val
    }
  },
  methods: {
    closeDialog () {
      this.$emit('input', false)
    },
    handleSubmit () {
      this.$emit('input', false)
    }
  }
}
</script>