Merge branch 'test_dispaly' of https://git.code.tencent.com/lian-cbtc/jl-client into test_dispaly

This commit is contained in:
joylink_cuiweidong 2023-01-31 14:19:36 +08:00
commit 7ed113aebb
10 changed files with 131 additions and 16 deletions

View File

@ -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
});

View File

@ -0,0 +1,8 @@
import Vue from 'vue';
import install from './verticalDrag';
const verticalDrag = function(Vue) {
Vue.directive('verticalDrag', install);
};
Vue.use(verticalDrag);

View File

@ -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;
};
};
}
};

View File

@ -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';

View File

@ -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';

View File

@ -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:{},

View File

@ -1,7 +1,9 @@
<template>
<div>
<div v-if="isShow && terminalList.length" class="terminalList">
<div v-if="isShow && terminalList.length" v-verticalDrag class="terminalList">
<div class="drag-line verticalDrag__header" />
<div v-for="(eachTerminal,index) in terminalList" :key="index" :class="picture==eachTerminal.code?'eachTerminal active':'eachTerminal'" @click="eachTerminal.click(eachTerminal.code)">{{ eachTerminal.name }}</div>
<div class="drag-line verticalDrag__footer" />
</div>
</div>
</template>
@ -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;

View File

@ -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;

View File

@ -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 }
});
}
}
}
};

View File

@ -52,7 +52,7 @@
</template>
</el-table-column>
</el-table>
<edit-rule ref="addRule" :rule-list="ruleList" @submit="handleRuleSubmit" />
<edit-rule ref="addRule" :rule-list="ruleList" :exam-data="examData" @submit="handleRuleSubmit" />
</div>
</template>