修改worker路径
This commit is contained in:
@@ -141,7 +141,7 @@ export class MainComponent implements OnInit {
|
|||||||
let data = JSON.parse(event as string);
|
let data = JSON.parse(event as string);
|
||||||
if (data.topic === 'schd') {
|
if (data.topic === 'schd') {
|
||||||
let message = JSON.parse(data.message);
|
let message = JSON.parse(data.message);
|
||||||
console.log(message);
|
// console.log(message);
|
||||||
//是否可以开始处理动态消息
|
//是否可以开始处理动态消息
|
||||||
if (this.canHandleDynamicMessage) {
|
if (this.canHandleDynamicMessage) {
|
||||||
this.dynamicMessageHandle(message);
|
this.dynamicMessageHandle(message);
|
||||||
@@ -150,7 +150,7 @@ export class MainComponent implements OnInit {
|
|||||||
}
|
}
|
||||||
} else if (data.topic === 'msg') {
|
} else if (data.topic === 'msg') {
|
||||||
let message = JSON.parse(data.message);
|
let message = JSON.parse(data.message);
|
||||||
console.log(message);
|
// console.log(message);
|
||||||
if (this.canHandleDynamicAlert) {
|
if (this.canHandleDynamicAlert) {
|
||||||
this.dynamicAlertHandle(message);
|
this.dynamicAlertHandle(message);
|
||||||
} else {
|
} 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() {
|
creatWorkers() {
|
||||||
let dynamicData = {
|
let dynamicData = {
|
||||||
raw_data: this.raw_data,
|
raw_data: this.raw_data,
|
||||||
@@ -484,7 +484,7 @@ export class MainComponent implements OnInit {
|
|||||||
}
|
}
|
||||||
this.promise.postMessage(dynamicData);
|
this.promise.postMessage(dynamicData);
|
||||||
this.promise.onmessage = function (e) {
|
this.promise.onmessage = function (e) {
|
||||||
console.log('=====')
|
// console.log('=====')
|
||||||
this.combined_data = e.data;
|
this.combined_data = e.data;
|
||||||
this.selectChange('dynamic');
|
this.selectChange('dynamic');
|
||||||
// this.promise.terminate();
|
// this.promise.terminate();
|
||||||
|
|||||||
Reference in New Issue
Block a user