实训调整
This commit is contained in:
parent
2589141b4b
commit
1b7ecb0aad
@ -27,7 +27,7 @@ export function handlerUrl() {
|
||||
// BASE_API = 'https://joylink.club/jlcloud';
|
||||
// BASE_API = 'https://test.joylink.club/jlcloud';
|
||||
// BASE_API = 'http://114.116.51.125/jlcloud';
|
||||
BASE_API = 'http://192.168.3.90:9000'; // 周寅
|
||||
// BASE_API = 'http://192.168.3.90:9000'; // 周寅
|
||||
// BASE_API = 'http://192.168.3.94:9000'; // 旭强
|
||||
// BASE_API = 'http://192.168.3.15:9000'; // 张赛
|
||||
// BASE_API = 'http://192.168.3.5:9000'; // 夏增彬
|
||||
|
@ -229,6 +229,7 @@ export default {
|
||||
this.picture = val;
|
||||
if (this.picture === 'dispatchWork' && this.lineCode === '14') {
|
||||
this.picture = 'basidi';
|
||||
this.$store.dispatch('app/animationsClose');
|
||||
}
|
||||
this.$store.dispatch('map/setPicture', this.picture);
|
||||
if (val === 'ibp') {
|
||||
@ -268,11 +269,7 @@ export default {
|
||||
// 设置地图加载状态
|
||||
mapViewLoaded(loading) {
|
||||
this.loading = loading;
|
||||
if (loading) {
|
||||
this.$store.dispatch('app/animationsClose');
|
||||
} else {
|
||||
this.$store.dispatch('app/animationsClose');
|
||||
}
|
||||
this.$store.dispatch('app/animationsClose');
|
||||
}
|
||||
}
|
||||
};
|
||||
|
@ -195,14 +195,12 @@ export default {
|
||||
},
|
||||
watch: {
|
||||
'$store.state.training.roles': function (val) {
|
||||
console.log('watch', val);
|
||||
this.initTerminalList();
|
||||
const trainingDetail = this.$store.state.trainingNew.trainingDetail;
|
||||
if (this.isFirst && this.$route.query.client) {
|
||||
this.isFirst = false;
|
||||
} else {
|
||||
if (trainingDetail && trainingDetail.client) {
|
||||
console.log(trainingDetail.client, '-----------ee-');
|
||||
this.changePictureShow(trainingDetail.client);
|
||||
} else {
|
||||
this.initPictureShow();
|
||||
@ -230,18 +228,14 @@ export default {
|
||||
});
|
||||
},
|
||||
noEvent(code) {
|
||||
console.log(code, 'noEvent');
|
||||
this.$emit('pictureChange', code);
|
||||
},
|
||||
initPictureShow() {
|
||||
console.log(this.roles, '-----------');
|
||||
const localWorkRoleList = ['STATION_SUPERVISOR', 'STATION_ASSISTANT', 'STATION_MASTER', 'STATION_SIGNALER', 'STATION_PASSENGER', 'STATION_SWITCH_MAN',
|
||||
'STATION_FACILITATOR', 'STATION_WORKER', 'DEVICE_MANAGER', 'TRAIN_MASTER', 'DEPOT_DISPATCHER'];
|
||||
if (localWorkRoleList.includes(this.roles)) {
|
||||
console.log('00000000000000');
|
||||
this.changePictureShow('localWork');
|
||||
} else if (this.roles === 'DISPATCHER') {
|
||||
console.log('00000001111');
|
||||
this.changePictureShow('dispatchWork');
|
||||
} else if (this.roles === 'MAINTAINER') {
|
||||
// 通号
|
||||
@ -251,7 +245,6 @@ export default {
|
||||
}
|
||||
},
|
||||
changePictureShow(code) {
|
||||
console.log(code, '111111');
|
||||
this.$emit('loadingChange');
|
||||
setTimeout(() => {
|
||||
this.$emit('pictureChange', code);
|
||||
|
@ -7,7 +7,13 @@
|
||||
<el-button size="small" type="text" @click="doClose">返回</el-button>
|
||||
</div>
|
||||
<data-form ref="dataform" :form="form" :form-model="formModel" :rules="rules" />
|
||||
<el-form ref="form" :model="tagForm" label-width="60px">
|
||||
<el-form ref="form" :model="tagForm" size="small" label-width="90px" :rules="formRules">
|
||||
<el-form-item v-if="formModel.type === 'SINGLE'" label="客户端" prop="client">
|
||||
<el-select v-model="tagForm.client" placeholder="请选择客户端">
|
||||
<el-option label="行调客户端" value="dispatchWork" />
|
||||
<el-option label="现地客户端" value="localWork" />
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item label="标签">
|
||||
<el-tag
|
||||
v-for="tag in tagForm.dynamicTags"
|
||||
@ -53,6 +59,7 @@ export default {
|
||||
inputVisible: false,
|
||||
inputValue: '',
|
||||
tagForm: {
|
||||
client: '',
|
||||
dynamicTags: []
|
||||
}
|
||||
};
|
||||
@ -67,7 +74,7 @@ export default {
|
||||
},
|
||||
form() {
|
||||
const form = {
|
||||
labelWidth: '60px',
|
||||
labelWidth: '90px',
|
||||
items: [
|
||||
{ prop: 'name', label: '名称', type: 'text' },
|
||||
{ prop: 'description', label: '描述', type: 'textarea' },
|
||||
@ -89,6 +96,11 @@ export default {
|
||||
]
|
||||
};
|
||||
return crules;
|
||||
},
|
||||
formRules() {
|
||||
return {
|
||||
client: [{ required: true, message: '请选择客户端', trigger: 'blur' }]
|
||||
};
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
@ -133,6 +145,7 @@ export default {
|
||||
this.formModel[key] = data[key];
|
||||
});
|
||||
this.tagForm.dynamicTags = data.labelJson ? JSON.parse(data.labelJson) : [];
|
||||
this.tagForm.client = data.client;
|
||||
} else {
|
||||
this.isCreate = true;
|
||||
this.formModel = {
|
||||
@ -148,7 +161,9 @@ export default {
|
||||
doCreate() {
|
||||
this.$refs.dataform.validateForm(() => {
|
||||
const cpData = Object.assign({}, this.formModel);
|
||||
cpData.client = this.tagForm.client;
|
||||
cpData.labelJson = JSON.stringify(this.tagForm.dynamicTags);
|
||||
console.log(cpData, '----------');
|
||||
let api = updateTraining;
|
||||
let mes = '编辑';
|
||||
if (this.isCreate) {
|
||||
|
@ -84,6 +84,7 @@
|
||||
<el-option
|
||||
v-for="item in roleList"
|
||||
:key="item.id"
|
||||
:disabled="computedRoleDisabled(item)"
|
||||
:label="item.label"
|
||||
:value="item.id"
|
||||
/>
|
||||
@ -112,7 +113,7 @@
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import { updateTrainingStep, getTrainingAll, updateTrainingBackgroud, getTrainingStepList, updateTrainingMaplocation, clearDesignTraining, updateTraining} from '@/api/trainingManage';
|
||||
import { updateTrainingStep, getTrainingAll, updateTrainingBackgroud, getTrainingStepList, updateTrainingMaplocation, clearDesignTraining} from '@/api/trainingManage';
|
||||
import { assignUsersPlayRoles } from '@/api/jointSimulation';
|
||||
import Vue from 'vue';
|
||||
import {covertMemberData} from '@/views/newMap/displayNew/utils';
|
||||
@ -190,6 +191,13 @@ export default {
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
computedRoleDisabled(role) {
|
||||
if (!this.editData.client) {
|
||||
return false;
|
||||
} else {
|
||||
return (this.editData.client === 'dispatchWork' && role.type !== '行调') || (this.editData.client === 'localWork' && role.type !== '行值');
|
||||
}
|
||||
},
|
||||
getRoleList() {
|
||||
const memberData = this.$store.state.training.memberData;
|
||||
let activeTrainList = [];
|
||||
@ -304,10 +312,6 @@ export default {
|
||||
minisize() {
|
||||
this.dialogVisible = !this.dialogVisible;
|
||||
},
|
||||
backStep() {
|
||||
this.dialogVisible = true;
|
||||
this.activeName = 'stepList';
|
||||
},
|
||||
doShow(data) {
|
||||
this.dialogVisible = true;
|
||||
},
|
||||
@ -321,16 +325,6 @@ export default {
|
||||
delete obj.isEdit;
|
||||
list.push(obj);
|
||||
});
|
||||
const trainingData = {
|
||||
id: this.editData.id,
|
||||
name: this.editData.name,
|
||||
mapId: this.editData.mapId,
|
||||
description: this.editData.description,
|
||||
labelJson: this.editData.label,
|
||||
type: this.editData.type,
|
||||
client: this.editData.type === 'SINGLE' ? this.$store.state.map.picture : ''
|
||||
};
|
||||
await updateTraining(trainingData);
|
||||
await updateTrainingStep(this.group, this.editData.id, list);
|
||||
this.$message.success('保存实训成功!');
|
||||
} catch {
|
||||
|
Loading…
Reference in New Issue
Block a user