This commit is contained in:
zyy 2020-08-10 18:37:43 +08:00
commit 20706dd67f
32 changed files with 1020 additions and 2360 deletions

View File

@ -94,7 +94,7 @@
:ref="name" :ref="name"
v-model="formModel[name]" v-model="formModel[name]"
:multiple="field.config.multiple" :multiple="field.config.multiple"
clearable :clearable="!field.config.noClear"
:placeholder="field.placeholder || $t('global.choose')" :placeholder="field.placeholder || $t('global.choose')"
filterable filterable
@change="selectChange(field, formModel)" @change="selectChange(field, formModel)"
@ -293,6 +293,7 @@ export default {
// //
initQueryModel() { initQueryModel() {
this.formModel = localStore.get(this.$route.path) || this.formModel; this.formModel = localStore.get(this.$route.path) || this.formModel;
this.buildForm();
if (typeof this.queryForm.initLoadCallback === 'function') { if (typeof this.queryForm.initLoadCallback === 'function') {
this.queryForm.initLoadCallback(this.formModel); this.queryForm.initLoadCallback(this.formModel);
} }
@ -304,7 +305,6 @@ export default {
this.exportFlag = this.queryForm.canExport; this.exportFlag = this.queryForm.canExport;
this.resetShow = this.queryForm.reset; this.resetShow = this.queryForm.reset;
this.buildQueryField(); this.buildQueryField();
this.buildForm();
}, },
// //
buildForm() { buildForm() {
@ -342,13 +342,12 @@ export default {
if (this.queryForm.queryObject.show === false) { if (this.queryForm.queryObject.show === false) {
continue; continue;
} else if (this.queryForm.queryObject.visible === false) { } else if (this.queryForm.queryObject.visible === false) {
model[item] = this.queryForm.queryObject[item].value; model[item] = this.formModel[item] || this.queryForm.queryObject[item].value;
} else { } else {
queryObject[item] = this.queryForm.queryObject[item]; queryObject[item] = this.queryForm.queryObject[item];
model[item] = this.queryForm.queryObject[item].value || getDefaultValueByField(this.queryForm.queryObject[item]); model[item] = this.formModel[item] || this.queryForm.queryObject[item].value || getDefaultValueByField(this.queryForm.queryObject[item]);
} }
} }
this.queryObject = queryObject; this.queryObject = queryObject;
this.formModel = model; this.formModel = model;
}, },

View File

@ -129,6 +129,11 @@ export default {
watch: { watch: {
'$store.state.training.prdType': function (val) { '$store.state.training.prdType': function (val) {
this.initControlModeList(val); this.initControlModeList(val);
},
'$store.state.map.controlTransfer':function (controlTransferList) {
controlTransferList.forEach(controlTransfer=>{
this.updateTableValue(controlTransfer);
});
} }
}, },
mounted() { mounted() {
@ -146,6 +151,17 @@ export default {
this.controlModeList = []; this.controlModeList = [];
} }
}, },
updateTableValue(controlTransfer) {
this.centralizedStationList.forEach((row, index) => {
if (row.code == controlTransfer.code) {
if (controlTransfer.applicantIdOfControlTransfer) {
this.disabledCommit = true;
} else {
this.disabledCommit = false;
}
}
});
},
doShow(operate) { doShow(operate) {
if (!this.dialogShow) { if (!this.dialogShow) {
this.operate = operate || {}; this.operate = operate || {};

View File

@ -33,7 +33,7 @@
<el-col :span="11" :offset="2"><el-checkbox v-model="checked2" :disabled="disabledAll" size="medium">全部确认</el-checkbox></el-col> <el-col :span="11" :offset="2"><el-checkbox v-model="checked2" :disabled="disabledAll" size="medium">全部确认</el-checkbox></el-col>
</el-col> </el-col>
<el-col :span="5" :offset="1" style="margin-top: -56px;"> <el-col :span="5" :offset="1" style="margin-top: -56px;">
<el-button :id="domIdConfirm" type="primary" :loading="loading" style="margin-left: 0; margin-bottom: 10px; width: 100%;" @click="commit"> </el-button> <el-button :id="domIdConfirm" type="primary" :disabled="commitDisabled" :loading="loading" style="margin-left: 0; margin-bottom: 10px; width: 100%;" @click="commit"> </el-button>
<el-button :id="domIdCancel" style="margin-left: 0; width: 100%;" @click="cancel"> </el-button> <el-button :id="domIdCancel" style="margin-left: 0; width: 100%;" @click="cancel"> </el-button>
</el-col> </el-col>
</el-row> </el-row>
@ -65,7 +65,8 @@ export default {
operation: '', operation: '',
stationLists: [], stationLists: [],
disabledAll: false, disabledAll: false,
checked2: false checked2: false,
commitDisabled:false
}; };
}, },
computed: { computed: {
@ -109,6 +110,11 @@ export default {
} }
}, },
watch: { watch: {
'$store.state.map.controlTransfer':function (controlTransferList) {
controlTransferList.forEach(controlTransfer=>{
this.updateTableValue(controlTransfer);
});
},
'$store.state.map.keyboardEnterCount': function (val) { '$store.state.map.keyboardEnterCount': function (val) {
if (this.show && !this.loading) { if (this.show && !this.loading) {
this.commit(); this.commit();
@ -143,6 +149,41 @@ export default {
}); });
} }
}, },
updateTableValue(controlTransfer) {
this.stationLists.forEach((row, index) => {
if (row.code == controlTransfer.code) {
if (controlTransfer.applicantIdOfControlTransfer) {
this.commitDisabled = true;
} else {
this.commitDisabled = false;
}
}
});
// this.tableData.forEach((row, index) => {
// if (row.code == controlTransfer.code) {
// if (controlTransfer.applicantIdOfControlTransfer) {
// row.result = this.$t('menu.menuDialog.senedMessageOne') + controlTransfer.validDurationOfControlTransferApplication + this.$t('menu.menuDialog.senedMessageTwo');
// row.disabled = true;
// row.check = false;
// } else {
// if (row.control != this.controlProps[controlTransfer.controlMode]) {
// row.result = this.$t('menu.menuDialog.controlModeTransfersuccees');
// row.control = this.controlProps[controlTransfer.controlMode];
// this.removeSelection(controlTransfer.code);
// row.disabled = true;
// row.check = false;
// } else {
// row.result = this.$t('menu.menuDialog.controlModeTransferFailed');
// this.removeSelection(controlTransfer.code);
// row.disabled = false;
// row.check = false;
// }
// this.disabledClose = false;
// this.disabledSure = false;
// }
// }
// });
},
getProtectedSectionName(row) { getProtectedSectionName(row) {
let name = ''; let name = '';
if (row && if (row &&

View File

@ -119,6 +119,11 @@ export default {
if (this.show && !this.disabledCommit) { if (this.show && !this.disabledCommit) {
this.handleCommit(); this.handleCommit();
} }
},
'$store.state.map.controlTransfer':function (controlTransferList) {
controlTransferList.forEach(controlTransfer=>{
this.updateTableValue(controlTransfer);
});
} }
}, },
mounted() { mounted() {
@ -142,6 +147,17 @@ export default {
// } // }
this.$store.dispatch('training/emitTipFresh'); this.$store.dispatch('training/emitTipFresh');
}, },
updateTableValue(controlTransfer) {
this.concertrateStationList.forEach((row, index) => {
if (row.code == controlTransfer.code) {
if (controlTransfer.applicantIdOfControlTransfer) {
this.disabledCommit = true;
} else {
this.disabledCommit = false;
}
}
});
},
doClose() { doClose() {
this.dialogShow = false; this.dialogShow = false;
this.$store.dispatch('training/emitTipFresh'); this.$store.dispatch('training/emitTipFresh');

View File

@ -117,9 +117,6 @@ const PermissionCreate = () => import('@/views/orderauthor/permission/create/ind
const UserRules = () => import('@/views/orderauthor/rules/index'); const UserRules = () => import('@/views/orderauthor/rules/index');
const UserRulesDetail = () => import('@/views/orderauthor/rules/detail'); const UserRulesDetail = () => import('@/views/orderauthor/rules/detail');
const LessonApproval = () => import('@/views/approval/lesson/index');
const ScriptApproval = () => import('@/views/approval/script/index');
const RunPlanApproval = () => import('@/views/approval/runPlan/index');
const DeviceManage = () => import('@/views/system/deviceManage/index'); const DeviceManage = () => import('@/views/system/deviceManage/index');
const MapSort = () => import('@/views/publish/publishMap/mapSort'); const MapSort = () => import('@/views/publish/publishMap/mapSort');
const StudentManage = () => import('@/views/studentManage'); const StudentManage = () => import('@/views/studentManage');
@ -140,6 +137,7 @@ const JsxtApply = () => import('@/views/jsxt/apply/index');
// const theoryManage = () => import('@/views/jsxt/competition/theory/index'); // const theoryManage = () => import('@/views/jsxt/competition/theory/index');
const RefereeList = () => import('@/views/jsxt/refereeList/index'); const RefereeList = () => import('@/views/jsxt/refereeList/index');
const RefereeDisplay = () => import('@/views/jsxt/refereeList/display'); const RefereeDisplay = () => import('@/views/jsxt/refereeList/display');
const Approval = () => import('@/views/approval/index');
import { GenerateRouteProjectList } from '@/scripts/ProjectConfig'; import { GenerateRouteProjectList } from '@/scripts/ProjectConfig';
// import { getSessionStorage } from '@/utils/auth'; // import { getSessionStorage } from '@/utils/auth';
@ -793,6 +791,13 @@ export const asyncRouter = [
meta: { meta: {
i18n: 'router.configLine' i18n: 'router.configLine'
} }
},
{// 发布申请
path: 'approval',
component: Approval,
meta: {
i18n: 'router.releaseApplication'
}
} }
// { // {
// path: 'deviceManage', // path: 'deviceManage',
@ -803,37 +808,6 @@ export const asyncRouter = [
// } // }
] ]
}, },
{ // 发布申请
path: '/apply',
component: Layout,
meta: {
i18n: 'router.releaseApplication',
roles: [admin]
},
children: [
{
path: 'lesson',
component: LessonApproval,
meta: {
i18n: 'router.courseApplication'
}
},
{
path: 'script',
component: ScriptApproval,
meta: {
i18n: 'router.scriptReleaseApplication'
}
},
{
path: 'runGraph',
component: RunPlanApproval,
meta: {
i18n: 'router.runGraphReleaseApplication'
}
}
]
},
{ // 新个人地图 { // 新个人地图
path: '/design', path: '/design',
component: Layout, component: Layout,

View File

@ -103,11 +103,9 @@ const PermissionCreate = () => import('@/views/orderauthor/permission/create/ind
const UserRules = () => import('@/views/orderauthor/rules/index'); const UserRules = () => import('@/views/orderauthor/rules/index');
const UserRulesDetail = () => import('@/views/orderauthor/rules/detail'); const UserRulesDetail = () => import('@/views/orderauthor/rules/detail');
const LessonApproval = () => import('@/views/approval/lesson/index');
const ScriptApproval = () => import('@/views/approval/script/index');
const RunPlanApproval = () => import('@/views/approval/runPlan/index');
const DeviceManage = () => import('@/views/system/deviceManage/index'); const DeviceManage = () => import('@/views/system/deviceManage/index');
const MapSort = () => import('@/views/publish/publishMap/mapSort'); const MapSort = () => import('@/views/publish/publishMap/mapSort');
const Approval = () => import('@/views/approval/index');
// import { loginInfo } from '@/scripts/ProjectConfig'; // import { loginInfo } from '@/scripts/ProjectConfig';
// import { getSessionStorage } from '@/utils/auth'; // import { getSessionStorage } from '@/utils/auth';
@ -716,36 +714,12 @@ export const asyncRouter = [
meta: { meta: {
i18n: 'router.deviceManage' i18n: 'router.deviceManage'
} }
}
]
}, },
{// 发布申请 {// 发布申请
path: '/apply', path: 'approval',
component: Layout, component: Approval,
meta: { meta: {
i18n: 'router.releaseApplication', i18n: 'router.releaseApplication'
roles: [admin]
},
children: [
{
path: 'lesson',
component: LessonApproval,
meta: {
i18n: 'router.courseApplication'
}
},
{
path: 'script',
component: ScriptApproval,
meta: {
i18n: 'router.scriptReleaseApplication'
}
},
{
path: 'runGraph',
component: RunPlanApproval,
meta: {
i18n: 'router.runGraphReleaseApplication'
} }
} }
] ]

View File

