Merge remote-tracking branch 'remotes/origin/test'

This commit is contained in:
joylink_cuiweidong 2020-12-03 13:53:51 +08:00
commit 2dd277e633
4 changed files with 109 additions and 131 deletions

View File

@ -33,17 +33,27 @@ class Handler {
}
afterValid(operation, valid) {
const basicInfo = store.getters['training/basicInfo'];
if (basicInfo.id && valid) {
const group = router.currentRoute.query.group;
sendTrainingNextStepNew({ trainingId: basicInfo.id, operation: operation }, group);
}
if (!valid) {
this.pop();
} else if (operation.cancel === true) {
this.clear();
}
return new Promise((resolve, reject) => {
const basicInfo = store.getters['training/basicInfo'];
if (basicInfo.id && valid) {
const group = router.currentRoute.query.group;
sendTrainingNextStepNew({ trainingId: basicInfo.id, operation: operation }, group).then(res=>{
if (!valid) {
this.pop();
} else if (operation.cancel === true) {
this.clear();
}
resolve();
}).catch(error => {
if (!valid) {
this.pop();
} else if (operation.cancel === true) {
this.clear();
}
reject(error);
});
}
});
}
getWholeParam() {
@ -94,24 +104,25 @@ class Handler {
this.storeOperation(operation);
const rtn = { valid: false, response: null };
const valid = ValidateHandler.vaildate(this.getTrainingMode(), operation);
this.afterValid(operation, valid);
rtn.valid = valid;
if (operation.cmdType && valid) {
const command = this.getCommand(operation);
if (command) {
CommandHandler.execute(command.id, command.get()).then(response => {
rtn.response = response;
resolve(rtn);
}).catch(error => {
reject(error);
});
this.afterValid(operation, valid).then(()=>{
rtn.valid = valid;
if (operation.cmdType && valid) {
const command = this.getCommand(operation);
if (command) {
CommandHandler.execute(command.id, command.get()).then(response => {
rtn.response = response;
resolve(rtn);
}).catch(error => {
reject(error);
});
} else {
rtn.response = '获取指令失败,暂无指令或参数传值不正确,请检查指令字典';
reject(rtn);
}
} else {
rtn.response = '获取指令失败,暂无指令或参数传值不正确,请检查指令字典';
reject(rtn);
resolve(rtn);
}
} else {
resolve(rtn);
}
});
});
}

View File

@ -1,19 +1,21 @@
<template>
<div v-loading="loading" class="joylink-card map-list-main">
<div class="clearfix">
<span>{{ $t('map.publishedMapList') }}</span>
<div>
<div class="mapListName">
<span>{{ $t('map.publishedMapList') }}</span>
</div>
<template v-if="!getMapByCode">
<filter-city ref="filerCity" filter-empty :local-param-name="localParamName" @filterSelectChange="refresh" />
<el-input v-model="filterText" :placeholder="this.$t('global.filteringKeywords')" clearable />
</template>
</div>
<div class="text_item">
<filter-city v-if="!getMapByCode" ref="filerCity" filter-empty :local-param-name="localParamName" @filterSelectChange="refresh" />
<el-input v-if="!getMapByCode" v-model="filterText" :placeholder="this.$t('global.filteringKeywords')" clearable />
<div class="tree_mian_box">
<el-tree ref="tree" class="tree_box" :data="treeList" :default-expanded-keys="defaultShowKeys" node-key="id" :props="defaultProps" highlight-current :span="22" :filter-node-method="filterNode" @node-click="clickEvent">
<span slot-scope="{ node:tnode, data }">
<span class="el-icon-tickets" :style="{color: data.valid ? 'green':''}" />
<span>&nbsp;{{ tnode.label }}</span>
</span>
</el-tree>
</div>
<el-tree ref="tree" :data="treeList" :default-expanded-keys="defaultShowKeys" node-key="id" :props="defaultProps" highlight-current :span="22" :filter-node-method="filterNode" @node-click="clickEvent">
<span slot-scope="{ node:tnode, data }">
<span class="el-icon-tickets" :style="{color: data.valid ? 'green':''}" />
<span>&nbsp;{{ tnode.label }}</span>
</span>
</el-tree>
</div>
</div>
</template>
@ -231,45 +233,28 @@ export default {
};
</script>
<style rel="stylesheet/scss" lang="scss" scoped>
.back-home {
float: right;
cursor: pointer;
&:hover {
color: #3ea726;
}
}
.text_item{
height: 100%;
padding-top: 47px;
.tree_mian_box{
height: calc(100% - 76px);
}
width: 100%;
flex: 1;
overflow: auto;
padding-bottom: 10px;
padding-top: 5px;
}
.map-list-main{
text-align:left;
height: 100%;
position: relative;
height: 100%;
display:flex;
flex-direction:column;
}
.mapListName{
padding: 15px 0px 15px 20px;
border-bottom: 1px solid #EBEEF5;
}
.clearfix{
padding: 0 20px;
border-bottom: 1px solid #EBEEF5;
box-sizing: border-box;
height: 47px;
line-height: 47px;
position: absolute;
width:100%;
}
.tree_box{
height: 100%;
}
</style>
<style>
.el-tree {
overflow-x: hidden;
}
.el-tree-node.is-current>.el-tree-node__content {
background-color: #e4e3e3 !important;
}

