This commit is contained in:
zyy 2020-04-23 17:12:06 +08:00
commit 98ce2d5890
8 changed files with 161 additions and 73 deletions

View File

@ -173,7 +173,7 @@ export default {
/** 如果车次号为空,不显示名称*/ /** 如果车次号为空,不显示名称*/
if (train.tripNumber) { if (train.tripNumber) {
/** 创建标记点名称和坐标*/ /** 创建标记点名称和坐标*/
pointdata.name = `${service.serviceNumber}${train.directionCode}${train.tripNumber}`; pointdata.name = `${service.serviceNumber}${train.tripNumber}`;
pointdata.color = '#000' || lineStyle.color; pointdata.color = '#000' || lineStyle.color;
pointdata.directionCode = train.directionCode; pointdata.directionCode = train.directionCode;
pointdata.coord = [train.stationTimeList[1].secondTime, this.getCoordYByElem(stations, kmRangeCoordMap, train.stationTimeList[1], train.directionCode, false)]; pointdata.coord = [train.stationTimeList[1].secondTime, this.getCoordYByElem(stations, kmRangeCoordMap, train.stationTimeList[1], train.directionCode, false)];
@ -272,7 +272,7 @@ export default {
serie.markPoint.data.push(createMartPoint({ serie.markPoint.data.push(createMartPoint({
directionCode: elem.directionCode, directionCode: elem.directionCode,
coord: [parseInt(elem.secondTime), this.getCoordYByElem(stations, kmRangeCoordMap, elem, false)], coord: [parseInt(elem.secondTime), this.getCoordYByElem(stations, kmRangeCoordMap, elem, false)],
name: `(${elem.groupNumber})${elem.serviceNumber}${elem.directionCode}${elem.tripNumber}`, name: `(${elem.groupNumber})${elem.serviceNumber}${elem.tripNumber}`,
color: lineStyle.color || '#000' color: lineStyle.color || '#000'
})); }));
} }

View File

@ -63,7 +63,7 @@ service.interceptors.response.use(
}); });
}); });
}); });
} else { } else if (res.code === 500) {
const defaultError = { type: '服务异常:', message: '未知错误!'}; const defaultError = { type: '服务异常:', message: '未知错误!'};
const errorTip = ConstConfig.ConstSelect.interfaceErrorConfig[res.code + '']; const errorTip = ConstConfig.ConstSelect.interfaceErrorConfig[res.code + ''];
Vue.prototype.$alert('<strong>' + (errorTip || defaultError).type + '<i style="color: red;">' + (errorTip || defaultError).message + '</i></strong>', '请求结果', { Vue.prototype.$alert('<strong>' + (errorTip || defaultError).type + '<i style="color: red;">' + (errorTip || defaultError).message + '</i></strong>', '请求结果', {
@ -72,6 +72,8 @@ service.interceptors.response.use(
closeOnClickModal: false closeOnClickModal: false
}).then(() => {}); }).then(() => {});
return Promise.reject(res); return Promise.reject(res);
} else {
return Promise.reject(res);
} }
} else { } else {
return response.data; return response.data;

View File

@ -79,8 +79,8 @@ export default {
this.lessonName = response.data[0].name; this.lessonName = response.data[0].name;
this.lessonRemark = response.data[0].remarks; this.lessonRemark = response.data[0].remarks;
this.loading = false; this.loading = false;
// }).catch(()=>{ }).catch(()=>{
// this.$messageBox(this.$t('approval.failedToGetCourseData')); this.$messageBox(this.$t('approval.failedToGetCourseData'));
}); });
}, },
doClose() { doClose() {

View File

@ -148,8 +148,8 @@ export default {
adminPublishLesson(params, row.id).then(response => { adminPublishLesson(params, row.id).then(response => {
this.$message.success(this.$t('tip.coursePublishSuccessful')); this.$message.success(this.$t('tip.coursePublishSuccessful'));
this.doClose(); this.doClose();
// }).catch(() => { }).catch(() => {
// this.$messageBox(this.$t('tip.coursePublishFailed')); this.$messageBox(this.$t('tip.coursePublishFailed'));
}); });
}); });
}, },
@ -169,7 +169,7 @@ export default {
this.rejectId = ''; this.rejectId = '';
this.doClose(); this.doClose();
}).catch(() => { }).catch(() => {
// this.$messageBox(this.$t('tip.rejectedCourseReleaseApplicationSuccessful')); this.$messageBox(this.$t('tip.rejectedCourseReleaseApplicationSuccessful'));
this.dialogFormVisible = false; this.dialogFormVisible = false;
this.rejectId = ''; this.rejectId = '';
this.doClose(); this.doClose();

View File

@ -137,8 +137,8 @@ export default {
}; };
this.$router.push({ path: `${UrlConfig.display}/plan`, query: query }); this.$router.push({ path: `${UrlConfig.display}/plan`, query: query });
launchFullscreen(); launchFullscreen();
// }).catch(error => { }).catch(error => {
// this.$messageBox(this.$t('tip.createSimulationFaild') + this.$t('global.colon') + error.message); this.$messageBox(this.$t('tip.createSimulationFaild') + this.$t('global.colon') + error.message);
}); });
}, },
handleConfirmPass(data) { handleConfirmPass(data) {
@ -149,16 +149,16 @@ export default {
this.$messageBox(`${this.$t('approval.passedRunPlanFailed')}: ${resp.data[0]}`); this.$messageBox(`${this.$t('approval.passedRunPlanFailed')}: ${resp.data[0]}`);
} }
this.reloadTable(); this.reloadTable();
// }).catch(error => { }).catch(error => {
// this.$messageBox(`${this.$t('approval.passedRunPlanFailed')}: ${error.message}`); this.$messageBox(`${this.$t('approval.passedRunPlanFailed')}: ${error.message}`);
}); });
}, },
handleConfirmReject(data) { handleConfirmReject(data) {
rejectRunPlan(data.id, data).then(resp => { rejectRunPlan(data.id, data).then(resp => {
this.reloadTable(); this.reloadTable();
this.$message.success(this.$t('approval.rejectRunPlanSuccess')); this.$message.success(this.$t('approval.rejectRunPlanSuccess'));
// }).catch(error => { }).catch(error => {
// this.$messageBox(`${this.$t('approval.rejectRunPlanFailed')}: ${error.message}`); this.$messageBox(`${this.$t('approval.rejectRunPlanFailed')}: ${error.message}`);
}); });
} }
} }

