弹窗自动退出时关闭
continuous-integration/drone/push Build is passing
Details
continuous-integration/drone/push Build is passing
Details
parent
85c4cf89f6
commit
fa2519cba4
|
@ -2,12 +2,13 @@ import Vue from "vue";
|
||||||
import MFACOMP from "./index.vue";
|
import MFACOMP from "./index.vue";
|
||||||
|
|
||||||
const MFAConstructor = Vue.extend(MFACOMP);
|
const MFAConstructor = Vue.extend(MFACOMP);
|
||||||
|
let MFAINSTANCELIST = [];
|
||||||
const MFA = options => {
|
const MFA = options => {
|
||||||
const { UserId, username, EMail, callBack, cancelBack, status = 'login' } = options;
|
const { UserId, username, EMail, callBack, cancelBack, status = 'login' } = options;
|
||||||
if (!UserId) throw `UserId is requred.but ${UserId}`
|
if (!UserId) throw `UserId is requred.but ${UserId}`
|
||||||
const id = `MFA${new Date().getTime()}`;
|
const id = `MFA${new Date().getTime()}`;
|
||||||
const instance = new MFAConstructor();
|
const instance = new MFAConstructor();
|
||||||
|
MFAINSTANCELIST.push(instance)
|
||||||
instance.id = id;
|
instance.id = id;
|
||||||
instance.vm = instance.$mount();
|
instance.vm = instance.$mount();
|
||||||
if (instance.vm.visible) return;
|
if (instance.vm.visible) return;
|
||||||
|
@ -20,7 +21,17 @@ const MFA = options => {
|
||||||
if (cancelBack) cancelBack();
|
if (cancelBack) cancelBack();
|
||||||
document.body.removeChild(instance.vm.$el);
|
document.body.removeChild(instance.vm.$el);
|
||||||
instance.vm.$destroy();
|
instance.vm.$destroy();
|
||||||
|
let index = MFAINSTANCELIST.findIndex(item => item.id === id);
|
||||||
|
MFAINSTANCELIST.splice(index, 1)
|
||||||
});
|
});
|
||||||
return instance.vm;
|
return instance.vm;
|
||||||
}
|
}
|
||||||
|
MFA.close = () => {
|
||||||
|
if (MFAINSTANCELIST.length <= 0) return;
|
||||||
|
MFAINSTANCELIST.forEach(item => {
|
||||||
|
document.body.removeChild(item.vm.$el);
|
||||||
|
item.vm.$destroy();
|
||||||
|
})
|
||||||
|
MFAINSTANCELIST = [];
|
||||||
|
}
|
||||||
export default MFA;
|
export default MFA;
|
|
@ -1,17 +1,17 @@
|
||||||
import Vue from "vue";
|
import Vue from "vue";
|
||||||
import FEEDBACKCOMP from "./index.vue";
|
import FEEDBACKCOMP from "./index.vue";
|
||||||
const FBConstructor = Vue.extend(FEEDBACKCOMP);
|
const FBConstructor = Vue.extend(FEEDBACKCOMP);
|
||||||
|
let FBCINSTANCELIST = [];
|
||||||
const FB = options => {
|
const FB = options => {
|
||||||
const { type, callBack, cancelBack, trialId = null, Id = null, visitTaskId = null, SubjectVisitId = null } = options;
|
const { type, callBack, cancelBack, trialId = null, Id = null, visitTaskId = null, SubjectVisitId = null } = options;
|
||||||
if (!type) throw `type is requred.but ${type}`
|
if (!type) throw `type is requred.but ${type}`
|
||||||
const id = `FB${new Date().getTime()}`;
|
const id = `FB${new Date().getTime()}`;
|
||||||
const instance = new FBConstructor();
|
const instance = new FBConstructor();
|
||||||
|
FBCINSTANCELIST.push(instance);
|
||||||
instance.id = id;
|
instance.id = id;
|
||||||
instance.vm = instance.$mount();
|
instance.vm = instance.$mount();
|
||||||
if (instance.vm.visible) return;
|
if (instance.vm.visible) return;
|
||||||
document.body.appendChild(instance.vm.$el);
|
document.body.appendChild(instance.vm.$el);
|
||||||
console.log(type);
|
|
||||||
instance.vm.open({ type, trialId, Id, visitTaskId, SubjectVisitId });
|
instance.vm.open({ type, trialId, Id, visitTaskId, SubjectVisitId });
|
||||||
instance.vm.$on("success", (Id) => {
|
instance.vm.$on("success", (Id) => {
|
||||||
if (callBack) callBack();
|
if (callBack) callBack();
|
||||||
|
@ -20,8 +20,18 @@ const FB = options => {
|
||||||
instance.vm.$on("closed", () => {
|
instance.vm.$on("closed", () => {
|
||||||
document.body.removeChild(instance.vm.$el);
|
document.body.removeChild(instance.vm.$el);
|
||||||
instance.vm.$destroy();
|
instance.vm.$destroy();
|
||||||
|
let index = FBCINSTANCELIST.findIndex(item => item.id === id);
|
||||||
|
FBCINSTANCELIST.splice(index, 1)
|
||||||
if (cancelBack) cancelBack()
|
if (cancelBack) cancelBack()
|
||||||
});
|
});
|
||||||
return instance.vm;
|
return instance.vm;
|
||||||
}
|
}
|
||||||
|
FB.close = () => {
|
||||||
|
if (FBCINSTANCELIST.length <= 0) return;
|
||||||
|
FBCINSTANCELIST.forEach(item => {
|
||||||
|
document.body.removeChild(item.vm.$el);
|
||||||
|
item.vm.$destroy();
|
||||||
|
})
|
||||||
|
FBCINSTANCELIST = [];
|
||||||
|
}
|
||||||
export default FB;
|
export default FB;
|
|
@ -1,12 +1,13 @@
|
||||||
import Vue from "vue";
|
import Vue from "vue";
|
||||||
import FEEDBACKCOMP from "./index.vue";
|
import FEEDBACKCOMP from "./index.vue";
|
||||||
const FBConstructor = Vue.extend(FEEDBACKCOMP);
|
const FBConstructor = Vue.extend(FEEDBACKCOMP);
|
||||||
|
let FBCTABLEINSTANCELIST = [];
|
||||||
const FBT = (options = {}) => {
|
const FBT = (options = {}) => {
|
||||||
const { data = {}, callBack } = options;
|
const { data = {}, callBack } = options;
|
||||||
// if (!UserId) throw `UserId is requred.but ${UserId}`
|
// if (!UserId) throw `UserId is requred.but ${UserId}`
|
||||||
const id = `FB${new Date().getTime()}`;
|
const id = `FB${new Date().getTime()}`;
|
||||||
const instance = new FBConstructor();
|
const instance = new FBConstructor();
|
||||||
|
FBCTABLEINSTANCELIST.push(instance);
|
||||||
instance.id = id;
|
instance.id = id;
|
||||||
instance.vm = instance.$mount();
|
instance.vm = instance.$mount();
|
||||||
if (instance.vm.visible) return;
|
if (instance.vm.visible) return;
|
||||||
|
@ -18,7 +19,17 @@ const FBT = (options = {}) => {
|
||||||
instance.vm.$on("closed", () => {
|
instance.vm.$on("closed", () => {
|
||||||
document.body.removeChild(instance.vm.$el);
|
document.body.removeChild(instance.vm.$el);
|
||||||
instance.vm.$destroy();
|
instance.vm.$destroy();
|
||||||
|
let index = FBCTABLEINSTANCELIST.findIndex(item => item.id === id);
|
||||||
|
FBCTABLEINSTANCELIST.splice(index, 1)
|
||||||
});
|
});
|
||||||
return instance.vm;
|
return instance.vm;
|
||||||
}
|
}
|
||||||
|
FBT.close = () => {
|
||||||
|
if (FBCTABLEINSTANCELIST.length <= 0) return;
|
||||||
|
FBCTABLEINSTANCELIST.forEach(item => {
|
||||||
|
document.body.removeChild(item.vm.$el);
|
||||||
|
item.vm.$destroy();
|
||||||
|
})
|
||||||
|
FBCTABLEINSTANCELIST = [];
|
||||||
|
}
|
||||||
export default FBT;
|
export default FBT;
|
|
@ -381,6 +381,9 @@ async function VueInit() {
|
||||||
if (_vm.$msgbox) {
|
if (_vm.$msgbox) {
|
||||||
_vm.$msgbox.close();
|
_vm.$msgbox.close();
|
||||||
}
|
}
|
||||||
|
_vm.$FB.close();
|
||||||
|
_vm.$FBT.close();
|
||||||
|
_vm.$MFA.close();
|
||||||
isOpen = false
|
isOpen = false
|
||||||
isLock = null
|
isLock = null
|
||||||
zzSessionStorage.removeItem('isLock')
|
zzSessionStorage.removeItem('isLock')
|
||||||
|
|
Loading…
Reference in New Issue