|
|
|
<template>
|
|
|
|
<div class="main-content">
|
|
|
|
<div class="form-area">
|
|
|
|
<el-form size="default" :model="form" label-width="120px">
|
|
|
|
<el-form-item label="分组" style="width: 80%">
|
|
|
|
<el-select v-model="form.groupId" placeholder="请选择">
|
|
|
|
<el-option :value="0" label="不分组"></el-option>
|
|
|
|
</el-select>
|
|
|
|
</el-form-item>
|
|
|
|
<el-form-item label="车系" style="width: 80%">
|
|
|
|
<div>
|
|
|
|
<el-checkbox-group v-model="form.brandList">
|
|
|
|
<el-checkbox v-for="(item,index) in brandData" :key="index" :label="item.id">
|
|
|
|
{{item.name}}
|
|
|
|
</el-checkbox>
|
|
|
|
</el-checkbox-group>
|
|
|
|
</div>
|
|
|
|
</el-form-item>
|
|
|
|
<el-form-item label="类型" style="width: 80%">
|
|
|
|
<el-select v-model="form.type" placeholder="请选择">
|
|
|
|
<el-option :value="1" label="视频"></el-option>
|
|
|
|
<el-option :value="2" label="图片"></el-option>
|
|
|
|
<el-option :value="3" label="文字"></el-option>
|
|
|
|
</el-select>
|
|
|
|
</el-form-item>
|
|
|
|
<el-form-item label="标签" style="width: 80%">
|
|
|
|
<el-checkbox-group v-model="form.tagList">
|
|
|
|
<el-checkbox v-for="(item,index) in tagData" :key="index" :label="item.id">
|
|
|
|
{{item.title}}
|
|
|
|
</el-checkbox>
|
|
|
|
</el-checkbox-group>
|
|
|
|
</el-form-item>
|
|
|
|
<el-form-item label="素材描述" style="width: 80%">
|
|
|
|
<el-input type="textarea" v-model="form.description" />
|
|
|
|
</el-form-item>
|
|
|
|
<el-form-item label="素材内容" style="width: 100%">
|
|
|
|
<uploadFile @change="handlerUpload" :config="{ limit: 1, accept: '.jpg, .jpeg, .png, .gif'}">
|
|
|
|
<el-button>上传文件</el-button>
|
|
|
|
</uploadFile>
|
|
|
|
</el-form-item>
|
|
|
|
<el-form-item>
|
|
|
|
<el-button type="primary" @click="confirm">提交</el-button>
|
|
|
|
</el-form-item>
|
|
|
|
</el-form>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</template>
|
|
|
|
|
|
|
|
<script>
|
|
|
|
import {defineComponent,reactive,ref,getCurrentInstance} from 'vue'
|
|
|
|
export default defineComponent({
|
|
|
|
name: 'v-matUpload',
|
|
|
|
setup() {
|
|
|
|
const activeId = reactive({
|
|
|
|
value: 0
|
|
|
|
});
|
|
|
|
const form = reactive({
|
|
|
|
groupId: 0,
|
|
|
|
title: '',
|
|
|
|
tagList: [],
|
|
|
|
brandList: [],
|
|
|
|
});
|
|
|
|
const tagData = ref([]);
|
|
|
|
const brandData = ref([]);
|
|
|
|
const { proxy } = getCurrentInstance();
|
|
|
|
return {
|
|
|
|
form,proxy,
|
|
|
|
tagData,brandData,
|
|
|
|
activeId
|
|
|
|
}
|
|
|
|
},
|
|
|
|
mounted() {
|
|
|
|
this.getApi()
|
|
|
|
},
|
|
|
|
methods: {
|
|
|
|
getApi() {
|
|
|
|
this.proxy.$post("/tag/list", {}).then(res => {
|
|
|
|
this.tagData = res.data.records;
|
|
|
|
}).catch(() => {});
|
|
|
|
this.proxy.$post("/brand/list", {}).then(res => {
|
|
|
|
this.brandData = res.data.records;
|
|
|
|
}).catch(() => {});
|
|
|
|
},
|
|
|
|
confirm() {
|
|
|
|
this.$router.go(-1);
|
|
|
|
},
|
|
|
|
//素材上传
|
|
|
|
handlerUpload(data) {
|
|
|
|
console.log(data)
|
|
|
|
}
|
|
|
|
}
|
|
|
|
})
|
|
|
|
</script>
|
|
|
|
|
|
|
|
<style lang="less">
|
|
|
|
.form-area {
|
|
|
|
width: 600px
|
|
|
|
}
|
|
|
|
</style>
|