web端产品库 vite版本
This commit is contained in:
@@ -66,14 +66,40 @@ const $decimalCalc = (...arr) => {
|
||||
* @param { boolean } immediate true 表立即执行,false 表非立即执行
|
||||
*/
|
||||
|
||||
|
||||
export const waiting = {
|
||||
init(ops, count) {
|
||||
if (document.body) {
|
||||
let div = document.createElement('div')
|
||||
div.id = "ai-waiting"
|
||||
div.className = "el-loading-mask is-fullscreen"
|
||||
div.style.zIndex = '202204271710'
|
||||
div.style.textAlign = 'center'
|
||||
div.style.lineHeight = '100vh'
|
||||
document.body.appendChild(div)
|
||||
} else if (count < 10) {
|
||||
setTimeout(() => this.init(ops, ++count), 500)
|
||||
}
|
||||
},
|
||||
getDom() {
|
||||
return document.querySelector('#ai-waiting')
|
||||
},
|
||||
setContent(html) {
|
||||
let div = this.getDom()
|
||||
div.innerHTML = html
|
||||
},
|
||||
close() {
|
||||
let div = this.getDom()
|
||||
div.parentElement.removeChild(div)
|
||||
}
|
||||
}
|
||||
|
||||
export default {
|
||||
...tools,
|
||||
addChildParty,
|
||||
$confirm,
|
||||
$permissions,
|
||||
$decimalCalc
|
||||
$decimalCalc,
|
||||
$waiting: waiting
|
||||
}
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user