diff --git a/src/jmapNew/config/skinCode/nanjing_02.js b/src/jmapNew/config/skinCode/nanjing_02.js index f19547a60..0a6ffbb43 100644 --- a/src/jmapNew/config/skinCode/nanjing_02.js +++ b/src/jmapNew/config/skinCode/nanjing_02.js @@ -839,8 +839,17 @@ class SkinCode extends defaultStyle { this[deviceType.Responder] = { block: { + mapStyle: { + FB: { fill: '#fff' }, + VB: { fill: '#666' }, + IB: { fill: '#666' } + } + }, + delta: { + fill: '#fff' }, text: { + textFill: '#fff' } }; diff --git a/src/jmapNew/shape/Responder/index.js b/src/jmapNew/shape/Responder/index.js index 9ee494d4f..2079e186b 100644 --- a/src/jmapNew/shape/Responder/index.js +++ b/src/jmapNew/shape/Responder/index.js @@ -4,6 +4,7 @@ import Group from 'zrender/src/container/Group'; import Rect from 'zrender/src/graphic/shape/Rect'; import Text from 'zrender/src/graphic/Text'; +import Polygon from 'zrender/src/graphic/shape/Polygon'; export default class Responder extends Group { constructor(model, style) { @@ -15,21 +16,27 @@ export default class Responder extends Group { this.style = style; this.isShowShape = true; this.z = model.zIndex || 1; - this.create(); + if (model.previewOrMapDraw) { + this.create(); + this.setState(model); + } } create() { const model = this.model; + const responderStyle = this.style.Responder; const blockX = model.position.x; const blockY = model.position.y; - const blockWidth = this.style.Responder.block.width || 5; - const blockHeight = this.style.Responder.block.height || 12; - const blockStroke = this.style.Responder.block.stroke || '#000'; - const blockFill = this.style.Responder.block.fill || '#fff'; - const textX = model.position.x + model.offset.x; - const textY = model.position.y + model.offset.y; + const blockWidth = responderStyle.block.width || 5; + const blockHeight = responderStyle.block.height || 12; + const blockStroke = responderStyle.block.stroke || '#000'; + const blockStyle = responderStyle.block.mapStyle[model.type] || { fill: '#000'}; + const textX = model.position.x + model.textOffset.x; + const textY = model.position.y + model.textOffset.y; const textName = `${model.type}-${model.name}`; - const textColor = this.style.Responder.text.stroke || '#fff'; + const textFill = responderStyle.text.textFill || '#fff'; + const deltaFill = responderStyle.delta.fill || '#fff'; + const padding = 1.2; this.block = new Rect({ zlevel: this.model.zlevel, @@ -42,17 +49,10 @@ export default class Responder extends Group { }, style: { stroke: blockStroke, - fill: blockFill + ...blockStyle } }); - if (model.rotate) { - const origin = [blockX, blockY]; - const rotation = -Math.PI / 180 * Number(model.rotate); - this.transformRotation(this.block, origin, rotation); - } - this.add(this.block); - this.text = new Text({ zlevel: this.zlevel, z: this.z + 1, @@ -62,22 +62,68 @@ export default class Responder extends Group { text: textName, fontFamily: this.style.fontFamily, fontSize: this.style.fontSize, - textFill: textColor, + textFill: textFill, textAlign: 'right' } }); + this.delta1 = new Polygon({ + zlevel: this.zlevel, + z: this.z + 1, + shape: { + points: [ + [blockX + blockWidth / 2, blockY + blockWidth], + [blockX + padding, blockY + padding], + [blockX + blockWidth - padding, blockY + padding] + ] + }, + style: { + fill: deltaFill + } + }); + + this.delta2 = new Polygon({ + zlevel: this.zlevel, + z: this.z + 1, + shape: { + points: [ + [blockX + blockWidth / 2, blockY + blockHeight - blockWidth], + [blockX + padding, blockY + blockHeight - padding], + [blockX + blockWidth - padding, blockY + blockHeight - padding] + ] + }, + style: { + fill: deltaFill + } + }); + + if (model.rotate) { + const origin = [blockX, blockY]; + const rotation = -Math.PI / 180 * Number(model.rotate); + [this.block, this.delta1, this.delta2].forEach(el => { + this.transformRotation(el, origin, rotation); + }); + } + if (model.textRotate) { const origin = [textX, textY]; const rotation = -Math.PI / 180 * Number(model.textRotate); this.transformRotation(this.text, origin, rotation); } - this.add(this.text); + [this.block, this.delta1, this.delta2, this.text].forEach(el => { + this.add(el); + }); } setState(model) { if (!this.isShowShape) return; + const responderStyle = this.style.Responder; + const style = responderStyle.block.mapStyle[model.type] || { fill: '#000'}; + this.block.setStyle(style); + [this.delta1, this.delta2].forEach(el => { + model.type == 'IB' ? el.show() : el.hide(); + }); } // 整体图片 diff --git a/src/jmapNew/utils/parser.js b/src/jmapNew/utils/parser.js index 8dca2b3c9..0845de471 100644 --- a/src/jmapNew/utils/parser.js +++ b/src/jmapNew/utils/parser.js @@ -263,6 +263,7 @@ export function parser(data, skinCode, showConfig) { mapDevice[elem.code] = createDevice(deviceType.DirectionRod, elem, propConvert, showConfig); }, this); + if (!data.responderList) { data.responderList = []; }; zrUtil.each(data.responderList || [], elem => { mapDevice[elem.code] = createDevice(deviceType.Responder, elem, propConvert, showConfig); }, this); diff --git a/src/layout/components/Logout.vue b/src/layout/components/Logout.vue index 5ed055278..30214a7c9 100644 --- a/src/layout/components/Logout.vue +++ b/src/layout/components/Logout.vue @@ -11,7 +11,7 @@ {{ $t('global.personalDetails') }} - {{ $t('global.organization') }} + 教学管理 {{ $t('global.exit') }} diff --git a/src/store/modules/map.js b/src/store/modules/map.js index 92be3d600..1afe335a2 100644 --- a/src/store/modules/map.js +++ b/src/store/modules/map.js @@ -537,7 +537,7 @@ const map = { }, responderList: (state) => { if (state.map) { - return state.map.responderList || []; + return state.map.responderList; } else { return []; } diff --git a/src/views/demonstration/detail/index.vue b/src/views/demonstration/detail/index.vue index 850cb78af..ef172ee33 100644 --- a/src/views/demonstration/detail/index.vue +++ b/src/views/demonstration/detail/index.vue @@ -16,7 +16,7 @@ {{ $t('global.distributePermission') }} - {{ $t('demonstration.startSimulation') }} + {{ $t('demonstration.startSimulation') }} @@ -78,9 +78,6 @@ export default { isComprehensive() { return this.courseModel.prdType === '03'; }, - isStartDemon() { - return (this.hasPermssion || this.tryTime > 0); - }, mapId() { return this.$route.query.mapId; }, @@ -173,7 +170,11 @@ export default { this.$router.push({ path: `/jointTrainingNew`, query: query }); launchFullscreen(); }).catch(error => { - this.$messageBox(this.$t('error.createSimulationFailed') + error.message); + if (error.code == 10003) { + this.$messageBox(this.$t('error.createSimulationFailed') + ':您的仿真权限不足!'); + } else { + this.$messageBox(this.$t('error.createSimulationFailed') + error.message); + } this.disabled = false; }); }, @@ -188,6 +189,11 @@ export default { this.$router.push({ path: `/displayIscs/system`, query: query }); } } catch (error) { + if (error.code == 10003) { + this.$messageBox(this.$t('error.createSimulationFailed') + ':您的仿真权限不足!'); + } else { + this.$messageBox(this.$t('error.createSimulationFailed') + error.message); + } this.disabled = false; } }, @@ -200,7 +206,11 @@ export default { } this.$router.push({ path: `/displayBigScreen/${this.courseModel.mapId}`, query: query }); }).catch(error => { - this.$messageBox(this.$t('error.createSimulationFailed') + error.message); + if (error.code == 10003) { + this.$messageBox(this.$t('error.createSimulationFailed') + ':您的仿真权限不足!'); + } else { + this.$messageBox(this.$t('error.createSimulationFailed') + error.message); + } this.disabled = false; }); }, @@ -220,7 +230,11 @@ export default { this.$router.push({ path: `${UrlConfig.displayNew}/demon`, query: query }); launchFullscreen(); }).catch(error=>{ - this.$messageBox(this.$t('error.createSimulationFailed') + error.message); + if (error.code == 10003) { + this.$messageBox(this.$t('error.createSimulationFailed') + ':您的仿真权限不足!'); + } else { + this.$messageBox(this.$t('error.createSimulationFailed') + error.message); + } this.disabled = false; }); }, diff --git a/src/views/newMap/newMapdraft/mapoperate/responder/responderModel.vue b/src/views/newMap/newMapdraft/mapoperate/responder/responderModel.vue index 415b773e8..e17ba1d86 100644 --- a/src/views/newMap/newMapdraft/mapoperate/responder/responderModel.vue +++ b/src/views/newMap/newMapdraft/mapoperate/responder/responderModel.vue @@ -48,7 +48,7 @@ export default { name: '', rotate: 0, textRotate: 0, - offset: { + textOffset: { x: 0, y: 0 }, @@ -56,6 +56,7 @@ export default { x: 0, y: 0 }, + offset: 0, sectionCode: '', stationCode: '' }, @@ -72,6 +73,9 @@ export default { rotate: [ { required: true, message: '请输入应答器旋转角度', trigger: 'blur' } ], + offset: [ + { type: 'number', required: true, message: '请输入应答器文字旋转角度', trigger: 'blur', min: 0 } + ], textRotate: [ { required: true, message: '请输入应答器文字旋转角度', trigger: 'blur' } ], @@ -87,10 +91,10 @@ export default { 'position.y': [ { required: true, message: '请输入应答器坐标y', trigger: 'blur' } ], - 'offset.x': [ + 'textOffset.x': [ { required: true, message: '请输入应答器偏移x', trigger: 'blur' } ], - 'offset.y': [ + 'textOffset.y': [ { required: true, message: '请输入应答器偏移y', trigger: 'blur' } ] } @@ -115,14 +119,15 @@ export default { { prop: 'code', label: '应答器编码', type: 'select', optionLabel: 'code', optionValue: 'code', options: this.responderList, deviceChange: this.deviceChange }, { prop: 'name', label: '应答器名称', type: 'input' }, { prop: 'type', label: `应答器类型`, type: 'select', optionLabel: 'name', optionValue: 'value', options: this.responderTypeList }, + { prop: 'offset', label: '区段偏移值', type: 'number' }, { prop: 'position', label: '坐标', type: 'coordinate', width: '120px', children: [ { prop: 'position.x', firstLevel: 'position', secondLevel: 'x', label: 'x:', type: 'number', labelWidth: '25px', disabled: false }, { prop: 'position.y', firstLevel: 'position', secondLevel: 'y', label: 'y:', type: 'number', labelWidth: '25px', disabled: false } ] }, { prop: 'rotate', label: '应答器旋转', type: 'number' }, - { prop: 'offset', label: '文字偏移', type: 'coordinate', width: '120px', children: [ - { prop: 'offset.x', firstLevel: 'offset', secondLevel: 'x', label: 'x:', type: 'number', labelWidth: '25px', disabled: false }, - { prop: 'offset.y', firstLevel: 'offset', secondLevel: 'y', label: 'y:', type: 'number', labelWidth: '25px', disabled: false } + { prop: 'textOffset', label: '文字偏移', type: 'coordinate', width: '120px', children: [ + { prop: 'textOffset.x', firstLevel: 'textOffset', secondLevel: 'x', label: 'x:', type: 'number', labelWidth: '25px', disabled: false }, + { prop: 'textOffset.y', firstLevel: 'textOffset', secondLevel: 'y', label: 'y:', type: 'number', labelWidth: '25px', disabled: false } ] }, { prop:'textRotate', label: '文字旋转', type: 'number' }, { prop: 'sectionCode', label: '关联区段', type: 'select', optionLabel: 'code', optionValue: 'code', options: this.sectionList }, diff --git a/src/views/newMap/newMapdraft/mapoperate/responder/utils.js b/src/views/newMap/newMapdraft/mapoperate/responder/utils.js index 0aae4c6bf..487dd0fec 100644 --- a/src/views/newMap/newMapdraft/mapoperate/responder/utils.js +++ b/src/views/newMap/newMapdraft/mapoperate/responder/utils.js @@ -21,7 +21,7 @@ export function buildModelBySection(section, model, list) { x: vx, y: vy }, - offset: { + textOffset: { x: 0, y: 0 }, diff --git a/src/views/organization/index.vue b/src/views/organization/index.vue index 38145e7f1..20de68208 100644 --- a/src/views/organization/index.vue +++ b/src/views/organization/index.vue @@ -1,22 +1,10 @@ - - - 导入学生信息 - - 学生信息导入模板 返回 - + {{ $store.state.user.companyName }} @@ -29,11 +17,11 @@ - + - + 班级 - + - - 查询 + + + + 导入学生信息 + + 学生信息导入模板 + 查询 @@ -69,7 +69,7 @@ /> - + @@ -247,29 +247,24 @@ export default { for (const index in wb.Sheets) { const dataList = convertSheetToList(wb.Sheets[index], true); if (dataList.length) { - const depart = dataList[2][0].trim(); - const parentDepart = dataList[1][0].trim(); + const depart = dataList[1][0].trim(); + const parentDepart = dataList[0][0].trim(); studentData.depart = depart; studentData.parentDepart = parentDepart; for ( let i = 2; i <= dataList[0].length; i++) { - const serialNumber = dataList[0][i]; - const studentId = dataList[1][i]; - const name = dataList[2][i]; + const studentId = dataList[0][i]; + const name = dataList[1][i]; const reg = new RegExp('[\\u4E00-\\u9FFF]+', 'g'); const studentIdJudge = !!studentId && !reg.test(studentId); - const serialNumberJudge = serialNumber == (i - 1); - console.log(studentIdJudge, serialNumberJudge); - if (studentIdJudge && serialNumberJudge && name) { - students.push({account:dataList[1][i], name: dataList[2][i]}); + if (studentIdJudge && name) { + students.push({account:dataList[0][i], name: dataList[1][i]}); } else { - if (!serialNumber && !studentId && !name) { + if (!studentId && !name) { break; } else if (!name) { - throw new Error(`序号为:《${serialNumber}》,学号为:《${studentId}》的数据学生姓名为空!`); + throw new Error(`学号为:《${studentId}》的数据学生姓名为空!`); } else if (!studentIdJudge) { - throw new Error(`序号为:《${serialNumber}》,学号为:《${studentId}》的数据学号格式不正确!`); - } else if (!serialNumberJudge) { - throw new Error(`序号为:《${serialNumber}》,学号为:《${studentId}》的数据序号顺序不正确!`); + throw new Error(`,学号为:《${studentId}》的数据学号格式不正确!`); } } } @@ -305,10 +300,10 @@ export default { }, exportTemplate() { const wb = XLSX.utils.book_new(); - const data1 = [{A: '', B: '年级一', C:'班级二'}]; - const data2 = [{A: '序号', B: '学号', C:'姓名'}]; - const data3 = [{A: '1', B: '00001', C:'张三'}]; - const data4 = [{A: '2', B: '00002', C:'李四'}]; + const data1 = [{ A: 'XXXX级', B:'XX班'}]; + const data2 = [{A: '学号', B:'姓名'}]; + const data3 = [{A: '00001', B:'张三'}]; + const data4 = [{A: '00002', B:'李四'}]; const data = [...data1, ...data2, ...data3, ...data4]; const ws = XLSX.utils.json_to_sheet(data, {skipHeader:true}); ws['!cols'] = [ @@ -331,7 +326,7 @@ export default { padding-right: 20px; height: 40px; z-index: 36; - width: 320px; + width: 40px; text-align: center; position: absolute; right: 0; diff --git a/src/views/publish/examRule/draft/index.vue b/src/views/publish/examRule/draft/index.vue index bd3cc9196..b94ef046e 100644 --- a/src/views/publish/examRule/draft/index.vue +++ b/src/views/publish/examRule/draft/index.vue @@ -35,7 +35,7 @@ import { getPublishLessonList } from '@/api/jmap/lesson'; import RuleFrom from './rule'; import ExamFrom from './examFrom'; import { getPublishMapInfo } from '@/api/jmap/map'; -import { getExamLessonDetail, setCourseList, setCourseListGzb } from '@/api/management/exam'; +import { getExamLessonDetail, setCourseList } from '@/api/management/exam'; import { UrlConfig } from '@/scripts/ConstDic'; import { getSessionStorage } from '@/utils/auth'; @@ -71,9 +71,6 @@ export default { }, isFastCreate() { return this.display == 1 && this.$route.params.mode != 'edit' && Number(this.$route.params.ruleId); - }, - isGzbShow() { - return getSessionStorage('project').startsWith('gzb'); } }, watch: { @@ -103,6 +100,7 @@ export default { }); }, async definition(data) { + console.log(data, '===='); this.course = data; this.formData = {}; this.display = 2; @@ -140,11 +138,7 @@ export default { }; let res = {}; try { - if (this.isGzbShow) { - res = await setCourseListGzb(result); - } else { - res = await setCourseList(result); - } + res = await setCourseList(result); this.$message.success({ message: res.message }); this.$store.dispatch('exam/setRuleList', []); // 清空规则列表数据 const path = `${this.$route.path.match(/(\/.*)\/examRule/)[1]}${UrlConfig.examRuleManage}`; diff --git a/src/views/publish/examRule/draft/rule.vue b/src/views/publish/examRule/draft/rule.vue index 1fc4fcb7a..a496ec88d 100644 --- a/src/views/publish/examRule/draft/rule.vue +++ b/src/views/publish/examRule/draft/rule.vue @@ -25,7 +25,7 @@