@ -0,0 +1,527 @@
<template>
<div>
<QueryListPage ref="queryListPage" :pager-config="pagerConfig" :query-form="queryForm" :query-list="queryList" />
<el-dialog v-dialogDrag :title="this.$t('approval.explanation')" :visible.sync="dialogFormVisible" width="500px" center>
<data-form ref="dataform" :form="form" :form-model="formModel" :rules="rules" />
<div slot="footer" class="dialog-footer">
<el-button @click="rejectCancel">{{ $t('global.cancel') }}</el-button>
<el-button type="primary" @click="rejectConfirm">{{ $t('global.confirm') }}</el-button>
</div>
</el-dialog>
<lesson-detail ref="lessonDetail" />
</div>
</template>
<script>
import {adminPublishLesson, rejectedLessonRelease, reviewLessonList, reviewScriptList, publishScript, rejectScript, reviewRunPlanList, publishRunPlan, rejectRunPlan, previewRunPlan} from '@/api/designPlatform';
import { getPublishMapListOnline } from '@/api/jmap/map';
import { scriptDraftRecordNotify } from '@/api/simulation';
import LessonDetail from './detail';
import { launchFullscreen } from '@/utils/screen';
import { UrlConfig } from '@/scripts/ConstDic';
export default {
name: 'Approval',
components: {
LessonDetail
},
data() {
return {
dialogFormVisible: false,
rejectId: '',
passId: '',
formModel: {
explanation: ''
},
approvalType: 'lesson',
mapList: [],
pagerConfig: {
pageSize: 'pageSize',
pageIndex: 'pageNum'
},
queryList: {
query: this.queryApprovalList,
selectCheckShow: false,
indexShow: true,
columns: [
{
title: this.$t('lesson.courseName'),
prop: 'name'
},
{
title: this.$t('approval.map'),
prop: 'mapId ',
type: 'tag',
columnValue: (row) => { return this.$convertField(row.mapId, this.mapList, ['value', 'label']); },
tagType: (row) => { return ''; }
},
{
title: this.$t('approval.courseDescription'),
prop: 'remarks'
},
{
title: this.$t('approval.applicant'),
prop: 'userName'
},
{
title: this.$t('approval.applyTime'),
prop: 'uploadTime',
type: 'tag',
columnValue: (row) => { return row.uploadTime.replace('T', ' '); },
tagType: (row) => { return ''; }
},
{
type: 'button',
title: this.$t('global.operate'),
width: '400',
buttons: [
{
name: this.$t('approval.lookOver'),
handleClick: this.goDetail,
type: ''
},
{
name: this.$t('approval.applyPassed'),
handleClick: this.pass,
type: ''
},
{
name: this.$t('approval.applyReject'),
handleClick: this.noPass,
type: ''
}
]
}
]
},
form: {
labelWidth: '80px',
items: [
{ prop: 'explanation', label: this.$t('approval.explanation'), type: 'textarea', required: true}
]
},
rules: {
explanation: [
{ required: true, message: this.$t('rules.enterRejectReason'), trigger: 'blur' }
]
}
};
},
computed: {
queryForm() {
if (this.approvalType === 'script') {
return {
labelWidth: '120px',
reset: true,
initLoadCallback: this.initLoadCallback,
queryObject: {
approvalType: {
type: 'select',
label: '申请类型:',
config: {
data: [{ label: '课程申请', value: 'lesson' }, { label: '剧本申请', value: 'script'}, { label: '运行图申请', value: 'runPlan' }],
noClear: true
},
default: 'lesson',
selectChange: this.approvalTypeChange
},
mapId: {
type: 'select',
label: this.$t('approval.map') + this.$t('global.colon'),
config: {
data: []
}
},
'name':{
type: 'text',
label: this.$t('approval.scriptName')
},
'creatorName': {
type: 'text',
label: this.$t('approval.applicant')
}
}
};
} else if (this.approvalType === 'runPlan') {
return {
labelWidth: '120px',
reset: true,
queryObject: {
approvalType: {
type: 'select',
label: '申请类型:',
config: {
data: [{ label: '课程申请', value: 'lesson' }, { label: '剧本申请', value: 'script'}, { label: '运行图申请', value: 'runPlan' }],
noClear: true
},
default: 'lesson',
selectChange: this.approvalTypeChange
},
mapId: {
type: 'select',
label: this.$t('approval.map'),
config: {
data: []
}
},
'name':{
type: 'text',
label: this.$t('approval.runPlanName')
},
'creatorName': {
type: 'text',
label: this.$t('approval.applicant')
}
}
};
} else {
return {
labelWidth: '120px',
reset: true,
initLoadCallback: this.initLoadCallback,
queryObject: {
approvalType: {
type: 'select',
label: '申请类型:',
config: {
data: [{ label: '课程申请', value: 'lesson' }, { label: '剧本申请', value: 'script'}, { label: '运行图申请', value: 'runPlan' }],
noClear: true
},
default: 'lesson',
selectChange: this.approvalTypeChange
},
mapId: {
type: 'select',
label: this.$t('approval.map') + this.$t('global.colon'),
config: {
data: []
}
},
lessonName: {
type: 'text',
label: '课程名称:'
},
userName: {
type: 'text',
label: this.$t('approval.applicant') + this.$t('global.colon')
}
}
};
}
}
},
watch: {
approvalType() {
if (this.approvalType === 'lesson') {
this.queryList.columns = [
{
title: this.$t('lesson.courseName'),
prop: 'name'
},
{
title: this.$t('approval.map'),
prop: 'mapId ',
type: 'tag',
columnValue: (row) => { return this.$convertField(row.mapId, this.mapList, ['value', 'label']); },
tagType: (row) => { return ''; }
},
{
title: this.$t('approval.courseDescription'),
prop: 'remarks'
},
{
title: this.$t('approval.applicant'),
prop: 'userName'
},
{
title: this.$t('approval.applyTime'),
prop: 'uploadTime',
type: 'tag',
columnValue: (row) => { return row.uploadTime.replace('T', ' '); },
tagType: (row) => { return ''; }
},
{
type: 'button',
title: this.$t('global.operate'),
width: '400',
buttons: [
{
name: this.$t('approval.lookOver'),
handleClick: this.goDetail,
type: ''
},
{
name: this.$t('approval.applyPassed'),
handleClick: this.pass,
type: ''
},
{
name: this.$t('approval.applyReject'),
handleClick: this.noPass,
type: ''
}
]
}
];
} else if (this.approvalType === 'script') {
this.queryList.columns = [
{
title: this.$t('approval.scriptName'),
width:250,
prop: 'name'
},
{
title: this.$t('approval.map'),
prop: 'mapId ',
width:250,
type: 'tag',
columnValue: (row) => { return this.$convertField(row.mapId, this.mapList, ['value', 'label']); },
tagType: (row) => { return ''; }
},
{
title: this.$t('approval.scriptDescription'),
prop: 'description'
},
{
title: this.$t('approval.applicant'),
prop: 'creatorName'
},
{
title: this.$t('approval.applyTime'),
prop: 'uploadTime',
type: 'tag',
columnValue: (row) => { return row.uploadTime.replace('T', ' '); },
tagType: (row) => { return ''; }
},
{
type: 'button',
title: this.$t('global.operate'),
width: '450',
buttons: [
{
name: this.$t('approval.applyPassed'),
handleClick: this.scriptPass,
type: ''
},
{
name: this.$t('approval.applyReject'),
handleClick: this.noPass,
type: ''
},
{
name: this.$t('approval.scriptPreview'),
handleClick: this.scriptPreview,
type: ''
}
]
}
];
} else if (this.approvalType === 'runPlan') {
this.queryList.columns = [
{
title: this.$t('approval.runPlanName'),
width:250,
prop: 'name'
},
{
title: this.$t('approval.map'),
prop: 'mapId ',
width:250,
type: 'tag',
columnValue: (row) => { return this.$convertField(row.mapId, this.mapList, ['value', 'label']); },
tagType: (row) => { return ''; }
},
{
title: this.$t('approval.applicant'),
prop: 'creatorName'
},
{
title: this.$t('approval.applyTime'),
prop: 'uploadTime',
type: 'tag',
columnValue: (row) => { return row.uploadTime.replace('T', ' '); },
tagType: (row) => { return ''; }
},
{
type: 'button',
title: this.$t('global.operate'),
width: '450',
buttons: [
{
name: this.$t('approval.applyPassed'),
handleClick: this.runPlanPassed,
type: ''
},
{
name: this.$t('approval.applyReject'),
handleClick: this.noPass,
type: ''
},
{
name: this.$t('approval.runPlanPreview'),
handleClick: this.runPlanPreview,
type: ''
}
]
}
];
}
}
},
created() {
getPublishMapListOnline().then(response=>{
this.mapList = response.data.map(elem => { return { value: elem.id, label: elem.name }; });
this.queryForm.queryObject.mapId.config.data = this.mapList;
});
},
methods: {
goDetail(index, row) {
this.$refs.lessonDetail.show(row.id);
},
queryApprovalList(params) {
if (this.approvalType === 'lesson') {
return reviewLessonList(params);
} else if (this.approvalType === 'script') {
return reviewScriptList(params);
} else if (this.approvalType === 'runPlan') {
return reviewRunPlanList(params);
} else { return reviewLessonList(params); }
},
initLoadCallback(form) {
form.approvalType = 'lesson';
},
pass(index, row) {
this.$confirm(this.$t('tip.publishTheCourseHint'), this.$t('global.tips'), {
confirmButtonText: this.$t('global.confirm'),
cancelButtonText: this.$t('global.cancel'),
type: 'warning'
}).then(() => {
const params = {
cityCode: row.cityCode,
mapId: row.mapId,
name: row.name,
prdType: row.prdType
};
adminPublishLesson(params, row.id).then(response => {
this.$message.success(this.$t('tip.coursePublishSuccessful'));
this.doClose();
}).catch(() => {
this.$messageBox(this.$t('tip.coursePublishFailed'));
});
});
},
noPass(index, row) {
this.form = {
labelWidth: '80px',
items: [
{ prop: 'explanation', label: this.$t('approval.explanation'), type: 'textarea', required: true}
]
};
this.dialogFormVisible = true;
this.rejectId = row.id;
},
doClose() {
this.dialogFormVisible = false;
this.rejectId = '';
this.passId = '';
this.$refs.queryListPage.refresh(true);
this.$refs.dataform.resetForm();
},
rejectConfirm() {
this.$refs.dataform.validateForm(() => {
if (this.rejectId && this.approvalType === 'lesson') {
rejectedLessonRelease(this.formModel, this.rejectId).then(resp =>{
this.$message.success(this.$t('tip.rejectedCourseReleaseApplicationSuccessful'));
this.doClose();
}).catch(() => {
this.$messageBox(this.$t('tip.rejectedCourseReleaseApplicationSuccessful'));
this.doClose();
});
} else if (this.rejectId && this.approvalType === 'script') {
rejectScript(this.rejectId, this.formModel).then(resp => {
this.$message.success(this.$t('approval.rejectScriptSuccess'));
this.doClose();
}).catch((error) => {
this.$messageBox(`${this.$t('approval.rejectScriptFailed')}: ${error.message}`);
this.doClose();
});
} else if (this.rejectId && this.approvalType === 'runPlan') {
rejectRunPlan(this.rejectId, this.formModel).then(resp => {
this.$message.success(this.$t('approval.rejectRunPlanSuccess'));
this.doClose();
}).catch((error) => {
this.$messageBox(`${this.$t('approval.rejectRunPlanFailed')}: ${error.message}`);
this.doClose();
});
} else if (this.passId && this.approvalType === 'runPlan') {
publishRunPlan(this.passId, this.formModel).then(resp => {
if (resp.data.length <= 0) {
this.$message.success(this.$t('approval.passedRunPlanSuccess'));
} else {
this.$messageBox(`${this.$t('approval.passedRunPlanFailed')}: ${resp.data[0]}`);
}
this.doClose();
}).catch(error => {
this.$messageBox(`${this.$t('approval.passedRunPlanFailed')}: ${error.message}`);
this.doClose();
});
}
});
},
rejectCancel() {
this.dialogFormVisible = false;
this.rejectId = '';
this.textarea = '';
},
approvalTypeChange(form) {
this.approvalType = form.approvalType;
this.$refs.queryListPage.refresh(true);
},
runPlanPreview(index, row) {
previewRunPlan(row.id).then(resp => {
const query = {
prdType: '01', group: resp.data, mapId: row.mapId, planId: row.id, from:''
};
this.$router.push({ path: `${UrlConfig.display}/plan`, query: query });
launchFullscreen();
}).catch(error => {
this.$messageBox(this.$t('tip.createSimulationFaild') + this.$t('global.colon') + error.message);
});
},
runPlanPassed(index, row) {
this.form = {
labelWidth: '100px',
items: [
{ prop: 'runPlanName', label: this.$t('approval.runPlanName'), type: 'text', required: true}
]
};
this.dialogFormVisible = true;
this.passId = row.id;
},
scriptPass(index, row) {
publishScript(row.id).then(resp => {
this.reloadTable();
this.$message.success(this.$t('approval.passedScriptSuccess'));
}).catch(error => {
this.$messageBox(`${this.$t('approval.passedScriptFailed')}: ${error.message}`);
});
},
scriptPreview(index, row) {
const mapInfo = this.mapList.find(elem=>{ return elem.id == row.mapId; });
scriptDraftRecordNotify(row.id).then(resp => {
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 });
launchFullscreen();
}).catch(error => {
this.$messageBox(`${this.$t('scriptRecord.createSimulationFail')}: ${error.message}`);
});
}
}
};
</script>
<style lang="scss" scoped>
/deep/
.el-row .el-button+.el-button{
margin-top: 10px;
}
</style>

