This commit is contained in:
zyy 2020-10-28 18:35:08 +08:00
commit 4d283fab04
23 changed files with 257 additions and 79 deletions

View File

@ -179,3 +179,19 @@ export function justTripTurnBack(planId, tripNo, data) {
data
});
}
/** 开始编辑*/
export function startRpEdit(planId) {
return request({
url: `/api/rpTools/${planId}/edit`,
method: 'put'
})
}
/** 开始编辑*/
export function endRpEdit(planId) {
return request({
url: `/api/rpTools/${planId}/endEdit`,
method: 'put'
})
}

View File

@ -126,7 +126,7 @@ class ETextName extends Group {
fontSize: styleModel.fontSize,
fontFamily: styleModel.fontFamily || this.model.style.fontFamily,
text: styleName,
textFill: model.approach ? styleModel.approachColor : styleModel.fontColor,
textFill: model.approach && this.model.type === 'name' ? styleModel.approachColor : styleModel.fontColor,
textAlign: styleModel.textAlign,
textPosition: styleModel.textPosition || 'inside',
textVerticalAlign: styleModel.textVerticalAlign || null

View File

@ -371,6 +371,10 @@ class Signal extends Group {
} else {
this.lamps[0].setColor(this.style.Signal.lamp.redColor);
}
} else if (this.count == 3) {
this.lamps[0] && this.lamps[0].setColor(this.style.Signal.lamp.redColor);
this.lamps[1] && this.lamps[1].setColor(this.style.backgroundColor);
this.lamps[2] && this.lamps[2].setColor(this.style.backgroundColor);
}
}
}

View File

@ -43,8 +43,8 @@ export default {
planData.areaList &&
planData.areaList.length) {
planData.areaList.forEach(model => {
model.startTime = toTimeStamp(model.startTime);
model.endTime = toTimeStamp(model.endTime);
model.startTime = typeof model.startTime == 'string'? toTimeStamp(model.startTime): model.startTime;
model.endTime = typeof model.endTime == 'string'? toTimeStamp(model.endTime): model.endTime;
graphs.push(createRectArea(this.calcAreaArgsByModel(chart, model)));
})
}

View File

