This commit is contained in:
fan 2019-09-12 13:22:40 +08:00
commit cf45174dad
5 changed files with 77 additions and 26 deletions

View File

@ -75,5 +75,27 @@ export default {
back: 'Back',
startPlanFail: 'Start planning failed, please go back and try again',
endPlanFail: 'End plan failed, please go back'
},
schema: {
selectProduct: 'Please select product type',
loadScript: 'Load Script',
previewRunDiagram: 'Preview Run Diagram',
loadRunDiagram: 'Load Run Diagram',
faultSetting: 'Fault Setting',
normalOperation: 'Normal Operation',
faultOperation: 'Fault Operation',
getRunDiagramFail: 'Failed to get run diagram data',
todayRunDiagramNoLoad: 'Today\'s run diagram is not loaded',
getStationListFail: 'Failed to get station list'
},
faultChoose: {
manual: 'Manual',
automatic: 'Automatic',
settingCondition: 'Setting Condition',
triggerTarget: 'Trigger Target',
selectFault: 'Select Fault',
selectRules: 'Please select rules',
setFaultSuccess: 'Set fault success',
setFaultFail: 'Set fault failed'
}
};

View File

@ -75,6 +75,39 @@ export default {
back: '返回',
startPlanFail: '开始计划失败,请返回重试',
endPlanFail: '结束计划失败,请返回'
},
schema: {
selectProduct: '请选择产品类型',
loadScript: '加载剧本',
previewRunDiagram: '运行图预览',
loadRunDiagram: '运行图加载',
faultSetting: '故障设置',
normalOperation: '正常操作',
faultOperation: '故障操作',
getRunDiagramFail: '获取运行图数据失败',
todayRunDiagramNoLoad: '今日运行图未加载',
getStationListFail: '获取车站列表失败'
},
faultChoose: {
manual: '手动',
automatic: '自动',
settingCondition: '设置条件',
triggerTarget: '触发目标',
selectFault: '选择故障',
selectRules: '请选择规则',
setFaultSuccess: '设置故障成功',
setFaultFail: '设置故障失败'
},
setTime: {
// 系统时间
// 任意时间点
// 加载列车数
// 请选择可加载列车个数
// 可加载的最大车辆个数
// 设置仿真系统时间
// 请选择系统时间
// 请选择有效的开始时间
// 请选择车辆个数
}
};

View File

