# Conflicts:
#	src/views/iscs/iscsDraw/iscsCommonElem/button.vue
This commit is contained in:
zyy 2020-06-02 16:17:53 +08:00
commit a1978bd266
18 changed files with 541 additions and 96 deletions

View File

@ -1,40 +0,0 @@
import request from '@/utils/request';
/** 创建实操 */
export function createPractical(data) {
return request({
url: `/api/v1/competitionPractical`,
method: 'post',
data: data
});
}
/** 加载实操及内容 */
export function loadingPractical(data) {
return request({
url: `/api/v1/competitionPractical/distribute`,
method: 'post',
data: data
});
}
/** 查询地图下的实操列表 */
export function getPracticalListByMapId(mapId) {
return request({
url: `/api/v1/competitionPractical/map/${mapId}`,
method: 'get'
});
}
/** 删除实操 */
export function deletePractical(practicalId) {
return request({
url: `/api/v1/competitionPractical/${practicalId}`,
method: 'delete'
});
}
/** 更新实操 */
export function updatePractical(practicalId, data) {
return request({
url: `/api/v1/competitionPractical/{practicalId}`,
method: 'put',
data: data
});
}

View File

@ -33,12 +33,3 @@ export function getPracticeList(params) {
params
});
}
/** 录制实操试题 */
export function practiceRecordNotify(practiceId) {
return request({
url: `/api/scriptSimulation/${practiceId}/scriptWrite`,
method: 'get'
});
}

View File

@ -242,5 +242,10 @@ deviceRender[deviceType.StateTable] = {
zlevel: 1,
z: 5
};
/** 照明组 */
deviceRender[deviceType.LightingGroup] = {
_type: deviceType.LightingGroup,
zlevel: 1,
z: 5
};
export default deviceRender;

View File

@ -36,7 +36,8 @@ const deviceType = {
SingleStaircase: 'SingleStaircase',
ArcStatus: 'ArcStatus',
IscsButton: 'IscsButton',
StateTable: 'StateTable'
StateTable: 'StateTable',
LightingGroup: 'LightingGroup'
};
export default deviceType;

File diff suppressed because one or more lines are too long

View File