View File

@ -1,193 +0,0 @@
<template>
<div>
<QueryListPage ref="queryListPage" :pager-config="pagerConfig" :query-form="queryForm" :query-list="queryList" />
<el-dialog v-dialogDrag :title="this.$t('approval.explanation')" :visible.sync="dialogFormVisible">
<data-form ref="dataform" :form="form" :form-model="formModel" :rules="rules" />
<div slot="footer" class="dialog-footer">
<el-button @click="rejectCancel">{{ $t('global.cancel') }}</el-button>
<el-button type="primary" @click="rejectConfirm">{{ $t('global.confirm') }}</el-button>
</div>
</el-dialog>
<lesson-detail ref="lessonDetail" />
</div>
</template>
<script>
import {adminPublishLesson, rejectedLessonRelease, reviewLessonList} from '@/api/designPlatform';
import { getPublishMapListOnline } from '@/api/jmap/map';
import LessonDetail from './detail';
export default {
name: 'LessonApproval',
components: {
LessonDetail
},
data() {
return {
dialogFormVisible: false,
rejectId: '',
formModel: {
explanation: ''
},
mapList: [],
pagerConfig: {
pageSize: 'pageSize',
pageIndex: 'pageNum'
},
queryForm: {
labelWidth: '120px',
reset: true,
queryObject: {
mapId: {
type: 'select',
label: this.$t('approval.map') + this.$t('global.colon'),
config: {
data: []
}
},
lessonName: {
type: 'text',
label: this.$t('lesson.courseName')
},
userName: {
type: 'text',
label: this.$t('approval.applicant') + this.$t('global.colon')
}
}
},
queryList: {
query: reviewLessonList,
selectCheckShow: false,
indexShow: true,
columns: [
{
title: this.$t('lesson.courseName'),
prop: 'name'
},
{
title: this.$t('approval.map'),
prop: 'mapId ',
type: 'tag',
columnValue: (row) => { return this.$convertField(row.mapId, this.mapList, ['value', 'label']); },
tagType: (row) => { return ''; }
},
{
title: this.$t('approval.courseDescription'),
prop: 'remarks'
},
{
title: this.$t('approval.applicant'),
prop: 'userName'
},
{
title: this.$t('approval.applyTime'),
prop: 'uploadTime',
type: 'tag',
columnValue: (row) => { return row.uploadTime.replace('T', ' '); },
tagType: (row) => { return ''; }
},
{
type: 'button',
title: this.$t('global.operate'),
width: '400',
buttons: [
{
name: this.$t('approval.lookOver'),
handleClick: this.goDetail,
type: ''
},
{
name: this.$t('approval.applyPassed'),
handleClick: this.pass,
type: ''
},
{
name: this.$t('approval.applyReject'),
handleClick: this.noPass,
type: ''
}
]
}
]
},
form: {
labelWidth: '150px',
items: [
{ prop: 'explanation', label: this.$t('approval.explanation'), type: 'textarea', required: true}
]
},
rules: {
explanation: [
{ required: true, message: this.$t('rules.enterRejectReason'), trigger: 'blur' }
]
}
};
},
created() {
getPublishMapListOnline().then(response=>{
this.mapList = response.data.map(elem => { return { value: elem.id, label: elem.name }; });
this.queryForm.queryObject.mapId.config.data = this.mapList;
});
},
methods: {
goDetail(index, row) {
this.$refs.lessonDetail.show(row.id);
},
pass(index, row) {
this.$confirm(this.$t('tip.publishTheCourseHint'), this.$t('global.tips'), {
confirmButtonText: this.$t('global.confirm'),
cancelButtonText: this.$t('global.cancel'),
type: 'warning'
}).then(() => {
const params = {
cityCode: row.cityCode,
mapId: row.mapId,
name: row.name,
prdType: row.prdType
};
adminPublishLesson(params, row.id).then(response => {
this.$message.success(this.$t('tip.coursePublishSuccessful'));
this.doClose();
}).catch(() => {
this.$messageBox(this.$t('tip.coursePublishFailed'));
});
});
},
noPass(index, row) {
this.dialogFormVisible = true;
this.rejectId = row.id;
},
doClose() {
this.$refs.queryListPage.refresh(true);
},
rejectConfirm() {
this.$refs.dataform.validateForm(() => {
if (this.rejectId) {
rejectedLessonRelease(this.formModel, this.rejectId).then(resp =>{
this.$message.success(this.$t('tip.rejectedCourseReleaseApplicationSuccessful'));
this.dialogFormVisible = false;
this.rejectId = '';
this.doClose();
}).catch(() => {
this.$messageBox(this.$t('tip.rejectedCourseReleaseApplicationSuccessful'));
this.dialogFormVisible = false;
this.rejectId = '';
this.doClose();
});
}
});
},
rejectCancel() {
this.dialogFormVisible = false;
this.rejectId = '';
this.textarea = '';
}
}
};
</script>
<style lang="scss" scoped>
/deep/
.el-row .el-button+.el-button{
margin-top: 10px;
}
</style>

View File

@ -1,166 +0,0 @@
<template>
<div>
<QueryListPage ref="queryListPage" :pager-config="pagerConfig" :query-form="queryForm" :query-list="queryList" />
<run-plan-operate ref="applyPassed" :title="$t('approval.passedRunPlan')" type="applyPassed" @reloadTable="reloadTable" @create="handleConfirmPass" />
<run-plan-operate ref="applyReject" :title="$t('approval.rejectRunPlan')" type="applyReject" @reloadTable="reloadTable" @create="handleConfirmReject" />
</div>
</template>
<script>
import RunPlanOperate from './operate';
import { reviewRunPlanList, publishRunPlan, rejectRunPlan, previewRunPlan } from '@/api/designPlatform';
import { getPublishMapListOnline } from '@/api/jmap/map';
import { launchFullscreen } from '@/utils/screen';
import { UrlConfig } from '@/scripts/ConstDic';
export default {
name: 'RunPlanApproval',
components: {
RunPlanOperate
},
data() {
return {
pagerConfig: {
pageSize: 'pageSize',
pageIndex: 'pageNum'
},
mapList:[],
queryForm: {
labelWidth: '150px',
reset: true,
queryObject: {
mapId: {
type: 'select',
label: this.$t('approval.map'),
config: {
data: []
}
},
'name':{
type: 'text',
label: this.$t('approval.runPlanName')
},
'creatorName': {
type: 'text',
label: this.$t('approval.applicant')
}
}
},
queryList: {
query: this.queryFunction,
selectCheckShow: false,
indexShow: true,
columns: [
{
title: this.$t('approval.runPlanName'),
width:250,
prop: 'name'
},
{
title: this.$t('approval.map'),
prop: 'mapId ',
width:250,
type: 'tag',
columnValue: (row) => { return this.$convertField(row.mapId, this.mapList, ['value', 'label']); },
tagType: (row) => { return ''; }
},
{
title: this.$t('approval.applicant'),
prop: 'creatorName'
},
{
title: this.$t('approval.applyTime'),
prop: 'uploadTime',
type: 'tag',
columnValue: (row) => { return row.uploadTime.replace('T', ' '); },
tagType: (row) => { return ''; }
},
{
type: 'button',
title: this.$t('global.operate'),
width: '450',
buttons: [
{
name: this.$t('approval.applyPassed'),
handleClick: this.applyPassed,
type: ''
},
{
name: this.$t('approval.applyReject'),
handleClick: this.applyReject,
type: ''
},
{
name: this.$t('approval.runPlanPreview'),
handleClick: this.runPlanPreview,
type: ''
}
]
}
]
}
};
},
mounted() {
this.loadInitData();
},
methods: {
reloadTable() {
if (this.queryList && this.queryList.reload) {
this.queryList.reload();
}
},
async loadInitData() {
try {
//
this.mapList = [];
const res = await getPublishMapListOnline();
this.mapList = res.data.map(elem => { return { value: elem.id, label: elem.name }; });
this.queryForm.queryObject.mapId.config.data = this.mapList;
} catch (error) {
console.error(error, '获取发布地图');
}
},
queryFunction(params) {
return reviewRunPlanList(params);
},
applyPassed(index, row) {
this.$refs.applyPassed.doShow(row);
},
applyReject(index, row) {
this.$refs.applyReject.doShow(row);
},
runPlanPreview(index, row) {
previewRunPlan(row.id).then(resp => {
const query = {
prdType: '01', group: resp.data, mapId: row.mapId, planId: row.id, from:''
};
this.$router.push({ path: `${UrlConfig.display}/plan`, query: query });
launchFullscreen();
}).catch(error => {
this.$messageBox(this.$t('tip.createSimulationFaild') + this.$t('global.colon') + error.message);
});
},
handleConfirmPass(data) {
publishRunPlan(data.id, data).then(resp => {
if (resp.data.length <= 0) {
this.$message.success(this.$t('approval.passedRunPlanSuccess'));
} else {
this.$messageBox(`${this.$t('approval.passedRunPlanFailed')}: ${resp.data[0]}`);
}
this.reloadTable();
}).catch(error => {
this.$messageBox(`${this.$t('approval.passedRunPlanFailed')}: ${error.message}`);
});
},
handleConfirmReject(data) {
rejectRunPlan(data.id, data).then(resp => {
this.reloadTable();
this.$message.success(this.$t('approval.rejectRunPlanSuccess'));
}).catch(error => {
this.$messageBox(`${this.$t('approval.rejectRunPlanFailed')}: ${error.message}`);
});
}
}
};
</script>

View File

@ -1,96 +0,0 @@
<template>
<div>
<el-dialog :title="title" :visible.sync="dialogVisible" width="500px" :before-close="doClose" center>
<data-form ref="dataform" :form="form" :form-model="formModel" :rules="rules" />
<span slot="footer" class="dialog-footer">
<el-button type="primary" @click="doCreate">{{ $t('global.confirm') }}</el-button>
<el-button @click="doClose">{{ $t('global.cancel') }}</el-button>
</span>
</el-dialog>
</div>
</template>
<script>
export default {
name: 'ScriptOperate',
props: {
title: {type:String, required:true},
type: {type:String, required:true}
},
data() {
return {
dialogVisible: false,
formModel:{
runPlanName:'',
id:'',
explanation:''
},
isShow: false
};
},
computed: {
form() {
let form = {};
if (this.type == 'applyPassed') {
form = {
labelWidth: '150px',
items: [
{ prop: 'runPlanName', label: this.$t('approval.runPlanName'), type: 'text', required: true}
]
};
} else {
form = {
labelWidth: '150px',
items: [
{ prop: 'explanation', label: this.$t('approval.explanation'), type: 'textarea', required: true}
]
};
}
return form;
},
rules() {
let crules = {};
if (this.type == 'applyPassed') {
crules = {
runPlanName: [
{ required: true, message: this.$t('approval.inputRunPlanName'), trigger: 'blur' }
]
};
} else {
crules = {
explanation:[
{ required: true, message: this.$t('approval.inputRejectExplanation'), trigger: 'blur', max:200 }
]
};
}
return crules;
}
},
methods: {
doShow(row) {
if (this.type == 'applyPassed') {
this.formModel.runPlanName = row.name;
}
this.formModel.id = row.id;
this.dialogVisible = true;
},
doCreate() {
const self = this;
this.$refs.dataform.validateForm(() => {
self.$emit('create', Object.assign({}, this.formModel));
self.doClose();
});
},
doClose() {
this.$refs.dataform.resetForm();
this.isShow = false;
this.dialogVisible = false;
}
}
};
</script>
<style lang="scss" scoped>
/deep/ .el-dialog--center .el-dialog__body{
padding: 15px 65px 10px 10px;
}
</style>

View File

