修改worker路径
This commit is contained in:
@@ -141,7 +141,7 @@ export class MainComponent implements OnInit {
|
||||
let data = JSON.parse(event as string);
|
||||
if (data.topic === 'schd') {
|
||||
let message = JSON.parse(data.message);
|
||||
console.log(message);
|
||||
// console.log(message);
|
||||
//是否可以开始处理动态消息
|
||||
if (this.canHandleDynamicMessage) {
|
||||
this.dynamicMessageHandle(message);
|
||||
@@ -150,7 +150,7 @@ export class MainComponent implements OnInit {
|
||||
}
|
||||
} else if (data.topic === 'msg') {
|
||||
let message = JSON.parse(data.message);
|
||||
console.log(message);
|
||||
// console.log(message);
|
||||
if (this.canHandleDynamicAlert) {
|
||||
this.dynamicAlertHandle(message);
|
||||
} else {
|
||||
@@ -471,7 +471,7 @@ export class MainComponent implements OnInit {
|
||||
/**
|
||||
* 创建线程并执行
|
||||
*/
|
||||
public promise: Worker = new Worker('/assets/web-worker-handle.js');
|
||||
public promise: Worker = new Worker('/adminweb/assets/web-worker-handle.js');
|
||||
creatWorkers() {
|
||||
let dynamicData = {
|
||||
raw_data: this.raw_data,
|
||||
@@ -484,7 +484,7 @@ export class MainComponent implements OnInit {
|
||||
}
|
||||
this.promise.postMessage(dynamicData);
|
||||
this.promise.onmessage = function (e) {
|
||||
console.log('=====')
|
||||
// console.log('=====')
|
||||
this.combined_data = e.data;
|
||||
this.selectChange('dynamic');
|
||||
// this.promise.terminate();
|
||||
|
||||
Reference in New Issue
Block a user