diff --git a/UI2.0/src/js/command-record.js b/UI2.0/src/js/command-record.js index 842002f8f7c27025984f38c4ddc1d4c29b6f469a..0e4aeb7776ab06bd08f3ca31a4f606f28436e12c 100644 --- a/UI2.0/src/js/command-record.js +++ b/UI2.0/src/js/command-record.js @@ -1,16 +1,109 @@ import { defineComponent } from "vue"; +import axios from "./utils/AxiosConfig"; export default defineComponent({ + data() { + return{ + curPage: 1, + recordNum: 0, + recordList: [], + recordType: 'command', + descriptionList: [] + } + }, methods: { - onOfflineClick() { - this.$router.push({ - path: "/offline", - }); + getRecordNum(type) { + var url = '/v1/UI/' + type + '/initialPage' + axios(url, { + uid: this.$store.state.User.userInfo.userId, + }, "get").then(res => { + res = JSON.parse(res) + this.recordNum = res.count + }) + }, + getRecordList(type) { + var url = '/v1/UI/' + type + '/getList' + axios(url, { + uid: this.$store.state.User.userInfo.userId, + pageNum: this.curPage, + pageSize: 15 + }, "get").then(res => { + res = JSON.parse(res) + this.recordList = res.data + for(var i = 0; i < this.recordList.length; i++){ + this.descriptionList[i] = this.recordList[i].description + } + }) }, - onOnlineClick() { - this.$router.push({ - path: "/online", - }); + getRecord(type) { + this.getRecordNum(type) + this.getRecordList(type) + this.recordType = type + this.curPage = 1 }, + getRecordDetail(type, id, mid) { + if(typeof(type) == 'undefined'){ + if(this.recordType == 2) { + this.$router.push({ + path: "/offline", + query: {id: id} + }); + }else { + this.$router.push({ + path: "/online", + query: {id: id} + }); + } + }else if(type == 'tuning') { + this.$router.push({ + path: "/offline", + query: {id: mid} + }); + }else { + this.$router.push({ + path: "/online", + query: {id: mid} + }); + } + }, + updateRecordDescription(index, id) { + if(this.recordList[index].description == this.descriptionList[index]) { + return + } + var url = '/v1/UI/' + this.recordType + '/updateDescription' + if(this.recordType == 'tuning'){ + axios(url, { + tid: id, + description: this.descriptionList[index] + }, "get").then(res => { + res = JSON.parse(res) + if(res.status) { + this.recordList[index].description = this.descriptionList[index] + }else { + this.descriptionList[index] = this.recordList[index].description + } + }) + }else { + axios(url, { + cid: id, + description: this.descriptionList[index] + }, "get").then(res => { + res = JSON.parse(res) + if(res.status) { + this.recordList[index].description = this.descriptionList[index] + }else { + this.descriptionList[index] = this.recordList[index].description + } + }) + } + } + }, + watch:{ + curPage: function(){ + this.getRecord(this.recordType) + } }, + mounted() { + this.getRecord('command') + } }); \ No newline at end of file diff --git a/UI2.0/src/pages/Command-record.vue b/UI2.0/src/pages/Command-record.vue index 9dc5622462b553b2d2b9ad512654398ba32fd19f..2ebacdeddadb1f235a2876ac1cbbba63b1ac4620 100644 --- a/UI2.0/src/pages/Command-record.vue +++ b/UI2.0/src/pages/Command-record.vue @@ -27,15 +27,17 @@ border-bottom-left-radius: 4px; margin-left: 32px; " + @click="getRecord('command')" > 全部 - + @@ -47,322 +49,85 @@ -
| 序号 | -- |命令/ID - | -- |IP地址 - | -
- |任务状态
-
- |
-
- |开始时间
- |
- - |描述 - | -- |操作 - | -
|---|---|---|---|---|---|---|
| 1 | -9.10.33.13 | -
-
-
-
- 运行中
- |
- 2021-11-22 11:23:00 | -- | - - - | -|
| 2 | -9.10.33.13 | -
-
-
-
- 已完成
- |
- 2021-11-22 11:23:00 | -- | - - - | -|
| 3 | -9.10.33.13 | -
-
-
-
- 失败
- |
- 2021-11-22 11:23:00 | -- | - - - | -|
| 4 | -9.10.33.13 | -
-
-
-
- 运行中
- |
- 2021-11-22 11:23:00 | -- | - - - | -|
| 5 | -9.10.33.13 | -
-
-
-
- 已完成
- |
- 2021-11-22 11:23:00 | -- | - - - | -|
| 6 | -9.10.33.13 | -
-
-
-
- 失败
- |
- 2021-11-22 11:23:00 | -- | - - - | -|
| 7 | -9.10.33.13 | -
-
-
-
- 运行中
- |
- 2021-11-22 11:23:00 | -- | - - - | -|
| 8 | -9.10.33.13 | -
-
-
-
- 已完成
- |
- 2021-11-22 11:23:00 | -- | - - - | -|
| 9 | -9.10.33.13 | -
-
-
-
- 失败
- |
- 2021-11-22 11:23:00 | -- | - - - | -|
| 10 | -9.10.33.13 | -
-
-
-
- 运行中
- |
- 2021-11-22 11:23:00 | -- | - - - | -|
| 11 | -9.10.33.13 | -
-
-
-
- 已完成
- |
- 2021-11-22 11:23:00 | -- | - - - | -|
| 12 | -9.10.33.13 | -
-
-
-
- 失败
- |
- 2021-11-22 11:23:00 | -- | - - - | -|
| 13 | -9.10.33.13 | -
-
-
-
- 失败
- |
- 2021-11-22 11:23:00 | -- | - - - | -|
| 14 | -9.10.33.13 | -
-
-
-
- 运行中
- |
- 2021-11-22 11:23:00 | -- | - - - | -|
| 15 | -9.10.33.13 | -
-
-
-
- 失败
- |
- 2021-11-22 11:23:00 | -- | - - - | -|
| 序号 | ++ |命令/ID + | ++ |IP地址 + | +
+ |任务状态
+
+ |
+
+ |开始时间
+ |
+ + |描述 + | ++ |操作 + | +
| {{ index+1 }} | +{{ item.ip }} | +
+
+
+
+
+
+ running
+
+
+
+ finished
+
+
+
+ failed
+ |
+ {{ item.date }} | ++ + + | +