| | |
| | | :key="index" |
| | | :data="item" |
| | | :type="'sdk'" |
| | | :address="{ ip: ip, port: port }" |
| | | :id="id" |
| | | ></Card> |
| | | </div> |
| | | <el-select |
| | |
| | | :data="item" |
| | | :key="index" |
| | | :type="'app'" |
| | | :address="{ ip: ip, port: port }" |
| | | :id="id" |
| | | ></Card> |
| | | </div> |
| | | <el-select |
| | |
| | | import Card from "@/views/equipmentManagement/algorithmDetail/components/Card"; |
| | | export default { |
| | | created() { |
| | | this.userId = JSON.parse(sessionStorage.getItem("userInfo")).id; |
| | | this.id = this.$route.query.id; |
| | | this.getData(); |
| | | }, |
| | | data() { |
| | | return { |
| | | deviceData: {}, |
| | | userId: null, |
| | | id: null, |
| | | applicationInfo: [ |
| | | { |
| | | label: "算法总数", |
| | |
| | | { value: "all", label: "全部应用" }, |
| | | { value: "update", label: "待升级应用" }, |
| | | ], //应用下拉框选项 |
| | | ip: this.$route.query.ip, |
| | | port: this.$route.query.port, |
| | | id: this.$route.query.id, |
| | | |
| | | activeApp: [], |
| | | upgradeApp: [], |
| | | activeSdk: [], |
| | | upgradeSdk: [], |
| | | enableSdk: [], |
| | | time: "", |
| | | }; |
| | | }, |
| | |
| | | |
| | | //获取应用列表 |
| | | async getApp() { |
| | | const res = await findAllApp({ ip: this.ip, port: this.port }); |
| | | res.data.data.forEach((item) => { |
| | | const res = await findAllApp({ userId: "", nodeId: this.id }); |
| | | res.data.forEach((item) => { |
| | | if (item.installed) { |
| | | this.activeApp.push(item); |
| | | } |
| | | if (item.installed && item.isUpgrade) { |
| | | this.upgradeApp.push(item); |
| | | } |
| | | if (item.installed && item.enable) { |
| | | this.enableSdk.push(item); |
| | | } |
| | | }); |
| | | |
| | |
| | | this.applicationInfo[3].count = this.upgradeApp.length |
| | | ? this.upgradeApp.length |
| | | : 0; |
| | | |
| | | console.log(this.applicationInfo); |
| | | }, |
| | | |
| | | //获取算法列表 |
| | | async getSdk() { |
| | | const res2 = await findAllSdk({ ip: this.ip, port: this.port }); |
| | | res2.data.data.forEach((item) => { |
| | | const res2 = await findAllSdk({ userId: "", nodeId: this.id }); |
| | | res2.data.forEach((item) => { |
| | | if (item.installed) { |
| | | this.activeSdk.push(item); |
| | | } |
| | |
| | | |
| | | //获取设备时间戳 |
| | | async getTime() { |
| | | const res = await clockInfo({ ip: this.ip, port: this.port }); |
| | | const res = await clockInfo({ userId: this.userId, nodeId: this.id }); |
| | | if (res && res.success) { |
| | | // const timezone = res.data.time_zone; |
| | | let timestamp = res.data.local_time; |
| | |
| | | return this.upgradeSdk; |
| | | } |
| | | |
| | | if (this.algorithm == "process") { |
| | | return this.enableSdk; |
| | | } |
| | | |
| | | return []; |
| | | }, |
| | | applicationArr() { |