@ -58,9 +58,11 @@ import NoticeInfo from '@/jmapNew/theme/components/menus/childDialog/noticeInfo'
import CMD from '@/scripts/cmdPlugin/CommandEnum';
import { OperationEvent } from '@/scripts/cmdPlugin/OperationHandler';
import { TrainingMode } from '@/scripts/ConstDic';
import AlarmTable from './menuDialog/alarmTable';
export default {
components: {
NoticeInfo
NoticeInfo,
AlarmTable
},
props: {
selected: {

View File

@ -1,44 +0,0 @@
<template>
<el-dialog v-dialogDrag class="haerbin-01__systerm manage-user" :title="title" :visible.sync="show" width="420px" :z-index="2000" :modal="false" :close-on-click-modal="false">
<div>
<el-table
:data="tableData"
style="width: 100%"
>
<el-table-column
prop="time"
label="日期/时间"
width="180"
/>
<el-table-column
prop="name"
label="等级"
width="180"
/>
<el-table-column
prop="address"
label="设备类型"
/>
<el-table-column
prop="address"
label="设备编号"
/>
</el-table>
</div>
</el-dialog>
</template>
<script>
export default {
name: 'Alarm',
data() {
return {
tableData: []
};
}
};
</script>
<style scoped>
</style>

View File

@ -0,0 +1,61 @@
<template>
<el-dialog v-dialogDrag class="haerbin-01__systerm manage-user" :title="title" :visible.sync="show" width="420px" :z-index="2000" :modal="false" :close-on-click-modal="false">
<div>
<el-table
:data="tableData"
style="width: 100%"
>
<el-table-column prop="time" label="日期/时间" />
<el-table-column prop="level" label="等级" />
<el-table-column prop="address" label="设备类型" />
<el-table-column prop="address" label="设备编号" />
<el-table-column prop="address" label="故障号" />
<el-table-column prop="address" label="故障描述" />
<el-table-column prop="address" label="已恢复" />
<el-table-column prop="address" label="恢复时间" />
<el-table-column prop="address" label="已确认" />
<el-table-column prop="address" label="确认人" />
<el-table-column prop="address" label="确认时间" />
<el-table-column prop="address" label="备注信息" />
<el-table-column />
</el-table>
<el-pagination
:current-page="currentPage"
:page-sizes="20"
layout="total, prev, pager, next, jumper"
:total="totalNum"
@size-change="handleSizeChange"
@current-change="handleCurrentChange"
/>
</div>
</el-dialog>
</template>
<script>
export default {
name: 'Alarm',
data() {
return {
tableData: [],
currentPage: 0,
totalNum: 0,
show: false
};
},
methods:{
doShow() {
this.show = true;
},
handleSizeChange() {
},
handleCurrentChange() {
}
}
};
</script>
<style scoped>
</style>

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.3.5:9000'; // 袁琪
// BASE_API = 'http://192.168.8.144:9000'; // 旭强
// BASE_API = 'http://192.168.3.175:9000'; // 张赛

View File

@ -16,7 +16,7 @@ export function now() {
return year + '-' + month + '-' + day + ' ' + hour + ':' + minute + ':' + second;
}
export function timeFormat(usedTime) {
export function timeFormat(usedTime=0) {
let hour = 0; let minute = 0; let second = 0; let sumTime = usedTime;
if (sumTime) {
if (sumTime >= 3600) {
@ -37,8 +37,8 @@ export function timeFormat(usedTime) {
// 时分秒转为时间戳
export function toTimeStamp(time) {
let s = 0;
export function toTimeStamp(time='') {
let s = 0;
const hour = time.split(':')[0];
const min = time.split(':')[1];
const sec = time.split(':')[2];

View File

@ -5,7 +5,7 @@
<div :class="chatContent.memberId == myMemberId?'rightUser':'leftUser'">
<div class="userHeader">
<div v-if="!chatContent.self" class="userName">{{ covertName(chatContent.memberId) }}</div>
<div :class="chatContent.memberId == myMemberId?'userChatTime textRight':'userChatTime'">{{ chatContent.time }}</div>
<div :class="chatContent.memberId == myMemberId?'userChatTime textRight':'userChatTime'">{{ covertTime(chatContent.time) }}</div>
</div>
<div class="userBubble" @click="playAudio(baseUrl+chatContent.src)">
<div class="userMessage">
@ -23,6 +23,7 @@
<script>
import yuyin from '@/assets/yuyin.png';
import {overConversationMessage} from '@/api/chat';
// this.time = `${prefixIntrger(date.getHours(), 2)}:${prefixIntrger(date.getMinutes(), 2)}${prefixIntrger(date.getSeconds(), 2)}`;
export default {
props:{
messageList:{
@ -153,6 +154,16 @@ export default {
}
return name;
},
covertTime(time) {
const date = new Date(time);
let hour = date.getHours();
let minute = date.getMinutes();
let second = date.getSeconds();
hour = hour > 9 ? hour : '0' + hour;
minute = minute > 9 ? minute : '0' + minute;
second = second > 9 ? second : '0' + second;
return hour + ':' + minute + ':' + second;
},
playAudio(audioUrl) {
if (!this.isPlay) {
document.querySelector('#audioPlay').src = audioUrl;

View File

@ -133,6 +133,39 @@
</div>
</div>
</template>
<template v-if="checkFieldType(item, 'sectionUnit')">
<div :key="item.prop" class="coordinate">
<span class="title" :style="{width: item.width}">{{ item.label }}</span>
<div class="point-section">
<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="请选择">
<el-option
v-for="elem in item.options"
:key="elem.code"
:label="elem.name"
:value="elem.code"
/>
</el-select>
</el-form-item>
<el-form-item label="右端区段" :prop="'sectionUnitList[' + j + '].leftCode'" label-width="70px">
<el-select v-model="sectionUnit.rightCode" filterable placeholder="请选择">
<el-option
v-for="elem in item.options"
:key="elem.code"
:label="elem.name"
:value="elem.code"
/>
</el-select>
<el-button type="success" icon="el-icon-plus" circle @click="item.addSectionUnit(j)" />
<el-button v-if="j" type="danger" icon="el-icon-delete" circle @click="item.delSectionUnit(j)" />
</el-form-item>
</div>
</template>
</div>
</div>
</template>
<!-- 多个坐标点绘制 -->
<template v-if="checkFieldType(item, 'points')">
<div v-if="!item.isHidden" :key="item.prop" class="coordinate">

View File

@ -70,7 +70,11 @@ export default {
leftSectionCode: '',
leftOffset: 0,
rightSectionCode: '',
rightOffset: 0
rightOffset: 0,
sectionUnitList: [{
leftCode: '',
rightCode: ''
}]
},
addModel: {
width: 1,
@ -82,7 +86,8 @@ export default {
leftSectionCode: '',
leftOffset: 0,
rightSectionCode: '',
rightOffset: 0
rightOffset: 0,
sectionUnitList: []
},
rules: {
code: [
@ -131,7 +136,8 @@ export default {
{ prop: 'leftSectionCode', label: '左端点区段', type: 'selectHover', optionLabel: 'name', optionValue: 'code', options: this.sectionList, hover: this.hover, buttonType: 'leftSectionCode', buttonShowType: this.isButtonTypeLeft},
{ prop: 'leftOffset', label: '左端点区段偏移', type: 'number', min: 0},
{ prop: 'rightSectionCode', label: '右端点区段', type: 'selectHover', optionLabel: 'name', optionValue: 'code', options: this.sectionList, hover: this.hover, buttonType: 'rightSectionCode', buttonShowType: this.isButtonTypeRight},
{ prop: 'rightOffset', label: '右端点区段偏移', type: 'number', min: 0}
{ prop: 'rightOffset', label: '右端点区段偏移', type: 'number', min: 0},
{ prop: 'sectionUnitList', label: '额外的区段单元', type: 'sectionUnit', options: this.sectionList, addSectionUnit: this.addSectionUnit, delSectionUnit: this.delSectionUnit }
]
},
map: {
@ -179,6 +185,12 @@ export default {
this.$emit('deviceSelect', '');
}
},
addSectionUnit(i) {
this.editModel.sectionUnitList.splice(i, 0, {leftCode: '', rightCode: ''});
},
delSectionUnit(i) {
this.editModel.sectionUnitList.splice(i, 1);
},
batchSetPosition() {
const models = [];
this.powerLineList.forEach(item => {
@ -289,7 +301,11 @@ export default {
leftSectionCode: '',
leftOffset: 0,
rightSectionCode: '',
rightOffset: 0
rightOffset: 0,
sectionUnitList: [{
leftCode: '',
rightCode: ''
}]
};
}
}

View File

@ -129,7 +129,7 @@ export default {
height: calc(100% - 10px);
/deep/ {
.el-card__body {
height: 100%;
height: calc(100% - 50px);
overflow-y: auto;
&::-webkit-scrollbar {

View File

@ -1,6 +1,6 @@
<template>
<drawer :visible.sync="drawer" direction="rtl" :width="600" @before-close="e => drawer=false">
<template slot="title">修改表单</template>
<template slot="title">修改站信息</template>
<div class="container" v-if="model">
<el-form class="form" :model="model" :rules="rules" ref="form" label-width="100px" >
<el-form-item label="车站名称" prop="name">

View File

@ -63,7 +63,7 @@ export default {
rules: {
time: [
{
type: 'number', min: 0, message: 'Please select the arrival time.', trigger: 'blur'
required: true, type: 'number', min: 0, message: 'Please select the arrival time.', trigger: 'blur'
},
{
validator: validator, trigger: 'blur'

View File

@ -46,7 +46,7 @@ export default {
rules: {
time: [
{
type: 'number', min: 0, max: 12*3600, message: 'Please select the stop time.', trigger: 'blur'
required: true, type: 'number', min: 0, max: 12*3600, message: 'Please select the stop time.', trigger: 'blur'
},
{
validator: validator, trigger: 'blur'

View File

@ -38,7 +38,7 @@ export default {
rules: {
time: [
{
type: 'number', min: 0, message: 'Please select turn back time.', trigger: 'blur'
required: true, type: 'number', min: 0, message: 'Please select turn back time.', trigger: 'blur'
}
],
}

View File

@ -1,6 +1,6 @@
<template>
<el-dialog v-dialogDrag append-to-body title="Modification of train diagram parameters" :visible.sync="dialogShow" width="30%" :close-on-click-modal="false" :before-close="doClose">
<el-form ref="form" label-width="160px" :model="formModel" :rules="rules">
<el-form ref="form" label-width="200px" :model="formModel" :rules="rules">
<el-form-item label="Average speed" prop="averageSpeed">
<el-input-number v-model="formModel.averageSpeed" controls-position="right" :min="20" :max="60" />
<span style="padding-left: 10px">km/h</span>
@ -57,32 +57,32 @@ export default {
rules: {
averageSpeed: [
{
type: 'number', min: 20, max: 60, message: 'Please select the stop time.', trigger: 'blur'
required: true, type: 'number', min: 20, max: 60, message: 'Please select the stop time.', trigger: 'blur'
}
],
maxSpeed: [
{
type: 'number', min: 50, max: 80, message: 'Please select the stop time.', trigger: 'blur'
required: true, type: 'number', min: 50, max: 80, message: 'Please select the stop time.', trigger: 'blur'
}
],
stopTime: [
{
type: 'number', min: 10, max: 120, message: 'Please select the stop time.', trigger: 'blur'
required: true, type: 'number', min: 10, max: 120, message: 'Please select the stop time.', trigger: 'blur'
}
],
minStopTime: [
{
type: 'number', min: 10, max: 30, message: 'Please select the stop time.', trigger: 'blur'
required: true, type: 'number', min: 10, max: 30, message: 'Please select the stop time.', trigger: 'blur'
}
],
minIntervalTime: [
{
type: 'number', min: 30, max: 360, message: 'Please select the stop time.', trigger: 'blur'
required: true, type: 'number', min: 30, max: 360, message: 'Please select the stop time.', trigger: 'blur'
}
],
turnBackTime: [
{
type: 'number', min: 60, max: 180, message: 'Please select the stop time.', trigger: 'blur'
required: true, type: 'number', min: 60, max: 180, message: 'Please select the stop time.', trigger: 'blur'
}
]
}

View File

@ -73,6 +73,7 @@ import * as utils from '../utils.js';
import { timeFormat } from '@/utils/date';
import { mapGetters } from 'vuex';
import {
startRpEdit, endRpEdit,
listLines, listStations,
listRps, createRp, deleteRp,
getRpTools, clearRpPlan, addRpTrip, delRpTrip,
@ -102,6 +103,7 @@ export default {
planData: {},
selected: null,
target: null,
isModify: false,
textareaModel: {
id: 0,
show: false,
@ -123,7 +125,7 @@ export default {
},
computed: {
disabled() {
return !this.planId;
return !this.planId || !this.isModify;
},
show() {
return this.textareaModel.show;
@ -157,14 +159,35 @@ export default {
height() {
this.setPosition();
},
$route() {
this.loadPlanData();
$route: function (to, from) {
const fromPlanId = from.query.planId;
if (fromPlanId) {
if(utils.getModifyState(fromPlanId)) {
endRpEdit(fromPlanId).then(resp => {
utils.delModifyState(fromPlanId);
this.loadPlanData();
})
} else {
this.loadPlanData();
}
} else {
this.loadPlanData();
}
}
},
created() {
this.planUtil = this.$theme.loadPlanConvert(this.lineCode);
},
mounted() {
window.onbeforeunload = e => {
if(this.planId &&
utils.getModifyState(this.planId)) {
endRpEdit(this.planId).then(resp => {
utils.setModifyState(this.planId, resp.data);
})
}
};
this.setPosition();
this.loadPlanData();
},
@ -177,6 +200,7 @@ export default {
return {
id: it.id,
isPlan: true,
isModify: it.editable,
name: it.mapName,
lineId: it.mapId,
}
@ -200,6 +224,31 @@ export default {
this.$refs.schedule.loadChartPage(stations);
if (this.planId) {
if(utils.getModifyState(this.planId)) {
endRpEdit(this.planId).then(resp => {
utils.setModifyState(this.planId, resp.data);
startRpEdit(this.planId).then(resp => {
this.isModify = resp.data;
utils.setModifyState(this.planId, resp.data);
if (this.isModify) {
listRps().then(resp => {
this.planList = this.buildPlanList(resp.data);
});
}
});
})
} else {
startRpEdit(this.planId).then(resp => {
this.isModify = resp.data;
utils.setModifyState(this.planId, resp.data);
if (this.isModify) {
listRps().then(resp => {
this.planList = this.buildPlanList(resp.data);
});
}
});
}
getRpTools(this.planId).then(rest => {
const planData = this.planData = rest.data;
this.$store.commit('rpTools/setPlanData', planData);

View File

@ -7,12 +7,15 @@
<span><i :class="data.isPlan? 'el-icon-document': 'el-icon-folder'"/>&ensp;{{data.name}}</span>
<el-button
v-if="!data.isPlan"
type="text"
style="color:red"
class="btn-text"
type="danger"
size="mini"
@click.stop="onDelete(data)">
Delete
<i class="el-icon-delete" />
</el-button>
<span v-else>
<el-link :underline="false" :type="data.isModify?'warning':'info'"><code>{{data.isModify? 'edit': 'read'}}</code></el-link>
</span>
</span>
</template>
</el-tree>
@ -68,4 +71,9 @@ export default {
justify-content: space-between;
width: 100%;
}
.btn-text {
color: #fff;
padding: 5px 10px;
}
</style>

View File

@ -42,9 +42,8 @@ export default {
const xIndex = pointInGrid[0];
const yIndex = pointInGrid[1];
const option = this.myChart.getOption();
const minY = option.yAxis[0].min;
const xVal = option.xAxis[0].data[xIndex];
const yObj = this.planUtil.getStationByCoordinateY(this.stations, yIndex-minY);
const yObj = this.planUtil.getStationByCoordinateY(this.stations, yIndex);
if (yObj) {
cb({yObj, xVal, pointInPixel, pointInGrid, e});
}

View File

@ -163,7 +163,9 @@ export default {
shadowColor: 'rgba(0, 0, 0, 0.6)',
shadowOffsetX: 2,
shadowOffsetY: 2
},
},
rangeMode: 'percent',
labelFormatter: this.dataZoomFormat,
bottom: '20px'
}
]
@ -197,6 +199,9 @@ export default {
yAxisLabelFormat(value, index) {
return '';
},
dataZoomFormat(value) {
return timeFormat(value);
},
axisTooltip(param) {
let data = '';

View File

@ -111,3 +111,21 @@ var binary = atob(dataURI.split(',')[1]), array = [];
for(var i = 0; i < binary.length; i++) array.push(binary.charCodeAt(i));
return new Blob([new Uint8Array(array)], {type: dataTYPE});
}
const ModifyFlag = 'AUS-modify-flag'
export function getModifyState(planId) {
const state = JSON.parse(localStorage.getItem(ModifyFlag)||`{ }`);
return state[planId];
}
export function setModifyState(planId, bool) {
const state = JSON.parse(localStorage.getItem(ModifyFlag)||`{ }`);
bool
? state[planId] = bool
: delete state[planId]
localStorage.setItem(ModifyFlag, JSON.stringify(state));
}
export function delModifyState(planId) {
const state = JSON.parse(localStorage.getItem(ModifyFlag)||`{ }`);
delete state[planId];
localStorage.setItem(ModifyFlag, JSON.stringify(state));
}