<!--
 * @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="120px">
      <el-form-item :label="$t('module.basicData.code')" prop="code">
        <el-input v-model="dataForm.code" :placeholder="$t('placeholder.first')+$t('module.basicData.code')"></el-input>
      </el-form-item>
      <el-form-item :label="$t('module.basicData.name')" prop="name">
        <el-input v-model="dataForm.name" :placeholder="$t('placeholder.first')+$t('module.basicData.name')"></el-input>
      </el-form-item>
      <el-form-item :label="$t('module.basicData.site')" prop="platformId">
        <el-select
          v-model="dataForm.platformId"
          filterable
          :placeholder="$t('placeholder.first')+$t('module.basicData.site')"
        >
          <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="$t('module.basicData.descs')" prop="remark">
        <el-input v-model="dataForm.remark" :placeholder="$t('placeholder.first')+$t('module.basicData.descs')"></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>
