福州列车显示调整&表单组件button增加loading

This commit is contained in:
fan 2020-06-16 18:36:18 +08:00
parent d0e862823a
commit 3b171130f9
7 changed files with 47 additions and 21 deletions

View File

@ -139,9 +139,10 @@
:key="idx" :key="idx"
size="mini" size="mini"
style="margin-top: 5px;" style="margin-top: 5px;"
:loading="scope.row['loading'+idx]"
:type="button.type ? button.type : 'primary'" :type="button.type ? button.type : 'primary'"
:disabled="isTableBtnDisabled(button, scope.$index, scope.row)" :disabled="isTableBtnDisabled(button, scope.$index, scope.row)"
@click="button.handleClick(scope.$index, scope.row) " @click="button.handleClick(scope.$index, scope.row, idx) "
>{{ getTableBtnName(button.name, scope.$index, scope.row) }}</el-button> >{{ getTableBtnName(button.name, scope.$index, scope.row) }}</el-button>
</template> </template>
</template> </template>

View File

@ -121,7 +121,7 @@ class SkinCode extends defaultStyle {
}; };
this[deviceType.Signal] = { this[deviceType.Signal] = {
distance: 10, // 设备距离区段的距离 distance: 3, // 设备距离区段的距离
post: { post: {
standardLength: 6, // 高柱长度 standardLength: 6, // 高柱长度
standardHeight: 6, // 灯柱高度 standardHeight: 6, // 灯柱高度
@ -544,12 +544,12 @@ class SkinCode extends defaultStyle {
changeTrainWidth: true, // 是否根据车身上车组号、服务号、车次号、目的地码显示情况改变列车长度 changeTrainWidth: true, // 是否根据车身上车组号、服务号、车次号、目的地码显示情况改变列车长度
specialTrainType: [ specialTrainType: [
{ {
type: '03', type: 'MANUAL',
serviceNumber: 'MM', serviceNumber: 'MM',
nameFormat: 'serviceNumber:groupNumber' nameFormat: 'serviceNumber:groupNumber'
}, },
{ {
type: '02', type: 'HEAD',
nameFormat: 'targetCode:groupNumber' nameFormat: 'targetCode:groupNumber'
} }
], // 特殊列车类型需设置显示格式 ], // 特殊列车类型需设置显示格式
@ -558,6 +558,14 @@ class SkinCode extends defaultStyle {
trainBodyFillColor: '#000000', // 列车车身填充颜色 trainBodyFillColor: '#000000', // 列车车身填充颜色
trainNameFormat: 'targetCode:serviceNumber:tripNumber'// 列车显示格式 trainNameFormat: 'targetCode:serviceNumber:tripNumber'// 列车显示格式
}, },
soonerOrLater: {
level: 3,
serviceNumber: true,
destinationCode: true, // 目的地号颜色改变
earlyColor: '#00FF00',
lateColor: '#800000',
normalColor: '#FFF'
},
directionArrow: { directionArrow: {
}, },
hsda: { hsda: {
@ -583,7 +591,9 @@ class SkinCode extends defaultStyle {
trainTargetNumber: { trainTargetNumber: {
groupNumberPrefix: '000', // 车组号前缀 groupNumberPrefix: '000', // 车组号前缀
defaultGroupNumber: 'EEE', // 默认车组号 defaultGroupNumber: 'EEE', // 默认车组号
trainTargetNumberOffset: {x: -1, y: 1}// 车组号偏移量 trainTargetNumberOffset: {x: -1, y: 1}, // 车组号偏移量
headTypeColor: '#FFFF00', // 头码车车组号显示颜色
manualTypeColor: '#FFFF00' // 人工车车组号显示颜色
}, },
trainHead: { trainHead: {
trainHeadRectHeight: 15, // 列车车头矩形高度 trainHeadRectHeight: 15, // 列车车头矩形高度

View File

@ -84,15 +84,11 @@ export default class Line2 extends Group {
setState(model) { setState(model) {
if (!this.isShowShape) return; if (!this.isShowShape) return;
/** 设置屏蔽门开关*/ /** 设置屏蔽门开关*/
// if (model.name == 'Psd44') {
// console.log(model, model.screenDoorOpenStatus, '1 为关门 0 为开门');
// }
model.screenDoorOpenStatus == 0 && this.openDoor(); /** 开门*/ model.screenDoorOpenStatus == 0 && this.openDoor(); /** 开门*/
model.screenDoorOpenStatus != 0 && this.closeDoor(); /** 关门*/ model.screenDoorOpenStatus != 0 && this.closeDoor(); /** 关门*/
model.alarmStatus && this.alarm(); /** 收到警报(西安二号线样式) */ model.alarmStatus && this.alarm(); /** 收到警报(西安二号线样式) */
model.emergencyDepart && this.emergencyDepart(); /** 紧急出发按钮激活(西安二号线样式) */ model.emergencyDepart && this.emergencyDepart(); /** 紧急出发按钮激活(西安二号线样式) */
// /** 设置屏蔽门状态*/ // /** 设置屏蔽门状态*/
// switch (model.screenDoorStatus) { // switch (model.screenDoorStatus) {
// case '01': // case '01':

View File

@ -12,14 +12,27 @@ class EMouse extends Group {
this.create(); this.create();
} }
create() { create() {
let destinationText = ''; let destinationText = LangStorage.getLang() == 'en' ? 'unknown' : '未知';
switch (this.device.model.destinationStatus) { if (this.device.style.Train.soonerOrLater && this.device.style.Train.soonerOrLater.level === 5) {
case '01': destinationText = LangStorage.getLang() == 'en' ? 'on time' : '准点'; break; if (this.device.model.dt > 120) {
case '02': destinationText = LangStorage.getLang() == 'en' ? 'early' : '早点'; break; destinationText = LangStorage.getLang() == 'en' ? 'early seriously' : '严重早点';
case '03': destinationText = LangStorage.getLang() == 'en' ? 'early seriously' : '严重早点'; break; } else if (this.device.mode.dt >= 15 && this.device.mode.dt <= 120) {
case '04': destinationText = LangStorage.getLang() == 'en' ? 'late' : '晚点'; break; destinationText = LangStorage.getLang() == 'en' ? 'early' : '早点';
case '05': destinationText = LangStorage.getLang() == 'en' ? 'late seriously ' : '严重晚点'; break; } else if (this.device.mode.dt >= -120 && this.device.mode.dt <= -15) {
default: destinationText = LangStorage.getLang() == 'en' ? 'unknown' : '未知'; break; destinationText = LangStorage.getLang() == 'en' ? 'late' : '晚点';
} else if (this.device.mode.dt < -120) {
destinationText = LangStorage.getLang() == 'en' ? 'late seriously ' : '严重晚点';
} else {
destinationText = LangStorage.getLang() == 'en' ? 'on time' : '准点';
}
} else if (this.device.style.Train.soonerOrLater && this.device.style.Train.soonerOrLater.level === 3) {
if (this.device.model.dt > 120) {
destinationText = LangStorage.getLang() == 'en' ? 'early' : '早点';
} else if (this.device.model.dt < -120) {
destinationText = LangStorage.getLang() == 'en' ? 'late' : '晚点';
} else {
destinationText = LangStorage.getLang() == 'en' ? 'on time' : '准点';
}
} }
let trainType = ''; let trainType = '';
switch (this.device.model.type) { switch (this.device.model.type) {

View File

@ -381,13 +381,16 @@ export default class TrainBody extends Group {
} else if (this.style.Train.soonerOrLater && this.style.Train.soonerOrLater.level === 3) { } else if (this.style.Train.soonerOrLater && this.style.Train.soonerOrLater.level === 3) {
if (dt > 120) { if (dt > 120) {
this.style.Train.soonerOrLater.serviceNumber && this.textTrainServer && this.textTrainServer.setStyle({textFill: this.style.Train.soonerOrLater.earlyColor}); this.style.Train.soonerOrLater.serviceNumber && this.textTrainServer && this.textTrainServer.setStyle({textFill: this.style.Train.soonerOrLater.earlyColor});
this.style.Train.soonerOrLater.destinationCode && this.textTrainNumber && this.textTrainNumber.setStyle({textFill: this.style.Train.soonerOrLater.earlyColor});
this.style.Train.soonerOrLater.trainBody && this.trainBodyBox && this.trainBodyBox.setColor({stroke: this.style.Train.soonerOrLater.earlyColor}); this.style.Train.soonerOrLater.trainBody && this.trainBodyBox && this.trainBodyBox.setColor({stroke: this.style.Train.soonerOrLater.earlyColor});
} else if (dt < -120) { } else if (dt < -120) {
this.style.Train.soonerOrLater.serviceNumber && this.textTrainServer && this.textTrainServer.setStyle({textFill: this.style.Train.soonerOrLater.lateColor}); this.style.Train.soonerOrLater.serviceNumber && this.textTrainServer && this.textTrainServer.setStyle({textFill: this.style.Train.soonerOrLater.lateColor});
this.style.Train.soonerOrLater.destinationCode && this.textTrainNumber && this.textTrainNumber.setStyle({textFill: this.style.Train.soonerOrLater.lateColor});
this.style.Train.soonerOrLater.trainBody && this.trainBodyBox && this.trainBodyBox.setColor({stroke: this.style.Train.soonerOrLater.lateColor}); this.style.Train.soonerOrLater.trainBody && this.trainBodyBox && this.trainBodyBox.setColor({stroke: this.style.Train.soonerOrLater.lateColor});
} else { } else {
this.style.Train.soonerOrLater.serviceNumber && this.textTrainServer && this.textTrainServer.setStyle({textFill: this.style.Train.soonerOrLater.normalColor}); this.style.Train.soonerOrLater.serviceNumber && this.textTrainServer && this.textTrainServer.setStyle({textFill: this.style.Train.soonerOrLater.normalColor});
this.style.Train.soonerOrLater.trainBody && this.trainBodyBox && this.trainBodyBox.setColor({stroke: this.style.Train.soonerOrLater.normalColor}); this.style.Train.soonerOrLater.trainBody && this.trainBodyBox && this.trainBodyBox.setColor({stroke: this.style.Train.soonerOrLater.normalColor});
this.style.Train.soonerOrLater.destinationCode && this.textTrainNumber && this.textTrainNumber.setStyle({textFill: this.style.Train.soonerOrLater.normalColor});
} }
} }
} }

View File

@ -2,11 +2,11 @@ export function getBaseUrl() {
let BASE_API; let BASE_API;
if (process.env.NODE_ENV === 'development') { if (process.env.NODE_ENV === 'development') {
// BASE_API = 'https://joylink.club/jlcloud'; // BASE_API = 'https://joylink.club/jlcloud';
BASE_API = 'https://test.joylink.club/jlcloud'; // BASE_API = 'https://test.joylink.club/jlcloud';
// BASE_API = 'http://192.168.3.5:9000'; // 袁琪 // BASE_API = 'http://192.168.3.5:9000'; // 袁琪
// BASE_API = 'http://192.168.3.6:9000'; // 旭强 // BASE_API = 'http://192.168.3.6:9000'; // 旭强
// BASE_API = 'http://192.168.3.41:9000'; // 张赛 // BASE_API = 'http://192.168.3.41:9000'; // 张赛
// BASE_API = 'http://192.168.3.82:9000'; // 杜康 BASE_API = 'http://192.168.3.82:9000'; // 杜康
// BASE_API = 'http://b29z135112.zicp.vip'; // BASE_API = 'http://b29z135112.zicp.vip';
// BASE_API = 'http://2925963m2a.zicp.vip'; // 杜康 // BASE_API = 'http://2925963m2a.zicp.vip'; // 杜康
// BASE_API = 'http://2i38984j47.qicp.vip'; // 张赛 // BASE_API = 'http://2i38984j47.qicp.vip'; // 张赛

View File

@ -256,12 +256,14 @@ export default {
}, },
// json // json
async handleExportMap(index, row) { async handleExportMap(index, row, idx) {
this.$confirm('您是否导出地图数据?', this.$t('global.tips'), { this.$confirm('您是否导出地图数据?', this.$t('global.tips'), {
confirmButtonText: this.$t('global.confirm'), confirmButtonText: this.$t('global.confirm'),
cancelButtonText: this.$t('global.cancel'), cancelButtonText: this.$t('global.cancel'),
type: 'warning' type: 'warning'
}).then(async () => { }).then(async () => {
this.$set(row, 'loading' + idx, true);
console.log(row);
const res = await getPublishMapExport(row.id); const res = await getPublishMapExport(row.id);
const resultData = res.data; const resultData = res.data;
if (resultData === false) { if (resultData === false) {
@ -283,7 +285,8 @@ export default {
el.download = `${resultData.name}.json`; el.download = `${resultData.name}.json`;
el.click(); el.click();
urlObject.revokeObjectURL(url); urlObject.revokeObjectURL(url);
}).catch(() => { }); this.$set(row, 'loading' + idx, false);
}).catch(() => { this.$set(row, 'loading' + idx, false); });
}, },
// exls // exls