| | |
| | | </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;" |
| | |
| | | <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> |
| | |
| | | }); |
| | | }, |
| | | |
| | | // 单个设备重启应用 |
| | | 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; |