mirror of
https://github.com/kuaifan/dootask.git
synced 2025-12-12 11:19:56 +00:00
no message
This commit is contained in:
parent
09cebb90fe
commit
90a4a01de7
@ -368,16 +368,29 @@ export default {
|
||||
* @param config
|
||||
*/
|
||||
async onOpen(config) {
|
||||
// 备份配置
|
||||
this.backupConfigs[config.name] = $A.cloneJSON(config);
|
||||
|
||||
// 如果没有胶囊配置,则从缓存中恢复
|
||||
if (!$A.isHave(config.capsule, true)) {
|
||||
const capsuleCache = await $A.IDBJson("microAppsCapsuleCache");
|
||||
if ($A.isJson(capsuleCache[config.name])) {
|
||||
config.capsule = capsuleCache[config.name];
|
||||
}
|
||||
}
|
||||
|
||||
// 如果是 blank 链接,则在新窗口打开
|
||||
if (/_blank$/i.test(config.url_type)) {
|
||||
await this.inlineBlank(config)
|
||||
return
|
||||
}
|
||||
|
||||
// 如果是外部链接,则在新窗口打开
|
||||
if (config.url_type === 'external') {
|
||||
await this.externalWindow(config)
|
||||
return
|
||||
}
|
||||
this.backupConfigs[config.name] = $A.cloneJSON(config);
|
||||
|
||||
|
||||
const app = this.microApps.find(({name}) => name == config.name);
|
||||
if (app) {
|
||||
// 恢复 keep_alive
|
||||
@ -399,12 +412,6 @@ export default {
|
||||
})
|
||||
} else {
|
||||
// 新建微应用
|
||||
if (!$A.isHave(config.capsule, true)) {
|
||||
const capsuleCache = await $A.IDBJson("microAppsCapsuleCache");
|
||||
if ($A.isJson(capsuleCache[config.name])) {
|
||||
config.capsule = capsuleCache[config.name];
|
||||
}
|
||||
}
|
||||
config.isOpen = false
|
||||
config.postMessage = () => {}
|
||||
config.onBeforeClose = () => true
|
||||
|
||||
@ -9,7 +9,7 @@
|
||||
<!-- 胶囊工具栏 -->
|
||||
<div v-if="capsuleMenuShow" class="micro-modal-cmask"></div>
|
||||
<div class="micro-modal-capsule" :style="capsuleStyle">
|
||||
<div class="micro-modal-capsule-item" @click="onCapsuleMore">
|
||||
<div class="micro-modal-capsule-item" v-touchclick="onCapsuleMore">
|
||||
<svg width="18" height="18" viewBox="0 0 18 18" fill="none" xmlns="http://www.w3.org/2000/svg">
|
||||
<path d="M2 11C3.10457 11 4 10.1046 4 9C4 7.89543 3.10457 7 2 7C0.895431 7 0 7.89543 0 9C0 10.1046 0.895431 11 2 11Z" fill="currentColor"/>
|
||||
<path d="M9 12C10.6569 12 12 10.6569 12 9C12 7.34315 10.6569 6 9 6C7.34315 6 6 7.34315 6 9C6 10.6569 7.34315 12 9 12Z" fill="currentColor"/>
|
||||
@ -17,7 +17,7 @@
|
||||
</svg>
|
||||
</div>
|
||||
<div class="micro-modal-capsule-line"></div>
|
||||
<div class="micro-modal-capsule-item" @click="attemptClose">
|
||||
<div class="micro-modal-capsule-item" v-touchclick="attemptClose">
|
||||
<svg width="18" height="18" viewBox="0 0 18 18" fill="none" xmlns="http://www.w3.org/2000/svg">
|
||||
<path d="M9 16C12.866 16 16 12.866 16 9C16 5.13401 12.866 2 9 2C5.13401 2 2 5.13401 2 9C2 12.866 5.13401 16 9 16Z" stroke="currentColor" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round"/>
|
||||
<path d="M9 12C10.6569 12 12 10.6569 12 9C12 7.34315 10.6569 6 9 6C7.34315 6 6 7.34315 6 9C6 10.6569 7.34315 12 9 12Z" fill="currentColor"/>
|
||||
@ -48,13 +48,13 @@
|
||||
|
||||
<script>
|
||||
import TransferDom from "../../directives/transfer-dom";
|
||||
import touchclick from "../../directives/touchclick";
|
||||
import ResizeLine from "../ResizeLine.vue";
|
||||
import { mapState } from "vuex";
|
||||
|
||||
export default {
|
||||
name: 'MicroModal',
|
||||
components: {ResizeLine},
|
||||
directives: {TransferDom},
|
||||
directives: {TransferDom, touchclick},
|
||||
props: {
|
||||
open: {
|
||||
type: Boolean,
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user