国际化调整

This commit is contained in:
fan 2019-09-19 18:53:28 +08:00
commit dc5edddde0
29 changed files with 537 additions and 265 deletions

View File

@ -100,11 +100,17 @@ export default {
permission: 'Permission',
orderSelectionItem: 'Order selection item',
orderDetails: 'Order details',
universalPackage: '万能权限',
createPackage: '创建权限',
package: '权限包',
basePackage: '基础权限',
statusType: 'Status type',
private: 'Private',
public: 'Public',
pleaseEnterContent: 'Please enter content',
selectGoods: 'Select Goods',
month: ' month',
yuan: ' yuan'
yuan: ' yuan',
back: '返回',
next: '下一步'
};

View File

@ -29,6 +29,86 @@ export default {
deleteSuccess: 'Delete success!',
pleaseSelectRunplan: 'please select run graph'
},
modifying: {
tripNumber: 'Trip number: ',
pleaseSelect: 'Please select',
manual: 'Manual',
defaultStopTime: 'Default stop time',
serviceNumber: 'Service number: ',
clearGuest: 'Clear guest',
continuationPlan: 'Continuation plan',
firstTrain: 'First train',
serialNumber: 'Serial number: ',
defaultRunLevel: 'Default run level: ',
startTime: 'Start Time',
selectTime: 'Select Time',
inStock: 'In Stock',
outStock: 'Out Stock',
lastTrain: 'Last Train',
route: 'Route ',
// 起始站
// 起始区段
// 终到站
// 终到区段
// 描述
detail: 'Detail: ',
station: 'Station',
section: 'Section',
stopTime: 'Stop time',
runLevel: 'Run level',
arrivalTime: 'Arrival time',
departureTime: 'Departure time',
showDefaultTime: 'Show default stop time and run level',
automatic: 'Automatic',
default: 'Default',
modifyTask: 'Modify task',
setMessageTip1: 'Please set the start interval of the start section',
setMessageTip2: 'to the section',
setMessageTip3: '.',
modifyTaskSuccess: 'Modify task success!',
modifyTaskFailed: 'Modify task failed',
startingStation: 'Start station',
startSection: 'Start section',
endStation: 'End station',
endSection: 'End section',
direction: 'Direction',
distance: 'Distance',
operation: 'Operation',
edit: 'Edit',
save: 'Save',
cancelAndQuit: 'Cancel and quit',
modifySuccess: 'Modify Success',
modifyFailed: 'Modify Failed',
modifyRunLevel: 'Modify run level',
startStationTips: 'Start station departure time unchanged',
endStationTips: 'End station departure time unchanged',
startStationTitle: 'Start station',
startedStation: 'Start station',
endStationTitle: 'End station',
endedStation: 'End station',
description: 'Description',
modifyTaskRoute: 'Modify task route',
modifyStartTime: 'Modify start time: ',
modifyStartTimeTitle: 'Modify start time',
search: 'Search',
modifyTwoStationTime: 'Modify the time between the two stations'
},
editSmoothRun: {
trainProportion: 'Train proportion',
allTheLoopTrainProportion: 'Use the same size loop train proportion for all time periods',
sizeOfTheLoopTrainProportion: 'Large loop and small loop train proportion',
pleaseSelect: 'Please select',
startTime: 'Start time',
stopTime: 'Stop time',
runInterval: 'Run interval',
add: 'Add',
delete: 'Delete',
modify: 'Modify',
editSmoothRunTime: 'Edit smooth run time'
},
buy: 'Buy',
offlineMappingSoftware: 'Offline mapping software',
lianPlanSystem: 'Urban rail transit lian planning system',
@ -67,7 +147,7 @@ export default {
runLevel: 'Run level',
platform: 'Platform',
modifyPlatformProperties: 'Modify platform properties',
file: 'file',
file: 'File',
openRunningDiagram: 'Open run graph',
createRunningDiagram: 'Create run graph',
modifyRunningDiagramName: 'Modify run graph name',
@ -146,5 +226,6 @@ export default {
task: 'Task',
startTime: 'Start time',
endTime: 'End time',
editPlanningTrain: 'Edit planning train'
editPlanningTrain: 'Edit planning train',
runGraphName: 'Run graph name'
};

View File

@ -276,6 +276,7 @@ export default {
accessNumber: 'Please input the number of permissions',
courseNameEmpty: 'Course name cannot be empty',
purchaseMonth: 'Please input the number of months to buy',
pleaseEnterGoodPrice: '请输入商品价格',
enterTheNameOfTheRunGraph: 'Please enter the name of the run graph',
chooseToPublishTheRunGraph: 'Please choose to publish the run chart',
enterTheAlarmCode: 'Please enter the alarm code',

View File

@ -171,6 +171,9 @@ export default {
selectSpeedLimitValueTip: 'Please select the speed limit value, click the "release" button, and issue the command!',
addTrainIdTip: 'Add train identification number: successful',
editTrainIdTip: 'Modify train identification number: successful',
enterPrice: '请输入价格',
publishMap: '获取发布地图',
addPackage: '请添加权限',
deletePlanSuccessfully: 'Delete plan successfully',
deletePlanFailed: 'Delete plan failed',
importRunGraphFailed: 'Import the run graph failed:',

View File

@ -105,8 +105,11 @@ export default {
createPackage: '创建权限',
package: '权限包',
basePackage: '基础权限',
universalPackage: '万能权限',
pleaseEnterContent: '请输入内容',
selectGoods: '选择商品',
month: '月',
yuan: '元'
yuan: '元',
back: '返回',
next: '下一步'
};

View File

@ -29,7 +29,87 @@ export default {
deleteSuccess: '删除成功!',
pleaseSelectRunplan: '请选择运行图'
},
modifying: {
tripNumber: '车次号:',
pleaseSelect: '请选择',
manual: '手工',
defaultStopTime: '缺省停站时间:',
serviceNumber: '表号:',
clearGuest: '清客',
continuationPlan: '延续计划',
firstTrain: '首班车',
serialNumber: '序列号:',
defaultRunLevel: '缺省运行等级:',
startTime: '开始时间',
selectTime: '选择时间',
inStock: '入库',
outStock: '出库',
lastTrain: '末班车',
route: '交路:',
// startingStation 起始站
// startSection 起始区段
// endStationTitle 终到站
// endSection 终到区段
// description 描述
detail: '详情:',
station: '车站',
section: '区段',
stopTime: '停站时间',
runLevel: '运行等级',
arrivalTime: '到点',
departureTime: '发点',
showDefaultTime: '显示默认停站时间和运行等级',
automatic: '自动',
default: '默认',
modifyTask: '修改任务',
setMessageTip1: '请先设置开始区段',
setMessageTip2: '终到区段',
setMessageTip3: '的站间运行时间',
modifyTaskSuccess: '修改任务成功!',
modifyTaskFailed: '修改任务失败',
startingStation: '起始站',
startSection: '起始区段',
endStation: '终点站',
endSection: '终点区段',
direction: '方向',
distance: '距离',
operation: '操作',
edit: '编辑',
save: '保存',
cancelAndQuit: '取消&退出',
modifySuccess: '修改成功!',
modifyFailed: '修改失败',
modifyRunLevel: '修改运行等级',
startStationTips: '起始站发车时间不变',
endStationTips: '终到站到达时间不变',
startStationTitle: '起始站',
startedStation: '起始站台',
endStationTitle: '终到站',
endedStation: '终到站台',
description: '描述',
modifyTaskRoute: '修改任务交路',
time: '时间',
modifyStartTime: '修改开始时间:',
modifyStartTimeTitle: '修改起始时间',
search: '查找',
modifyTwoStationTime: '修改两站之间的时间'
},
editSmoothRun: {
trainProportion: '分车比例',
allTheLoopTrainProportion: '所有时段使用相同大小环路分车比例',
sizeOfTheLoopTrainProportion: '大环路与小环路分车比例:',
pleaseSelect: '请选择',
startTime: '开始时间',
stopTime: '结束时间',
runInterval: '运行间隔',
add: '增加',
delete: '删除',
modify: '修改',
editSmoothRunTime: '编辑平稳运行时段'
},
buy: '购买',
offlineMappingSoftware: '离线编图软件',
lianPlanSystem: '城市轨道交通琏计划系统',

View File

@ -278,6 +278,7 @@ export default {
enterTheTripNumber: '请输入车次号',
enterTheTargetCode: '请输入目的地号',
selectStation: '请选择车站',
pleaseEnterGoodPrice: '请输入商品价格',
enterTheNameOfTheRunGraph: '请输入运行图名称',
chooseToPublishTheRunGraph: '请选择发布运行图',
enterTheAlarmCode: '请输入报警器编号',

View File

@ -171,6 +171,9 @@ export default {
selectSpeedLimitValueTip: '请选择限速值后,点击“下达”按钮,下达命令!',
addTrainIdTip: '添加列车识别号:成功',
editTrainIdTip: '修改列车识别号:成功',
enterPrice: '请输入价格',
publishMap: '获取发布地图',
addPackage: '请添加权限',
deletePlanSuccessfully: '删除计划成功',
deletePlanFailed: '删除计划失败',
importRunGraphFailed: '导入运行图失败:',

View File

@ -27,7 +27,7 @@ export default {
importData(Sheet, JsonData) {
var dataList = convertSheetToList(Sheet, false);
var needList = Object.keys(this.ExcelConfig.columns);
debugger;
if (dataList && dataList.length) {
for (var rowIndex = this.ExcelConfig.beginRow; rowIndex < dataList.length; rowIndex += 1) {
for (var colIndex = this.ExcelConfig.beginCol; colIndex < dataList[this.ExcelConfig.beginCol].length; colIndex += this.ExcelConfig.fieldNum + 1) {

View File

@ -3,10 +3,10 @@ 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.41:9000'; // 王兴杰
BASE_API = 'http://192.168.3.41:9000'; // 王兴杰
} else {
BASE_API = process.env.VUE_APP_BASE_API;
}

View File

@ -70,7 +70,8 @@ export default {
permissionId: good.permissionId,
name: good.name,
remarks: good.remarks,
price: good.price
price: good.price,
list: good.list
}];
this.$refs.orderForm.setOrderName(good, permission);
this.display = 1;

View File

@ -1,7 +1,16 @@
<template>
<el-dialog :title="this.$t('orderAuthor.packingDetails')" :visible.sync="dialogShow" width="800px" :before-close="close">
<div>
<QueryListPage ref="queryListPage" :pager-config="pagerConfig" :query-form="queryForm" :query-list="queryList" />
<div style="height: 300px">
<el-scrollbar wrap-class="scrollbar-wrapper" style="">
<el-table :data="permissionList" border style="width: 100%">
<el-table-column prop="name" :label="this.$t('orderAuthor.permissionName')" />
<el-table-column prop="type" :label="this.$t('orderAuthor.permissionType')">
<template slot-scope="scope">
{{ computedName(PermissionTypeList, scope.row.type) }}
</template>
</el-table-column>
</el-table>
</el-scrollbar>
</div>
<span slot="footer" class="dialog-footer">
<el-button @click="dialogShow = false">{{ $t('map.cancel') }}</el-button>
@ -10,7 +19,6 @@
</template>
<script>
import { getPermissonDetail } from '@/api/management/author';
export default {
name: 'Author',
@ -21,44 +29,22 @@ export default {
dialogShow: false,
id: '',
PermissionTypeList: [],
pagerConfig: {
pageSize: 'pageSize',
pageIndex: 'pageNum'
},
queryForm: {
labelWidth: '140px',
reset: true,
show: false,
queryObject: {
}
},
queryList: {
query: this.queryFunction,
selectCheckShow: false,
indexShow: true,
columns: [
{
title: this.$t('orderAuthor.permissionName'),
prop: 'name'
},
{
title: this.$t('orderAuthor.permissionType'),
prop: 'type',
type: 'tag',
columnValue: (row) => { return this.$convertField(row.type, this.PermissionTypeList, ['value', 'label']); },
tagType: (row) => { return ''; }
}
],
actions: [
]
}
permissionList: []
};
},
mounted() {
this.loadInitData();
},
methods: {
computedName(list, code) {
let name = '';
list.forEach(elem => {
if (elem.value == code) {
name = elem.label;
}
});
return name;
},
loadInitData() {
this.$Dictionary.permissionType().then(list => {
this.$convertList(list, this.PermissionTypeList, elem => {
@ -66,25 +52,14 @@ export default {
});
});
},
doShow(id) {
this.id = id;
doShow(list) {
this.permissionList = list;
this.dialogShow = true;
this.reloadTable();
},
close() {
this.id = '';
this.dialogShow = false;
},
queryFunction() {
if (this.id) {
return getPermissonDetail(this.id);
}
},
reloadTable() {
if (this.queryList && this.queryList.reload) {
this.queryList.reload();
}
},
turnback() {
this.$router.go(-1);
}

View File

@ -144,16 +144,14 @@ export default {
labelWidth: this.$i18n.locale == 'en' ? '200px': '145px',
items: [
{ prop: 'organizationId', label: this.$t('orderAuthor.organizationOrEnterprise'), type: 'select', options: this.OrganizationList, allowCreate: true, onChange: this.onChange },
// { prop: 'goodsName', label: this.$t('orderAuthor.commodityName'), type: 'text', disabled: true },
// { prop: 'price', label: this.$t('orderAuthor.itemPricing'), type: 'number', disabled: true, min: 0, message: '' },
{ prop: 'orderType', label: this.$t('orderAuthor.orderType'), type: 'select', options: this.OrderTypeList },
{ prop: 'sellerId', label: this.$t('orderAuthor.salesman'), type: 'select', show: this.isShowSeller, options: this.SellerList },
{ prop: 'contractNo', label: this.$t('orderAuthor.contractNumber'), type: 'text', show: this.isShowContractNo },
{ prop: 'amount', label: this.$t('orderAuthor.choosePermissionNumber'), type: 'number', show: true, min: 0 },
{ prop: 'forever', label: this.$t('orderAuthor.permanenceOrNot'), type: 'radio', options: this.$ConstSelect.Whether, disabled: this.foreverIsDisabled },
{ prop: 'startTime', label: this.$t('orderAuthor.startDate'), type: 'date', show: this.isShowStartDate, viewFormat: 'yyyy-MM-dd', valueFormat: 'yyyy-MM-dd', picker: this.DatePicker },
{ prop: 'monthAmount', label: this.$t('orderAuthor.choosePurchaseTime'), type: 'number', show: this.isShowMonths, min: 0, message: '月' },
{ prop: 'totalPrice', label: this.$t('orderAuthor.totalPrice'), type: 'number', show: this.isShowPrice, min: 0, message: '元' },
{ prop: 'monthAmount', label: this.$t('orderAuthor.choosePurchaseTime'), type: 'number', show: this.isShowMonths, min: 0, message: this.$t('orderAuthor.month') },
{ prop: 'totalPrice', label: this.$t('orderAuthor.totalPrice'), type: 'number', show: this.isShowPrice, min: 0, message: this.$t('orderAuthor.yuan') },
{ prop: 'bizType', label: this.$t('orderAuthor.businessType'), type: 'select', disabled: true, options: this.BizTypeList },
{ prop: 'payWays', label: this.$t('orderAuthor.paymentMethod'), type: 'select', show: this.isShowPayType, options: this.PayTypeList },
{ prop: 'payStatus', label: this.$t('orderAuthor.paymentStatus'), type: 'select', show: this.isShowPayStatus, options: this.PayStatusTypeList },
@ -334,7 +332,7 @@ export default {
});
},
showPermission(index, row) {
this.$refs.permissionList.doShow(row.permissionId);
this.$refs.permissionList.doShow(row.list);
},
//
setOrderName(data, permission) {
@ -413,7 +411,7 @@ export default {
};
this.$emit('orderNext', this.urlInfo);
}).catch(error => {
console.log(error);
this.$messageBox(`${error.message}`);
});
});
},

View File

@ -21,11 +21,11 @@
{{ computedName(PermissionTypeList, scope.row.type) }}
</template>
</el-table-column>
<el-table-column v-if="addModel.type == '01'" prop="price" label="价格">
<el-table-column v-if="addModel.type == '01'" prop="price" :label="$t('orderAuthor.price')">
<template slot-scope="scope">
<div v-if="scope.row.price">{{ scope.row.price }}</div>
<div v-if="!scope.row.price">
<el-input v-model="scope.row.payPrice" placeholder="请输入价格" />
<el-input v-model="scope.row.payPrice" :placeholder="$t('tip.enterPrice')" />
</div>
</template>
</el-table-column>
@ -37,13 +37,13 @@
</el-table>
</div>
<el-form ref="formData" label-width="130px" :model="addModel" size="mini" :rules="rules" class="rule_box">
<el-form-item label="权限类型:">
<el-form-item :label="$t('orderAuthor.permissionType') + ':'">
<el-radio-group v-model="addModel.type">
<el-radio v-for="item in permissionType" :key="item.value" :label="item.value" @change="changeRadio">{{ item.label }}</el-radio>
</el-radio-group>
</el-form-item>
<el-form-item v-show="addModel.type == '02'" :label="$t('orderAuthor.permissionGoodName') + ':'" prop="name">
<el-input v-model="addModel.name" size="small" />
<el-input v-model="addModel.name" size="small" :disabled="isGoods" />
</el-form-item>
<el-form-item v-show="addModel.type == '02'" :label="$t('orderAuthor.describtion') + ':'">
<el-input
@ -52,19 +52,20 @@
:rows="2"
maxlength="60"
show-word-limit
:disabled="isGoods"
/>
</el-form-item>
<el-form-item v-show="addModel.type == '02' && !isGoods" :label="$t('orderAuthor.price') + ':'" prop="price">
<el-input-number v-model="addModel.price" :min="0.01" />
<el-form-item v-show="addModel.type == '02'" :label="$t('orderAuthor.price') + ':'" prop="price">
<el-input-number v-model="addModel.price" :min="0.01" :disabled="isGoods" />
<span style="padding-left: 20px; font-size: 12px; color: #a9a9a9;">{{ $t('global.yuan') }}</span>
</el-form-item>
<el-form-item v-show="addModel.type == '02' && !isGoods" :label="$t('orderAuthor.whetherTrial')" prop="forever">
<el-radio-group v-model="addModel.forever">
<el-form-item v-show="addModel.type == '02'" :label="$t('orderAuthor.whetherTrial')" prop="forever">
<el-radio-group v-model="addModel.forever" :disabled="isGoods">
<el-radio v-for="option in $ConstSelect.Whether" :key="option.value" :label="option.value">{{ option.label }}</el-radio>
</el-radio-group>
</el-form-item>
<el-form-item v-if="addModel.type == '02' && addModel.forever && !isGoods" :label="$t('orderAuthor.unitOfTime')" prop="tryUseTimeUnit">
<el-select v-model="addModel.tryUseTimeUnit" filterable>
<el-form-item v-if="addModel.type == '02' && addModel.forever" :label="$t('orderAuthor.unitOfTime')" prop="tryUseTimeUnit">
<el-select v-model="addModel.tryUseTimeUnit" filterable :disabled="isGoods">
<el-option
v-for="option in TimeStyleList"
:key="option.value"
@ -73,8 +74,8 @@
/>
</el-select>
</el-form-item>
<el-form-item v-if="addModel.type == '02' && addModel.forever && !isGoods" :label="$t('orderAuthor.price') + ':'" prop="tryUseTime">
<el-input-number v-model="addModel.tryUseTime" :min="0.01" />
<el-form-item v-if="addModel.type == '02' && addModel.forever" :label="$t('orderAuthor.price') + ':'" prop="tryUseTime">
<el-input-number v-model="addModel.tryUseTime" :min="0.01" :disabled="isGoods" />
<span style="padding-left: 20px; font-size: 12px; color: #a9a9a9;">{{ TimeStyleDict[addModel.tryUseTimeUnit] }}</span>
</el-form-item>
</el-form>
@ -90,7 +91,7 @@
<div class="draft">
<el-button-group>
<el-button type="primary" @click="turnback">{{ $t('global.back') }}</el-button>
<el-button type="primary" @click="permissionNext">下一步</el-button>
<el-button type="primary" @click="permissionNext">{{ $t('orderAuthor.next') }}</el-button>
</el-button-group>
</div>
</div>
@ -114,10 +115,10 @@ export default {
EffectiveTypeList: [],
PermissionTypeList: [],
permissionType: [
{value: '01', label: '基础权限'},
{value: '02', label: '万能权限'}
{value: '01', label: this.$t('orderAuthor.basePackage')},
{value: '02', label: this.$t('orderAuthor.universalPackage')}
],
isGoods: true,
isGoods: false,
mapList: [],
goodsList: [], //
goodsListNew: [],
@ -136,7 +137,7 @@ export default {
{ required: true, message: this.$t('rules.enterPermissionName'), trigger: 'blur' }
],
price: [
{ required: true, message: '请输入商品价格', trigger: 'blur' }
{ required: true, message: this.$t('rules.pleaseEnterGoodPrice'), trigger: 'blur' }
]
}
};
@ -153,11 +154,12 @@ export default {
return item.id;
});
postFindPermission(arr).then(res => {
this.isGoods = true;
if (!res.data) {
this.isGoods = false;
} else {
if (res.data && res.data.goodsId) {
this.isGoods = true;
this.addModel.name = res.data.name;
this.addModel.price = res.data.prdPrice;
this.addModel.remarks = res.data.remarks;
}
});
}
@ -184,11 +186,12 @@ export default {
return item.id;
});
postFindPermission(arr).then(res => {
this.isGoods = true;
if (!res.data) {
this.isGoods = false;
} else {
if (res.data && res.data.goodsId) {
this.isGoods = true;
this.addModel.name = res.data.name;
this.addModel.price = res.data.prdPrice;
this.addModel.remarks = res.data.remarks;
}
});
}
@ -223,7 +226,7 @@ export default {
this.mapList.push({ value: elem.id, label: elem.name });
});
} catch (error) {
console.error(error, '获取发布地图');
console.error(error, this.$t('tip.publishMap'));
}
},
computedName(list, code) {
@ -319,45 +322,40 @@ export default {
if (valid) { // 使
postFindPermission(arr).then(res => {
this.addModel['relPermissions'] = arr;
if (res.data) {
if (this.isGoods) {
this.addModel.name = res.data.name;
this.addModel.remarks = res.data.remarks;
this.$confirm('选择的权限已存在对应商品,是否创建订单', '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
}).then(() => {
this.addModel['id'] = res.data.id;
const good = {
id: res.data.goodsId,
permissionId: res.data.id,
name: res.data.prdName,
price: res.data.prdPrice,
remarks: res.data.remarks
remarks: res.data.remarks,
list: this.ruleList
};
this.$emit('permissionNextOrder', this.addModel, good);
});
} else {
this.addModel['id'] = '';
//
const good = {
name: this.addModel.name,
permissionId: this.addModel.id,
permissionId: '',
tryUse: this.addModel.forever,
tryUseTime: this.addModel.tryUseTime,
tryUseTimeUnit: this.addModel.tryUseTimeUnit,
price: this.addModel.price,
remarks: this.addModel.remarks
remarks: this.addModel.remarks,
list: this.ruleList
};
this.$emit('permissionNextOrder', this.addModel, good);
}
// this.$emit('permissionNextOrder', this.addModel, good);
}).catch((error) => { console.log(error); });
}
});
}
} else {
this.$messageBox('请添加权限');
this.$messageBox(this.$t('tip.addPackage'));
}
},
turnback() {

View File

@ -7,7 +7,7 @@
</div>
<div class="draft">
<el-button-group>
<el-button @click="turnback">返回</el-button>
<el-button @click="turnback">{{ $t('orderAuthor.back') }}</el-button>
</el-button-group>
</div>
</div>

View File

@ -11,7 +11,7 @@
<status-bar ref="statusBar" @dispatchDialog="dispatchDialog" @showTrain="showTrain" />
<open-run-plan ref="openRunPlan" :skin-code="skinCode" @dispatchDialog="dispatchDialog" />
<create-empty-plan ref="createEmptyPlan" @dispatchOperate="dispatchOperate" @dispatchDialog="dispatchDialog" />
<create-empty-plan ref="createEmptyPlan" :plan-convert="PlanConvert" @dispatchOperate="dispatchOperate" @dispatchDialog="dispatchDialog" />
<parameter ref="parameter" />
<off-line ref="offLine" @handleConfirm="handleConfirm" @dispatchDialog="dispatchDialog" />
<add-planning-train ref="addPlanningTrain" @dispatchDialog="dispatchDialog" />

View File

@ -159,19 +159,19 @@ export default {
title: this.$t('planMonitor.createRunningDiagram'),
click: this.handleCreateEmptyPlan
},
{
title: this.$t('planMonitor.modifyRunningDiagramName'),
click: this.handleEditPlan
},
// {
// title: '',
// click: this.handleEditPlan
// },
{
title: this.$t('planMonitor.modifyStationIntervalTime'),
click: this.handleModifyingStationIntervalTime
// disabledCallback: () => { return !this.$route.query.planId },
},
{
title: this.$t('planMonitor.deleteRunningDiagram'),
click: this.handledeleteRunPlan
}
// {
// title: '',
// click: this.handledeleteRunPlan
// }
]
},
{
@ -399,13 +399,13 @@ export default {
handleOpenRunPlan() {
this.$emit('dispatchDialog', { name: 'openRunPlan', params: {type: 'add'} });
},
handledeleteRunPlan() {
this.$emit('dispatchDialog', { name: 'openRunPlan', params: {type: 'delete'} });
},
// handledeleteRunPlan() {
// this.$emit('dispatchDialog', { name: 'openRunPlan', params: {type: 'delete'} });
// },
//
handleEditPlan() {
this.$emit('dispatchDialog', { name: 'openRunPlan', params: {type: 'edit'} });
},
// handleEditPlan() {
// this.$emit('dispatchDialog', { name: 'openRunPlan', params: {type: 'edit'} });
// },
loadingScreen() {
this.loading = this.$loading({
lock: true,

View File

@ -40,6 +40,20 @@
</el-form>
</el-row>
</el-tab-pane>
<el-tab-pane label="导入运行图" name="three">
<el-row>
<el-button type="text" class="uploadDemo">
<input
ref="files"
type="file"
class="file_box"
accept=".json, application/json, .csv, application/vnd.openxmlformats-officedocument.spreadsheetml.sheet, application/vnd.ms-excel"
@change="importf"
>
<i class="el-icon-plus" />
</el-button>
</el-row>
</el-tab-pane>
</el-tabs>
</div>
<span slot="footer" class="dialog-footer">
@ -50,18 +64,28 @@
</template>
<script>
import { createEmptyPlan, queryRunPlanList, postCreatePlan } from '@/api/runplan';
import { createEmptyPlan, queryRunPlanList, postCreatePlan, importRunPlan } from '@/api/runplan';
import { UrlConfig } from '@/router/index';
import XLSX from 'xlsx';
export default {
name: 'CreateEmptyPlan',
components: {
},
props: {
planConvert: {
type: Object,
default: function() {
return { };
}
}
},
data() {
return {
activeTab: 'first',
dialogShow: false,
loading: false,
loadingDig: null,
publishMapList: [],
newModel: {
name: '',
@ -136,7 +160,6 @@ export default {
};
this.$emit('dispatchOperate', params);
// this.$emit('dispatchDialog', { name: 'openRunPlan', params: {type: 'add'} });
this.$message.success(this.$t('tip.createAnEmptyRunGraphSuccessfully'));
this.jump(resp.data, this.newModel.name);
this.doClose();
@ -151,7 +174,6 @@ export default {
if (valid) {
this.loading = true;
postCreatePlan(this.pullModel).then(resp => {
// this.$emit('dispatchDialog', { name: 'openRunPlan', params: {type: 'add'} });
this.$message.success(this.$t('tip.createARunGraphSuccessfully'));
this.jump(resp.data, this.pullModel.name);
this.doClose();
@ -163,6 +185,74 @@ export default {
});
}
},
importf(item) {
const obj = this.$refs.files;
if (obj.files) {
const file = obj.files[0];
this.handleImportRunPlan(file);
obj.value = '';
}
},
loadingScreen() {
this.loadingDig = this.$loading({
lock: true,
text: this.$t('tip.underImport'),
spinner: 'el-icon-loading',
background: 'rgba(0, 0, 0, 0.7)'
});
},
//
handleImportRunPlan(file) {
if (file) {
this.loadingScreen();
setTimeout(() => {
const that = this;
const reader = new FileReader();
if (reader) {
reader.onload = function (e) {
let wb;
const data = e.target.result;
if (that.rABS) {
wb = XLSX.read(btoa(that.fixdata(data)), { //
type: 'base64'
});
} else {
wb = XLSX.read(data, {
type: 'binary'
});
}
if (wb) {
try {
let jsonData = [];
for (const index in wb.Sheets) {
jsonData = that.planConvert.importData(wb.Sheets[index], jsonData);
}
importRunPlan({ skinCode: that.$route.query.skinCode || '02', runPlanList: jsonData }).then(response => {
that.loadingDig.close();
that.$message.success(this.$t('tip.importOperationGraphSuccessfully'));
// this.$emit('dispatchDialog', { name: 'openRunPlan', params: {type: 'add'} });
}).catch(error => {
that.loadingDig.close();
that.$message.warning(`${this.$t('tip.importRunGraphFailed')} ${error.message}`);
});
} catch (error) {
that.loadingDig.close();
that.$message.warning(`${this.$t('tip.parseRunGraphFailed')} ${error.message}`);
}
}
};
if (that.rABS) {
reader.readAsArrayBuffer(file);
} else {
reader.readAsBinaryString(file);
}
}
}, 200);
}
this.doClose();
},
jump(planId, planName) {
const query = { skinCode: this.$route.query.skinCode, mapId: this.$route.query.mapId, planId: planId, planName: planName };
this.$router.push({ path: `${UrlConfig.plan.tool}`, query: query });
@ -182,4 +272,24 @@ export default {
width: 120px;
}
}
.uploadDemo{
width: 100%;
height: 130px;
border: 1px dashed #409EFF;
position: relative;
.file_box{
position: absolute;
opacity: 0;
left: 0;
top: 0;
width: 100%;
height: 100%;
cursor: pointer;
}
.el-icon-plus{
font-size: 40px;
}
}
</style>

View File

@ -4,7 +4,7 @@
class="planEdit__tool create-empty-plan"
:title="title"
:visible.sync="dialogShow"
width="30%"
width="400px"
:before-close="doClose"
:z-index="3000"
:modal="false"
@ -20,8 +20,8 @@
</el-row>
</div>
<span slot="footer" class="dialog-footer">
<el-button @click="doClose">{{ $t('map.cancel') }}</el-button>
<el-button type="primary" :loading="loading" @click="handleEdit">{{ $t('global.modify') }}</el-button>
<el-button @click="doClose">{{ $t('global.cancel') }}</el-button>
</span>
</el-dialog>
</template>

View File

@ -13,17 +13,17 @@
<div style="margin: 10px;">
<div style="border: 1px solid #B9B5A7">
<el-row>
<span style="position: relative; top: -8px; left: 20px">分车比例</span>
<span style="position: relative; top: -8px; left: 20px">{{$t('planMonitor.editSmoothRun.trainProportion')}}</span>
<el-col :offset="1">
<el-checkbox v-model="model.useSame">所有时段使用相同大小环路分车比例</el-checkbox>
<el-checkbox v-model="model.useSame">{{$t('planMonitor.editSmoothRun.allTheLoopTrainProportion')}}</el-checkbox>
</el-col>
</el-row>
<el-row>
<el-col :span="9" :offset="1">
<span>大环路与小环路分车比例</span>
<span>{{$t('planMonitor.editSmoothRun.sizeOfTheLoopTrainProportion')}}</span>
</el-col>
<el-col :span="12">
<el-select v-model="model.scale" placeholder="请选择">
<el-select v-model="model.scale" :placeholder="$t('planMonitor.editSmoothRun.pleaseSelect')">
<el-option
v-for="item in scaleList"
:key="item.value"
@ -36,21 +36,21 @@
</div>
<el-row style="margin-top: 20px">
<el-table :data="model.smoothList" border :height="240">
<el-table-column prop="startTime" label="开始时间" />
<el-table-column prop="stopTime" label="结束时间" />
<el-table-column prop="runInterval" label="运行间隔" />
<el-table-column prop="scale" label="分车比例" />
<el-table-column prop="startTime" :label="$t('planMonitor.editSmoothRun.startTime')" />
<el-table-column prop="stopTime" :label="$t('planMonitor.editSmoothRun.stopTime')" />
<el-table-column prop="runInterval" :label="$t('planMonitor.editSmoothRun.runInterval')" />
<el-table-column prop="scale" :label="$t('planMonitor.editSmoothRun.trainProportion')" />
</el-table>
</el-row>
<el-row type="flex" justify="center" class="button-group">
<el-button @click="handleAdd">增加</el-button>
<el-button @click="handleDelete">删除</el-button>
<el-button @click="handleEdit">修改</el-button>
<el-button @click="handleAdd">{{$t('planMonitor.editSmoothRun.add')}}</el-button>
<el-button @click="handleDelete">{{$t('planMonitor.editSmoothRun.delete')}}</el-button>
<el-button @click="handleEdit">{{$t('planMonitor.editSmoothRun.modify')}}</el-button>
</el-row>
</div>
<el-row type="flex" justify="center" class="button-group">
<el-button style="padding: 0px; margin: 0px 30px" @click="handleCommit"> </el-button>
<el-button style="padding: 0px; margin: 0px 30px" @click="doClose"> </el-button>
<el-button style="padding: 0px; margin: 0px 30px" @click="handleCommit">{{$t('global.confirm')}}</el-button>
<el-button style="padding: 0px; margin: 0px 30px" @click="doClose">{{$t('global.cancel')}}</el-button>
</el-row>
</el-dialog>
</template>
@ -74,7 +74,7 @@ export default {
},
computed: {
title() {
return '编辑平稳运行时段';
return this.$t('planMonitor.editSmoothRun.editSmoothRunTime');
}
},
mounted() {

View File

@ -11,8 +11,8 @@
:close-on-click-modal="false"
>
<el-row type="flex" justify="center" class="button-group">
<el-button @click="handleCommit"> </el-button>
<el-button @click="doClose"> </el-button>
<el-button @click="handleCommit">{{$t('global.confirm')}}</el-button>
<el-button @click="doClose">{{$t('global.cancel')}}</el-button>
</el-row>
</el-dialog>
</template>
@ -31,7 +31,7 @@ export default {
},
computed: {
title() {
return '修改两站之间的时间';
return this.$t('planMonitor.modifying.modifyTwoStationTime');
}
},
mounted() {

View File

@ -11,8 +11,8 @@
:close-on-click-modal="false"
>
<el-row type="flex" justify="center" class="button-group">
<el-button @click="handleCommit"> </el-button>
<el-button @click="doClose"> </el-button>
<el-button @click="handleCommit">{{$t('global.confirm')}}</el-button>
<el-button @click="doClose">{{$t('global.cancel')}}</el-button>
</el-row>
</el-dialog>
</template>
@ -31,7 +31,7 @@ export default {
},
computed: {
title() {
return '查找';
return this.$t('planMonitor.modifying.search');
}
},
mounted() {

View File

@ -11,18 +11,17 @@
:close-on-click-modal="false"
>
<el-row>
<el-col :span="9" :offset="1" style="height: 32px; line-height: 32px;">修改开始时间</el-col>
<el-col :span="9" :offset="1" style="height: 32px; line-height: 32px;">{{$t('planMonitor.modifying.modifyStartTime')}}</el-col>
<el-col :span="14">
<el-time-picker v-model="beginTime" size="mini" :clearable="false" />
</el-col>
</el-row>
<el-row type="flex" justify="center" style="margin-top: 20px">
<el-button @click="handleCommit"> </el-button>
<el-button @click="doClose"> </el-button>
<el-button @click="handleCommit">{{$t('global.confirm')}}</el-button>
<el-button @click="doClose">{{$t('global.cancel')}}</el-button>
</el-row>
</el-dialog>
</template>
<script>
export default {
@ -38,7 +37,7 @@ export default {
},
computed: {
title() {
return '修改起始时间';
return this.$t('planMonitor.modifying.modifyStartTimeTitle');
}
},
mounted() {

View File

@ -13,14 +13,14 @@
<div style="margin: 10px">
<el-row>
<el-col :span="8">
<span style="position:relative; left: 12px; top: 9px">时间</span>
<span style="position:relative; left: 12px; top: 9px">{{$t('planMonitor.modifying.time')}}</span>
<div style="border: 1px solid #ADA99A">
<el-radio-group v-model="timeType" style="margin: 10px">
<el-row style="margin: 5px 0px">
<el-radio :label="1">起始站发车时间不变</el-radio>
<el-radio :label="1">{{$t('planMonitor.modifying.startStationTips')}}</el-radio>
</el-row>
<el-row style="margin: 5px 0px">
<el-radio :label="2">终到站到达时间不变</el-radio>
<el-radio :label="2">{{$t('planMonitor.modifying.endStationTips')}}</el-radio>
</el-row>
</el-radio-group>
</div>
@ -28,16 +28,16 @@
</el-row>
<el-row style="margin-top: 20px">
<el-table :data="routeDate" border style="width: 100%" height="120">
<el-table-column prop="beginStationCode" label="起始站" />
<el-table-column prop="beginStationStandCode" label="起始站台" />
<el-table-column prop="endStationCode" label="终到站" />
<el-table-column prop="endStationStandCode" label="终到站台" />
<el-table-column prop="describe" label="描述" width="250" />
<el-table-column prop="beginStationCode" :label="$t('planMonitor.modifying.startStationTitle')" />
<el-table-column prop="beginStationStandCode" :label="$t('planMonitor.modifying.startedStation')" />
<el-table-column prop="endStationCode" :label="$t('planMonitor.modifying.endStationTitle')" />
<el-table-column prop="endStationStandCode" :label="$t('planMonitor.modifying.endedStation')" />
<el-table-column prop="describe" :label="$t('planMonitor.modifying.description')" width="250" />
</el-table>
</el-row>
<el-row type="flex" justify="center" class="button-group">
<el-button @click="handleCommit"> </el-button>
<el-button @click="doClose"> </el-button>
<el-button @click="handleCommit">{{$t('global.confirm')}}</el-button>
<el-button @click="doClose">{{$t('global.cancel')}}</el-button>
</el-row>
</div>
</el-dialog>
@ -59,7 +59,7 @@ export default {
},
computed: {
title() {
return '修改任务交路';
return this.$t('planMonitor.modifying.modifyTaskRoute');
}
},
mounted() {

View File

@ -12,37 +12,37 @@
>
<el-row>
<el-table :data="stationIntervalData" border style="width: 100%" height="320">
<el-table-column prop="startStationCode" label="起始站" width="120">
<el-table-column prop="startStationCode" :label="$t('planMonitor.modifying.startingStation')" width="120">
<template slot-scope="scope">
<span style="margin-left: 10px">{{ formatName(scope.row.startStationCode) }}</span>
</template>
</el-table-column>
<el-table-column prop="startSectionCode" label="起始区段">
<el-table-column prop="startSectionCode" :label="$t('planMonitor.modifying.startSection')">
<template slot-scope="scope">
<span style="margin-left: 10px">{{ formatName(scope.row.startSectionCode) }}</span>
</template>
</el-table-column>
<el-table-column prop="endStationCode" label="终点站" width="120">
<el-table-column prop="endStationCode" :label="$t('planMonitor.modifying.endStation')" width="120">
<template slot-scope="scope">
<span style="margin-left: 10px">{{ formatName(scope.row.endStationCode) }}</span>
</template>
</el-table-column>
<el-table-column prop="endSectionCode" label="终点区段">
<el-table-column prop="endSectionCode" :label="$t('planMonitor.modifying.endSection')">
<template slot-scope="scope">
<span style="margin-left: 10px">{{ formatName(scope.row.endSectionCode) }}</span>
</template>
</el-table-column>
<el-table-column prop="directionCode" label="方向" width="60">
<el-table-column prop="directionCode" :label="$t('planMonitor.modifying.direction')" width="60">
<template slot-scope="scope">
<span style="margin-left: 10px">{{ DirectionCodeMap[scope.row.directionCode] }}</span>
</template>
</el-table-column>
<el-table-column prop="distance" label="距离" width="65">
<el-table-column prop="distance" :label="$t('planMonitor.modifying.distance')" width="65">
<template slot-scope="scope">
<span style="margin-left: 10px">{{ scope.row.distance/100 }}</span>
</template>
</el-table-column>
<el-table-column prop="runPlanLevelVO" label="等级一" width="70">
<el-table-column prop="runPlanLevelVO" :label="$t('planMonitor.updateStation.level1')" width="70">
<template slot-scope="scope">
<span
style="margin-left: 10px"
@ -50,7 +50,7 @@
>{{ scope.row.runPlanLevelVO.level1 || '' }}</span>
</template>
</el-table-column>
<el-table-column prop="runPlanLevelVO" label="等级二" width="70">
<el-table-column prop="runPlanLevelVO" :label="$t('planMonitor.updateStation.level2')" width="70">
<template slot-scope="scope">
<span
style="margin-left: 10px"
@ -58,7 +58,7 @@
>{{ scope.row.runPlanLevelVO.level2 || '' }}</span>
</template>
</el-table-column>
<el-table-column prop="runPlanLevelVO" label="等级三" width="70">
<el-table-column prop="runPlanLevelVO" :label="$t('planMonitor.updateStation.level3')" width="70">
<template slot-scope="scope">
<span
style="margin-left: 10px"
@ -66,7 +66,7 @@
>{{ scope.row.runPlanLevelVO.level3 || '' }}</span>
</template>
</el-table-column>
<el-table-column prop="runPlanLevelVO" label="等级四" width="70">
<el-table-column prop="runPlanLevelVO" :label="$t('planMonitor.updateStation.level4')" width="70">
<template slot-scope="scope">
<span
style="margin-left: 10px"
@ -74,7 +74,7 @@
>{{ scope.row.runPlanLevelVO.level4 || '' }}</span>
</template>
</el-table-column>
<el-table-column prop="runPlanLevelVO" label="等级五" width="70">
<el-table-column prop="runPlanLevelVO" :label="$t('planMonitor.updateStation.level5')" width="70">
<template slot-scope="scope">
<span
style="margin-left: 10px"
@ -82,16 +82,16 @@
>{{ scope.row.runPlanLevelVO.level5 || '' }}</span>
</template>
</el-table-column>
<el-table-column label="操作" width="100">
<el-table-column :label="$t('planMonitor.modifying.operation')" width="100">
<template slot-scope="scope">
<el-button type="text" size="small" @click="handleUpdate(scope.row)">编辑</el-button>
<el-button type="text" size="small" @click="handleUpdate(scope.row)">{{$t('planMonitor.modifying.edit')}}</el-button>
</template>
</el-table-column>
</el-table>
</el-row>
<div class="button-group" style="text-align: center; margin-top: 10px;">
<el-button type="primary" @click="handleSave">保存</el-button>
<el-button @click="doClose">取消&退出</el-button>
<el-button type="primary" @click="handleSave">{{$t('planMonitor.modifying.save')}}</el-button>
<el-button @click="doClose">{{$t('planMonitor.modifying.cancelAndQuit')}}</el-button>
</div>
<update-station-interval-time ref="updateStationIntervalTime" @handleConfirm="handleConfirm" />
</el-dialog>
@ -124,7 +124,7 @@ export default {
},
computed: {
title() {
return '修改运行等级';
return this.$t('planMonitor.modifying.modifyRunLevel');
}
},
mounted() {
@ -187,9 +187,9 @@ export default {
this.stationIntervalData.forEach(elem => {
elem.isEditStatus = false;
});
this.$message.success('修改成功!');
this.$message.success(this.$t('planMonitor.modifying.modifySuccess'));
}).catch(() => {
this.$messageBox('修改失败');
this.$messageBox(this.$t('planMonitor.modifying.modifyFailed'));
});
}
}

View File

@ -14,10 +14,10 @@
<el-col :span="4">
<el-row>
<el-col :span="9" class="lineHeight">
<span>车次号</span>
<span>{{ $t('planMonitor.modifying.tripNumber') }}</span>
</el-col>
<el-col :span="15">
<el-select v-model="editModel.tripNumber" size="mini" style="display: inline-black" placeholder="请选择">
<el-select v-model="editModel.tripNumber" size="mini" style="display: inline-black" :placeholder="$t('planMonitor.modifying.pleaseSelect')">
<el-option
v-for="item in tripNumberList"
:key="item.value"
@ -31,21 +31,21 @@
<el-col :span="2">
<el-row>
<el-col :offset="8" class="lineHeight">
<el-checkbox v-model="editModel.trainManual">手工</el-checkbox>
<el-checkbox v-model="editModel.trainManual">{{ $t('planMonitor.modifying.manual') }}</el-checkbox>
</el-col>
</el-row>
</el-col>
<el-col :span="6">
<el-row>
<el-col :span="11" :offset="1" class="lineHeight">
<span>缺省停站时间</span>
<span>{{ $t('planMonitor.modifying.defaultStopTime') }}</span>
</el-col>
<el-col :span="12">
<el-select
v-model="editModel.defaultStopTime"
style="display: inline-black"
size="mini"
placeholder="请选择"
:placeholder="$t('planMonitor.modifying.pleaseSelect')"
>
<el-option
v-for="item in defaultStopTimeList"
@ -60,7 +60,7 @@
<el-col :span="5">
<el-row>
<el-col :span="9" :offset="2" class="lineHeight">
<span>表号</span>
<span>{{ $t('planMonitor.modifying.serviceNumber') }}</span>
</el-col>
<el-col :span="13">
<el-input v-model="editModel.serviceNumber" size="mini" />
@ -72,13 +72,13 @@
<el-col :span="22" :offset="2">
<el-row>
<el-col :span="6">
<el-checkbox v-model="editModel.clearGuest">清客</el-checkbox>
<el-checkbox v-model="editModel.clearGuest">{{ $t('planMonitor.modifying.clearGuest') }}</el-checkbox>
</el-col>
<el-col :span="8">
<el-checkbox v-model="editModel.continuationPlan">延续计划</el-checkbox>
<el-checkbox v-model="editModel.continuationPlan">{{ $t('planMonitor.modifying.continuationPlan') }}</el-checkbox>
</el-col>
<el-col :span="6">
<el-checkbox v-model="editModel.firstTrain">首班车</el-checkbox>
<el-checkbox v-model="editModel.firstTrain">{{ $t('planMonitor.modifying.firstTrain') }}</el-checkbox>
</el-col>
</el-row>
</el-col>
@ -89,10 +89,10 @@
<el-col :span="4">
<el-row>
<el-col :span="9" class="lineHeight">
<span>序列号</span>
<span>{{ $t('planMonitor.modifying.serialNumber') }}</span>
</el-col>
<el-col :span="15">
<el-select v-model="editModel.serialNumber" size="mini" style="display: inline-black" placeholder="请选择">
<el-select v-model="editModel.serialNumber" size="mini" style="display: inline-black" :placeholder="$t('planMonitor.modifying.pleaseSelect')">
<el-option
v-for="item in serialNumberList"
:key="item.value"
@ -106,21 +106,21 @@
<el-col :span="2">
<el-row>
<el-col :offset="8" class="lineHeight">
<el-checkbox v-model="editModel.serialManual" size="mini">手工</el-checkbox>
<el-checkbox v-model="editModel.serialManual" size="mini">{{ $t('planMonitor.modifying.manual') }}</el-checkbox>
</el-col>
</el-row>
</el-col>
<el-col :span="6" class="lineHeight">
<el-row>
<el-col :span="11" :offset="1">
<span>缺省运行等级</span>
<span>{{ $t('planMonitor.modifying.defaultRunLevel') }}</span>
</el-col>
<el-col :span="12">
<el-select
v-model="editModel.defaultSpeedLevel"
style="display: inline-black"
size="mini"
placeholder="请选择"
:placeholder="$t('planMonitor.modifying.pleaseSelect')"
>
<el-option
v-for="item in defaultSpeedLevelList"
@ -135,12 +135,12 @@
<el-col :span="5" class="lineHeight">
<el-row>
<el-col :span="9" :offset="2">
<span>开始时间</span>
<span>{{ $t('planMonitor.modifying.startTime') }}</span>
</el-col>
<el-col :span="13">
<el-time-picker
v-model="editModel.startTime"
placeholder="选择时间"
:placeholder="$t('planMonitor.modifying.selectTime')"
value-format="HH:mm:ss"
size="mini"
:clearable="false"
@ -153,13 +153,13 @@
<el-col :span="22" :offset="2">
<el-row>
<el-col :span="6">
<el-checkbox v-model="editModel.inStock">入库</el-checkbox>
<el-checkbox v-model="editModel.inStock">{{ $t('planMonitor.modifying.inStock') }}</el-checkbox>
</el-col>
<el-col :span="8">
<el-checkbox v-model="editModel.outStock">出库</el-checkbox>
<el-checkbox v-model="editModel.outStock">{{ $t('planMonitor.modifying.outStock') }}</el-checkbox>
</el-col>
<el-col :span="6">
<el-checkbox v-model="editModel.lastTrain">末班车</el-checkbox>
<el-checkbox v-model="editModel.lastTrain">{{ $t('planMonitor.modifying.lastTrain') }}</el-checkbox>
</el-col>
</el-row>
</el-col>
@ -167,59 +167,58 @@
</el-col>
</el-row>
<el-row style="margin-bottom: 5px;">
交路
{{ $t('planMonitor.modifying.route') }}
</el-row>
<el-row>
<el-table :data="editModel.routingList" border :height="140">
<el-table-column prop="startStationCode" label="起始站">
<el-table-column prop="startStationCode" :label="$t('planMonitor.modifying.startingStation')">
<template slot-scope="scope">
{{ formatName(scope.row.startStationCode) }}
</template>
</el-table-column>
<el-table-column prop="startSectionCode" label="起始区段" />
<el-table-column prop="endStationCode" label="终到站">
<el-table-column prop="startSectionCode" :label="$t('planMonitor.modifying.startSection')" />
<el-table-column prop="endStationCode" :label="$t('planMonitor.modifying.endStationTitle')">
<template slot-scope="scope">
{{ formatName(scope.row.endStationCode) }}
</template>
</el-table-column>
<el-table-column prop="endSectionCode" label="终到区段" />
<el-table-column prop="remarks" label="描述" :width="280" />
<el-table-column prop="endSectionCode" :label="$t('planMonitor.modifying.endSection')" />
<el-table-column prop="remarks" :label="$t('planMonitor.modifying.description')" :width="280" />
<el-table-column :width="40" />
</el-table>
</el-row>
<el-row style=" margin-bottom: 5px;margin-top: 10px;">
详情
{{ $t('planMonitor.modifying.detail') }}
</el-row>
<el-row>
<el-table :data="editModel.arriveConfigList" border :height="180">
<el-table-column prop="stationCode" label="车站">
<el-table-column prop="stationCode" :label="$t('planMonitor.modifying.station')">
<template slot-scope="scope">
{{ formatName(scope.row.stationCode) }}
</template>
</el-table-column>
<el-table-column prop="sectionCode" label="区段">
<el-table-column prop="sectionCode" :label="$t('planMonitor.modifying.section')">
<template slot-scope="scope">
{{ formatName(scope.row.sectionCode) }}
</template>
</el-table-column>
<el-table-column prop="arriveTime" label="到点" />
<el-table-column prop="stopTime" label="停站时间" />
<el-table-column prop="departureTime" label="发点" />
<el-table-column prop="speedLevel" label="运行等级" />
<el-table-column prop="arriveTime" :label="$t('planMonitor.modifying.arrivalTime')" />
<el-table-column prop="stopTime" :label="$t('planMonitor.modifying.stopTime')" />
<el-table-column prop="departureTime" :label="$t('planMonitor.modifying.departureTime')" />
<el-table-column prop="speedLevel" :label="$t('planMonitor.modifying.runLevel')" />
</el-table>
</el-row>
<el-row>
<el-col :offset="16">
<el-checkbox v-model="editModel.default">显示默认停站时间和运行等级</el-checkbox>
<el-checkbox v-model="editModel.default">{{ $t('planMonitor.modifying.showDefaultTime') }}</el-checkbox>
</el-col>
</el-row>
<span slot="footer" class="dialog-footer">
<el-button size="medium" @click="doClose"> </el-button>
<el-button type="primary" size="medium" @click="handleCommit"> </el-button>
<el-button size="medium" @click="doClose">{{ $t('global.cancel') }}</el-button>
<el-button type="primary" size="medium" @click="handleCommit">{{ $t('global.confirm') }}</el-button>
</span>
</el-dialog>
</template>
<script>
import { getRoutingBySDTNumber, querySectionListByRouting, getStationRunning, updatePlanTrip } from '@/api/runplan';
import { formatTime, formatName } from '@/utils/runPlan';
@ -257,15 +256,15 @@ export default {
inStock: false,
outStock: false
},
tripNumberList: [{ value: '', label: '自动' }],
defaultStopTimeList: [{ value: '', label: '默认' }],
defaultSpeedLevelList: [{ value: '', label: '默认' }],
tripNumberList: [{ value: '', label: this.$t('planMonitor.modifying.automatic') }],
defaultStopTimeList: [{ value: '', label: this.$t('planMonitor.modifying.default') }],
defaultSpeedLevelList: [{ value: '', label: this.$t('planMonitor.modifying.default') }],
serialNumberList: []
};
},
computed: {
title() {
return '修改任务';
return this.$t('planMonitor.modifying.modifyTask');
}
},
watch: {
@ -299,7 +298,7 @@ export default {
if (stopStationObj.runPlanLevelVO) {
runTime = parseInt(stopStationObj.runPlanLevelVO[runLevel]);
} else {
this.$messageBox(`请先设置开始区段 ${stopStationObj.startSectionCode} 终到区段 ${stopStationObj.endSectionCode} 的站间运行时间`);
this.$messageBox(`${this.$t('planMonitor.modifying.setMessageTip1')} ${stopStationObj.startSectionCode} ${this.$t('planMonitor.modifying.setMessageTip2')} ${stopStationObj.endSectionCode} ${this.$t('planMonitor.modifying.setMessageTip3')}`);
}
}
}
@ -317,8 +316,8 @@ export default {
list.forEach((elem, index) => {
elem.arriveTime = index ? formatTime(tempTime) : '';
elem.departureTime = index == list.length - 1 ? '' : formatTime(tempTime + waitTime);
elem.stopTime = this.editModel.defaultSpeedLevel || '默认';
elem.speedLevel = this.editModel.defaultStopTime || '默认';
elem.stopTime = this.editModel.defaultSpeedLevel || this.$t('planMonitor.modifying.default');
elem.speedLevel = this.editModel.defaultStopTime || this.$t('planMonitor.modifying.default');
tempTime = tempTime + waitTime + this.compuntedRunTime(list, index, runLevel);
});
@ -405,9 +404,9 @@ export default {
this.$emit('dispatchOperate', {
dialogName: 'openRunPlan', operate: 'loadRunPlanData', params: Object.assign({refresh: true}, this.$route.query)
});
this.$message.success('修改任务成功!');
this.$message.success(this.$t('planMonitor.modifying.modifyTaskSuccess'));
}).catch(() => {
this.$messageBox('修改任务失败');
this.$messageBox(this.$t('planMonitor.modifying.modifyTaskFailed'));
});
}
this.doClose();

View File

@ -5,13 +5,24 @@
class="planEdit__tool open-runplan"
:title="title"
:visible.sync="show"
width="640px"
width="800px"
:before-close="doClose"
:z-index="2000"
:modal="true"
:close-on-click-modal="false"
>
<el-scrollbar wrap-class="scrollbar-wrapper" :style="{height: height+'px'}">
<el-table :data="runPlanList" height="350" border style="width: 100%">
<el-table-column prop="name" label="运行图名称" />
<el-table-column prop="createTime" label="创建日期" width="180" />
<el-table-column label="操作">
<template slot-scope="scope">
<el-button size="mini" class="button_box" @click="handleConfirm(scope.row)">加载</el-button>
<el-button size="mini" class="button_box" @click="handleEdit(scope.row)">修改名称</el-button>
<el-button size="mini" class="button_box" type="danger" @click="handleDelete(scope.row)">删除</el-button>
</template>
</el-table-column>
</el-table>
<!-- <el-scrollbar wrap-class="scrollbar-wrapper" :style="{height: height+'px'}">
<el-tree
ref="tree"
class="filter-tree"
@ -22,13 +33,13 @@
:style="{height: height-20+'px'}"
@node-click="handleNodeClick"
/>
</el-scrollbar>
<el-row type="flex" justify="center" class="button-group">
<el-button v-if="type == 'add'" type="primary" @click="handleConfirm">{{$t('planMonitor.openRunPlan.selectRunplan')}}</el-button>
<el-button v-if="type == 'delete'" type="primary" @click="handleDelete">{{$t('planMonitor.openRunPlan.delete')}}</el-button>
<el-button v-if="type == 'edit'" type="primary" @click="handleEdit">{{$t('planMonitor.openRunPlan.modify')}}</el-button>
<el-button @click="dialogShow = false">{{$t('global.cancel')}}</el-button>
</el-row>
</el-scrollbar> -->
<!-- <el-row type="flex" justify="center" class="button-group">
<el-button v-if="type == 'add'" type="primary" @click="handleConfirm">选择运行图</el-button>
<el-button v-if="type == 'delete'" type="primary" @click="handleDelete">删除</el-button>
<el-button v-if="type == 'edit'" type="primary" @click="handleEdit">修改</el-button>
<el-button @click="dialogShow = false"> </el-button>
</el-row> -->
</el-dialog>
<edit-plan-name ref="editPlan" @renewal="getRunPlanList" />
</div>
@ -54,15 +65,15 @@ export default {
dialogShow: false,
loading: false,
height: 260,
planId: '',
planName: '',
// planId: '',
// planName: '',
type: 'add',
// defaultShowKeys: [],
runPlanList: [],
runPlanDict: {},
defaultProps: {
label: 'name'
}
runPlanDict: {}
// defaultProps: {
// label: 'name'
// }
};
},
computed: {
@ -81,10 +92,10 @@ export default {
});
},
methods: {
handleNodeClick(data) {
this.planId = data.id;
this.planName = data.name;
},
// handleNodeClick(data) {
// this.planId = data.id;
// this.planName = data.name;
// },
loadRunPlanData({ refresh, planId, skinCode, planName }) {
if (refresh) {
this.$store.dispatch('runPlan/refresh');
@ -99,7 +110,6 @@ export default {
this.runPlanList.forEach(elem => {
this.runPlanDict[elem.id] = elem.name;
});
// this.defaultShowKeys = [this.planId];
this.dialogShow = true;
}).catch(() => {
this.$messageBox(this.$t('planMonitor.openRunPlan.getRunPlanListFail'));
@ -111,28 +121,28 @@ export default {
},
doClose() {
this.dialogShow = false;
this.planId = '';
this.planName = '';
// this.planId = '';
// this.planName = '';
},
//
handleConfirm() {
handleConfirm(row) {
this.loadRunPlanData({
planId: this.planId,
planId: row.id,
skinCode: this.$route.query.skinCode,
planName: this.planName
planName: row.name
});
this.doClose();
},
//
handleDelete() {
handleDelete(row) {
this.$confirm(this.$t('planMonitor.openRunPlan.confirmDeleteRunPlan'), this.$t('tip.hint'), {
confirmButtonText: this.$t('tip.confirm'),
cancelButtonText: this.$t('tip.cancel'),
type: 'warning'
}).then(() => {
deleteRunPlan(this.planId).then(Response => {
deleteRunPlan(row.id).then(Response => {
this.$message.success(this.$t('planMonitor.openRunPlan.deleteSuccess'));
if (this.planId === this.$route.query.planId) {
if (row.id === this.$route.query.planId) {
const query = { skinCode: this.$route.query.skinCode, mapId: this.$route.query.mapId };
this.$router.push({ path: `${UrlConfig.plan.tool}`, query: query });
}
@ -143,9 +153,9 @@ export default {
}).catch(() => { });
},
//
handleEdit() {
if (this.planId && this.planName) {
this.$refs.editPlan.doShow({id: this.planId, name: this.planName});
handleEdit(row) {
if (row.id && row.name) {
this.$refs.editPlan.doShow({id: row.id, name: row.name});
} else {
this.$message.info(this.$t('planMonitor.openRunPlan.pleaseSelectRunplan'));
}
@ -166,4 +176,8 @@ export default {
// background: #ECE9D8 !important;
}
}
.button_box{
float: left;
margin: 0 2px!important;
}
</style>

View File

@ -86,7 +86,7 @@ export default {
columns: [
{
prop: 'tripNumber',
label: this.$t('planMonitor.tripNumber'),
label: this.$t('planMonitor.tripNumber')
}
]
},