Merge branch 'test' of https://git.code.tencent.com/lian-cbtc/jl-client into test
This commit is contained in:
commit
5712885f8a
@ -9,6 +9,7 @@ export default class Button extends Group {
|
||||
this._type = device.model._type;
|
||||
this._code = device.model.code;
|
||||
this.zlevel = device.model.zlevel;
|
||||
this._function = device.model.function;
|
||||
this.z = device.model.z;
|
||||
this.create();
|
||||
}
|
||||
@ -18,36 +19,37 @@ export default class Button extends Group {
|
||||
id: model.code,
|
||||
position: [model.point.x, model.point.y]
|
||||
});
|
||||
this.buttonText = new Text({
|
||||
zlevel: model.zlevel,
|
||||
z: model.z + 1,
|
||||
style: {
|
||||
x: 0,
|
||||
y: 0,
|
||||
fontWeight: 'normal',
|
||||
fontSize: model.fontSize,
|
||||
fontFamily: 'consolas',
|
||||
text: model.context,
|
||||
textFill: '#FFF',
|
||||
textAlign: 'center',
|
||||
textPosition: 'inside',
|
||||
textVerticalAlign: 'bottom'
|
||||
}
|
||||
});
|
||||
const textRect = this.buttonText.getBoundingRect();
|
||||
this.buttonText.setStyle('textLineHeight', textRect.height);
|
||||
this.buttonRect = new Rect({
|
||||
zlevel: model.zlevel,
|
||||
z: model.z,
|
||||
shape: {
|
||||
x: 0,
|
||||
y: 0,
|
||||
width: model.width,
|
||||
height: model.height
|
||||
x: textRect.x - model.levelPadding,
|
||||
y: textRect.y - model.verticalPadding,
|
||||
width: textRect.width + 2 * model.levelPadding,
|
||||
height: textRect.height + 2 * model.verticalPadding
|
||||
},
|
||||
style: {
|
||||
fill: model.fillColor,
|
||||
stroke: model.strokeColor,
|
||||
lineWidth: model.borderWidth
|
||||
}
|
||||
});
|
||||
this.buttonText = new Text({
|
||||
zlevel: model.zlevel,
|
||||
z: model.z,
|
||||
style: {
|
||||
x: model.width / 2,
|
||||
y: model.height / 2,
|
||||
fontWeight: 'normal',
|
||||
fontSize: model.height - 2,
|
||||
fontFamily: 'consolas',
|
||||
text: model.context,
|
||||
textFill: model.textFill,
|
||||
textAlign: 'center',
|
||||
textPosition: 'inside',
|
||||
textVerticalAlign: 'middle',
|
||||
textLineHeight: model.height
|
||||
fill: '#879096',
|
||||
stroke: '#132E48',
|
||||
lineWidth: 1
|
||||
}
|
||||
});
|
||||
this.grouper.add(this.buttonRect);
|
||||
|
@ -34,6 +34,7 @@ import FasBrakeMachine from './fasBrakeMachine';
|
||||
import Staircase from './staircase';
|
||||
import SingleStaircase from './singleStaircase';
|
||||
import ArcStatus from './ArcStatus';
|
||||
import IscsButton from './button';
|
||||
|
||||
const iscsShape = {};
|
||||
iscsShape[deviceType.ManualAlarmButton] = ManualAlarmButton;
|
||||
@ -72,6 +73,7 @@ iscsShape[deviceType.FasBrakeMachine] = FasBrakeMachine;
|
||||
iscsShape[deviceType.Staircase] = Staircase;
|
||||
iscsShape[deviceType.SingleStaircase] = SingleStaircase;
|
||||
iscsShape[deviceType.ArcStatus] = ArcStatus;
|
||||
iscsShape[deviceType.IscsButton] = IscsButton;
|
||||
|
||||
function shapefactory(device, iscs) {
|
||||
const type = device.model._type;
|
||||
|
@ -157,14 +157,13 @@ class Jlmap {
|
||||
}
|
||||
|
||||
setUpdateScreen(opts) {
|
||||
const scale = 0.3;
|
||||
this.$painter.updateTransform1(
|
||||
[
|
||||
{ scaleRate: 0.3, offsetY: -100 },
|
||||
{ scaleRate: 0.3, offsetY: -300 },
|
||||
{ scaleRate: 0.3, offsetY: -500 },
|
||||
{ scaleRate: 0.3, offsetY: -700 },
|
||||
{ scaleRate: 0.3, offsetY: -900 },
|
||||
{ scaleRate: 0.3, offsetY: -1100 }
|
||||
{ scaleRate: scale, offsetY: -100 },
|
||||
{ scaleRate: scale, offsetY: -300 },
|
||||
{ scaleRate: scale, offsetY: -500 },
|
||||
{ scaleRate: scale, offsetY: -700 }
|
||||
],
|
||||
{width: opts.width, height: opts.height});
|
||||
}
|
||||
|
@ -42,6 +42,15 @@ class Model {
|
||||
};
|
||||
}
|
||||
|
||||
handleScreenProps(viewModel) { // 大屏隐藏元素
|
||||
const model = viewModel.model;
|
||||
if (model._type == deviceType.OutFrame ||
|
||||
model._type == deviceType.Text ||
|
||||
model._type == deviceType.AutoTurnBack) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
initPublicProps(model) {
|
||||
if (model) {
|
||||
var modelInitial = this.public[model._type];
|
||||
|
@ -1,5 +1,7 @@
|
||||
|
||||
import {createTransform, createBoundingRect} from './utils/parser';
|
||||
import Vue from 'vue';
|
||||
import store from '@/store/index_APP_TARGET';
|
||||
|
||||
class TransformHandle {
|
||||
constructor(painter) {
|
||||
@ -21,10 +23,15 @@ class TransformHandle {
|
||||
if (view) {
|
||||
for (let i = 0; i < this.transform.length; i++) {
|
||||
view.transform = this.transform[i];
|
||||
view.decomposeTransform();
|
||||
view.decomposeTransform(); // 修改 transform 后同步位置
|
||||
const propConvert = Vue.prototype.$theme.loadPropConvert(store.state.map.map.skinVO.code);
|
||||
if (propConvert.handleScreenProps && propConvert.handleScreenProps(view)) {
|
||||
view.hide();
|
||||
return;
|
||||
}
|
||||
if (this.checkVisible(view)) { view.show(); return; } else { view.hide(); }
|
||||
}
|
||||
view.dirty();
|
||||
view.dirty(); // 更新
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -1,25 +1,28 @@
|
||||
<template>
|
||||
<div>
|
||||
<el-form ref="form" :rules="rules" :model="form" label-width="80px">
|
||||
<el-form-item v-if="isUpdate" label="按钮编号" prop="code">
|
||||
<el-input v-model="from.code" :disabled="true" />
|
||||
<el-form ref="form" :rules="rules" :model="form" label-width="100px">
|
||||
<el-form-item v-if="isUpdate" label="按钮编号:" prop="code">
|
||||
<el-input v-model="form.code" :disabled="true" />
|
||||
</el-form-item>
|
||||
<el-form-item label="宽度" prop="width">
|
||||
<el-input-number v-model="form.width" controls-position="right" :min="1" />
|
||||
</el-form-item>
|
||||
<el-form-item label="高度" prop="height">
|
||||
<el-input-number v-model="form.height" controls-position="right" :min="1" />
|
||||
</el-form-item>
|
||||
<el-form-item label="X轴坐标" prop="x">
|
||||
<el-form-item label="X轴坐标:" prop="x">
|
||||
<el-input-number v-model="form.x" controls-position="right" :min="1" />
|
||||
</el-form-item>
|
||||
<el-form-item label="Y轴坐标" prop="y">
|
||||
<el-form-item label="Y轴坐标:" prop="y">
|
||||
<el-input-number v-model="form.y" controls-position="right" :min="1" />
|
||||
</el-form-item>
|
||||
<el-form-item label="按钮文字" prop="context">
|
||||
<el-form-item label="按钮文字:" prop="context">
|
||||
<el-input v-model="form.context" />
|
||||
</el-form-item>
|
||||
<el-form-item label="按钮功能" prop="function">
|
||||
<el-form-item label="文字大小:" prop="fontSize">
|
||||
<el-input-number v-model="form.fontSize" controls-position="right" :min="1" />
|
||||
</el-form-item>
|
||||
<el-form-item label="左右内距:" prop="levelPadding">
|
||||
<el-input-number v-model="form.levelPadding" controls-position="right" :min="1" />
|
||||
</el-form-item>
|
||||
<el-form-item label="上下内距:" prop="verticalPadding">
|
||||
<el-input-number v-model="form.verticalPadding" controls-position="right" :min="1" />
|
||||
</el-form-item>
|
||||
<el-form-item label="按钮功能:" prop="function">
|
||||
<el-select v-model="form.function">
|
||||
<el-option
|
||||
v-for="item in functionList"
|
||||
@ -42,7 +45,7 @@
|
||||
import { mapGetters } from 'vuex';
|
||||
import {getUID} from '@/iscs/utils/Uid';
|
||||
export default {
|
||||
name: 'Text',
|
||||
name: 'IscsButton',
|
||||
components: {
|
||||
},
|
||||
data() {
|
||||
@ -57,20 +60,20 @@ export default {
|
||||
],
|
||||
form: {
|
||||
code: '',
|
||||
fillColor: '',
|
||||
borderWidth: '',
|
||||
strokeColor: '',
|
||||
width: 1,
|
||||
height: 1,
|
||||
levelPadding: 10,
|
||||
verticalPadding: 2,
|
||||
fontSize: 10,
|
||||
x: 10,
|
||||
y: 10
|
||||
y: 10,
|
||||
context: '',
|
||||
function: ''
|
||||
},
|
||||
rules: {
|
||||
strokeColor: [
|
||||
{ required: true, message: '请选择边框颜色', trigger: 'change' }
|
||||
context: [
|
||||
{ required: true, message: '请填写按钮文字', trigger: 'blur' }
|
||||
],
|
||||
fillColor: [
|
||||
{ required: true, message: '请选择矩形填充颜色', trigger: 'change'}
|
||||
function: [
|
||||
{ required: true, message: '请选择按钮功能', trigger: 'change'}
|
||||
]
|
||||
}
|
||||
};
|
||||
@ -88,13 +91,12 @@ export default {
|
||||
this.showDeleteButton = true;
|
||||
this.isUpdate = true;
|
||||
this.form.code = model.code;
|
||||
this.form.fillColor = model.fillColor;
|
||||
this.form.borderWidth = model.borderWidth;
|
||||
this.form.strokeColor = model.strokeColor;
|
||||
this.form.width = model.width;
|
||||
this.form.height = model.height;
|
||||
this.form.levelPadding = model.levelPadding;
|
||||
this.form.verticalPadding = model.verticalPadding;
|
||||
this.form.x = model.point.x;
|
||||
this.form.y = model.point.y;
|
||||
this.form.context = model.context;
|
||||
this.form.function = model.function;
|
||||
}
|
||||
}
|
||||
},
|
||||
@ -110,11 +112,11 @@ export default {
|
||||
},
|
||||
code: this.isUpdate ? this.form.code : getUID('IscsButton', this.iscs.iscsButtonList),
|
||||
_type: 'IscsButton',
|
||||
fillColor: this.form.fillColor,
|
||||
borderWidth: this.form.borderWidth,
|
||||
strokeColor: this.form.strokeColor,
|
||||
width: this.form.width,
|
||||
height: this.form.height
|
||||
levelPadding: this.form.levelPadding,
|
||||
verticalPadding: this.form.verticalPadding,
|
||||
context: this.form.context,
|
||||
function: this.form.function,
|
||||
fontSize: this.form.fontSize
|
||||
};
|
||||
this.$emit('createDataModel', rectModel);
|
||||
this.initPage();
|
||||
@ -131,11 +133,11 @@ export default {
|
||||
},
|
||||
code: this.form.code,
|
||||
_type: 'IscsButton',
|
||||
fillColor: this.form.fillColor,
|
||||
borderWidth: this.form.borderWidth,
|
||||
strokeColor: this.form.strokeColor,
|
||||
width: this.form.width,
|
||||
height: this.form.height
|
||||
levelPadding: this.form.levelPadding,
|
||||
verticalPadding: this.form.verticalPadding,
|
||||
context: this.form.context,
|
||||
function: this.form.function,
|
||||
fontSize: this.form.fontSize
|
||||
};
|
||||
this.$emit('deleteDataModel', rectModel);
|
||||
},
|
||||
@ -145,13 +147,13 @@ export default {
|
||||
this.showDeleteButton = false;
|
||||
this.form = {
|
||||
code: '',
|
||||
fillColor: '',
|
||||
borderWidth: '',
|
||||
strokeColor: '',
|
||||
width: 1,
|
||||
height: 1,
|
||||
levelPadding: 10,
|
||||
verticalPadding: 2,
|
||||
fontSize: 10,
|
||||
x: 10,
|
||||
y: 10
|
||||
y: 10,
|
||||
context: '',
|
||||
function: ''
|
||||
};
|
||||
}
|
||||
}
|
||||
|
@ -32,7 +32,7 @@
|
||||
import { mapGetters } from 'vuex';
|
||||
import {getUID} from '@/iscs/utils/Uid';
|
||||
export default {
|
||||
name: 'Line',
|
||||
name: 'IscsLine',
|
||||
data() {
|
||||
return {
|
||||
isUpdate: false,
|
||||
|
@ -35,7 +35,7 @@
|
||||
import { mapGetters } from 'vuex';
|
||||
import {getUID} from '@/iscs/utils/Uid';
|
||||
export default {
|
||||
name: 'Text',
|
||||
name: 'IscsRect',
|
||||
components: {
|
||||
},
|
||||
data() {
|
||||
|
@ -32,7 +32,7 @@
|
||||
import { mapGetters } from 'vuex';
|
||||
import {getUID} from '@/iscs/utils/Uid';
|
||||
export default {
|
||||
name: 'Text',
|
||||
name: 'IscsText',
|
||||
components: {
|
||||
},
|
||||
data() {
|
||||
|
@ -82,6 +82,14 @@
|
||||
@deleteDataModel="deleteDataModel"
|
||||
/>
|
||||
</el-tab-pane>
|
||||
<el-tab-pane label="按钮" name="IscsButton">
|
||||
<iscs-button
|
||||
ref="iscsButton"
|
||||
style="width: 90%;"
|
||||
@createDataModel="createDataModel"
|
||||
@deleteDataModel="deleteDataModel"
|
||||
/>
|
||||
</el-tab-pane>
|
||||
<el-tab-pane label="文字" name="IscsText">
|
||||
<iscs-text
|
||||
ref="iscsText"
|
||||
@ -125,6 +133,7 @@ import TemperatureDetector from './temperatureDetector';
|
||||
import IscsLine from '../iscsCommonElem/line';
|
||||
import IscsText from '../iscsCommonElem/text';
|
||||
import IscsRect from '../iscsCommonElem/rect';
|
||||
import IscsButton from '../iscsCommonElem/button';
|
||||
|
||||
export default {
|
||||
name: 'IscsOperate',
|
||||
@ -140,7 +149,8 @@ export default {
|
||||
Staircase,
|
||||
IscsText,
|
||||
IscsRect,
|
||||
IscsLine
|
||||
IscsLine,
|
||||
IscsButton
|
||||
},
|
||||
mixins: [
|
||||
],
|
||||
@ -151,11 +161,6 @@ export default {
|
||||
stationCode: ''
|
||||
};
|
||||
},
|
||||
computed: {
|
||||
height() {
|
||||
return this.$store.state.config.height;
|
||||
}
|
||||
},
|
||||
watch: {
|
||||
'$store.state.iscs.rightClickCount': function (val) {
|
||||
const model = this.$store.getters['iscs/updateDeviceData'];
|
||||
|
Loading…
Reference in New Issue
Block a user