@ -1,171 +0,0 @@
<template>
<div>
<QueryListPage ref="queryListPage" :pager-config="pagerConfig" :query-form="queryForm" :query-list="queryList" />
<script-operate ref="applyReject" :title="$t('approval.rejectScript')" @reloadTable="reloadTable" @create="handleConfirmReject" />
</div>
</template>
<script>
import { launchFullscreen } from '@/utils/screen';
import { UrlConfig } from '@/scripts/ConstDic';
import { scriptDraftRecordNotify } from '@/api/simulation';
import ScriptOperate from './operate';
import { reviewScriptList, publishScript, rejectScript } from '@/api/designPlatform';
import { getPublishMapListOnline } from '@/api/jmap/map';
export default {
name: 'ScriptApproval',
components: {
ScriptOperate
},
data() {
return {
allMapList:[],
pagerConfig: {
pageSize: 'pageSize',
pageIndex: 'pageNum'
},
queryForm: {
labelWidth: '100px',
reset: true,
queryObject: {
mapId: {
type: 'select',
label: this.$t('approval.map'),
config: {
data: []
}
},
'name':{
type: 'text',
label: this.$t('approval.scriptName')
},
'creatorName': {
type: 'text',
label: this.$t('approval.applicant')
}
}
},
queryList: {
query: this.queryFunction,
selectCheckShow: false,
indexShow: true,
columns: [
{
title: this.$t('approval.scriptName'),
width:250,
prop: 'name'
},
{
title: this.$t('approval.map'),
prop: 'mapId ',
width:250,
type: 'tag',
columnValue: (row) => { return this.$convertField(row.mapId, this.mapList, ['value', 'label']); },
tagType: (row) => { return ''; }
},
{
title: this.$t('approval.scriptDescription'),
prop: 'description'
},
{
title: this.$t('approval.applicant'),
prop: 'creatorName'
},
{
title: this.$t('approval.applyTime'),
prop: 'uploadTime',
type: 'tag',
columnValue: (row) => { return row.uploadTime.replace('T', ' '); },
tagType: (row) => { return ''; }
},
{
type: 'button',
title: this.$t('global.operate'),
width: '450',
buttons: [
{
name: this.$t('approval.applyPassed'),
handleClick: this.applyPassed,
type: ''
},
{
name: this.$t('approval.applyReject'),
handleClick: this.applyReject,
type: ''
},
{
name: this.$t('approval.scriptPreview'),
handleClick: this.scriptPreview,
type: ''
}
]
}
]
}
};
},
mounted() {
this.loadInitData();
},
methods: {
reloadTable() {
if (this.queryList && this.queryList.reload) {
this.queryList.reload();
}
},
async loadInitData() {
try {
//
this.mapList = [];
const res = await getPublishMapListOnline();
this.allMapList = res.data;
this.mapList = res.data.map(elem => { return { value: elem.id, label: elem.name }; });
this.queryForm.queryObject.mapId.config.data = this.mapList;
} catch (error) {
console.error(error, '获取发布地图');
}
},
queryFunction(params) {
return reviewScriptList(params);
},
applyPassed(index, row) {
this.handleConfirmPass(row);
},
applyReject(index, row) {
this.$refs.applyReject.doShow(row);
},
scriptPreview(index, row) {
const mapInfo = this.allMapList.find(elem=>{ return elem.id == row.mapId; });
scriptDraftRecordNotify(row.id).then(resp => {
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 });
launchFullscreen();
}).catch(error => {
this.$messageBox(`${this.$t('scriptRecord.createSimulationFail')}: ${error.message}`);
});
},
handleConfirmReject(data) {
rejectScript(data.id, data).then(resp => {
this.reloadTable();
this.$message.success(this.$t('approval.rejectScriptSuccess'));
}).catch(error => {
this.$messageBox(`${this.$t('approval.rejectScriptFailed')}: ${error.message}`);
});
},
handleConfirmPass(data) {
publishScript(data.id).then(resp => {
this.reloadTable();
this.$message.success(this.$t('approval.passedScriptSuccess'));
}).catch(error => {
this.$messageBox(`${this.$t('approval.passedScriptFailed')}: ${error.message}`);
});
}
}
};
</script>
<style lang="scss" scoped>
/deep/
.el-row .el-button+.el-button{
margin-top: 10px;
}
</style>

View File

@ -1,70 +0,0 @@
<template>
<div>
<el-dialog :title="title" :visible.sync="dialogVisible" width="500px" :before-close="doClose" center>
<data-form ref="dataform" :form="form" :form-model="formModel" :rules="rules" />
<span slot="footer" class="dialog-footer">
<el-button type="primary" @click="doCreate">{{ $t('global.confirm') }}</el-button>
<el-button @click="doClose">{{ $t('global.cancel') }}</el-button>
</span>
</el-dialog>
</div>
</template>
<script>
export default {
name: 'ScriptOperate',
props: {
title:{type:String, required:true}
},
data() {
return {
dialogVisible: false,
formModel:{
id:'',
explanation:''
}
};
},
computed: {
form() {
const form = {
labelWidth: '150px',
items: [
{ prop: 'explanation', label: this.$t('approval.explanation'), type: 'textarea', required: true}
]
};
return form;
},
rules() {
const crules = {
explanation:[
{ required: true, message: this.$t('approval.inputRejectExplanation'), trigger: 'blur', max:200 }
]
};
return crules;
}
},
methods: {
doShow(row) {
this.formModel.id = row.id;
this.dialogVisible = true;
},
doCreate() {
const self = this;
this.$refs.dataform.validateForm(() => {
self.$emit('create', Object.assign({}, this.formModel));
self.doClose();
});
},
doClose() {
this.$refs.dataform.resetForm();
this.dialogVisible = false;
}
}
};
</script>
<style lang="scss" scoped>
/deep/ .el-dialog--center .el-dialog__body{
padding: 15px 65px 10px 10px;
}
</style>

View File

