<!--
 * @Author: zhp
 * @Date: 2023-02-14 15:02:26
 * @LastEditTime: 2023-07-17 10:23:23
 * @LastEditors: zwq
 * @Description: 
-->
<template>
  <el-form
    :model="dataForm"
    :rules="dataRule"
    ref="dataForm"
    @keyup.enter.native="dataFormSubmitHandle()"
    label-width="130px"
  >
    <el-form-item prop="name" :label="$t('code.name')">
      <el-input v-model="dataForm.name" :placeholder="$t('code.name')"> </el-input>
    </el-form-item>
    <el-form-item prop="code" :label="$t('code.code')">
      <el-input v-model="dataForm.code" :placeholder="$t('code.code')"></el-input>
    </el-form-item>
    <el-form-item prop="problemStatus" label="状态">
      <el-switch v-model="dataForm.problemStatus" :active-value="1" :inactive-value="0">
      </el-switch>
    </el-form-item>
    <el-form-item prop="description" label="描述">
      <el-input v-model="dataForm.description" placeholder="描述"></el-input>
    </el-form-item>
  </el-form>
</template>

<script>
import basicAdd from "@/mixins/basic-add";
export default {
  mixins: [basicAdd],
  data() {
    return {
      urlOptions: {
        submitURL: "/code/problemType",
        infoURL: "/code/problemType",
      },
      visible: false,
      dataForm: {
        id: null,
        name: null,
        code: null,
        description: null,
        problemStatus: 0,
      },
    };
  },
  computed: {
    dataRule() {
      return {
        code: [
          {
            required: true,
            message: "请输入编码",
            trigger: "blur",
          },
        ],
        name: [
          {
            required: true,
            message: "请输入名称",
            trigger: "blur",
          },
        ],
      };
    },
  },
  methods: {},
};
</script>
