Merge branch 'dev' into test

This commit is contained in:
sunzhenyu 2019-09-18 13:23:05 +08:00
commit 18418cadde
17 changed files with 161 additions and 64 deletions

View File

@ -107,13 +107,19 @@ export default {
},
computed: {
width() {
let fontNum = 0;
let fontNum = 0;
let newLabel="";
this.menu.forEach(elem => {
if (elem.label && elem.label.length > fontNum) {
fontNum = elem.label.length;
newLabel=elem.label.replace(/[^\u0000-\u00ff]/g,"aa");
if (elem.label && newLabel.length > fontNum) {
fontNum=newLabel.length;
// fontNum = elem.label.length;
}
});
var width = fontNum * this.defaultFontSize + 40 + 'px';
});
var width = fontNum/2 * this.defaultFontSize + 60 + 'px';
// if(this.$t('global.lanuage')==='en'){
// width = fontNum/2 * this.defaultFontSize + 40 + 'px';
// }
return width;
}
},
@ -187,6 +193,7 @@ export default {
}
},
calculateSubWidth(item) {
// debugger;
const children = item.children;
let width = 0;
let fontNum = 0;
@ -197,7 +204,7 @@ export default {
});
width = fontNum * this.defaultFontSize + 20 + 'px';
return width;
},
},
openLoadFile(item) {
const obj = this.$refs[item.label][0];
if (obj.files) {

View File

@ -1,4 +1,5 @@
export default {
// lanuage: 'en',
offset: 'Offset',
zoom: 'Zoom',
tips: 'Tips',

View File

@ -2,6 +2,7 @@ export default {
drawData: 'The drawing data',
mapData: 'Map data',
pleaseSelect: 'please choose',
pleaseEnter: 'please input',
sketchMap: 'Draft map list',
newConstruction: 'create',
importMap: 'Import the map',
@ -47,11 +48,11 @@ export default {
routeRouteTurnoutData: 'Route turnout',
trainWindowPoints: 'Train window points:',
createSection: '一键生成区段',
createSwitch: '一键生成道岔',
clearHint: '清除提示',
batchOperation: '批量操作',
breakUpNumber: '拆分数量',
createSection: 'One-click generation section',
createSwitch: 'One-click generation turnout',
clearHint: 'Clear hint',
batchOperation: 'Batch operation',
breakUpNumber: 'Split quantity',
// physicalSegmentName: '物理区段:',
save: 'save',
@ -175,14 +176,14 @@ export default {
code: 'code:',
imageName: 'Image name:',
imageWidth: 'Image width:',
imageHeight: 'Picture height:',
imageHeight: 'Image height:',
imagePoint: 'Image coordinates:',
imageZindex: 'Image level:',
imageSelect: 'Pictures to choose:',
imageSelect: 'Image to choose:',
rotateAngle: 'Rotation Angle:',
areaSolution: 'Area so the solution',
alwaysSolution: 'People always solution',
areaSolution: 'Zone failure unlock',
alwaysSolution: 'Total manual unlock',
pleaseSelectMap: 'Please select map',
selectCounterType: 'Select the counter type',
@ -203,8 +204,9 @@ export default {
font: 'font:',
color: 'color:',
upside: 'In the upper',
hypomere: 'The period of',
upside: 'Upper section',
hypomere: 'Bottom section',
returnByGraph: 'Return by graph',
linkType: 'The Link type',
linkCode: 'The Link code:',
@ -535,5 +537,9 @@ export default {
switchBCodeNum: 'Switch ID 2:',
wellDelTrianModel: 'Deleting the train model will delete the associated class cars together, please confirm whether to continue?',
clear: 'Clear'
clear: 'Clear',
horizontal: 'Horizontal',
vertical: 'Vertical',
piece: 'piece'
};

View File

@ -114,6 +114,10 @@ export default {
createRoomFailedHint: 'Each user can only create one comprehensive drill room. Do you want to enter the room?',
noPermissionHint: 'You do not have permission, please go to purchase products',
trainModelNameRepeat: 'Train model data duplication',
totalAmount: 'Failed to get the total amount',
wxCodePayFailde: 'Failed to get WeChat Pay payment QR code',
aliCodePayFailde: 'Failed to get Alipay payment QR code',
cancelOrderFailed: 'Cancel order failed',
coursePublishSuccessful: 'Successful course release',
coursePublishFailed: 'Course launch failed',

View File

@ -1,4 +1,5 @@
export default {
// lanuage: 'zh',
offset: '偏 移',
zoom: '缩 放',
tips: '提 示',

View File

@ -190,6 +190,7 @@ export default {
upside: '上段',
hypomere: '下段',
returnByGraph: '按图折返',
linkType: 'Link类型',
linkCode: 'Link编码:',
@ -530,6 +531,10 @@ export default {
switchBCodeNum: '道岔ID 2:',
wellDelTrianModel: '删除车模型会将关联的类车一起删除,请确认是否继续?',
clear: '清空'
clear: '清空',
horizontal: '水平',
vertical: '垂直',
piece: 'piece'
};

View File

@ -104,16 +104,18 @@ export function JLmapDriving(dom, data, skinCode) {
camera.updateProjectionMatrix();
let listener = new THREE.AudioListener();
listener.position.y = -2;
camera.add( listener );
let sound = new THREE.Audio( listener );
sound.soundswitch = true;
// load a sound and set it as the Audio object's buffer
let audioLoader = new THREE.AudioLoader();
audioLoader.load( '../../static/audio/trainmove.ogg', function( buffer ) {
sound.setBuffer( buffer );
sound.setLoop( true );
sound.setVolume( 0.8 );
sound.setVolume( 0 );
sound.volswitch = false;
sound.play();
});
@ -133,6 +135,7 @@ export function JLmapDriving(dom, data, skinCode) {
var timer = setInterval(function() {
if(mapdata.trainlisttest.group){
if(mapdata.trainlisttest.group.children[0]){
updatemmi.updatedrivingcode(mapdata.trainlisttest.group.children[0].name);
scope.Subscribe.initdrivercode(mapdata.trainlisttest.group.children[0].name);
clearInterval(timer);
@ -249,6 +252,7 @@ export function JLmapDriving(dom, data, skinCode) {
mixers = null;
scope.actions = null;
scope.Subscribe = null;
sound.stop();
// console.log(scope);
// scope = null;
};
@ -317,6 +321,7 @@ export function JLmapDriving(dom, data, skinCode) {
// 窗口自适应
window.addEventListener( 'resize', onWindowResized, false );
sound.volswitch = true;
// controls.update();
};
@ -326,6 +331,9 @@ export function JLmapDriving(dom, data, skinCode) {
document.getElementById('jlsimulation').removeEventListener( 'mousedown', onselect, false );
// 窗口自适应
window.removeEventListener( 'resize', onWindowResized, false );
sound.volswitch = false;
sound.setVolume( 0 );
};
this.updatecamera = function(mesh, type) {

View File

@ -106,6 +106,7 @@ export function Jl3dDriving(updatemmi,sound) {
break;
case 'Simulation_Driver_Change':
drivingcode = data.body.code;
sound.volswitch = true;
updatemmi.updatedrivingcode( data.body.code);
break;
case 'SJL3D_TrainStatus':
@ -165,18 +166,7 @@ export function Jl3dDriving(updatemmi,sound) {
// if (data.body[tl].v >0) {
// updatemmi.updatenowspeed(data.body[tl].v);
// } else {
if(trainlisttest.list[code].speeds == 0){
if(sound.soundswitch == true){
sound.stop();
sound.soundswitch = false;
}
}else{
if(sound.soundswitch == false){
sound.play();
sound.soundswitch = true;
}
}
sound.setVolume( data.body[tl].v/100 );
updatemmi.updatenowspeed(Math.abs(data.body[tl].v));
// }
}
@ -185,6 +175,10 @@ export function Jl3dDriving(updatemmi,sound) {
if (code == drivingcode) {
if(sound.volswitch == true){
sound.setVolume( data.body[tl].v/100 );
}
if (data.body[tl].atpv) {
updatemmi.updateatpspeed(data.body[tl].atpv);
} else {

View File

@ -0,0 +1,45 @@
// 转换属性名称
export const translateSame = {
base: {
sheetName: '基本信息',
columns: [
{ key: 'id', tHeader: '地图id', formatter: (val) => { return val || ''; } },
{ key: 'name', tHeader: '地图名称', formatter: (val) => { return val || ''; } },
{ key: 'authorId', tHeader: '作者id', formatter: (val) => { return val || ''; } },
{ key: 'cityCode', tHeader: '城市code', formatter: (val) => { return val || ''; } },
{ key: 'skinCode', tHeader: '皮肤类型', formatter: (val) => { return val || ''; } },
{ key: 'updateTime', tHeader: '更新时间', formatter: (val) => { return val || ''; } },
{ key: 'version', tHeader: '版本类型', formatter: (val) => { return val || ''; } }
]
},
sectionList: {
sheetName: '区段',
columns: [
{ key: 'name', tHeader: '区段名称', formatter: (val) => { return val || ''; } },
{ key: 'code', tHeader: '编号', formatter: (val) => { return val || ''; } }
]
},
signalList: {
sheetName: '信号机',
columns: [
{ key: 'name', tHeader: '信号机名称', formatter: (val) => { return val || ''; } },
{ key: 'code', tHeader: '编号', formatter: (val) => { return val || ''; } }
]
},
stationStandList: {
sheetName: '站台',
columns: [
{ key: 'name', tHeader: '站台名称', formatter: (val) => { return val || ''; } },
{ key: 'code', tHeader: '编号', formatter: (val) => { return val || ''; } },
{ key: 'direction', tHeader: '行驶方向', formatter: (val) => { return val || ''; } }
]
},
switchList: {
sheetName: '道岔',
columns: [
{ key: 'name', tHeader: '道岔名称', formatter: (val) => { return val || ''; } },
{ key: 'code', tHeader: '编号', formatter: (val) => { return val || ''; } }
]
}
};

View File

@ -3,6 +3,7 @@ require('script-loader!file-saver');
require('@/utils/Blob');
import XLSX from 'xlsx';
import { translate } from '@/scripts/translate';
import { translateSame } from '@/scripts/translateSame';
function generateArray(table) {
@ -276,13 +277,29 @@ export function export_json_to_excel(th, jsonData, defaultTitle) {
saveAs(new Blob([s2ab(wbout)], { type: "application/octet-stream" }), title + ".xlsx")
}
export function export_json_excel(jsonData, defaultTitle) {
// 转换数据格式
function handelData(translate, key) {
let tHeader = [];
let tHeaderF = [];
if (translate[key]) {
translate[key].columns.forEach(item => {
tHeader.push(item.tHeader);
tHeaderF.push(item.key);
});
}
let filterVal = {
tHeader: tHeader,
tHeaderF: tHeaderF,
};
return filterVal;
}
export function export_json_excel(jsonData, defaultTitle) {
let data = jsonData;
let wb = new Workbook();
for (let index in data) {
let filterVal = handelData(index);
let filterVal = handelData(translate, index);
if (filterVal.tHeader.length) {
let dataDetail = formatJson(filterVal.tHeaderF, data[index]);
dataDetail.unshift(filterVal.tHeader); // 设置表头的
@ -299,19 +316,26 @@ export function export_json_excel(jsonData, defaultTitle) {
var title = defaultTitle || '列表'
saveAs(new Blob([s2ab(wbout)], { type: "application/octet-stream" }), title + ".xlsx")
}
// 转换数据格式
function handelData(key) {
let tHeader = [];
let tHeaderF = [];
if (translate[key]) {
translate[key].columns.forEach(item => {
tHeader.push(item.tHeader);
tHeaderF.push(item.key);
});
export function export_json_excel_same(jsonData, defaultTitle) {
let data = jsonData;
let wb = new Workbook();
for (let index in data) {
let filterVal = handelData(translateSame, index);
if (filterVal.tHeader.length) {
let dataDetail = formatJson(filterVal.tHeaderF, data[index]);
dataDetail.unshift(filterVal.tHeader); // 设置表头的
let ws = sheet_from_array_of_arrays(dataDetail);
/* add worksheet to workbook */
let title = translate[index].sheetName || index;
wb.SheetNames.push(title);
wb.Sheets[`${title}`] = ws;
}
}
let filterVal = {
tHeader: tHeader,
tHeaderF: tHeaderF,
};
return filterVal;
let wbout = XLSX.write(wb, { bookType: 'xlsx', bookSST: false, type: 'binary' });
var title = defaultTitle || '列表'
saveAs(new Blob([s2ab(wbout)], { type: "application/octet-stream" }), title + ".xlsx")
}

View File

@ -93,7 +93,7 @@ export default {
return {
activeName: 'first',
buttonTypeList: [
{ code: '01', name: '按图折返' }
{ code: '01', name: this.$t('map.returnByGraph') }
],
mapData: null,
editModel: {

View File

@ -160,8 +160,8 @@
<el-form-item v-if="!item.isHidden" :key="item.prop" :label="item.label" :prop="item.prop" :required="item.required">
<el-input v-model="formModel[item.content]" :placeholder="item.placeholder" class="input-with-select">
<el-select slot="prepend" v-model="formModel[item.prepend]" :placeholder="item.placeholder">
<el-option label="水平" value="H" />
<el-option label="垂直" value="V" />
<el-option :label="$t('map.horizontal')" value="H" />
<el-option :label="$t('map.vertical')" value="V" />
</el-select>
</el-input>
</el-form-item>

View File

@ -150,7 +150,7 @@ export default {
{ prop: 'code', label: this.$t('map.counterCoding'), type: 'select', optionLabel: 'code', optionValue: 'code', options: this.counterList, change: true, deviceChange: this.deviceChange },
{ prop: 'name', label: this.$t('map.counterName'), type: 'input' },
{ prop: 'type', label: this.$t('map.counterType'), type: 'select', optionLabel: 'name', optionValue: 'code', options: this.typeList },
{ prop: 'max', label: this.$t('map.countMax'), type: 'number', min: 0, placeholder: '个' },
{ prop: 'max', label: this.$t('map.countMax'), type: 'number', min: 0, placeholder: this.$t('map.piece') },
{ prop: 'position', label: this.$t('map.counterPosition'), type: 'coordinate', width: '110px', children: [
{ prop: 'position.x', firstLevel: 'position', secondLevel: 'x', label: 'x:', type: 'number', labelWidth: '25px' },
{ prop: 'position.y', firstLevel: 'position', secondLevel: 'y', label: 'y:', type: 'number', labelWidth: '25px' }

View File

@ -16,10 +16,10 @@
<el-scrollbar wrap-class="scrollbar-wrapper" :style="{ height: cardHeight +'px' }">
<el-form ref="make" label-width="110px" :model="addModel" size="mini" :rules="makeRules">
<el-form-item :label="$t('map.textContent')" prop="content">
<el-input v-model="addModel.content" :placeholder="$t('map.pleaseSelect')" class="input-with-select">
<el-input v-model="addModel.content" :placeholder="$t('map.pleaseEnter')" class="input-with-select">
<el-select slot="prepend" v-model="addModel.prepend" :placeholder="$t('map.pleaseSelect')">
<el-option label="水平" value="H" />
<el-option label="垂直" value="V" />
<el-option :label="$t('map.horizontal')" value="H" />
<el-option :label="$t('map.vertical')" value="V" />
</el-select>
</el-input>
</el-form-item>
@ -148,7 +148,7 @@ export default {
name: this.$t('map.drawData'),
item: [
{ prop: 'code', label: this.$t('map.textCode'), type: 'select', optionLabel: 'code', optionValue: 'code', options: this.textList, change: true, deviceChange: this.deviceChange },
{ prop: 'content', label: this.$t('map.textContent'), type: 'fontContent', content: 'content', prepend: 'prepend', placeholder: this.$t('map.pleaseSelect') },
{ prop: 'content', label: this.$t('map.textContent'), type: 'fontContent', content: 'content', prepend: 'prepend', placeholder: this.$t('map.pleaseEnter') },
{ prop: 'font', label: this.$t('map.textFont'), type: 'font', placeholder: this.$t('map.font') },
{ prop: 'fontColor', label: this.$t('map.textFontColor'), type: 'color' },
{ prop: 'position', label: this.$t('map.textPoints'), type: 'coordinate', width: '120px', children: [

View File

@ -14,9 +14,10 @@
</el-tab-pane>
<el-tab-pane class="view-control" :label="$t('map.batchOperation')" name="three">
<el-scrollbar wrap-class="scrollbar-wrapper" :style="{ height: cardHeight +'px' }">
<div style="display: flex;justify-content: center;">
<!-- style="display: flex;justify-content: center;" -->
<div style="text-align:center;">
<el-button type="danger" size="big" @click="removeTrainWindow">{{ $t('map.deleteTrainWindow') }}</el-button>
<el-button type="primary" size="big" @click="createTrainWindow">{{ $t('map.createTrainWindow') }}</el-button>
<el-button type="primary" size="big" @click="createTrainWindow" style="margin-top:10px">{{ $t('map.createTrainWindow') }}</el-button>
</div>
</el-scrollbar>
</el-tab-pane>

View File

@ -8,7 +8,6 @@
import { getPublishMapList, delPublishMap, getPublishMapExport, putMapOnLine, putMapOffLine } from '@/api/jmap/map';
import { getSkinCodeList } from '@/api/management/mapskin';
import { UrlConfig } from '@/router/index';
import deviceType from '@/jmap/constant/deviceType';
import localStore from 'storejs';
export default {
@ -242,7 +241,7 @@ export default {
const self = this;
import('@/utils/Export2Excel').then(excel => {
self.queryExportDataSame(resultData).then(data => {
excel.export_json_excel(data, resultData.name);
excel.export_json_excel_same(data, resultData.name);
}).catch(error => {
self.$message.error(`${this.$t('error.exportException')}:${error.message}`);
});
@ -290,7 +289,11 @@ export default {
filter: item => { return true; },
propList: {
'direction': item => {
return item.direction;
switch (item.direction) {
case '01': return '下行';
case '02': return '上行';
default: return '未知';
}
},
'name': (item, devices) =>{
let name = '';
@ -380,8 +383,6 @@ export default {
});
result[v] = list;
}
} else if (v == 'skinVO') {
result[v] = [data[i][v]];
}
}
} else if (data[i] instanceof Object || typeof data[i] != 'object') {

Binary file not shown.