<template>
	<el-drawer title="图片组(支持拖拽排序)" :size="670" v-model="visible" :close-on-press-escape="false" :close-on-click-modal="false" destroy-on-close @closed="$emit('closed')">
		<el-container>
			<el-main style="padding:0 20px 20px 20px">
				<x-upload-multiple v-model="data.images" draggable :width="120" :height="90" :limit="20" tip="最多上传20个文件,单个文件不要超过10M,请上传图像格式文件"></x-upload-multiple>
			</el-main>
			<el-footer>
				<el-button type="primary" @click="submit">提交</el-button>
			</el-footer>
		</el-container>
	</el-drawer>
</template>
<script>
	export default {
		emits: ['success', 'closed'],
		data() {
			return {
				visible: false,
				issave: false,
				data:[],
			}
		},
		mounted() {

		},
		methods: {
			//显示
			open(){
				this.visible = true;
				return this;
			},
			close(){
				this.visible = false;
			},
			//表单提交方法
			submit(){
				this.$emit('success', this.data, this)
			},
			//表单注入数据
			setData(o){
				this.data = o
			},
			remoteData(o){
				setTimeout(async ()=>{
					var res = await this.$http.get('app/apartment/getAttachment',{id:o.id})
					this.loading = false
					this.issave = true
					this.data = res.data;
				},400)
			}
		}
	}
</script>
<style>
</style>