@ -23,7 +23,7 @@ import { UrlConfig } from '@/scripts/ConstDic';
import PublishCreate from './lessoncategory/edit/create'; import PublishCreate from './lessoncategory/edit/create';
import PublishLesson from './lessoncategory/edit/lesson/publish'; import PublishLesson from './lessoncategory/edit/lesson/publish';
import { delLesson } from '@/api/jmap/lessondraft'; import { delLesson } from '@/api/jmap/lessondraft';
import LessonDetail from '@/views/approval/lesson/detail'; import LessonDetail from '@/views/approval/detail';
import ConstConfig from '@/scripts/ConstConfig'; import ConstConfig from '@/scripts/ConstConfig';
export default { export default {

View File

@ -1,5 +1,5 @@
<template> <template>
<div class="chatBox" :class="{'active': drawer}" :style="{'bottom':offsetBottom+'px'}"> <div class="chatBox" :class="{'active': drawer}">
<div class="menuTrainListBtn" @click="clickBtn"> <div class="menuTrainListBtn" @click="clickBtn">
<!-- <i class="el-icon-more" /> --> <!-- <i class="el-icon-more" /> -->
<p style="margin: 0;"></p> <p style="margin: 0;"></p>
@ -120,10 +120,6 @@ export default {
inviteUserName:{ inviteUserName:{
type:String, type:String,
required:true required:true
},
offsetBottom:{
type:Number,
required:true
} }
}, },
data() { data() {
@ -178,7 +174,7 @@ export default {
if (memberList && memberList.length) { if (memberList && memberList.length) {
memberList.forEach(member => { memberList.forEach(member => {
if (member && !(member.children) && (member.userId == '' || member.userId)) { if (member && !(member.children) && (member.userId == '' || member.userId)) {
this.userString += member.memberName + ','; this.userString += member.label + ',';
this.memberIdList.push(member.id); this.memberIdList.push(member.id);
} }
}); });

View File

@ -46,7 +46,7 @@ export default {
const scrollTop = document.querySelector('.chatcontentInner').offsetHeight - document.querySelector('.chatcontentIn').offsetHeight + 30; const scrollTop = document.querySelector('.chatcontentInner').offsetHeight - document.querySelector('.chatcontentIn').offsetHeight + 30;
document.querySelector('.chatcontentIn').scrollTop = scrollTop; document.querySelector('.chatcontentIn').scrollTop = scrollTop;
}); });
} },
// playEachAudio(audioUrl) { // playEachAudio(audioUrl) {
// this.$nextTick(function() { // this.$nextTick(function() {
// document.querySelector('#audioPlay').src = audioUrl; // document.querySelector('#audioPlay').src = audioUrl;
@ -88,10 +88,10 @@ export default {
// } // }
// return name; // return name;
// }, // },
// playAudio(audioUrl) { playAudio(audioUrl) {
// document.querySelector('#audioPlay').src = audioUrl; document.querySelector('#audioPlay').src = audioUrl;
// document.querySelector('#audioPlay').play(); document.querySelector('#audioPlay').play();
// }, }
// conversationChange() { // conversationChange() {
// this.currentAudioList = []; // this.currentAudioList = [];
// } // }

View File

@ -7,8 +7,8 @@
:key="member.id" :key="member.id"
:style="computedStyle(member)" :style="computedStyle(member)"
class="each-chat-member" class="each-chat-member"
:title="member.memberName" :title="member.label"
>{{ member.memberName }}</div> >{{ member.label }}</div>
</div> </div>
</div> </div>
</template> </template>

View File

@ -1,828 +0,0 @@
<template>
<div class="chatBox" :class="{'active': drawer}" :style="{'bottom':bottom+'px'}">
<div class="menuTrainListBtn" @click="clickBtn">
<!-- <i class="el-icon-more" /> -->
<p style="margin: 0;"></p>
<p style="margin: 0;"></p>
</div>
<div class="chat-box-main">
<div class="chat-box-header">
<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()">
<i class="el-icon-plus" style="font-weight: bolder;" />
</div> -->
<div class="chat-setting" @click="handleSetting()">
<i class="el-icon-s-tools" />
</div>
</div>
<div v-if="isShow" class="chat-box-content">
<el-tree
ref="tree"
:data="treeData"
:props="defaultProps"
node-key="id"
default-expand-all
:filter-node-method="filterNode"
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 style="font-size: 14px">{{ data.label }}</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 v-if="isShow">
<div class="userString">{{ userString }}</div>
<el-button :loading="loading" size="mini" type="primary" class="chat-box-create-coversite" @click="doCreate">创建会话</el-button>
</div>
<div v-else>
<div class="chat-box-footer-tool" />
<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>
<chat-setting ref="chatSetting" :form="form" @setSetting="setSetting" />
<!-- <chat-create-group ref="createGroup" :group="group" :member-list="memberList" @addCoversition="addCoversition" /> -->
<chat-tooltip :group="group" @getCoversitionList="getCoversitionList" />
</div>
</template>
<script>
import CMD from '@/scripts/cmdPlugin/CommandEnum';
import ChatSetting from './chatSetting';
import ChatContent from './chatContent';
// import ChatCreateGroup from './chatCreateGroup';
import ChatMemberList from './chatMemberList';
import ChatTooltip from './chatTooltip';
import RecordRTC from 'recordrtc';
import {sendSimulationConversition, overSimulationConversition, getAllConversition, getSimulationConversition, startConversition} from '@/api/chat';
import ConstConfig from '@/scripts/ConstConfig';
import Cookies from 'js-cookie';
export default {
name: 'ChatBox',
components:{
ChatSetting,
ChatContent,
ChatMemberList,
// ChatCreateGroup,
ChatTooltip
},
props: {
group: {
type: String,
required: true
},
userRole: {
type: String,
required: true
}
},
data() {
return {
drawer: false,
bottom:15,
recordSending:false,
memberList:[],
treeData:[],
memberIdList: [],
queryMember: '',
userString:'',
currentMemberList:[],
chatContentList:[],
memberListCoversition:{},
seconds:0,
inter:null,
isHasCoversition:false,
loading:false,
recorders: null,
microphone:null,
isCreate:false,
scriptTip:'',
form:{
language:'zh',
sex:'1'
},
defaultProps: {
children: 'children',
label: 'label'
},
headerTitle:''
};
},
computed:{
isShow() {
return this.userRole != '' && this.userRole != 'ADMIN' && this.userRole != 'AUDIENCE' && !this.isHasCoversition;
},
isButtonShow() {
return this.userRole != '' && this.userRole != 'ADMIN' && this.userRole != 'AUDIENCE' && this.isHasCoversition;
}
},
watch: {
'$store.state.socket.simulationScriptTip':function(val, old) {
if (val) {
if (val.type == 'Conversation') {
const target = this.$refs.chatMemberList.getMember(val.targetId);
if (target && target.length > 0) {
this.scriptTip = '请对' + target[0].memberName + '说:' + val.reply;
}
} else if (val.type == 'Command') {
const device = val.operationType.split('_')[0];
const operate = 'CMD_' + val.operationType.toUpperCase();
this.$messageBox('请执行【' + CMD[device][operate].label + '】操作');
} else if (val.type == 'Over_Conversation') {
this.scriptTip = '请结束当前会话';
}
}
},
'$store.state.socket.scriptFinish':function(val, old) {
this.$message('剧本执行完成');
},
'$store.state.map.mapViewLoadedCount':function(val) {
const object = document.querySelector('.menuButton');
if (object) {
const objectBottom = object.offsetHeight || 0;
this.bottom = objectBottom + 15;
} else {
this.bottom = 15;
}
},
queryMember(val) {
if (this.$refs.tree) {
this.$refs.tree.filter(val);
}
},
'userRole':function(val) {
this.isHasCoversition = false;
//
if (val) {
this.getSimulationMembers();
}
},
'$store.state.scriptRecord.updateRoleStatus':function(val) {
//
this.getSimulationMembers();
},
'$store.state.scriptRecord.updateCoversitionStatus':function(val) {
//
this.isHasCoversition = false;
this.getSimulationConverMembers();
},
'memberListCoversition':function(val) {
this.getSimulationConverMembers();
},
'$store.state.socket.conversationInfo':function (val, old) { // 仿
const simulationText = this.$store.state.socket.conversationInfo;
if (this.memberListCoversition.id == val.id && val.messageType == 'MESSAGE') {
this.chatContentList.push(this.addContent(simulationText.message));
// this.scrollTop();
} else {
if (!simulationText.all && val.messageType == 'MESSAGE') {
this.chatContentList.push(this.addContent(simulationText.message));
}
}
}
},
mounted() {
this.initPage();
},
methods:{
clickBtn() {
if (this.drawer) {
this.drawer = false;
} else {
this.drawer = true;
}
},
async initPage() {
this.cancleRecording();
this.scriptTip = '';
},
addContent(simulationText) {
const text = {};
const member = this.memberList.find(member=>{
return member.id == simulationText.memberId;
});
const targetUser = this.currentMemberList.filter(currentMember=>{
return currentMember.id != simulationText.memberId;
});
if (member) {
text.self = (this.$store.state.user.id == member.userId);
text.member = member;
text.chatTime = simulationText.time;
text.src = simulationText.audioPath;
text.message = simulationText.content;
text.targetUser = targetUser;
}
return text;
},
//
getSimulationMembers() {
const memberList = this.$store.state.training.memberData;
let lastData = JSON.stringify(memberList);
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);
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;
if (member.deviceCode) {
const device = this.$store.getters['map/getDeviceByCode'](member.deviceCode);
if (device) {
if (device._type == 'Train') {
member.memberName = member.type + device.groupNumber + name;
if (activeList.length > 0 && activeList.includes(device.groupNumber)) {
lastMemberList.push(member);
member.label = member.memberName;
driverList.push(member);
}
} else {
member.memberName = member.type + device.name + name;
lastMemberList.push(member);
if (device._type == 'Station') {
member.label = member.memberName;
stationSupervisorList.push(member);
}
}
} else {
member.memberName = member.type + member.deviceCode + name;
lastMemberList.push(member);
}
} else {
member.memberName = member.type + name;
member.label = member.memberName;
if (member.type == '行调') {
dispatcherList.push(member);
} else if (member.type == '通号') {
maintainerList.push(member);
}
lastMemberList.push(member);
}
}
});
this.treeData = [{
label: '行调',
id: 'dispatcher',
type: 'role',
children: dispatcherList
}, {
label: '车站值班员',
id: 'stationSupervisor',
type: 'role',
children: stationSupervisorList
}, {
label: '司机',
id: 'driver',
type: 'role',
children: driverList
}, {
label: '通号',
id: 'maintainer',
type: 'role',
children: maintainerList
}];
this.memberList = lastMemberList;
this.getAllConversition();
},
doCreate() {
if (this.memberIdList.length > 0) {
this.loading = true;
startConversition(this.group, this.memberIdList).then(resp => {
if (resp.data) {
const data = resp.data;
this.loading = false;
this.addCoversition({data:data, headerTitle:resp.data.name});
this.memberIdList = [];
this.userString = '';
}
}).catch(error=>{
this.$messageBox('创建会话失败: ' + error.message);
this.loading = false;
this.dialogVisible = false;
this.checkList = [];
});
}
},
filterNode(value, data) {
return data.label.indexOf(value) !== -1;
},
handleCheckChange() {
const memberList = this.$refs.tree.getCheckedNodes();
this.userString = '';
this.memberIdList = [];
if (memberList && memberList.length) {
memberList.forEach(member => {
if (member && !(member.children) && (member.userId == '' || member.userId)) {
this.userString += member.memberName + ',';
this.memberIdList.push(member.id);
}
});
}
},
getAllConversition() {
if (this.recordSending) {
this.cancleRecording();
}
//
getAllConversition(this.$route.query.group).then(resp=>{
if (resp.data && resp.data.length && resp.data.length > 0) {
this.isCreate = false;
const coversitionList = resp.data;
let memberListCoversition = {};
coversitionList.forEach(coversition=>{
if (!coversition.over) {
const memberList = coversition.memberList;
memberList.forEach(member=>{
if (member.memberId == this.$store.state.scriptRecord.updateRoleId) {
memberListCoversition = {id:coversition.id, all:null};
if (member.memberId == coversition.creatorId) {
this.isCreate = true;
}
}
});
}
});
this.memberListCoversition = memberListCoversition;
} else {
this.isCreate = false;
this.memberListCoversition = {};
}
this.getSimulationConverMembers();
});
},
//
getSimulationConverMembers() {
this.currentMemberList = [];
this.chatContentList = [];
if (this.memberListCoversition && this.memberListCoversition.id) {
this.isHasCoversition = true;
getSimulationConversition(this.$route.query.group, this.memberListCoversition.id).then(resp => {
const memberList = resp.data.memberList;
const currentMemberList = [];
memberList.forEach(currentMember=>{
this.memberList.forEach(member=>{
if (currentMember.memberId == member.id) {
currentMemberList.push(member);
}
});
});
this.currentMemberList = currentMemberList;
const contentList = [];
resp.data.messageList.forEach(message=>{
contentList.push(this.addContent(message));
});
this.chatContentList = contentList;
});
} else {
this.isHasCoversition = false;
}
},
setSetting(data) {
this.form = data;
},
hideAddCoversition() {
this.isHasCoversition = true;
},
getCoversitionList() {
// this.$refs.chatCoversitionList.initPage(false);
},
// 仿
quitCoversition() {
this.loading = true;
overSimulationConversition(this.group, this.memberListCoversition.id).then(res=>{
this.loading = false;
this.memberListCoversition = {all:undefined, id:null};
this.isHasCoversition = false;
}).catch(error=>{
this.$messageBox('退出会话失败: ' + error.message);
this.loading = false;
});
},
setHeadTitle(headerTitle) {
this.headerTitle = headerTitle;
},
addCoversition({data, headerTitle}) {
this.isHasCoversition = true;
this.memberListCoversition = {id:data.id, all:data.all};
this.headerTitle = headerTitle;
this.isCreate = true;
},
clearAllData() {
this.initPage();
this.getSimulationMembers();
this.chatContentList = [];
},
//
startRecording() {
this.scriptTip = '';
const that = this;
if (!this.recordSending && !this.recorders && !this.microphone) {
this.$refs.chatSetting.doClose();
const StereoAudioRecorder = RecordRTC.StereoAudioRecorder;
navigator.getUserMedia(
{ audio: true } //
, function (stream) {
that.microphone = stream;
that.recorders = new RecordRTC(that.microphone, {
type: 'audio',
recorderType: StereoAudioRecorder,
numberOfAudioChannels: 1,
bitsPerSecond: 256000,
desiredSampRate: 16000
});
that.recorders.startRecording();
that.recordSending = true;
that.inter = setInterval(() => {
if (that.seconds < 60) {
that.seconds++;
} else {
clearInterval(that.inter);
}
}, 1000);
}, function (error) {
switch (error.code || error.name) {
case 'PERMISSION_DENIED':
case 'PermissionDeniedError':
that.$message({
showClose: true,
message: '用户拒绝提供信息',
type: 'error'
});
break;
case 'NOT_SUPPORTED_ERROR':
case 'NotSupportedError':
that.$message({
showClose: true,
message: '浏览器不支持硬件设备',
type: 'error'
});
break;
case 'MANDATORY_UNSATISFIED_ERROR':
case 'MandatoryUnsatisfiedError':
that.$message({
showClose: true,
message: '无法发现指定的硬件设备',
type: 'error'
});
break;
default:
that.$message({
showClose: true,
message: '无法打开麦克风',
type: 'error'
});
break;
}
}
);
}
},
cancleRecording() {
if (this.microphone) {
clearInterval(this.inter);
this.seconds = 0;
this.microphone.stop();
this.microphone = null;
this.recordSending = false;
this.recorders = null;
}
},
//
stopRecording() {
const that = this;
this.recorders.stopRecording(function(blobURL) {
const data = URL.createObjectURL(that.recorders.getBlob());
console.log('--------', data);
clearInterval(that.inter);
that.seconds = 0;
const blob = that.recorders.getBlob();
const fd = new FormData();
fd.append('file', blob);
sendSimulationConversition(that.group, that.memberListCoversition.id, fd)
.then((data) => {
})
.catch(error => {
console.log(error);
});
if (that.microphone) {
that.microphone.stop();
that.microphone = null;
that.recordSending = false;
that.recorders = null;
}
});
},
// handleCreateGroup() {
// this.$refs.createGroup.doShow();
// },
handleSetting() {
this.$refs.chatSetting.doShow();
},
connectMember(val) {
this.conversitionMemberList.forEach(member => {
if (member.memberId == val.memberId) {
member.connect = true;
}
});
}
}
};
</script>
<style lang="scss" scoped>
.chatBox {
position: absolute;
left: 0;
top: calc((100% - 400px) / 2);
height: 400px;
width: 503px;
transform: translateX(-503px);
transition: all 0.4s;
z-index: 9;
&.active{
transform: translateX(0px);
}
}
.menuTrainListBtn {
background: #fff;
text-align: center;
border-radius: 0px 6px 6px 0px;
position: absolute;
top: 45%;
z-index: 2;
transform: translateX(502px);
cursor: pointer;
z-index: 9;
display: flex;
flex-direction: column;
align-items: center;
text-align: center;
justify-content: center;
padding: 7px 4px;
.el-icon-more{
font-size: 20px;
margin-top: 9px;
transform-origin: 50% 50%;
transform: rotate(90deg);
margin-left:0px;
}
}
.chat-box-header{
width: 100%;
height: 40px;
border-bottom: 1px #dedede solid;
}
.chat-box-header-title{
font-size: 15px;
margin-left: 15px;
display: inline-block;
margin-top: 4px;
width: 70%;
overflow: hidden;
white-space: nowrap;
text-overflow: ellipsis;
}
.chat-box-content{
width: 100%;
height: 300px;
border-bottom: 1px #dedede solid;
position: relative;
}
.chatcontentInner{
height: 100%;
width: 362px;
display: inline-block;
overflow: auto;
cursor: auto;
position: relative;
}
.chat-box-footer{
display: inline-block;
width: 100%;
position: relative;
}
.chat-createGroup{
float: right;
line-height: 40px;
margin-right: 10px;
cursor: pointer;
font-size: 16px;
position: relative;
}
.chat-setting{
float: right;
line-height: 40px;
margin-right: 10px;
cursor: pointer;
font-size: 16px;
}
.chat-box-footer-tool{
width: 100%;
height: 30px;
}
.chat-box-footer-quit{
font-size: 12px;
padding: 5px 15px;
color: #fff;
float: left;
margin-left: 10px;
margin-bottom: 10px;
cursor: pointer;
}
.chat-box-footer-send{
font-size: 12px;
text-align: center;
float: right;
margin-right: 10px;
margin-bottom: 10px;
cursor: pointer;
padding: 5px 15px;
}
.chat-box-create-coversite{
font-size: 12px;
float: right;
margin-right: 10px;
margin-top: 18px;
cursor: pointer;
padding: 5px 15px;
}
.minimality {
float: right;
line-height: 40px;
margin-right: 10px;
cursor: pointer;
font-size:16px;
}
.chat-box-main{
position: absolute;
width: 100%;
left: 0;
height: 100%;
top: 0;
border-right: 1px #dedede solid;
z-index: 4;
background: #fff;
border-radius: 5px;
left: 0;
font-size:0;
}
.chat-coversition{
}
.coversition-list{
}
.chat-box-footer-send.disbled{
cursor: no-drop;
}
.scriptTip{
position: absolute;
width: 260px;
padding: 10px;
background: rgb(250, 246, 3);
right: 7px;
bottom:45px;
border-radius: 5px;
font-size: 14px;
color: #000000;
z-index: 2;
}
.scriptTip::after{
content: '';
position: absolute;
width: 0;
height: 0;
border-left: 10px solid transparent;
border-right: 10px solid transparent;
border-top: 8px solid #faf603;
right: 16px;
bottom: -7px;
}
.userString{
height: 50px;
width: 409px;
position: absolute;
left: 0;
top: 0;
padding: 4px 5px;
overflow-x: auto;
font-size: 13px;
line-height: 135%;
resize: none;
}
.showMembers{
float: right;
line-height: 40px;
margin-right: 10px;
cursor: pointer;
font-size: 17px;
}
#record_progress_bar{
height: 100%;
position: absolute;
background: #bbe5f5;
}
.chat_record_tip{
height: 28px;
display: inline-block;
background: #dfe6ee;
width: 100%;
font-size: 13px;
border-top: 1px #d8dce5 solid;
position: absolute;
bottom: 0;
right: 0;
}
.record_icon{
display: inline-block;
width: 8px;
height: 8px;
background: #25d825;
border-radius: 10px;
left: 7px;
margin-right: 0px;
box-shadow: -1px 0px 3px #6d6d6d;
border: 1px #28d228 solid;
position: absolute;
top: 10px;
}
.record_tip_text{
display: inline-block;
font-size: 12px;
margin-left: 3px;
// padding: 8px 0px 6px 0px;
position: absolute;
top: 8px;
left:20px
}
.record_tip_confirm{
position: absolute;
right: 63px;
padding: 3px 0px 2px 0px;
border: 1px #a2a5aa solid;
border-radius: 5px;
width: 45px;
text-align: center;
font-size: 12px;
top: 4px;
background: #eeeeee;
cursor: pointer;
}
.record_tip_cancle{
position: absolute;
right: 10px;
padding: 3px 0px 2px 0px;
border: 1px #a2a5aa solid;
border-radius: 5px;
width: 45px;
text-align: center;
font-size: 12px;
top: 4px;
background: #eeeeee;
cursor: pointer;
}
</style>

View File

