Skip to content

Commit e1fbe2a

Browse files
committed
fix ng-zorro css; update echarts
1 parent 572abf3 commit e1fbe2a

File tree

7 files changed

+64
-31
lines changed

7 files changed

+64
-31
lines changed

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@
3838
"dagre-compound": "^0.0.13",
3939
"date-fns": "^4.1.0",
4040
"dayjs": "^1.11.13",
41-
"echarts": "^3.8.5",
41+
"echarts": "^5.5.1",
4242
"monaco-editor": "^0.52.0",
4343
"ng-zorro-antd": "^18.1.1",
4444
"quill": "^1.3.2",

pnpm-lock.yaml

Lines changed: 14 additions & 7 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/app.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ import { enableProdMode } from '@angular/core';
22
import { platformBrowserDynamic } from '@angular/platform-browser-dynamic';
33
import { AppModule } from './app/app.module';
44
import './assets/less/index.less';
5-
import '../node_modules/ng-zorro-antd/ng-zorro-antd.min.css';
5+
require('../node_modules/ng-zorro-antd/ng-zorro-antd.min.css');
66
// import 'quill/dist/quill.bubble.css';
77
// import 'quill/dist/quill.core.css';
88
import 'quill/dist/quill.snow.css';

src/app/app.module.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ const icons: IconDefinition[] = [UserOutline, LockOutline, SettingOutline, Appst
4747
// FormsModule,
4848
// ReactiveFormsModule,
4949
// HttpClientModule,
50-
// RouterModule,
50+
RouterModule,
5151
// AppRouting,
5252
ZorroAntdModule,
5353
],

src/app/charts/chart.component.ts

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -10,17 +10,17 @@ import { Echarts } from '@utils/echarts';
1010
import { format } from 'date-fns'
1111

1212
// 引入柱状图
13-
require('echarts/lib/chart/bar');
14-
require('echarts/lib/chart/line');
15-
require('echarts/lib/chart/pie');
13+
// require('echarts/lib/chart/bar');
14+
// require('echarts/lib/chart/line');
15+
// require('echarts/lib/chart/pie');
1616
// 引入提示框和标题组件
17-
require('echarts/lib/component/title');
18-
require('echarts/lib/component/tooltip');
19-
require('echarts/lib/component/toolbox');
20-
require('echarts/lib/component/legend');
21-
require('echarts/lib/component/legend/ScrollableLegendModel');
22-
require('echarts/lib/component/legend/ScrollableLegendAction');
23-
require('echarts/lib/component/legend/ScrollableLegendView');
17+
// require('echarts/lib/component/title');
18+
// require('echarts/lib/component/tooltip');
19+
// require('echarts/lib/component/toolbox');
20+
// require('echarts/lib/component/legend');
21+
// require('echarts/lib/component/legend/ScrollableLegendModel');
22+
// require('echarts/lib/component/legend/ScrollableLegendAction');
23+
// require('echarts/lib/component/legend/ScrollableLegendView');
2424

2525
@Component({
2626
selector: 'app-charts',
@@ -75,7 +75,7 @@ export class ChartComponent {
7575
// 日期选择
7676
public changedDate () {
7777
this.disable = true;
78-
this.chartService.getSystemLogDate(format(this.date, 'YYYY-MM-DD'))
78+
this.chartService.getSystemLogDate(format(this.date, 'yyyy-MM-dd'))
7979
.pipe(finalize(() => this.disable = false))
8080
.subscribe((res: any) => {
8181
this.initSystemLogDateChart(res.data);

src/app/dashboard/dashboard.component.ts

Lines changed: 14 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -4,16 +4,16 @@ import { Echarts } from '@utils/echarts';
44

55
// const echarts = require('echarts/lib/echarts');
66
// 引入中国地图
7-
require('echarts/map/js/china');
8-
require('echarts/lib/component/visualMap');
7+
// require('echarts/map/js/china');
8+
// require('echarts/lib/component/visualMap');
99
// 引入提示框和标题组件
10-
require('echarts/lib/component/title');
11-
require('echarts/lib/component/tooltip');
12-
require('echarts/lib/component/toolbox');
13-
require('echarts/lib/component/legend');
14-
require('echarts/lib/component/legend/ScrollableLegendModel');
15-
require('echarts/lib/component/legend/ScrollableLegendAction');
16-
require('echarts/lib/component/legend/ScrollableLegendView');
10+
// require('echarts/lib/component/title');
11+
// require('echarts/lib/component/tooltip');
12+
// require('echarts/lib/component/toolbox');
13+
// require('echarts/lib/component/legend');
14+
// require('echarts/lib/component/legend/ScrollableLegendModel');
15+
// require('echarts/lib/component/legend/ScrollableLegendAction');
16+
// require('echarts/lib/component/legend/ScrollableLegendView');
1717

1818
@Component({
1919
selector: 'dashboard',
@@ -32,6 +32,11 @@ export class Dashboard {
3232
}
3333

3434
public ngOnInit () {
35+
// this.initSystemChinaChart([]);
36+
// this.changedSource();
37+
}
38+
39+
ngAfterViewInit() {
3540
this.initSystemChinaChart([]);
3641
this.changedSource();
3742
}

src/utils/echarts/index.ts

Lines changed: 22 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,28 @@
11
/**
22
* echarts
33
*/
4-
const Echarts = require('echarts/lib/echarts');
4+
// const Echarts = require('echarts/lib/echarts');
5+
import * as Echarts from 'echarts/core'
6+
import { VisualMapComponentOption, TitleComponentOption } from 'echarts/components'
7+
import {
8+
TitleComponent,
9+
TooltipComponent,
10+
ToolboxComponent,
11+
LegendComponent,
12+
LegendScrollComponent,
13+
VisualMapComponent,
14+
} from 'echarts/components'
15+
import { CanvasRenderer } from 'echarts/renderers'
16+
17+
Echarts.use([
18+
CanvasRenderer,
19+
TitleComponent,
20+
TooltipComponent,
21+
ToolboxComponent,
22+
LegendComponent,
23+
LegendScrollComponent,
24+
VisualMapComponent,
25+
])
526

627
export {
728
Echarts,

0 commit comments

Comments
 (0)