Merge branch 'dongwu-master'

This commit is contained in:
BOE\10867418
2023-04-23 17:45:16 +08:00

View File

@@ -256,45 +256,26 @@ console.log("data", data, props.routerInfo);
function show() {
visiable.value = true;
}
function canStudy(setting,current){
const arr = setting?.split(',')
if (arr && arr.length===2){
return current >= arr[0] && current <= arr[1]
}
return false
}
function toDetail(item, i) {
// console.log("import.meta.env.MODE", import.meta.env.MODE);
console.log("current.value !== i", current, i, item);
const realIndex = data.value?.list.findIndex(e => e.id === showList.value[i].id);
// 预览和学习设置
let previewSetting = props.routerInfo.previewSetting;
let studySetting = props.routerInfo.studySetting;
let isStudy = false;
if (previewSetting == null) {
// 如果未设置预览 则只可以看当前关卡 其余关卡不让点击
if (current.value !== i) {
ElMessage.warning("当前关卡不可预览");
return;
}
isStudy = true;
} else {
if (current.value !== i) {
let lookArr = [];
lookArr = previewSetting.split(",");
if (i + 1 >= lookArr[0] && i + 1 <= lookArr[1]) {
if (studySetting !== null) {
let studyArr = [];
studyArr = studySetting.split(",");
if (i + 1 >= studyArr[0] && i + 1 <= studyArr[1]) {
isStudy = true;
} else {
isStudy = false;
}
} else {
isStudy = false;
}
} else {
ElMessage.warning("当前关卡不可预览");
return;
}
} else {
isStudy = true;
}
let isStudy = true;
if(current.value !== i && !canStudy(props.routerInfo.previewSetting,realIndex+1) && !canStudy(props.routerInfo.studySetting,realIndex+1)){
ElMessage.warning("当前关卡不可预览");
return;
}
if(current.value !== i && canStudy(props.routerInfo.previewSetting,realIndex+1)){
isStudy = false
}
if(current.value !== i && canStudy(props.routerInfo.studySetting,realIndex+1)){
isStudy = true
}
router.push({
path: "/pathmappage",
@@ -330,7 +311,7 @@ function close() {
// background-position: center;
// overflow-x: scroll;
margin: 30px;
margin-top: 100px;
margin-top: 200px;
.cha {
position: absolute;
cursor: pointer;