？<template>
  <layout-form>
    <el-form
      :model="form"
      :loading="loading"
      :rules="rules"
      size="small"
      style="width: 100%"
      label-width="120px"
      ref="form"
    >
      <el-row>
        <Field
          label="问题"
          prop="title"
          v-model="form.title"
          placeholder="请输入问题"
          span="18"
          type="textarea"
        />
        <Field
          label="回答"
          prop="content"
          v-model="form.content"
          placeholder="请输入回答"
          span="18"
          rows="5"
          type="textarea"
        />
        <Field
          label="常见问题来源"
          prop="source"
          v-model="form.source"
          :enumData="dict.source"
          type="select"
        />
      </el-row>
      <form-buttons @submit="submitForm" />
    </el-form>
  </layout-form>
</template>

<script>
import form from "@/assets/mixins/form";
export default {
  mixins: [form],
  created() {
    const { matterId } = this.$route.query;
    this.form.matterId = matterId;
  },
  data() {
    return {
      toString: ["source"],

      rules: {
        title: [
          {required: true, max: 1024, message: "最多只能录入1024个字符", trigger: "blur" },
        ],
        content: [
          { required: true, message: "请输入回答", trigger: "blur" },
          { max: 65535, message: "最多只能录入65535个字符", trigger: "blur" },
        ],
        source: [
          { required: true, message: "请选择事项来源", trigger: "blur" },
        ],
      },
    };
  },
};
</script>