修改:移动端打开文件的方法
This commit is contained in:
parent
08cb3f0c3c
commit
4b3ce450f9
@ -10,7 +10,6 @@ NProgress.configure({ showSpinner: false }) // NProgress配置
|
|||||||
const whiteList = ['/login','/s','/s/','/s_m','/s_m/'] // 白名单
|
const whiteList = ['/login','/s','/s/','/s_m','/s_m/'] // 白名单
|
||||||
|
|
||||||
router.beforeEach(async(to, from, next) => {
|
router.beforeEach(async(to, from, next) => {
|
||||||
console.log(to)
|
|
||||||
// 开始进度条
|
// 开始进度条
|
||||||
NProgress.start()
|
NProgress.start()
|
||||||
// 设置页面标题
|
// 设置页面标题
|
||||||
@ -80,7 +79,6 @@ function setMenuList(next, to){
|
|||||||
}
|
}
|
||||||
})
|
})
|
||||||
} else {
|
} else {
|
||||||
console.log('next(to)', to)
|
|
||||||
next(to)
|
next(to)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -230,7 +230,8 @@
|
|||||||
<van-checkbox v-if="selectStatus" v-model="isShowCheckContext" slot="right-icon" :name="rowContextData"></van-checkbox>
|
<van-checkbox v-if="selectStatus" v-model="isShowCheckContext" slot="right-icon" :name="rowContextData"></van-checkbox>
|
||||||
</van-cell>
|
</van-cell>
|
||||||
</van-overlay>
|
</van-overlay>
|
||||||
|
<!--为了不受右键区域的影响, 把弹窗之类的提取出来-->
|
||||||
|
<image-viewer :fileList="fileList" :file="imagePreviewRow" :status.sync="imagePreviewVisible"></image-viewer>
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
<script>
|
<script>
|
||||||
@ -242,10 +243,11 @@
|
|||||||
import Bus from '@/assets/js/bus'
|
import Bus from '@/assets/js/bus'
|
||||||
import {getPath, getPathList, removePath, setPath} from '@/utils/path'
|
import {getPath, getPathList, removePath, setPath} from '@/utils/path'
|
||||||
import fileConfig from "@/utils/file-config";
|
import fileConfig from "@/utils/file-config";
|
||||||
|
import ImageViewer from "@/components/preview/ImageViewer";
|
||||||
let pinyin = require("pinyin");
|
let pinyin = require("pinyin");
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
components: {IconFile},
|
components: {ImageViewer, IconFile},
|
||||||
computed: {
|
computed: {
|
||||||
...mapGetters([
|
...mapGetters([
|
||||||
'name',
|
'name',
|
||||||
@ -323,7 +325,9 @@
|
|||||||
sortableProp: null,
|
sortableProp: null,
|
||||||
order: null,
|
order: null,
|
||||||
grid: false,
|
grid: false,
|
||||||
vmode: 'list'
|
vmode: 'list',
|
||||||
|
imagePreviewRow: {},
|
||||||
|
imagePreviewVisible: false,
|
||||||
};
|
};
|
||||||
},
|
},
|
||||||
mounted(){
|
mounted(){
|
||||||
@ -957,12 +961,14 @@
|
|||||||
setPath(this.path, this.pathList)
|
setPath(this.path, this.pathList)
|
||||||
this.getFileList()
|
this.getFileList()
|
||||||
} else {
|
} else {
|
||||||
if(row.contentType.includes('text')){
|
if (row.contentType.startsWith('image')) {
|
||||||
this.$router.push(`/public/articles/article?mark=${row.id}`)
|
// 图片
|
||||||
}else{
|
this.imagePreviewVisible = true
|
||||||
// 打开文件
|
this.imagePreviewRow = row
|
||||||
fileConfig.preview(this.$store.state.user.token, row, this.$store.getters.token)
|
return
|
||||||
}
|
}
|
||||||
|
// 通用打开文件的方法
|
||||||
|
fileConfig.preview(this.$store.state.user.name, row, this.$store.getters.token)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user