This commit is contained in:
lVAL 2020-10-30 11:13:24 +08:00
commit 1adc1101fe
15 changed files with 487 additions and 195 deletions

View File

@ -15,120 +15,232 @@ export default {
beginRow: 1,
beginCol: 0,
// fieldNum: 10,
columns: {
'默认上行折返轨': { key: 'upTrack', formatter: (val) => { return val; } },
'默认下行折返轨': { key: 'downTrack', formatter: (val) => { return val; } }
}
trainId: '车次号',
columns: ['备注', '车次号']
// beginRow: 1,
// beginCol: 0,
// // fieldNum: 10,
// columns: {
// '默认上行折返轨': { key: 'upTrack', formatter: (val) => { return val; } },
// '默认下行折返轨': { key: 'downTrack', formatter: (val) => { return val; } }
// }
},
// /** 解析exal数据转换为Json后台数据*/
// importData(Sheet, JsonData) {
// const dataList = convertSheetToList(Sheet, true);
// const needList = Object.keys(this.ExcelConfig.columns);
// const tripObj = { upTrack: '', downTrack: '' };
// if (dataList && dataList.length && dataList[1] && dataList[0]) {
// const tIndex = dataList.findIndex(it => { return it[0]; });
// if (dataList[0][0] == needList[0] && dataList[1][0] == needList[1]) {
// for (var colIndex = this.ExcelConfig.beginCol; colIndex < dataList.length; colIndex += 1) {
// var isContinue = true;
// for (var rowIndex = this.ExcelConfig.beginRow; isContinue; rowIndex += 1) {
// isContinue = false;
// var title = dataList[colIndex][0];
// var value = dataList[colIndex][rowIndex];
// if (title && value) {
// // 数据列解析
// isContinue = true;
// var titleStr = `${title}`.replace(/\s*/g, '');
// var valueStr = `${value}`.replace(/\s*/g, '');
// // 取需要的字段
// if (needList.findIndex(elem => { return elem == titleStr; }) >= 0) {
// tripObj[this.ExcelConfig.columns[titleStr].key] = this.ExcelConfig.columns[titleStr].formatter(valueStr);
// }
// }
// }
// }
// } else {
// /** 解析二维数组为json对象*/
// const reg0 = /^[↑|↓|¡|ü|ý|]+(.*)/; // ↑|↓
// const reg1 = /^([▼|▲|¡ø|¨‹]+)\s*(\d+:\d+:\d+)/; // ▲ 06:10:00
// const reg2 = /^(\d+:\d+:\d+)\s*([▼|▲|¡ø|¨‹]+)/; // 06:10:00 ▲
// const reg3 = /^(\d+:\d+:\d+)\s*(\d+:\d+:\d+|)/; // 06:10:00 06:12:00
// const reg4 = /[▼|▲|¡|ø|¨|‹]+/; // ▲
// dataList.forEach((elem, i) => {
// var begin = -1;
// /** 跳过名称所在的行*/
// if (i != tIndex && elem && elem.length > 0) {
// elem.forEach((item, j) => {
// /** 过滤空值*/
// if (item) {
// var value = `${item}`.trim();
// var title = `${dataList[tIndex][j]}`.replace(/\s*/g, '');
// /** 匹配到开始位置或者结束位置*/
// if (reg0.test(value)) {
// if (begin == -1) {
// begin = value; // 设置初始索引
// JsonData.push({
// code: reg0.exec(value)[1],
// arrivalList: []
// });
// } else if (begin === value) {
// begin = -1; // 清空初始索引
// }
// } else if (begin !== -1) {
// /** 匹配到中间位置*/
// var begTime, endTime;
// var runFlag = JsonData[JsonData.length - 1].code[2];
// var stationName = title.replace(/\s/, '');
// var need = false;
// var flag = false;
// if (reg1.test(value)) {
// /** 含有特殊字符的时间格式*/
// [, begTime, endTime] = reg1.exec(value);
// begTime = reg4.test(begTime) ? '' : begTime;
// endTime = reg4.test(endTime) ? '' : endTime;
// /** 下行方向时间互换*/
// if (runFlag === '2') {
// [begTime, endTime] = [endTime, begTime];
// }
// /** 设置标志*/
// [need, flag] = [true, true];
// } else if (reg2.test(value)) {
// /** 含有特殊字符的时间格式*/
// [, begTime, endTime] = reg2.exec(value);
// begTime = reg4.test(begTime) ? '' : begTime;
// endTime = reg4.test(endTime) ? '' : endTime;
// /** 下行方向时间互换*/
// if (runFlag === '2') {
// [begTime, endTime] = [endTime, begTime];
// }
// /** 设置标志*/
// [need, flag] = [true, true];
// } else if (reg3.test(value)) {
// /** 正常时间格式*/
// [, begTime, endTime] = reg3.exec(value);
// /** 如果只存在一个数据时,则开始和结束设置一样*/
// endTime = endTime || begTime;
// /** 下行方向时间互换*/
// if (runFlag === '2') {
// [begTime, endTime] = [endTime, begTime];
// }
// /** 设置标志*/
// [need, flag] = [true, false];
// }
// /** 添加json数据*/
// if (need) { // 储存非空 数据
// var stationObj = {
// stationName: stationName
// };
// if (begTime) { stationObj['arriveTime'] = prefixTime(begTime); }
// if (endTime) { stationObj['departureTime'] = prefixTime(endTime); }
// if (flag) { stationObj['flag'] = flag; } // 是否转换轨
// JsonData[JsonData.length - 1].arrivalList.push(stationObj);
// }
// }
// }
// });
// }
// });
// }
// }
// JsonData.forEach(item => {
// item['upTrack'] = tripObj.upTrack;
// item['downTrack'] = tripObj.downTrack;
// });
// return JsonData;
// },
/** 解析exal数据转换为Json后台数据*/
importData(Sheet, JsonData) {
const dataList = convertSheetToList(Sheet, true);
const needList = Object.keys(this.ExcelConfig.columns);
const tripObj = { upTrack: '', downTrack: '' };
if (dataList && dataList.length && dataList[1] && dataList[0]) {
const tIndex = dataList.findIndex(it => { return it[0]; });
if (dataList[0][0] == needList[0] && dataList[1][0] == needList[1]) {
for (var colIndex = this.ExcelConfig.beginCol; colIndex < dataList.length; colIndex += 1) {
var isContinue = true;
for (var rowIndex = this.ExcelConfig.beginRow; isContinue; rowIndex += 1) {
isContinue = false;
var title = dataList[colIndex][0];
var value = dataList[colIndex][rowIndex];
if (title && value) {
// 数据列解析
isContinue = true;
var titleStr = `${title}`.replace(/\s*/g, '');
var valueStr = `${value}`.replace(/\s*/g, '');
// 取需要的字段
if (needList.findIndex(elem => { return elem == titleStr; }) >= 0) {
tripObj[this.ExcelConfig.columns[titleStr].key] = this.ExcelConfig.columns[titleStr].formatter(valueStr);
}
}
}
}
} else {
const tIndex = 8; // 设置不用过滤行数
/** 解析二维数组为json对象*/
const reg0 = /^[↑|↓|¡|ü|ý|]+(.*)/; // ↑|↓
const reg1 = /^([▼|▲|¡ø|¨‹]+)\s*(\d+:\d+:\d+)/; // ▲ 06:10:00
const reg2 = /^(\d+:\d+:\d+)\s*([▼|▲|¡ø|¨‹]+)/; // 06:10:00 ▲
const reg3 = /^(\d+:\d+:\d+)\s*(\d+:\d+:\d+|)/; // 06:10:00 06:12:00
const reg3 = /^(\d+:\d+:\d+|)/; // 06:12:00
const reg4 = /[▼|▲|¡|ø|¨|‹]+/; // ▲
dataList.forEach((elem, i) => {
var begin = -1;
/** 跳过名称所在的行*/
if (i != tIndex && elem && elem.length > 0) {
elem.forEach((item, j) => {
/** 过滤空值*/
if (item) {
let flag = false;
let param = { begTime: '', endTime: '' };
if (i > tIndex) { elem.reverse(); }
let interval = 1;
for (let j = 0; j < elem.length;) {
const item = elem[j];
let title = '';
var value = `${item}`.trim();
var title = `${dataList[tIndex][j]}`.replace(/\s*/g, '');
if (i > tIndex) { // 上行线
title = `${dataList[tIndex][dataList[tIndex].length - j - 1]}`.replace(/\s*/g, '');
if (title == 'undefined') {
title = `${dataList[tIndex][dataList[tIndex].length - j - 2]}`.replace(/\s*/g, '');
}
} else { // 下行线
title = `${dataList[tIndex][j]}`.replace(/\s*/g, '');
if (title == 'undefined') {
title = `${dataList[tIndex][j - 1]}`.replace(/\s*/g, '');
}
}
/** 匹配到开始位置或者结束位置*/
if (reg0.test(value)) {
if (title == this.ExcelConfig.trainId && value != 'undefined') {
if (begin == -1) {
interval = 2;
flag = true;
begin = value; // 设置初始索引
JsonData.push({
code: reg0.exec(value)[1],
code: value,
destinationCode: '',
arrivalList: []
});
} else if (begin === value) {
} else if (flag) {
interval = 1;
begin = -1; // 清空初始索引
JsonData[JsonData.length - 1].destinationCode = value;
flag = false;
}
} else if (title == this.ExcelConfig.columns[0]) {
interval = 1;
} else if (begin !== -1) {
const item1 = `${elem[j]}`.trim();
const item2 = `${elem[j + 1]}`.trim();
if (item1 != 'undefined' || item2 != 'undefined') {
/** 匹配到中间位置*/
var begTime, endTime;
var runFlag = JsonData[JsonData.length - 1].code[2];
var stationName = title.replace(/\s/, '');
var need = false;
var flag = false;
if (reg1.test(value)) {
/** 含有特殊字符的时间格式*/
[, begTime, endTime] = reg1.exec(value);
begTime = reg4.test(begTime) ? '' : begTime;
endTime = reg4.test(endTime) ? '' : endTime;
/** 下行方向时间互换*/
if (runFlag === '2') {
[begTime, endTime] = [endTime, begTime];
const flag = reg3.test(item1) || reg3.test(item2);
if (this.ExcelConfig.columns.indexOf(stationName) == -1 && flag) {
let need = false;
if (value.split(':')[0] == '24') { // 24:XX:XX 类似这种数据 变24为00
const arr = value.split(':');
arr[0] = '00';
value = arr.join(':');
}
const item1 = elem[j] ? `${elem[j]}`.trim() : '';
const item2 = elem[j + 1] ? `${elem[j + 1]}`.trim() : '';
if (item1 && item2) {
param.begTime = item1;
param.endTime = item2;
} else if (item1 && !item2) {
param.begTime = item1;
param.endTime = item1;
} else if (!item1 && item2) {
param.begTime = item2;
param.endTime = item2;
}
/** 设置标志*/
[need, flag] = [true, true];
} else if (reg2.test(value)) {
/** 含有特殊字符的时间格式*/
[, begTime, endTime] = reg2.exec(value);
begTime = reg4.test(begTime) ? '' : begTime;
endTime = reg4.test(endTime) ? '' : endTime;
/** 下行方向时间互换*/
if (runFlag === '2') {
[begTime, endTime] = [endTime, begTime];
}
/** 设置标志*/
[need, flag] = [true, true];
} else if (reg3.test(value)) {
/** 正常时间格式*/
[, begTime, endTime] = reg3.exec(value);
/** 如果只存在一个数据时,则开始和结束设置一样*/
endTime = endTime || begTime;
/** 下行方向时间互换*/
if (runFlag === '2') {
[begTime, endTime] = [endTime, begTime];
}
/** 设置标志*/
[need, flag] = [true, false];
if (param.begTime && param.endTime) {
need = true;
}
/** 添加json数据*/
@ -136,25 +248,32 @@ export default {
var stationObj = {
stationName: stationName
};
if (begTime) { stationObj['arriveTime'] = prefixTime(begTime); }
if (endTime) { stationObj['departureTime'] = prefixTime(endTime); }
if (flag) { stationObj['flag'] = flag; } // 是否转换轨
if (reg4.test(param.begTime)) {
param.begTime = '';
}
if (reg4.test(param.endTime)) {
param.endTime = '';
}
stationObj['arriveTime'] = prefixTime(param.begTime);
stationObj['departureTime'] = prefixTime(param.endTime);
JsonData[JsonData.length - 1].arrivalList.push(stationObj);
param = { begTime: '', endTime: '' };
}
}
}
}
j = j + interval;
}
}
});
}
});
const arr = [];
JsonData.forEach((item, i) => {
if (item.code) {
arr.push(item);
}
}
JsonData.forEach(item => {
item['upTrack'] = tripObj.upTrack;
item['downTrack'] = tripObj.downTrack;
});
return JsonData;
return arr;
},
/** 将后台数据解析成图表*/

View File

@ -9,6 +9,7 @@
v-model="startTime"
size="small"
type="datetime"
value-format="yyyy-MM-dd HH:mm:ss"
placeholder="选择日期时间"
/>
</el-col>
@ -18,6 +19,7 @@
v-model="endTime"
size="small"
type="datetime"
value-format="yyyy-MM-dd HH:mm:ss"
placeholder="选择日期时间"
/>
</el-col>
@ -76,7 +78,7 @@
<el-table-column prop="confirmTime" label="确认时间" width="150px" />
<el-table-column prop="recover" label="恢复">
<template slot-scope="scope">
<span>{{ scope.row.recover? 'Y':'N' }}</span>
<span>{{ scope.row.recovered? 'Y':'N' }}</span>
</template>
</el-table-column>
<el-table-column prop="address" label="恢复时间" />

View File

@ -7,6 +7,7 @@
v-model="startTime"
size="small"
type="datetime"
value-format="yyyy-MM-dd HH:mm:ss"
placeholder="选择日期时间"
/>
<div style="display: inline-block;margin-right: 5px;margin-left: 10px;">结束时间:</div>
@ -14,6 +15,7 @@
v-model="endTime"
size="small"
type="datetime"
value-format="yyyy-MM-dd HH:mm:ss"
placeholder="选择日期时间"
/>
<el-button style="margin-left: 10px;" @click="queryData">查询</el-button>
@ -35,7 +37,7 @@
<el-table-column prop="description" label="故障描述" />
<el-table-column prop="recover" label="已恢复">
<template slot-scope="scope">
<el-checkbox v-model="scope.row.recover" />
<el-checkbox v-model="scope.row.recovered" />
</template>
</el-table-column>
<el-table-column prop="address" label="恢复时间" />

View File

@ -222,13 +222,13 @@ export default {
/** 计算折返点*/
elem.right = elem.tripNumber[0] == '2';
var nextPoint = [parseInt(elem.secondTime), this.getCoordYByElem(stations, kmRangeCoordMap, elem, false), elem.right];
var nextPoint = [parseInt(elem.secondTime), this.getCoordYByElem(stations, kmRangeCoordMap, elem, false), elem.tripNumber, elem.right];
if (serie.data.length > 0) {
var lastPoint = serie.data[serie.data.length - 1];
if (lastPoint[2] !== nextPoint[2]) {
var num = this.computedReentryNumber(elem.tripNumber);
serie.data.push([lastPoint[0], this.getYvalueByDirectionCode(lastPoint[1], lastPoint[2], num), lastPoint[2]]);
serie.data.push([nextPoint[0], this.getYvalueByDirectionCode(nextPoint[1], lastPoint[2], num), lastPoint[2]]);
serie.data.push([lastPoint[0], this.getYvalueByDirectionCode(lastPoint[1], lastPoint[3], num), lastPoint[3]]);
serie.data.push([nextPoint[0], this.getYvalueByDirectionCode(nextPoint[1], lastPoint[3], num), lastPoint[3]]);
}
}

View File

@ -236,6 +236,14 @@
</div>
</div>
</div>
<div class="form_box">
<div class="title">单位:</div>
<div class="content_box_info">
<div v-show="companyShow" class="show_box">
<span>{{ handleCompany(userInfo.companyId) }}</span>
</div>
</div>
</div>
<div v-if="!wmOpenId" class="form_box">
<div class="title">绑定微信:</div>
<div class="content_box_info">
@ -278,6 +286,7 @@ import QrcodeVue from 'qrcode.vue';
import { setInterval, clearInterval } from 'timers';
import { checkLoginStatus } from '@/api/login';
import { getSessionStorage } from '@/utils/auth';
import { getCompanyList } from '@/api/company';
export default {
components: { QrcodeVue },
@ -296,14 +305,16 @@ export default {
nickname: '',
mobile: '',
email: '',
passWord: ''
passWord: '',
companyId: ''
},
editInfo: {
name: '',
nickname: '',
mobile: '',
email: '',
passWord: ''
passWord: '',
companyId: ''
},
nationCode: '86',
nameShow: true,
@ -311,6 +322,7 @@ export default {
mobileShow: true,
emailShow: true,
passwordShow: true,
companyShow: true,
mobileCode: null,
emailCode: null,
passWordCode: null,
@ -340,7 +352,8 @@ export default {
nationCodeInit: '86', //
loginClient: 'LianKeTang',
project:'',
wmOpenId: ''
wmOpenId: '',
companyList: []
};
},
computed: {
@ -372,7 +385,8 @@ export default {
nickname: user.nickname,
mobile: user.mobile,
email: user.email,
passWord: ''
passWord: '',
companyId: user.companyId
};
this.wmOpenId = user.wmOpenId || '';
this.oldPassWord = user.password;
@ -384,6 +398,11 @@ export default {
.catch(error => {
console.log(error, '请求个人信息失败');
});
getCompanyList().then(resp => {
this.companyList = resp.data;
}).catch((error) => {
console.log(error, '获取公司列表信息失败');
});
},
doClose() {
this.visible = false;
@ -394,6 +413,10 @@ export default {
this.editInfo.name = this.userInfo.name;
this.nameShow = !this.nameShow;
},
switcherCompany() {
this.editInfo.companyId = this.userInfo.companyId;
this.companyShow = !this.companyShow;
},
async saveName() {
if (this.editInfo.name) {
try {
@ -406,7 +429,16 @@ export default {
}
}
},
async saveCompany() {
try {
await getUserinfoName(this.info.id, this.editInfo.name);
this.userInfo.name = this.editInfo.name;
this.nameShow = !this.nameShow;
this.$store.commit('SET_NAME', this.editInfo.name);
} catch (error) {
console.log(error, '错误');
}
},
switcherNickname() {
this.editInfo.nickname = this.userInfo.nickname;
this.nickNameShow = !this.nickNameShow;
@ -426,7 +458,15 @@ export default {
}
}
},
handleCompany(companyId) {
let name = '';
this.companyList.forEach(item => {
if (item.id == companyId) {
name = item.name;
}
});
return name;
},
switcherMobile() {
// this.editInfo.mobile = this.userInfo.mobile;
this.mobileShow = !this.mobileShow;

View File

@ -2,8 +2,8 @@ export function getBaseUrl() {
let BASE_API;
if (process.env.NODE_ENV === 'development') {
// BASE_API = 'https://joylink.club/jlcloud';
// BASE_API = 'https://test.joylink.club/jlcloud';
BASE_API = 'http://192.168.8.107:9000'; // 袁琪
BASE_API = 'https://test.joylink.club/jlcloud';
// BASE_API = 'http://192.168.8.107:9000'; // 袁琪
// BASE_API = 'http://192.168.8.144:9000'; // 旭强
// BASE_API = 'http://192.168.3.175:9000'; // 张赛
// BASE_API = 'http://192.168.8.110:9000'; // 杜康

View File

@ -271,7 +271,9 @@ export default {
this.formModel.operationScore = row.operationScore;
this.formModel.scriptId = row.scriptId;
getScriptByIdNew(row.scriptId).then(res=>{
this.actionList = res.data.actionList;
this.actionList = res.data.actionList.filter(action=>{
return action.type != 'Exit_Conversation' && action.type != 'Accept_Conversation_Invitation';
});
getCompetitionPracticalSceneById(row.id).then(response=>{
const commandEvaluationRuleVOs = {};
if (response.data.commandEvaluationRuleVOs) {

View File

@ -1,6 +1,6 @@
<template>
<div>
<el-dialog v-dialogDrag title="场景列表" :visible.sync="dialogVisible" width="800px" center>
<el-dialog v-dialogDrag title="场景列表" :visible.sync="dialogVisible" width="900px" center>
<el-tabs v-model="activeName" type="card" style="height: 500px;">
<el-tab-pane label="主场景列表" name="first">
<el-table :data="mainSceneData" border :span-method="objectSpanMethod" stripe :cell-style="{padding: '8px 0'}">

View File

@ -58,12 +58,34 @@ export const operateEnum = {
// }
},
ControlConvertMenu:{
type:'控制模式',
CM_Apply_For_Station_Control:{
code:'stationCodes',
isList:true,
isDevice:true,
name:'车站列表',
function:getStationNameById
},
CM_Reply_Station_Control:{
code:'replyVOList',
name:'车站列表',
isList:true,
isDevice:true,
function:getStationResultById
},
CM_Reply_Center_Control:{
code:'replyVOList',
name:'车站列表',
isList:true,
isDevice:true,
function:getStationResultById
},
CM_Apply_For_Center_Control:{
code:'stationCodes',
isList:true,
isDevice:true,
name:'车站列表',
function:getStationNameById
}
},
Stand:{
@ -125,7 +147,7 @@ export const operateEnum = {
params:[
{
code:'open',
name:'',
name:'状态',
result:[
{data:true, name:'开', judge:'='},
{data:false, name:'关', judge:'='}
@ -133,13 +155,17 @@ export const operateEnum = {
},
{
code:'right',
name:'',
name:' 方向',
result:[
{data:true, name:'左门', judge:'='},
{data:false, name:'右门', judge:'='}
]
}
]
},
Driver_Drive_Mode_Change:{
code:'driveMode',
name:'模式为'
}
},
TrainWindow:{
@ -233,21 +259,19 @@ export function covertOperate(operationType, operationParamMap) {
}
}
function covertOperation(deviceType, operationParamMap, operationType) {
function covertDeviceName(deviceInfo, deviceType) {
let deviceName = '';
let paramName = '';
if (operateEnum[deviceType].code) {
const device = store.getters['map/getDeviceByCode'](operationParamMap[operateEnum[deviceType].code]);
const device = store.getters['map/getDeviceByCode'](deviceInfo);
if (device._type == 'StationStand') {
const station = store.getters['map/getDeviceByCode'](device.stationCode);
deviceName += '车站-' + station.name + '/';
deviceName += '车站-' + station.name + '/';
}
if (device._type == 'Section') {
if (device.parentCode && device.type == '02') {
const parentSection = store.getters['map/getDeviceByCode'](device.parentCode);
deviceName += '【' + operateEnum[deviceType].type + ' ' + parentSection.name + '-' + device.name + '】';
deviceName += operateEnum[deviceType].type + ' ' + parentSection.name + '-' + device.name;
} else {
deviceName += '【' + operateEnum[deviceType].type + device.name + '】';
deviceName += operateEnum[deviceType].type + device.name;
}
} else {
let deviceNameIn = '';
@ -256,8 +280,36 @@ function covertOperation(deviceType, operationParamMap, operationType) {
} else {
deviceNameIn = '(车组号:' + device.groupNumber + ')';
}
deviceName += '【' + operateEnum[deviceType].type + ' ' + deviceNameIn + '】';
deviceName += operateEnum[deviceType].type + ' ' + deviceNameIn;
}
return deviceName;
}
function covertOperation(deviceType, operationParamMap, operationType) {
let deviceName = '【';
let paramName = '';
if (operateEnum[deviceType].code) {
const deviceInfo = operationParamMap[operateEnum[deviceType].code];
if (deviceInfo) {
deviceName += covertDeviceName(deviceInfo, deviceType);
} else {
const deviceCode = operationParamMap[operateEnum[deviceType][operationType].code];
const device = store.getters['map/routeList'].find(route=>{ return route.code == deviceCode; });
deviceName += covertDeviceName(device.startSignalCode, deviceType);
}
// if (deviceInfo instanceof Array) {
// deviceInfo.forEach((each, index)=>{
// deviceName = +covertDeviceName(each, deviceType);
// if (index != deviceInfo.length - 1) {
// deviceName += '';
// }
// });
// } else {
// }
deviceName += '】';
} else if (operateEnum[deviceType].type) {
deviceName += operateEnum[deviceType].type + '】';
}
const paramInfo = operateEnum[deviceType][operationType];
if (paramInfo) {
@ -340,4 +392,10 @@ function getStationNameById(stationId) {
const station = store.getters['map/getDeviceByCode'](stationId);
return station.name;
}
function getStationResultById(stationResult) {
const station = store.getters['map/getDeviceByCode'](stationResult.stationCode);
let param = '不同意';
if (stationResult.agree) { param = '同意'; }
return station.name + ' ' + param;
}

View File

@ -418,7 +418,7 @@ export default {
map.stationStandList.forEach(stationStand => {
const section = this.$store.getters['map/getDeviceByCode'](stationStand.standTrackCode);
const list = [];
section.points.forEach(point => {
section && section.points.forEach(point => {
list.push(point.x);
});
if (stationStand.position.x > Math.max(...list) || stationStand.position.x < Math.min(...list)) {

View File

@ -140,7 +140,7 @@
<template v-for="(sectionUnit, j) in formModel[item.prop]">
<div :key="j" style="border: 1px solid #CCCCCC; border-radius: 5px;padding: 2px;padding-top: 10px;">
<el-form-item label="左端区段" :prop="'sectionUnitList[' + j + '].leftCode'" label-width="70px">
<el-select v-model="sectionUnit.leftCode" filterable placeholder="请选择" style="width: 115px;">
<el-select v-model="sectionUnit.leftCode" filterable placeholder="请选择" clearable style="width: 115px;">
<el-option
v-for="elem in item.options"
:key="elem.code"
@ -154,7 +154,7 @@
>{{ $t('map.activate') }}</el-button>
</el-form-item>
<el-form-item label="右端区段" :prop="'sectionUnitList[' + j + '].rightCode'" label-width="70px">
<el-select v-model="sectionUnit.rightCode" filterable placeholder="请选择" style="width: 115px;">
<el-select v-model="sectionUnit.rightCode" filterable placeholder="请选择" clearable style="width: 115px;">
<el-option
v-for="elem in item.options"
:key="elem.code"

View File

@ -239,6 +239,9 @@ export default {
this.activeName = 'first';
this.initEditModel();
this.editModel = deepAssign(this.editModel, selected);
if (!this.editModel.sectionUnitList) {
this.editModel.sectionUnitList = [{leftCode: '', rightCode: ''}];
}
} else if (selected && selected._type.toUpperCase() === 'Section'.toUpperCase() && this.field === 'leftSectionCode' && this.activeName === 'first') {
this.editModel.leftSectionCode = selected.code;
} else if (selected && selected._type.toUpperCase() === 'Section'.toUpperCase() && this.field === 'leftSectionCode' && this.activeName === 'second') {
@ -300,7 +303,29 @@ export default {
}
},
updateMapModel(data) {
const list = [];
let msg = '';
if (data.sectionUnitList && data.sectionUnitList.length) {
data.sectionUnitList.forEach(item => {
if (item.leftCode && item.rightCode) {
list.push(item);
} else if (item.leftCode && !item.rightCode) {
msg = '完善或清除填写过的额外单元信息';
} else if (!item.leftCode && item.rightCode) {
msg = '完善或清除填写过的额外单元信息';
}
});
}
if (msg) {
this.$message.error(msg);
} else {
if (list.length) {
data.sectionUnitList = list;
} else {
delete data.sectionUnitList;
}
this.$emit('updateMapModel', data);
}
},
deleteObj() {
this.$refs.dataform.deleteObj();

View File

@ -220,10 +220,10 @@ export default {
jsonData = that.planConvert.importData(wb.Sheets[index], jsonData);
}
if (that.$route.query.lineCode == '02' && !jsonData[0].downTrack && !jsonData[0].upTrack) {
that.loadingDig.close();
that.$message.warning(`运行图暂无默认上行折返轨或默认下行折返轨,请输入`);
} else {
// if (that.$route.query.lineCode == '02' && !jsonData[0].downTrack && !jsonData[0].upTrack) {
// that.loadingDig.close();
// that.$message.warning(``);
// } else {
importRunPlan({ mapId: that.$route.params.mapId || that.$route.query.mapId || '02', runPlanList: jsonData }).then(response => {
that.loadingDig.close();
if (response && response.code == 200) {
@ -235,7 +235,7 @@ export default {
that.loadingDig.close();
that.$message.warning(`${that.$t('tip.importRunGraphFailed')} ${error.message}`);
});
}
// }
} catch (error) {
that.loadingDig.close();
that.$message.warning(`${that.$t('tip.parseRunGraphFailed')} ${error.message}`);

View File

@ -2,7 +2,7 @@
<el-dialog v-dialogDrag :title="title" :visible.sync="dialogVisible" width="710px" :before-close="handleClose" center :close-on-click-modal="false">
<el-form ref="form" :model="formModel" label-width="100px" :inline="true">
<el-form-item v-if="!isProject" label="单位">
<el-select v-model="formModel.companyId" placeholder="请选择单位" clearable size="small" style="width: 400px;" :disabled="update">
<el-select v-model="formModel.companyId" placeholder="请选择单位" clearable size="small" style="width: 400px;" :disabled="update" @change="selectQuestion">
<el-option
v-for="item in companyList"
:key="item.id"
@ -45,7 +45,7 @@
<div style="width: 100%;text-align: center;">{{ `${totalNum}题,${totalScore}` }}</div>
<span slot="footer" class="dialog-footer">
<el-button type="primary" @click="doSave">{{ update? '修改' : $t('global.confirm') }}</el-button>
<el-button @click="dialogVisible = false">{{ $t('global.cancel') }}</el-button>
<el-button @click="handleClose">{{ $t('global.cancel') }}</el-button>
</span>
</el-dialog>
</template>
@ -80,11 +80,11 @@ export default {
answerPoint: 0
},
questionNum: {
select: 0,
judge: 0,
multi: 0,
fill:0,
answer: 0
select: 999,
judge: 999,
multi: 999,
fill:999,
answer: 999
},
update: false
};
@ -106,36 +106,46 @@ export default {
}
},
watch: {
'formModel.companyId' () {
this.selectQuestion();
}
},
methods: {
selectQuestion() {
selectQuestionTypeNum(this.formModel.companyId || '').then(resp => {
resp.data.forEach(item => {
this.questionNum[item.type] = item.num;
});
});
},
doShow(data) {
// console.log(this.companyList);
this.dialogVisible = true;
this.update = false;
this.questionNum = {
async selectQuestion() {
const questionNumTem = {
select: 0,
judge: 0,
multi: 0,
fill:0,
answer: 0
};
const resp = await selectQuestionTypeNum(this.formModel.companyId || '');
(resp.data || []).forEach(item => {
questionNumTem[item.type] = item.num;
});
this.questionNum = questionNumTem;
},
async doShow(data) {
this.dialogVisible = true;
this.update = false;
if (data) {
this.update = true;
this.formModel.id = data.id;
this.formModel.companyId = data.companyId;
const questionNumTem = {
select: 0,
judge: 0,
multi: 0,
fill:0,
answer: 0
};
const resp = await selectQuestionTypeNum(this.formModel.companyId || '');
(resp.data || []).forEach(item => {
questionNumTem[item.type] = item.num;
});
this.questionNum = questionNumTem;
data.rules.forEach(item => {
if (item.type === 'judge') {
this.formModel.judgeNum = item.num;
console.log(this.formModel.judgeNum, item.num);
this.formModel.judgePoint = item.point;
} else if (item.type === 'select') {
this.formModel.selectNum = item.num;
@ -145,13 +155,25 @@ export default {
this.formModel.multiPoint = item.point;
} else if (item.type === 'fill') {
this.formModel.fillNum = item.num;
this.formModel.fillNum = item.point;
this.formModel.fillPoint = item.point;
} else if (item.type === 'answer') {
this.formModel.answerNum = item.num;
this.formModel.answerPoint = item.point;
}
});
} else {
const questionNumTem = {
select: 0,
judge: 0,
multi: 0,
fill:0,
answer: 0
};
const resp = await selectQuestionTypeNum(this.formModel.companyId || '');
(resp.data || []).forEach(item => {
questionNumTem[item.type] = item.num;
});
this.questionNum = questionNumTem;
this.formModel = {
id: '',
companyId: '',
@ -170,6 +192,27 @@ export default {
},
handleClose() {
this.dialogVisible = false;
this.formModel = {
id: '',
companyId: '',
judgeNum: 0,
judgePoint: 0,
selectNum: 0,
selectPoint: 0,
multiNum: 0,
multiPoint: 0,
fillNum: 0,
fillPoint: 0,
answerNum: 0,
answerPoint: 0
};
this.questionNum = {
select: 999,
judge: 999,
multi: 999,
fill:999,
answer: 999
};
},
doSave() {
const params = {

View File

@ -13,7 +13,7 @@
>添加</el-button>
<el-button
size="mini"
type="danger"
type="success"
@click="handlerBack"
>返回</el-button>
</div>
@ -87,6 +87,7 @@
<template slot-scope="scope">
<el-button
size="mini"
type="primary"
@click="handleUpdate(scope.$index, scope.row)"
>编辑</el-button>
<el-button