|
|
@@ -30,7 +30,7 @@
|
|
|
<div v-else>
|
|
|
<div class='flex flex-center'>
|
|
|
<main-button icon="View" title="详情" width="85" v-if='option.viewBtn' @click="rowView(item,index)"/>
|
|
|
- <main-button icon="Download" v-if='[1].includes(item.type)' title="下载" width="85" @click="View(item)"/>
|
|
|
+ <main-button icon="Download" v-if='[1].includes(item.type)' title="下载" width="85" @click="rowDownload(item)"/>
|
|
|
<main-button icon="Delete" title="删除" width="85" v-if='option.delBtn || (user && user.info.userId === item.createUser)' @click="rowDel(item,index)"/>
|
|
|
<slot name='menu' :row="item"></slot>
|
|
|
</div>
|
|
|
@@ -38,13 +38,18 @@
|
|
|
</div>
|
|
|
</div>
|
|
|
</div>
|
|
|
-
|
|
|
+ <el-image-viewer
|
|
|
+ v-if='showImage'
|
|
|
+ :url-list="imgList"
|
|
|
+ @close='showImage = false'
|
|
|
+ />
|
|
|
</div>
|
|
|
</template>
|
|
|
|
|
|
<script>
|
|
|
import mainButton from '@/components/main-button.vue'
|
|
|
import { useStore } from '@/store/user.js'
|
|
|
+import api from '@/api/index.js'
|
|
|
|
|
|
export default {
|
|
|
name: 'index.vue',
|
|
|
@@ -70,6 +75,12 @@ export default {
|
|
|
immediate: true
|
|
|
}
|
|
|
},
|
|
|
+ data () {
|
|
|
+ return {
|
|
|
+ showImage: false,
|
|
|
+ imgList: []
|
|
|
+ }
|
|
|
+ },
|
|
|
setup () {
|
|
|
const user = useStore()
|
|
|
return { user }
|
|
|
@@ -80,6 +91,15 @@ export default {
|
|
|
},
|
|
|
rowView (row, index) {
|
|
|
this.$emit('rowView', row, index)
|
|
|
+ },
|
|
|
+ rowDownload (row) {
|
|
|
+ console.log(row)
|
|
|
+ if (api.offices.includes(row.suffix)) {
|
|
|
+ window.open(row.url, '')
|
|
|
+ } else {
|
|
|
+ this.imgList = [row.url]
|
|
|
+ this.showImage = true
|
|
|
+ }
|
|
|
}
|
|
|
}
|
|
|
}
|