diff --git a/klp-ui/src/api/lines/zinc/pdo.js b/klp-ui/src/api/lines/zinc/pdo.js new file mode 100644 index 00000000..a032aeb4 --- /dev/null +++ b/klp-ui/src/api/lines/zinc/pdo.js @@ -0,0 +1,9 @@ +import zinc1Request from '@/utils/zinc1Request' + +export function listPdo(queryParams) { + return zinc1Request({ + url: '/pdo/list', + method: 'post', + data: queryParams + }) +} \ No newline at end of file diff --git a/klp-ui/src/api/pocket/deviceEnum.js b/klp-ui/src/api/pocket/deviceEnum.js index 1c6ba41f..7cf33ad9 100644 --- a/klp-ui/src/api/pocket/deviceEnum.js +++ b/klp-ui/src/api/pocket/deviceEnum.js @@ -2,7 +2,7 @@ import zinc1Request from '@/utils/zinc1Request' export function listDeviceEnumAll() { return zinc1Request({ - url: '/api/deviceEnum/all', + url: '/deviceEnum/all', method: 'get' }) } diff --git a/klp-ui/src/api/pocket/deviceFieldMeta.js b/klp-ui/src/api/pocket/deviceFieldMeta.js index dfc60d74..29e9aa60 100644 --- a/klp-ui/src/api/pocket/deviceFieldMeta.js +++ b/klp-ui/src/api/pocket/deviceFieldMeta.js @@ -2,7 +2,7 @@ import zinc1Request from '@/utils/zinc1Request' export function getDeviceFieldMetaAll() { return zinc1Request({ - url: '/api/deviceFieldMeta/all', + url: '/deviceFieldMeta/all', method: 'get' }) } diff --git a/klp-ui/src/api/pocket/deviceSnapshot.js b/klp-ui/src/api/pocket/deviceSnapshot.js index 2d8a6c76..a6e75727 100644 --- a/klp-ui/src/api/pocket/deviceSnapshot.js +++ b/klp-ui/src/api/pocket/deviceSnapshot.js @@ -3,7 +3,7 @@ import zinc1Request from '@/utils/zinc1Request' // 获取最新N条设备快照 export function listDeviceSnapshotLatest(params) { return zinc1Request({ - url: '/api/deviceSnapshot/latest', + url: '/deviceSnapshot/latest', method: 'get', params }) @@ -12,7 +12,7 @@ export function listDeviceSnapshotLatest(params) { // 按时间范围查询设备快照 export function listDeviceSnapshotRange(params) { return zinc1Request({ - url: '/api/deviceSnapshot/range', + url: '/deviceSnapshot/range', method: 'get', params }) diff --git a/klp-ui/src/utils/websocketManager.js b/klp-ui/src/utils/websocketManager.js index 5352f380..d56eebbb 100644 --- a/klp-ui/src/utils/websocketManager.js +++ b/klp-ui/src/utils/websocketManager.js @@ -23,6 +23,8 @@ class WebSocketManager { this.disconnect(type) } + console.log(`[WebSocket] 正在连接: ${type}`) + const url = `${this.baseUrl}?type=${type}` console.log(`[WebSocket] 正在连接: ${type}`) diff --git a/klp-ui/src/views/lines/components/DateViewPicker.vue b/klp-ui/src/views/lines/components/DateViewPicker.vue new file mode 100644 index 00000000..de224f0b --- /dev/null +++ b/klp-ui/src/views/lines/components/DateViewPicker.vue @@ -0,0 +1,248 @@ + + + + + \ No newline at end of file diff --git a/klp-ui/src/views/lines/components/knovaStage.vue b/klp-ui/src/views/lines/components/knovaStage.vue deleted file mode 100644 index cd50a7ea..00000000 --- a/klp-ui/src/views/lines/components/knovaStage.vue +++ /dev/null @@ -1,119 +0,0 @@ - - - diff --git a/klp-ui/src/views/lines/rects.js b/klp-ui/src/views/lines/rects.js deleted file mode 100644 index ecf8b9d5..00000000 --- a/klp-ui/src/views/lines/rects.js +++ /dev/null @@ -1,356 +0,0 @@ -export const rects = [ - // 左侧:开卷机 - { - id: 'POR1', - config: { - x: 40, - y: 110, - width: 200, - height: 50, - fill: '#d3d3d3', - stroke: 'black', - strokeWidth: 1, - cursor: 'pointer' - }, - textConfig: { text: '1#开卷机[POR1]' } - }, - { - id: 'POR2', - config: { - x: 40, - y: 220, - width: 200, - height: 50, - fill: '#d3d3d3', - stroke: 'black', - strokeWidth: 1, - cursor: 'pointer' - }, - textConfig: { text: '2#开卷机[POR2]' } - }, - - // 中上部:焊机、入口活套 - { - id: 'WELDER', - config: { - x: 300, - y: 30, - width: 220, - height: 50, - fill: '#d3d3d3', - stroke: 'black', - strokeWidth: 1, - cursor: 'pointer' - }, - textConfig: { text: '焊机[WELDER]' } - }, - { - id: 'ENL1', - config: { - x: 300, - y: 110, - width: 220, - height: 50, - fill: '#d3d3d3', - stroke: 'black', - strokeWidth: 1, - cursor: 'pointer' - }, - textConfig: { text: '入口活套1[ENL1]' } - }, - { - id: 'ENL2', - config: { - x: 300, - y: 160, - width: 220, - height: 50, - fill: '#d3d3d3', - stroke: 'black', - strokeWidth: 1, - cursor: 'pointer' - }, - textConfig: { text: '入口活套2[ENL2]' } - }, - - // 中下部:清洗段 - { - id: 'CLEAN', - config: { - x: 300, - y: 240, - width: 220, - height: 50, - fill: '#d3d3d3', - stroke: 'black', - strokeWidth: 1, - cursor: 'pointer' - }, - textConfig: { text: '清洗段[CLEAN]' } - }, - - // 右侧上:退火炉1-4 - { - id: 'FUR1', - config: { - x: 600, - y: 70, - width: 220, - height: 50, - fill: '#d3d3d3', - stroke: 'black', - strokeWidth: 1, - cursor: 'pointer' - }, - textConfig: { text: '退火炉[FUR1]' } - }, - { - id: 'FUR2', - config: { - x: 600, - y: 120, - width: 220, - height: 50, - fill: '#d3d3d3', - stroke: 'black', - strokeWidth: 1, - cursor: 'pointer' - }, - textConfig: { text: '退火炉[FUR2]' } - }, - { - id: 'FUR3', - config: { - x: 600, - y: 170, - width: 220, - height: 50, - fill: '#d3d3d3', - stroke: 'black', - strokeWidth: 1, - cursor: 'pointer' - }, - textConfig: { text: '退火炉[FUR3]' } - }, - { - id: 'FUR4', - config: { - x: 600, - y: 220, - width: 220, - height: 50, - fill: '#d3d3d3', - stroke: 'black', - strokeWidth: 1, - cursor: 'pointer' - }, - textConfig: { text: '退火炉[FUR4]' } - }, - - // 右侧中:光整机 - { - id: 'TM', - config: { - x: 600, - y: 400, - width: 220, - height: 50, - fill: '#d3d3d3', - stroke: 'black', - strokeWidth: 1, - cursor: 'pointer' - }, - textConfig: { text: '光整机[TM]' } - }, - - // 右侧下:拉矫机 - { - id: 'TL', - config: { - x: 600, - y: 480, - width: 220, - height: 50, - fill: '#d3d3d3', - stroke: 'black', - strokeWidth: 1, - cursor: 'pointer' - }, - textConfig: { text: '拉矫机[TL]' } - }, - - // 中下:后处理 - { - id: 'COAT', - config: { - x: 300, - y: 360, - width: 220, - height: 50, - fill: '#d3d3d3', - stroke: 'black', - strokeWidth: 1, - cursor: 'pointer' - }, - textConfig: { text: '后处理[COAT]' } - }, - - // 中下:出口活套 - { - id: 'CXL1', - config: { - x: 300, - y: 440, - width: 220, - height: 50, - fill: '#d3d3d3', - stroke: 'black', - strokeWidth: 1, - cursor: 'pointer' - }, - textConfig: { text: '出口活套[CXL1]' } - }, - { - id: 'CXL2', - config: { - x: 300, - y: 490, - width: 220, - height: 50, - fill: '#d3d3d3', - stroke: 'black', - strokeWidth: 1, - cursor: 'pointer' - }, - textConfig: { text: '出口活套[CXL2]' } - }, - - // 左下:卷取机、称重位 - { - id: 'TR', - config: { - x: 40, - y: 380, - width: 200, - height: 50, - fill: '#d3d3d3', - stroke: 'black', - strokeWidth: 1, - cursor: 'pointer' - }, - textConfig: { text: '卷取机[TR]' } - }, - { - id: 'WEIT', - config: { - x: 40, - y: 460, - width: 200, - height: 50, - fill: '#d3d3d3', - stroke: 'black', - strokeWidth: 1, - cursor: 'pointer' - }, - textConfig: { text: '称重位[WEIT]' } - } -] - -export const lines = [ - // 1#开卷机 → 焊机 - { - id: 'line-por1-welder', - config: { - points: [ - 40 + 200, 110 + 25, - 40 + 200 + 30, 110 + 25, - 40 + 200 + 30, 30 + 25, - 300, 30 + 25 - ], - stroke: '#686868', - strokeWidth: 2, - lineCap: 'round', - lineJoin: 'round' - } - }, - // 2#开卷机 → 焊机 - { - id: 'line-por2-welder', - config: { - points: [ - 40 + 200, 220 + 25, - 40 + 200 + 30, 220 + 25, - 40 + 200 + 30, 30 + 25, - 300, 30 + 25 - ], - stroke: '#686868', - strokeWidth: 2, - lineCap: 'round', - lineJoin: 'round' - } - }, - // 清洗段 → 退火炉1 - { - id: 'line-clean-fur1', - config: { - points: [ - 300 + 220, 240 + 25, - 300 + 220 + 40, 240 + 25, - 300 + 220 + 40, 70 + 25, - 600, 70 + 25 - ], - stroke: '#686868', - strokeWidth: 2, - lineCap: 'round', - lineJoin: 'round' - } - }, - // 退火炉4 → 光整机 - { - id: 'line-fur4-tm', - config: { - points: [ - 600 + 220, 220 + 25, - 600 + 220 + 40, 220 + 25, - 600 + 220 + 40, 400 + 25, - 600 + 220, 400 + 25 - ], - stroke: '#686868', - strokeWidth: 2, - lineCap: 'round', - lineJoin: 'round' - } - }, - // 拉矫机 → 后处理 - { - id: 'line-tl-coat', - config: { - points: [ - 600, 480 + 25, - 600 - 40, 480 + 25, - 600 - 40, 360 + 25, - 600 - 80, 360 + 25 - ], - stroke: '#686868', - strokeWidth: 2, - lineCap: 'round', - lineJoin: 'round' - } - }, - // 出口活套2 → 卷取机 - { - id: 'line-cxl2-tr', - config: { - points: [ - 300, 490 + 25, - 300 - 30, 490 + 25, - 300 - 30, 380 + 25, - 300 - 60, 380 + 25 - ], - stroke: '#686868', - strokeWidth: 2, - lineCap: 'round', - lineJoin: 'round' - } - } -] \ No newline at end of file diff --git a/klp-ui/src/views/lines/utils/monent.js b/klp-ui/src/views/lines/utils/monent.js new file mode 100644 index 00000000..7a29eb38 --- /dev/null +++ b/klp-ui/src/views/lines/utils/monent.js @@ -0,0 +1,46 @@ +/** + * 获取当前月的第一天和今天的日期(返回数组:[第一天, 今天]) + * @param {string} format 日期格式,默认 'yyyy-MM-dd' + * @returns {string[]} [当前月第一天, 今天] + */ +export function getCurrentMonthFirstDayOrToday(format = 'yyyy-MM-dd') { + // 重写日期格式化逻辑,移除RegExp.$1的使用 + const dateFormatter = (date, fmt) => { + const o = { + 'y+': date.getFullYear().toString(), // 年(转为字符串方便补位) + 'M+': (date.getMonth() + 1).toString(), // 月 + 'd+': date.getDate().toString(), // 日 + }; + + // 处理年份:替换yyyy/yy等格式 + fmt = fmt.replace(/(y+)/, (match, p1) => { + // p1是匹配到的y+(比如yyyy/yy),取年份后p1.length位 + return o['y+'].slice(-p1.length).padStart(p1.length, '0'); + }); + + // 处理月份:替换MM/M等格式 + fmt = fmt.replace(/(M+)/, (match, p1) => { + return o['M+'].padStart(p1.length, '0'); + }); + + // 处理日期:替换dd/d等格式 + fmt = fmt.replace(/(d+)/, (match, p1) => { + return o['d+'].padStart(p1.length, '0'); + }); + + return fmt; + }; + + const now = new Date(); + // 1. 获取当前月第一天 + const firstDay = new Date(now.getFullYear(), now.getMonth(), 1); + // 2. 获取今天 + const today = new Date(); + + // 3. 按指定格式格式化日期 + const firstDayStr = dateFormatter(firstDay, format); + const todayStr = dateFormatter(today, format); + + // 返回 [第一天, 今天] 数组,适配之前Vue代码中dateRange的格式 + return [firstDayStr, todayStr]; +} \ No newline at end of file diff --git a/klp-ui/src/views/lines/zinc/components/product-statistic.vue b/klp-ui/src/views/lines/zinc/components/product-statistic.vue index ffb66d9b..5690e3db 100644 --- a/klp-ui/src/views/lines/zinc/components/product-statistic.vue +++ b/klp-ui/src/views/lines/zinc/components/product-statistic.vue @@ -1,31 +1,35 @@ @@ -149,7 +618,49 @@ export default { background: #f5f7fa; min-height: calc(100vh - 120px); } -.summary-card, .detail-card { + +.summary-card, +.chart-card, +.detail-card { background: #fff; + border: 1px solid #eee; +} + +/* 图表容器样式 */ +.chart-container { + padding: 10px; + display: flex; + flex-wrap: wrap; + gap: 20px; +} + +.chart-item { + flex: 1; + min-width: 400px; +} + +.chart-item.full-width { + flex: 100%; + min-width: 100%; +} + +.chart { + border: 1px solid #e0e0e0; + border-radius: 4px; + background-color: #fafafa; +} + +/* 调整标题样式,贴合工业风 */ +.chart-item h4 { + color: #333; + font-weight: 600; + border-bottom: 1px solid #eee; + padding-bottom: 8px; + margin-bottom: 15px !important; +} + +.el-card__header { + border-bottom: 1px solid #eee; + background-color: #f9f9f9; } \ No newline at end of file diff --git a/klp-ui/src/views/lines/zinc/components/real-time-monitoring.vue b/klp-ui/src/views/lines/zinc/components/real-time-monitoring.vue index 49df4da4..7eed59a5 100644 --- a/klp-ui/src/views/lines/zinc/components/real-time-monitoring.vue +++ b/klp-ui/src/views/lines/zinc/components/real-time-monitoring.vue @@ -1,5 +1,728 @@ \ No newline at end of file + + + + + \ No newline at end of file diff --git a/klp-ui/src/views/lines/zine.vue b/klp-ui/src/views/lines/zine.vue deleted file mode 100644 index ca8b9ced..00000000 --- a/klp-ui/src/views/lines/zine.vue +++ /dev/null @@ -1,466 +0,0 @@ - - - - - diff --git a/klp-ui/src/views/wms/coil/panels/LabelRender/ProductionTagPreview.vue b/klp-ui/src/views/wms/coil/panels/LabelRender/MaterialTag.vue similarity index 100% rename from klp-ui/src/views/wms/coil/panels/LabelRender/ProductionTagPreview.vue rename to klp-ui/src/views/wms/coil/panels/LabelRender/MaterialTag.vue diff --git a/klp-ui/src/views/wms/coil/panels/LabelRender/index.vue b/klp-ui/src/views/wms/coil/panels/LabelRender/index.vue index 7777da2d..754b9232 100644 --- a/klp-ui/src/views/wms/coil/panels/LabelRender/index.vue +++ b/klp-ui/src/views/wms/coil/panels/LabelRender/index.vue @@ -2,7 +2,7 @@
-