From 32f7290778b7726ce23fc5b17f20bb0ed43ca900 Mon Sep 17 00:00:00 2001 From: jhd <1684074631@qq.com> Date: Mon, 13 Jul 2026 09:17:16 +0800 Subject: [PATCH 1/7] =?UTF-8?q?feat(cost):=20=E4=BC=98=E5=8C=96=E6=8A=98?= =?UTF-8?q?=E7=BA=BF=E5=9B=BE=E7=BB=9F=E8=AE=A1=E5=8A=9F=E8=83=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - 实现图表列选择功能,支持已选和待选标签显示 - 添加拖拽排序功能,支持图表列的重新排列 - 集成本地存储,持久化保存图表列选择状态 - 添加删除功能,支持移除不需要的图表列 - 重构图表渲染逻辑,只渲染已选择的列 - 优化对话框布局样式,调整为弹性布局 - 添加空状态提示,改善用户体验 --- klp-ui/src/views/cost/comprehensive.vue | 118 ++++++++++++++++++++++-- 1 file changed, 110 insertions(+), 8 deletions(-) diff --git a/klp-ui/src/views/cost/comprehensive.vue b/klp-ui/src/views/cost/comprehensive.vue index 5a7c79e2d..6b23ee918 100644 --- a/klp-ui/src/views/cost/comprehensive.vue +++ b/klp-ui/src/views/cost/comprehensive.vue @@ -337,12 +337,38 @@ - -
-
+ +
+
+ 已选 + {{ col.itemName || col.metricName || '' }} +
+
+ 待选 + {{ col.itemName || col.metricName || '' }} +
+
+
+
+
@@ -498,7 +524,10 @@ export default { backfilling: false, progressOpen: false, progressTitle: '', progressTasks: [], anomalyOpen: false, anomalyMap: {}, - chartOpen: false, _chartInstances: [] + chartOpen: false, _chartInstances: [], + chartSelectedKeys: [], + _chartTagDragIdx: -1, + _chartTagDragOverIdx: -1 } }, computed: { @@ -599,6 +628,15 @@ export default { const key = 'mv' + col.mIdx return this.gridRows.some(r => r[key] != null) }) + }, + chartActiveCols() { + return this.chartSelectedKeys + .map(key => this.chartDataCols.find(c => this.getColKey(c) === key)) + .filter(Boolean) + }, + chartUnselectedCols() { + const set = new Set(this.chartSelectedKeys) + return this.chartDataCols.filter(c => !set.has(this.getColKey(c))) } }, watch: { configOpen(v) { if (!v) this.rpOpen = false } }, @@ -1266,11 +1304,68 @@ export default { } return makeOption(label, [{ type: 'line', data: rows.map(r => { const v = parseFloat(r['mv'+col.mIdx]); return isNaN(v) ? 0 : v }), smooth: true }]) }, + getColKey(col) { + if (col.$type === 'detail') return 'd-' + col.itemId + return 'm-' + (col.metricId != null ? col.metricId : 'idx' + col.mIdx) + }, + loadChartSelection() { + if (!this.activeReport) return + const key = 'cost_chart_cols_' + this.activeReport.reportId + const allKeys = this.chartDataCols.map(c => this.getColKey(c)) + try { + const saved = localStorage.getItem(key) + if (saved) { + const parsed = JSON.parse(saved) + this.chartSelectedKeys = (parsed.selected || []).filter(k => allKeys.includes(k)) + return + } + } catch (e) { /* ignore */ } + // default: select all + this.chartSelectedKeys = [...allKeys] + }, + saveChartSelection() { + if (!this.activeReport) return + const key = 'cost_chart_cols_' + this.activeReport.reportId + localStorage.setItem(key, JSON.stringify({ selected: this.chartSelectedKeys })) + }, + addChartCol(key) { + this.chartSelectedKeys.push(key) + this.saveChartSelection() + this.renderCharts() + }, + removeChartCol(key) { + const idx = this.chartSelectedKeys.indexOf(key) + if (idx >= 0) this.chartSelectedKeys.splice(idx, 1) + this.saveChartSelection() + this.renderCharts() + }, + onChartTagDragStart(e, idx) { + this._chartTagDragIdx = idx + this._chartTagDragOverIdx = -1 + if (e.dataTransfer) e.dataTransfer.effectAllowed = 'move' + }, + onChartTagDragEnter(idx) { this._chartTagDragOverIdx = idx }, + onChartTagDragLeave() { this._chartTagDragOverIdx = -1 }, + onChartTagDragEnd() { this._chartTagDragIdx = -1; this._chartTagDragOverIdx = -1 }, + onChartTagDrop(targetIdx) { + if (this._chartTagDragIdx < 0 || this._chartTagDragIdx === targetIdx) { this._chartTagDragIdx = -1; this._chartTagDragOverIdx = -1; return } + const [item] = this.chartSelectedKeys.splice(this._chartTagDragIdx, 1) + const insertAt = this._chartTagDragIdx < targetIdx ? targetIdx - 1 : targetIdx + this.chartSelectedKeys.splice(insertAt, 0, item) + this._chartTagDragIdx = -1 + this._chartTagDragOverIdx = -1 + this.saveChartSelection() + this.renderCharts() + }, + onChartOpen() { + this.loadChartSelection() + this.renderCharts() + }, renderCharts() { this.disposeCharts() this.$nextTick(() => { this._chartInstances = [] - this.chartDataCols.forEach((col, idx) => { + this.chartActiveCols.forEach((col, idx) => { const el = this.$refs['chart_'+idx] if (!el || !el[0]) return const chart = echarts.init(el[0]) @@ -1344,9 +1439,16 @@ export default { /deep/ .summary-row td .cell { color: #303133; } .summary-label { font-weight: bold; color: #303133; padding: 0 5px; } .summary-val { font-weight: bold; color: #303133; } -/deep/ .chart-fullscreen { width: 100% !important; max-width: 100% !important; height: 100vh !important; margin: 0 !important; } -/deep/ .chart-fullscreen .el-dialog__body { height: calc(100vh - 90px); overflow: auto; padding: 16px 20px; } -/deep/ .chart-fullscreen .el-dialog__header { padding: 12px 20px; } +/deep/ .chart-fullscreen { width: 100% !important; max-width: 100% !important; height: 100vh !important; margin: 0 !important; display: flex; flex-direction: column; } +/deep/ .chart-fullscreen .el-dialog__body { flex: 1; max-height: none; overflow: auto; padding: 16px 20px; } +/deep/ .chart-fullscreen .el-dialog__header { padding: 12px 20px; flex-shrink: 0; } +.chart-tag-bar { padding: 0 4px 8px; } +.chart-tag-row { display: flex; flex-wrap: wrap; align-items: center; margin-bottom: 4px; } +.chart-tag-row:last-child { margin-bottom: 0; } +.chart-tag-label { font-size: 12px; color: #909399; margin-right: 4px; flex-shrink: 0; } +/deep/ .chart-tag-row .el-tag { transition: transform 0.15s, opacity 0.15s; user-select: none; margin: 1px 4px 1px 0; } +/deep/ .chart-tag-row .el-tag.is-dragging { opacity: 0.3; transform: scale(0.92); } +/deep/ .chart-tag-row .el-tag.drag-over { transform: translateY(-2px); border-color: #409eff !important; } .chart-grid { display: flex; flex-wrap: wrap; } .chart-item { width: 33.33%; padding: 6px; box-sizing: border-box; } From fdba2fb78da5f9e4e823630cfad0e20e57ae9a23 Mon Sep 17 00:00:00 2001 From: jhd <1684074631@qq.com> Date: Mon, 13 Jul 2026 09:50:12 +0800 Subject: [PATCH 2/7] =?UTF-8?q?fix(cost):=20=E4=BF=AE=E5=A4=8D=E5=9B=BE?= =?UTF-8?q?=E8=A1=A8=E5=85=A8=E5=B1=8F=E6=98=BE=E7=A4=BA=E5=92=8C=E9=BB=98?= =?UTF-8?q?=E8=AE=A4=E9=80=89=E6=8B=A9=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - 添加默认选择所有图表项的逻辑 - 修复全屏图表对话框的高度设置 - 调整全屏图表的布局结构为flex布局 - 优化图表头部和主体的样式设置 --- klp-ui/src/views/cost/comprehensive.vue | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/klp-ui/src/views/cost/comprehensive.vue b/klp-ui/src/views/cost/comprehensive.vue index 6736f42c7..138fd8eac 100644 --- a/klp-ui/src/views/cost/comprehensive.vue +++ b/klp-ui/src/views/cost/comprehensive.vue @@ -1321,6 +1321,8 @@ export default { } } catch (e) { /* ignore */ } this.chartSelectedKeys = selected + // default: select all + if (!this.chartSelectedKeys.length) this.chartSelectedKeys = [...allKeys] }, saveChartSelection() { if (!this.activeReport) return @@ -1440,9 +1442,9 @@ export default { /deep/ .summary-row td .cell { color: #303133; } .summary-label { font-weight: bold; color: #303133; padding: 0 5px; } .summary-val { font-weight: bold; color: #303133; } -/deep/ .chart-fullscreen { width: 100% !important; max-width: 100% !important; margin: 0 !important; } -/deep/ .chart-fullscreen .el-dialog__body { max-height: calc(100vh - 90px); overflow: auto; padding: 16px 20px; } -/deep/ .chart-fullscreen .el-dialog__header { padding: 12px 20px; } +/deep/ .chart-fullscreen { width: 100% !important; max-width: 100% !important; height: 100vh !important; margin: 0 !important; display: flex; flex-direction: column; } +/deep/ .chart-fullscreen .el-dialog__body { flex: 1; max-height: none; overflow: auto; padding: 16px 20px; } +/deep/ .chart-fullscreen .el-dialog__header { padding: 12px 20px; flex-shrink: 0; } .chart-tag-bar { padding: 0 4px 8px; } .chart-tag-row { display: flex; flex-wrap: wrap; align-items: center; margin-bottom: 4px; } .chart-tag-row:last-child { margin-bottom: 0; } From 048aeefa77db36a2d23af935b56c5259e36d5357 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9C=B1=E6=98=8A=E5=A4=A9?= <15984976+n2319_0@user.noreply.gitee.com> Date: Mon, 13 Jul 2026 10:39:34 +0800 Subject: [PATCH 3/7] =?UTF-8?q?=E6=95=B0=E5=AD=97=E9=92=A2=E5=8D=B7?= =?UTF-8?q?=E7=9A=84=E4=BF=AE=E6=94=B9=E6=97=A5=E5=BF=97=E5=BC=80=E5=8F=91?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- klp-ui/src/api/wms/coilChangeLog.js | 10 + .../coil/info/components/ChangeLogSection.vue | 486 ++++++++++++++++++ .../coil/info/components/CostInfoSection.vue | 2 + klp-ui/src/views/wms/coil/info/index.vue | 6 +- .../WmsCoilChangeLogController.java | 9 + .../com/klp/domain/vo/WmsCoilChangeLogVo.java | 3 +- .../klp/service/IWmsCoilChangeLogService.java | 5 + .../impl/WmsCoilChangeLogServiceImpl.java | 10 + 8 files changed, 529 insertions(+), 2 deletions(-) create mode 100644 klp-ui/src/api/wms/coilChangeLog.js create mode 100644 klp-ui/src/views/wms/coil/info/components/ChangeLogSection.vue diff --git a/klp-ui/src/api/wms/coilChangeLog.js b/klp-ui/src/api/wms/coilChangeLog.js new file mode 100644 index 000000000..891cb7561 --- /dev/null +++ b/klp-ui/src/api/wms/coilChangeLog.js @@ -0,0 +1,10 @@ +import request from '@/utils/request' + +// 根据钢卷ID查询钢卷变更日志 +export function getCoilChangeLogByCoilId(coilId) { + return request({ + url: '/wms/coilChangeLog/byCoilId/' + coilId, + method: 'get', + timeout: 100000 + }) +} diff --git a/klp-ui/src/views/wms/coil/info/components/ChangeLogSection.vue b/klp-ui/src/views/wms/coil/info/components/ChangeLogSection.vue new file mode 100644 index 000000000..05b05efce --- /dev/null +++ b/klp-ui/src/views/wms/coil/info/components/ChangeLogSection.vue @@ -0,0 +1,486 @@ + + + + + diff --git a/klp-ui/src/views/wms/coil/info/components/CostInfoSection.vue b/klp-ui/src/views/wms/coil/info/components/CostInfoSection.vue index 6c20d66c1..c3c263ccc 100644 --- a/klp-ui/src/views/wms/coil/info/components/CostInfoSection.vue +++ b/klp-ui/src/views/wms/coil/info/components/CostInfoSection.vue @@ -53,6 +53,7 @@
+
@@ -704,4 +705,5 @@ export default { font-weight: 600; color: #f56c6c; } + diff --git a/klp-ui/src/views/wms/coil/info/index.vue b/klp-ui/src/views/wms/coil/info/index.vue index e56a40741..615cc0fb5 100644 --- a/klp-ui/src/views/wms/coil/info/index.vue +++ b/klp-ui/src/views/wms/coil/info/index.vue @@ -1,4 +1,4 @@ -