Merge branch 'test' of git.code.tencent.com:lian-cbtc/jl-client into yly_eg2d

This commit is contained in:
yuan 2021-07-14 09:20:57 +08:00
commit 4bb31b119a
6 changed files with 68 additions and 23 deletions

View File

@ -36,6 +36,13 @@ export default {
backgroundHeight: 'backgroundHeight', backgroundHeight: 'backgroundHeight',
buttonCode: 'Button code', buttonCode: 'Button code',
buttonColor: 'Button color', buttonColor: 'Button color',
buttonLightColor: 'Button Light Color',
red: 'Red',
blue: 'Blue',
yellow: 'Yellow',
green: 'Green',
gray: 'White',
button: 'Button',
buttonWidth: 'Button width', buttonWidth: 'Button width',
redButton: 'Red button', redButton: 'Red button',
blueButton: 'Blue button', blueButton: 'Blue button',

View File

@ -41,6 +41,13 @@ export default {
backgroundHeight: '背景板高度', backgroundHeight: '背景板高度',
buttonCode: '按钮编号', buttonCode: '按钮编号',
buttonColor: '按钮颜色', buttonColor: '按钮颜色',
buttonLightColor: '按钮灯颜色',
red: '红色',
blue: '蓝色',
yellow: '黄色',
green: '绿色',
gray: '白色',
button: '按钮',
buttonWidth: '按钮宽度', buttonWidth: '按钮宽度',
redButton: '红色按钮', redButton: '红色按钮',
blueButton: '蓝色按钮', blueButton: '蓝色按钮',

View File

@ -86,7 +86,12 @@ export default class button extends Group {
} }
getImagePic() { getImagePic() {
const color = colors.get(`${this.model.color}${this.model.pressed ? '_pressed' : ''}_${this.model.status}`); let color;
if (this.model.status === 'on') {
color = colors.get(`${this.model.lightColor || this.model.color}${this.model.pressed ? '_pressed' : ''}_on`)
} else if (this.model.status === 'off') {
color = colors.get(`${this.model.color}${this.model.pressed ? '_pressed' : ''}_off`)
}
return color; return color;
} }

View File

@ -139,8 +139,8 @@ export const IbpOperation = {
XXYS: {operate: '09', event: 'XXYS', name: '下行钥匙'}, XXYS: {operate: '09', event: 'XXYS', name: '下行钥匙'},
SXYS: {operate: '11', event: 'SXYS', name: '上行钥匙'}, SXYS: {operate: '11', event: 'SXYS', name: '上行钥匙'},
AXLE_RESET: {operate: '12', event: 'AXLE_RESET', name: '计轴复位'}, AXLE_RESET: {operate: '12', event: 'AXLE_RESET', name: '计轴复位'},
AXLE_PRE_RESET: {operate: '13', event: 'AXLE_PRE_RESET', name: '计轴复位'}, AXLE_PRE_RESET: {operate: '13', event: 'AXLE_PRE_RESET', name: '计轴区段复位'},
PRERESET_Z: {operate: '14', event: 'PRERESET_Z', name: '计轴预复'}, PRERESET_Z: {operate: '14', event: 'PRERESET_Z', name: '计轴预复'},
SD: {operate: '15', event: 'SD', name: '试灯'}, SD: {operate: '15', event: 'SD', name: '试灯'},
XXGM: {operate: '16', event: 'XXGM', name: '下行屏蔽门开门'}, XXGM: {operate: '16', event: 'XXGM', name: '下行屏蔽门开门'},
SXGM: {operate: '17', event: 'SXGM', name: '上行屏蔽门开门'}, SXGM: {operate: '17', event: 'SXGM', name: '上行屏蔽门开门'},

View File

@ -10,11 +10,23 @@
</el-form-item> </el-form-item>
<el-form-item :label="this.$t('ibp.buttonColor')" prop="buttonColor"> <el-form-item :label="this.$t('ibp.buttonColor')" prop="buttonColor">
<el-select v-model="form.buttonColor" :placeholder="this.$t('ibp.selectTheButtonColor')"> <el-select v-model="form.buttonColor" :placeholder="this.$t('ibp.selectTheButtonColor')">
<el-option :label="this.$t('ibp.redButton')" value="red" /> <el-option
<el-option :label="this.$t('ibp.yellowButton')" value="yellow" /> v-for="item in colors"
<el-option :label="this.$t('ibp.greenButton')" value="green" /> :key="`btn${item}`"
<el-option :label="this.$t('ibp.blueButton')" value="blue" /> :label="`${$t(`ibp.${item}`)}${$t('ibp.button')}`"
<el-option :label="this.$t('ibp.grayButton')" value="gray" /> :value="item"
></el-option>
</el-select>
</el-form-item>
<el-form-item :label="this.$t('ibp.buttonLightColor')" prop="buttonLightColor">
<el-select v-model="form.buttonLightColor">
<el-option label="默认" value=""></el-option>
<el-option
v-for="item in colors"
:key="`light${item}`"
:label="`${$t(`ibp.${item}`)}`"
:value="item"
></el-option>
</el-select> </el-select>
</el-form-item> </el-form-item>
<el-form-item :label="this.$t('ibp.buttonWidth')" prop="buttonWidth"> <el-form-item :label="this.$t('ibp.buttonWidth')" prop="buttonWidth">
@ -86,14 +98,16 @@ export default {
{ label: "屏蔽门开门", value: "KM" }, { label: "屏蔽门开门", value: "KM" },
{ label: "屏蔽门关门", value: "GM" }, { label: "屏蔽门关门", value: "GM" },
{ label: "计轴复位", value: "AXLE_RESET" }, { label: "计轴复位", value: "AXLE_RESET" },
{ label: "计轴复位", value: "AXLE_PRE_RESET" }, { label: "计轴区段复位", value: "AXLE_PRE_RESET" },
{ label: "计轴预复", value: "PRERESET_Z" }, { label: "计轴预复", value: "PRERESET_Z" },
{ label: "试灯", value: "SD" } { label: "试灯", value: "SD" }
], ],
colors: ["red", "yellow", "blue", "green", "gray"],
operateWithoutDirections: ["AXLE_RESET", "AXLE_PRE_RESET", "PRERESET_Z", "SD"], operateWithoutDirections: ["AXLE_RESET", "AXLE_PRE_RESET", "PRERESET_Z", "SD"],
form: { form: {
code: "", code: "",
buttonColor: "red", buttonColor: "red",
buttonLightColor: "",
buttonWidth: 25, buttonWidth: 25,
x: 10, x: 10,
y: 10, y: 10,
@ -125,6 +139,7 @@ export default {
this.isUpdate = true; this.isUpdate = true;
this.form.code = model.code; this.form.code = model.code;
this.form.buttonColor = model.color; this.form.buttonColor = model.color;
this.form.buttonLightColor = model.lightColor;
this.form.buttonWidth = model.width; this.form.buttonWidth = model.width;
this.form.x = model.point.x; this.form.x = model.point.x;
this.form.y = model.point.y; this.form.y = model.point.y;
@ -167,6 +182,7 @@ export default {
_type: "SquareButton", _type: "SquareButton",
code: this.form.code, code: this.form.code,
color: this.form.buttonColor, color: this.form.buttonColor,
lightColor: this.form.buttonLightColor,
status: "off", status: "off",
width: this.form.buttonWidth, width: this.form.buttonWidth,
mean: this.form.mean, mean: this.form.mean,
@ -189,6 +205,7 @@ export default {
_type: "SquareButton", _type: "SquareButton",
code: this.form.code, code: this.form.code,
color: this.form.buttonColor, color: this.form.buttonColor,
lightColor: this.form.buttonLightColor,
status: "off", status: "off",
width: this.form.buttonWidth, width: this.form.buttonWidth,
mean: this.form.mean, mean: this.form.mean,
@ -205,6 +222,7 @@ export default {
this.form = { this.form = {
code: "", code: "",
buttonColor: "red", buttonColor: "red",
buttonLightColor: "",
buttonWidth: 25, buttonWidth: 25,
x: 10, x: 10,
y: 10, y: 10,

View File

@ -2,7 +2,7 @@
<div> <div>
<div class="schema" :style="{top: offset+'px'}"> <div class="schema" :style="{top: offset+'px'}">
<select-station v-if="isLocalStation && !isScript" ref="selectStation" :style-css="'width: 100px;'" /> <select-station v-if="isLocalStation && !isScript" ref="selectStation" :style-css="'width: 100px;'" />
<el-select v-if="isAdmin" v-model="speed" style="width: 100px;" size="small" @change="speedChange"> <el-select v-model="speed" style="width: 100px;" size="small" @change="speedChange">
<el-option <el-option
v-for="item in speedList" v-for="item in speedList"
:key="item.value" :key="item.value"
@ -84,18 +84,6 @@ export default {
swch: '02', swch: '02',
isScriptCommand:false, isScriptCommand:false,
faultMode: false, faultMode: false,
speedList:[
{ value: 1, label: '1倍速' },
{ value: 2, label: '2倍速' },
{ value: 3, label: '3倍速' },
{ value: 4, label: '4倍速' },
{ value: 5, label: '5倍速' },
{ value: 6, label: '6倍速' },
{ value: 7, label: '7倍速' },
{ value: 8, label: '8倍速' },
{ value: 9, label: '9倍速' },
{ value: 10, label: '10倍速' }
],
speed: 1 speed: 1
// firstLoad: true // firstLoad: true
}; };
@ -133,6 +121,26 @@ export default {
}, },
isAdmin() { isAdmin() {
return this.$store.state.user.roles.includes('04') || this.$store.state.user.roles.includes('05'); return this.$store.state.user.roles.includes('04') || this.$store.state.user.roles.includes('05');
},
speedList() {
return this.isAdmin ? [
{ value: 1, label: '1倍速' },
{ value: 2, label: '2倍速' },
{ value: 3, label: '3倍速' },
{ value: 4, label: '4倍速' },
{ value: 5, label: '5倍速' },
{ value: 6, label: '6倍速' },
{ value: 7, label: '7倍速' },
{ value: 8, label: '8倍速' },
{ value: 9, label: '9倍速' },
{ value: 10, label: '10倍速' }
] : [
{ value: 1, label: '1倍速' },
{ value: 2, label: '2倍速' },
{ value: 3, label: '3倍速' },
{ value: 4, label: '4倍速' },
{ value: 5, label: '5倍速' }
];
} }
}, },
watch: { watch: {