From 588f77173ac28a2bbecabe4ad97991035c76d3df Mon Sep 17 00:00:00 2001 From: fan <18706759286@163.com> Date: Thu, 17 Sep 2020 15:36:46 +0800 Subject: [PATCH] =?UTF-8?q?=E8=A1=8C=E8=B0=83=E5=A4=A7=E8=B5=9B=E7=90=86?= =?UTF-8?q?=E8=AE=BA=E8=80=83=E8=AF=95&=E7=A6=8F=E5=B7=9EIscs?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/api/competition.js | 17 ++- src/iscs/constant/deviceRender.js | 7 + src/iscs/constant/deviceType.js | 3 +- src/iscs/shape/factory.js | 2 + src/iscs/shape/fuzhouDoor.js | 137 ++++++++++++++++++ src/iscs/shape/ordinaryDoor.js | 36 +++-- src/iscs/utils/parser.js | 3 + src/store/modules/iscs.js | 1 - src/utils/baseUrl.js | 4 +- .../iscs/iscsDraw/IscsNetOperate/index.vue | 4 +- .../iscsDraw/iscsCommonElem/fuzhouDoor.vue | 118 +++++++++++++++ .../iscsDraw/iscsCommonElem/ordinaryDoor.vue | 48 +++--- .../displayNew/dispatherContest/index.vue | 10 +- .../displayNew/dispatherContest/quiz.vue | 135 +++++------------ .../displayNew/dispatherContest/result.vue | 109 ++++++++++++++ 15 files changed, 483 insertions(+), 151 deletions(-) create mode 100644 src/iscs/shape/fuzhouDoor.js create mode 100644 src/views/iscs/iscsDraw/iscsCommonElem/fuzhouDoor.vue create mode 100644 src/views/newMap/displayNew/dispatherContest/result.vue diff --git a/src/api/competition.js b/src/api/competition.js index d3ef12405..da57c2d90 100644 --- a/src/api/competition.js +++ b/src/api/competition.js @@ -239,4 +239,19 @@ export function getTheroyCompetitionResult(competitionId, raceUserId) { method: 'get' }); } - +/** 项目获取试题列表 */ +export function getItemListByProjectCode(projectCode, params) { + return request({ + url: `api/v1/competitionTheory/project/${projectCode}`, + method: 'get', + params + }); +} +/** 项目提交试卷 */ +export function commitProjectTestPaper(projectCode, data, mode) { + return request({ + url: `api/v1/competitionTheory/project/${projectCode}/submit?mode=${mode}`, + method: 'post', + data + }); +} diff --git a/src/iscs/constant/deviceRender.js b/src/iscs/constant/deviceRender.js index e3c9c1ffa..ac8a21b75 100644 --- a/src/iscs/constant/deviceRender.js +++ b/src/iscs/constant/deviceRender.js @@ -296,9 +296,16 @@ deviceRender[deviceType.IscsImage] = { zlevel: 1, z: 5 }; +// 福州iscs扇门 deviceRender[deviceType.OrdinaryDoor] = { _type: deviceType.OrdinaryDoor, zlevel: 1, z: 4 }; +// 福州门禁 +deviceRender[deviceType.FuzhouDoor] = { + _type: deviceType.FuzhouDoor, + zlevel: 1, + z: 4 +}; export default deviceRender; diff --git a/src/iscs/constant/deviceType.js b/src/iscs/constant/deviceType.js index 848be06aa..c64d05cfe 100644 --- a/src/iscs/constant/deviceType.js +++ b/src/iscs/constant/deviceType.js @@ -46,7 +46,8 @@ const deviceType = { Elevator: 'Elevator', Draught: 'Draught', IscsImage: 'IscsImage', - OrdinaryDoor: 'ordinaryDoor' + OrdinaryDoor: 'OrdinaryDoor', + FuzhouDoor: 'FuzhouDoor' }; export default deviceType; diff --git a/src/iscs/shape/factory.js b/src/iscs/shape/factory.js index 5284ca043..709a4ddf2 100644 --- a/src/iscs/shape/factory.js +++ b/src/iscs/shape/factory.js @@ -47,6 +47,7 @@ import Elevator from './bas/elevator'; import Draught from './bas/draught'; import IscsImage from './iscsImage'; import OrdinaryDoor from './ordinaryDoor'; +import FuzhouDoor from './fuzhouDoor'; const iscsShape = {}; iscsShape[deviceType.ManualAlarmButton] = ManualAlarmButton; @@ -98,6 +99,7 @@ iscsShape[deviceType.Elevator] = Elevator; iscsShape[deviceType.Draught] = Draught; iscsShape[deviceType.IscsImage] = IscsImage; iscsShape[deviceType.OrdinaryDoor] = OrdinaryDoor; +iscsShape[deviceType.FuzhouDoor] = FuzhouDoor; function shapefactory(device, iscs) { const type = device.model._type; diff --git a/src/iscs/shape/fuzhouDoor.js b/src/iscs/shape/fuzhouDoor.js new file mode 100644 index 000000000..9937d320b --- /dev/null +++ b/src/iscs/shape/fuzhouDoor.js @@ -0,0 +1,137 @@ +import Group from 'zrender/src/container/Group'; +import Rect from 'zrender/src/graphic/shape/Rect'; +import Polygon from 'zrender/src/graphic/shape/Polygon'; + +export default class fuzhouDoor extends Group { + constructor(device) { + super(); + this.model = device.model; + this.zlevel = device.model.zlevel; + this.z = device.model.z; + this._type = device.model._type; + this._code = device.model.code; + this.create(); + this.setState(this.model); + } + create() { + this.grouper = new Group({ + id: this.model.code, + position: [this.model.point.x, this.model.point.y] + }); + this.add(this.grouper); + this.door = new Rect({ + zlevel: this.zlevel, + z: this.z, + shape: { + x: 0, + y: 0, + width: this.model.width, + height: this.model.width * 25 / 16 + }, + style: { + fill: '#33CC00'// D3D0C9 + } + }); + this.doorWindow = new Rect({ + zlevel: this.zlevel, + z: this.z, + shape: { + x: this.model.width * 2 / 17, + y: this.model.width * 6 / 17, + width: this.model.width * 13 / 17, + height: this.model.width * 4 / 17 + }, + style: { + fill: '#000' + } + }); + this.doorknob = new Rect({ + zlevel: this.zlevel, + z: this.z, + shape: { + x: this.model.width * 13 / 17, + y: this.model.width * 21 / 17, + width: this.model.width / 17, + height: this.model.width / 17 + }, + style: { + fill: '#000' + } + }); + this.polygon1 = new Polygon({ + zlevel: this.zlevel, + z: this.z + 1, + shape: { + points:[ + [0, 0], + [this.model.width * 3 / 4, this.model.width * 5 / 16], + [this.model.width * 3 / 4, this.model.width * 7 / 4], + [0, this.model.width * 25 / 16] + ] + }, + style: { + fill: '#0F0', + stroke: '#000', + lineWidth: 2 + } + }); + this.polygon2 = new Polygon({ + zlevel: this.zlevel, + z: this.z + 2, + shape: { + points: [ + [this.model.width / 6, this.model.width / 4], + [this.model.width * 2 / 3, this.model.width * 5 / 12], + [this.model.width / 6, this.model.width * 7 / 12], + [this.model.width * 2 / 3, this.model.width * 2 / 3] + ] + }, + style: { + fill: '#000' + } + }); + this.polygon3 = new Polygon({ + zlevel: this.zlevel, + z: this.z + 2, + shape: { + points: [ + [this.model.width * 11 / 24, this.model.width * 55 / 48], + [this.model.width / 3, this.model.width * 29 / 24], + [this.model.width * 11 / 24, this.model.width * 5 / 4], + [this.model.width / 3, this.model.width * 21 / 16] + ] + }, + style: { + fill: '#000' + } + }); + this.doorWindow.hide(); + this.doorknob.hide(); + this.polygon1.hide(); + this.polygon2.hide(); + this.polygon3.hide(); + this.grouper.add(this.door); + this.grouper.add(this.doorWindow); + this.grouper.add(this.doorknob); + this.grouper.add(this.polygon1); + this.grouper.add(this.polygon2); + this.grouper.add(this.polygon3); + this.add(this.grouper); + } + setState(model) { + if (model.doorOpen) { + this.door.setStyle({fill: 'D3D0C9'}); + this.polygon1.show(); + this.polygon2.show(); + this.polygon3.show(); + } else { + this.door.setStyle({fill: 'D3D0C9'}); + this.doorWindow.show(); + this.doorknob.show(); + } + } + setModel(dx, dy) { + this.model.point.x += dx; + this.model.point.y += dy; + } +} diff --git a/src/iscs/shape/ordinaryDoor.js b/src/iscs/shape/ordinaryDoor.js index b5566eb5a..e942e4358 100644 --- a/src/iscs/shape/ordinaryDoor.js +++ b/src/iscs/shape/ordinaryDoor.js @@ -22,11 +22,11 @@ export default class OrdinaryDoor extends Group { zlevel: this.zlevel, z: this.z, shape: { - cx: this.model.point.x, - cy: this.model.point.y - this.model.r, + cx: 0, + cy: this.model.r, r: this.model.r, - startAngle: Math.PI / 2, - endAngle: Math.PI + startAngle: Math.PI / 2 * 3, + endAngle: 2 * Math.PI }, style: { fill: 'rgba(0, 0, 0, 0)', @@ -34,6 +34,7 @@ export default class OrdinaryDoor extends Group { lineWidth: 1 } }); + this.grouper.add(this.sector1); if (this.model.doorType === '1') { this.createLine(this.model.r); } else if (this.model.doorType === '2') { @@ -47,17 +48,20 @@ export default class OrdinaryDoor extends Group { this.createRect(this.model.r * 2); this.createLine(this.model.r * 2); } + this.grouper.origin = [0, 0]; + this.grouper.rotation = Math.PI / 180 * (this.model.rotationAngle || 0); + this.add(this.grouper); } createSector2() { this.sector2 = new Sector({ zlevel: this.zlevel, z: this.z, shape: { - cx: this.model.point.x + this.model.r * 2, - cy: this.model.point.y, + cx: this.model.r * 2, + cy: this.model.r, r: this.model.r, - startAngle: 0, - endAngle: Math.PI / 2 + startAngle: Math.PI, + endAngle: Math.PI / 2 * 3 }, style: { fill: 'rgba(0,0,0,0)', @@ -72,10 +76,10 @@ export default class OrdinaryDoor extends Group { zlevel: this.zlevel, z: this.z, shape: { - x1: this.model.point.x, - y1: this.model.point.y - this.model.r, - x2: this.model.point.x + length, - y2: this.model.point.y - this.model.r + x1: 1, + y1: this.model.r, + x2: length - 1, + y2: this.model.r }, style: { stroke: '#45607B', @@ -89,8 +93,8 @@ export default class OrdinaryDoor extends Group { zlevel: this.zlevel, z: this.z, shape: { - x: this.model.point.x, - y: this.model.point.y - this.model.r, + x: 0, + y: this.model.r, width: length, height: this.model.r }, @@ -102,4 +106,8 @@ export default class OrdinaryDoor extends Group { }); this.grouper.add(this.bottomRect); } + setModel(dx, dy) { + this.model.point.x += dx; + this.model.point.y += dy; + } } diff --git a/src/iscs/utils/parser.js b/src/iscs/utils/parser.js index 9cf3fce92..2b6d6725f 100644 --- a/src/iscs/utils/parser.js +++ b/src/iscs/utils/parser.js @@ -187,6 +187,9 @@ export function parser(data) { zrUtil.each(data.ordinaryDoorList || [], elem => { iscsDevice[elem.code] = deviceFactory(deviceType.OrdinaryDoor, elem); }); + zrUtil.each(data.fuzhoudoorList || [], elem => { + iscsDevice[elem.code] = deviceFactory(deviceType.FuzhouDoor, elem); + }); } return iscsDevice; diff --git a/src/store/modules/iscs.js b/src/store/modules/iscs.js index 9e9b1dba9..e4e7802ef 100644 --- a/src/store/modules/iscs.js +++ b/src/store/modules/iscs.js @@ -161,7 +161,6 @@ const iscs = { if (!(models instanceof Array)) { models = [models]; } - commit('iscsRender', models); resolve(models); }); diff --git a/src/utils/baseUrl.js b/src/utils/baseUrl.js index 778caeb7b..836771751 100644 --- a/src/utils/baseUrl.js +++ b/src/utils/baseUrl.js @@ -2,11 +2,11 @@ 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.82:9000'; // 杜康 + BASE_API = 'http://192.168.3.82:9000'; // 杜康 // BASE_API = 'http://b29z135112.zicp.vip'; // BASE_API = 'http://2925963m2a.zicp.vip'; // 杜康 // BASE_API = 'http://2i38984j47.qicp.vip'; // 张赛 diff --git a/src/views/iscs/iscsDraw/IscsNetOperate/index.vue b/src/views/iscs/iscsDraw/IscsNetOperate/index.vue index f07fa488c..78be19694 100644 --- a/src/views/iscs/iscsDraw/IscsNetOperate/index.vue +++ b/src/views/iscs/iscsDraw/IscsNetOperate/index.vue @@ -50,14 +50,14 @@ @deleteDataModel="deleteDataModel" /> - + - + diff --git a/src/views/iscs/iscsDraw/iscsCommonElem/fuzhouDoor.vue b/src/views/iscs/iscsDraw/iscsCommonElem/fuzhouDoor.vue new file mode 100644 index 000000000..a49a84f43 --- /dev/null +++ b/src/views/iscs/iscsDraw/iscsCommonElem/fuzhouDoor.vue @@ -0,0 +1,118 @@ + + + + + diff --git a/src/views/iscs/iscsDraw/iscsCommonElem/ordinaryDoor.vue b/src/views/iscs/iscsDraw/iscsCommonElem/ordinaryDoor.vue index 5b410dd7c..4b8708839 100644 --- a/src/views/iscs/iscsDraw/iscsCommonElem/ordinaryDoor.vue +++ b/src/views/iscs/iscsDraw/iscsCommonElem/ordinaryDoor.vue @@ -53,6 +53,7 @@ export default { {label: '单扇有矩形', value: '3'}, {label: '双扇有矩形', value: '4'} ], + rules: {}, isUpdate: false, buttonText: '立即创建', showDeleteButton: false @@ -74,6 +75,7 @@ export default { this.form.x = model.point.x; this.form.y = model.point.y; this.form.r = model.r; + this.form.doorType = model.doorType; this.form.rotationAngle = model.rotationAngle; } } @@ -85,16 +87,14 @@ export default { if (valid) { const model = { point: { - x: this.form.x1, - y: this.form.y1 + x: this.form.x, + y: this.form.y }, code: this.isUpdate ? this.form.code : getUID('OrdinaryDoor', this.iscs.ordinaryDoorList), _type: 'OrdinaryDoor', - lineWidth: this.form.lineWidth, - fillColor: this.form.fillColor, - classify: this.form.classify, - arrowShow: this.form.arrowShow, - arrowSize: this.form.arrowSize + rotationAngle: this.form.rotationAngle, + r: this.form.r, + doorType: this.form.doorType }; this.$emit('createDataModel', model); this.initPage(); @@ -105,21 +105,15 @@ export default { }, deleteDevice() { const lineModel = { - point1: { - x: this.form.x1, - y: this.form.y1 - }, - point2: { - x: this.form.x2, - y: this.form.y2 + point: { + x: this.form.x, + y: this.form.y }, code: this.form.code, - _type: 'IscsLine', - lineWidth: this.form.lineWidth, - fillColor: this.form.fillColor, - classify: this.form.classify, - arrowShow: this.form.arrowShow, - arrowSize: this.form.arrowSize + _type: 'OrdinaryDoor', + rotationAngle: this.form.rotationAngle, + r: this.form.r, + doorType: this.form.doorType }; this.$emit('deleteDataModel', lineModel); }, @@ -129,15 +123,11 @@ export default { this.showDeleteButton = false; this.form = { code: '', - lineWidth: '', - fillColor: '#fff', - arrowShow: 'none', - arrowSize: 5, - x1: 10, - y1: 10, - x2: 20, - y2: 10, - classify:'solid' + doorType: '1', + r: 1, + rotationAngle: 0, + x: 10, + y: 10 }; } } diff --git a/src/views/newMap/displayNew/dispatherContest/index.vue b/src/views/newMap/displayNew/dispatherContest/index.vue index f7e582cfb..8b01e2a32 100644 --- a/src/views/newMap/displayNew/dispatherContest/index.vue +++ b/src/views/newMap/displayNew/dispatherContest/index.vue @@ -53,7 +53,8 @@ - + + @@ -66,6 +67,7 @@ import DemonChat from '../demonChat'; import SceneList from './sceneList'; import MenuSchema from '@/views/newMap/displayNew/menuSchema'; import TheoryQuiz from './quiz'; +import ThroryResult from './result'; import { getGoodsTryUse } from '@/api/management/goods'; import { ranAsPlan, exitRunPlan, clearSimulation, getSimulationInfoNew } from '@/api/simulation'; import { PermissionType } from '@/scripts/ConstDic'; @@ -87,7 +89,8 @@ export default { MenuSchema, DemonMenu, SceneList, - TheoryQuiz + TheoryQuiz, + ThroryResult }, props: { offset: { @@ -450,6 +453,9 @@ export default { }, goTheoryQuiz() { this.$refs.theoryQuiz.doShow(); + }, + commitResult(result) { + this.$refs.theoryResult.doShow(result); } } }; diff --git a/src/views/newMap/displayNew/dispatherContest/quiz.vue b/src/views/newMap/displayNew/dispatherContest/quiz.vue index 6edeb1c0d..3d8995d0a 100644 --- a/src/views/newMap/displayNew/dispatherContest/quiz.vue +++ b/src/views/newMap/displayNew/dispatherContest/quiz.vue @@ -27,19 +27,17 @@ +