@ -1,153 +0,0 @@
<template>
<div class="chatcontentIn">
<div class="chatcontentInner">
<div v-for="(chatContent,index) in chatContentList" :key="index" class="chatContentInClass">
<div :class="chatContent.self?'rightUser':'leftUser'">
<div class="userHeader">
<!-- chatContent.all&& -->
<div v-if="!chatContent.self" class="userName">{{ covertName(chatContent.member) }}</div>
<div :class="chatContent.self?'userChatTime textRight':'userChatTime'">{{ formatTime(chatContent.chatTime) }}</div>
</div>
<!-- @click="playAudio('audio'+index) -->
<div class="userBubble" @click="playAudio(baseUrl+chatContent.src)">
<div class="userMessage">
<!-- &&!(chatContent.self) -->
<!-- v-if="chatContent.all" -->
<span style="color:#409eff">@{{ covertName(chatContent.targetUser) }}</span>
<span class="el-icon-video-play playicon" />
<span class="messageText">{{ chatContent.message }}</span>
</div>
</div>
<audio id="audioPlay" style="display:none" />
</div>
</div>
</div>
</div>
</template>
<script>
export default {
props:{
chatContentList:{
type:Array,
required:true
}
},
data() {
return {
baseUrl:process.env.VUE_APP_VOICE_API
};
},
methods:{
scrollTop() {
this.$nextTick(function() {
const scrollTop = document.querySelector('.chatcontentInner').offsetHeight - document.querySelector('.chatcontentIn').offsetHeight + 30;
document.querySelector('.chatcontentIn').scrollTop = scrollTop;
});
},
formatTime(time) {
return /\d{2}:\d{2}:\d{2}/.exec(time)[0] || time;
},
covertName(memberId) {
let name = '';
const member = this.$store.state.training.memberData[memberId];
if (member && member.userId) {
const user = this.simulationUsers[member.userId];
name = member.label + '(' + user.nickName + ')';
} else if (member) {
name = member.label;
}
return name;
},
playAudio(audioUrl) {
document.querySelector('#audioPlay').src = audioUrl;
document.querySelector('#audioPlay').play();
}
// reloadData(currentCoversition) {
// this.chatContentList = [];
// this.coversition = currentCoversition;
// this.inintData();
// }
}
};
</script>
<style lang="scss" scoped>
.chatcontentIn{
height: 100%;
width: 100%;
display: inline-block;
overflow: auto;
padding-bottom: 20px;
cursor:auto;
}
.leftUser{
float: left;
margin-left: 10px;
margin-top: 10px;
display: inline-block;
}
.rightUser{
float: right;
margin-right: 10px;
margin-top: 10px;
display: inline-block;
}
.userHeader{margin-bottom: 2px;}
.userName{font-size: 12px;display:inline-block;margin-right:10px;}
.userChatTime{font-size: 12px;display:inline-block;}
.userBubble{
max-width: 200px;
font-size: 12px;
padding: 10px;
background: #ccc;
border-radius: 5px;
cursor: pointer;
}
.playicon{
font-size: 20px;
vertical-align: top;
}
.textRight{text-align: right;width: 100%;}
.userMessage{}
.messageText{line-height: 20px;}
.chatContentInClass{
display: inline-block;
width: 100%;
}
// safariqq360
//
.chatcontentIn::-webkit-scrollbar {
width: 6px;
height: 6px;
// height: 110px;
background-color: #FFFFFF;
}
/*定义滚动条轨道 内阴影+圆角*/
.chatcontentIn::-webkit-scrollbar-track {
// box-shadow: inset 0 0 6px rgba(0,0,0,0.3);
border-radius: 10px;
background-color: #FFFFFF;;
}
/*定义滑块 内阴影+圆角*/
.chatcontentIn::-webkit-scrollbar-thumb {
border-radius: 10px;
// box-shadow: inset 0 0 6px rgba(0,0,0,.3);
background-color: #cacaca;
}
/*滑块效果*/
.chatcontentIn::-webkit-scrollbar-thumb:hover {
border-radius: 5px;
// box-shadow: inset 0 0 5px rgba(0,0,0,0.2);
background: rgba(0,0,0,0.4);
}
/*IE滚动条颜色*/
html {
scrollbar-face-color:#bfbfbf;/*滚动条颜色*/
scrollbar-highlight-color:#000;
scrollbar-3dlight-color:#000;
scrollbar-darkshadow-color:#000;
scrollbar-Shadow-color:#adadad;/*滑块边色*/
scrollbar-arrow-color:rgba(0,0,0,0.4);/*箭头颜色*/
scrollbar-track-color:#eeeeee;/*背景颜色*/
}
</style>

View File

@ -1,199 +0,0 @@
<template>
<div v-show="dialogVisible" class="chat-create-group">
<div class="create-group-header">
<div class="create-group-title">添加会话对象</div>
<div class="create-group-close">
<i class="el-icon-close" @click="dialogVisible=false" />
</div>
</div>
<div class="create-group-content">
<div class="chat-member-list">
<el-checkbox-group v-model="checkList">
<el-checkbox
v-for="member in memberList"
:key="member.id"
class="each-chat-member"
:label="member"
:disabled="member.disabled"
>{{ member.memberName }}</el-checkbox>
</el-checkbox-group>
</div>
<div class="currentSelectList">
<div
v-for="member in checkList"
:key="member.id"
class="eachSelect"
>
{{ member.memberName }}
</div>
</div>
</div>
<div class="create-group-bottom">
<el-button :loading="loading" size="small" type="primary" @click="doCreate">创建会话</el-button>
<el-button size="small" @click="doClose">取消</el-button>
</div>
</div>
</template>
<script>
import {startConversition} from '@/api/chat';
export default {
name:'ChatCreateGroup',
props: {
group: {
type: String,
required: true
},
memberList:{
type: Array,
required: true
}
},
data() {
return {
dialogVisible:false,
loading:false,
checkList:[]
};
},
computed:{
userId() {
return parseInt(this.$store.state.user.id);
}
},
methods:{
doShow() {
this.dialogVisible = true;
},
doCreate() {
if (this.checkList.length > 0) {
this.loading = true;
const checkList = this.checkList.map(function(check) { return check.id; });
startConversition(this.group, checkList).then(resp => {
if (resp.data) {
const data = resp.data;
this.loading = false;
this.$emit('addCoversition', {data:data, headerTitle:resp.data.name});
this.dialogVisible = false;
this.checkList = [];
}
}).catch(error=>{
this.$messageBox('创建会话失败: ' + error.message);
this.loading = false;
this.dialogVisible = false;
this.checkList = [];
});
}
},
doClose() {
this.checkList = [];
this.dialogVisible = false;
}
}
};
</script>
<style lang="scss" scoped>
.chat-create-group{
position: absolute;
width: 70%;
height: 300px;
border: 1px #dedede solid;
left: 26%;
top: 8%;
z-index: 7;
border-radius: 8px;
box-shadow: #b5aeae 0 0 10px;
background: #fff;
}
.create-group-header{
padding-left: 10px;
padding-top: 6px;
font-size: 14px;
border-bottom: 1px #dedede solid;
padding-bottom: 6px;
}
.create-group-title{
display: inline-block;
}
.create-group-close{
float: right;
display: inline-block;
margin-right: 5px;
font-size: 16px;
cursor: pointer;
}
.chat-member-list{
width: 54%;
height: 216px;
overflow-y: auto;
padding: 5px 10px;
font-size: 14px;
overflow-x: hidden;
border-right: 1px #ccc solid;
display:inline-block;
}
.create-group-content{
width: 100%;
height: 220px;
padding-bottom: 10px;
border-bottom: 1px #dedede solid;
}
.create-group-bottom{
text-align: center;
margin-top:8px;
}
.each-chat-member{
display:block;
margin-top:5px;
}
.currentSelectList{
display: inline-block;
width: 44%;
font-size: 14px;
vertical-align: top;
padding: 5px 10px;
overflow-x: hidden;
overflow-y: auto;
height: 216px;
}
.eachSelect{
display:block;
margin-top:5px;
}
// safariqq360
//
.chat-member-list::-webkit-scrollbar,.currentSelectList::-webkit-scrollbar {
width: 6px;
height: 6px;
// height: 110px;
background-color: #FFFFFF;
}
/*定义滚动条轨道 内阴影+圆角*/
.chat-member-list::-webkit-scrollbar-track,.currentSelectList::-webkit-scrollbar-track{
// box-shadow: inset 0 0 6px rgba(0,0,0,0.3);
border-radius: 10px;
background-color: #FFFFFF;;
}
/*定义滑块 内阴影+圆角*/
.chat-member-list::-webkit-scrollbar-thumb,.currentSelectList::-webkit-scrollbar-thumb{
border-radius: 10px;
// box-shadow: inset 0 0 6px rgba(0,0,0,.3);
background-color: #cacaca;
}
/*滑块效果*/
.chat-member-list::-webkit-scrollbar-thumb:hover,.currentSelectList::-webkit-scrollbar-thumb:hover {
border-radius: 5px;
// box-shadow: inset 0 0 5px rgba(0,0,0,0.2);
background: rgba(0,0,0,0.4);
}
/*IE滚动条颜色*/
html {
scrollbar-face-color:#bfbfbf;/*滚动条颜色*/
scrollbar-highlight-color:#000;
scrollbar-3dlight-color:#000;
scrollbar-darkshadow-color:#000;
scrollbar-Shadow-color:#adadad;/*滑块边色*/
scrollbar-arrow-color:rgba(0,0,0,0.4);/*箭头颜色*/
scrollbar-track-color:#eeeeee;/*背景颜色*/
}
</style>

View File

@ -1,117 +0,0 @@
<template>
<div class="chat-box-members">
<div class="chat-member-title">成员列表</div>
<div v-if="userRole!=''" class="chat-member-list">
<div
v-for="member in currentMemberList"
:key="member.id"
:style="member.userId === userId ?'color:red':''"
class="each-chat-member"
:title="member.memberName"
>{{ member.memberName }}</div>
<!-- :class="member.online?'each-chat-member':'each-chat-member each-chat-member-outline'" -->
</div>
</div>
</template>
<script>
export default {
name: 'ChatMemberList',
props: {
currentMemberList:{
type:Array,
required:true
},
userRole:{
type: String,
required: true
}
},
computed:{
userId() {
return this.$store.state.user.id;
}
},
watch:{
'$store.state.socket.acceptConversionInvite':function(val) {
this.$emit('connectMember', val);
}
},
mounted() {
},
methods:{
}
};
</script>
<style lang="scss" scoped>
.memberAnimate{
transform: translateX(97%);
}
.chat-box-members{
position: absolute;
width: 140px;
top: 0;
right: 0;
height: 100%;
background: #fff;
border-left: 1px #dedede solid;
padding: 12px 2px 10px 10px;
font-size: 14px;
}
.chat-member-title{
}
.chat-member-list{
margin-top: 10px;
font-size: 12px;
margin-left: 0px;
height: calc(100% - 18px);
overflow-y: auto;
}
.each-chat-member{
margin-bottom: 10px;
width: 100%;
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
cursor: pointer;
}
.each-chat-member-outline{
color: #ccc;
}
// safariqq360
//
.chat-member-list::-webkit-scrollbar {
width: 6px;
height: 6px;
// height: 110px;
background-color: #FFFFFF;
}
/*定义滚动条轨道 内阴影+圆角*/
.chat-member-list::-webkit-scrollbar-track {
// box-shadow: inset 0 0 6px rgba(0,0,0,0.3);
border-radius: 10px;
background-color: #FFFFFF;;
}
/*定义滑块 内阴影+圆角*/
.chat-member-list::-webkit-scrollbar-thumb {
border-radius: 10px;
// box-shadow: inset 0 0 6px rgba(0,0,0,.3);
background-color: #cacaca;
}
/*滑块效果*/
.chat-member-list::-webkit-scrollbar-thumb:hover {
border-radius: 5px;
// box-shadow: inset 0 0 5px rgba(0,0,0,0.2);
background: rgba(0,0,0,0.4);
}
/*IE滚动条颜色*/
html {
scrollbar-face-color:#bfbfbf;/*滚动条颜色*/
scrollbar-highlight-color:#000;
scrollbar-3dlight-color:#000;
scrollbar-darkshadow-color:#000;
scrollbar-Shadow-color:#adadad;/*滑块边色*/
scrollbar-arrow-color:rgba(0,0,0,0.4);/*箭头颜色*/
scrollbar-track-color:#eeeeee;/*背景颜色*/
}
</style>

View File

