mirror of
https://github.com/kuaifan/dootask.git
synced 2025-12-14 12:42:51 +00:00
no message
This commit is contained in:
parent
d93092de99
commit
c178e36f9b
@ -252,38 +252,13 @@ export default {
|
|||||||
})
|
})
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
popoutWindow: async (config) => {
|
popoutWindow: async (windowConfig = null) => {
|
||||||
let appConfig = {}
|
const app = this.apps.find(item => item.name == name);
|
||||||
if (config.url) {
|
if (!app) {
|
||||||
appConfig = {
|
$A.modalError("应用不存在");
|
||||||
name: `url-${await $A.getSHA256Hash(config.url)}`,
|
return
|
||||||
url: config.url,
|
|
||||||
}
|
|
||||||
delete config.url
|
|
||||||
} else {
|
|
||||||
const app = this.apps.find(item => item.name == name);
|
|
||||||
if (!app) {
|
|
||||||
$A.modalError("应用不存在");
|
|
||||||
return
|
|
||||||
}
|
|
||||||
appConfig = Object.assign({}, app)
|
|
||||||
}
|
}
|
||||||
|
await this.inlineBlank(app, windowConfig)
|
||||||
appConfig.url_type = 'inline';
|
|
||||||
appConfig.transparent = true
|
|
||||||
appConfig.keep_alive = false
|
|
||||||
|
|
||||||
const apps = (await $A.IDBArray("cacheMicroApps")).filter(item => item.name != appConfig.name);
|
|
||||||
apps.length > 50 && apps.splice(0, 10)
|
|
||||||
apps.push(appConfig)
|
|
||||||
await $A.IDBSet("cacheMicroApps", apps);
|
|
||||||
|
|
||||||
await this.$store.dispatch('openChildWindow', {
|
|
||||||
name: `single-apps-${$A.randomString(6)}`,
|
|
||||||
path: `/single/apps/${appConfig.name}`,
|
|
||||||
force: false,
|
|
||||||
config
|
|
||||||
});
|
|
||||||
},
|
},
|
||||||
openWindow: (params) => {
|
openWindow: (params) => {
|
||||||
if (!$A.isJson(params)) {
|
if (!$A.isJson(params)) {
|
||||||
@ -360,18 +335,21 @@ export default {
|
|||||||
/**
|
/**
|
||||||
* 内联链接,在新窗口打开
|
* 内联链接,在新窗口打开
|
||||||
* @param config
|
* @param config
|
||||||
|
* @param windowConfig
|
||||||
* @returns {Promise<void>}
|
* @returns {Promise<void>}
|
||||||
*/
|
*/
|
||||||
async inlineBlank(config) {
|
async inlineBlank(config, windowConfig = null) {
|
||||||
// 内联链接在新窗口打开固定参数
|
const appConfig = {
|
||||||
config.url_type = 'inline';
|
...config,
|
||||||
config.transparent = true
|
url_type: 'inline',
|
||||||
config.keep_alive = false
|
transparent: true,
|
||||||
|
keep_alive: false,
|
||||||
|
};
|
||||||
//
|
//
|
||||||
const path = `/single/apps/${config.name}`
|
const path = `/single/apps/${appConfig.name}`
|
||||||
const apps = (await $A.IDBArray("cacheMicroApps")).filter(item => item.name != config.name);
|
const apps = (await $A.IDBArray("cacheMicroApps")).filter(item => item.name != appConfig.name);
|
||||||
apps.length > 50 && apps.splice(0, 10)
|
apps.length > 50 && apps.splice(0, 10)
|
||||||
apps.push(config)
|
apps.push(appConfig)
|
||||||
await $A.IDBSet("cacheMicroApps", apps);
|
await $A.IDBSet("cacheMicroApps", apps);
|
||||||
|
|
||||||
if (this.$Electron) {
|
if (this.$Electron) {
|
||||||
@ -379,12 +357,12 @@ export default {
|
|||||||
name: `single-apps-${$A.randomString(6)}`,
|
name: `single-apps-${$A.randomString(6)}`,
|
||||||
path: path,
|
path: path,
|
||||||
force: false,
|
force: false,
|
||||||
config: {
|
config: Object.assign({
|
||||||
title: ' ',
|
title: ' ',
|
||||||
parent: null,
|
parent: null,
|
||||||
width: Math.min(window.screen.availWidth, 1440),
|
width: Math.min(window.screen.availWidth, 1440),
|
||||||
height: Math.min(window.screen.availHeight, 900),
|
height: Math.min(window.screen.availHeight, 900),
|
||||||
},
|
}, $A.isJson(windowConfig) ? windowConfig : {}),
|
||||||
});
|
});
|
||||||
} else if (this.$isEEUIApp) {
|
} else if (this.$isEEUIApp) {
|
||||||
await this.$store.dispatch('openAppChildPage', {
|
await this.$store.dispatch('openAppChildPage', {
|
||||||
@ -402,14 +380,14 @@ export default {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* 外部链接,在新窗口打开
|
* 外部链接,在新窗口打开
|
||||||
* @param url
|
* @param config
|
||||||
* @returns {Promise<void>}
|
* @returns {Promise<void>}
|
||||||
*/
|
*/
|
||||||
async externalWindow({url}) {
|
async externalWindow(config) {
|
||||||
if (this.$Electron) {
|
if (this.$Electron) {
|
||||||
await this.$store.dispatch('openChildWindow', {
|
await this.$store.dispatch('openChildWindow', {
|
||||||
name: `external-apps-${$A.randomString(6)}`,
|
name: `external-apps-${$A.randomString(6)}`,
|
||||||
path: url,
|
path: config.url,
|
||||||
force: false,
|
force: false,
|
||||||
config: {
|
config: {
|
||||||
title: ' ',
|
title: ' ',
|
||||||
@ -423,10 +401,12 @@ export default {
|
|||||||
pageType: 'app',
|
pageType: 'app',
|
||||||
pageTitle: ' ',
|
pageTitle: ' ',
|
||||||
url: 'web.js',
|
url: 'web.js',
|
||||||
params: {url},
|
params: {
|
||||||
|
url: config.url
|
||||||
|
},
|
||||||
});
|
});
|
||||||
} else {
|
} else {
|
||||||
window.open(url)
|
window.open(config.url)
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user