diff --git a/src/api/management/exam.js b/src/api/management/exam.js index 5691838ae..cd3e23ffc 100644 --- a/src/api/management/exam.js +++ b/src/api/management/exam.js @@ -222,7 +222,7 @@ export function getPaperDetail(pcId) { */ export function getQuestionAmount(data) { return request({ - url: `/api/v2/paper/${data.orgId}/question/count`, + url: `/api/v2/paper/question/count`, method: 'POST', data }); diff --git a/src/directive/verticalDrag/index.js b/src/directive/verticalDrag/index.js new file mode 100644 index 000000000..73c83960a --- /dev/null +++ b/src/directive/verticalDrag/index.js @@ -0,0 +1,8 @@ +import Vue from 'vue'; +import install from './verticalDrag'; + +const verticalDrag = function(Vue) { + Vue.directive('verticalDrag', install); +}; + +Vue.use(verticalDrag); diff --git a/src/directive/verticalDrag/verticalDrag.js b/src/directive/verticalDrag/verticalDrag.js new file mode 100644 index 000000000..88f1a3e5d --- /dev/null +++ b/src/directive/verticalDrag/verticalDrag.js @@ -0,0 +1,101 @@ +/* 垂直拖拽 */ +export default { + bind(el) { + const dialogHeaderEl = el.querySelector('.verticalDrag__header'); + const dialogFooterEl = el.querySelector('.verticalDrag__footer'); + const dragDom = el; + dialogHeaderEl.style.cursor = 'move'; + dialogFooterEl.style.cursor = 'move'; + const vD = 5; + + /** 获取原有属性 ie dom元素.currentStyle 火狐谷歌 window.getComputedStyle(dom元素, null);*/ + const sty = dragDom.currentStyle || window.getComputedStyle(dragDom, null); + + dialogHeaderEl.onmousedown = (e) => { + e.stopPropagation(); + /** 鼠标按下,计算当前元素距离可视区的距离*/ + const disY = e.clientY; + const oY = dialogHeaderEl.offsetHeight; + const bY = dragDom.offsetHeight; + + /** 获取到的值带px 正则匹配替换*/ + let styT; + + /** 注意在ie中 第一次获取到的值为组件自带50% 移动之后赋值为px*/ + if (sty.top.includes('%')) { + styT = +document.body.clientHeight * (+sty.top.replace(/\%/g, '') / 100); + } else { + styT = +sty.top.replace(/\px/g, ''); + } + + document.onmousemove = function (e) { + e.preventDefault(); + e.stopPropagation(); + let cY = e.clientY; + if (cY < oY + vD) { + cY = oY + vD; + } + if (cY > document.body.clientHeight - bY - vD) { + cY = document.body.clientHeight - bY - vD; + } + /** 通过事件委托,计算移动的距离*/ + const t = cY - disY; + + /** 移动当前元素*/ + dragDom.style.top = `${t + styT}px`; + + /** 将此时的位置传出去*/ + // binding.value({ x: e.pageX, y: e.pageY }); + }; + + document.onmouseup = function () { + e.stopPropagation(); + document.onmousemove = null; + document.onmouseup = null; + }; + }; + dialogFooterEl.onmousedown = (e) => { + e.stopPropagation(); + /** 鼠标按下,计算当前元素距离可视区的距离*/ + const disY = e.clientY; + const oY = dialogFooterEl.offsetHeight; + const bY = dragDom.offsetHeight; + + /** 获取到的值带px 正则匹配替换*/ + let styT; + + /** 注意在ie中 第一次获取到的值为组件自带50% 移动之后赋值为px*/ + if (sty.top.includes('%')) { + styT = +document.body.clientHeight * (+sty.top.replace(/\%/g, '') / 100); + } else { + styT = +sty.top.replace(/\px/g, ''); + } + + document.onmousemove = function (e) { + e.preventDefault(); + e.stopPropagation(); + let cY = e.clientY; + if (cY < bY + vD) { + cY = bY + vD; + } + if (cY > document.body.clientHeight - oY - vD) { + cY = document.body.clientHeight - oY - vD; + } + /** 通过事件委托,计算移动的距离*/ + const t = cY - disY; + + /** 移动当前元素*/ + dragDom.style.top = `${t + styT}px`; + + /** 将此时的位置传出去*/ + // binding.value({ x: e.pageX, y: e.pageY }); + }; + + document.onmouseup = function () { + e.stopPropagation(); + document.onmousemove = null; + document.onmouseup = null; + }; + }; + } +}; diff --git a/src/main.js b/src/main.js index 0e17c5626..e7ada36b6 100644 --- a/src/main.js +++ b/src/main.js @@ -24,6 +24,7 @@ import '@/directive/dialogLoading/index.js'; import '@/directive/drag/index.js'; import '@/directive/focus/index.js'; import '@/directive/quickMenuDrag/index.js'; +import '@/directive/verticalDrag/index.js'; import '@/directive/waves/index.js'; import messages from '@/i18n/index'; diff --git a/src/utils/baseUrl.js b/src/utils/baseUrl.js index f84210e59..17845245e 100644 --- a/src/utils/baseUrl.js +++ b/src/utils/baseUrl.js @@ -23,7 +23,7 @@ export function handlerUrl() { let OSS_URL; if (process.env.NODE_ENV === 'development') { // 开发分支 - BASE_API = 'http://192.168.3.233/rtss-server'; + // BASE_API = 'http://192.168.3.233/rtss-server'; // BASE_API = 'https://joylink.club/jlcloud'; // BASE_API = 'https://test.joylink.club/jlcloud'; // BASE_API = 'http://114.116.51.125/jlcloud'; diff --git a/src/views/newMap/display/terminals/dispatcherLoger/index.vue b/src/views/newMap/display/terminals/dispatcherLoger/index.vue index 01253cc1e..65fcfc714 100644 --- a/src/views/newMap/display/terminals/dispatcherLoger/index.vue +++ b/src/views/newMap/display/terminals/dispatcherLoger/index.vue @@ -204,7 +204,7 @@ export default { }, data() { return { - height: this.$store.state.app.height - 37, + height: this.$store.state.app.height - 38, filterSectionList:[], mapStationDirectionData:[], // filterSectionMap:{}, diff --git a/src/views/newMap/display/terminals/terminalMenu.vue b/src/views/newMap/display/terminals/terminalMenu.vue index 22d63de3e..6311c4973 100644 --- a/src/views/newMap/display/terminals/terminalMenu.vue +++ b/src/views/newMap/display/terminals/terminalMenu.vue @@ -1,7 +1,9 @@ @@ -322,6 +324,10 @@ export default { border-radius: 5px 0 0 5px; z-index: 2000; } +.drag-line { + width: 100%; + height: 5px; +} .eachTerminal{ padding: 8px 0; text-align: center; diff --git a/src/views/publish/examRule/draft/editRule.vue b/src/views/publish/examRule/draft/editRule.vue index 1bd32eef1..810be9a0b 100644 --- a/src/views/publish/examRule/draft/editRule.vue +++ b/src/views/publish/examRule/draft/editRule.vue @@ -73,6 +73,12 @@ export default { default() { return []; } + }, + examData: { + type: Object, + default() { + return {}; + } } }, data() { @@ -171,6 +177,7 @@ export default { const param = { orgId: this.$store.state.user.companyId, groupType: this.form.type, + mapId: this.examData.mapId, subType: this.form.subtype }; this.form.tags = ''; @@ -184,7 +191,8 @@ export default { const param = { orgId: this.$store.state.user.companyId, groupType: this.form.type, - subType: this.form.subtype + subType: this.form.subtype, + mapId: this.examData.mapId }; if (this.form.tags !== '') { param.tags = this.form.tags; diff --git a/src/views/publish/examRule/draft/index.vue b/src/views/publish/examRule/draft/index.vue index 848320b52..ae1648b30 100644 --- a/src/views/publish/examRule/draft/index.vue +++ b/src/views/publish/examRule/draft/index.vue @@ -35,7 +35,6 @@ import RuleFrom from './rule'; import ExamFrom from './examFrom'; import { getPaperDetail } from '@/api/management/exam'; -import { UrlConfig } from '@/scripts/ConstDic'; import { createPaper, editPaper } from '@/api/management/exam'; @@ -137,15 +136,7 @@ export default { }); }, turnback() { - const path = `${this.$route.path.match(/(\/.*)\/examRule/)[1]}${UrlConfig.examRuleManage}`; - if (this.$route.query.source === 'org') { - this.$router.go(-1); - } else { - this.$router.replace({ - path: `${path}`, - query: { mapId: this.$route.query.mapId, noPreLogout: this.$route.query.noPreLogout } - }); - } + this.$router.go(-1); } } }; diff --git a/src/views/publish/examRule/draft/rule.vue b/src/views/publish/examRule/draft/rule.vue index baed9ce55..f72725fab 100644 --- a/src/views/publish/examRule/draft/rule.vue +++ b/src/views/publish/examRule/draft/rule.vue @@ -52,7 +52,7 @@ - +