Merge remote-tracking branch 'origin/test'
This commit is contained in:
commit
42779dc952
@ -515,10 +515,10 @@ export function getStandListByRunLineOrTrainCode(group, params) {
|
||||
params
|
||||
});
|
||||
}
|
||||
/** 上饶列车控制 */
|
||||
export function srTrainControl(group, params) {
|
||||
/** 沙盘列车控制 */
|
||||
export function sandTableTrainControl(group, params) {
|
||||
return request({
|
||||
url: `/api/sr/${group}/control`,
|
||||
url: `/api/sandTable/${group}/control`,
|
||||
method: 'put',
|
||||
params
|
||||
});
|
||||
|
@ -441,7 +441,8 @@ class SkinCode extends defaultStyle {
|
||||
monolockLocationColor: '#ea282c', // 道岔单锁'定位'颜色
|
||||
monolockInversionColor: '#ea282c', // 道岔单锁'反位'颜色
|
||||
block: true, // 封锁名称
|
||||
faultFlashing: true // 故障闪烁
|
||||
faultFlashing: true, // 故障闪烁
|
||||
lossRect: true // 道岔失表矩形
|
||||
},
|
||||
sectionAction: {
|
||||
flag: false, // 道岔 关联区段显示
|
||||
|
@ -474,12 +474,6 @@ export default class Switch extends Group {
|
||||
this.specialCircle && this.specialCircle.animate();
|
||||
}
|
||||
|
||||
this.lossShow && this.lossShow.show(); // 西安线路专有
|
||||
this.lossShow && this.lossShow.animateStyle(true)
|
||||
.when(0, { stroke: this.style.backgroundColor })
|
||||
.when(500, { stroke: '#F00' })
|
||||
.when(1000, { stroke: this.style.backgroundColor })
|
||||
.start();
|
||||
if (this.style.Switch.jointImg.loseNameFlash) {
|
||||
this.name.getNameText().animateStyle(true)
|
||||
.when(0, { textFill: this.style.backgroundColor })
|
||||
@ -509,6 +503,14 @@ export default class Switch extends Group {
|
||||
}
|
||||
}
|
||||
}
|
||||
if (pos === 'NO' && fault && faultList.includes(fault)) {
|
||||
this.lossShow && this.lossShow.show(); // 西安线路专有
|
||||
this.lossShow && this.lossShow.animateStyle(true)
|
||||
.when(0, { stroke: this.style.backgroundColor })
|
||||
.when(500, { stroke: '#F00' })
|
||||
.when(1000, { stroke: this.style.backgroundColor })
|
||||
.start();
|
||||
}
|
||||
// stopAnimation
|
||||
this.shapeModelB.stopAnimation(false);
|
||||
this.shapeModelC.stopAnimation(false);
|
||||
@ -834,7 +836,6 @@ export default class Switch extends Group {
|
||||
// N-定位 R-反位 NO-无(失表) EX-挤叉
|
||||
|
||||
// model.pos = 'EX';
|
||||
|
||||
if (model.pos == 'N') {
|
||||
this.switchPosition = 'normal';
|
||||
this.setLocationAction(model); /** 定位*/
|
||||
|
@ -25,13 +25,13 @@
|
||||
</el-row>
|
||||
<el-row style="margin-top: 40px">
|
||||
<el-col :span="3" :offset="7" style="text-align: right;">
|
||||
<el-button :type="right?'':'primary'" size="mini" icon="el-icon-arrow-left" @click="adjustDirection('left')" />
|
||||
<el-button :disabled="!showRight" type="primary" size="mini" icon="el-icon-arrow-left" @click="adjustDirection" />
|
||||
</el-col>
|
||||
<el-col :span="3" style="text-align: center;">
|
||||
<img style="width: 50px" :src="right? rightTrainPic:leftTrainPic">
|
||||
<img style="width: 50px" :src="trainPic">
|
||||
</el-col>
|
||||
<el-col :span="3">
|
||||
<el-button :type="right?'primary':''" size="mini" icon="el-icon-arrow-right" @click="adjustDirection('right')" />
|
||||
<el-button :disabled="showRight" type="primary" size="mini" icon="el-icon-arrow-right" @click="adjustDirection" />
|
||||
</el-col>
|
||||
</el-row>
|
||||
</el-dialog>
|
||||
@ -40,7 +40,7 @@
|
||||
<script>
|
||||
import LeftTrain from '@/assets/left_train.png';
|
||||
import RightTrain from '@/assets/right_train.png';
|
||||
import { srTrainControl } from '@/api/simulation';
|
||||
import { sandTableTrainControl } from '@/api/simulation';
|
||||
export default {
|
||||
name: 'TrainOperation',
|
||||
data() {
|
||||
@ -52,6 +52,7 @@ export default {
|
||||
groupNumber: '',
|
||||
changeSpeedFlag: false,
|
||||
right: true,
|
||||
reversal: false,
|
||||
train: null,
|
||||
marks: {
|
||||
0: '0',
|
||||
@ -68,6 +69,18 @@ export default {
|
||||
}
|
||||
};
|
||||
},
|
||||
computed: {
|
||||
showRight() {
|
||||
return (this.right && !this.reversal) || (!this.right && this.reversal);
|
||||
},
|
||||
trainPic() {
|
||||
if ((this.right && this.reversal) || (!this.right && !this.reversal)) {
|
||||
return this.leftTrainPic;
|
||||
} else {
|
||||
return this.rightTrainPic;
|
||||
}
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
handleClose() {
|
||||
this.$store.dispatch('menuOperation/setSelected', {device: {}});
|
||||
@ -75,6 +88,10 @@ export default {
|
||||
},
|
||||
doShow(val) {
|
||||
const train = this.$store.getters['map/getDeviceByCode'](val.groupNumber);
|
||||
if (train && train.trainWindowCode) {
|
||||
const trainWindow = this.$store.getters['map/getDeviceByCode'](train.trainWindowCode);
|
||||
this.reversal = trainWindow.reversal;
|
||||
}
|
||||
this.groupNumber = train.groupNumber;
|
||||
this.train = train;
|
||||
if (this.right != train.right) {
|
||||
@ -90,16 +107,16 @@ export default {
|
||||
this.changeSpeedFlag = true;
|
||||
},
|
||||
changeSpeed(val) {
|
||||
srTrainControl(this.$route.query.group, { groupNumber: this.groupNumber, right: this.right, speed: this.speed }).then(resp => {
|
||||
sandTableTrainControl(this.$route.query.group, { groupNumber: this.groupNumber, right: this.right, speed: this.speed }).then(resp => {
|
||||
}).catch(err => { this.$message.error(err.message); this.speed = this.train.speed; }).finally(() => { this.changeSpeedFlag = false; });
|
||||
},
|
||||
adjustDirection(value) {
|
||||
srTrainControl(this.$route.query.group, { groupNumber: this.groupNumber, right: value === 'right', speed: this.speed }).then(resp => {
|
||||
this.right = value === 'right';
|
||||
adjustDirection() {
|
||||
sandTableTrainControl(this.$route.query.group, { groupNumber: this.groupNumber, right: !this.right, speed: this.speed }).then(resp => {
|
||||
this.right = !this.right;
|
||||
}).catch(err => { this.$message.error(err.message); });
|
||||
},
|
||||
brakeTrain() {
|
||||
srTrainControl(this.$route.query.group, { groupNumber: this.groupNumber, right: this.right, speed: 0 }).then(resp => {
|
||||
sandTableTrainControl(this.$route.query.group, { groupNumber: this.groupNumber, right: this.right, speed: 0 }).then(resp => {
|
||||
this.speed = 0;
|
||||
}).catch(err => { this.$message.error(err.message); });
|
||||
}
|
||||
|
@ -125,17 +125,18 @@ export default {
|
||||
this.memberId = this.$store.state.training.myMemberId;
|
||||
const centralizedStationCode = this.stationCentralizedMap[this.$store.state.training.roleDeviceCode];
|
||||
const centralizedStation = this.$store.getters['map/getDeviceByCode'](centralizedStationCode);
|
||||
const data = { code: centralizedStation.code, name: centralizedStation.name, apply: false, release: false, distribution: false, controller: null };
|
||||
const data = { code: centralizedStation.code, name: centralizedStation.name, apply: false, release: false, distribution: false, controller: centralizedStation.controller };
|
||||
this.tableData.push(data);
|
||||
centralizedStation.chargeStationCodeList.forEach(elem => {
|
||||
const station = this.$store.getters['map/getDeviceByCode'](elem);
|
||||
const data1 = { code: station.code, name: station.name, apply: false, release: false, distribution: false, controller: null };
|
||||
const data1 = { code: station.code, name: station.name, apply: false, release: false, distribution: false, controller: station.controller };
|
||||
this.tableData.push(data1);
|
||||
});
|
||||
} else if (this.$store.state.training.roles === 'DISPATCHER') {
|
||||
this.memberId = this.$store.state.training.myMemberId;
|
||||
this.stationList.forEach(item => {
|
||||
const data = { code: item.code, name: item.name, apply: false, release: false, distribution: false, controller: null };
|
||||
const station = this.$store.getters['map/getDeviceByCode'](item.code);
|
||||
const data = { code: item.code, name: item.name, apply: false, release: false, distribution: false, controller: station.controller };
|
||||
this.tableData.push(data);
|
||||
});
|
||||
}
|
||||
|
@ -27,7 +27,8 @@ const user = {
|
||||
// resourcesUrl: '',
|
||||
// uploadUrl: '',
|
||||
ossUrl:'',
|
||||
baseSite: ''
|
||||
baseSite: '',
|
||||
deviceConfig: null
|
||||
},
|
||||
|
||||
mutations: {
|
||||
@ -102,6 +103,9 @@ const user = {
|
||||
},
|
||||
setBaseSite: (state, baseSite) => {
|
||||
state.baseSite = baseSite;
|
||||
},
|
||||
setDeviceConfig: (state, deviceConfig) => {
|
||||
state.deviceConfig = deviceConfig;
|
||||
}
|
||||
},
|
||||
|
||||
@ -153,6 +157,8 @@ const user = {
|
||||
} else {
|
||||
reject('getInfo: roles must be a non-null array !');
|
||||
}
|
||||
const deviceVO = response.data.deviceVO;
|
||||
|
||||
commit('SET_NAME', user.name);
|
||||
commit('SET_NICKNAME', user.nickname);
|
||||
commit('SET_ID', user.id);
|
||||
@ -164,6 +170,9 @@ const user = {
|
||||
commit('SET_COMPANYNAME', user.companyName);
|
||||
commit('SET_COMPANYPROJECTLIST', user.projectCodes);
|
||||
commit('SET_THIRDLOGIN', response.data.thirdLogin);
|
||||
if (deviceVO) {
|
||||
commit('setDeviceConfig', JSON.parse(deviceVO.config || '{}'));
|
||||
}
|
||||
resolve(user);
|
||||
}).catch(error => {
|
||||
reject(error);
|
||||
|
@ -253,8 +253,7 @@ export default {
|
||||
projectDevice:this.$route.query.projectDevice,
|
||||
type:this.$route.query.type,
|
||||
simType:paramVO.type,
|
||||
project: this.project,
|
||||
singleClient:true
|
||||
project: this.project
|
||||
};
|
||||
if (config) {
|
||||
if (config.client) { query.client = config.client; }
|
||||
|
@ -294,33 +294,31 @@ export default {
|
||||
});
|
||||
},
|
||||
assignUser(group, mapId) {
|
||||
this.$store.dispatch('GetUserInfo', getToken()).then(res => {
|
||||
getLoginInfo(getToken()).then(resp => {
|
||||
const deviceVO = resp.data.deviceVO;
|
||||
if (deviceVO) {
|
||||
const config = JSON.parse(deviceVO.config || '{}');
|
||||
if (config && config.roleCode) {
|
||||
const params = [{userId: res.id, memberId:config.roleCode}];
|
||||
assignUsersPlayRoles(params, group).then(() => {
|
||||
this.enterSimulation(group, mapId, config);
|
||||
}).catch(res=>{
|
||||
this.loading = false;
|
||||
this.$message.error('切换角色失败');
|
||||
this.$store.dispatch('LogOut');
|
||||
});
|
||||
} else {
|
||||
getLoginInfo(getToken()).then(resp => {
|
||||
const deviceVO = resp.data.deviceVO;
|
||||
if (deviceVO) {
|
||||
const config = JSON.parse(deviceVO.config || '{}');
|
||||
if (config && config.roleCode) {
|
||||
const params = [{userId: resp.data.accountVO.id, memberId:config.roleCode}];
|
||||
assignUsersPlayRoles(params, group).then(() => {
|
||||
this.enterSimulation(group, mapId, config);
|
||||
}).catch(res=>{
|
||||
this.loading = false;
|
||||
this.$message.error('请先配置设备相关信息');
|
||||
this.$message.error('切换角色失败');
|
||||
this.$store.dispatch('LogOut');
|
||||
}
|
||||
});
|
||||
} else {
|
||||
this.enterSimulation(group, mapId);
|
||||
this.loading = false;
|
||||
this.$message.error('请先配置设备相关信息');
|
||||
this.$store.dispatch('LogOut');
|
||||
}
|
||||
}).catch(res=>{
|
||||
this.loading = false;
|
||||
this.$message.error('获取用户信息失败');
|
||||
this.$store.dispatch('LogOut');
|
||||
});
|
||||
} else {
|
||||
this.enterSimulation(group, mapId);
|
||||
}
|
||||
}).catch(res=>{
|
||||
this.loading = false;
|
||||
this.$message.error('获取用户信息失败');
|
||||
this.$store.dispatch('LogOut');
|
||||
});
|
||||
},
|
||||
enterSimulation(group, mapId, config) {
|
||||
@ -333,8 +331,7 @@ export default {
|
||||
mapId: mapId,
|
||||
simType:paramVO.type,
|
||||
project: this.projectCode,
|
||||
projectDevice:this.$route.query.projectDevice,
|
||||
singleClient:true
|
||||
projectDevice:this.$route.query.projectDevice
|
||||
};
|
||||
if (config) {
|
||||
if (config.client) { query.client = config.client; }
|
||||
|
@ -155,7 +155,7 @@ export default {
|
||||
return this.$store.state.training.roleDeviceCode;
|
||||
},
|
||||
menuShow() {
|
||||
return !this.$route.query.singleClient && !this.$route.query.projectDevice;
|
||||
return !this.$route.query.singleClient;
|
||||
}
|
||||
},
|
||||
watch: {
|
||||
|
@ -61,8 +61,16 @@ export default {
|
||||
watch: {
|
||||
'$store.state.training.roles': function (val) {
|
||||
const clientIdList = this.$store.state.training.domConfig ? this.$store.state.training.domConfig.clientList : [];
|
||||
if (!clientIdList || !clientIdList.length) {
|
||||
this.initTerminalList();
|
||||
if (this.$route.query.projectDevice) {
|
||||
const deviceClientIdList = this.$store.state.user.deviceConfig.clientList || [];
|
||||
this.initTerminalList(deviceClientIdList);
|
||||
if (this.$route.query.client && !this.nowTerminal.id) {
|
||||
this.changeQueryClient();
|
||||
} else {
|
||||
this.initPictureShow();
|
||||
}
|
||||
} else if (!clientIdList || !clientIdList.length) {
|
||||
this.initTerminalList(clientIdList);
|
||||
if (this.$store.state.trainingNew.trainingDetail && this.$store.state.trainingNew.trainingDetail.client) {
|
||||
const client = this.findTerminalFromMap(this.$store.state.trainingNew.trainingDetail.client);
|
||||
if (client) {
|
||||
@ -74,7 +82,7 @@ export default {
|
||||
this.initPictureShow();
|
||||
}
|
||||
} else if (!this.terminalList.length) {
|
||||
this.initTerminalList();
|
||||
this.initTerminalList([]);
|
||||
this.changeQueryClient();
|
||||
}
|
||||
}
|
||||
@ -131,9 +139,8 @@ export default {
|
||||
}
|
||||
},
|
||||
// 初始化客户端数据
|
||||
initTerminalList() {
|
||||
initTerminalList(clientIdList) {
|
||||
this.terminalList = [];
|
||||
const clientIdList = this.$store.state.training.domConfig ? this.$store.state.training.domConfig.clientList : [];
|
||||
const mapClientMap = this.$store.state.map.map ? this.$store.state.map.map.mapClientVOMap : {};
|
||||
const mapClientList = mapClientMap ? mapClientMap[this.$route.query.simType] : [];
|
||||
if (!mapClientList.length) {
|
||||
|
@ -31,8 +31,8 @@
|
||||
/>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item label="关联客户端:" prop="client">
|
||||
<el-select v-model="formIbp.client" placeholder="请选择" size="small">
|
||||
<el-form-item label="客户端列表:" prop="client">
|
||||
<el-select v-model="formIbp.clientList" multiple placeholder="请选择" size="small">
|
||||
<el-option
|
||||
v-for="item in clientList"
|
||||
:key="item.id"
|
||||
@ -41,6 +41,18 @@
|
||||
/>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item label="初始客户端:" prop="client">
|
||||
<el-select v-model="formIbp.client" placeholder="请选择" size="small">
|
||||
<template v-for="item in clientList">
|
||||
<el-option
|
||||
v-if="formIbp.clientList.includes(item.id)"
|
||||
:key="item.id"
|
||||
:label="item.name"
|
||||
:value="item.id"
|
||||
/>
|
||||
</template>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
<el-form v-show="['IM','CW','DRIVE','DEPOT'].includes(data.type)" ref="formIm" :model="formIm" label-width="100px" :rules="rulesIm">
|
||||
<el-form-item label="关联角色:" prop="roleCode">
|
||||
@ -53,8 +65,8 @@
|
||||
/>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item label="关联客户端:" prop="client">
|
||||
<el-select v-model="formIm.client" placeholder="请选择" size="small">
|
||||
<el-form-item label="客户端列表:" prop="client">
|
||||
<el-select v-model="formIm.clientList" multiple placeholder="请选择" size="small">
|
||||
<el-option
|
||||
v-for="item in clientList"
|
||||
:key="item.id"
|
||||
@ -63,6 +75,18 @@
|
||||
/>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item label="初始客户端:" prop="client">
|
||||
<el-select v-model="formIm.client" placeholder="请选择" size="small">
|
||||
<template v-for="item in clientList">
|
||||
<el-option
|
||||
v-if="formIm.clientList.includes(item.id)"
|
||||
:key="item.id"
|
||||
:label="item.name"
|
||||
:value="item.id"
|
||||
/>
|
||||
</template>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
<el-form v-show="data.type === 'LW'" ref="formLw" :model="formLw" label-width="100px" :rules="rulesLw">
|
||||
<el-form-item label="关联车站:" prop="stationCode">
|
||||
@ -85,8 +109,8 @@
|
||||
/>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item label="关联客户端:" prop="client">
|
||||
<el-select v-model="formLw.client" placeholder="请选择" size="small">
|
||||
<el-form-item label="客户端列表:" prop="client">
|
||||
<el-select v-model="formLw.clientList" multiple placeholder="请选择" size="small">
|
||||
<el-option
|
||||
v-for="item in clientList"
|
||||
:key="item.id"
|
||||
@ -95,6 +119,18 @@
|
||||
/>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item label="初始客户端:" prop="client">
|
||||
<el-select v-model="formLw.client" placeholder="请选择" size="small">
|
||||
<template v-for="item in clientList">
|
||||
<el-option
|
||||
v-if="formLw.clientList.includes(item.id)"
|
||||
:key="item.id"
|
||||
:label="item.name"
|
||||
:value="item.id"
|
||||
/>
|
||||
</template>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
<el-form v-show="data.type === 'ISCS_LW' || data.type === 'ISCS_CW'" ref="formIscs" :model="formIscs" label-width="100px" :rules="rulesIscs">
|
||||
<el-form-item :label="data.type === 'ISCS_LW'?'现地工作站:': '行调工作站'" prop="deviceCode">
|
||||
@ -137,8 +173,8 @@
|
||||
/>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item label="关联客户端:" prop="client">
|
||||
<el-select v-model="formIscs.client" placeholder="请选择" size="small">
|
||||
<el-form-item label="客户端列表:" prop="client">
|
||||
<el-select v-model="formIscs.clientList" multiple placeholder="请选择" size="small">
|
||||
<el-option
|
||||
v-for="item in clientList"
|
||||
:key="item.id"
|
||||
@ -147,6 +183,18 @@
|
||||
/>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item label="初始客户端:" prop="client">
|
||||
<el-select v-model="formIscs.client" placeholder="请选择" size="small">
|
||||
<template v-for="item in clientList">
|
||||
<el-option
|
||||
v-if="formIscs.clientList.includes(item.id)"
|
||||
:key="item.id"
|
||||
:label="item.name"
|
||||
:value="item.id"
|
||||
/>
|
||||
</template>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
<span slot="footer" class="dialog-footer">
|
||||
<el-button type="primary" @click="doSave">{{ $t('global.confirm') }}</el-button>
|
||||
@ -170,25 +218,29 @@ export default {
|
||||
lwList: [],
|
||||
formIm:{
|
||||
roleCode:'',
|
||||
client:''
|
||||
client:'',
|
||||
clientList: []
|
||||
},
|
||||
formIbp: {
|
||||
part: '',
|
||||
deviceCode: '',
|
||||
roleCode:'',
|
||||
client:''
|
||||
client:'',
|
||||
clientList: []
|
||||
},
|
||||
formLw: {
|
||||
stationCode: '',
|
||||
roleCode:'',
|
||||
client:''
|
||||
client:'',
|
||||
clientList: []
|
||||
},
|
||||
formIscs: {
|
||||
deviceCode: '',
|
||||
picture: '',
|
||||
stationCode: '',
|
||||
roleCode:'',
|
||||
client:''
|
||||
client:'',
|
||||
clientList: []
|
||||
},
|
||||
clientList: [],
|
||||
pictureList: [
|
||||
@ -201,6 +253,9 @@ export default {
|
||||
],
|
||||
client: [
|
||||
{ required: true, message: '请选择关联客户端', trigger: 'change'}
|
||||
],
|
||||
clientList: [
|
||||
{ required: true, message: '请选择客户端列表', trigger: 'change'}
|
||||
]
|
||||
},
|
||||
rulesIbp: {
|
||||
@ -215,6 +270,9 @@ export default {
|
||||
],
|
||||
client: [
|
||||
{ required: true, message: '请选择关联客户端', trigger: 'change'}
|
||||
],
|
||||
clientList: [
|
||||
{ required: true, message: '请选择客户端列表', trigger: 'change'}
|
||||
]
|
||||
},
|
||||
rulesLw: {
|
||||
@ -226,6 +284,9 @@ export default {
|
||||
],
|
||||
client: [
|
||||
{ required: true, message: '请选择关联客户端', trigger: 'change'}
|
||||
],
|
||||
clientList: [
|
||||
{ required: true, message: '请选择客户端列表', trigger: 'change'}
|
||||
]
|
||||
},
|
||||
rulesIscs: {
|
||||
@ -237,6 +298,9 @@ export default {
|
||||
],
|
||||
client: [
|
||||
{ required: true, message: '请选择关联客户端', trigger: 'change'}
|
||||
],
|
||||
clientList: [
|
||||
{ required: true, message: '请选择客户端列表', trigger: 'change'}
|
||||
]
|
||||
},
|
||||
partList: [{label: '左', value: 'LEFT'}, {label: '右', value: 'RIGHT'}, {label: '全部', value: 'WHOLE'}],
|
||||
@ -252,19 +316,19 @@ export default {
|
||||
initData(row) {
|
||||
getDeviceDetail(row.id).then(resp => {
|
||||
if (resp.data.config && resp.data.type === 'VR_IBP') {
|
||||
this.formIbp = {part: '', deviceCode: '', roleCode:'', client:''};
|
||||
this.formIbp = {part: '', deviceCode: '', roleCode:'', client:'', clientList: []};
|
||||
const form = JSON.parse(resp.data.config);
|
||||
this.formIbp = Object.assign(this.formIbp, form);
|
||||
} else if (resp.data.config && resp.data.type === 'LW') {
|
||||
this.formLw = {stationCode: '', roleCode:'', client:''};
|
||||
this.formLw = {stationCode: '', roleCode:'', client:'', clientList: []};
|
||||
const form = JSON.parse(resp.data.config);
|
||||
this.formLw = Object.assign(this.formLw, form);
|
||||
} else if (resp.data.config && ['IM', 'CW', 'DRIVE', 'DEPOT'].includes(resp.data.type)) {
|
||||
this.formIm = { roleCode:'', client:''};
|
||||
this.formIm = { roleCode:'', client:'', clientList: []};
|
||||
const form = JSON.parse(resp.data.config);
|
||||
this.formIm = Object.assign(this.formIm, form);
|
||||
} else if (resp.data.config && (resp.data.type === 'ISCS_LW' || resp.data.type === 'ISCS_CW')) {
|
||||
this.formIscs = {deviceCode: '', picture: '', stationCode: '', roleCode:'', client:''};
|
||||
this.formIscs = {deviceCode: '', picture: '', stationCode: '', roleCode:'', client:'', clientList: []};
|
||||
const form = JSON.parse(resp.data.config);
|
||||
this.formIscs = Object.assign(this.formIscs, form);
|
||||
}
|
||||
@ -377,10 +441,10 @@ export default {
|
||||
this.dialogVisible = false;
|
||||
this.data = {};
|
||||
this.lwList = [];
|
||||
this.formIbp = {part: '', deviceCode: '', roleCode:'', client:''};
|
||||
this.formLw = {stationCode: '', roleCode:'', client:''};
|
||||
this.formIm = { roleCode:'', client:''};
|
||||
this.formIscs = {deviceCode: '', picture: '', stationCode: '', roleCode:'', client:''};
|
||||
this.formIbp = {part: '', deviceCode: '', roleCode:'', client:'', clientList: []};
|
||||
this.formLw = {stationCode: '', roleCode:'', client:'', clientList: []};
|
||||
this.formIm = { roleCode:'', client:'', clientList: []};
|
||||
this.formIscs = {deviceCode: '', picture: '', stationCode: '', roleCode:'', client:'', clientList: []};
|
||||
this.$refs.formIbp.resetFields();
|
||||
this.$refs.formLw.resetFields();
|
||||
this.$refs.formIscs.resetFields();
|
||||
|
@ -41,7 +41,8 @@ export default {
|
||||
stationCode: '',
|
||||
standCode: '',
|
||||
roleCode:'',
|
||||
client:''
|
||||
client:'',
|
||||
clientList: []
|
||||
},
|
||||
rules: {
|
||||
addr: [
|
||||
@ -64,6 +65,9 @@ export default {
|
||||
],
|
||||
client: [
|
||||
{ required: true, message: '请选择关联客户端', trigger: 'change'}
|
||||
],
|
||||
clientList: [
|
||||
{ required: true, message: '请选择客户端列表', trigger: 'change'}
|
||||
]
|
||||
},
|
||||
stationList: [],
|
||||
@ -96,7 +100,8 @@ export default {
|
||||
{ prop: 'standCode', label: '关联站台:', type: 'select', options: this.standList, optionLabel: 'name', optionValue: 'code', deviceChange: this.standCodeChange},
|
||||
{ prop: 'psdCode', label: '关联屏蔽门:', type: 'select', options: this.psdList, optionLabel: 'code', optionValue: 'code' },
|
||||
{ prop: 'roleCode', label: '关联角色:', type: 'select', options: this.roleList, optionLabel: 'label', optionValue: 'value' },
|
||||
{ prop: 'client', label: '关联客户端:', type: 'select', options: this.clientList, optionLabel: 'name', optionValue: 'id' }
|
||||
{ prop: 'client', label: '初始客户端:', type: 'select', options: this.clientList, optionLabel: 'name', optionValue: 'id' },
|
||||
{ prop: 'clientList', label: '客户端列表:', type: 'select', options: this.clientList, optionLabel: 'name', optionValue: 'id' }
|
||||
]
|
||||
};
|
||||
} else if (this.data.type === 'LSW') {
|
||||
@ -106,7 +111,8 @@ export default {
|
||||
{ prop: 'deviceCode', label: '教研机:', type: 'select', options: this.deviceList, optionLabel: 'code', optionValue: 'code' },
|
||||
{ prop: 'quadrant', label: '屏幕配置:', type: 'select', options: this.screenList, optionLabel: 'label', optionValue: 'value'},
|
||||
{ prop: 'roleCode', label: '关联角色:', type: 'select', options: this.roleList, optionLabel: 'label', optionValue: 'value' },
|
||||
{ prop: 'client', label: '关联客户端:', type: 'select', options: this.clientList, optionLabel: 'label', optionValue: 'value' }
|
||||
{ prop: 'client', label: '初始客户端:', type: 'select', options: this.clientList, optionLabel: 'label', optionValue: 'value' },
|
||||
{ prop: 'clientList', label: '客户端列表:', type: 'select', options: this.clientList, optionLabel: 'name', optionValue: 'id' }
|
||||
]
|
||||
};
|
||||
} else if (this.data.type === 'CCTV') {
|
||||
@ -115,7 +121,8 @@ export default {
|
||||
items: [
|
||||
{ prop: 'deviceCode', label: '教研机:', type: 'select', options: this.deviceList, optionLabel: 'code', optionValue: 'code' },
|
||||
{ prop: 'roleCode', label: '关联角色:', type: 'select', options: this.roleList, optionLabel: 'label', optionValue: 'value' },
|
||||
{ prop: 'client', label: '关联客户端:', type: 'select', options: this.clientList, optionLabel: 'label', optionValue: 'value' }
|
||||
{ prop: 'client', label: '关联客户端:', type: 'select', options: this.clientList, optionLabel: 'label', optionValue: 'value' },
|
||||
{ prop: 'clientList', label: '客户端列表:', type: 'select', options: this.clientList, optionLabel: 'name', optionValue: 'id' }
|
||||
]
|
||||
};
|
||||
} else if ( this.data.type === 'SANDBOX') {
|
||||
@ -124,7 +131,8 @@ export default {
|
||||
items: [
|
||||
{ prop: 'deviceCode', label: '教研机', type: 'select', options: this.deviceList, optionLabel: 'code', optionValue: 'code'},
|
||||
{ prop: 'roleCode', label: '关联角色:', type: 'select', options: this.roleList, optionLabel: 'label', optionValue: 'value' },
|
||||
{ prop: 'client', label: '关联客户端:', type: 'select', options: this.clientList, optionLabel: 'label', optionValue: 'value' }
|
||||
{ prop: 'client', label: '关联客户端:', type: 'select', options: this.clientList, optionLabel: 'label', optionValue: 'value' },
|
||||
{ prop: 'clientList', label: '客户端列表:', type: 'select', options: this.clientList, optionLabel: 'name', optionValue: 'id' }
|
||||
]
|
||||
};
|
||||
} else if (this.data.type === 'ILW') {
|
||||
@ -133,7 +141,8 @@ export default {
|
||||
items: [
|
||||
{ prop: 'deviceCode', label: '教研机', type: 'select', options: this.deviceList, optionLabel: 'code', optionValue: 'code'},
|
||||
{ prop: 'roleCode', label: '关联角色:', type: 'select', options: this.roleList, optionLabel: 'label', optionValue: 'value' },
|
||||
{ prop: 'client', label: '关联客户端:', type: 'select', options: this.clientList, optionLabel: 'label', optionValue: 'value' }
|
||||
{ prop: 'client', label: '关联客户端:', type: 'select', options: this.clientList, optionLabel: 'label', optionValue: 'value' },
|
||||
{ prop: 'clientList', label: '客户端列表:', type: 'select', options: this.clientList, optionLabel: 'name', optionValue: 'id' }
|
||||
]
|
||||
};
|
||||
}
|
||||
@ -160,6 +169,7 @@ export default {
|
||||
psdCode: data.psdCode,
|
||||
roleCode:data.roleCode || '',
|
||||
client:data.client || '',
|
||||
clientList: data.clientList || [],
|
||||
addr: data.addr,
|
||||
quantity: data.quantity
|
||||
};
|
||||
@ -211,30 +221,6 @@ export default {
|
||||
this.$message.error('获取客户端列表失败');
|
||||
});
|
||||
}).catch(() => { this.$message.error('获取线路功能数据失败!'); });
|
||||
// const self = this;
|
||||
// querySimulationMemberByMapId(mapId).then(resp => {
|
||||
// if (resp.data) {
|
||||
// getMapFunctioById(functionId).then(response=>{
|
||||
// if (resp.data) {
|
||||
// const roleList = resp.data[response.data.simType];
|
||||
// const clientListMapIn = ConstConfig.ConstSelect.clientMap;
|
||||
// this.clientListMap = clientListMapIn[response.data.simType];
|
||||
// const covertRoleList = [];
|
||||
// roleList.forEach(member => {
|
||||
// const data = self.handleMember(member, self.stationList);
|
||||
// covertRoleList.push(data);
|
||||
// });
|
||||
// this.clientList = [];
|
||||
// self.roleList = covertRoleList;
|
||||
// const roleCode = this.formData.roleCode;
|
||||
// const role = this.roleList.find(each=>{ return each.value == roleCode; });
|
||||
// if (role) { this.clientList = this.clientListMap[role.memberType] || []; }
|
||||
// }
|
||||
// });
|
||||
// }
|
||||
// }).catch(() => {
|
||||
// this.$message.error('获取角色列表失败');
|
||||
// });
|
||||
}).catch(() => {
|
||||
this.$message.error('获取车站列表失败');
|
||||
});
|
||||
@ -343,7 +329,8 @@ export default {
|
||||
quadrant: this.formData.quadrant,
|
||||
roleCode: this.formData.roleCode,
|
||||
mapId:this.formData.mapId,
|
||||
client: this.formData.client
|
||||
client: this.formData.client,
|
||||
clientList: this.formData.clientList
|
||||
};
|
||||
const data = {id: this.data.id, project: this.data.project, code: this.data.code, type: this.data.type, config: JSON.stringify(param) };
|
||||
setDeviceConfig(data).then(() => {
|
||||
@ -360,7 +347,8 @@ export default {
|
||||
deviceCode: this.formData.deviceCode,
|
||||
roleCode: this.formData.roleCode,
|
||||
mapId:this.formData.mapId,
|
||||
client: this.formData.client
|
||||
client: this.formData.client,
|
||||
clientList: this.formData.clientList
|
||||
};
|
||||
const data = {id: this.data.id, project: this.data.project, code: this.data.code, type: this.data.type, config: JSON.stringify(param) };
|
||||
setDeviceConfig(data).then(() => {
|
||||
@ -378,7 +366,8 @@ export default {
|
||||
psdCode: this.formData.psdCode,
|
||||
mapId:this.formData.mapId,
|
||||
roleCode: this.formData.roleCode,
|
||||
client: this.formData.client
|
||||
client: this.formData.client,
|
||||
clientList: this.formData.clientList
|
||||
};
|
||||
const data = {id: this.data.id, project: this.data.project, code: this.data.code, type: this.data.type, config: JSON.stringify(param) };
|
||||
setDeviceConfig(data).then(() => {
|
||||
@ -410,7 +399,8 @@ export default {
|
||||
deviceCode: this.formData.deviceCode,
|
||||
roleCode: this.formData.roleCode,
|
||||
mapId:this.formData.mapId,
|
||||
client: this.formData.client
|
||||
client: this.formData.client,
|
||||
clientList: this.formData.clientList
|
||||
};
|
||||
const data = {id: this.data.id, project: this.data.project, code: this.data.code, type: this.data.type, config: JSON.stringify(param) };
|
||||
setDeviceConfig(data).then(() => {
|
||||
@ -426,7 +416,8 @@ export default {
|
||||
const param = {
|
||||
deviceCode: this.formData.deviceCode,
|
||||
roleCode: this.formData.roleCode,
|
||||
client: this.formData.client
|
||||
client: this.formData.client,
|
||||
clientList: this.formData.clientList
|
||||
};
|
||||
const data = {id: this.data.id, project: this.data.project, code: this.data.code, type: this.data.type, config: JSON.stringify(param) };
|
||||
setDeviceConfig(data).then(() => {
|
||||
|
@ -29,10 +29,13 @@
|
||||
<el-input v-model="formModel.bottomRecordNumber" style="width: 400px;" size="small" />
|
||||
</el-form-item>
|
||||
<el-form-item label="项目Logo:" prop="loginProLogo">
|
||||
<div class="eachButton uploadLogo">
|
||||
<img v-if="formModel.loginProLogo" :src="computedLoginLogo" :alt="computedLoginLogo" class="loginLogo">
|
||||
<i class="el-icon-plus avatar-uploader-icon el-icon-other" />
|
||||
<input id="upload_file" ref="files" type="file" class="file_box" accept="image/jpeg,image/png" @change="uploadLogo">
|
||||
<div style="display: flex; justify-content: flex-start;align-items: flex-end;">
|
||||
<div class="eachButton uploadLogo">
|
||||
<img v-if="formModel.loginProLogo" :src="computedLoginLogo" :alt="computedLoginLogo" class="loginLogo">
|
||||
<i class="el-icon-plus avatar-uploader-icon el-icon-other" />
|
||||
<input id="upload_file" ref="files" type="file" class="file_box" accept="image/jpeg,image/png" @change="uploadLogo">
|
||||
</div>
|
||||
<el-button :disabled="!formModel.loginProLogo" type="text" style="margin-left: 15px;" @click="deleteProLogo">删除</el-button>
|
||||
</div>
|
||||
</el-form-item>
|
||||
<el-form-item label="登录页Logo宽度:" prop="loginProLogoWidth" class="inlineBlock" style="margin-left:10px">
|
||||
@ -234,6 +237,16 @@ export default {
|
||||
}
|
||||
});
|
||||
},
|
||||
deleteProLogo() {
|
||||
this.$confirm('确定删除项目Logo?', '警告', {
|
||||
confirmButtonText: '确定',
|
||||
cancelButtonText: '取消',
|
||||
type: 'warning'
|
||||
}).then(() => {
|
||||
document.getElementById('upload_file');
|
||||
this.formModel.loginProLogo = '';
|
||||
}).catch(e => {});
|
||||
},
|
||||
uploadLogo() {
|
||||
const pic = document.getElementById('upload_file');
|
||||
if (!pic.files || !pic.files[0]) {
|
||||
|
Loading…
Reference in New Issue
Block a user