剧本编制代码调整

This commit is contained in:
joylink_cuiweidong 2020-07-15 16:09:15 +08:00
parent 7857be23bf
commit adde89a41d
3 changed files with 148 additions and 53 deletions

View File

@ -2,36 +2,63 @@
<!-- v-quickMenuDrag -->
<div class="chatBox" :style="{'bottom':bottom+'px'}">
<div v-show="!minimize" class="chat-box">
<chat-member-list ref="chatMemberList" :user-role="userRole" :current-member-list="currentMemberList" />
<div class="chat-box-main">
<div class="chat-window">
<div class="chat-box-header">
<div class="chat-box-header-title">{{ headerTitle }}</div>
<div class="chat-box-header-title">
<el-input v-show="isShow" v-model="queryMember" size="small" placeholder="请输入搜索人员">
<el-button slot="append" icon="el-icon-search" />
</el-input>
</div>
<div class="minimality" @click="handleMinimality('min')">
<i class="el-icon-remove" />
</div>
<div v-show="memberListCoversition.all==undefined?true&&isShow:memberListCoversition.all&&isShow" class="chat-createGroup" @click="handleCreateGroup()">
<!-- <div v-show="memberListCoversition.all==undefined?true&&isShow:memberListCoversition.all&&isShow" class="chat-createGroup" @click="handleCreateGroup()">
<i class="el-icon-plus" style="font-weight: bolder;" />
</div>
</div> -->
<div class="chat-setting" @click="handleSetting()">
<i class="el-icon-s-tools" />
</div>
</div>
<div class="chat-box-content">
<chat-content ref="chatContent" :chat-content-list="chatContentList" />
<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 v-if="isShow" class="chat-box-content">
<!-- :filter-node-method="filterNode" -->
<el-tree
ref="tree"
:data="treeData"
:props="defaultProps"
node-key="id"
default-expand-all
show-checkbox
style="margin: 10px;overflow-y: auto;height: 100%;margin-right: 0;"
@check-change="handleCheckChange"
>
<span :id="data.id" slot-scope="{ node, data }">
<span v-if="data.type=='role'" style="font-size: 14px">{{ data.label }}</span>
<span v-else style="font-size: 14px">{{ data.memberName }}</span>
</span>
</el-tree>
</div>
<div v-else class="chat-box-content">
<div class="chatcontentInner">
<chat-content ref="chatContent" :chat-content-list="chatContentList" />
<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>
<chat-member-list ref="chatMemberList" :user-role="userRole" :current-member-list="currentMemberList" />
</div>
<div class="chat-box-footer">
<div class="chat-box-footer-tool" />
<el-button v-if="isButtonShow&&isCreate" size="mini" type="danger" class="chat-box-footer-quit" :loading="quitLoading" @click="quitCoversition()">退出群聊</el-button>
<el-button v-if="memberListCoversition.all||isButtonShow" class="chat-box-footer-send" size="mini" type="primary" :disabled="recordSending" @click="startRecording()">发送语音</el-button>
<div v-if="scriptTip" class="scriptTip">{{ scriptTip }}</div>
<el-button v-if="isShow" :loading="loading" size="mini" type="primary" class="chat-box-footer-send" @click="doCreate">创建群聊</el-button>
<div v-else>
<el-button v-if="isButtonShow&&isCreate" size="mini" type="danger" class="chat-box-footer-quit" :loading="loading" @click="quitCoversition()">退出群聊</el-button>
<el-button v-if="memberListCoversition.all||isButtonShow" class="chat-box-footer-send" size="mini" type="primary" :disabled="recordSending" @click="startRecording()">发送语音</el-button>
<div v-if="scriptTip" class="scriptTip">{{ scriptTip }}</div>
</div>
</div>
</div>
</div>
@ -43,7 +70,7 @@
</div>
</div>
<chat-setting ref="chatSetting" :form="form" @setSetting="setSetting" />
<chat-create-group ref="createGroup" :group="group" :member-list="memberList" @addCoversition="addCoversition" />
<!-- <chat-create-group ref="createGroup" :group="group" :member-list="memberList" @addCoversition="addCoversition" /> -->
<chat-tooltip :group="group" @getCoversitionList="getCoversitionList" />
</div>
</template>
@ -51,7 +78,7 @@
import CMD from '@/scripts/cmdPlugin/CommandEnum';
import ChatSetting from './chatSetting';
import ChatContent from './chatContent';
import ChatCreateGroup from './chatCreateGroup';
// import ChatCreateGroup from './chatCreateGroup';
import ChatMemberList from './chatMemberList';
import ChatTooltip from './chatTooltip';
import RecordRTC from 'recordrtc';
@ -64,7 +91,7 @@ export default {
ChatSetting,
ChatContent,
ChatMemberList,
ChatCreateGroup,
// ChatCreateGroup,
ChatTooltip
},
props: {
@ -83,13 +110,14 @@ export default {
bottom:15,
recordSending:false,
memberList:[],
queryMember: '',
currentMemberList:[],
chatContentList:[],
memberListCoversition:{},
seconds:0,
inter:null,
isHasCoversition:false,
quitLoading:false,
loading:false,
recorders: null,
microphone:null,
isCreate:false,
@ -98,6 +126,10 @@ export default {
language:'zh',
sex:'1'
},
defaultProps: {
children: 'children',
label: 'label'
},
headerTitle:''
};
},
@ -210,6 +242,13 @@ export default {
const activeList = this.$store.state.map.activeTrainList;
lastData = Object.values(lastData);
const lastMemberList = [];
const dispatcherList = [];
const electricDispatcherList = [];
const depotDispatcherList = [];
const stationSupervisorList = [];
const driverList = [];
const maintainerList = [];
this.treeData = [];
lastData.forEach((member, index)=>{
if (member.type != '观众') {
const name = member.name == undefined ? '' : '-' + member.name;
@ -220,8 +259,12 @@ export default {
member.memberName = member.type + device.groupNumber + name;
if (activeList.length > 0 && activeList.includes(device.groupNumber)) {
lastMemberList.push(member);
driverList.push(member);
}
} else {
if (device._type == 'Station') {
stationSupervisorList.push(member);
}
member.memberName = member.type + device.name + name;
lastMemberList.push(member);
}
@ -230,14 +273,64 @@ export default {
lastMemberList.push(member);
}
} else {
if (member.type == '行调') {
dispatcherList.push(member);
} else if (member.type == '通号') {
maintainerList.push(member);
}
member.memberName = member.type + name;
lastMemberList.push(member);
}
}
});
this.treeData = [{
label: '行调',
id: 'dispatcher',
disabled: dispatcherList.length <= 0,
type: 'role',
children: dispatcherList
}, {
label: '车站值班员',
id: 'stationSupervisor',
disabled: stationSupervisorList.length <= 0,
type: 'role',
children: stationSupervisorList
}, {
label: '司机',
id: 'driver',
disabled: driverList.length <= 0,
type: 'role',
children: driverList
}, {
label: '通号',
id: 'maintainer',
disabled: maintainerList.length <= 0,
type: 'role',
children: maintainerList
}];
this.memberList = lastMemberList;
this.getAllConversition();
},
doCreate() {
},
handleCheckChange() {
const memberList = this.$refs.tree.getCheckedKeys();
this.userString = '';
this.memberIdList = [];
// if (memberList && memberList.length) {
// memberList.forEach(memberId => {
// const member = this.memberData[memberId];
// if (member && member.userId) {
// this.memberIdList.push(member.id);
// this.userString += ((this.userString ? ',' : '') + member.label + '(' + this.simulationUsers[member.userId].nickName + ')');
// } else if (member) {
// this.userString += ((this.userString ? ',' : '') + member.label);
// this.memberIdList.push(member.id);
// }
// });
// }
},
getAllConversition() {
if (this.recordSending) {
this.cancleRecording();
@ -316,14 +409,14 @@ export default {
},
// 仿
quitCoversition() {
this.quitLoading = true;
this.loading = true;
overSimulationConversition(this.group, this.memberListCoversition.id).then(res=>{
this.quitLoading = false;
this.loading = false;
this.memberListCoversition = {all:undefined, id:null};
this.isHasCoversition = false;
}).catch(error=>{
this.$messageBox('退出会话失败: ' + error.message);
this.quitLoading = false;
this.loading = false;
});
},
setHeadTitle(headerTitle) {
@ -460,7 +553,7 @@ export default {
cursor: pointer;
}
.chatBox{
width: 400px;
width: 503px;
// height: 400px;
position: absolute;
padding-left:5px;
@ -481,7 +574,7 @@ export default {
font-size: 15px;
margin-left: 15px;
display: inline-block;
margin-top: 10px;
margin-top: 4px;
width: 70%;
overflow: hidden;
white-space: nowrap;
@ -496,6 +589,14 @@ export default {
.chat-box-contentTip{
}
.chatcontentInner{
height: 100%;
width: 380px;
display: inline-block;
overflow: auto;
cursor: auto;
}
.chat-box-footer{
display: inline-block;
width: 100%;
@ -503,7 +604,7 @@ export default {
}
.chat-window{
display: inline-block;
width: 400px;
width: 100%;
}
.chat-createGroup{
float: right;
@ -522,7 +623,7 @@ export default {
}
.chat-box-footer-tool{
width: 100%;
height: 30px;
height: 18px;
}
.chat-box-footer-send{
font-size: 12px;

View File

@ -1,5 +1,5 @@
<template>
<div :class="showMembers?'memberAnimate chat-box-members':'chat-box-members'">
<div class="chat-box-members">
<div class="chat-member-title">成员列表</div>
<div v-if="userRole!=''" class="chat-member-list">
<div
@ -26,11 +26,6 @@ export default {
required: true
}
},
data() {
return {
showMembers:true
};
},
computed:{
userId() {
return this.$store.state.user.id;
@ -51,13 +46,12 @@ export default {
.chat-box-members{
position: absolute;
width: 140px;
top: 0;
right: 0;
height: 100%;
background: #fff;
border-right: 1px #dedede solid;
border-radius: 0px 5px 5px 0px;
border-left: 1px #dedede solid;
z-index: 2;
transition: transform 1s;
padding: 12px 2px 10px 16px;
font-size: 14px;
}

View File

@ -16,7 +16,7 @@
<el-tab-pane v-for="(each,index) in tabList" :key="index" :label="each.label" class="tab_pane_box" :name="each.name" :lazy="lazy">
<component
:is="each.menus"
:ref="enabledTabMenu[each.name]"
:ref="each.name"
:selected="selected"
:map-info="mapInfo"
@setCenter="setCenter"
@ -78,17 +78,17 @@ export default {
{label:this.$t('map.routing'), name:'routing', menus:RoutingOperate},
{label:'停站时间', name:'dwellTime', menus:DwellTimeOperate},
{label:'设置运行等级', name:'runLevel', menus:RunLevelOperate}
],
enabledTabMenu: {
route: 'routeOperate',
routing: 'routingOperate',
automatic: 'automaticOperate',
signal: 'signalOperate',
runLevel: 'runLevelOperate',
turned: 'turnedOperate',
flankProtect: 'flankProtectOperate',
dwellTime: 'dwellTimeOperate'
}
]
// enabledTabMenu: {
// route: 'routeOperate',
// routing: 'routingOperate',
// automatic: 'automaticOperate',
// signal: 'signalOperate',
// runLevel: 'runLevelOperate',
// turned: 'turnedOperate',
// flankProtect: 'flankProtectOperate',
// dwellTime: 'dwellTimeOperate'
// }
};
},
mounted() {
@ -100,21 +100,21 @@ export default {
},
initLoad() {
if (this.enabledTab === 'route') {
this.$refs[this.enabledTabMenu[this.enabledTab]][0].initLoad();
this.$refs[this.enabledTab][0].initLoad();
}
this.tabBeforeLeave(this.enabledTab);
},
createRouteEvent() { //
this.$refs[this.enabledTabMenu[this.enabledTab]][0].createRouteEvent();
this.$refs[this.enabledTab][0].createRouteEvent();
},
previewRouteEvent() { //
this.$refs[this.enabledTabMenu[this.enabledTab]][0].previewRouteEvent();
this.$refs[this.enabledTab][0].previewRouteEvent();
},
changePane(data) {
this.enabledTab = data.name;
},
setSelected(selected) {
this.$refs[this.enabledTabMenu[this.enabledTab]][0].setSelected(selected);
this.$refs[this.enabledTab][0].setSelected(selected);
},
setCenter(code) {
this.$emit('setCenter', code);
@ -125,11 +125,11 @@ export default {
},
tabBeforeLeave(activeName, oldActiveName) {
if (oldActiveName === 'route' || oldActiveName === 'signal' || oldActiveName == 'runLevel' || oldActiveName == 'routing') {
this.$refs[this.enabledTabMenu[oldActiveName]][0].batchSectionListFocus(false);
this.$refs[oldActiveName][0].batchSectionListFocus(false);
}
if (activeName === 'route' || activeName === 'signal' || activeName == 'runLevel' || activeName == 'routing') {
this.$nextTick(() => {
this.$refs[this.enabledTabMenu[activeName]][0].batchSectionListFocus(true);
this.$refs[activeName][0].batchSectionListFocus(true);
});
}
}