From d16c9af7bb89a7e3abb4071003c63b3a6f6b9e4b Mon Sep 17 00:00:00 2001
From: Junjie <fallin.jie@qq.com>
Date: 星期二, 07 四月 2026 14:45:27 +0800
Subject: [PATCH] #
---
src/main/webapp/components/DevpCard.js | 78 +++++++++++++++++++++++++++++++++++++-
1 files changed, 75 insertions(+), 3 deletions(-)
diff --git a/src/main/webapp/components/DevpCard.js b/src/main/webapp/components/DevpCard.js
index d699cfc..e5c8bbb 100644
--- a/src/main/webapp/components/DevpCard.js
+++ b/src/main/webapp/components/DevpCard.js
@@ -1,9 +1,11 @@
+var stationTracePageVersion = "20260319_station_trace_layout_v2";
+
Vue.component("devp-card", {
template: `
<div class="mc-root">
<div class="mc-toolbar">
<div class="mc-title">杈撻�佺洃鎺�</div>
- <div class="mc-search">
+ <div v-if="!readOnly" class="mc-search">
<input class="mc-input" v-model="searchStationId" placeholder="璇疯緭鍏ョ珯鍙�" />
<button type="button" class="mc-btn mc-btn-ghost" @click="getDevpStateInfo">鏌ヨ</button>
</div>
@@ -25,13 +27,21 @@
<span class="mc-field-label">宸ヤ綔鍙�</span>
<input class="mc-input" v-model="controlParam.taskNo" placeholder="杈撳叆宸ヤ綔鍙�" />
</label>
+ <label class="mc-field">
+ <span class="mc-field-label">slotIdx</span>
+ <input class="mc-input" v-model="controlParam.slotIdx" placeholder="杈撳叆缂撳瓨绱㈠紩" />
+ </label>
<label class="mc-field mc-span-2">
<span class="mc-field-label">鐩爣绔�</span>
<input class="mc-input" v-model="controlParam.targetStationId" placeholder="杈撳叆鐩爣绔欏彿" />
</label>
<div class="mc-action-row">
<button type="button" class="mc-btn" @click="controlCommand">涓嬪彂</button>
+ <button type="button" class="mc-btn mc-btn-soft" @click="clearPathByTaskNoCommand">宸ヤ綔鍙锋竻璺緞</button>
+ <button type="button" class="mc-btn mc-btn-soft" @click="clearPathBySlotCommand">绔欑偣娓呰矾寰�</button>
<button type="button" class="mc-btn mc-btn-soft" @click="resetCommand">澶嶄綅</button>
+ <button type="button" class="mc-btn mc-btn-ghost" @click="openStationTracePage">杩愯杞ㄨ抗</button>
+ <button v-if="showFakeTraceEntry" type="button" class="mc-btn mc-btn-ghost" @click="openFakeTracePage">浠跨湡杞ㄨ抗</button>
</div>
</div>
</div>
@@ -88,7 +98,7 @@
<div v-if="displayStationList.length === 0" class="mc-empty">褰撳墠娌℃湁鍙睍绀虹殑绔欑偣鏁版嵁</div>
</div>
- <div class="mc-footer">
+ <div v-if="!readOnly || totalPages > 1" class="mc-footer">
<button type="button" class="mc-page-btn" :disabled="currentPage <= 1" @click="handlePageChange(currentPage - 1)">涓婁竴椤�</button>
<span>{{ currentPage }} / {{ totalPages }}</span>
<button type="button" class="mc-page-btn" :disabled="currentPage >= totalPages" @click="handlePageChange(currentPage + 1)">涓嬩竴椤�</button>
@@ -110,10 +120,12 @@
controlParam: {
stationId: "",
taskNo: "",
+ slotIdx: "",
targetStationId: ""
},
barcodePreviewCache: {},
- pageSize: 12,
+ showFakeTraceEntry: false,
+ pageSize: this.readOnly ? 24 : 12,
currentPage: 1,
timer: null
};
@@ -155,6 +167,7 @@
},
created: function () {
MonitorCardKit.ensureStyles();
+ this.loadFakeProcessStatus();
if (this.autoRefresh) {
this.timer = setInterval(this.getDevpStateInfo, 1000);
}
@@ -168,6 +181,15 @@
methods: {
orDash: function (value) {
return MonitorCardKit.orDash(value);
+ },
+ formatIoMode: function (value) {
+ if (value === 1 || value === "1") {
+ return "鍏ュ簱";
+ }
+ if (value === 2 || value === "2") {
+ return "鍑哄簱";
+ }
+ return "--";
},
getStatusLabel: function (item) {
return item && item.autoing ? "鑷姩" : "鎵嬪姩";
@@ -223,8 +245,34 @@
this.afterDataRefresh();
}
},
+ loadFakeProcessStatus: function () {
+ if (this.readOnly || !window.$ || typeof baseUrl === "undefined") {
+ this.showFakeTraceEntry = false;
+ return;
+ }
+ $.ajax({
+ url: baseUrl + "/openapi/getFakeSystemRunStatus",
+ method: "get",
+ success: function (res) {
+ var data = res && res.data ? res.data : null;
+ this.showFakeTraceEntry = !!(data && data.isFake);
+ }.bind(this),
+ error: function () {
+ this.showFakeTraceEntry = false;
+ }.bind(this)
+ });
+ },
openControl: function () {
this.showControl = !this.showControl;
+ },
+ openFakeTracePage: function () {
+ if (!this.showFakeTraceEntry) {
+ return;
+ }
+ window.open(baseUrl + "/views/watch/fakeTrace.html", "_blank");
+ },
+ openStationTracePage: function () {
+ window.open(baseUrl + "/views/watch/stationTrace.html?v=" + stationTracePageVersion, "_blank");
},
buildDetailEntries: function (item) {
return [
@@ -232,6 +280,7 @@
{ label: "宸ヤ綔鍙�", value: this.orDash(item.taskNo) },
{ label: "鐩爣绔�", value: this.orDash(item.targetStaNo) },
{ label: "妯″紡", value: item.autoing ? "鑷姩" : "鎵嬪姩" },
+ { label: "鍑哄叆搴撴ā寮�", value: this.formatIoMode(item.ioMode) },
{ label: "鏈夌墿", value: MonitorCardKit.yesNo(item.loading) },
{ label: "鍙叆", value: MonitorCardKit.yesNo(item.inEnable) },
{ label: "鍙嚭", value: MonitorCardKit.yesNo(item.outEnable) },
@@ -239,14 +288,31 @@
{ label: "婊℃澘淇″彿", value: MonitorCardKit.yesNo(item.fullPlt) },
{ label: "杩愯闃诲", value: MonitorCardKit.yesNo(item.runBlock) },
{ label: "鍚姩鍏ュ簱", value: MonitorCardKit.yesNo(item.enableIn) },
+ { label: "鍏ュ簱鏉$爜绔欏紓甯�", value: MonitorCardKit.yesNo(item.inBarcodeError) },
{ label: "鎵樼洏楂樺害", value: this.orDash(item.palletHeight) },
{ label: "鏉$爜", value: this.orDash(item.barcode), code: true, type: "barcode" },
{ label: "閲嶉噺", value: this.orDash(item.weight) },
{ label: "浠诲姟鍙啓鍖�", value: this.orDash(item.taskWriteIdx) },
+ { label: "缂撳瓨鍖烘暟鎹�", value: this.formatTaskBufferItems(item.taskBufferItems), code: true },
{ label: "鏁呴殰浠g爜", value: this.orDash(item.error) },
{ label: "鏁呴殰淇℃伅", value: this.orDash(item.errorMsg) },
+ { label: "绯荤粺鍛婅", value: this.orDash(item.systemWarning) },
{ label: "鎵╁睍鏁版嵁", value: this.orDash(item.extend) }
];
+ },
+ formatTaskBufferItems: function (items) {
+ if (!Array.isArray(items) || items.length === 0) {
+ return "--";
+ }
+ return items.map(function (item) {
+ var slotIdx = item && item.slotIdx != null ? item.slotIdx : "?";
+ var taskNo = item && item.taskNo != null ? item.taskNo : 0;
+ var targetStaNo = item && item.targetStaNo != null ? item.targetStaNo : 0;
+ if (!taskNo && !targetStaNo) {
+ return slotIdx + ": 绌�";
+ }
+ return slotIdx + ": " + taskNo + " -> " + targetStaNo;
+ }).join(" | ");
},
postControl: function (url, payload) {
$.ajax({
@@ -436,6 +502,12 @@
controlCommand: function () {
this.postControl("/station/command/move", this.controlParam);
},
+ clearPathByTaskNoCommand: function () {
+ this.postControl("/station/command/clearPath", this.controlParam);
+ },
+ clearPathBySlotCommand: function () {
+ this.postControl("/station/command/clearPathBySlot", this.controlParam);
+ },
resetCommand: function () {
this.postControl("/station/command/reset", this.controlParam);
}
--
Gitblit v1.9.1