|
@@ -3,10 +3,10 @@
|
|
|
<div class="header-tabs">
|
|
|
<el-tabs v-model="activeName" type="card" @tab-click="handleClick">
|
|
|
<el-tab-pane label="实时进度" name="0">
|
|
|
- <component :is='components' v-bind="$attrs" v-if="activeName == 0" :review="review" :tableHeight="height"></component>
|
|
|
+ <component :is='components' v-bind="$attrs" v-if="activeName == 0" :review="review" :tableHeight="height" :webSocket="webSocket"></component>
|
|
|
</el-tab-pane>
|
|
|
<el-tab-pane label="任务列表" name="1">
|
|
|
- <component :is='components' v-bind="$attrs" v-if="activeName == 1" :review="review" :tableHeight="height"></component>
|
|
|
+ <component :is='components' v-bind="$attrs" v-if="activeName == 1" :review="review" :tableHeight="height" :webSocket="webSocket"></component>
|
|
|
</el-tab-pane>
|
|
|
</el-tabs>
|
|
|
|
|
@@ -29,16 +29,35 @@ export default {
|
|
|
activeName:0,
|
|
|
components:'realTime',
|
|
|
height:null,
|
|
|
- review:false
|
|
|
+ review:false,
|
|
|
+ webSocket:''
|
|
|
};
|
|
|
},
|
|
|
watch: {},
|
|
|
- computed: {},
|
|
|
+ computed: {
|
|
|
+ userinfo() {
|
|
|
+ return this.$store.state.admin.userinfo
|
|
|
+ }
|
|
|
+ },
|
|
|
created() {},
|
|
|
mounted() {
|
|
|
this.getHeight()
|
|
|
+ this.connectWebSocket()
|
|
|
},
|
|
|
methods: {
|
|
|
+ connectWebSocket() {
|
|
|
+ let webSocket = new WebSocket(`ws://${this.$c.hostname}:8877/api/report/api/ws/`+this.userinfo.id)
|
|
|
+ this.webSocket = webSocket
|
|
|
+ webSocket.onopen = () => {
|
|
|
+ console.log('WebSocket连接成功')
|
|
|
+ }
|
|
|
+ webSocket.onerror = () => {
|
|
|
+ console.log('WebSocket连接失败')
|
|
|
+ }
|
|
|
+ webSocket.onclose = () => {
|
|
|
+ console.log('WebSocket连接关闭')
|
|
|
+ }
|
|
|
+ },
|
|
|
getQueueList(){
|
|
|
this.review = true
|
|
|
this.$nextTick(()=>{
|