From ce13e25ed685ba5c961832d023ceafecf4f30d47 Mon Sep 17 00:00:00 2001
From: Junjie <DELL@qq.com>
Date: 星期六, 10 一月 2026 15:27:33 +0800
Subject: [PATCH] #
---
src/main/webapp/components/WatchDualCrnCard.js | 33 +++++++++++++++++++++++++++------
1 files changed, 27 insertions(+), 6 deletions(-)
diff --git a/src/main/webapp/components/WatchDualCrnCard.js b/src/main/webapp/components/WatchDualCrnCard.js
index 4191450..d221857 100644
--- a/src/main/webapp/components/WatchDualCrnCard.js
+++ b/src/main/webapp/components/WatchDualCrnCard.js
@@ -8,7 +8,7 @@
<el-button @click="getDualCrnStateInfo" size="mini">鏌ヨ</el-button>
</div>
</div>
- <div style="margin-bottom: 10px;">
+ <div style="margin-bottom: 10px;" v-if="!readOnly">
<div style="margin-bottom: 5px;">
<el-button v-if="showControl" @click="openControl" size="mini">鍏抽棴鎺у埗涓績</el-button>
<el-button v-else @click="openControl" size="mini">鎵撳紑鎺у埗涓績</el-button>
@@ -86,7 +86,20 @@
</div>
</div>
`,
- props: ["param"],
+ props: {
+ param: {
+ type: Object,
+ default: () => ({})
+ },
+ autoRefresh: {
+ type: Boolean,
+ default: true
+ },
+ readOnly: {
+ type: Boolean,
+ default: false
+ }
+ },
data() {
return {
crnList: [],
@@ -101,12 +114,20 @@
},
pageSize: 25,
currentPage: 1,
+ timer: null
};
},
created() {
- setInterval(() => {
- this.getDualCrnStateInfo();
- }, 1000);
+ if (this.autoRefresh) {
+ this.timer = setInterval(() => {
+ this.getDualCrnStateInfo();
+ }, 1000);
+ }
+ },
+ beforeDestroy() {
+ if (this.timer) {
+ clearInterval(this.timer);
+ }
},
computed: {
displayCrnList() {
@@ -118,7 +139,7 @@
watch: {
param: {
handler(newVal) {
- if (newVal.crnNo != 0) {
+ if (newVal && newVal.crnNo && newVal.crnNo != 0) {
this.activeNames = newVal.crnNo;
this.searchCrnNo = newVal.crnNo;
const idx = this.crnList.findIndex(i => i.crnNo == newVal.crnNo);
--
Gitblit v1.9.1