|
|
@@ -4,13 +4,14 @@ import "pdfh5/css/pdfh5.css";
|
|
|
import { snapshoot } from '@/api/platform/file/attachment' //印章,快照
|
|
|
import { download } from '@/api/platform/file/attachment'
|
|
|
import ActionUtils from '@/utils/action'
|
|
|
+import store from '@/store'
|
|
|
|
|
|
const getPint = (tableForm, srcUrl) => {
|
|
|
- var flag = true;
|
|
|
+ let isMobile = false
|
|
|
if (/Mobi|Android|iPhone|iPad/i.test(navigator.userAgent)) {
|
|
|
- flag = false
|
|
|
+ isMobile = true
|
|
|
}
|
|
|
- if (flag) {
|
|
|
+ if (!isMobile) {
|
|
|
dialog(
|
|
|
{
|
|
|
data() {
|
|
|
@@ -19,30 +20,46 @@ const getPint = (tableForm, srcUrl) => {
|
|
|
data: ''
|
|
|
}
|
|
|
},
|
|
|
-
|
|
|
- template: '<div style="height:100%">' +
|
|
|
- '<iframe src="' + srcUrl + '"' +
|
|
|
- 'id="myiframe" frameborder="0" scrolling="no" height="100%" width="100%"></iframe>' +
|
|
|
- '</div>'
|
|
|
+ template: `
|
|
|
+ <div style="height:100%">
|
|
|
+ <iframe src="${srcUrl}" id="myiframe" frameborder="0" scrolling="no" height="100%" width="100%"></iframe>
|
|
|
+ </div>
|
|
|
+ `,
|
|
|
},
|
|
|
{
|
|
|
dialog: {
|
|
|
appendToBody: true,
|
|
|
width: '90%',
|
|
|
- top: '1vh',
|
|
|
+ top: '3vh',
|
|
|
center: true,
|
|
|
title: '',
|
|
|
- 'custom-class': 'ibps-dialog-91'
|
|
|
- }
|
|
|
- }, (tpl) => {
|
|
|
+ showClose: true,
|
|
|
+ closeOnClickModal: false,
|
|
|
+ 'custom-class': 'ibps-dialog-91 btn-cover'
|
|
|
+ },
|
|
|
+ },
|
|
|
+ (tpl) => {
|
|
|
tableForm.dialogTemplate = tpl
|
|
|
+ const { role } = store.getters.userInfo || {}
|
|
|
+ // 系统管理角色、实验室主任、档案管理员、信息管理角色可下载打印
|
|
|
+ const hasRole = role.some(item => [ 'xtgljs', 'syszr', 'dagly', 'xxgljs'].includes(item.alias))
|
|
|
+ if (hasRole) {
|
|
|
+ return
|
|
|
+ }
|
|
|
+ setTimeout(() => {
|
|
|
+ const toolbarCover = document.createElement('div')
|
|
|
+ toolbarCover.classList.add('toolbar-cover')
|
|
|
+ toolbarCover.addEventListener('click', () => {
|
|
|
+ confirm('无权操作,请联系管理员开放相关权限!', '提示')
|
|
|
+ })
|
|
|
+ document.querySelector('.btn-cover').children[1].appendChild(toolbarCover)
|
|
|
+ }, 1000)
|
|
|
}
|
|
|
).catch((_this) => {
|
|
|
_this.visible = false
|
|
|
tableForm.dialogTemplate = null
|
|
|
})
|
|
|
} else {
|
|
|
-
|
|
|
dialog(
|
|
|
{
|
|
|
data() {
|