From ecf6d2ccc69c1e8bd2068c16f232b98bf4a8c234 Mon Sep 17 00:00:00 2001
From: Junjie <DELL@qq.com>
Date: 星期一, 19 一月 2026 15:14:57 +0800
Subject: [PATCH] #
---
src/main/webapp/views/tvDevice/tvDevice.html | 74 +++++++++++++++++++++++++++++++++++-
1 files changed, 71 insertions(+), 3 deletions(-)
diff --git a/src/main/webapp/views/tvDevice/tvDevice.html b/src/main/webapp/views/tvDevice/tvDevice.html
index 9b1ae73..103e18f 100644
--- a/src/main/webapp/views/tvDevice/tvDevice.html
+++ b/src/main/webapp/views/tvDevice/tvDevice.html
@@ -181,13 +181,15 @@
</template>
</el-table-column>
<el-table-column prop="remark" label="澶囨敞" min-width="100" show-overflow-tooltip></el-table-column>
- <el-table-column label="鎿嶄綔" width="300" align="center" fixed="right">
+ <el-table-column label="鎿嶄綔" width="350" align="center" fixed="right">
<template slot-scope="scope">
<el-button type="text" size="small" @click="showEditDialog(scope.row)">缂栬緫</el-button>
<el-button type="text" size="small" @click="testConnection(scope.row)"
- :loading="scope.row.testing">娴嬭瘯杩炴帴</el-button>
+ :loading="scope.row.testing">娴嬭瘯</el-button>
<el-button type="text" size="small" style="color: #67c23a;" @click="launchApp(scope.row)"
:loading="scope.row.launching">鍚姩</el-button>
+ <el-button type="text" size="small" style="color: #e6a23c;" @click="restartApp(scope.row)"
+ :loading="scope.row.restarting">閲嶅惎</el-button>
<el-button type="text" size="small" style="color: #409eff;"
@click="captureScreen(scope.row)" :loading="scope.row.capturing">鎴浘</el-button>
<el-button type="text" size="small" style="color: #f56c6c;"
@@ -302,7 +304,11 @@
<el-form-item>
<el-button type="success" @click="batchLaunchApp" :loading="launching"
:disabled="launchForm.deviceIds.length === 0">
- <i class="el-icon-video-play"></i> 鎵归噺鍚姩搴旂敤
+ <i class="el-icon-video-play"></i> 鎵归噺鍚姩
+ </el-button>
+ <el-button type="warning" @click="batchRestartApp" :loading="launching"
+ :disabled="launchForm.deviceIds.length === 0">
+ <i class="el-icon-refresh"></i> 鎵归噺閲嶅惎
</el-button>
</el-form-item>
</el-form>
@@ -679,6 +685,68 @@
});
},
+ // 鍗曚釜璁惧閲嶅惎搴旂敤
+ restartApp(row) {
+ this.$set(row, 'restarting', true);
+ $.ajax({
+ url: baseUrl + '/tvDevice/restartApp/' + row.id + '/auth',
+ headers: this.getHeaders(),
+ method: 'POST',
+ contentType: 'application/json;charset=UTF-8',
+ data: JSON.stringify({ packageName: this.launchForm.packageName }),
+ success: (res) => {
+ this.$set(row, 'restarting', false);
+ if (res.code === 200) {
+ Object.assign(row, res.data.device);
+ this.$message.success('閲嶅惎鎴愬姛');
+ this.installResult = res.data.result;
+ } else {
+ this.$message.error(res.msg || '閲嶅惎澶辫触');
+ }
+ },
+ error: () => {
+ this.$set(row, 'restarting', false);
+ this.$message.error('璇锋眰澶辫触');
+ }
+ });
+ },
+
+ // 鎵归噺閲嶅惎搴旂敤
+ batchRestartApp() {
+ if (this.launchForm.deviceIds.length === 0) {
+ this.$message.warning('璇烽�夋嫨璁惧');
+ return;
+ }
+
+ this.launching = true;
+ this.installResult = '';
+
+ $.ajax({
+ url: baseUrl + '/tvDevice/batchRestartApp/auth',
+ headers: this.getHeaders(),
+ method: 'POST',
+ contentType: 'application/json;charset=UTF-8',
+ data: JSON.stringify({
+ deviceIds: this.launchForm.deviceIds,
+ packageName: this.launchForm.packageName
+ }),
+ success: (res) => {
+ this.launching = false;
+ if (res.code === 200) {
+ this.installResult = res.data.join('\n');
+ this.$message.success('閲嶅惎瀹屾垚');
+ this.loadData();
+ } else {
+ this.$message.error(res.msg || '閲嶅惎澶辫触');
+ }
+ },
+ error: () => {
+ this.launching = false;
+ this.$message.error('璇锋眰澶辫触');
+ }
+ });
+ },
+
// 鎼滅储
handleSearch() {
this.currentPage = 1;
--
Gitblit v1.9.1