修改数据初始化逻辑,避免请求两次数据
This commit is contained in:
parent
aa6d7e6c55
commit
23c657bfcb
|
@ -145,7 +145,12 @@ export default class Initializer {
|
||||||
let $store = options.$store;
|
let $store = options.$store;
|
||||||
if (windows && $store) {
|
if (windows && $store) {
|
||||||
$store.commit("clearWindows");
|
$store.commit("clearWindows");
|
||||||
|
setTimeout(() => {
|
||||||
|
$store.commit("setWindows", []);
|
||||||
|
setTimeout(() => {
|
||||||
$store.commit("setWindows", windows);
|
$store.commit("setWindows", windows);
|
||||||
|
}, 300);
|
||||||
|
}, 300);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -167,7 +172,6 @@ export default class Initializer {
|
||||||
async initialize() {
|
async initialize() {
|
||||||
const options = this.options;
|
const options = this.options;
|
||||||
const $store = options.$store;
|
const $store = options.$store;
|
||||||
|
|
||||||
const global_data = GlobalData.getInstance();
|
const global_data = GlobalData.getInstance();
|
||||||
let client = global_data.getCurrentClient();
|
let client = global_data.getCurrentClient();
|
||||||
if (client) {
|
if (client) {
|
||||||
|
|
|
@ -30,9 +30,9 @@ export default defineComponent({
|
||||||
$q,
|
$q,
|
||||||
};
|
};
|
||||||
|
|
||||||
new Initializer(options).initialize().then(() => {
|
// new Initializer(options).initialize().then(() => {
|
||||||
$store.commit("setInitialized");
|
// $store.commit("setInitialized");
|
||||||
});
|
// });
|
||||||
|
|
||||||
const remote_data_exange_processer = new RemoteDataExangeProcesser(options);
|
const remote_data_exange_processer = new RemoteDataExangeProcesser(options);
|
||||||
remote_data_exange_processer.enable();
|
remote_data_exange_processer.enable();
|
||||||
|
|
|
@ -31,9 +31,9 @@ export default defineComponent({
|
||||||
$q,
|
$q,
|
||||||
};
|
};
|
||||||
|
|
||||||
new Initializer(options).initialize().then(() => {
|
// new Initializer(options).initialize().then(() => {
|
||||||
$store.commit("setInitialized");
|
// $store.commit("setInitialized");
|
||||||
});
|
// });
|
||||||
|
|
||||||
const remote_data_exange_processer = new RemoteDataExangeProcesser(options);
|
const remote_data_exange_processer = new RemoteDataExangeProcesser(options);
|
||||||
remote_data_exange_processer.enable();
|
remote_data_exange_processer.enable();
|
||||||
|
|
Loading…
Reference in New Issue