mirror of
https://github.com/kuaifan/dootask.git
synced 2026-01-16 03:58:12 +00:00
移动客户端文件使用新窗口打开
This commit is contained in:
parent
0150b41e17
commit
76e66ab433
@ -426,10 +426,13 @@ export default {
|
||||
});
|
||||
} else if (this.$isEEUiApp) {
|
||||
$A.eeuiAppOpenPage({
|
||||
pageType: 'web',
|
||||
pageType: 'app',
|
||||
pageTitle: `${this.msgData.msg.name} (${$A.bytesToSize(this.msgData.msg.size)})`,
|
||||
statusBarStyle: false,
|
||||
url: $A.apiUrl(`../token?token=${this.userToken}&from=${encodeURIComponent($A.apiUrl(`..${uri}`))}`)
|
||||
url: 'web.js',
|
||||
params: {
|
||||
titleFixed: true,
|
||||
url: $A.apiUrl(`../token?token=${this.userToken}&from=${encodeURIComponent($A.apiUrl(`..${uri}`))}`)
|
||||
},
|
||||
});
|
||||
} else {
|
||||
window.open($A.apiUrl(`..${uri}`))
|
||||
|
||||
@ -200,10 +200,13 @@ export default {
|
||||
});
|
||||
} else if (this.$isEEUiApp) {
|
||||
$A.eeuiAppOpenPage({
|
||||
pageType: 'web',
|
||||
pageType: 'app',
|
||||
pageTitle: $A.getFileName(this.file) + ` [${row.created_at}]`,
|
||||
statusBarStyle: false,
|
||||
url: $A.apiUrl(`../token?token=${this.userToken}&from=${encodeURIComponent($A.apiUrl(`..${uri}`))}`)
|
||||
url: 'web.js',
|
||||
params: {
|
||||
titleFixed: true,
|
||||
url: $A.apiUrl(`../token?token=${this.userToken}&from=${encodeURIComponent($A.apiUrl(`..${uri}`))}`)
|
||||
},
|
||||
});
|
||||
} else {
|
||||
window.open($A.apiUrl(`..${uri}`))
|
||||
|
||||
@ -2,7 +2,7 @@
|
||||
<div class="file-preview">
|
||||
<IFrame v-if="isPreview" class="preview-iframe" :src="previewUrl" @on-message="onMessage"/>
|
||||
<template v-else>
|
||||
<div v-show="!['word', 'excel', 'ppt'].includes(file.type)" class="edit-header">
|
||||
<div v-show="headerShow && !['word', 'excel', 'ppt'].includes(file.type)" class="edit-header">
|
||||
<div class="header-title">
|
||||
<div class="title-name">{{$A.getFileName(file)}}</div>
|
||||
<Tag color="default">{{$L('只读')}}</Tag>
|
||||
@ -68,6 +68,10 @@ export default {
|
||||
return {};
|
||||
}
|
||||
},
|
||||
headerShow: {
|
||||
type: Boolean,
|
||||
default: true
|
||||
},
|
||||
},
|
||||
|
||||
data() {
|
||||
|
||||
@ -1303,10 +1303,13 @@ export default {
|
||||
});
|
||||
} else if (this.$isEEUiApp) {
|
||||
$A.eeuiAppOpenPage({
|
||||
pageType: 'web',
|
||||
pageType: 'app',
|
||||
pageTitle: `${file.name} (${$A.bytesToSize(file.size)})`,
|
||||
statusBarStyle: false,
|
||||
url: $A.apiUrl(`../token?token=${this.userToken}&from=${encodeURIComponent($A.apiUrl(`..${uri}`))}`)
|
||||
url: 'web.js',
|
||||
params: {
|
||||
titleFixed: true,
|
||||
url: $A.apiUrl(`../token?token=${this.userToken}&from=${encodeURIComponent($A.apiUrl(`..${uri}`))}`)
|
||||
},
|
||||
});
|
||||
} else {
|
||||
window.open($A.apiUrl(`..${uri}`))
|
||||
|
||||
@ -995,7 +995,7 @@ export default {
|
||||
}
|
||||
}
|
||||
// 客户端打开独立窗口
|
||||
if (this.$Electron) {
|
||||
if (this.$Electron || this.$isEEUiApp) {
|
||||
this.openFileSingle(item);
|
||||
return;
|
||||
}
|
||||
@ -1005,22 +1005,37 @@ export default {
|
||||
},
|
||||
|
||||
openFileSingle(item) {
|
||||
this.$Electron.sendMessage('windowRouter', {
|
||||
name: `file-${item.id}`,
|
||||
path: `/single/file/${item.id}`,
|
||||
userAgent: "/hideenOfficeTitle/",
|
||||
force: false, // 如果窗口已存在不重新加载
|
||||
config: {
|
||||
title: $A.getFileName(item),
|
||||
titleFixed: true,
|
||||
parent: null,
|
||||
width: Math.min(window.screen.availWidth, 1440),
|
||||
height: Math.min(window.screen.availHeight, 900),
|
||||
},
|
||||
webPreferences: {
|
||||
nodeIntegrationInSubFrames: item.type === 'drawio'
|
||||
},
|
||||
});
|
||||
const uri = `/single/file/${item.id}`;
|
||||
if (this.$Electron) {
|
||||
this.$Electron.sendMessage('windowRouter', {
|
||||
name: `file-${item.id}`,
|
||||
path: uri,
|
||||
userAgent: "/hideenOfficeTitle/",
|
||||
force: false, // 如果窗口已存在不重新加载
|
||||
config: {
|
||||
title: $A.getFileName(item),
|
||||
titleFixed: true,
|
||||
parent: null,
|
||||
width: Math.min(window.screen.availWidth, 1440),
|
||||
height: Math.min(window.screen.availHeight, 900),
|
||||
},
|
||||
webPreferences: {
|
||||
nodeIntegrationInSubFrames: item.type === 'drawio'
|
||||
},
|
||||
});
|
||||
} else if (this.$isEEUiApp) {
|
||||
$A.eeuiAppOpenPage({
|
||||
pageType: 'app',
|
||||
pageTitle: $A.getFileName(item),
|
||||
url: 'web.js',
|
||||
params: {
|
||||
titleFixed: true,
|
||||
url: $A.apiUrl(`../token?token=${this.userToken}&from=${encodeURIComponent($A.apiUrl(`..${uri}`))}`)
|
||||
},
|
||||
});
|
||||
} else {
|
||||
window.open($A.apiUrl(`..${uri}`))
|
||||
}
|
||||
this.browseFile(0);
|
||||
},
|
||||
|
||||
|
||||
@ -3,7 +3,7 @@
|
||||
<PageTitle :title="pageName"/>
|
||||
<Loading v-if="loadIng > 0"/>
|
||||
<template v-else-if="fileInfo">
|
||||
<FilePreview v-if="isPreview" :code="code" :file="fileInfo" :historyId="historyId"/>
|
||||
<FilePreview v-if="isPreview" :code="code" :file="fileInfo" :historyId="historyId" :headerShow="!$isEEUiApp"/>
|
||||
<FileContent v-else v-model="fileShow" :file="fileInfo"/>
|
||||
</template>
|
||||
</div>
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user