| | |
| | | <div class="realTime" v-if="realTime">实时</div> |
| | | <div class="poll" v-if="poll">轮询</div> |
| | | <div class="analyse" v-if="analyse">正在分析</div> |
| | | <div class="update" v-if="update">可升级</div> |
| | | <div class="update" v-if="data.isUpgrade">可升级</div> |
| | | </div> |
| | | </div> |
| | | </div> |
| | |
| | | <ul class="info"> |
| | | <li> |
| | | <div class="label">安装时间:</div> |
| | | <div class="data">{{ data.update_time }}</div> |
| | | <div class="data">{{ data.create_time }}</div> |
| | | </li> |
| | | |
| | | <li> |
| | |
| | | |
| | | <li> |
| | | <div class="label">激活码:</div> |
| | | <div class="data">-</div> |
| | | <div class="data" v-if="data.activateCode">{{ data.activateCode }}</div> |
| | | <div class="data" v-else>-</div> |
| | | </li> |
| | | </ul> |
| | | |
| | |
| | | </template> |
| | | |
| | | <script> |
| | | import { unInstallSdk, unInstallApp, installAppSdk } from "@/api/device"; |
| | | //应用卸载 |
| | | import { unInstallApp } from "@/api/device"; |
| | | //算法升级卸载 |
| | | import { downloadOrUpgrade, unInstall } from "@/api/algorithm"; |
| | | |
| | | export default { |
| | | props: { |
| | | data: {}, |
| | | type: {}, |
| | | address: {}, |
| | | id: {}, |
| | | }, |
| | | data() { |
| | | return { |
| | | realTime: true, |
| | | realTime: false, |
| | | poll: false, |
| | | analyse: true, |
| | | update: true, |
| | | analyse: false, |
| | | }; |
| | | }, |
| | | created() { |
| | | console.log(this.data); |
| | | }, |
| | | created() {}, |
| | | methods: { |
| | | //升级 |
| | | async upgrade() { |
| | | const res = await installAppSdk({ |
| | | ip: this.address.ip, |
| | | port: this.address.port, |
| | | id: this.data.id, |
| | | const res = await downloadOrUpgrade({ |
| | | nodeId: this.id, |
| | | path: this.data.id, |
| | | userId: JSON.parse(sessionStorage.getItem("userInfo")).id, |
| | | inputText: data.sdk_name || data.name, |
| | | }); |
| | | |
| | | if (res.success) { |
| | | this.$message({ |
| | | if (res && res.success) { |
| | | this.$notify({ |
| | | type: "success", |
| | | message: "升级成功!", |
| | | }); |
| | | } else { |
| | | this.$message({ |
| | | type: "info", |
| | | message: "升级失败", |
| | | message: "操作成功,请稍后", |
| | | }); |
| | | } |
| | | }, |
| | | //卸载 |
| | | unInstall() { |
| | | this.$confirm(`是否卸载该${this.type == "sdk" ? "算法" : "应用"}`, { |
| | | confirmButtonText: "确认卸载", |
| | |
| | | customClass: "uninstallBox", |
| | | }) |
| | | .then(async () => { |
| | | //卸载算法 |
| | | if (this.type == "sdk") { |
| | | const res = await unInstallSdk({ |
| | | ip: this.address.ip, |
| | | port: this.address.port, |
| | | const res = await unInstall({ |
| | | nodeId: this.id, |
| | | sdkId: this.data.id, |
| | | userId: JSON.parse(sessionStorage.getItem("userInfo")).id, |
| | | }); |
| | | if (res.success) { |
| | | this.$message({ |
| | | if (res && res.success) { |
| | | this.$emit("unInstall"); |
| | | this.$notify({ |
| | | type: "success", |
| | | message: "删除成功!", |
| | | }); |
| | | } else { |
| | | this.$message({ |
| | | type: "info", |
| | | message: "删除失败", |
| | | message: "卸载成功", |
| | | }); |
| | | } |
| | | //卸载应用 |
| | | } else if (this.type == "app") { |
| | | const res = await unInstallApp({ |
| | | ip: this.address.ip, |
| | | port: this.address.port, |
| | | nodeId: this.id, |
| | | appId: this.data.id, |
| | | }); |
| | | if (res.success) { |