@ -1,126 +0,0 @@
<template>
<div v-show="dialogVisible" class="chat-popup">
<div class="chat-setting-header">
<div class="chat-setting-title">设置</div>
<div class="chat-setting-close">
<i class="el-icon-close" @click="dialogVisible=false" />
</div>
</div>
<div class="chat-setting-content">
<div class="chat-setting-language">
<div class="setting-language-title">语言: </div>
<el-switch
v-model="form.language"
class="setting-language-select"
active-color="#409EFF"
inactive-color="#ff4949"
active-text="中"
inactive-text="En"
active-value="zh"
inactive-value="en"
@change="changeLanguage()"
/>
</div>
<div class="chat-setting-sex">
<div class="setting-sex-title">性别: </div>
<el-switch
v-model="form.sex"
class="setting-sex-select"
active-color="#409EFF"
inactive-color="#ff4949"
active-icon-class="el-icon-male"
inactive-icon-class="el-icon-female"
active-value="1"
inactive-value="0"
@change="changeSex()"
/>
</div>
</div>
</div>
</template>
<script>
export default {
name: 'ChatSetting',
props:{
form:{
type:Object,
required:true
}
},
data() {
return {
dialogVisible: false,
loading:false
};
},
methods:{
doShow() {
this.dialogVisible = true;
},
doClose() {
this.dialogVisible = false;
},
changeLanguage() {
this.$emit('setSetting', this.form);
},
changeSex() {
this.$emit('setSetting', this.form);
}
}
};
</script>
<style lang="scss" scoped>
.chat-popup{
position: absolute;
width: 54%;
height: 143px;
border: 1px #dedede solid;
left: 33%;
top: 24%;
z-index: 7;
border-radius: 4px;
-webkit-box-shadow: 3px 3px 3px #dedede;
box-shadow: 3px 3px 3px #dedede;
background: #fff;
}
.chat-setting-header{
padding-left: 10px;
padding-top: 6px;
font-size: 14px;
border-bottom: 1px #dedede solid;
padding-bottom: 6px;
}
.chat-setting-title{
display: inline-block;
}
.chat-setting-close{
float: right;
display: inline-block;
margin-right: 5px;
font-size: 16px;
cursor: pointer;
}
.chat-setting-content{
}
.chat-setting-language,.chat-setting-sex{
display: inline-block;
margin-top: 20px;
}
.setting-language-title,.setting-sex-title{
display: inline-block;
font-size: 14px;
margin-left: 20px;
vertical-align: top;
margin-top: 3px;
}
.setting-language-select,.setting-sex-select{
display: inline-block;
vertical-align: top;
}
</style>
<style lang="scss">
.setting-sex-select .el-icon-male,.setting-sex-select .el-icon-female{
font-size:18px !important;
}
</style>

View File

@ -1,110 +0,0 @@
<template>
<div v-show="dialogVisible" class="chatTooltipAll">
<div class="chatTooltip">
<div class="chatTooltipHeader">
{{ userName }} 邀请您加入会话
</div>
<div class="chatTooltipBootom">
<div class="create-group-bottom">
<el-button :loading="loading" size="small" type="primary" @click="doCreate">接受</el-button>
<el-button size="small" @click="doClose">拒绝</el-button>
</div>
</div>
</div>
</div>
</template>
<script>
import ConstConfig from '@/scripts/ConstConfig';
import Cookies from 'js-cookie';
import {acceptCoversitionInvite} from '@/api/chat';
export default {
name:'ChatTooltip',
props: {
group: {
type: String,
required: true
}
},
data() {
return {
userName:'',
dialogVisible:false,
loading:false,
conversationId:''
};
},
watch:{
'$store.state.socket.inviteOtherIntoChat':function(val) {
this.userName = this.coverName(val);
this.dialogVisible = true;
this.conversationId = val.conversationId;
}
},
// {"conversationId":"22e10b17-7a6c-4b1b-8724-f87fb2053b76","from":{"id":"17","userId":"75","name":"",
// "role":"STATION_SUPERVISOR","deviceType":"STATION","deviceCode":"Station32955","deviceName":"","online":true,"robot":false}
methods:{
coverName(inviteUser) {
const member = inviteUser.from;
const roleTypeList = ConstConfig.ConstSelect.roleTypeNew;
let data = member.role;
roleTypeList.forEach(function(element) {
const rolename = element.value;
if (Cookies.get('user_lang') == 'en') {
data = data.replace(rolename, element.enLabel);
} else {
data = data.replace(rolename, element.label);
}
});
const deviceName = member.deviceName ? '-' + member.deviceName : '';
const memberName = member.name ? '-' + member.name : '';
return data + deviceName + memberName;
},
doCreate() {
this.loading = true;
acceptCoversitionInvite(this.group, this.conversationId).then(res=>{
this.loading = false;
this.dialogVisible = false;
this.$emit('getCoversitionList');
}).catch(error=>{
this.$messageBox('接受邀请失败: ' + error.message);
});
},
doClose() {
this.dialogVisible = false;
}
}
};
</script>
<style lang="scss" scoped>
.chatTooltip{
position: absolute;
width: 290px;
left: 32%;
top: 42%;
z-index: 5;
background: #fff;
padding: 15px;
box-shadow: #969090 0px 0px 10px;
border-radius: 4px;
line-height: 20px;
transform: translateY(-50%);
}
.chatTooltipHeader{
margin-top:10px;
font-size:14px;
}
.chatTooltipBootom{
margin-top:10px;
text-align: center;
margin-bottom:10px;
}
.chatTooltipAll{
position:absolute;
width:100%;
height:100%;
left:0;
top:0;
z-index: 10;
}
</style>

View File

