|
@@ -12,6 +12,7 @@
|
|
|
>
|
|
|
<el-upload
|
|
|
v-if="item.type == 'image'"
|
|
|
+ :disabled="disabled"
|
|
|
action="#"
|
|
|
accept=".jpg,.png,.svg,.jpeg,.gif,.bmp"
|
|
|
:file-list="imageList"
|
|
@@ -21,10 +22,11 @@
|
|
|
:before-upload="beforeUploadImage"
|
|
|
slot="reference"
|
|
|
>
|
|
|
- <span class="action-img image"></span>
|
|
|
+ <span class="action-img image" @click="checkLogin"></span>
|
|
|
</el-upload>
|
|
|
<el-upload
|
|
|
v-else-if="item.type == 'attach'"
|
|
|
+ :disabled="disabled"
|
|
|
action="#"
|
|
|
accept=".pdf,.word,.docx,.ppt,.pptx"
|
|
|
:file-list="attachList"
|
|
@@ -34,7 +36,7 @@
|
|
|
:before-upload="beforeUploadAttach"
|
|
|
slot="reference"
|
|
|
>
|
|
|
- <span class="action-img attach"></span>
|
|
|
+ <span class="action-img attach" @click="checkLogin"></span>
|
|
|
</el-upload>
|
|
|
<div v-else-if="item.type == 'rate'" slot="reference">
|
|
|
<span v-show="isRobot === 2" class="action-img rate" :class="item.type" @click="onClick(item.type)"></span>
|
|
@@ -52,6 +54,7 @@
|
|
|
<script>
|
|
|
import { Popover, Upload } from 'element-ui'
|
|
|
import { fileUpload } from '@/api/modules/'
|
|
|
+import {mapGetters} from "vuex";
|
|
|
|
|
|
export default {
|
|
|
name: 'action-container',
|
|
@@ -90,7 +93,8 @@ export default {
|
|
|
return {
|
|
|
list: this.options,
|
|
|
imageList: [],
|
|
|
- attachList: []
|
|
|
+ attachList: [],
|
|
|
+ disabled: false
|
|
|
}
|
|
|
},
|
|
|
watch: {
|
|
@@ -99,6 +103,7 @@ export default {
|
|
|
}
|
|
|
},
|
|
|
computed: {
|
|
|
+ ...mapGetters('user', ['isLogin']),
|
|
|
getOptions () {
|
|
|
const list = this.list
|
|
|
const arr = list.map(v => {
|
|
@@ -181,6 +186,12 @@ export default {
|
|
|
this.$toast('上传失败,只能选择PDF、WORD、PPT格式')
|
|
|
return false
|
|
|
}
|
|
|
+ },
|
|
|
+ checkLogin () {
|
|
|
+ if (!this.isLogin) {
|
|
|
+ this.disabled = true
|
|
|
+ this.$showLoginDialog()
|
|
|
+ }
|
|
|
}
|
|
|
}
|
|
|
}
|