<template>
  <div class="app-container">
    <el-form model="form" :rules="rules" label-width="100px" size="small">
      <el-row>
        <el-col :span="12">
          <el-form-item label="音频上传：">
            <imageUpload />
          </el-form-item>
        </el-col>
        <el-col :span="12">
          <el-form-item prop="name" label="歌曲名称：">
            <el-input v-model="form.name" />
          </el-form-item>
          <el-form-item label="歌手名称：">
            <el-select>
              <el-option></el-option>
            </el-select>
          </el-form-item>
          <el-form-item label="播放时长：">
            <el-input></el-input>
          </el-form-item>
        </el-col>
      </el-row>
      <el-form-item label="资源平台：">
        <el-input disabled />
      </el-form-item>
      <el-form-item label="标签分类：">
        <el-select>
          <el-option></el-option>
        </el-select>
      </el-form-item>
      <el-form-item label="所属专辑：">
        <!-- 必填 -->
        <el-select filterable placeholder="请选择所属专辑">
          <el-option></el-option>
        </el-select>
      </el-form-item>
      <el-form-item label="所属歌单：">
        <!-- 选填 -->
        <el-select v-model="value" multiple filterable placeholder="请选择所属歌单">
          <el-option v-for="item in options" :key="item.value" :value="item.value" :label="item.label" />
        </el-select>
      </el-form-item>
      <el-form-item>
        <el-button @click="getCancel">取消</el-button>
        <el-button type="primary" @click="getSubmit">提交</el-button>
      </el-form-item>
    </el-form>
  </div>
</template>

<script>
import imageUpload from "@/components/Upload/index";
export default {
  components: {
    imageUpload,
  },
  data() {
    return {
      // 歌单
      options:[{
        value: 1,
        label: '每日精选'
      },{
        value: 2,
        label: '昨日精选'
      }],
      value: [],
      // 表单
      form: {},
      rules: {
        name: [
          {
            required: true,
            message: "请输入歌曲名称",
            trigger: "blur",
          },
        ],
      },
    };
  },
  methods: {
    getCancel() {
      this.$tab.closeOpenPage("/music/list");
      this.$refs.form.resetFields();
    },
  },
};
</script>

<style lang="scss" scoped>
.el-form {
  width: 600px;
}
</style>