This commit is contained in:
zyy 2020-04-22 18:37:23 +08:00
commit d2eee7fca8
7 changed files with 79 additions and 11 deletions

View File

@ -323,11 +323,16 @@ class SkinCode extends defaultStyle {
}, },
turnBack: { // 按图折返 turnBack: { // 按图折返
lamp: 1, // 灯数量 lamp: 1, // 灯数量
lampSpace: 60 // 灯间距 lampSpace: 60, // 灯间距
textName: '按计划执行',
showLampBorder: true,
topText: true,
toptextDistance: 14,
lineDash: [0]
}, },
StationControl:{ StationControl:{
text: { text: {
distance: 2, // 灯和文字之间的距离 distance: 3, // 灯和文字之间的距离
fontSize: 11, // 字体大小 fontSize: 11, // 字体大小
fontFormat: 'consolas', // 字体格式 fontFormat: 'consolas', // 字体格式
fontColor: '#ffffff', // 字体颜色 fontColor: '#ffffff', // 字体颜色

View File

@ -112,6 +112,25 @@ export default class Station extends Group {
const style = this.style; const style = this.style;
if (model.visible && model.createTurnBack) { if (model.visible && model.createTurnBack) {
this.turnBacks = []; this.turnBacks = [];
if (style.Station.turnBack.topText) {
this.turnBackTopText = new Text({
zlevel: this.zlevel,
z: this.z,
position: [0, 0],
style: {
x: model.turnBackPoint.x,
y: model.turnBackPoint.y - style.Station.lamp.radiusR - style.Station.turnBack.toptextDistance,
fontWeight: style.Station.text.fontWeight,
fontSize: style.Station.text.fontSize,
fontFamily: style.fontFamily,
text: model.name + '站后折返',
textFill: '#fff',
textAlign: 'middle',
textVerticalAlign: 'top'
}
});
this.add(this.turnBackTopText);
}
for (let index = 0; index < style.Station.turnBack.lamp; index++) { for (let index = 0; index < style.Station.turnBack.lamp; index++) {
const turnBack = new EControl({ const turnBack = new EControl({
zlevel: this.zlevel, zlevel: this.zlevel,
@ -123,6 +142,7 @@ export default class Station extends Group {
r: style.Station.lamp.radiusR r: style.Station.lamp.radiusR
}, },
lineWidth: 0, lineWidth: 0,
lineDash: style.Station.turnBack.lineDash,
fill: style.Station.lamp.controlColor fill: style.Station.lamp.controlColor
}, },
text: { text: {
@ -132,7 +152,7 @@ export default class Station extends Group {
fontWeight: style.Station.text.fontWeight, fontWeight: style.Station.text.fontWeight,
fontSize: style.Station.text.fontSize, fontSize: style.Station.text.fontSize,
fontFamily: style.fontFamily, fontFamily: style.fontFamily,
text: '按图折返', text: style.Station.turnBack.textName || '按图折返',
textFill: '#fff', textFill: '#fff',
textAlign: 'middle', textAlign: 'middle',
textVerticalAlign: 'top' textVerticalAlign: 'top'
@ -141,7 +161,10 @@ export default class Station extends Group {
}); });
this.turnBacks.push(turnBack); this.turnBacks.push(turnBack);
} }
this.turnBacks.forEach(lamp => { this.add(lamp); }); this.turnBacks.forEach(lamp => {
lamp.setArcBorder(style.Station.turnBack.showLampBorder);
this.add(lamp);
});
} }
} }
// 创建控制模式 // 创建控制模式

View File

@ -56,9 +56,14 @@ export default class EControl extends Group {
zlevel: this.zlevel, zlevel: this.zlevel,
z: this.z, z: this.z,
silent: true, silent: true,
shape: arcRect, shape: {
x: arcRect.x - 2,
y: arcRect.y - 2,
width: arcRect.width + 4,
height: arcRect.height + 4
},
style: { style: {
lineDash: this.style.arcBorderStyle.lineDash, lineDash: this.arcStyle.lineDash || this.style.arcBorderStyle.lineDash,
stroke: this.style.arcBorderStyle.stroke, stroke: this.style.arcBorderStyle.stroke,
fill: this.style.arcBorderStyle.fill fill: this.style.arcBorderStyle.fill
} }

View File

@ -232,6 +232,7 @@ const socket = {
permissionOver: {}, // 权限结束 permissionOver: {}, // 权限结束
roomIsSubscribe:false, // 房间是否订阅 roomIsSubscribe:false, // 房间是否订阅
assistantIsSubscribe:false, // 综合演练仿真聊天是否订阅
isInRoom:false, // 是否己经进入房间 isInRoom:false, // 是否己经进入房间
tipOperateCount: 0, // 任务结束提示消息 tipOperateCount: 0, // 任务结束提示消息
@ -294,6 +295,9 @@ const socket = {
setRoomSubscribe:(state, roomIsSubscribe)=>{ setRoomSubscribe:(state, roomIsSubscribe)=>{
state.roomIsSubscribe = roomIsSubscribe; state.roomIsSubscribe = roomIsSubscribe;
}, },
setAssistantSubscribe:(state, assistantIsSubscribe)=>{
state.assistantIsSubscribe = assistantIsSubscribe;
},
setInRoom:(state, isInRoom)=>{ setInRoom:(state, isInRoom)=>{
state.isInRoom = isInRoom; state.isInRoom = isInRoom;
} }
@ -361,6 +365,9 @@ const socket = {
setRoomSubscribe:({ commit }, msg) => { setRoomSubscribe:({ commit }, msg) => {
commit('setRoomSubscribe', msg); commit('setRoomSubscribe', msg);
}, },
setAssistantSubscribe:({ commit }, msg) => {
commit('setAssistantSubscribe', msg);
},
setInRoom:({ commit }, msg) => { setInRoom:({ commit }, msg) => {
commit('setInRoom', msg); commit('setInRoom', msg);
} }

View File

@ -5,6 +5,7 @@ import store from '@/store/index_APP_TARGET';
export const displayTopic = '/user/queue/simulation'; // 其他仿真topic export const displayTopic = '/user/queue/simulation'; // 其他仿真topic
export const perpetualTopic = '/user/topic/message'; // 公用topic export const perpetualTopic = '/user/topic/message'; // 公用topic
export const roomTopic = '/user/queue/room'; // 房间topic export const roomTopic = '/user/queue/room'; // 房间topic
export const assistant = '/user/topic/simulation/assistant';// 房间里仿真聊天topic
// 建立连接并订阅地址 // 建立连接并订阅地址
export function creatSubscribe(topic, header) { export function creatSubscribe(topic, header) {

View File

@ -45,9 +45,11 @@
</div> </div>
</template> </template>
<script> <script>
import { getToken } from '@/utils/auth';
import { creatSubscribe, clearSubscribe, assistant} from '@/utils/stomp';
import ChatSetting from './chatSetting'; import ChatSetting from './chatSetting';
import RecordRTC from 'recordrtc'; import RecordRTC from 'recordrtc';
import {getSimulationMembersNew, getSimulationConversationListNew, getSimulationConversationIdNew} from '@/api/chat'; import {getSimulationMembersNew, getSimulationConversationListNew} from '@/api/chat';
import ConstConfig from '@/scripts/ConstConfig'; import ConstConfig from '@/scripts/ConstConfig';
import Cookies from 'js-cookie'; import Cookies from 'js-cookie';
export default { export default {
@ -55,6 +57,12 @@ export default {
components:{ components:{
ChatSetting ChatSetting
}, },
props: {
group: {
type: String,
required: true
}
},
data() { data() {
return { return {
minimize:false, minimize:false,
@ -70,11 +78,12 @@ export default {
mounted() { mounted() {
this.initPage(); this.initPage();
}, },
async beforeDestroy() {
this.clearSubscribe();
},
methods:{ methods:{
initPage() { async initPage() {
// getSimulationConversationIdNew({ memberId:'' }, this.$route.query.group).then(response=>{ await this.subscribe();
// debugger;
// });
getSimulationConversationListNew(this.$route.query.group).then(resp=>{ getSimulationConversationListNew(this.$route.query.group).then(resp=>{
debugger; debugger;
}); });
@ -82,6 +91,7 @@ export default {
handleMinimality(data) { handleMinimality(data) {
if (data == 'min') { if (data == 'min') {
this.minimize = true; this.minimize = true;
this.$refs.chatSetting.doClose();
} else { } else {
this.minimize = false; this.minimize = false;
} }
@ -90,6 +100,7 @@ export default {
startRecording() { startRecording() {
const that = this; const that = this;
if (!this.recordSending && !this.recorders && !this.microphone) { if (!this.recordSending && !this.recorders && !this.microphone) {
this.$refs.chatSetting.doClose();
navigator.getUserMedia( navigator.getUserMedia(
{ audio: true } // { audio: true } //
, function (stream) { , function (stream) {
@ -179,6 +190,7 @@ export default {
this.$refs.chatSetting.doShow(); this.$refs.chatSetting.doShow();
}, },
handleMembers() { handleMembers() {
this.$refs.chatSetting.doClose();
if (this.showMembers) { if (this.showMembers) {
this.showMembers = false; this.showMembers = false;
} else { } else {
@ -200,6 +212,18 @@ export default {
}); });
} }
},
async subscribe() {
if (!this.$store.state.socket.assistantIsSubscribe) {
this.clearSubscribe();
const header = { group: this.group || '', 'X-Token': getToken() };
creatSubscribe(`${assistant}\/${this.group}`, header);
await this.$store.dispatch('socket/setAssistantSubscribe', true);
}
},
async clearSubscribe() {
clearSubscribe(`${assistant}\/${this.group}`);
await this.$store.dispatch('socket/setAssistantSubscribe', false);
} }
} }
}; };

View File

@ -55,6 +55,9 @@ export default {
doShow() { doShow() {
this.dialogVisible = true; this.dialogVisible = true;
}, },
doClose() {
this.dialogVisible = false;
},
changeLanguage() { changeLanguage() {
}, },