desc: 修改综合演练,socket创建

This commit is contained in:
zyy 2019-08-14 16:15:44 +08:00
parent c304af4811
commit ed8b14dac2
8 changed files with 871 additions and 689 deletions

View File

@ -1,12 +1,52 @@
<template>
<div id="app">
<router-view />
<deomon-topic ref="deomonTopic"/>
</div>
</template>
<script>
import { handleToken } from '@/utils/auth';
import { creatSubscribe, perpetualTopic } from '@/utils/stomp';
import DeomonTopic from '@/views/demonstration/deomonTopic';
export default {
name: 'App'
name: 'App',
components: {
DeomonTopic
// QuickMenu
},
watch: {
'$store.state.socket.roomInvite': function (val) {
if (val.creatorId) {
this.subscribeMessage(val);
}
}
},
mounted() {
this.prohibitSystemContextMenu();
this.subscribe();
},
methods: {
prohibitSystemContextMenu() {
window.document.oncontextmenu = function () {
return false;
};
},
subscribe() {
this.$nextTick(() => {
if (!this.$route.path.includes('/login') && this.$route.path != '/404') {
const header = { group: '', 'X-Token': handleToken() };
creatSubscribe(perpetualTopic, header);
}
});
},
subscribeMessage(res) {
if (this.$refs.deomonTopic) {
this.$refs.deomonTopic.doShow(res);
this.$store.dispatch('socket/setRoomInvite');
}
}
}
};
</script>

View File

@ -427,6 +427,6 @@ export default {
thenList: '交路列表',
startStation: '起始站',
endStation: '终到站',
endStation: '终到站'
};

View File

@ -133,6 +133,6 @@ export default {
proximitySection: '请选择接近区段',
accessPropertyType: '请选择进路性质类型',
autoAccessType: '请选择自动进路类型',
physicalSegmentData: '请选择进路物理区段数据',
physicalSegmentData: '请选择进路物理区段数据'
};

View File

@ -4,16 +4,19 @@
<span style="color: white;">{{ item.name }}</span>
</el-menu-item>
<deomon-list ref="deomonList" />
<qcode ref="qcode" />
</div>
</template>
<script>
import DeomonList from '@/views/demonstration/deomonList';
import Qcode from './Qcode';
export default {
name: 'Entry',
components: {
DeomonList
DeomonList,
Qcode
},
data() {
return {
@ -21,6 +24,10 @@ export default {
{
name: '快速入口',
handle: this.quickEntry
},
{
name: '扫码',
handle: this.qcodeEntry
}
],
stomp: null,
@ -39,11 +46,16 @@ export default {
methods: {
quickEntry() {
this.$refs.deomonList.doShow();
},
qcodeEntry() {
this.$refs.qcode.doShow();
}
}
};
</script>
<style rel="stylesheet/scss" lang="scss" scoped>
.avatar-wrapper{
display: inline-block;
}
</style>

View File

@ -0,0 +1,85 @@
<template>
<el-dialog title="输入房间号" :visible.sync="centerDialogVisible" width="30%" center>
<el-input v-model="input" placeholder="请输入房间号" />
<span slot="footer" class="dialog-footer">
<el-button @click="centerDialogVisible = false"> </el-button>
<el-button type="primary" @click="comit"> </el-button>
</span>
</el-dialog>
</template>
<script>
import { getPermissionJoint } from '@/api/chat';
export default {
name: 'Dashboard',
data() {
return {
centerDialogVisible: false,
input: ''
};
},
computed: {
isShow() {
return process.env.NODE_ENV == 'development';
}
},
methods: {
doShow() {
this.centerDialogVisible = true;
},
doClose() {
this.centerDialogVisible = false;
},
async comit() {
await getPermissionJoint(`${this.input}`);
this.centerDialogVisible = false;
}
}
};
</script>
<style rel="stylesheet/scss" lang="scss" scoped>
.dashboard {
&-container {
margin: 30px;
}
&-text {
font-size: 30px;
line-height: 46px;
}
}
/deep/ .el-carousel {
overflow: hidden;
}
.home-box {
float: left;
width: 100%;
font-family: 'Microsoft YaHei';
.title {
font-size: 45px;
text-align: center;
font-weight: 400;
border-bottom: 2px dashed #333;
padding-bottom: 15px;
margin: 50px 200px 120px 200px;
position: relative;
.logo-img {
position: absolute;
right: 0;
top: 0;
width: 55px;
}
}
.card-box {
width: 100%;
padding: 0 300px;
}
}
</style>

View File

@ -7,6 +7,7 @@ var Stomp = require('stompjs');
const isDev = process.env.NODE_ENV === 'development';
const websocketUrl = `${getBaseUrl()}/joylink-websocket?token=`;
// const websocketUrl = `http://192.168.3.6:9000/joylink-websocket?token=`;
var StompClient = function (headers) {
this.url = websocketUrl + handleToken();

View File

@ -9,7 +9,7 @@
:modal="false"
:close-on-click-modal="false"
>
<!-- <el-input placeholder="输入关键字进行过滤" v-model="filterText"></el-input> -->
<!-- <el-input v-model="filterText" placeholder="输入关键字进行过滤" /> -->
<el-scrollbar wrap-class="scrollbar-wrapper" :style="{height: height+'px'}">
<el-tree
ref="tree"

File diff suppressed because it is too large Load Diff