From fdd35441437709c470f438e3c789811c5ba60ec1 Mon Sep 17 00:00:00 2001 From: "lijie.hu" Date: Tue, 2 Apr 2024 17:30:12 +0800 Subject: [PATCH 1/2] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E6=AF=9B=E9=87=8D?= =?UTF-8?q?=E8=AE=A1=E9=87=8F=E9=A1=B5=E9=9D=A2=E5=8F=B3=E4=BE=A7=E7=9A=84?= =?UTF-8?q?=E6=A0=B7=E5=BC=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../lj-car-ag-grid-component.component.html | 1 + .../lj-car-info-table.component.css | 33 ++++- .../lj-car-info-table.component.html | 21 +-- .../lj-car-info-table.component.ts | 134 ++++++++++-------- .../data-v/lj-card/lj-card.component.less | 2 +- .../data-v/second1/second1.component.html | 5 +- .../data-v/second1/second1.component.ts | 40 +++++- .../lj-ag-grid-component.component.less | 28 ++-- .../lj-ag-grid-component.component.ts | 4 +- src/assets/dashboard/dashboard_card_bg2.png | Bin 0 -> 3691 bytes 10 files changed, 171 insertions(+), 97 deletions(-) create mode 100644 src/assets/dashboard/dashboard_card_bg2.png diff --git a/src/app/routes/data-v/lj-car-info-table/lj-car-ag-grid-component/lj-car-ag-grid-component.component.html b/src/app/routes/data-v/lj-car-info-table/lj-car-ag-grid-component/lj-car-ag-grid-component.component.html index 6da66b8..be1c43c 100644 --- a/src/app/routes/data-v/lj-car-info-table/lj-car-ag-grid-component/lj-car-ag-grid-component.component.html +++ b/src/app/routes/data-v/lj-car-info-table/lj-car-ag-grid-component/lj-car-ag-grid-component.component.html @@ -2,6 +2,7 @@ #myGrid [class]="gridThemeClass" [pagination]="true" + style="height: 100%" [suppressPaginationPanel]="true" [suppressPaginationPanel]="true" [suppressScrollOnNewData]="true" diff --git a/src/app/routes/data-v/lj-car-info-table/lj-car-info-table.component.css b/src/app/routes/data-v/lj-car-info-table/lj-car-info-table.component.css index d24397c..2c110f3 100644 --- a/src/app/routes/data-v/lj-car-info-table/lj-car-info-table.component.css +++ b/src/app/routes/data-v/lj-car-info-table/lj-car-info-table.component.css @@ -41,7 +41,7 @@ border-radius: 3px; /* 调整内边距以适应内容 */ //position: relative; - background-image: url('../../../../assets/dashboard/dashboard_card_bg.jpg'); + background-image: url('../../../../assets/dashboard/dashboard_card_bg2.png'); background-repeat: no-repeat; /* 防止背景图片重复 */ @@ -104,8 +104,8 @@ border-radius: 3px; } .table-container { - margin: 10px 5px 20px; /* Adjust padding as needed */ - padding: 10px; + margin: 10px 3px 20px 55px; /* Adjust padding as needed */ + padding: 5px; border: 1px solid #fff; /* White border */ /* Other styles */ @@ -115,14 +115,37 @@ border-radius: 3px; .table-header { display: flex; /* 使用 flex 布局 */ justify-content: space-between; /* 元素之间平均分布 */ + } .table-header span { flex: 1; /* 每个元素占据等宽 */ + font-size: 12px; text-align: center; /* 文本居中 */ } .grid-item { - margin-bottom: 10px; - } + display: flex; + align-items: flex-start; /* 内容居上对齐 */ + margin-bottom: 20px; /* 增加底部间距 */ +} + + .rounded-border { + display: flex; + place-items: center center; + justify-content: center; + width: 50px; + height: 40px; + margin-right: 10px; + padding: 3px; + font-size: 26px; + font-weight: 700; + text-align: center; + background-color: #21306A; + border:1px solid #00EFF9; + border-radius: 2px; /* 减小圆角 */ +} + + + \ No newline at end of file diff --git a/src/app/routes/data-v/lj-car-info-table/lj-car-info-table.component.html b/src/app/routes/data-v/lj-car-info-table/lj-car-info-table.component.html index 0d2be2b..d96e21a 100644 --- a/src/app/routes/data-v/lj-car-info-table/lj-car-info-table.component.html +++ b/src/app/routes/data-v/lj-car-info-table/lj-car-info-table.component.html @@ -14,37 +14,42 @@
+
#1
+
+
#2
+
#3
+
#4
diff --git a/src/app/routes/data-v/lj-car-info-table/lj-car-info-table.component.ts b/src/app/routes/data-v/lj-car-info-table/lj-car-info-table.component.ts index d600993..6c1d9b6 100644 --- a/src/app/routes/data-v/lj-car-info-table/lj-car-info-table.component.ts +++ b/src/app/routes/data-v/lj-car-info-table/lj-car-info-table.component.ts @@ -41,16 +41,19 @@ export class DataVLjCarInfoTableComponent implements OnInit { //默认列配置 @Input() defaultColDef: ColDef = { - width: 130, + // width: 130, editable: false, - headerClass: 'ag-header-center', + // headerClass: 'ag-header-center', cellStyle: { 'font-weight': 'bold', textAlign: 'center', 'justify-content': 'center', 'line-height': '38px' } }; /** 列头 */ @Input() columnDefs: ColDef[] = []; /**行数据 */ - @Input() rowData: any[] = []; + @Input() rowData1: any[] = []; + @Input() rowData2: any[] = []; + @Input() rowData3: any[] = []; + @Input() rowData4: any[] = []; /**表格主题 */ @Input() gridThemeClass: string = 'ag-theme-quartz'; @Input() paginationThemeClass: string = 'ag-theme-quartz'; @@ -75,74 +78,85 @@ export class DataVLjCarInfoTableComponent implements OnInit { valueGetter: function (params: any) { return parseInt(params.node.id) + 1; }, - width: 90, - // flex: 2, - sortable: true, - unSortIcon: true, + width: 20, + cellStyle: { 'font-size': '8px' }, field: 'xh' }, - { headerName: '任务名称', unSortIcon: true, width: 120, field: 'rwmc' }, - { headerName: '任务描述', unSortIcon: true, field: 'rwms', width: 120 }, - { headerName: '开始时间', headerClass: 'ag-header-center', unSortIcon: true, field: 'kssj', width: 180 }, - { headerName: '计划完成时间', unSortIcon: true, field: 'jhwcsj', width: 180 }, - { headerName: '超期', width: 70, field: 'sfcq' }, - { headerName: '操作', width: 90, field: 'cz', cellRenderer: GridButtonValueRenderer } + { headerName: '时间', field: 'time', width: 60, cellStyle: { 'font-size': '8px' } }, + { headerName: '车牌', field: 'carNo', width: 60, cellStyle: { 'font-size': '8px' } }, + { headerName: '车型', field: 'carType', width: 50, cellStyle: { 'font-size': '8px' } }, + { headerName: '卡号', field: 'no', width: 50, cellStyle: { 'font-size': '8px' } }, + { headerName: '供应商', width: 50, field: 'supplier', cellStyle: { 'font-size': '8px' } }, + { headerName: '毛重', width: 50, field: 'grossWeight', cellStyle: { 'font-size': '8px' } }, + { headerName: '上报热值', width: 50, field: 'reportHotValue', cellStyle: { 'font-size': '8px' } }, + { headerName: '估算热值', width: 50, field: 'estimateValue', cellStyle: { 'font-size': '8px' } } + // { headerName: '操作', width: 90, field: 'cz', cellRenderer: GridButtonValueRenderer } ]; - tableData = [ - { sort: '1', time: '2024.1.12 18:23', option: '锁定', optionDesc: '锁定1号磅', optionMan: '张三', mark: '早晨', edit: '按钮' }, - { sort: '1', time: '2024.1.12 18:23', option: '释放', optionDesc: '释放1号磅', optionMan: '张三', mark: '早晨', edit: '按钮' }, - { sort: '1', time: '2024.1.12 18:23', option: '锁定', optionDesc: '锁定1号磅', optionMan: '张三', mark: '早晨', edit: '按钮' }, - { sort: '1', time: '2024.1.12 18:23', option: '释放', optionDesc: '释放1号磅', optionMan: '张三', mark: '早晨', edit: '按钮' }, - { sort: '1', time: '2024.1.12 18:23', option: '锁定', optionDesc: '锁定1号磅', optionMan: '张三', mark: '早晨', edit: '按钮' }, - { sort: '1', time: '2024.1.12 18:23', option: '释放', optionDesc: '释放1号磅', optionMan: '张三', mark: '早晨', edit: '按钮' }, - { sort: '1', time: '2024.1.12 18:23', option: '锁定', optionDesc: '锁定1号磅', optionMan: '张三', mark: '早晨', edit: '按钮' }, - { sort: '1', time: '2024.1.12 18:23', option: '释放', optionDesc: '释放1号磅', optionMan: '张三', mark: '早晨', edit: '按钮' }, - { sort: '1', time: '2024.1.12 18:23', option: '锁定', optionDesc: '锁定1号磅', optionMan: '张三', mark: '早晨', edit: '按钮' }, - { sort: '1', time: '2024.1.12 18:23', option: '释放', optionDesc: '释放1号磅', optionMan: '张三', mark: '早晨', edit: '按钮' }, - { sort: '1', time: '2024.1.12 18:23', option: '锁定', optionDesc: '锁定1号磅', optionMan: '张三', mark: '早晨', edit: '按钮' }, - { sort: '1', time: '2024.1.12 18:23', option: '释放', optionDesc: '释放1号磅', optionMan: '张三', mark: '早晨', edit: '按钮' }, - { sort: '1', time: '2024.1.12 18:23', option: '锁定', optionDesc: '锁定1号磅', optionMan: '张三', mark: '早晨', edit: '按钮' }, - { sort: '1', time: '2024.1.12 18:23', option: '释放', optionDesc: '释放1号磅', optionMan: '张三', mark: '早晨', edit: '按钮' }, - { sort: '1', time: '2024.1.12 18:23', option: '锁定', optionDesc: '锁定1号磅', optionMan: '张三', mark: '早晨', edit: '按钮' }, - { sort: '1', time: '2024.1.12 18:23', option: '释放', optionDesc: '释放1号磅', optionMan: '张三', mark: '早晨', edit: '按钮' }, - { sort: '1', time: '2024.1.12 18:23', option: '锁定', optionDesc: '锁定1号磅', optionMan: '张三', mark: '早晨', edit: '按钮' }, - { sort: '1', time: '2024.1.12 18:23', option: '释放', optionDesc: '释放1号磅', optionMan: '张三', mark: '早晨', edit: '按钮' }, - { sort: '1', time: '2024.1.12 18:23', option: '锁定', optionDesc: '锁定1号磅', optionMan: '张三', mark: '早晨', edit: '按钮' }, - { sort: '1', time: '2024.1.12 18:23', option: '释放', optionDesc: '释放1号磅', optionMan: '张三', mark: '早晨', edit: '按钮' } - // 其他数据... - ]; /**初始化 */ ngOnInit() { - for (var i = 1; i < 30; i++) { - this.rowData.push({ - rwmc: `任务${i}`, - rwms: `任务描述${i}`, - kssj: `2024-1-${i} 13:38:${i * 11}`, - jhwcsj: `2024-1-${i} 13:38:${i * 10}`, - sfcq: '否', - dqzt: '正常', - dqjd: `节点${i}`, - sjwcsj: `2024-1-${i} 13:38:${i * 27}`, - bjmc: '报警5', - bjms: '报警描述5', - bjsj: `2024-1-${i} 13:38:${i * 12}`, - gzyy: '-', - clff: '-', - tzsj: `2024-1-${i} 13:38:${i * 19}`, - zycd: '一般', - tzmc: '系统提示', - tznr: '账户登录', - fj: '-', - cz: '操作' - }); - } + this.rowData1.push({ + xh: 1, + time: '13:25', + carNo: 'A4132', + carType: '重卡', + no: '6-*', + supplier: '大同', + grossWeight: '7.15', + reportHotValue: '7.6', + estimateValue: '7.51' + }); + this.rowData1.push({ + xh: 1, + time: '13:25', + carNo: 'A4132', + carType: '重卡', + no: '6-*', + supplier: '大同', + grossWeight: '7.15', + reportHotValue: '7.6', + estimateValue: '7.51' + }); + this.rowData1.push({ + xh: 1, + time: '13:25', + carNo: 'A4132', + carType: '重卡', + no: '6-*', + supplier: '大同', + grossWeight: '7.15', + reportHotValue: '7.6', + estimateValue: '7.51' + }); + // for (var i = 1; i < 30; i++) { + // this.rowData.push({ + // rwmc: `任务${i}`, + // rwms: `任务描述${i}`, + // kssj: `2024-1-${i} 13:38:${i * 11}`, + // jhwcsj: `2024-1-${i} 13:38:${i * 10}`, + // sfcq: '否', + // dqzt: '正常', + // dqjd: `节点${i}`, + // sjwcsj: `2024-1-${i} 13:38:${i * 27}`, + // bjmc: '报警5', + // bjms: '报警描述5', + // bjsj: `2024-1-${i} 13:38:${i * 12}`, + // gzyy: '-', + // clff: '-', + // tzsj: `2024-1-${i} 13:38:${i * 19}`, + // zycd: '一般', + // tzmc: '系统提示', + // tznr: '账户登录', + // fj: '-', + // cz: '操作' + // }); + // } console.log('-----表格初始化-----'); // this.title = ''; this.pageSize = 5; this.pageIndex = 1; - this.pageRowTotal = this.rowData.length; + this.pageRowTotal = this.rowData1.length; } //每页数 nzPageSizeChange(_pageSize: any) { diff --git a/src/app/routes/data-v/lj-card/lj-card.component.less b/src/app/routes/data-v/lj-card/lj-card.component.less index 7a1eebe..43ebe78 100644 --- a/src/app/routes/data-v/lj-card/lj-card.component.less +++ b/src/app/routes/data-v/lj-card/lj-card.component.less @@ -34,8 +34,8 @@ border-radius: 3px; .card-content { overflow: hidden; + height: 250px; margin-bottom: 0.5rem; - //height: 18rem; padding: 1rem 1.5rem; padding: 1rem; diff --git a/src/app/routes/data-v/second1/second1.component.html b/src/app/routes/data-v/second1/second1.component.html index e839afd..5798ae5 100644 --- a/src/app/routes/data-v/second1/second1.component.html +++ b/src/app/routes/data-v/second1/second1.component.html @@ -52,15 +52,16 @@
- +