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