Merge branch 'dev' into test

This commit is contained in:
zyy 2019-11-01 18:09:17 +08:00
commit 645326bf6a
27 changed files with 710 additions and 704 deletions

View File

@ -119,5 +119,6 @@ export default {
theBelongsProjectCannotBeEmpty: 'The belongs project cannot be empty',
pleaseSelectTheBelongsProject: 'Please select the belongs project',
copyMapAs: 'Copy map as',
whetherToCopyData: 'Whether to copy data'
whetherToCopyData: 'Whether to copy data',
copy:'Copy'
};

View File

@ -123,5 +123,6 @@ export default {
theBelongsProjectCannotBeEmpty: '所属项目不能为空',
pleaseSelectTheBelongsProject: '请选择归属项目',
copyMapAs: '复制地图为',
whetherToCopyData: '是否复制数据'
whetherToCopyData: '是否复制数据',
copy:'复制'
};

View File

@ -49,10 +49,10 @@ import TeachDetail from '@/views/teach/detail/index';
import TeachHome from '@/views/teach/index';
import Pay from '@/views/components/pay/index';
import ExamDetail from '@/views/exam/detail/examDetail';
import ExamHome from '@/views/exam/index';
import ExamCourseDetail from '@/views/exam/detail/courseDetail';
import ExamResult from '@/views/exam/result';
import ExamDetail from '@/views/exam/detail/examDetail';
import ExamCourseDetail from '@/views/exam/detail/courseDetail';
import DemonstrationDetail from '@/views/demonstration/detail/index';
@ -428,7 +428,7 @@ export const asyncRouter = [
},
hidden: true
},
{
{ // 剧本编辑 战场图
path: '/scriptDisplay/:mode',
component: ScriptDisplay,
meta: {
@ -758,6 +758,7 @@ export const asyncRouter = [
}
},
{
// 用户管理
path: 'userManage',
component: UserControl,
meta: {
@ -765,6 +766,7 @@ export const asyncRouter = [
}
},
{
// 缓存管理
path: 'cache',
component: CacheControl,
meta: {
@ -800,6 +802,7 @@ export const asyncRouter = [
}
},
{
// 子系统生成
path: 'systemGenerate',
component: SystemGenerate,
meta: {
@ -807,6 +810,7 @@ export const asyncRouter = [
}
},
{
// 产品编辑
path: 'product',
component: MapProduct,
meta: {
@ -814,6 +818,7 @@ export const asyncRouter = [
}
},
{
// 实训录制
path: 'record',
redirect: 'record/training/0/null',
component: Trainingrecord,

View File

@ -49,53 +49,53 @@
import {reviewLessonDetail} from '@/api/designPlatform';
export default {
name: 'LessonApprovalDetail',
components: {
name: 'LessonApprovalDetail',
components: {
},
data() {
return {
loading: false,
tableData: [],
lessonName: '',
lessonRemark: '',
showDetail: false
};
},
computed: {
height() {
return this.$store.state.app.height - 260;
}
},
watch: {
},
data() {
return {
loading: false,
tableData: [],
lessonName: '',
lessonRemark: '',
showDetail: false
};
},
computed: {
height() {
return this.$store.state.app.height - 260;
}
},
watch: {
},
created() {
},
mounted() {
// this.loadInitData();
},
beforeDestroy() {
},
created() {
},
mounted() {
// this.loadInitData();
},
beforeDestroy() {
},
methods: {
show(lessonId) {
this.showDetail = true;
this.loadInitData(lessonId);
},
loadInitData(lessonId) {
this.loading =true;
reviewLessonDetail(lessonId).then(response =>{
this.tableData = response.data[0].children;
this.lessonName = response.data[0].name;
this.lessonRemark = response.data[0].remarks;
this.loading = false;
}).catch(()=>{
this.$messageBox(this.$t('approval.failedToGetCourseData'));
});
},
doClose() {
}
}
},
methods: {
show(lessonId) {
this.showDetail = true;
this.loadInitData(lessonId);
},
loadInitData(lessonId) {
this.loading = true;
reviewLessonDetail(lessonId).then(response =>{
this.tableData = response.data[0].children;
this.lessonName = response.data[0].name;
this.lessonRemark = response.data[0].remarks;
this.loading = false;
}).catch(()=>{
this.$messageBox(this.$t('approval.failedToGetCourseData'));
});
},
doClose() {
}
}
};
</script>

View File

@ -58,6 +58,7 @@ import { getDetailList } from '@/api/management/dictionary';
import { mapGetters } from 'vuex';
import { launchFullscreen } from '@/utils/screen';
import { UrlConfig } from '@/router/index';
import LangStorage from '@/utils/lang';
export default {
name: 'ExamDetailView',
@ -84,10 +85,7 @@ export default {
computed: {
...mapGetters('trainingList', [
'trainingList'
]),
height() {
return this.$store.state.app.height - 50;
}
])
},
watch: {
'$route.params.examId': function (val) {
@ -125,6 +123,36 @@ export default {
this.typeList = [];
await getDetailList('training_type').then(res => {
this.typeList = res.data;
if (LangStorage.getLang() == 'en') {
this.typeList.forEach(item => {
switch (item.code) {
case '01':
item.name = 'Control permission operation';
break;
case '02':
item.name = 'Signalling machine operation';
break;
case '03':
item.name = 'Turnout operation';
break;
case '04':
item.name = 'Section operation';
break;
case '05':
item.name = 'Platform operation';
break;
case '06':
item.name = 'Train scheduling operation';
break;
case '07':
item.name = 'Train operation';
break;
case '08':
item.name = 'Temporary speed limit operation of the whole line';
break;
}
});
}
});
},
async loadInitPage(examId) {

View File

@ -6,23 +6,10 @@
</div>
</el-card>
<el-card v-loading="loading">
<el-table
:data="tableData"
border
style="width: 100%"
>
<el-table-column
prop="name"
:label="this.$t('exam.courseName')"
/>
<el-table-column
prop="remarks"
show-overflow-tooltip
:label="this.$t('exam.courseDescription')"
/>
<el-table-column
:label="this.$t('global.operate')"
>
<el-table :data="tableData" border style="width: 100%">
<el-table-column prop="name" :label="this.$t('exam.courseName')" />
<el-table-column prop="remarks" show-overflow-tooltip :label="this.$t('exam.courseDescription')" />
<el-table-column :label="this.$t('global.operate')">
<template slot-scope="scope">
<el-button size="mini" type="primary" @click="goLesson(scope.row)">
{{ $t('exam.enterTheExam') }}

View File

@ -1,43 +1,33 @@
<template>
<div v-loading="loading">
<el-card class="paper" :style="{height: height - 10 + 'px'}">
<div slot="header" style="text-align: center;">
<span style="font-weight:bold ">{{ $t('exam.examResultsDetails') }}</span>
</div>
<el-scrollbar wrap-class="scrollbar-wrapper" :style="{height: height - 150 + 'px'}">
<div class="context">
<el-form ref="form" :model="resultModel" size="mini">
<el-form-item :label="this.$t('exam.testQuestionsName')+':'" prop="name">
<span>{{ resultModel.examName }}</span>
</el-form-item>
<el-form-item :label="this.$t('exam.testScores')+':'" prop="score">
<span>{{ resultModel.score + ' '+ $t('exam.points') }}</span>
</el-form-item>
<el-form-item :label="this.$t('exam.whetherThrough')+':'" prop="detail">
<span v-if="resultModel.result === '01'" style="color:darkgray">{{ $t('exam.didNotCalculate') }}</span>
<span v-else-if="resultModel.result === '02'" style="color:green">{{ $t('exam.pass') }}</span>
<span v-else-if="resultModel.result === '03'" style="color:red">{{ $t('exam.notPass') }}</span>
</el-form-item>
<el-form-item :label="this.$t('exam.examTime')+':'" prop="detail">
<span>{{ Math.ceil(resultModel.usedTime/60) + ' '+ $t('global.minutes') }}</span>
</el-form-item>
</el-form>
<el-table
:data="resultModel.userExamQuestionsVOs"
border
style="width: 100%"
:summary-method="getSummaries"
show-summary
>
<el-table-column prop="trainingName" :label="this.$t('exam.trainingName')" />
<el-table-column prop="score" :label="this.$t('exam.trainingScore')" />
</el-table>
</div>
</el-scrollbar>
<div style="position: relative; float: right; right: 60px; bottom: -30px;">
<el-button type="primary " @click="back">{{ $t('exam.returnToExamList') }}</el-button>
</div>
</el-card>
<div v-loading="loading" class="joylink-card paper">
<div class="card-title">
<span style="font-weight:bold ">{{ $t('exam.examResultsDetails') }}</span>
</div>
<div class="context">
<el-form ref="form" :model="resultModel" size="mini">
<el-form-item :label="this.$t('exam.testQuestionsName')+':'" prop="name">
<span>{{ resultModel.examName }}</span>
</el-form-item>
<el-form-item :label="this.$t('exam.testScores')+':'" prop="score">
<span>{{ resultModel.score + ' '+ $t('exam.points') }}</span>
</el-form-item>
<el-form-item :label="this.$t('exam.whetherThrough')+':'" prop="detail">
<span v-if="resultModel.result === '01'" style="color:darkgray">{{ $t('exam.didNotCalculate') }}</span>
<span v-else-if="resultModel.result === '02'" style="color:green">{{ $t('exam.pass') }}</span>
<span v-else-if="resultModel.result === '03'" style="color:red">{{ $t('exam.notPass') }}</span>
</el-form-item>
<el-form-item :label="this.$t('exam.examTime')+':'" prop="detail">
<span>{{ Math.ceil(resultModel.usedTime/60) + ' '+ $t('global.minutes') }}</span>
</el-form-item>
</el-form>
<el-table :data="resultModel.userExamQuestionsVOs" border style="width: 100%; min-height: 200px;" :summary-method="getSummaries" show-summary>
<el-table-column prop="trainingName" :label="this.$t('exam.trainingName')" />
<el-table-column prop="score" :label="this.$t('exam.trainingScore')" />
</el-table>
</div>
<div class="draf_box">
<el-button type="primary " @click="back">{{ $t('exam.returnToExamList') }}</el-button>
</div>
</div>
</template>
<script>
@ -124,19 +114,25 @@ export default {
};
</script>
<style rel="stylesheet/scss" lang="scss" scoped>
/deep/ {
.scrollbar-wrapper {
margin-bottom: 0 !important;
.paper {
height: 100%;
overflow: hidden;
.card-title{
height: 47px;
line-height: 47px;
border-bottom: 1px solid #e6e6e6;
text-align: center;
}
.context {
padding: 30px 60px;
height: calc(100% - 107px);
overflow: auto;
}
}
.paper {
width: 900px;
margin: 0 auto;
border: 1px solid #F8F8F8;
}
.context {
margin: 30px 60px;
.draf_box{
padding: 10px 0;
text-align: center;
}
</style>

View File

@ -22,7 +22,6 @@
</template>
<script>
// import { getPublishMapListBySkinCode } from '@/api/jmap/map';
import { adminPublishLesson, releaseOrCancel } from '@/api/designPlatform';
export default {

View File

@ -6,28 +6,30 @@
<el-step title="" icon="el-icon-upload" />
</el-steps>
<el-card class="forms">
<el-tree
ref="lessonTree"
:data="treeData"
:props="defaultProps"
draggable
:allow-drop="allowDrop"
default-expand-all
:allow-drag="allowDrag"
expand-on-click-node
highlight-current
style="margin:20px; min-height: 300px;"
@node-drag-end="handleDragEnd"
>
<span slot-scope="{ node }">
<el-tooltip class="item" effect="dark" :content="node.label" placement="top" :open-delay="1000">
<span v-if="node.data.type === 'lesson'" class="el-icon-tickets">{{ node.label }}</span>
<span v-if="node.data.type === 'chapter'" class="el-icon-document">{{ node.label }}
</span>
<span v-else> {{ node.label }}</span>
</el-tooltip>
</span>
</el-tree>
<div style="height:100%;overflow-y:auto">
<el-tree
ref="lessonTree"
:data="treeData"
:props="defaultProps"
draggable
:allow-drop="allowDrop"
default-expand-all
:allow-drag="allowDrag"
expand-on-click-node
highlight-current
style="margin:20px; min-height:300px;"
@node-drag-end="handleDragEnd"
>
<span slot-scope="{ node }">
<el-tooltip class="item" effect="dark" :content="node.label" placement="top" :open-delay="1000">
<span v-if="node.data.type === 'lesson'" class="el-icon-tickets">{{ node.label }}</span>
<span v-if="node.data.type === 'chapter'" class="el-icon-document">{{ node.label }}
</span>
<span v-else> {{ node.label }}</span>
</el-tooltip>
</span>
</el-tree>
</div>
</el-card>
<div class="draft">
<el-button type="primary" @click="goBack">{{ $t('global.back') }}</el-button>
@ -50,11 +52,6 @@ export default {
}
};
},
computed: {
height() {
return this.$store.state.app.height - 180;
}
},
methods: {
convertTreeData(list, data) {
let tree = [];
@ -143,6 +140,7 @@ export default {
.steps {
width: 980px;
margin: 0 auto;
height: 100%;
/deep/ {
.el-step__icon.is-icon {
@ -151,10 +149,15 @@ export default {
}
}
/deep/ .el-card__body{
height:100%;
}
.forms {
width: 800px;
margin: 0 auto;
margin-top: 10px;
height: calc(100% - 150px);
}
.draft {
width: 300px;

View File

@ -68,23 +68,19 @@ export default {
// planId: '',
// planName: '',
type: 'add',
// defaultShowKeys: [],
runPlanList: [],
runPlanDict: {},
isCreate:false,
PlanConvert: {}
// defaultProps: {
// label: 'name'
// }
};
},
computed: {
height() {
return this.$store.state.app.height - 60 - 30;
},
skinCode() {
return this.$route.query.skinCode || '02';
},
// skinCode() {
// return this.$route.query.skinCode || '02';
// },
hasRelease() {
return this.$store.state.user.roles.includes('04') ||
this.$store.state.user.roles.includes('05');
@ -96,6 +92,7 @@ export default {
}
},
created() {
debugger;
this.PlanConvert = this.$theme.loadPlanConvert(this.$route.query.skinCode);
},
mounted() {

View File

@ -6,14 +6,14 @@
<script>
import { getProductList, putMapProductOnLine, putMapProductOffLine } from '@/api/management/mapprd';
import { getSkinCodeList } from '@/api/management/mapskin';
import { listPublishMap } from '@/api/jmap/map';
export default {
name: 'PublishExam',
data() {
return {
prdTypeList: [],
skinCodeList: [],
mapIdList: [],
pagerConfig: {
pageSize: 'pageSize',
pageIndex: 'pageNum'
@ -42,10 +42,10 @@ export default {
prop: 'name'
},
{
title: this.$t('publish.skinType'),
prop: 'skinCode',
title: this.$t('publish.mapName'),
prop: 'mapId',
type: 'tag',
columnValue: (row) => { return this.$convertField(row.skinCode, this.skinCodeList, ['code', 'name']); },
columnValue: (row) => { return this.$convertField(row.mapId, this.mapIdList, ['id', 'name']); },
tagType: (row) => { return ''; }
},
{
@ -94,9 +94,9 @@ export default {
this.prdTypeList = list;
});
this.skinCodeList = [];
getSkinCodeList().then(response => {
this.skinCodeList = response.data;
this.mapIdList = [];
listPublishMap().then(response => {
this.mapIdList = response.data;
});
},
handlePutaway(index, row) {

View File

@ -7,7 +7,6 @@
<script>
import { publishLessonList, delPublishLesson, putLessonOnLine, putLessonOffLine, updatePublishLesson } from '@/api/jmap/lesson';
import { getSkinCodeList } from '@/api/management/mapskin';
import localStore from 'storejs';
import UpdateOperate from './draft.vue';
@ -19,7 +18,6 @@ export default {
data() {
return {
cityList: [],
skinCodeList: [],
pagerConfig: {
pageSize: 'pageSize',
pageIndex: 'pageNum'
@ -118,11 +116,6 @@ export default {
}).catch(() => {
this.$messageBox(this.$t('error.loadingCityListFailed'));
});
this.skinCodeList = [];
getSkinCodeList().then(response => {
this.skinCodeList = response.data;
});
},
//
handleEdit(index, row) {

View File

@ -122,7 +122,7 @@ export default {
handleClick: this.handleSetProject
},
{
name: '复制',
name: this.$t('publish.copy'),
handleClick: this.handleCopy
}
]

View File

@ -17,7 +17,6 @@ export default {
data() {
return {
cityList: [],
skinCodeList: [],
pagerConfig: {
pageSize: 'pageSize',
pageIndex: 'pageNum'

View File

@ -10,7 +10,7 @@
<script>
import { runPlanTemplateList } from '@/api/runplan';
import { getSkinCodeList } from '@/api/management/mapskin';
import { listPublishMap } from '@/api/jmap/map';
export default {
name: 'ChooseTemplatePlan',
@ -18,7 +18,7 @@ export default {
return {
dialogShow: false,
loading: false,
skinCodeList: [],
mapIdList: [],
model: {},
pagerConfig: {
pageSize: 'pageSize',
@ -44,11 +44,11 @@ export default {
prop: 'name'
},
{
title: this.$t('publish.skinType'),
prop: 'skinCode',
title: this.$t('publish.mapName'),
prop: 'mapId',
type: 'tag',
columnValue: (row) => {
return this.$convertField(row.skinCode, this.skinCodeList, ['code', 'name']);
return this.$convertField(row.mapId, this.mapIdList, ['id', 'name']);
},
tagType: (row) => { return 'success'; }
}
@ -65,9 +65,10 @@ export default {
},
methods: {
loadInitData() {
this.skinCodeList = [];
getSkinCodeList().then(response => {
this.skinCodeList = response.data;
this.mapIdList = [];
listPublishMap().then(response => {
this.mapIdList = response.data;
});
},
doShow(model) {
@ -80,7 +81,7 @@ export default {
this.dialogShow = false;
},
queryFunction(params) {
params['skinCode'] = this.model.skinCode || '';
params['mapId'] = this.model.mapId || '';
return runPlanTemplateList(params);
},
handleConfirm() {

View File

@ -1,14 +1,12 @@
<template>
<div class="app-wrapper">
<el-scrollbar wrap-class="scrollbar-wrapper">
<div v-show="listShow" class="examList" :style="{width: widthLeft+'px'}">
<demon-list ref="demonList" :height="height" />
</div>
<drap-left :width-left="widthLeft" @drapWidth="drapWidth" />
<transition>
<router-view />
</transition>
</el-scrollbar>
<div v-show="listShow" class="examList" :style="{width: widthLeft+'px'}">
<demon-list ref="demonList" :height="height" />
</div>
<drap-left :width-left="widthLeft" @drapWidth="drapWidth" />
<transition>
<router-view />
</transition>
</div>
</template>
@ -19,41 +17,41 @@ import drapLeft from '@/views/components/drapLeft/index';
import localStore from 'storejs';
export default {
name: 'Exam',
components: {
demonList,
drapLeft
},
data() {
return {
listShow: true,
widthLeft: 450
};
},
computed: {
...mapGetters([
'lessonbar'
]),
height() {
return this.$store.state.app.height;
}
},
watch: {
'lessonbar.opened': function (val) {
this.listShow = val;
}
},
mounted() {
this.widthLeft = Number(localStore.get('LeftWidth'));
},
methods: {
refresh() {
this.$refs && this.$refs.demonList && this.$refs.demonList.refresh();
},
drapWidth(width) {
this.widthLeft = Number(width);
}
}
name: 'Exam',
components: {
demonList,
drapLeft
},
data() {
return {
listShow: true,
widthLeft: 450
};
},
computed: {
...mapGetters([
'lessonbar'
]),
height() {
return this.$store.state.app.height;
}
},
watch: {
'lessonbar.opened': function (val) {
this.listShow = val;
}
},
mounted() {
this.widthLeft = Number(localStore.get('LeftWidth'));
},
methods: {
refresh() {
this.$refs && this.$refs.demonList && this.$refs.demonList.refresh();
},
drapWidth(width) {
this.widthLeft = Number(width);
}
}
};
</script>
<style rel="stylesheet/scss" lang="scss" scoped>

View File

@ -36,104 +36,104 @@ import { UrlConfig } from '@/router/index';
import { getSessionStorage, setSessionStorage, removeSessionStorage } from '@/utils/auth';
export default {
name: 'ExamDetailList',
components: {
FilterCity
},
props: {
height: {
type: Number,
required: true
}
},
data() {
return {
loading: true,
queryFunction: listPublishMap,
defaultShowKeys: [],
filterText: '',
treeData: [],
treeList: [],
selected: {},
defaultProps: {
children: 'children',
label: 'name'
},
node: {
},
screenList: []
};
},
watch: {
filterText(val) {
this.treeList = this.treeData.filter((res) => {
return res.name.includes(val);
});
}
},
created() {
this.getScreenLists();
},
beforeDestroy () {
removeSessionStorage('screenMonitorList');
},
methods: {
async getScreenLists() {
const list = await queryPermissionScreen();
this.screenList = list.data || [];
},
filterNode(value, data) {
if (!value) return true;
return data.name.indexOf(value) !== -1;
},
showContextMenu(e, obj, node, vueElem) {
if (obj) {
this.node = node;
this.selected = obj;
}
},
clickEvent(obj) {
setSessionStorage('screenMonitorList', obj.id);
this.$router.push({ path: `${UrlConfig.dp.detail}/${obj.id}` });
},
refresh(filterSelect) {
this.loading = true;
this.treeData = this.treeList = [];
listPublishMap().then(res => {
(res.data || []).forEach(ele => {
if (ele.cityCode == filterSelect) {
ele.valid = false;
if (this.screenList.length) {
ele.valid = true;
}
this.treeData.push(ele);
}
});
name: 'ExamDetailList',
components: {
FilterCity
},
props: {
height: {
type: Number,
required: true
}
},
data() {
return {
loading: true,
queryFunction: listPublishMap,
defaultShowKeys: [],
filterText: '',
treeData: [],
treeList: [],
selected: {},
defaultProps: {
children: 'children',
label: 'name'
},
node: {
},
screenList: []
};
},
watch: {
filterText(val) {
this.treeList = this.treeData.filter((res) => {
return res.name.includes(val);
});
}
},
created() {
this.getScreenLists();
},
beforeDestroy () {
removeSessionStorage('screenMonitorList');
},
methods: {
async getScreenLists() {
const list = await queryPermissionScreen();
this.screenList = list.data || [];
},
filterNode(value, data) {
if (!value) return true;
return data.name.indexOf(value) !== -1;
},
showContextMenu(e, obj, node, vueElem) {
if (obj) {
this.node = node;
this.selected = obj;
}
},
clickEvent(obj) {
setSessionStorage('screenMonitorList', obj.id);
this.$router.push({ path: `${UrlConfig.dp.detail}/${obj.id}` });
},
refresh(filterSelect) {
this.loading = true;
this.treeData = this.treeList = [];
listPublishMap().then(res => {
(res.data || []).forEach(ele => {
if (ele.cityCode == filterSelect) {
ele.valid = false;
if (this.screenList.length) {
ele.valid = true;
}
this.treeData.push(ele);
}
});
this.treeList = this.filterText
? this.treeData.filter((res) => {
return res.name.includes(this.filterText);
})
: this.treeData;
this.treeList = this.filterText
? this.treeData.filter((res) => {
return res.name.includes(this.filterText);
})
: this.treeData;
if (this.treeList.length == 0) {
this.$router.push({ path: `${UrlConfig.dp.prefix}/home` });
} else {
this.$nextTick(() => {
const mapId = getSessionStorage('screenMonitorList')|| (this.treeList[0] || { id: 0 }).id;
this.$router.push({ path: `${UrlConfig.dp.detail}/${mapId}` });
this.$refs.tree.setCurrentKey(mapId); // value node-key
});
}
if (this.treeList.length == 0) {
this.$router.push({ path: `${UrlConfig.dp.prefix}/home` });
} else {
this.$nextTick(() => {
const mapId = getSessionStorage('screenMonitorList') || (this.treeList[0] || { id: 0 }).id;
this.$router.push({ path: `${UrlConfig.dp.detail}/${mapId}` });
this.$refs.tree.setCurrentKey(mapId); // value node-key
});
}
this.$nextTick(() => { this.loading = false; });
}).catch(error => {
console.log(error);
this.loading = false;
this.$messageBox(this.$t('error.refreshFailed'));
});
}
}
this.$nextTick(() => { this.loading = false; });
}).catch(error => {
console.log(error);
this.loading = false;
this.$messageBox(this.$t('error.refreshFailed'));
});
}
}
};
</script>
<style>

View File

@ -1,107 +1,109 @@
<template>
<el-dialog :title="title" :visible.sync="dialogVisible" width="500px" :before-close="doClose" center>
<data-form ref="dataform" :form="form" :formModel="formModel" :rules="rules"></data-form>
<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>
<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>
</template>
<script>
import { listPublishMap } from '@/api/jmap/map'
import { getQuestById} from '@/api/quest';
import { listPublishMap } from '@/api/jmap/map';
export default {
name: 'ScriptDraft',
data() {
return {
dialogVisible: false,
mapList: [],
taskStatusList: [],
formModel: {
name: '',
mapId: '',
description:''
}
}
},
props: {
title: String,
},
computed: {
form() {
let form = {
labelWidth: '150px',
items: [
{ prop: 'name', label: this.$t('scriptRecord.scriptName'), type: 'text', required: true},
{ prop: 'mapId', label: this.$t('scriptRecord.map'), type: 'select', required: true, options: this.mapList,disabled:true},
{ prop: 'description', label: this.$t('scriptRecord.scriptDescription'), type: 'textarea', required: true},
]
}
return form
},
rules() {
let crules = {
name: [
{ required: true, message: this.$t('scriptRecord.inputScriptName'), trigger: 'blur' },
{ required: true, message: this.$t('scriptRecord.inputScriptName'), trigger: 'change' },
],
mapId: [
{ required: true, message: this.$t('scriptRecord.selectMap'), trigger: 'change' },
],
description:[
{ required: true, message: this.$t('scriptRecord.inputScriptDescription'), trigger: 'blur' },
{ required: true, message: this.$t('scriptRecord.inputScriptDescription'), trigger: 'change' },
]
}
return crules
},
},
mounted() {
this.loadInitData();
},
methods: {
loadInitData() {
this.mapList = [];
listPublishMap().then(response => {
this.mapList = response.data.map(elem => { return { value: elem.id, label: elem.name } });
})
},
doShow(questid) {
if(questid)
{
getQuestById(questid).then(resp=>{
let data={'name':resp.data.name,'description':resp.data.description,'mapId':resp.data.mapId};
this.formModel=data;
this.formModel.id=questid;
this.dialogVisible = true
});
}
else
{
this.formModel.mapId=this.$route.params.mapId;
this.dialogVisible = true
}
},
doCreate() {
let self = this
this.$refs.dataform.validateForm(() => {
self.$emit('create', Object.assign({}, this.formModel));
self.doClose()
})
},
doClose() {
this.$refs.dataform.resetForm();
this.dialogVisible = false
import { getQuestById} from '@/api/quest';
export default {
name: 'ScriptDraft',
props: {
title: {
type: String,
default() {
return '';
}
}
},
data() {
return {
dialogVisible: false,
mapList: [],
taskStatusList: [],
formModel: {
name: '',
mapId: '',
description:''
}
};
},
computed: {
form() {
const form = {
labelWidth: '150px',
items: [
{ prop: 'name', label: this.$t('scriptRecord.scriptName'), type: 'text', required: true},
{ prop: 'mapId', label: this.$t('scriptRecord.map'), type: 'select', required: true, options: this.mapList, disabled:true},
{ prop: 'description', label: this.$t('scriptRecord.scriptDescription'), type: 'textarea', required: true}
]
};
return form;
},
rules() {
const crules = {
name: [
{ required: true, message: this.$t('scriptRecord.inputScriptName'), trigger: 'blur' },
{ required: true, message: this.$t('scriptRecord.inputScriptName'), trigger: 'change' }
],
mapId: [
{ required: true, message: this.$t('scriptRecord.selectMap'), trigger: 'change' }
],
description:[
{ required: true, message: this.$t('scriptRecord.inputScriptDescription'), trigger: 'blur' },
{ required: true, message: this.$t('scriptRecord.inputScriptDescription'), trigger: 'change' }
]
};
return crules;
}
},
mounted() {
this.loadInitData();
},
methods: {
loadInitData() {
this.mapList = [];
listPublishMap().then(response => {
this.mapList = response.data.map(elem => { return { value: elem.id, label: elem.name }; });
});
},
doShow(questid) {
if (questid) {
getQuestById(questid).then(resp=>{
const data = {'name':resp.data.name, 'description':resp.data.description, 'mapId':resp.data.mapId};
this.formModel = data;
this.formModel.id = questid;
this.dialogVisible = true;
});
} else {
this.formModel.mapId = this.$route.params.mapId;
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: 25px 65px 30px 10px;
}
</style>
</style>

View File

@ -16,37 +16,35 @@ import TipScriptRecord from './tipScriptRecord';
import drapLeft from '@/views/components/drapLeft/index';
export default {
name: 'ScriptDisplay',
components: {
Display,
TipScriptRecord,
drapLeft
},
data() {
return {
widthLeft: 780,
size: {
width: document.documentElement.clientWidth - 780,
height: document.documentElement.clientHeight
},
group: this.$route.query.group
};
},
computed: {
},
watch: {
'$store.state.app.windowSizeCount': function() {
this.size = { width: this.$store.state.app.width - 780, height: this.$store.state.app.height};
},
widthLeft: function(val) {
this.size = { width: this.$store.state.app.width - val, height: this.$store.state.app.height};
}
},
methods: {
drapWidth(width) {
this.widthLeft = Number(width);
}
}
name: 'ScriptDisplay',
components: {
Display,
TipScriptRecord,
drapLeft
},
data() {
return {
widthLeft: 780,
size: {
width: document.documentElement.clientWidth - 780,
height: document.documentElement.clientHeight
},
group: this.$route.query.group
};
},
watch: {
'$store.state.app.windowSizeCount': function() {
this.size = { width: this.$store.state.app.width - 780, height: this.$store.state.app.height};
},
widthLeft: function(val) {
this.size = { width: this.$store.state.app.width - val, height: this.$store.state.app.height};
}
},
methods: {
drapWidth(width) {
this.widthLeft = Number(width);
}
}
};
</script>
<style rel="stylesheet/scss" lang="scss" scoped>

View File

@ -1,8 +1,8 @@
<template>
<div class="reminder-drag">
<div ref="drapBox" class="reminder-box" :style="{height:'100%', width: width + 'px'}">
<div ref="drapBox" class="reminder-box" :style="{width: width + 'px'}">
<el-container class="actionPane">
<el-header style="height:50px;">
<el-header style="height: 50px;">
<el-row class="actionList">
<span class="titleStyle">{{ $t('scriptRecord.scriptRecordTitle') }}</span>
<span class="titleStyle">( {{ $t('scriptRecord.language') }}: {{ $route.query.lang=="en"?$t('scriptRecord.english'):$t('scriptRecord.chinese') }} )</span>
@ -195,7 +195,7 @@ export default {
float: left;
left: 0px;
top:0px;
height:100%;
height: 100%;
background-color: #fff;
overflow: hidden;
z-index: 10;

View File

@ -1,21 +1,20 @@
<template>
<el-card :style="{height: height+'px'}">
<div class="joylink-card">
<div class="scriptHeader">
<div class="scriptList">{{ $t('scriptRecord.scriptList') }}</div>
<el-button size="small" type="primary" class="createScript" @click="handleCreate">{{ $t('scriptRecord.scriptCreate') }}</el-button>
</div>
<QueryListPage ref="queryListPage" :pager-config="pagerConfig" :query-form="queryForm" :query-list="queryList" style="width: 91%;margin-left:4%;margin-top:20px;display: inline-block;" />
<QueryListPage ref="queryListPage" :pager-config="pagerConfig" :query-form="queryForm" :query-list="queryList" style="width: 91%;margin-left:4%;margin-top:20px;" />
<script-publish ref="publishScript" :title="$t('scriptRecord.publishScript')" @reloadTable="reloadTable" @create="handleConfirmPublish" />
<create-script ref="createScript" :title="$t('scriptRecord.createScript')" @reloadTable="reloadTable" @create="handleConfirmCreate" />
<create-script ref="modifyScript" :title="$t('scriptRecord.modifyScript')" @reloadTable="reloadTable" @create="handleConfirmModify" />
</el-card>
</div>
</template>
<script>
import Cookies from 'js-cookie';
import ConstConfig from '@/scripts/ConstConfig';
import { UrlConfig } from '@/router/index';
import { mapGetters } from 'vuex';
import { admin, superAdmin} from '@/router';
import { getQuestPageList, createQuest, deleteQuest, updateQuest, publishQuest, retractQuest} from '@/api/quest';
import { launchFullscreen } from '@/utils/screen';
@ -25,7 +24,7 @@ import ScriptPublish from './publish';
export default {
name: 'ScriptDraft',
components: {
components: {
CreateScript,
ScriptPublish
},
@ -111,11 +110,6 @@ export default {
}
};
},
computed: {
height() {
return this.$store.state.app.height - 50 - 30;
}
},
watch: {
'$route' () {
this.reloadTable();
@ -275,8 +269,13 @@ export default {
</script>
<style rel="stylesheet/scss" lang="scss" scoped>
@import "src/styles/mixin.scss";
.joylink-card{
height: 100%;
overflow: auto;
}
.createScript{
display:inline-block;float:right;margin-right:20px;
float: right;
margin-right:20px;
}
.scriptHeader{
display:inline-block;margin-top:40px;width: 90%;margin-left:5%;

View File

@ -13,8 +13,12 @@
export default {
name: 'ScriptOperate',
props: {
title: String,
type:String
title: {
type: String,
default() {
return '';
}
}
},
data() {
return {

View File

@ -176,7 +176,6 @@ export default {
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);
}
});
@ -185,7 +184,9 @@ export default {
this.getDeviceCode();
this.resetDisabled();
this.initCommandActionData();
}).catch(error => {});
}).catch(error => {
this.$message(error.message);
});
},
changeRole(index) {
const role = this.orginMemberList.find(elem=>{ return elem.id == index; }).role;
@ -231,7 +232,6 @@ export default {
this.commandData.action.type = 'Command';
if (this.commandData.action.deviceCommand == 'Train_Manual_Route_Blocking_Drive') { this.commandData.action.commandParamList = [this.commandData.param.startStation, this.commandData.param.endStation]; }
const data = this.commandData.action;
const obj = this;
this.adding = true;
addScriptAction(group, data).then(response=>{
this.adding = false;
@ -256,7 +256,6 @@ export default {
const group = this.group;
this.modalData.actionVO.type = 'Conversation';
const data = this.modalData.actionVO;
const obj = this;
this.modifying = true;
if (this.operateType == 'add') {
addScriptAction(group, data).then(response=>{

View File

@ -92,12 +92,12 @@ export default {
const member = memberVOList.find(elem=>{ return elem.id == element.memberId; });
const memberName = member.name ? ' - ' + member.name:'';
const memberName = member.name ? ' - ' + member.name : '';
switch (element.type) {
case 'Conversation':
{
const target = memberVOList.find(elem=>{ return elem.id == element.targetId; });
const targetName = target.name ? ' - ' + target.name:'';
const targetName = target.name ? ' - ' + target.name : '';
this.actionInfoList.push({id: element.id, isCoversition: true, memberName: member.role + memberName, targetName: target.role + targetName, reply: element.reply, row: element, visible: true});
break;
}

View File

@ -10,76 +10,76 @@ import { DeviceMenu } from '@/scripts/ConstDic';
import { putJointTrainingUserkicked } from '@/api/chat';
export default {
name: 'TrainingOperateMenu',
components: {
PopMenu
},
props: {
point: {
type: Object,
required: true
},
clickUserId: {
type: String,
required: true
}
},
data() {
return {
menu: [],
menuShow: [
{
label: this.$t('trainRoom.kickOutTheRoom'),
handler: this.kicked
}
],
userId: ''
};
},
watch: {
'$store.state.menuOperation.menuCount': function (val) {
if (this.$store.getters['menuOperation/checkDialogIsOpen'](DeviceMenu.JointRoom)) {
this.doShow(this.$store.state.menuOperation.menuPosition);
} else {
this.doClose();
}
}
},
mounted() {
this.userId = this.$store.state.user.id;
this.closeEvent();
},
methods: {
closeEvent() {
const self = this;
window.onclick = function (e) {
self.doClose();
};
},
doShow(point) {
this.closeEvent();
if (this.userId != this.clickUserId) {
this.menu = this.menuShow;
if (this.$refs && this.$refs.popMenu) {
this.$refs.popMenu.resetShowPosition(point);
}
} else {
this.menu = [];
}
name: 'TrainingOperateMenu',
components: {
PopMenu
},
props: {
point: {
type: Object,
required: true
},
clickUserId: {
type: String,
required: true
}
},
data() {
return {
menu: [],
menuShow: [
{
label: this.$t('trainRoom.kickOutTheRoom'),
handler: this.kicked
}
],
userId: ''
};
},
watch: {
'$store.state.menuOperation.menuCount': function (val) {
if (this.$store.getters['menuOperation/checkDialogIsOpen'](DeviceMenu.JointRoom)) {
this.doShow(this.$store.state.menuOperation.menuPosition);
} else {
this.doClose();
}
}
},
mounted() {
this.userId = this.$store.state.user.id;
this.closeEvent();
},
methods: {
closeEvent() {
const self = this;
window.onclick = function (e) {
self.doClose();
};
},
doShow(point) {
this.closeEvent();
if (this.userId != this.clickUserId) {
this.menu = this.menuShow;
if (this.$refs && this.$refs.popMenu) {
this.$refs.popMenu.resetShowPosition(point);
}
} else {
this.menu = [];
}
},
doClose() {
if (this.$refs && this.$refs.popMenu) {
this.$refs.popMenu.close();
}
},
async kicked() {
try {
await putJointTrainingUserkicked(this.clickUserId, this.$route.query.group);
} catch (error) {
console.error(error);
}
}
}
},
doClose() {
if (this.$refs && this.$refs.popMenu) {
this.$refs.popMenu.close();
}
},
async kicked() {
try {
await putJointTrainingUserkicked(this.clickUserId, this.$route.query.group);
} catch (error) {
console.error(error);
}
}
}
};
</script>

View File

@ -35,12 +35,9 @@
id="dope"
v-model="text"
style="width: 99%;height: 47px; border: none;outline: none;"
name=""
rows=""
cols=""
@keyup="changeText"
/>
<button class="sendBtn" @click="sendText()" :disabled="disabled">{{$t('trainRoom.sendText')}}</button>
<button class="sendBtn" :disabled="disabled" @click="sendText()">{{ $t('trainRoom.sendText') }}</button>
<div
class="sendBtn yuyin_start zIndex1"
:style="{background: background}"
@ -48,7 +45,7 @@
@mouseup="stopRecording()"
>{{ speak }}</div>
<div v-show="sending" class="sendBtn yuyin_start zIndex2" :style="{background: background}">
{{$t('trainRoom.sending')}}</div>
{{ $t('trainRoom.sending') }}</div>
</div>
</div>
</div>
@ -59,168 +56,168 @@ import HZRecorder from '@/utils/HZRecorder';
import { getHistoryVoice, chatWithText, chatWithAudio } from '@/api/chat';
export default {
name: 'TrainChat',
props: {
groupRoom: {
type: String,
required: true
}
},
data() {
return {
textList: [],
topic: '/user/topic/chatroom',
text: '',
recorders: null,
stomp: null,
speak: this.$t('trainRoom.holdAndTalk'),
sending: false,
background: '',
userId: '',
disabled:true,
};
},
watch: {
'$store.state.socket.chatContentList': function (val) { //
if (val.chatInfo) {
this.handelTextList(val);
}
}
},
async mounted() {
this.userId = this.$store.state.user.id;
// this.getHistory(); //
},
methods: {
//
async sendText() {
if (!this.text.trim()) {
// alert(this.$t('trainRoom.contentIsEmptyAndCannotBeSent'));
// this.text = '';
} else {
try {
await chatWithText(this.text, this.groupRoom);
this.text = '';
this.disabled=true;
} catch (error) {
console.error(error);
}
}
name: 'TrainChat',
props: {
groupRoom: {
type: String,
required: true
}
},
changeText(){
if (!this.text.trim()){
this.disabled=true;
}else{
this.disabled=false;
}
data() {
return {
textList: [],
topic: '/user/topic/chatroom',
text: '',
recorders: null,
stomp: null,
speak: this.$t('trainRoom.holdAndTalk'),
sending: false,
background: '',
userId: '',
disabled:true
};
},
//
startRecording() {
this.background = '#ccc';
this.speak = this.$t('trainRoom.recording');
this.sending = false;
HZRecorder.init.get(rec => {
if (typeof rec == 'object') {
this.recorders = rec;
this.recorders.start();
}
});
},
//
async stopRecording() {
this.background = '';
this.speak = this.$t('trainRoom.holdAndTalk');
this.sending = true;
if (this.recorders) {
this.recorders.stop();
var fd = new FormData();
fd.append('file', this.recorders.getBlob());
await chatWithAudio(fd, this.$route.query.group).catch(error => {
this.sending = false;
const message = JSON.parse(error.message);
if (message.err_no == 3301) {
this.$message({
showClose: true,
message: this.$t('error.problemWithAudioQuality'),
type: 'error'
});
} else if (message.err_no == 3308) {
this.$message({
showClose: true,
message: this.$t('error.audioIsTooLong'),
type: 'error'
});
} else if (message.err_no == 3314) {
this.$message({
showClose: true,
message: this.$t('error.audioIsTooShort'),
type: 'error'
});
} else {
this.$message({
showClose: true,
message: this.$t('error.networkProblem'),
type: 'error'
});
}
});
this.recorders = null;
} else {
this.sending = false;
this.$message({
showClose: true,
message: this.$t('error.audioIsTooShort'),
type: 'error'
});
}
},
playAudio(nor) {
this.$refs.audio.src = nor.src;
this.$refs.audio.play();
},
//
async getHistory(obj, node, data) {
this.textList = [];
try {
const res = await getHistoryVoice(this.code);
res.data.forEach(item => {
let isSelf = false;
if (item.userId == this.userId) {
isSelf = true;
}
const param = {
join: false,
value: item.message,
self: isSelf,
voice: item.isAudio,
src: item.isAudio ? `${process.env.VOICE_API}/jlcloud/audio/${item.audioPath}` : '',
other: !isSelf,
userName: item.nickName,
chatTime: item.chatTime
};
this.handelTextList(param);
});
} catch (error) {
console.error(error);
}
},
// list
handelTextList(params) {
if (!params.inSimulation) {
this.textList.push(params);
this.textList.sort((a, b) => {
return a.date - b.date;
});
}
this.sending = false;
this.$store.dispatch('socket/setChatContentList', {});
this.$nextTick(() => {
if (this.$refs.content) {
this.$refs.content.scrollTop = this.$refs.content.scrollHeight;
}
});
}
}
watch: {
'$store.state.socket.chatContentList': function (val) { //
if (val.chatInfo) {
this.handelTextList(val);
}
}
},
async mounted() {
this.userId = this.$store.state.user.id;
// this.getHistory(); //
},
methods: {
//
async sendText() {
if (!this.text.trim()) {
// alert(this.$t('trainRoom.contentIsEmptyAndCannotBeSent'));
// this.text = '';
} else {
try {
await chatWithText(this.text, this.groupRoom);
this.text = '';
this.disabled = true;
} catch (error) {
console.error(error);
}
}
},
changeText() {
if (!this.text.trim()) {
this.disabled = true;
} else {
this.disabled = false;
}
},
//
startRecording() {
this.background = '#ccc';
this.speak = this.$t('trainRoom.recording');
this.sending = false;
HZRecorder.init.get(rec => {
if (typeof rec == 'object') {
this.recorders = rec;
this.recorders.start();
}
});
},
//
async stopRecording() {
this.background = '';
this.speak = this.$t('trainRoom.holdAndTalk');
this.sending = true;
if (this.recorders) {
this.recorders.stop();
var fd = new FormData();
fd.append('file', this.recorders.getBlob());
await chatWithAudio(fd, this.$route.query.group).catch(error => {
this.sending = false;
const message = JSON.parse(error.message);
if (message.err_no == 3301) {
this.$message({
showClose: true,
message: this.$t('error.problemWithAudioQuality'),
type: 'error'
});
} else if (message.err_no == 3308) {
this.$message({
showClose: true,
message: this.$t('error.audioIsTooLong'),
type: 'error'
});
} else if (message.err_no == 3314) {
this.$message({
showClose: true,
message: this.$t('error.audioIsTooShort'),
type: 'error'
});
} else {
this.$message({
showClose: true,
message: this.$t('error.networkProblem'),
type: 'error'
});
}
});
this.recorders = null;
} else {
this.sending = false;
this.$message({
showClose: true,
message: this.$t('error.audioIsTooShort'),
type: 'error'
});
}
},
playAudio(nor) {
this.$refs.audio.src = nor.src;
this.$refs.audio.play();
},
//
async getHistory(obj, node, data) {
this.textList = [];
try {
const res = await getHistoryVoice(this.code);
res.data.forEach(item => {
let isSelf = false;
if (item.userId == this.userId) {
isSelf = true;
}
const param = {
join: false,
value: item.message,
self: isSelf,
voice: item.isAudio,
src: item.isAudio ? `${process.env.VOICE_API}/jlcloud/audio/${item.audioPath}` : '',
other: !isSelf,
userName: item.nickName,
chatTime: item.chatTime
};
this.handelTextList(param);
});
} catch (error) {
console.error(error);
}
},
// list
handelTextList(params) {
if (!params.inSimulation) {
this.textList.push(params);
this.textList.sort((a, b) => {
return a.date - b.date;
});
}
this.sending = false;
this.$store.dispatch('socket/setChatContentList', {});
this.$nextTick(() => {
if (this.$refs.content) {
this.$refs.content.scrollTop = this.$refs.content.scrollHeight;
}
});
}
}
};
</script>

View File

@ -34,7 +34,6 @@
</el-tree>
</div>
</div>
</div>
</template>
<script>