@ -4,7 +4,6 @@
:group="group" :group="group"
:is-show="isShow" :is-show="isShow"
:tree-data="treeData" :tree-data="treeData"
:offset-bottom="offsetBottom"
:conversition-id="conversitionId" :conversition-id="conversitionId"
:current-member-list="currentMemberList" :current-member-list="currentMemberList"
:chat-content-list="chatContentList" :chat-content-list="chatContentList"
@ -40,7 +39,6 @@ export default {
}, },
data() { data() {
return { return {
offsetBottom:15,
scriptTip:'', scriptTip:'',
isHasCoversition:false, isHasCoversition:false,
conversitionId:'', conversitionId:'',
@ -66,13 +64,6 @@ export default {
} }
}, },
watch:{ watch:{
'$store.state.config.menuBarLoadedCount': function (val) {
this.$nextTick(() => {
this.offsetBottom = 15;
const menuBottom = document.getElementById('menuButton');
this.offsetBottom = this.offsetBottom + (menuBottom ? menuBottom.offsetHeight || 0 : 0);
});
},
'$store.state.map.mapViewLoadedCount': function (val) { // 仿 '$store.state.map.mapViewLoadedCount': function (val) { // 仿
getSimulationMemberList(this.group).then(resp => { getSimulationMemberList(this.group).then(resp => {
let lastData = JSON.stringify(resp.data); let lastData = JSON.stringify(resp.data);
@ -108,9 +99,8 @@ export default {
const device = this.$store.getters['map/getDeviceByCode'](member.deviceCode); const device = this.$store.getters['map/getDeviceByCode'](member.deviceCode);
if (device) { if (device) {
if (device._type == 'Train') { if (device._type == 'Train') {
member.memberName = member.type + device.groupNumber + name; member.label = member.type + device.groupNumber + name;
lastMemberList.push(member); lastMemberList.push(member);
member.label = member.memberName;
if (this.activeTrainList.length > 0) { if (this.activeTrainList.length > 0) {
if (this.activeTrainList.includes(member.deviceCode)) { if (this.activeTrainList.includes(member.deviceCode)) {
driverList.push(member); driverList.push(member);
@ -119,20 +109,18 @@ export default {
this.driverList.push(member); this.driverList.push(member);
} }
} else { } else {
member.memberName = member.type + device.name + name; member.label = member.type + device.name + name;
lastMemberList.push(member); lastMemberList.push(member);
if (device._type == 'Station') { if (device._type == 'Station') {
member.label = member.memberName;
stationSupervisorList.push(member); stationSupervisorList.push(member);
} }
} }
} else { } else {
member.memberName = member.type + member.deviceCode + name; member.label = member.type + member.deviceCode + name;
lastMemberList.push(member); lastMemberList.push(member);
} }
} else { } else {
member.memberName = member.type + name; member.label = member.type + name;
member.label = member.memberName;
if (member.type == '行调') { if (member.type == '行调') {
dispatcherList.push(member); dispatcherList.push(member);
} else if (member.type == '通号') { } else if (member.type == '通号') {
@ -248,7 +236,7 @@ export default {
if (val) { if (val) {
if (val.type == 'Conversation') { if (val.type == 'Conversation') {
this.scriptTip = '请说:' + val.content; this.scriptTip = '请说:' + val.content;
} else if (val.type == 'Command') { } else if (val.type == 'Operation') {
const commandName = val.operationType; const commandName = val.operationType;
let device = val.operationType.split('_')[0]; let device = val.operationType.split('_')[0];
if (device == 'CM') { if (device == 'CM') {
@ -267,6 +255,19 @@ export default {
} }
}); });
this.scriptTip = '请创建会话,选择' + inviteMember.toString(); this.scriptTip = '请创建会话,选择' + inviteMember.toString();
} else if (val.type == 'Command') {
const targetName = this.memberData.find(member=>{ return member.id == val.commandInitiateVO.targetMemberId; });
const CommandList = {
Drive_Ahead:'确认运行至前方站',
Route_Block_Drive:'进路闭塞法行车',
Drive_Through_The_Guide_Signal:'越引导信号行驶',
Drive_Through_The_Red_Light:'越红灯行驶',
Drive_In_Urm_Mode:'URM模式驾驶',
Set_Speed_Limit:'设置限速',
Open_Or_Close_Door:'开关门',
Switch_Hook_Lock: '道岔钩锁'
};
this.$messageBox('请对【' + targetName.label + '】下达【' + CommandList[val.commandInitiateVO.commandType] + '】指令');
} }
} }
}, },

View File

@ -5,7 +5,7 @@
<map-system-draft ref="mapCanvas" @back="back" /> <map-system-draft ref="mapCanvas" @back="back" />
</transition> </transition>
<script-preview-chat ref="chatbox" :group="group" :user-role="userRole" :member-data="memberData" :tree-data="treeData" :offset-bottom="offsetBottom" /> <script-preview-chat ref="chatbox" :group="group" :user-role="userRole" :member-data="memberData" :tree-data="treeData" />
<div class="display-draft"> <div class="display-draft">
<el-button v-if="isscriptRun&&!dataError" type="danger" @click="handleQuitQuest">{{ $t('display.demon.exitScript') }}</el-button> <el-button v-if="isscriptRun&&!dataError" type="danger" @click="handleQuitQuest">{{ $t('display.demon.exitScript') }}</el-button>
<el-button type="primary" @click="back">{{ $t('display.demon.back') }}</el-button> <el-button type="primary" @click="back">{{ $t('display.demon.back') }}</el-button>
@ -308,25 +308,22 @@ export default {
const device = this.$store.getters['map/getDeviceByCode'](member.deviceCode); const device = this.$store.getters['map/getDeviceByCode'](member.deviceCode);
if (device) { if (device) {
if (device._type == 'Train') { if (device._type == 'Train') {
member.memberName = member.type + device.groupNumber + name; member.label = member.type + device.groupNumber + name;
lastMemberList.push(member); lastMemberList.push(member);
member.label = member.memberName;
driverList.push(member); driverList.push(member);
} else { } else {
member.memberName = member.type + device.name + name; member.label = member.type + device.name + name;
lastMemberList.push(member); lastMemberList.push(member);
if (device._type == 'Station') { if (device._type == 'Station') {
member.label = member.memberName;
stationSupervisorList.push(member); stationSupervisorList.push(member);
} }
} }
} else { } else {
member.memberName = member.type + member.deviceCode + name; member.label = member.type + member.deviceCode + name;
lastMemberList.push(member); lastMemberList.push(member);
} }
} else { } else {
member.memberName = member.type + name; member.label = member.type + name;
member.label = member.memberName;
if (member.type == '行调') { if (member.type == '行调') {
dispatcherList.push(member); dispatcherList.push(member);
} else if (member.type == '通号') { } else if (member.type == '通号') {

View File

@ -8,7 +8,7 @@
<el-button type="primary" @click="back">{{ $t('scriptRecord.scriptBack') }}</el-button> <el-button type="primary" @click="back">{{ $t('scriptRecord.scriptBack') }}</el-button>
</el-button-group> </el-button-group>
</div> </div>
<chat-box ref="chatbox" :group="group" :user-role="userRole" /> <script-chat ref="chatbox" :group="group" :user-role="userRole" />
<set-time ref="setTime" @ConfirmSelectBeginTime="start" /> <set-time ref="setTime" @ConfirmSelectBeginTime="start" />
<tip-script-record-new ref="tipTaskRecordNew" :group="group" :offset-bottom="offsetBottom" /> <tip-script-record-new ref="tipTaskRecordNew" :group="group" :offset-bottom="offsetBottom" />
</div> </div>
@ -16,7 +16,7 @@
<!-- 单人仿真 --> <!-- 单人仿真 -->
<script> <script>
import ChatBox from './chatView/chatBox'; import ScriptChat from './scriptChat';
import TipScriptRecordNew from '@/views/scriptManage/tipScriptRecord'; import TipScriptRecordNew from '@/views/scriptManage/tipScriptRecord';
import SetTime from './demon/setTime'; import SetTime from './demon/setTime';
import { Notification } from 'element-ui'; import { Notification } from 'element-ui';
@ -27,7 +27,7 @@ export default {
name: 'MenuTask', name: 'MenuTask',
components: { components: {
SetTime, SetTime,
ChatBox, ScriptChat,
TipScriptRecordNew TipScriptRecordNew
}, },
props: { props: {

View File

@ -0,0 +1,346 @@
<template>
<chat-box
ref="chatbox"
:group="group"
:is-show="isShow"
:tree-data="treeData"
:conversition-id="conversitionId"
:current-member-list="currentMemberList"
:chat-content-list="chatContentList"
:script-tip="scriptTip"
:is-start-record="isStartRecord"
:invite-user-name="inviteUserName"
:is-quit-show="isQuitShow"
@setScriptTip="setScriptTip"
@resetCoversition="resetCoversition"
/>
</template>
<script>
import ChatBox from '../chatView/chatBox.vue';
import ConstConfig from '@/scripts/ConstConfig';
import Cookies from 'js-cookie';
import {getAllConversition} from '@/api/chat';
import { getSimulationMemberList} from '@/api/simulation';
export default {
name:'ScriptChat',
components:{
ChatBox
},
props: {
group: {
type: String,
required: true
},
userRole: {
type: String,
required: true
}
},
data() {
return {
scriptTip:'',
isHasCoversition:false,
conversitionId:'',
currentMemberList:[],
memberData:{},
chatContentList:[],
activeTrainList:[],
isStartRecord:false,
inviteUserName:'',
inviteUser:{},
isQuitShow:false,
treeData:[],
driverList:[]
};
},
computed:{
isShow() {
return this.userRole != '' &&
this.userRole != 'ADMIN' && this.userRole != 'AUDIENCE' &&
!this.isHasCoversition;
}
},
watch:{
'$store.state.map.mapViewLoadedCount': function (val) { // 仿
getSimulationMemberList(this.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);
const lastMemberList = [];
const dispatcherList = [];
// const electricDispatcherList = [];
const depotDispatcherList = [];
const stationSupervisorList = [];
this.driverList = [];
const maintainerList = [];
const driverList = [];
this.treeData = [];
lastData.forEach((member, index)=>{
if (member.type != '观众') {
if (!member.userId) {
member.userId = '';
member.disabled = false;
} else {
member.disabled = true;
}
const name = member.name == undefined ? '' : '-' + member.name;
if (member.deviceCode) {
const device = this.$store.getters['map/getDeviceByCode'](member.deviceCode);
if (device) {
if (device._type == 'Train') {
member.label = member.type + device.groupNumber + name;
member.deviceName = member.deviceCode;
lastMemberList.push(member);
if (this.activeTrainList.length > 0) {
if (this.activeTrainList.includes(member.deviceCode)) {
driverList.push(member);
}
} else {
this.driverList.push(member);
}
} else {
member.deviceName = device.name;
member.label = member.type + device.name + name;
lastMemberList.push(member);
if (device._type == 'Station') {
stationSupervisorList.push(member);
}
}
} else {
member.deviceName = member.deviceCode;
member.label = member.type + member.deviceCode + name;
lastMemberList.push(member);
}
} else {
member.label = member.type + name;
if (member.type == '行调') {
dispatcherList.push(member);
} else if (member.type == '通号') {
maintainerList.push(member);
} else if (member.type == '车辆段调度') {
depotDispatcherList.push(member);
}
lastMemberList.push(member);
}
}
});
this.treeData = [{
label: '行调',
id: 'dispatcher',
type: 'role',
children: dispatcherList
}, {
label: '车站值班员',
id: 'stationSupervisor',
type: 'role',
children: stationSupervisorList
}, {
label: '司机',
id: 'driver',
type: 'role',
children: driverList
}, {
label: '通号',
id: 'maintainer',
type: 'role',
children: maintainerList
}, {
label: '车辆段',
id: 'depotDispatcher',
type: 'role',
children: depotDispatcherList
}];
this.memberData = lastMemberList;
}).catch(() => {
this.$messageBox('获取仿真成员列表失败!');
});
},
'userRole':function(val, oldval) {
//
this.changeRole(oldval, val);
},
'$store.state.scriptRecord.updateRoleStatus':function(val) {
//
this.changeRole(this.$store.state.scriptRecord.userRole, this.$store.state.scriptRecord.userRole);
},
// ()
'$store.state.map.activeTrainListChange': function (val) {
const activeTrainList = this.$store.state.map.activeTrainList;
if (this.driverList.length > 0) {
const driverList = [];
if (activeTrainList && activeTrainList.length) {
activeTrainList.forEach(groupNumber => {
const drivers = this.driverList.find(driver=>{
return driver.deviceCode == groupNumber;
});
if (drivers) {
driverList.push(drivers);
}
});
}
this.treeData[2].children = driverList;
} else {
this.activeTrainList = activeTrainList;
}
},
//
'$store.state.socket.createConversition':function(val) {
if (this.memberData.length > 0) {
const member = this.memberData.find(member=>{ return member.id == val.creatorId; });
if (member && member.userId == this.$store.state.user.id) {
//
this.isHasCoversition = true;
this.isStartRecord = true;
this.isQuitShow = true;
this.conversitionId = val.id;
const memberList = [];
val.memberIds.forEach(id=>{
if (val.creatorId == id) {
member.connect = true;
memberList.push(member);
} else {
const member = this.memberData.find(member=>{ return member.id == id; });
member.connect = false;
member && memberList.push(member);
}
});
this.currentMemberList = memberList;
} else {
//
if (this.userRole == 'AUDIENCE') {
this.isHasCoversition = true;
this.currentMemberList = this.memberData;
}
}
}
},
//
'$store.state.socket.acceptConversionInvite':function(val) {
this.conversitionId = val.id;
if (this.conversitionId) {
//
const memberList = this.currentMemberList.map(member => {
if (member.id == val.memberId) {
member.connect = true;
}
return member;
});
this.currentMemberList = memberList;
}
},
//
'$store.state.socket.conversationInfo':function (val, old) { // 仿
const simulationText = this.$store.state.socket.conversationInfo;
if (val.messageType == 'MESSAGE' && (this.conversitionId == val.id || this.userRole == 'AUDIENCE')) {
this.chatContentList.push(this.addContent(simulationText.message));
}
},
'$store.state.scriptRecord.updateCoversitionStatus':function(val) {
//
this.getAllConversition();
}
},
methods:{
setScriptTip(scriptTip) {
this.scriptTip = scriptTip;
},
addContent(simulationText) {
const text = {};
const member = this.currentMemberList.find(member=>{
return member.id == simulationText.memberId;
});
if (member) {
text.self = (this.$store.state.user.id == member.userId);
text.member = member;
text.chatTime = simulationText.time;
text.src = simulationText.audioPath;
text.message = simulationText.content;
}
return text;
},
resetCoversition() {
this.conversitionId = '';
this.scriptTip = '';
this.isHasCoversition = false;
this.currentMemberList = [];
this.chatContentList = [];
this.isStartRecord = false;
this.inviteUserName = '';
this.inviteUser = {};
this.isQuitShow = false;
},
changeRole(oldval, val) {
const userList = ['DISPATCHER', 'STATION_SUPERVISOR', 'DRIVER', 'MAINTAINER', 'DEPOT_DISPATCHER'];
//
this.getAllConversition();
const oldIndex = userList.indexOf(oldval);
if (oldIndex >= 0) {
this.treeData[oldIndex].children.forEach(child=>{
if (child.userId) {
child.userId = '';
child.disabled = false;
child.label = child.type + (child.deviceName ? child.deviceName : '');
}
});
}
const index = userList.indexOf(val) || 0;
this.treeData[index].children.forEach(child=>{
if (child.id == this.$store.state.scriptRecord.updateRoleId) {
child.userId = this.$store.state.user.id;
child.disabled = true;
child.label = child.label + '-' + this.$store.state.user.nickname;
}
});
},
getAllConversition() {
//
getAllConversition(this.$route.query.group).then(resp=>{
let isHasCoversition = false;
let isQuitShow = false;
if (resp.data && resp.data.length && resp.data.length > 0) {
const coversitionList = resp.data;
let memberList = [];
let messageList = [];
coversitionList.forEach(coversition=>{
//
if (!coversition.over) {
coversition.memberList.forEach(member=>{
if (member.memberId == this.$store.state.scriptRecord.updateRoleId) {
if (member.memberId == coversition.creatorId) {
isQuitShow = true;
}
isHasCoversition = true;
memberList = coversition.memberList;
messageList = coversition.messageList;
this.conversitionId = coversition.id;
this.isStartRecord = true;
}
});
}
});
this.currentMemberList = [];
memberList.forEach(memberSimple=>{
const member = this.memberData.find(member=>{ return member.id == memberSimple.memberId; });
member.connect = memberSimple.connect;
member && this.currentMemberList.push(member);
});
this.chatContentList = [];
messageList.forEach(message=>{
this.chatContentList.push(this.addContent(message));
});
}
this.isHasCoversition = isHasCoversition;
this.isQuitShow = isQuitShow;
});
}
}
};
</script>

View File

@ -4,7 +4,6 @@
:group="group" :group="group"
:is-show="isShow" :is-show="isShow"
:tree-data="treeData" :tree-data="treeData"
:offset-bottom="offsetBottom"
:conversition-id="conversitionId" :conversition-id="conversitionId"
:current-member-list="currentMemberList" :current-member-list="currentMemberList"
:chat-content-list="chatContentList" :chat-content-list="chatContentList"
@ -40,10 +39,6 @@ export default {
treeData:{ treeData:{
type: Array, type: Array,
required: true required: true
},
offsetBottom:{
type: Number,
required: true
} }
}, },
data() { data() {
@ -135,7 +130,7 @@ export default {
if (val) { if (val) {
if (val.type == 'Conversation') { if (val.type == 'Conversation') {
this.scriptTip = '请说:' + val.content; this.scriptTip = '请说:' + val.content;
} else if (val.type == 'Command') { } else if (val.type == 'Operation') {
const commandName = val.operationType; const commandName = val.operationType;
let device = val.operationType.split('_')[0]; let device = val.operationType.split('_')[0];
if (device == 'CM') { if (device == 'CM') {
@ -154,6 +149,19 @@ export default {
} }
}); });
this.scriptTip = '请创建会话,选择' + inviteMember.toString(); this.scriptTip = '请创建会话,选择' + inviteMember.toString();
} else if (val.type == 'Command') {
const targetName = this.memberData.find(member=>{ return member.id == val.commandInitiateVO.targetMemberId; });
const CommandList = {
Drive_Ahead:'确认运行至前方站',
Route_Block_Drive:'进路闭塞法行车',
Drive_Through_The_Guide_Signal:'越引导信号行驶',
Drive_Through_The_Red_Light:'越红灯行驶',
Drive_In_Urm_Mode:'URM模式驾驶',
Set_Speed_Limit:'设置限速',
Open_Or_Close_Door:'开关门',
Switch_Hook_Lock: '道岔钩锁'
};
this.$messageBox('请对【' + targetName.label + '】下达【' + CommandList[val.commandInitiateVO.commandType] + '】指令');
} }
} }
}, },

View File

@ -552,9 +552,7 @@ export default {
this.privateMessageList = []; this.privateMessageList = [];
this.quitLoading = false; this.quitLoading = false;
this.$nextTick(() => { this.$nextTick(() => {
if (this.$refs.tree) { this.$refs.tree && this.$refs.tree.filter(this.queryMember);
this.$refs.tree.filter(this.queryMember);
}
}); });
}).catch(() => { }).catch(() => {
this.$message.error('退出会话失败!'); this.$message.error('退出会话失败!');
@ -687,9 +685,7 @@ export default {
this.conversitionMemberList = this.privateMemberList; this.conversitionMemberList = this.privateMemberList;
this.messageList = [...this.privateMessageList]; this.messageList = [...this.privateMessageList];
this.$nextTick(() => { this.$nextTick(() => {
if (this.$refs.tree) { this.$refs.tree && this.$refs.tree.filter(this.queryMember);
this.$refs.tree.filter(this.queryMember);
}
}); });
}, },
clearAllData() { clearAllData() {

View File

@ -460,7 +460,6 @@ export default {
this.$refs.make.validate((valid) => { this.$refs.make.validate((valid) => {
if (valid) { if (valid) {
const model = deepAssign(this.addModel, {code:getUID(this.getIdPrefix(this.addModel.type), this.selectLists)}); const model = deepAssign(this.addModel, {code:getUID(this.getIdPrefix(this.addModel.type), this.selectLists)});
debugger;
this.$emit('updateMapModel', model); this.$emit('updateMapModel', model);
this.$refs.make.resetForm(); this.$refs.make.resetForm();
this.$refs.dataform.resetFields(); this.$refs.dataform.resetFields();

View File

@ -164,7 +164,6 @@ export default {
} }
case 'Command': { case 'Command': {
const targetName = memberList.find(elem=>{ return elem.id == element.commandInitiateVO.targetMemberId; }); const targetName = memberList.find(elem=>{ return elem.id == element.commandInitiateVO.targetMemberId; });
debugger;
const CommandList = { const CommandList = {
Drive_Ahead:'确认运行至前方站', Drive_Ahead:'确认运行至前方站',
Route_Block_Drive:'进路闭塞法行车', Route_Block_Drive:'进路闭塞法行车',