|
@@ -27,9 +27,19 @@
|
|
|
</a-form-model-item>
|
|
|
</a-form-model>
|
|
|
<div class="table-operator">
|
|
|
- <a-button type="primary" @click="createAndPrint" style="width: 120px;height:40px" size="large" :loading="loading">
|
|
|
- 创建并打印
|
|
|
- </a-button>
|
|
|
+ <a-row>
|
|
|
+ <a-col :span="10">
|
|
|
+ <a-button type="primary" @click="createAndPrint" style="width: 120px;height:40px" size="large" :loading="loading">
|
|
|
+ 创建并打印
|
|
|
+ </a-button>
|
|
|
+ </a-col>
|
|
|
+ <a-col :span="8">
|
|
|
+ <div class="time">
|
|
|
+ {{ txt }} 秒后自动返回主界面!
|
|
|
+ </div>
|
|
|
+ </a-col>
|
|
|
+ </a-row>
|
|
|
+
|
|
|
<!-- <a-button type="primary" @click="print" style="height:60px;width: 100px;margin-left: 1080px" size="large">-->
|
|
|
<!-- 补打-->
|
|
|
<!-- </a-button>-->
|
|
@@ -175,10 +185,30 @@ export default {
|
|
|
video2:undefined,
|
|
|
canvas2:undefined,
|
|
|
video3:undefined,
|
|
|
- canvas3:undefined
|
|
|
+ canvas3:undefined,
|
|
|
+ txt: 30,
|
|
|
+ inactivityTimer: ''
|
|
|
}
|
|
|
},
|
|
|
+ created() {
|
|
|
+ setInterval(() => {
|
|
|
+ this.txt = this.txt -1;
|
|
|
+ }, 1000)
|
|
|
+ this.resetTimer()
|
|
|
+ // 在用户活动时调用 resetTimer 重置定时器
|
|
|
+ document.addEventListener('mousedown', this.resetTimer)
|
|
|
+ document.addEventListener('keydown', this.resetTimer)
|
|
|
+ },
|
|
|
methods: {
|
|
|
+ resetTimer() {
|
|
|
+ this.txt = 30;
|
|
|
+ const self = this
|
|
|
+ clearTimeout(this.inactivityTimer)
|
|
|
+ this.inactivityTimer = setTimeout(() => {
|
|
|
+ // 执行注销操作或者跳转到登录页面的代码
|
|
|
+ self.$router.push('/');
|
|
|
+ }, 0.5 * 60 * 1000) // 30分钟
|
|
|
+ },
|
|
|
tablePaginationChange (pagination) {
|
|
|
// console.log(pagination)
|
|
|
this.pagination.current = pagination.current // 重新设置当前页
|
|
@@ -742,4 +772,11 @@ export default {
|
|
|
/deep/ .tableClass1 {
|
|
|
font-size: 16px;
|
|
|
}
|
|
|
+
|
|
|
+.time {
|
|
|
+ color: #333;
|
|
|
+ font-size: 22px;
|
|
|
+ font-weight: 700;
|
|
|
+ color: red;
|
|
|
+}
|
|
|
</style>
|