This commit is contained in:
fan 2022-09-15 17:48:07 +08:00
commit ea99a2ed09
8 changed files with 170 additions and 14 deletions

View File

@ -64,6 +64,14 @@ export function publishTraining(data) {
data
});
}
/** 查询实现草稿发布轨迹 */
export function draftPubTrace(data) {
return request({
url: `/api/v2/training/draft/pub/trace/find/page`,
method: 'post',
data
});
}
/** 更新当前用户的某个实训草稿的大字段信息 */
export function updateTrainingContent(data) {
return request({

View File

@ -10,6 +10,7 @@ export default {
modify: 'modify',
delete: 'delete',
publish: 'publish',
publishTrack: 'track',
preview: 'preview',
mapLocation: 'Save map positioning',
saveBackground: 'Save Background',

View File

@ -10,6 +10,7 @@ export default {
modify: '修改',
delete: '删除',
publish: '发布',
publishTrack: '发布轨迹',
preview: '预览',
mapLocation: '保存地图定位',
saveBackground: '保存背景',

View File

@ -7,17 +7,19 @@
<el-button size="small" @click="showList">实训列表</el-button>
</el-button-group>
</div>
<TrainingList ref="trainingList" @updateDetails="updateDetails" @gradeRules="gradeRules" @closeAllDialog="closeAllDialog" />
<TrainingList ref="trainingList" @updateDetails="updateDetails" @gradeRules="gradeRules" @closeAllDialog="closeAllDialog" @draftTracK="draftTracK" />
<EditDetails ref="editDetails" :edit-data="editData" @openEditOperate="openEditOperate" @handleCondition="handleCondition" @publish="publish" @preview="preview" @gradeRules="gradeRules" />
<EditCondition ref="editCondition" v-dialogDrag :materials-list="materialsList" @editConditionFn="editConditionFn" @backStep="backStep" />
<edit-operate ref="editOperate" v-dialogDrag @backStepList="backStepList" />
<grade-rules ref="gradeRules" />
<members-manage ref="membersManage" :is-admin="isAdmin" @addSimulationMember="addSimulationMember" /> <!-- 成员管理 -->
<add-member ref="addMember" :station-list="stationList" />
<TrackList ref="trackList" />
</div>
</template>
<script>
import TrainingList from './trainingList.vue';
import TrackList from './trackList.vue';
import EditDetails from './editDetails.vue';
import EditCondition from './editCondition.vue';
import EditOperate from './editOperate.vue';
@ -31,6 +33,7 @@ export default {
name:'DemonMenu',
components:{
TrainingList,
TrackList,
EditDetails,
EditCondition,
EditOperate,
@ -45,7 +48,7 @@ export default {
hoverBtn: false,
btnWidth: -600,
materialsList: [],
refsList: ['editDetails', 'editCondition'],
refsList: ['editDetails', 'editCondition', 'trackList'],
editData: {},
isAdmin: true
};
@ -81,7 +84,7 @@ export default {
this.$refs.editDetails.backStep();
},
handleCondition(index, row, key) {
this.$refs.editCondition.doShow(row[key], index, key);
this.$refs.editCondition.doShow(row, index, key);
},
getMaterials() {
getTrainingMaterials().then(res => {
@ -100,6 +103,9 @@ export default {
this.btnWidth = -600;
}
},
draftTracK(row) {
this.$refs.trackList.doShow(row);
},
showList() {
this.$refs.trainingList.doShow();
},

View File

@ -61,6 +61,7 @@ export default {
tabVisible: false,
dialogVisible: false,
tableData: [],
roleDeviceCode: '', // code
activeIndexPath: '',
rowIndex: 0,
conditionKey: ''
@ -106,15 +107,17 @@ export default {
}
});
Object.values(this.mapStationDirectionData).forEach(item => {
let isAuto = true;
if (item.runModel == 'S') {
isAuto = false;
if (!this.roleDeviceCode || this.roleDeviceCode == item.relativeStationCode) {
let isAuto = true;
if (item.runModel == 'S') {
isAuto = false;
}
list.push({
code: item.code,
name: `${item.name}_${item.labelEnum}(${isAuto ? '自动闭塞' : '半自动闭塞'})`,
_type: `${isAuto ? 'StationDirectionAuto' : 'StationDirectionSemi'}`
});
}
list.push({
code: item.code,
name: `${item.name}_${item.labelEnum}(${isAuto ? '自动闭塞' : '半自动闭塞'})`,
_type: `${isAuto ? 'StationDirectionAuto' : 'StationDirectionSemi'}`
});
});
this.getRouteList.forEach(item => {
list.push({
@ -256,7 +259,10 @@ export default {
this.$emit('backStep');
this.doClose();
},
doShow(data, rowIndex, conditionKey) {
doShow(row, rowIndex, conditionKey) {
const data = row[conditionKey];
const member = this.$store.state.training.memberData[row.memberId];
this.roleDeviceCode = member.deviceCode || '';
this.dialogVisible = true;
this.tabVisible = true;
this.activeIndexPath = '';

View File

@ -268,6 +268,11 @@ export default {
},
handleCondition(index, row, key) {
console.log(key, '条件', index, row);
const member = this.$store.state.training.memberData[row.memberId];
if (!member.userId) {
assignUsersPlayRoles([{ userId: this.$store.state.user.id, memberId: member.id}], this.$route.query.group).then(resp => {
}).catch(() => { this.$message.error('调整角色失败!'); });
}
this.$emit('handleCondition', index, row, key);
this.doClose();
},

View File

@ -0,0 +1,120 @@
<template>
<el-dialog v-dialogDrag title="草稿发布轨迹" :visible.sync="dialogVisible" width="1050px" :before-close="doClose" center>
<div>
<QueryListPage ref="queryListPage" :card-padding="10" :pager-config="pagerConfig" :query-form="queryForm" :query-list="queryList" />
</div>
</el-dialog>
</template>
<script>
import { draftPubTrace } from '@/api/trainingManage';
export default {
name: 'TrackList',
components:{},
props: {},
data() {
return {
dialogVisible: false,
training: {},
draftId: '',
pagerConfig: {
pageSize: 'pageSize',
pageIndex: 'pageNum'
},
queryForm: {
labelWidth: '100px',
reset: true,
show:false
},
queryList: {
height: 500,
query: this.queryFunction,
selectCheckShow: false,
indexShow: true,
columns: [
{
title: '实训草稿名称',
prop: 'draftName'
},
{
title: '草稿实训是否存在',
prop: 'draftExist',
type: 'basicText',
columnValue: (row) => { return this.covertData(row, 'draftExist'); }
},
{
title: '已发布实训名称',
prop: 'pubName'
},
{
title: '发布实训是否存在',
prop: 'pubExist',
type: 'basicText',
columnValue: (row) => { return this.covertData(row, 'pubExist'); }
},
{
title: '发布者名称',
prop: 'traceCreatorName'
},
{
title: '发布时间',
prop: 'traceTime'
}
]
}
};
},
computed: {
group() {
return this.$route.query.group;
},
mapId() {
return this.$route.query.mapId;
}
},
methods: {
queryFunction(param) {
const params = {
...param,
desc: true,
draftId: this.draftId
};
return draftPubTrace(params);
},
doShow(row) {
console.log(row);
this.draftId = row.id;
this.getListData();
this.dialogVisible = true;
},
doClose() {
this.dialogVisible = false;
},
covertData(row, key) {
let s = '否';
if (row[key] == true) {
s = '是';
}
return s;
},
getListData() {
this.$refs.queryListPage && this.$refs.queryListPage.commitQuery();
}
}
};
</script>
<style lang="scss" scoped>
/deep/ .el-dialog--center .el-dialog__body{
padding: 10px 25px 10px 25px;
}
.trainingHeader {
display: flex;
justify-content: space-between;
align-items: center;
padding: 10px 5px;
.flexNull {
flex: 1;
}
}
</style>

View File

@ -1,5 +1,5 @@
<template>
<el-dialog v-dialogDrag title="实训管理" :visible.sync="dialogVisible" width="1050px" :before-close="doClose" center>
<el-dialog v-dialogDrag title="实训管理" :visible.sync="dialogVisible" width="1250px" :before-close="doClose" center>
<div>
<div class="trainingHeader">
<div class="trainingList">实训草稿列表</div>
@ -82,7 +82,7 @@ export default {
{
type: 'button',
title: this.$t('trainingManage.operate'),
width: '420',
width: '500',
buttons: [
{
name: this.$t('trainingManage.record'),
@ -119,6 +119,12 @@ export default {
handleClick: this.gradeRules,
type: 'success',
showControl:(row) => { return row.id; }
},
{
name: this.$t('trainingManage.publishTrack'),
handleClick: this.publishTrack,
type: 'primary',
showControl:(row) => { return row.id; }
}
]
}
@ -300,6 +306,9 @@ export default {
this.$emit('gradeRules', row);
// this.$refs.gradeRules.doShow();
},
publishTrack(index, row) {
this.$emit('draftTracK', row);
},
getListData() {
this.$refs.queryListPage && this.$refs.queryListPage.commitQuery();
}