<!--
 * @Author: zwq
 * @Date: 2021-11-18 14:16:25
 * @LastEditors: zwq
 * @LastEditTime: 2022-08-24 14:52:18
 * @Description:
-->
<template>
    <el-form :model="dataForm" :rules="dataRule" ref="dataForm" @keyup.enter.native="dataFormSubmit()" label-width="80px">
      <el-form-item label="编码" prop="code">
        <el-input v-model="dataForm.code" placeholder="编码"></el-input>
      </el-form-item>
      <el-form-item label="名称" prop="name">
        <el-input v-model="dataForm.name" placeholder="名称"></el-input>
      </el-form-item>
      <el-form-item label="站点" prop="platformId">
        <el-select
          v-model="dataForm.platformId"
          filterable
          placeholder="请选择站点"
        >
          <el-option
            v-for="item in urlOptions.optionArr.arr0"
            :key="item.id"
            :label="item.name"
            :value="item.id"
          >
          </el-option>
        </el-select>
      </el-form-item>
      <el-form-item label="描述" prop="remark">
        <el-input v-model="dataForm.remark" placeholder="描述"></el-input>
      </el-form-item>
    </el-form>
</template>

<script>
import basicAdd from '@/mixins/basic-add'
export default {
  mixins: [basicAdd],
  data() {
    return {
      urlOptions: {
          submitURL: '/basic/machine/',
          infoURL: '/basic/machine',
          getOption: true,
          optionArrUrl: ['/basic/platform/page'],
      },
        dataForm: {
          id: '',
          code: '',
          name: '',
          platformId: '',
          remark: ''
        },
        dataRule: {
          code: [
            { required: true, message: '编码不能为空', trigger: 'blur' }
          ],
          name: [
            { required: true, message: '名称不能为空', trigger: 'blur' }
          ]
        }
      }
    },
    methods: {
    }
  }
</script>