@ -37,6 +37,7 @@ import ArcStatus from './ArcStatus';
import IscsButton from './button';
import SmookExhaustFd from './bas/smookExhaustFd';
import StateTable from './stateTable';
import LightingGroup from './lighting';
const iscsShape = {};
iscsShape[deviceType.ManualAlarmButton] = ManualAlarmButton;
@ -78,6 +79,7 @@ iscsShape[deviceType.SingleStaircase] = SingleStaircase;
iscsShape[deviceType.ArcStatus] = ArcStatus;
iscsShape[deviceType.IscsButton] = IscsButton;
iscsShape[deviceType.StateTable] = StateTable;
iscsShape[deviceType.LightingGroup] = LightingGroup;
function shapefactory(device, iscs) {
const type = device.model._type;

186
src/iscs/shape/lighting.js Normal file
View File

@ -0,0 +1,186 @@
import Group from 'zrender/src/container/Group';
import Circle from 'zrender/src/graphic/shape/Circle';
import Line from 'zrender/src/graphic/shape/Line';
import Text from 'zrender/src/graphic/Text';
import Rect from 'zrender/src/graphic/shape/Rect';
export default class lighting extends Group {
constructor(device) {
super();
this.model = device.model;
this._type = device.model._type;
this._code = device.model.code;
this.zlevel = device.model.zlevel;
this.z = device.model.z;
this.create();
}
create() {
const model = this.model;
this.grouper = new Group({
id: model.code,
position: [model.point.x, model.point.y]
});
this.outsideRect = new Rect({
zlevel: this.zlevel,
z: this.z,
shape: {
x: 0,
y: 0,
width: model.width,
height: model.height
},
style: {
lineWidth: 2,
fill: 'rgba(0,0,0,0)',
stroke: '#4CCDE4'
}
});
this.grouper.add(this.outsideRect);
this.verticalLine = new Line({
zlevel: this.zlevel,
z: this.z,
shape: {
x1: model.width * 2 / 5,
y1: 0,
x2: model.width * 2 / 5,
y2: model.height
},
style: {
lineWidth: 2,
stroke: '#4CCDE4'
}
});
this.grouper.add(this.verticalLine);
this.horizontalLine = new Line({
zlevel: this.zlevel,
z: this.z,
shape: {
x1: model.width * 2 / 5,
y1: model.height / 2,
x2: model.width,
y2: model.height / 2
},
style: {
lineWidth: 2,
stroke: '#4CCDE4'
}
});
this.grouper.add(this.horizontalLine);
this.insideCircle = new Circle({
zlevel: this.zlevel,
z: this.z + 1,
shape: {
cx: model.width / 5,
cy: model.height / 2,
r: model.width / 10
},
style: {
lineWidth: 1,
fill: 'rgba(0,0,0,0)',
stroke: '#0F0'
}
});
this.grouper.add(this.insideCircle);
this.topCircle = new Circle({
zlevel: this.zlevel,
z: this.z + 2,
shape: {
cx: model.width / 5,
cy: model.height / 2,
r: model.width / 10
},
style: {
fill: '#45607B'
}
});
this.grouper.add(this.topCircle);
this.underlyingRect = new Rect({
zlevel: this.zlevel,
z: this.z + 1,
shape: {
x: model.width * 7 / 40,
y: model.height / 2 - model.width / 5,
width: model.width / 20,
height: model.width / 5
},
style: {
lineWidth: 1,
fill: 'rgba(0,0,0,0)',
stroke: '#0F0'
}
});
this.grouper.add(this.underlyingRect);
this.topRect = new Rect({
zlevel: this.zlevel,
z: this.z + 2,
shape: {
x: model.width * 7 / 40,
y: model.height / 2 - model.width / 5,
width: model.width / 20,
height: model.width / 5
},
style: {
fill: '#45607B'
}
});
this.grouper.add(this.topRect);
this.lines = [];
for (let i = 0; i < 7; i++) {
const lightingLine = new Line({
zlevel: this.zlevel,
z: this.z,
shape: {
x1: model.width / 5 + Math.cos(Math.PI / 6 * i) * (model.width / 10 + 2),
y1: model.height / 2 + Math.sin(Math.PI / 6 * i) * (model.width / 10 + 2),
x2: model.width / 5 + Math.cos( Math.PI / 6 * i) * (model.width / 5),
y2: model.height / 2 + Math.sin(Math.PI / 6 * i) * (model.width / 5)
},
style: {
lineWidth: 1,
stroke: '#0F0'
}
});
this.grouper.add(lightingLine);
this.lines.push(lightingLine);
}
this.topText = new Text({
zlevel: this.zlevel,
z: this.z,
style: {
x: model.width * 7 / 10,
y: model.height / 4,
fontSize: model.topFontSize,
fontFamily: 'consolas',
text: model.topContext,
textFill: model.topTextFill,
textAlign: 'center',
textPosition: 'inside',
textVerticalAlign: 'middle',
textLineHeight: model.topFontSize
}
});
this.grouper.add(this.topText);
this.bottomText = new Text({
zlevel: this.zlevel,
z: this.z,
style: {
x: model.width * 7 / 10,
y: model.height * 3 / 4,
fontSize: model.bottomFontSize,
fontFamily: 'consolas',
text: model.bottomContext,
textFill: model.bottomTextFill,
textAlign: 'center',
textPosition: 'inside',
textVerticalAlign: 'middle',
textLineHeight: model.bottomFontSize
}
});
this.grouper.add(this.bottomText);
this.add(this.grouper);
}
setModel(dx, dy) {
this.model.point.x += dx;
this.model.point.y += dy;
}
}

View File

@ -157,6 +157,9 @@ export function parser(data) {
zrUtil.each(data.stateTableList || [], elem=> {
iscsDevice[elem.code] = deviceFactory(deviceType.StateTable, elem);
});
zrUtil.each( data.lightingGroupList || [], elem=> {
iscsDevice[elem.code] = deviceFactory(deviceType.LightingGroup, elem);
});
}
return iscsDevice;
@ -293,6 +296,9 @@ export function updateIscsData(state, device) {
case deviceType.StateTable:
updateIscsListByDevice(state, 'stateTableList', device);
break;
case deviceType.LightingGroup:
updateIscsListByDevice(state, 'lightingGroupList', device);
break;
}
// store.dispatch('iscs/setIscsData', state.iscs);
}

