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
439262b930
commit
70b0538dd5
@ -318,6 +318,18 @@ export default {
|
|||||||
capsule: config,
|
capsule: config,
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
;(async () => {
|
||||||
|
const cache = await $A.IDBJson("microAppsCapsuleCache");
|
||||||
|
if ($A.isTrue(config.no_cache)) {
|
||||||
|
if (typeof cache[name] === "undefined") {
|
||||||
|
return
|
||||||
|
}
|
||||||
|
delete cache[name];
|
||||||
|
} else {
|
||||||
|
cache[name] = config;
|
||||||
|
}
|
||||||
|
await $A.IDBSet("microAppsCapsuleCache", cache);
|
||||||
|
})()
|
||||||
},
|
},
|
||||||
nextZIndex: () => {
|
nextZIndex: () => {
|
||||||
if (typeof window.modalTransferIndex === 'number') {
|
if (typeof window.modalTransferIndex === 'number') {
|
||||||
@ -386,6 +398,12 @@ export default {
|
|||||||
})
|
})
|
||||||
} else {
|
} 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.isOpen = false
|
||||||
config.postMessage = () => {}
|
config.postMessage = () => {}
|
||||||
config.onBeforeClose = () => true
|
config.onBeforeClose = () => true
|
||||||
|
|||||||
@ -318,8 +318,8 @@ export default {
|
|||||||
background: var(--modal-capsule-bgcolor);
|
background: var(--modal-capsule-bgcolor);
|
||||||
border: 1px solid var(--modal-capsule-bor-color);
|
border: 1px solid var(--modal-capsule-bor-color);
|
||||||
border-radius: 16px;
|
border-radius: 16px;
|
||||||
transition: box-shadow 0.2s, background 0.2s;
|
transition: box-shadow 0.2s, background 0.2s, top 0.2s, right 0.2s;
|
||||||
will-change: box-shadow, background;
|
will-change: box-shadow, background, top, right;
|
||||||
|
|
||||||
&:hover {
|
&:hover {
|
||||||
background: var(--modal-capsule-hov-bgcolor);
|
background: var(--modal-capsule-hov-bgcolor);
|
||||||
|
|||||||
29
resources/assets/js/functions/common.js
vendored
29
resources/assets/js/functions/common.js
vendored
@ -220,11 +220,34 @@ const timezone = require("dayjs/plugin/timezone");
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* 判断是否有
|
* 判断是否有
|
||||||
* @param set
|
* @param val
|
||||||
|
* @param {boolean} enhanced
|
||||||
* @returns {boolean}
|
* @returns {boolean}
|
||||||
*/
|
*/
|
||||||
isHave(set) {
|
isHave(val, enhanced = false) {
|
||||||
return !!(set !== null && set !== "null" && set !== undefined && set !== "undefined" && set);
|
// 基础检查
|
||||||
|
if (val === null || val === "null" || val === undefined || val === "undefined" || !val) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
// 增强检查
|
||||||
|
if (enhanced) {
|
||||||
|
if (Array.isArray(val)) return val.length > 0;
|
||||||
|
if (typeof val === 'object' && val.constructor === Object) return Object.keys(val).length > 0;
|
||||||
|
}
|
||||||
|
return true;
|
||||||
|
},
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 判断是否为真
|
||||||
|
* @param value
|
||||||
|
* @returns {boolean}
|
||||||
|
*/
|
||||||
|
isTrue(value) {
|
||||||
|
const type = typeof value;
|
||||||
|
if (type === 'boolean') return value === true;
|
||||||
|
if (type === 'number') return value === 1;
|
||||||
|
if (type === 'string') return value.toLowerCase() === 'true' || value === '1';
|
||||||
|
return false;
|
||||||
},
|
},
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user