View File

@ -1,37 +1,39 @@
<template>
<div v-loading="loading" class="joylink-card map-list-main">
<div class="clearfix">
<span>{{ $t('global.mapList') }}</span>
<div>
<div class="mapListName">
<span>{{ $t('global.mapList') }}</span>
</div>
<template v-if="!IsProject">
<filter-city ref="filerCity" filter-empty local-param-name="training_cityCode" @filterSelectChange="refresh" />
<el-input v-model="filterText" :placeholder="this.$t('global.filteringKeywords')" clearable />
</template>
</div>
<div class="left-map-list">
<filter-city v-if="!getMapByCode" ref="filerCity" filter-empty local-param-name="training_cityCode" @filterSelectChange="refresh" />
<el-input v-if="!getMapByCode" v-model="filterText" :placeholder="this.$t('global.filteringKeywords')" clearable />
<div style="height: calc(100% - 76px); overflow: auto;">
<el-tree
ref="tree"
:data="treeList"
node-key="key"
:props="{children: 'children',label: 'name'}"
highlight-current
:span="22"
:filter-node-method="filterNode"
:default-expanded-keys="expandList"
@node-click="clickEvent"
@node-expand="nodeExpand"
@node-collapse="nodeCollapse"
>
<span slot-scope="{ node }">
<span
class="el-icon-tickets"
/>
<span v-if="node.data.id ==='Simulation'">&nbsp;{{ node.data.name+ $t('global.simulationSystem') }}</span>
<span v-else-if="node.data.id ==='Lesson'">&nbsp;{{ node.data.name+ $t('global.lessonSystem') }}</span>
<span v-else-if="node.data.id ==='Exam'">&nbsp;{{ node.data.name+ $t('global.examSystem') }}</span>
<span v-else-if="node.data.id ==='Plan'">&nbsp;{{ node.data.name+ $t('global.runPlanSystem') }}</span>
<span v-else>&nbsp;{{ node.data.name }}</span>
</span>
</el-tree>
</div>
<el-tree
ref="tree"
:data="treeList"
node-key="key"
:props="{children: 'children',label: 'name'}"
highlight-current
:span="22"
:filter-node-method="filterNode"
:default-expanded-keys="expandList"
@node-click="clickEvent"
@node-expand="nodeExpand"
@node-collapse="nodeCollapse"
>
<span slot-scope="{ node }">
<span
class="el-icon-tickets"
/>
<span v-if="node.data.id ==='Simulation'">&nbsp;{{ node.data.name+ $t('global.simulationSystem') }}</span>
<span v-else-if="node.data.id ==='Lesson'">&nbsp;{{ node.data.name+ $t('global.lessonSystem') }}</span>
<span v-else-if="node.data.id ==='Exam'">&nbsp;{{ node.data.name+ $t('global.examSystem') }}</span>
<span v-else-if="node.data.id ==='Plan'">&nbsp;{{ node.data.name+ $t('global.runPlanSystem') }}</span>
<span v-else>&nbsp;{{ node.data.name }}</span>
</span>
</el-tree>
</div>
</div>
</template>
@ -65,9 +67,9 @@ export default {
project() {
return getSessionStorage('project');
},
getMapByCode() {
const project = getSessionStorage('project');
return GetMapListByProjectList.includes(project);
IsProject() {
// code
return GetMapListByProjectList.includes(this.project);
}
},
watch: {
@ -76,7 +78,7 @@ export default {
}
},
mounted() {
if (this.getMapByCode) {
if (this.IsProject) {
this.refresh();
}
},
@ -148,7 +150,7 @@ export default {
this.filterSelect = filterSelect;
try {
let res = {};
if (this.getMapByCode) {
if (this.IsProject) {
res = await getSubSystemByProjectCode();
} else {
res = await getTrainingSystemList(filterSelect);
@ -210,37 +212,26 @@ export default {
};
</script>
<style rel="stylesheet/scss" lang="scss" scoped>
.clearfix{
width:100%;
height: 47px;
line-height: 47px;
padding-left: 17px;
position:absolute;
}
.back-home {
float: right;
cursor: pointer;
&:hover {
color: #3ea726;
}
.mapListName{
padding: 15px 0px 15px 17px;
}
.left-map-list{
width: 100%;
height: 100%;
padding-top: 47px;
flex: 1;
overflow: auto;
padding-bottom: 10px;
padding-top: 5px;
}
.map-list-main{
text-align:left;
height: 100%;
position: relative;
display:flex;
flex-direction:column;
}
</style>
<style>
.el-tree {
overflow-x: hidden;
}
.el-tree-node.is-current>.el-tree-node__content {
background-color: #e4e3e3 !important;
}

View File

@ -61,23 +61,14 @@ export default {
</script>
<style rel="stylesheet/scss" lang="scss" scoped>
@import "src/styles/mixin.scss";
.app-wrapper {
@include clearfix;
position: relative;
height: 100%;
width: 100%;
overflow: hidden;
}
.examList {
height: 100%;
float: left;
}
/deep/ .scrollbar-wrapper{
overflow-x: hidden;
}
/deep/ .el-scrollbar__bar.is-horizontal {
display: none;
}
</style>