| | |
| | | <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> |
| | |
| | | </div> |
| | | </div> |
| | | `, |
| | | props: ["param"], |
| | | props: { |
| | | param: { |
| | | type: Object, |
| | | default: () => ({}) |
| | | }, |
| | | autoRefresh: { |
| | | type: Boolean, |
| | | default: true |
| | | }, |
| | | readOnly: { |
| | | type: Boolean, |
| | | default: false |
| | | } |
| | | }, |
| | | data() { |
| | | return { |
| | | crnList: [], |
| | |
| | | }, |
| | | 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() { |
| | |
| | | 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); |