diff --git a/src/app/routes/data-v/card/card.component.less b/src/app/routes/data-v/card/card.component.less new file mode 100644 index 0000000..626ed6e --- /dev/null +++ b/src/app/routes/data-v/card/card.component.less @@ -0,0 +1,15 @@ +.card-content { + height: 18rem; + padding: 1rem 1.5rem; + background-image: url('../../../../assets/dashboard/dashboard_card_bg.jpg'); + background-size: cover; + /* 背景图片尺寸适应 */ + background-position: top; +} + +.card-content-title { + font-size: 18px; + color: #94DDF3; + font-weight: 600; + margin-bottom: 0.5rem; +} \ No newline at end of file diff --git a/src/app/routes/data-v/card/card.component.ts b/src/app/routes/data-v/card/card.component.ts new file mode 100644 index 0000000..b8482b4 --- /dev/null +++ b/src/app/routes/data-v/card/card.component.ts @@ -0,0 +1,17 @@ +// parent.component.ts +import { Component, Input } from '@angular/core'; + +@Component({ + selector: 'data-v-card', + standalone: true, + template: ` +
+
{{title}}
+ +
+ `, + styleUrls: ['./card.component.less'] +}) +export class DataVCardComponent { + @Input() title: string = ""; +} \ No newline at end of file diff --git a/src/app/routes/data-v/home/home.component.html b/src/app/routes/data-v/home/home.component.html index eab12f5..9143941 100644 --- a/src/app/routes/data-v/home/home.component.html +++ b/src/app/routes/data-v/home/home.component.html @@ -8,7 +8,7 @@ -
+
diff --git a/src/app/routes/data-v/navigation/navigation.component.ts b/src/app/routes/data-v/navigation/navigation.component.ts index 624dca1..2085466 100644 --- a/src/app/routes/data-v/navigation/navigation.component.ts +++ b/src/app/routes/data-v/navigation/navigation.component.ts @@ -6,10 +6,10 @@ import { ModalHelper, _HttpClient } from '@delon/theme'; import { SHARED_IMPORTS } from '@shared'; @Component({ - selector: 'data-v-navigation', - standalone: true, - imports: [RouterOutlet, ...SHARED_IMPORTS], - template: ` + selector: 'data-v-navigation', + standalone: true, + imports: [RouterOutlet, ...SHARED_IMPORTS], + template: ` `, - styleUrls: ['./navigation.component.less'] + styleUrls: ['./navigation.component.less'] }) export class DataVNavigationComponent implements OnInit { - private readonly http = inject(_HttpClient); - private readonly modal = inject(ModalHelper); + private readonly http = inject(_HttpClient); + private readonly modal = inject(ModalHelper); - imageUrl: string = 'assets/dashboard/menu_btn_l.png'; - title: string = 'Label'; + imageUrl: string = 'assets/dashboard/menu_btn_l.png'; + title: string = 'Label'; - context: string = '2024-02-29 10:00'; + context: string = '2024-02-29 10:00'; - ngOnInit(): void { } + ngOnInit(): void { } - add(): void { - } + add(): void { + } } diff --git a/src/app/routes/data-v/title/title.component.less b/src/app/routes/data-v/title/title.component.less new file mode 100644 index 0000000..5e062ba --- /dev/null +++ b/src/app/routes/data-v/title/title.component.less @@ -0,0 +1,18 @@ +.title-container { + width: 100%; + height: 2rem; + // /* 水平宽度占据整个视口宽度 */ + // background-image: url('../../../../assets/dashboard/dashboard_workstation.jpg'); + // background-size: cover; + // /* 背景图片尺寸适应 */ + // background-position: top; +} + +img { + width: 100%; + /* 图片宽度占满父容器 */ + height: auto; + /* 高度自适应,保持宽高比 */ + display: block; + /* 将图片显示为块级元素 */ +} \ No newline at end of file diff --git a/src/app/routes/data-v/title/title.component.ts b/src/app/routes/data-v/title/title.component.ts new file mode 100644 index 0000000..be19c03 --- /dev/null +++ b/src/app/routes/data-v/title/title.component.ts @@ -0,0 +1,17 @@ +// parent.component.ts +import { Component, Input } from '@angular/core'; + +@Component({ + selector: 'data-v-title', + standalone: true, + template: ` +
+ +
{{title}}
+
+ `, + styleUrls: ['./title.component.less'] +}) +export class DataVTitleComponent { + @Input() title: string = "123"; +} \ No newline at end of file diff --git a/src/app/routes/data-v/workstation/workstation.component.html b/src/app/routes/data-v/workstation/workstation.component.html index 8f8ccfb..2b8e2ae 100644 --- a/src/app/routes/data-v/workstation/workstation.component.html +++ b/src/app/routes/data-v/workstation/workstation.component.html @@ -1,27 +1,32 @@ -
-
- -
-
-
待办任务
- + +
+ + -
-
-
已办任务
- + + + -
+ + + + + + + + +
-
-
+
+ +
+ \ No newline at end of file diff --git a/src/app/routes/data-v/workstation/workstation.component.less b/src/app/routes/data-v/workstation/workstation.component.less index fa3ce1e..65f38e3 100644 --- a/src/app/routes/data-v/workstation/workstation.component.less +++ b/src/app/routes/data-v/workstation/workstation.component.less @@ -1,21 +1,20 @@ -.workstation-header { - width: 100%; - height: 3rem; - /* 水平宽度占据整个视口宽度 */ - background-image: url('../../../../assets/dashboard/dashboard_workstation.jpg'); - background-size: cover; - /* 背景图片尺寸适应 */ - background-position: top; -} - -.workstation-content { - height: 18rem; - padding: 1rem 1.5rem; - background-image: url('../../../../assets/dashboard/dashboard_card_bg.jpg'); - background-size: cover; - /* 背景图片尺寸适应 */ - background-position: top; -} +// .workstation-header { +// width: 100%; +// height: 3rem; +// /* 水平宽度占据整个视口宽度 */ +// background-image: url('../../../../assets/dashboard/dashboard_workstation.jpg'); +// background-size: cover; +// /* 背景图片尺寸适应 */ +// background-position: top; +// } +// .workstation-content { +// height: 18rem; +// padding: 1rem 1.5rem; +// background-image: url('../../../../assets/dashboard/dashboard_card_bg.jpg'); +// background-size: cover; +// /* 背景图片尺寸适应 */ +// background-position: top; +// } .workstation-content-title { font-size: 18px; @@ -37,7 +36,35 @@ height: 14rem; } -.inner-box { - background: #0092ff; - padding: 8px 0; +/* 设置滚动条的宽度 */ +.ag-theme-datav ::ng-deep .ag-body-vertical-scroll-viewport::-webkit-scrollbar { + width: 12px; +} + +/* 设置滚动条滑块的样式 */ +.ag-theme-datav ::ng-deep .ag-body-vertical-scroll-viewport::-webkit-scrollbar-thumb { + background-color: red; + /* 滚动条滑块的背景颜色 */ + border-radius: 6px; + /* 圆角 */ + border: 2px solid orange; + /* 滚动条滑块的边框 */ +} + +/* 设置滚动条轨道的样式 */ +.ag-theme-datav ::ng-deep .ag-body-vertical-scroll-viewport::-webkit-scrollbar-track { + background-color: yellow; + /* 滚动条轨道的背景颜色 */ +} + +/* 设置滚动条滑块悬浮时的样式 */ +.ag-theme-datav ::ng-deep .ag-body-vertical-scroll-viewport::-webkit-scrollbar-thumb:hover { + background-color: darkred; + /* 滚动条滑块悬浮时的背景颜色 */ +} + +/* 设置滚动条滑块激活(即正在拖动滑块)时的样式 */ +.ag-theme-datav ::ng-deep .ag-body-vertical-scroll-viewport::-webkit-scrollbar-thumb:active { + background-color: #a00; + /* 滚动条滑块激活时的背景颜色 */ } \ No newline at end of file diff --git a/src/app/routes/data-v/workstation/workstation.component.ts b/src/app/routes/data-v/workstation/workstation.component.ts index a1b1bcf..c56c734 100644 --- a/src/app/routes/data-v/workstation/workstation.component.ts +++ b/src/app/routes/data-v/workstation/workstation.component.ts @@ -1,55 +1,99 @@ -import { Component, OnInit, ViewChild, inject } from '@angular/core'; +import { AfterViewInit, Component, ElementRef, OnInit, ViewChild, inject } from '@angular/core'; import { STColumn, STComponent } from '@delon/abc/st'; import { SFSchema } from '@delon/form'; import { ModalHelper, _HttpClient } from '@delon/theme'; import { SHARED_IMPORTS } from '@shared'; import { AgGridAngular } from 'ag-grid-angular'; // AG Grid Component import { ColDef } from 'ag-grid-community'; // Column Definition Type Interface +import { DataVCardComponent } from '../card/card.component'; +import { DataVTitleComponent } from '../title/title.component'; @Component({ selector: 'app-data-v-workstation', standalone: true, - imports: [AgGridAngular, ...SHARED_IMPORTS], + imports: [AgGridAngular, DataVCardComponent, DataVTitleComponent, ...SHARED_IMPORTS], templateUrl: './workstation.component.html', styleUrls: ['./workstation.component.less'] }) -export class DataVWorkstationComponent implements OnInit { +export class DataVWorkstationComponent implements OnInit, AfterViewInit { private readonly http = inject(_HttpClient); private readonly modal = inject(ModalHelper); + private readonly elementRef = inject(ElementRef); - // Row Data: The data to be displayed. rowData = [ - { make: "Tesla", model: "Model Y", price: 64950, electric: true }, - { make: "Ford", model: "F-Series", price: 33850, electric: false }, - { make: "Toyota", model: "Corolla", price: 29600, electric: false }, - { make: "Tesla", model: "Model Y", price: 64950, electric: true }, - { make: "Ford", model: "F-Series", price: 33850, electric: false }, - { make: "Toyota", model: "Corolla", price: 29600, electric: false }, - { make: "Tesla", model: "Model Y", price: 64950, electric: true }, - { make: "Ford", model: "F-Series", price: 33850, electric: false }, - { make: "Toyota", model: "Corolla", price: 29600, electric: false }, - { make: "Tesla", model: "Model Y", price: 64950, electric: true }, - { make: "Ford", model: "F-Series", price: 33850, electric: false }, - { make: "Toyota", model: "Corolla", price: 29600, electric: false }, - { make: "Tesla", model: "Model Y", price: 64950, electric: true }, - { make: "Ford", model: "F-Series", price: 33850, electric: false }, - { make: "Toyota", model: "Corolla", price: 29600, electric: false }, - { make: "Tesla", model: "Model Y", price: 64950, electric: true }, - { make: "Ford", model: "F-Series", price: 33850, electric: false }, - { make: "Toyota", model: "Corolla", price: 29600, electric: false }, + { + rwmc: "任务1", rwms: "任务描述1", kssj: "2024-1-1", jhwcsj: "2024-1-2", sfcq: '否', dqzt: "正常", dqjd: "节点1", sjwcsj: "2024-1-2", + bjmc: "报警1", bjms: "报警描述1", bjsj: "2024-1-1", gzyy: "-", clff: "-", tzsj: "2024-1-2", zycd: "一般", tzmc: '系统提示', + tznr: '账户登录', fj: "-" + }, + { + rwmc: "任务2", rwms: "任务描述2", kssj: "2024-1-2", jhwcsj: "2024-1-3", sfcq: '否', dqzt: "正常", dqjd: "节点2", sjwcsj: "2024-1-2", + bjmc: "报警2", bjms: "报警描述2", bjsj: "2024-1-2", gzyy: "-", clff: "-", tzsj: "2024-1-2", zycd: "一般", tzmc: '系统提示', + tznr: '账户登录', fj: "-" + }, + { + rwmc: "任务3", rwms: "任务描述3", kssj: "2024-1-3", jhwcsj: "2024-1-4", sfcq: '否', dqzt: "正常", dqjd: "节点3", sjwcsj: "2024-1-2", + bjmc: "报警3", bjms: "报警描述3", bjsj: "2024-1-3", gzyy: "-", clff: "-", tzsj: "2024-1-2", zycd: "一般", tzmc: '系统提示', + tznr: '账户登录', fj: "-" + }, + { + rwmc: "任务4", rwms: "任务描述4", kssj: "2024-1-4", jhwcsj: "2024-1-5", sfcq: '否', dqzt: "正常", dqjd: "节点4", sjwcsj: "2024-1-2", + bjmc: "报警4", bjms: "报警描述4", bjsj: "2024-1-4", gzyy: "-", clff: "-", tzsj: "2024-1-2", zycd: "一般", tzmc: '系统提示', + tznr: '账户登录', fj: "-" + }, + { + rwmc: "任务5", rwms: "任务描述5", kssj: "2024-1-5", jhwcsj: "2024-1-6", sfcq: '否', dqzt: "正常", dqjd: "节点5", sjwcsj: "2024-1-2", + bjmc: "报警5", bjms: "报警描述5", bjsj: "2024-1-5", gzyy: "-", clff: "-", tzsj: "2024-1-2", zycd: "一般", tzmc: '系统提示', + tznr: '账户登录', fj: "-" + }, + ]; + + colDefs1: ColDef[] = [ + { headerName: '任务名称', field: "rwmc", flex: 1 }, + { headerName: '任务描述', field: "rwms", flex: 2 }, + { headerName: '开始时间', field: "kssj", flex: 1 }, + { headerName: '计划完成时间', field: "jhwcsj", flex: 1.5 }, + { headerName: '是否超期', field: "sfcq", flex: 1 }, + ]; + + colDefs2: ColDef[] = [ + { headerName: '任务名称', field: "rwmc", flex: 1 }, + { headerName: '任务描述', field: "rwms", flex: 1 }, + { headerName: '开始时间', field: "kssj", flex: 1 }, + { headerName: '当前状态', field: "dqzt", flex: 1 }, + { headerName: '当前节点', field: "dqjd", flex: 1 }, + { headerName: '实际完成时间', field: "sjwcsj", flex: 1 }, + ]; + + colDefs3: ColDef[] = [ + { headerName: '报警名称', field: "bjmc", flex: 1 }, + { headerName: '报警描述', field: "bjms", flex: 1 }, + { headerName: '报警时间', field: "bjsj", flex: 1 }, + { headerName: '故障原因', field: "gzyy", flex: 1.5 }, + { headerName: '处理方法', field: "clff", flex: 1 }, ]; // Column Definitions: Defines the columns to be displayed. - colDefs: ColDef[] = [ - { field: "make" }, - { field: "model" }, - { field: "price" }, - { field: "electric" } + colDefs4: ColDef[] = [ + { headerName: '通知时间', field: "tzsj", flex: 1 }, + { headerName: '重要程度', field: "zycd", flex: 1 }, + { headerName: '通知名称', field: "tzmc", flex: 1 }, + { headerName: '通知内容', field: "tznr", flex: 1 }, + { headerName: '附件', field: "fj", flex: 1 } ]; ngOnInit(): void { } + ngAfterViewInit(): void { + // 获取 ag-grid 元素 + const gridDiv = this.elementRef.nativeElement.querySelector('.ag-theme-datav'); + // 获取 ag-grid 内部滚动容器元素 + const scrollContainer = gridDiv.querySelector('.ag-body-viewport'); + // 获取滚动条元素 + const scrollBar = gridDiv.querySelector('.ag-scroller'); + } + add(): void { // this.modal // .createStatic(FormEditComponent, { i: { id: 0 } }) diff --git a/src/styles/index.less b/src/styles/index.less index 90d4ee0..30857eb 100644 --- a/src/styles/index.less +++ b/src/styles/index.less @@ -1 +1,19 @@ /* You can add global styles to this file, and also import other style files */ + +/* 修改滚动条宽度、背景色和滑块颜色 */ +::-webkit-scrollbar { + width: 12px; +} + +::-webkit-scrollbar-track { + background: #f1f1f1; +} + +::-webkit-scrollbar-thumb { + background: #888; +} + +/* 鼠标悬停时滚动条滑块颜色 */ +::-webkit-scrollbar-thumb:hover { + background: #555; +} \ No newline at end of file diff --git a/src/styles/theme.less b/src/styles/theme.less index ecbd8c8..7a8b925 100644 --- a/src/styles/theme.less +++ b/src/styles/theme.less @@ -12,4 +12,56 @@ @primary-color: #13C2C2; @alain-default-header-bg: #13C2C2; @alain-default-aside-nav-text-hover-color: #13C2C2; -@alain-default-aside-nav-selected-text-color: #13C2C2; \ No newline at end of file +@alain-default-aside-nav-selected-text-color: #13C2C2; + + +/* 设置滚动条的宽度 */ +.ag-theme-datav ::ng-deep .ag-body-vertical-scroll-viewport::-webkit-scrollbar { + width: 12px; +} + +/* 设置滚动条滑块的样式 */ +.ag-theme-datav ::ng-deep .ag-body-vertical-scroll-viewport::-webkit-scrollbar-thumb { + background-color: red; + /* 滚动条滑块的背景颜色 */ + border-radius: 6px; + /* 圆角 */ + border: 2px solid orange; + /* 滚动条滑块的边框 */ +} + +/* 设置滚动条轨道的样式 */ +.ag-theme-datav ::ng-deep .ag-body-vertical-scroll-viewport::-webkit-scrollbar-track { + background-color: yellow; + /* 滚动条轨道的背景颜色 */ +} + +/* 设置滚动条滑块悬浮时的样式 */ +.ag-theme-datav ::ng-deep .ag-body-vertical-scroll-viewport::-webkit-scrollbar-thumb:hover { + background-color: darkred; + /* 滚动条滑块悬浮时的背景颜色 */ +} + +/* 设置滚动条滑块激活(即正在拖动滑块)时的样式 */ +.ag-theme-datav ::ng-deep .ag-body-vertical-scroll-viewport::-webkit-scrollbar-thumb:active { + background-color: #a00; + /* 滚动条滑块激活时的背景颜色 */ +} + +/* 修改滚动条宽度、背景色和滑块颜色 */ +::-webkit-scrollbar { + width: 12px; +} + +::-webkit-scrollbar-track { + background: #f1f1f1; +} + +::-webkit-scrollbar-thumb { + background: #888; +} + +/* 鼠标悬停时滚动条滑块颜色 */ +::-webkit-scrollbar-thumb:hover { + background: #555; +} \ No newline at end of file