？<template>
  <layout-form>
    <el-form
      :model="form"
      :loading="loading"
      :rules="rules"
      size="small"
      style="width: 100%"
      label-width="120px"
      ref="form"
    >
      <el-row>
        <Field
        :span="16"
          label="名称"
          prop="name"
          v-model="form.name"
          placeholder="请输入名称"
        />
        <Field
        :span="16"
          label="业务系统标识"
          prop="platformSn"
          v-model="form.platformSn"
        />
        <Field
        :span="16"
          label="接入秘钥"
          prop="secretKey"
          disabled
          v-model="form.secretKey"
        />

        <Field
        :span="16"
          label="接收消息类型"
          prop="type"
          :enumData="dict.type"
          type="radio"
          v-model="form.type"
        />
        <Field
        :span="16"
          v-if="form.type == '0'"
          label="回调地址"
          prop="callbackUrl"
          v-model="form.callbackUrl"
          placeholder="请输入回调地址"
        />

        <Field
        :span="16"
          v-if="form.type == '0'"
          label="监听消息类型"
          prop="type"
          :enumData="dict.listenerType"
          type="select"
          multiple
          clearable
          v-model="form.listener"
        />

        <Field
        :span="16"
          label="备注"
          prop="remark"
          v-model="form.remark"
          placeholder="请输入系统备注"
          type="textarea"
        />
      </el-row>
      <form-buttons @submit="submitForm" />
    </el-form>
  </layout-form>
</template>

<script>
import form from "@/assets/mixins/form";
export default {
  mixins: [form],
  data() {
    return {
      toString: ["status","type","listenerType"],
      rules: {
        name: [
          { required: true, message: "请输入名称", trigger: "blur" },
          { max: 32, message: "最多只能录入32个字符", trigger: "blur" },
        ],
        platformSn: [
          { required: true, message: "请输入业务系统标识", trigger: "blur" },
          { max: 40, message: "最多只能录入40个字符", trigger: "blur" },
        ],
        listener: [
          { required: true, message: "请选择监听消息类型", trigger: "blur" }
        ]

      },
    };
  },
};
</script>