@ -22,9 +22,6 @@ export default {
modifyScriptSuccess: '修改剧本成功',
modifyScriptFail: '修改剧本失败',
deleteScriptTip: '此操作将删除此剧本, 是否继续?',
operateTip: '提示',
confirmButtonText: '确定',
cancelButtonText: '取消',
deleteScriptSucess: '删除成功',
deleteScriptFail: '删除失败',
scriptRecordTitle: '剧本编制',

View File

@ -2,8 +2,8 @@
<el-dialog :title="title" :visible.sync="dialogShow" width="800px" :before-close="doClose" :modal="false">
<div class="draft">
<el-radio-group v-model="auto">
<el-radio :label="false" border>手动</el-radio>
<el-radio :label="true" border>自动</el-radio>
<el-radio :label="false" border>{{$t('display.faultChoose.manual')}}</el-radio>
<el-radio :label="true" border>{{$t('display.faultChoose.automatic')}}</el-radio>
</el-radio-group>
</div>
<div class="card" v-if="auto">
@ -11,8 +11,8 @@
</QueryListPage>
</div>
<span slot="footer" class="dialog-footer">
<el-button @click="dialogShow = false"> </el-button>
<el-button type="primary" @click="handleConfirm" :loading="loading"> </el-button>
<el-button @click="dialogShow = false">{{$t('global.cancel')}}</el-button>
<el-button type="primary" @click="handleConfirm" :loading="loading">{{$t('global.confirm')}}</el-button>
</span>
</el-dialog>
</template>
@ -46,7 +46,7 @@
queryObject: {
condition: {
type: 'text',
label: '设置条件'
label: this.$t('display.faultChoose.settingCondition')
}
}
},
@ -56,11 +56,11 @@
radioShow: true,
columns: [
{
title: '设置条件',
title: this.$t('display.faultChoose.settingCondition'),
prop: 'condition'
},
{
title: '触发目标',
title: this.$t('display.faultChoose.triggerTarget'),
prop: 'target'
}
]
@ -69,7 +69,7 @@
},
computed: {
title() {
return '选择故障'
return this.$t('display.faultChoose.selectFault')
},
skinCode() {
return this.$route.query.skinCode;
@ -126,11 +126,10 @@
},
getFailureModel(auto) {
let model = { auto };
if (auto) {
const choose = this.$refs.pageRules.currentChoose();
if (choose) {
choose.id ? Object.assign(model, { ruleId: choose.id }) : this.$messageBox(`请选择规则`);
choose.id ? Object.assign(model, { ruleId: choose.id }) : this.$messageBox(this.$t('display.faultChoose.selectRules'));
}
}
@ -140,9 +139,9 @@
this.$nextTick(() => {
let faultModel = this.getFailureModel(this.auto);
setFailureMode(faultModel, this.group).then(() => {
this.$message.success(`设置故障成功`);
this.$message.success(this.$t('display.faultChoose.setFaultSuccess'));
}).catch(error => {
this.$messageBox(`设置故障失败`);
this.$messageBox(this.$t('display.faultChoose.setFaultFail'));
})
this.doClose();

View File

@ -1,19 +1,19 @@
<template>
<div class="schema" :style="{top: offset+'px'}">
<el-select v-if="isScript" v-model="swch" size="small" placeholder="请选择产品类型" @change="switchMode">
<el-select v-if="isScript" v-model="swch" size="small" :placeholder="$t('display.schema.selectProduct')" @change="switchMode">
<el-option v-for="item in swchList" :key="item.value" :label="item.name" :value="item.value" />
</el-select>
<el-button-group>
<el-button v-if="isDemon" size="small" :disabled="viewDisabled" type="success" @click="viewRunQuest">加载剧本</el-button>
<el-button v-if="notScript && runing" size="small" :disabled="viewDisabled" @click="viewRunPlan">运行图预览</el-button>
<el-button v-if="!runing && !isPlan && notScript" size="small" :disabled="viewDisabled" type="warning" @click="loadRunPlan">运行图加载</el-button>
<el-button v-if="mode==OperateMode.FAULT" size="small" type="danger" @click="setFault">故障设置</el-button>
<el-button v-if="isDemon" size="small" :disabled="viewDisabled" type="success" @click="viewRunQuest">{{$t('display.schema.loadScript')}}</el-button>
<el-button v-if="notScript && runing" size="small" :disabled="viewDisabled" @click="viewRunPlan">{{$t('display.schema.previewRunDiagram')}}</el-button>
<el-button v-if="!runing && !isPlan && notScript" size="small" :disabled="viewDisabled" type="warning" @click="loadRunPlan">{{$t('display.schema.loadRunDiagram')}}</el-button>
<el-button v-if="mode==OperateMode.FAULT" size="small" type="danger" @click="setFault">{{$t('display.schema.faultSetting')}}</el-button>
</el-button-group>
<el-radio-group v-if="!isPlan" v-model="mode" size="small" @change="changeOperateMode(mode)">
<el-radio-button class="mode" :label="OperateMode.NORMAL">正常操作</el-radio-button>
<el-radio-button class="mode" :label="OperateMode.FAULT">故障操作</el-radio-button>
<el-radio-button class="mode" :label="OperateMode.NORMAL">{{$t('display.schema.normalOperation')}}</el-radio-button>
<el-radio-button class="mode" :label="OperateMode.FAULT">{{$t('display.schema.faultOperation')}}</el-radio-button>
</el-radio-group>
</div>
</template>
@ -96,7 +96,7 @@ export default {
this.viewDisabled = false;
}).catch(() => {
this.$store.dispatch('runPlan/setPlanData', []);
this.$messageBox(`获取运行图数据失败`);
this.$messageBox(this.$t('display.schema.getRunDiagramFail'));
});
} else {
getEveryDayRunPlanData(this.group).then(resp => {
@ -105,15 +105,15 @@ export default {
}).catch(error => {
this.$store.dispatch('runPlan/setPlanData', []);
if (error.code == 30001) {
this.$messageBox(`今日运行图未加载`);
this.$messageBox(this.$t('display.schema.todayRunDiagramNoLoad'));
} else {
this.$messageBox(`获取运行图数据失败`);
this.$messageBox(this.$t('display.schema.getRunDiagramFail'));
}
});
}
});
}).catch(() => {
this.$messageBox(`获取车站列表失败`);
this.$messageBox(this.$t('display.schema.getStationListFail'));
});
}
});