2016-08-21 07:12:56 +00:00
|
|
|
<template>
|
|
|
|
<div class="el-dragger__cover" @click.stop v-if="image">
|
2016-12-03 10:59:04 +00:00
|
|
|
<transition name="el-fade-in">
|
2016-08-21 07:12:56 +00:00
|
|
|
<el-progress
|
|
|
|
class="el-dragger__cover__progress"
|
2016-09-06 17:15:39 +00:00
|
|
|
v-if="image.status === 'uploading'"
|
2016-08-21 07:12:56 +00:00
|
|
|
:percentage="image.percentage"
|
2016-09-06 17:15:39 +00:00
|
|
|
:show-text="false"
|
|
|
|
:status="image.status === 'finished' ? 'success' : ''">
|
2016-08-21 07:12:56 +00:00
|
|
|
</el-progress>
|
|
|
|
</transition>
|
2016-09-06 17:15:39 +00:00
|
|
|
<div
|
|
|
|
class="el-dragger__cover__content"
|
|
|
|
v-if="image.status === 'finished'"
|
|
|
|
@mouseenter="mouseover = true"
|
|
|
|
@mouseleave="mouseover = false"
|
|
|
|
>
|
2016-08-21 07:12:56 +00:00
|
|
|
<img :src="image.url">
|
2016-12-03 10:59:04 +00:00
|
|
|
<transition name="el-fade-in">
|
2016-08-21 07:12:56 +00:00
|
|
|
<div v-show="mouseover" class="el-dragger__cover__interact">
|
|
|
|
<div class="el-draggeer__cover__btns">
|
2016-11-07 15:28:35 +00:00
|
|
|
<span class="btn" @click="$parent.handleClick()"><i class="el-icon-upload2"></i><span>{{ t('el.upload.continue') }}</span></span>
|
|
|
|
<span class="btn" @click="onPreview(image)"><i class="el-icon-view"></i><span>{{ t('el.upload.preview') }}</span></span>
|
|
|
|
<span class="btn" @click="onRemove(image)"><i class="el-icon-delete2"></i><span>{{ t('el.upload.delete') }}</span></span>
|
2016-08-21 07:12:56 +00:00
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</transition>
|
2016-12-03 10:59:04 +00:00
|
|
|
<transition name="el-zoom-in-bottom">
|
2016-08-21 07:12:56 +00:00
|
|
|
<h4 v-show="mouseover" class="el-dragger__cover__title">{{image.name}}</h4>
|
|
|
|
</transition>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</template>
|
|
|
|
<script>
|
2016-10-27 09:31:22 +00:00
|
|
|
import Locale from 'element-ui/src/mixins/locale';
|
2016-11-13 01:49:42 +00:00
|
|
|
import ElProgress from 'element-ui/packages/progress';
|
2016-10-27 09:31:22 +00:00
|
|
|
|
2016-08-21 07:12:56 +00:00
|
|
|
export default {
|
2016-10-27 09:31:22 +00:00
|
|
|
mixins: [Locale],
|
|
|
|
|
2016-11-13 01:49:42 +00:00
|
|
|
components: { ElProgress },
|
|
|
|
|
2016-08-21 07:12:56 +00:00
|
|
|
props: {
|
|
|
|
image: {},
|
|
|
|
onPreview: {
|
|
|
|
type: Function,
|
|
|
|
default: function() {}
|
|
|
|
},
|
|
|
|
onRemove: {
|
|
|
|
type: Function,
|
|
|
|
default: function() {}
|
|
|
|
}
|
|
|
|
},
|
|
|
|
data() {
|
|
|
|
return {
|
|
|
|
mouseover: false
|
|
|
|
};
|
|
|
|
}
|
|
|
|
};
|
|
|
|
</script>
|