View File

@ -44,7 +44,7 @@ export default {
labelWidth: '120px',
items: [
{ prop: 'name', label: '实操名称', type: 'text' },
{ prop:'mapId', label:'地图名称', type:'select', options:this.mapList, disabled:this.isEdit},
{ prop:'mapId', label:'实操地图', type:'select', options:this.mapList, disabled:this.isEdit},
{ prop: 'description', label: '实操描述', type: 'textarea' }
]
};

View File

@ -7,9 +7,10 @@
</template>
<script>
import Cookies from 'js-cookie';
import { getPublishMapListOnline } from '@/api/jmap/map';
import { getPracticeList, practiceRecordNotify } from '@/api/race';
import { getPublishMapListOnline, getPublishMapInfo } from '@/api/jmap/map';
import { getPracticeList } from '@/api/race';
import {updateScript, deleteScript, createScript} from '@/api/script';
import { scriptRecordNotifyNew } from '@/api/simulation';
import { launchFullscreen } from '@/utils/screen';
import { UrlConfig } from '@/scripts/ConstDic';
@ -32,7 +33,7 @@ export default {
queryObject: {
mapId: {
type: 'select',
label: '地图',
label: '实操地图',
config: {
data: []
}
@ -54,7 +55,7 @@ export default {
indexShow: true,
columns: [
{
title: '竞赛名称',
title: '实操地图',
prop: 'mapId',
type: 'tag',
width: '320',
@ -63,12 +64,12 @@ export default {
},
{
title: '实操名称',
prop: 'name'
prop: 'name',
width: '400'
},
{
title: '创建人',
prop: 'creatorName',
width: '100'
title: '实操描述',
prop: 'description'
},
{
type: 'button',
@ -131,20 +132,30 @@ export default {
}).catch(() => { });
},
doRecord(index, row) {
getPublishMapInfo(row.mapId).then(response=>{
const lineCode = response.data.lineCode;
scriptRecordNotifyNew(row.id).then(resp => {
const query = { mapId: row.mapId, group: resp.data, scriptId: row.id, lang:row.lang, drawWay:true, lineCode:lineCode};
this.$router.push({ path: `${UrlConfig.scriptDisplayNew}/script`, query });
launchFullscreen();
}).catch(error => {
this.$messageBox(`创建仿真失败: ${error.message}`);
});
});
// row.id
let raceInfo;
this.raceList.forEach(each=>{
if (each.id == row.raceId) {
raceInfo = each;
}
});
practiceRecordNotify(83).then(resp => {
const query = { mapId: raceInfo.mapId, group: resp.data, scriptId: row.id, lineCode:raceInfo.lineCode};
this.$router.push({ path: `${UrlConfig.practiceDisplayNew}/practice`, query });
launchFullscreen();
}).catch(error => {
this.$messageBox(`创建仿真失败: ${error.message}`);
});
// let raceInfo;
// this.raceList.forEach(each=>{
// if (each.id == row.raceId) {
// raceInfo = each;
// }
// });
// practiceRecordNotify(83).then(resp => {
// const query = { mapId: raceInfo.mapId, group: resp.data, scriptId: row.id, lineCode:raceInfo.lineCode};
// this.$router.push({ path: `${UrlConfig.practiceDisplayNew}/practice`, query });
// launchFullscreen();
// }).catch(error => {
// this.$messageBox(`仿: ${error.message}`);
// });
},
//
doUpdate(index, row) {

View File

@ -117,7 +117,7 @@ export default {
this.tryUser = 0;
this.loading = false;
this.drawWay = res.data.drawWay;
const remarksList = {'01':'ATS现地工作站原理级仿真实训课程', '02':'ATS行调工作站原理级仿真实训课程', '03':'各岗位应急综合演练', '04':'桌面版模拟驾驶系统', '05':'派班工作站主要是供车辆段/停车场派班员进行派班操作,可以自动生成派班计划,极大的简化了派班计划管理的复杂性', '06': '综合监控管理原理及仿真实训'};
const remarksList = {'01':'ATS现地工作站原理级仿真系统,实现车站值班员培训功能。', '02':'ATS行调工作站原理级仿真系统实现行车调度员培训功能。', '03':'各岗位应急综合演练', '04':'桌面版模拟驾驶系统,实现列车驾驶员培训功能。', '05':'派班工作站主要是供车辆段/停车场派班员进行派班操作,可以自动生成派班计划,极大的简化了派班计划管理的复杂性', '06': '综合监控工作站原理级仿真系统,实现电调、环调及车站值班员培训功能。', '07':'大屏仿真系统,可显示全线全站场实时状况,便于教学及观摩使用。'};
this.courseModel = {
id: resp.data.id,
name: resp.data.name,

View File

@ -133,6 +133,12 @@ export default {
mode: 'bas',
id: '23',
type: 'interface'
},
{
name: '照明',
mode: 'bas',
id: '24',
type: 'interface'
}
]
},

View File

@ -107,6 +107,14 @@
@deleteDataModel="deleteDataModel"
/>
</el-tab-pane>
<el-tab-pane label="照明组" name="LightingGroup">
<lighting-group
ref="lightingGroup"
style="width: 100%;height: 100%;"
@createDataModel="createDataModel"
@deleteDataModel="deleteDataModel"
/>
</el-tab-pane>
<el-tab-pane label="按钮" name="IscsButton">
<iscs-button
ref="iscsButton"
@ -162,6 +170,7 @@ import IscsLine from '../iscsCommonElem/line';
import IscsText from '../iscsCommonElem/text';
import IscsRect from '../iscsCommonElem/rect';
import SmookExhaustFd from './smookExhaustFd';
import LightingGroup from './lightingGroup';
export default {
name: 'IscsOperate',
@ -181,7 +190,8 @@ export default {
IscsButton,
IscsText,
IscsRect,
IscsLine
IscsLine,
LightingGroup
},
mixins: [
],
@ -218,5 +228,66 @@ export default {
};
</script>
<style lang="scss" scoped>
.map-control {
float: right;
width: 100%;
height: 100%;
.border-card{
height: 100%;
}
}
.mapEdit{
height: calc(100% - 47px);
.tab_pane_box{
height: 100%;
}
}
/deep/ .el-card__body{
height:100%;
}
/deep/ {
.mapEdit .el-tabs__nav-wrap.is-scrollable {
padding: 0 20px;
}
.mapEdit .el-tabs__header .el-tabs__item.is-active {
border-bottom-color: #f5f7fa;
background: #f5f7fa;
}
.mapEdit .el-tabs__active-bar{
background: transparent;
}
.mapEdit .el-tabs__content {
height: calc(100% - 56px);
}
.mapEdit .el-tab-pane {
height: 100%;
}
.card .el-tabs__nav .el-tabs__item.is-active {
border-bottom: 2px solid #E4E7ED;
background: #409eff;
color: #fff;
}
.card .el-tabs__nav .el-tabs__item{
padding: 0 20px!important;
}
.mapEdit .el-tabs__nav-prev {
width: 20px;
height: 41px;
display: flex;
justify-content: center;
align-items: center;
box-shadow: 1px 1px 4px #ccc;
}
.mapEdit .el-tabs__nav-next {
width: 20px;
height: 41px;
display: flex;
justify-content: center;
align-items: center;
box-shadow: 1px 1px 4px #ccc;
}
}
.heightClass{height:100%;}
</style>

View File

@ -0,0 +1,200 @@
<template>
<div style="overflow-y: scroll;height: calc(100% - 46px);">
<el-form ref="form" :rules="rules" :model="form" label-width="120px">
<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" :min="1" />
</el-form-item>
<el-form-item label="高度:" prop="height">
<el-input-number v-model="form.height" :min="1" />
</el-form-item>
<el-form-item label="顶部文字内容:" prop="topContext">
<el-input v-model="form.topContext" type="textarea" :rows="2" />
</el-form-item>
<el-form-item label="顶部字体大小:" prop="topFontSize">
<el-input-number v-model="form.topFontSize" :min="1" />
</el-form-item>
<el-form-item label="顶部字体颜色:" prop="topTextFill">
<el-color-picker v-model="form.topTextFill" />
</el-form-item>
<el-form-item label="底部文字内容:" prop="bottomContext">
<el-input v-model="form.bottomContext" type="textarea" :row="2" />
</el-form-item>
<el-form-item label="底部字体大小:" prop="bottomFontSize">
<el-input-number v-model="form.bottomFontSize" :min="1" />
</el-form-item>
<el-form-item label="底部字体颜色:" prop="bottomTextFill">
<el-color-picker v-model="form.bottomTextFill" />
</el-form-item>
<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-input-number v-model="form.y" controls-position="right" :min="1" />
</el-form-item>
<el-form-item>
<el-button type="primary" @click="onSubmit('form')">{{ buttonText }}</el-button>
<el-button v-show="showDeleteButton" type="danger" @click="deleteDevice">{{ $t('global.delete') }}</el-button>
<el-button v-show="showDeleteButton" @click="initPage">{{ $t('global.cancel') }}</el-button>
</el-form-item>
</el-form>
</div>
</template>
<script>
import { mapGetters } from 'vuex';
import {getUID} from '@/iscs/utils/Uid';
export default {
name:'AirConditioner',
data() {
return {
isUpdate:false,
showDeleteButton: false,
buttonText: '立即创建',
form:{
code:'',
width: 110,
height: 60,
topContext: '',
topFontSize: 10,
topTextFill: '#B4AF5B',
bottomContext: '',
bottomFontSize: 18,
bottomTextFill: '#FFFFFF',
x: 10,
y: 10
},
rules: {
width:[
{ required: true, message:'请输入设备图形宽度', trigger: 'blur' }
],
height: [
{ required: true, message: '请输入设备图形高度', trigger: 'blur'}
],
topContext: [
{ required: true, message: '请输入顶部文字内容', trigger: 'blur'}
],
topFontSize: [
{required: true, message: '请输入顶部字体大小', trigger: 'blur'}
],
topTextFill: [
{required: true, message: '请输入顶部字体颜色', trigger: 'blur'}
],
bottomContext: [
{required: true, message: '请输入底部文字内容', trigger: 'blur'}
],
bottomFontSize: [
{required: true, message: '请输入底部字体大小', trigger: 'blur'}
],
bottomTextFill: [
{required: true, message: '请输入底部字体颜色', trigger: 'blur'}
],
x: [
{ required: true, message: '请输入设备图形的X轴坐标', trigger: 'blur' }
],
y: [
{ required: true, message: '请输入设备图形的Y轴坐标', trigger: 'blur' }
]
}
};
},
computed:{
...mapGetters('iscs', [
'iscs'
])
},
watch:{
'$store.state.iscs.rightClickCount': function (val) {
const model = this.$store.getters['iscs/updateDeviceData'];
if (model._type === 'LightingGroup' ) {
this.buttonText = '修改';
this.showDeleteButton = true;
this.isUpdate = true;
this.form.code = model.code;
this.form.width = model.width;
this.form.x = model.point.x;
this.form.y = model.point.y;
this.form.height = model.height;
this.form.topContext = model.topContext;
this.form.topFontSize = model.topFontSize;
this.form.topTextFill = model.topTextFill;
this.form.bottomContext = model.bottomContext;
this.form.bottomFontSize = model.bottomFontSize;
this.form.bottomTextFill = model.bottomTextFill;
}
}
},
mounted() {
},
methods:{
onSubmit(form) {
this.$refs[form].validate((valid) => {
if (valid) {
const airConditionerModel = {
point: {
x: this.form.x,
y: this.form.y
},
_type: 'LightingGroup',
code: this.isUpdate ? this.form.code : getUID('LightingGroup', this.iscs.lightingGroupList),
width: this.form.width,
height:this.form.height,
topContext: this.form.topContext,
topFontSize: this.form.topFontSize,
topTextFill: this.form.topTextFill,
bottomContext: this.form.bottomContext,
bottomFontSize: this.form.bottomFontSize,
bottomTextFill: this.form.bottomTextFill
};
this.$emit('createDataModel', airConditionerModel);
this.initPage();
} else {
return false;
}
});
},
initPage() {
this.isUpdate = false;
this.buttonText = '立即创建';
this.showDeleteButton = false;
this.form = {
code:'',
width: 110,
height: 60,
topContext: '',
topFontSize: 10,
topTextFill: '#B4AF5B',
bottomContext: '',
bottomFontSize: 18,
bottomTextFill: '#FFFFFF',
x: 10,
y: 10
};
this.$refs.form.resetFields();
},
deleteDevice() {
const lightingGroupModel = {
point: {
x: this.form.x,
y: this.form.y
},
_type: 'LightingGroup',
code: this.form.code,
width: this.form.width,
height:this.form.height,
topContext: this.form.topContext,
topFontSize: this.form.topFontSize,
topTextFill: this.form.topTextFill,
bottomContext: this.form.bottomContext,
bottomFontSize: this.form.bottomFontSize,
bottomTextFill: this.form.bottomTextFill
};
this.$emit('deleteDataModel', lightingGroupModel );
this.initPage();
}
}
};
</script>

View File

@ -57,7 +57,8 @@ export default {
{label: '图元说明', value: 'GraphicEle'},
{label: '公共区域', value: 'PublicArea'},
{label: '操作按钮', value: 'OperatingButton'},
{label: '返回', value: 'GoBack'}
{label: '返回', value: 'GoBack'},
{label: '至EPS系统及导向照明', value: 'GoEPS'}
],
form: {
code: '',

View File

@ -1,8 +1,8 @@
<template>
<div>
<div class="stand_title">{{ $route.query.stationName }}火灾报警站台报警</div>
<div class="">
<iscsSystem ref="iscsPlate" :width-canvas="1520" :canvas-height="500" />
<div style="margin: auto">
<iscsSystem ref="iscsPlate" :width-canvas="width" :canvas-height="500" />
</div>
</div>
</template>
@ -15,10 +15,23 @@ export default {
},
data() {
return {
width: 1100
};
},
watch: {
'$store.state.iscs.selectedCount': function() {
const device = this.$store.state.iscs.selected;
if (device && device._type === 'IscsButton' && device.function === 'PublicArea') {
this.width = 1520;
this.$refs.iscsPlate.show('12');
} else if (device && device._type === 'IscsButton' && device.function === 'GoBack') {
this.width = 1100;
this.$refs.iscsPlate.show('14');
}
}
},
mounted() {
this.$refs.iscsPlate.show('12');
this.$refs.iscsPlate.show('14');
},
methods: {

View File

@ -256,7 +256,8 @@ export default {
children: [
{
name: '网络状态',
type: 'standFAS'
type: 'netState',
showType: ['center', 'local']
}
]
}
@ -301,17 +302,7 @@ export default {
]
};
},
watch: {
'$store.state.iscs.selectedCount': function() {
const device = this.$store.state.iscs.selected;
if (device._type === 'IscsButton' && device.function === 'PublicArea') {
this.selectChildIndex = 1;
this.$router.push({ path: `/iscs/system/config/stationHallFAS`, query: {currentSystem:this.$route.query.currentSystem, stationName: this.$route.query.stationName, stationId: this.$route.query.stationId } });
} else if (device._type === 'IscsButton' && device.function === 'GoBack') {
this.$router.go(-1);
}
}
},
watch: {},
mounted() {
this.navList.forEach((nav, navIndex)=>{
if (nav.children && nav.children.length > 0) {

View File

@ -1,7 +1,7 @@
<template>
<!-- v-quickMenuDrag -->
<div class="chatBox">
<div v-if="!minimize" class="chat-box">
<div v-show="!minimize" class="chat-box">
<chat-member-list ref="chatMemberList" :group="group" :current-coversition="currentCoversition" @addCoversition="addCoversition" />
<div class="chat-box-main">
<chat-coversition-list ref="chatCoversitionList" @setCurrentCoversition="setCurrentCoversition" @setHeadTitle="setHeadTitle" />