This commit is contained in:
joylink_cuiweidong 2019-08-20 15:42:15 +08:00
commit c6b8ba6794
17 changed files with 99 additions and 49 deletions

View File

@ -44,6 +44,8 @@ export default {
createDetailFailed: 'Failed to create details',
updateDetailFailed: 'Failed to update details',
addFailed: 'Failure to add',
updateFailed: 'Failure to update'
updateFailed: 'Failure to update',
exportException: 'Export exception',
operationFailure: 'Operation Failure'
};

View File

@ -79,6 +79,9 @@ export default {
trainingNotStart: "{name}'s room hasn't started yet",
inputRoomNumber: 'Please enter the room number.',
chooseRoom: 'Choose Room',
month: 'month'
month: 'month',
putaway: 'Putaway',
soldOut: 'Sold out',
exportMap: 'Export Map'
};

View File

@ -9,6 +9,7 @@ import scriptRecord from './scriptRecord';
import tip from './tip';
import system from './system';
import orderAuthor from './orderAuthor';
import publish from './publish';
export default {
...enLocale,
@ -21,5 +22,6 @@ export default {
scriptRecord,
tip,
system,
orderAuthor
orderAuthor,
publish
};

View File

@ -468,6 +468,7 @@ export default {
startStationCodeColon: 'Originating station:',
startStationCode: 'The starting platform',
endStationCode: 'Into the platform',
destination: 'destination',
routingDirection: 'The direction of',
remarks: 'describe',
remarksColon: 'describe:',

View File

@ -0,0 +1,10 @@
export default {
name: 'Name',
city: 'City',
skinType: 'Skin Type',
mapName: 'Map Name',
updateMapName: 'Update Map Name',
updateTime: 'Update Time',
operationSuccess: 'Operate successfully',
deleteSuccess: 'Delete successfully'
};

View File

@ -44,6 +44,8 @@ export default {
createDetailFailed: '创建明细失败',
updateDetailFailed: '更新明细失败',
addFailed: '添加失败',
updateFailed: '更新失败'
updateFailed: '更新失败',
exportException: '导出异常',
operationFailure: '操作失败'
};

View File

@ -80,5 +80,9 @@ export default {
trainingNotStart: '{name}的房间未开始',
inputRoomNumber: '请输入房间号',
chooseRoom: '选择房间',
month: '月'
month: '月',
putaway: '上 架',
soldOut: '下 架',
exportMap: '导出地图'
};

View File

@ -9,6 +9,7 @@ import scriptRecord from './scriptRecord';
import tip from './tip';
import system from './system';
import orderAuthor from './orderAuthor';
import publish from './publish';
export default {
...cnLocale,
@ -21,5 +22,6 @@ export default {
scriptRecord,
tip,
system,
orderAuthor
orderAuthor,
publish
};

View File

@ -470,6 +470,7 @@ export default {
startStationCodeColon: '起始站:',
startStationCode: '起始站台',
endStationCode: '终到站台',
destination: '目的地码',
routingDirection: '方向',
remarks: '描述',
remarksColon: '描述:',

View File

@ -0,0 +1,10 @@
export default {
name: '名称',
city: '所属城市',
skinType: '皮肤类型',
mapName: '地图名称',
updateMapName: '更新地图名称',
updateTime: '更新时间',
operationSuccess: '操作成功',
deleteSuccess: '删除成功'
};

View File

@ -36,6 +36,7 @@ export const translate = {
{ key: 'code', tHeader: '交路编号', formatter: (val) => { return val || ''; } },
{ key: 'name', tHeader: '交路名称', formatter: (val) => { return val || ''; } },
{ key: 'directionCode', tHeader: '方向码', formatter: (val) => { return val || 0; } },
{ key: 'destinationCode', tHeader: '目的地码', formatter: (val) => { return val || ''; } },
{ key: 'startSectionCode', tHeader: '起始区段', formatter: (val) => { return val || ''; } },
{ key: 'startStationCode', tHeader: '起始车站', formatter: (val) => { return val || ''; } },
{ key: 'endSectionCode', tHeader: '终到区段', formatter: (val) => { return val || ''; } },

View File

@ -3,9 +3,9 @@ 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 = 'https://test.joylink.club/jlcloud';
// 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.4:9000' // 琰培
} else {
BASE_API = process.env.VUE_APP_BASE_API;

View File

@ -4,6 +4,7 @@ const I18N_LANG = 'user_lang';
export default {
setLang(lang) {
Cookies.set(I18N_LANG, lang);
window.location.reload();
},
getLang(defaultLang) {
const localLang = Cookies.get(I18N_LANG);

View File

@ -92,6 +92,10 @@ export default {
columnValue: (row) => { return this.$ConstSelect.translate(row.directionCode, 'DirectionCodeList'); },
tagType: (row) => { if (row.directionCode === '0') { return 'primary'; } else { return 'success'; } }
},
{
title: this.$t('map.destination'),
prop: 'destinationCode'
},
{
title: this.$t('map.remarks'),
prop: 'remarks'

View File

@ -62,6 +62,13 @@
@click="hover('endSectionCode')"
>{{ $t('map.activate') }}</el-button>
</el-form-item>
<el-form-item :label="$t('map.destinationCode')" prop="remarks">
<el-input v-model="addModel.destinationCode" style="width: 178px" />
<el-button
:type=" field === 'routingDestinationCode' ? 'danger' : 'primary'"
@click="hover('routingDestinationCode')"
>{{ $t('map.activate') }}</el-button>
</el-form-item>
<el-form-item :label="$t('map.routingDirection')" prop="directionCode">
<el-select v-model="addModel.directionCode" clearable :filterable="true" :placeholder="$t('map.pleaseSelect')">
<el-option
@ -208,6 +215,9 @@ export default {
name: [
{ required: true, message: this.$t('map.routingName'), trigger: 'change' }
],
destinationCode: [
{ required: true, message: this.$t('map.destinationCode'), trigger: 'change' }
],
startStationCode: [
{ required: true, message: this.$t('map.startStationCode'), trigger: 'change' }
],
@ -293,6 +303,8 @@ export default {
this.sectionCode = selected.code;
} else if (selected._type.toUpperCase() === 'Station'.toUpperCase() && this.field.toUpperCase() == 'routingStation'.toUpperCase()) {
this.stationCode = selected.code;
} else if (selected._type.toUpperCase() === 'Section'.toUpperCase() && this.field.toUpperCase() == 'routingDestinationCode'.toUpperCase()) {
this.addModel.destinationCode = selected.destinationCode || '';
}
}
},

View File

@ -1,6 +1,5 @@
<template>
<div class="card-box">
<!-- <turnback-bar :title="turnbackBarTitle"></turnback-bar> -->
<el-steps class="steps" :active="display">
<el-step :title="title" icon="el-icon-edit-outline" />
<el-step title="" icon="el-icon-upload" />
@ -12,8 +11,8 @@
</el-card>
<div class="draft">
<el-button-group>
<el-button v-if="isEdit" type="warning" @click="update">更新</el-button>
<el-button type="primary" @click="turnback">返回</el-button>
<el-button v-if="isEdit" type="warning" @click="update">{{ $t('global.update') }}</el-button>
<el-button type="primary" @click="turnback">{{ $t('global.back') }}</el-button>
</el-button-group>
</div>
</div>
@ -30,7 +29,7 @@ export default {
],
data() {
return {
title: '更新地图名称',
title: this.$t('publish.updateMapName'),
height: '',
display: 1,
UserLoading: false,
@ -41,10 +40,6 @@ export default {
};
},
computed: {
// turnbackBarTitle() {
// return '';
// },
isEdit() {
return this.$route.params.mode.toUpperCase() == 'edit'.toUpperCase();
},
@ -53,7 +48,7 @@ export default {
const form = {
labelWidth: '140px',
items: [
{ prop: 'name', label: '地图名称', type: 'text', required: false }
{ prop: 'name', label: this.$t('publish.mapName'), type: 'text', required: false }
]
};
return form;

View File

@ -27,11 +27,11 @@ export default {
queryObject: {
name: {
type: 'text',
label: '名称'
label: this.$t('publish.name')
},
cityCode: {
type: 'select',
label: '所属城市',
label: this.$t('publish.city'),
config: {
data: []
}
@ -45,60 +45,60 @@ export default {
indexShow: true,
columns: [
{
title: '名称',
title: this.$t('publish.name'),
prop: 'name'
},
{
title: '所属城市',
title: this.$t('publish.city'),
prop: 'cityCode',
type: 'tag',
columnValue: (row) => { return this.$convertField(row.cityCode, this.cityList, ['code', 'name']); },
tagType: (row) => { return 'success'; }
},
{
title: '皮肤类型',
title: this.$t('publish.skinType'),
prop: 'skinCode',
type: 'tag',
columnValue: (row) => { return this.$convertField(row.skinCode, this.skinCodeList, ['code', 'name']); },
tagType: (row) => { return ''; }
},
{
title: '更新时间',
title: this.$t('publish.updateTime'),
prop: 'updateTime'
},
{
type: 'button',
title: '操作',
width: '420',
title: this.$t('global.operate'),
width: this.$i18n.locale == 'en' ? '520': '420',
buttons: [
{
name: '上架',
name: this.$t('global.putaway'),
handleClick: this.handlePutaway,
type: '',
showControl: (row) => { return row.status != 1; }
},
{
name: '下架',
name: this.$t('global.soldOut'),
handleClick: this.handleSoldOut,
type: 'warning',
showControl: (row) => { return row.status == 1; }
},
{
name: '删除',
name: this.$t('global.delete'),
handleClick: this.handleDelete,
type: 'danger',
showControl: () => { return this.isShow != -1; }
},
{
name: '更新地图名称',
name: this.$t('publish.updateMapName'),
handleClick: this.handleUpdate
},
{
name: '导出地图',
name: this.$t('global.exportMap'),
handleClick: this.handleExportMap
},
{
name: '导出',
name: this.$t('global.export'),
handleClick: this.handleExportMapSame,
showControl: () => { return process.env.NODE_ENV === 'development'; }
}
@ -127,7 +127,7 @@ export default {
this.queryForm.queryObject.cityCode.config.data.push({ value: elem.code, label: elem.name });
});
}).catch(() => {
this.$messageBox('加载城市列表失败');
this.$messageBox(this.$t('error.loadingCityListFailed'));
});
this.skinCodeList = [];
@ -142,18 +142,18 @@ export default {
//
handleDelete(index, row) {
this.$confirm('此操作将删除该类型, 是否继续?', '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
this.$confirm('此操作将删除该类型, 是否继续?', this.$t('global.tips'), {
confirmButtonText: this.$t('global.confirm'),
cancelButtonText: this.$t('global.cancel'),
type: 'warning'
}).then(() => {
delPublishMap(row.id).then(response => {
this.$message.success('删除成功');
this.$message.success(this.$t('publish.deleteSuccess'));
this.reloadTable();
localStore.remove('mapId');
}).catch(() => {
this.reloadTable();
this.$messageBox('删除失败');
this.$messageBox(this.$t('error.deleteFailed'));
});
}).catch(() => { });
},
@ -163,34 +163,34 @@ export default {
},
handlePutaway(index, row) {
this.$confirm('此操作将上架此地图, 是否继续?', '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
this.$confirm('此操作将上架此地图, 是否继续?', this.$t('global.tips'), {
confirmButtonText: this.$t('global.confirm'),
cancelButtonText: this.$t('global.cancel'),
type: 'warning'
}).then(() => {
putMapOnLine(row.id).then(response => {
this.$message.success('操作成功');
this.$message.success(this.$t('publish.operationSuccess'));
this.reloadTable();
}).catch(() => {
this.reloadTable();
this.$messageBox('操作失败');
this.$messageBox(this.$t('error.operationError'));
});
}).catch(() => { });
},
handleSoldOut(index, row) {
this.$confirm('此操作将下架此地图, 是否继续?', '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
this.$confirm('此操作将下架此地图, 是否继续?', this.$t('global.tips'), {
confirmButtonText: this.$t('global.confirm'),
cancelButtonText: this.$t('global.cancel'),
type: 'warning'
}).then(() => {
putMapOffLine(row.id).then(response => {
this.$message.success('操作成功');
this.$message.success(this.$t('publish.operationSuccess'));
this.reloadTable();
localStore.remove('mapId');
}).catch(() => {
this.reloadTable();
this.$messageBox('操作失败');
this.$messageBox(this.$t('error.operationError'));
});
}).catch(() => { });
},
@ -208,7 +208,7 @@ export default {
// self.queryExportData(resultData).then(data => {
// excel.export_json_excel(data, resultData.name);
// }).catch(error => {
// self.$message.error('' + error.message);
// self.$message.error(`${this.$t('error.exportException')}:${error.message}`);
// });
// });
@ -235,7 +235,7 @@ export default {
self.queryExportDataSame(resultData).then(data => {
excel.export_json_excel(data, resultData.name);
}).catch(error => {
self.$message.error('导出执行异常:' + error.message);
self.$message.error(`${this.$t('error.exportException')}:${error.message}`);
});
});
},