View File

@ -140,24 +140,24 @@ export default {
const query = { mapId: row.mapId, group: resp.data, scriptId: row.id, try:0, lineCode:mapInfo.lineCode}; const query = { mapId: row.mapId, group: resp.data, scriptId: row.id, try:0, lineCode:mapInfo.lineCode};
this.$router.push({ path: `${UrlConfig.design.display}/demon`, query }); this.$router.push({ path: `${UrlConfig.design.display}/demon`, query });
launchFullscreen(); launchFullscreen();
// }).catch(error => { }).catch(error => {
// this.$messageBox(`${this.$t('scriptRecord.createSimulationFail')}: ${error.message}`); this.$messageBox(`${this.$t('scriptRecord.createSimulationFail')}: ${error.message}`);
}); });
}, },
handleConfirmReject(data) { handleConfirmReject(data) {
rejectScript(data.id, data).then(resp => { rejectScript(data.id, data).then(resp => {
this.reloadTable(); this.reloadTable();
this.$message.success(this.$t('approval.rejectScriptSuccess')); this.$message.success(this.$t('approval.rejectScriptSuccess'));
// }).catch(error => { }).catch(error => {
// this.$messageBox(`${this.$t('approval.rejectScriptFailed')}: ${error.message}`); this.$messageBox(`${this.$t('approval.rejectScriptFailed')}: ${error.message}`);
}); });
}, },
handleConfirmPass(data) { handleConfirmPass(data) {
publishScript(data.id).then(resp => { publishScript(data.id).then(resp => {
this.reloadTable(); this.reloadTable();
this.$message.success(this.$t('approval.passedScriptSuccess')); this.$message.success(this.$t('approval.passedScriptSuccess'));
// }).catch(error => { }).catch(error => {
// this.$messageBox(`${this.$t('approval.passedScriptFailed')}: ${error.message}`); this.$messageBox(`${this.$t('approval.passedScriptFailed')}: ${error.message}`);
}); });
} }
} }

View File

