#
Junjie
5 天以前 51a1786ef3e4e016d5f3f7bad8c2e2e8a84247a6
src/main/webapp/components/DevpCard.js
@@ -1,3 +1,5 @@
var stationTracePageVersion = "20260319_station_trace_layout_v2";
Vue.component("devp-card", {
  template: `
    <div class="mc-root">
@@ -32,6 +34,8 @@
          <div class="mc-action-row">
            <button type="button" class="mc-btn" @click="controlCommand">下发</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>
@@ -113,6 +117,7 @@
        targetStationId: ""
      },
      barcodePreviewCache: {},
      showFakeTraceEntry: false,
      pageSize: this.readOnly ? 24 : 12,
      currentPage: 1,
      timer: null
@@ -155,6 +160,7 @@
  },
  created: function () {
    MonitorCardKit.ensureStyles();
    this.loadFakeProcessStatus();
    if (this.autoRefresh) {
      this.timer = setInterval(this.getDevpStateInfo, 1000);
    }
@@ -223,8 +229,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 [
@@ -245,6 +277,7 @@
        { label: "任务可写区", value: this.orDash(item.taskWriteIdx) },
        { label: "故障代码", value: this.orDash(item.error) },
        { label: "故障信息", value: this.orDash(item.errorMsg) },
        { label: "系统告警", value: this.orDash(item.systemWarning) },
        { label: "扩展数据", value: this.orDash(item.extend) }
      ];
    },