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地址 - - |任务状态 - - - |开始时间 - - - |描述 - - |操作 -
1compress-16278913929659.10.33.13 -
-
-
运行中
-
-
2021-11-22 11:23:00 - - -
2compress-16278913929649.10.33.13 -
-
-
已完成
-
-
2021-11-22 11:23:00 - - -
3compress-16278913929639.10.33.13 -
-
-
失败
-
-
2021-11-22 11:23:00 - - -
4compress-16278913929629.10.33.13 -
-
-
运行中
-
-
2021-11-22 11:23:00 - - -
5compress-16278913929619.10.33.13 -
-
-
已完成
-
-
2021-11-22 11:23:00 - - -
6compress-16278913929609.10.33.13 -
-
-
失败
-
-
2021-11-22 11:23:00 - - -
7compress-16278913929599.10.33.13 -
-
-
运行中
-
-
2021-11-22 11:23:00 - - -
8compress-16278913929589.10.33.13 -
-
-
已完成
-
-
2021-11-22 11:23:00 - - -
9compress-16278913929579.10.33.13 -
-
-
失败
-
-
2021-11-22 11:23:00 - - -
10compress-16278913929569.10.33.13 -
-
-
运行中
-
-
2021-11-22 11:23:00 - - -
11compress-16278913929559.10.33.13 -
-
-
已完成
-
-
2021-11-22 11:23:00 - - -
12compress-16278913929549.10.33.13 -
-
-
失败
-
-
2021-11-22 11:23:00 - - -
13compress-16278913929539.10.33.13 -
-
-
失败
-
-
2021-11-22 11:23:00 - - -
14compress-16278913929529.10.33.13 -
-
-
运行中
-
-
2021-11-22 11:23:00 - - -
15compress-16278913929519.10.33.13 -
-
-
失败
-
-
2021-11-22 11:23:00 - - -
序号 + |命令/ID + + |IP地址 + + |任务状态 + + + |开始时间 + + + |描述 + + |操作 +
{{ index+1 }}{{ item.name }}{{ item.ip }} +
+
+
+
running
+
+
+
+
finished
+
+
+
+
failed
+
+
+
{{ item.date }} + + +
-
共100条数据
+
共{{recordNum}}条数据
+
- -
-
-
    -
  • - -
  • -
  • 1
  • -
  • 2
  • -
  • 3
  • -
  • 4
  • -
  • 5
  • -
  • - -
  • -
+