<!--
 * @Author: zwq
 * @Date: 2023-01-04 10:29:40
 * @LastEditors: zwq
 * @LastEditTime: 2023-07-03 15:10:57
 * @Description: 
-->
<template>
  <el-form :model="dataForm" ref="dataForm" label-width="120px">
    <el-form-item prop="title" :label="$t('code.title')">
      <el-input v-model="dataForm.title" :placeholder="$t('code.title')" clearable></el-input>
    </el-form-item>
    <el-form-item prop="productId" label="产品">
      <el-select v-model="dataForm.productId" filterable clearable placeholder="请选择产品">
        <el-option
          v-for="item in this.urlOptions.optionArr.arr0"
          :key="item.id"
          :label="item.productName"
          :value="item.id"
        >
        </el-option>
      </el-select>
    </el-form-item>
    <el-form-item prop="defectId" label="缺陷">
      <el-select v-model="dataForm.defectId" filterable clearable placeholder="请选择缺陷">
        <el-option
          v-for="item in this.urlOptions.optionArr.arr1"
          :key="item.id"
          :label="item.name"
          :value="item.id"
        >
        </el-option>
      </el-select>
    </el-form-item>
    <el-form-item prop="description" label="关键字">
      <el-input v-model="dataForm.description" placeholder="关键字" clearable></el-input>
    </el-form-item>
  </el-form>
</template>

<script>
import basicAdd from "@/mixins/basic-add";

export default {
  mixins: [basicAdd],
  data() {
    return {
      urlOptions: {
        optionArrUrl: ["/basic/qmsProduct/page","/basic/qmsProduct/page"],
      },
      visible: false,
      dataForm: {
        title: "",
        productId: "",
        defectId: '',
        description: ''
      },
    };
  },
  computed: {
    dataRule() {
      return {
        // paramCode: [
        //   {
        //     required: true,
        //     message: this.$t("validate.required"),
        //     trigger: "blur",
        //   },
        // ],
      };
    },
  },
  methods: {
    init() {
      this.visible = true;
      this.$nextTick(() => {
        this.$refs["dataForm"].resetFields();
        this.getArr();
      });
    },
    dataFormSubmit() {
      this.$emit("refreshDataList", this.dataForm);
    },
  },
};
</script>