@ -4,34 +4,47 @@
<div :class="showMembers?'memberAnimate chat-box-members':'chat-box-members'"> <div :class="showMembers?'memberAnimate chat-box-members':'chat-box-members'">
<div class="chat-member-title">成员列表</div> <div class="chat-member-title">成员列表</div>
<div class="chat-member-list"> <div class="chat-member-list">
<div v-for="member in memberList" :key="member.id" :class="member.online?'each-chat-member':'each-chat-member each-chat-member-outline'">{{ member.role+'-'+member.name }}</div> <div v-for="member in memberList" :key="member.id" :class="member.online?'each-chat-member':'each-chat-member each-chat-member-outline'" @click="createConversition(member)">{{ member.role+'-'+member.name }}</div>
</div> </div>
</div> </div>
<div class="chat-box-main"> <div class="chat-box-main">
<div class="chat-box-header"> <div class="chat-coversition">
<div class="chat-box-header-title">所有人</div> <div id="coversition-list-name" />
<div class="minimality" @click="handleMinimality('min')"> <div class="coversition-list">
<i class="el-icon-remove" /> <div
</div> v-for="coversition in coversitionList"
<div class="showMembers" @click="handleMembers()"> :key="coversition.id"
<i class="el-icon-user-solid" /> :class="coversition.id==currentCoversition?'coversition-active each-coversition':'each-coversition'"
</div> @click="changeCoversition(coversition)"
<div class="chat-setting" @click="handleSetting()"> >{{ coversition.name }}</div>
<i class="el-icon-s-tools" />
</div> </div>
</div> </div>
<div class="chat-box-content"> <div class="chat-window">
<div v-if="recordSending" class="chat_record_tip"> <div class="chat-box-header">
<div id="record_progress_bar" :style="'width:'+100/60*seconds+'%'" /> <div class="chat-box-header-title">{{ headerTitle }}</div>
<div class="record_icon" /> <div class="minimality" @click="handleMinimality('min')">
<div class="record_tip_text">正在录音...</div> <i class="el-icon-remove" />
<div class="record_tip_confirm" @click="stopRecording()">确定</div> </div>
<div class="record_tip_cancle" @click="cancleRecording()">取消</div> <div class="showMembers" @click="handleMembers()">
<i class="el-icon-user-solid" />
</div>
<div class="chat-setting" @click="handleSetting()">
<i class="el-icon-s-tools" />
</div>
</div>
<div class="chat-box-content">
<div v-if="recordSending" class="chat_record_tip">
<div id="record_progress_bar" :style="'width:'+100/60*seconds+'%'" />
<div class="record_icon" />
<div class="record_tip_text">正在录音...</div>
<div class="record_tip_confirm" @click="stopRecording()">确定</div>
<div class="record_tip_cancle" @click="cancleRecording()">取消</div>
</div>
</div>
<div class="chat-box-footer">
<div class="chat-box-footer-tool" />
<div class="chat-box-footer-send" @click="startRecording()">发送语音</div>
</div> </div>
</div>
<div class="chat-box-footer">
<div class="chat-box-footer-tool" />
<div class="chat-box-footer-send" @click="startRecording()">发送语音</div>
</div> </div>
</div> </div>
</div> </div>
@ -41,7 +54,7 @@
<i class="el-icon-circle-plus" /> <i class="el-icon-circle-plus" />
</div> </div>
</div> </div>
<chat-setting ref="chatSetting" /> <chat-setting ref="chatSetting" :form="form" @setSetting="setSetting" />
</div> </div>
</template> </template>
<script> <script>
@ -49,7 +62,7 @@ import { getToken } from '@/utils/auth';
import { creatSubscribe, clearSubscribe, assistant} from '@/utils/stomp'; 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} from '@/api/chat'; import {getSimulationMembersNew, getSimulationConversationListNew, getSimulationConversationIdNew} 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 {
@ -69,10 +82,17 @@ export default {
showMembers:false, showMembers:false,
recordSending:false, recordSending:false,
memberList:[], memberList:[],
coversitionList:[],
seconds:0, seconds:0,
inter:null, inter:null,
recorders: null, recorders: null,
microphone:null microphone:null,
form:{
language:'zh',
sex:'1'
},
currentCoversition:'',
headerTitle:'所有人'
}; };
}, },
mounted() { mounted() {
@ -84,8 +104,11 @@ export default {
methods:{ methods:{
async initPage() { async initPage() {
await this.subscribe(); await this.subscribe();
this.getSimulationMembers();
getSimulationConversationListNew(this.$route.query.group).then(resp=>{ getSimulationConversationListNew(this.$route.query.group).then(resp=>{
debugger; if (resp.data) {
this.coversitionList = resp.data;
}
}); });
}, },
handleMinimality(data) { handleMinimality(data) {
@ -96,6 +119,9 @@ export default {
this.minimize = false; this.minimize = false;
} }
}, },
setSetting(data) {
this.form = data;
},
// //
startRecording() { startRecording() {
const that = this; const that = this;
@ -195,24 +221,25 @@ export default {
this.showMembers = false; this.showMembers = false;
} else { } else {
this.showMembers = true; this.showMembers = true;
getSimulationMembersNew(this.$route.query.group).then(resp => { this.getSimulationMembers();
// this.memberList = netdata.data;
let lastData = JSON.stringify(resp.data);
const roleTypeList = ConstConfig.ConstSelect.roleTypeNew;
roleTypeList.forEach(function(element) {
const rolename = element.value;
if (Cookies.get('user_lang') == 'en') {
lastData = lastData.replace(new RegExp(rolename, 'g'), element.enLabel);
} else {
lastData = lastData.replace(new RegExp(rolename, 'g'), element.label);
}
});
lastData = JSON.parse(lastData);
this.memberList = lastData;
});
} }
}, },
getSimulationMembers() {
getSimulationMembersNew(this.$route.query.group).then(resp => {
let lastData = JSON.stringify(resp.data);
const roleTypeList = ConstConfig.ConstSelect.roleTypeNew;
roleTypeList.forEach(function(element) {
const rolename = element.value;
if (Cookies.get('user_lang') == 'en') {
lastData = lastData.replace(new RegExp(rolename, 'g'), element.enLabel);
} else {
lastData = lastData.replace(new RegExp(rolename, 'g'), element.label);
}
});
lastData = JSON.parse(lastData);
this.memberList = lastData;
});
},
async subscribe() { async subscribe() {
if (!this.$store.state.socket.assistantIsSubscribe) { if (!this.$store.state.socket.assistantIsSubscribe) {
this.clearSubscribe(); this.clearSubscribe();
@ -224,13 +251,33 @@ export default {
async clearSubscribe() { async clearSubscribe() {
clearSubscribe(`${assistant}\/${this.group}`); clearSubscribe(`${assistant}\/${this.group}`);
await this.$store.dispatch('socket/setAssistantSubscribe', false); await this.$store.dispatch('socket/setAssistantSubscribe', false);
},
createConversition(member) {
if (member.userId != this.$store.state.user.id && member.online) {
getSimulationConversationIdNew({ memberId: member.id }, this.group).then(resp => {
if (resp.data) {
const data = resp.data;
const index = this.coversitionList.findIndex(item=>{ return item.id == data.id; });
if (index < 0) {
this.coversitionList.push({id:data.id, name:data.name});
}
this.currentCoversition = data.id;
this.headerTitle = data.name;
}
});
}
},
changeCoversition(coversition) {
this.currentCoversition = coversition.id;
this.headerTitle = coversition.name;
} }
} }
}; };
</script> </script>
<style lang="scss" scoped> <style lang="scss" scoped>
.chatBox{ .chatBox{
width: 400px; width: 503px;
height: 400px; height: 400px;
position: absolute; position: absolute;
padding-left:5px; padding-left:5px;
@ -260,9 +307,38 @@ export default {
} }
.chat-box-contentTip{ .chat-box-contentTip{
}
.chat-coversition{
width: 100px;
display: inline-block;
border-right: 1px #dedede solid;
height: 100%;
vertical-align: top;
background: #f9f9f9;
border-radius: 5px 0px 0px 5px;
}
.coversition-list{
padding: 3px 0px 10px 0px;
height: 355px;
overflow: auto;
margin-top:40px;
}
.each-coversition{
font-size: 14px;
padding: 10px 7px 10px 10px;
border-bottom: 1px #dedede solid;
cursor: pointer;
}
.coversition-active{
background: #e0e0e0;
} }
.chat-box-footer{ .chat-box-footer{
display: inline-block;
width: 100%;
}
.chat-window{
display: inline-block;
width: 400px;
} }
.chat-setting{ .chat-setting{
float: right; float: right;
@ -293,6 +369,7 @@ export default {
line-height: 40px; line-height: 40px;
margin-right: 10px; margin-right: 10px;
cursor: pointer; cursor: pointer;
font-size:16px;
} }
.chat-box-main{ .chat-box-main{
position: absolute; position: absolute;
@ -305,6 +382,7 @@ export default {
background: #fff; background: #fff;
border-radius: 5px; border-radius: 5px;
left:5px; left:5px;
font-size:0;
} }
.chat-member-list{ .chat-member-list{
margin-top: 13px; margin-top: 13px;
@ -323,6 +401,12 @@ export default {
} }
.each-chat-member-outline{ .each-chat-member-outline{
color: #ccc; color: #ccc;
}
.chat-coversition{
}
.coversition-list{
} }
.chat-box-members{ .chat-box-members{
position: absolute; position: absolute;

View File

@ -30,8 +30,8 @@
inactive-color="#ff4949" inactive-color="#ff4949"
active-icon-class="el-icon-male" active-icon-class="el-icon-male"
inactive-icon-class="el-icon-female" inactive-icon-class="el-icon-female"
active-value="man" active-value="1"
inactive-value="woman" inactive-value="0"
@change="changeSex()" @change="changeSex()"
/> />
</div> </div>
@ -41,14 +41,16 @@
<script> <script>
export default { export default {
name: 'ChatSetting', name: 'ChatSetting',
props:{
form:{
type:Object,
required:true
}
},
data() { data() {
return { return {
dialogVisible: false, dialogVisible: false,
loading:false, loading:false
form:{
language:'zh',
sex:'man'
}
}; };
}, },
methods:{ methods:{
@ -59,10 +61,10 @@ export default {
this.dialogVisible = false; this.dialogVisible = false;
}, },
changeLanguage() { changeLanguage() {
this.$emit('setSetting', this.form);
}, },
changeSex() { changeSex() {
this.$emit('setSetting', this.form);
} }
} }
}; };