|
@@ -1,7 +1,7 @@
|
|
|
<template>
|
|
<template>
|
|
|
<Modal :visible="visible" :width="1024" :closeButton="true" @update:visible="val => emit('update:visible', val)">
|
|
<Modal :visible="visible" :width="1024" :closeButton="true" @update:visible="val => emit('update:visible', val)">
|
|
|
<div class="wp_tool wp_tool45" v-if="workData">
|
|
<div class="wp_tool wp_tool45" v-if="workData">
|
|
|
- <div class="wp_t45_title">题目内容</div>
|
|
|
|
|
|
|
+ <!-- <div class="wp_t45_title">题目内容</div>
|
|
|
<div
|
|
<div
|
|
|
class="s_b_m_toolItem"
|
|
class="s_b_m_toolItem"
|
|
|
v-for="(item, index) in workData.testJson"
|
|
v-for="(item, index) in workData.testJson"
|
|
@@ -61,8 +61,73 @@
|
|
|
<span v-else>{{ item2 }}</span>
|
|
<span v-else>{{ item2 }}</span>
|
|
|
</span>
|
|
</span>
|
|
|
</div>
|
|
</div>
|
|
|
|
|
+ </div> -->
|
|
|
|
|
+ <div class="cq_title" v-if="workData.testJson[showIndex]">
|
|
|
|
|
+ <span>{{ workData.testJson[showIndex].teststitle }}</span>
|
|
|
|
|
+
|
|
|
|
|
+ <div class="cq_changeBtnArea" v-if="workData.testJson.length>1">
|
|
|
|
|
+ <span :class="{cq_cba_disabled: showIndex == 0}" @click="changeQuestion('prev')">上一题</span>
|
|
|
|
|
+ <span :class="{cq_cba_disabled: showIndex == workData.testJson.length - 1}" @click="changeQuestion('next')">下一题</span>
|
|
|
</div>
|
|
</div>
|
|
|
</div>
|
|
</div>
|
|
|
|
|
+
|
|
|
|
|
+
|
|
|
|
|
+ <img class="cq_image" v-if="workData.testJson[showIndex].timuList.length>0" :src="workData.testJson[showIndex].timuList[0].src" @click="openPreview(workData.testJson[showIndex].timuList[0])">
|
|
|
|
|
+
|
|
|
|
|
+ <div class="cq_type" v-if="workData.testJson[showIndex]">
|
|
|
|
|
+ {{ workData.testJson[showIndex].type == 1 ? "单选题" : "多选题" }}
|
|
|
|
|
+ <span v-if="workData.testJson.length>1">({{showIndex+1}}/{{workData.testJson.length}})</span>
|
|
|
|
|
+
|
|
|
|
|
+ </div>
|
|
|
|
|
+ <div class="cq_checkListArea">
|
|
|
|
|
+ <div
|
|
|
|
|
+ class="cq_ca_type1"
|
|
|
|
|
+ v-if="
|
|
|
|
|
+ workData.testJson[showIndex] && workData.testJson[showIndex].showType == '1'
|
|
|
|
|
+ "
|
|
|
|
|
+ >
|
|
|
|
|
+ <div
|
|
|
|
|
+ class="cq_ca_t1_item"
|
|
|
|
|
+ :class="{
|
|
|
|
|
+ cq_ca_t1_item_active:
|
|
|
|
|
+ workData.testJson[showIndex].type == '1'
|
|
|
|
|
+ ? workData.testJson[showIndex].userAnswer === index
|
|
|
|
|
+ : workData.testJson[showIndex].userAnswer.includes(index)
|
|
|
|
|
+ }"
|
|
|
|
|
+ v-for="(item, index) in workData.testJson[showIndex].checkList"
|
|
|
|
|
+ :key="showIndex + '_' + index"
|
|
|
|
|
+ >
|
|
|
|
|
+ <div>
|
|
|
|
|
+ <span>{{ options[index] }}</span>
|
|
|
|
|
+ </div>
|
|
|
|
|
+ <img v-if="item.imgType && item.imgType=='1'" :src="item.src" @click="openPreview(item)">
|
|
|
|
|
+ <span v-else>{{ item }}</span>
|
|
|
|
|
+ </div>
|
|
|
|
|
+ </div>
|
|
|
|
|
+
|
|
|
|
|
+ <div class="cq_ca_type2" v-if="
|
|
|
|
|
+ workData.testJson[showIndex] && workData.testJson[showIndex].showType == '2'
|
|
|
|
|
+ ">
|
|
|
|
|
+ <div
|
|
|
|
|
+ class="cq_ca_t2_item"
|
|
|
|
|
+ :class="{
|
|
|
|
|
+ cq_ca_t2_item_active:
|
|
|
|
|
+ workData.testJson[showIndex].type == '1'
|
|
|
|
|
+ ? workData.testJson[showIndex].userAnswer === index
|
|
|
|
|
+ : workData.testJson[showIndex].userAnswer.includes(index)
|
|
|
|
|
+ }"
|
|
|
|
|
+ v-for="(item, index) in workData.testJson[showIndex].checkList"
|
|
|
|
|
+ :key="showIndex + '_' + index"
|
|
|
|
|
+ >
|
|
|
|
|
+ <div>
|
|
|
|
|
+ <span>{{ options[index] }}</span>
|
|
|
|
|
+ </div>
|
|
|
|
|
+ <img v-if="item.imgType && item.imgType=='1'" :src="item.src" @click="openPreview(item)">
|
|
|
|
|
+ <span v-else>{{ item }}</span>
|
|
|
|
|
+ </div>
|
|
|
|
|
+ </div>
|
|
|
|
|
+ </div>
|
|
|
|
|
+ </div>
|
|
|
</Modal>
|
|
</Modal>
|
|
|
|
|
|
|
|
|
|
|
|
@@ -111,6 +176,36 @@ const visible = computed({
|
|
|
set: (v: boolean) => emit('update:visible', v)
|
|
set: (v: boolean) => emit('update:visible', v)
|
|
|
})
|
|
})
|
|
|
|
|
|
|
|
|
|
+const showIndex = ref(0)
|
|
|
|
|
+
|
|
|
|
|
+const options = [
|
|
|
|
|
+ 'A',
|
|
|
|
|
+ 'B',
|
|
|
|
|
+ 'C',
|
|
|
|
|
+ 'D',
|
|
|
|
|
+ 'E',
|
|
|
|
|
+ 'F',
|
|
|
|
|
+ 'G',
|
|
|
|
|
+ 'H',
|
|
|
|
|
+ 'I',
|
|
|
|
|
+ 'J',
|
|
|
|
|
+ 'K',
|
|
|
|
|
+ 'L',
|
|
|
|
|
+ 'M',
|
|
|
|
|
+ 'N',
|
|
|
|
|
+ 'O',
|
|
|
|
|
+ 'P',
|
|
|
|
|
+ 'Q',
|
|
|
|
|
+ 'R',
|
|
|
|
|
+ 'S',
|
|
|
|
|
+ 'T',
|
|
|
|
|
+ 'U',
|
|
|
|
|
+ 'V',
|
|
|
|
|
+ 'W',
|
|
|
|
|
+ 'X',
|
|
|
|
|
+ 'Y',
|
|
|
|
|
+ 'Z'
|
|
|
|
|
+]
|
|
|
|
|
|
|
|
|
|
|
|
|
const renderedFormula = computed(() => {
|
|
const renderedFormula = computed(() => {
|
|
@@ -179,7 +274,21 @@ const imageUrl = ref('')
|
|
|
|
|
|
|
|
watch(() => props.visible, (newVal) => {
|
|
watch(() => props.visible, (newVal) => {
|
|
|
if (props.work && newVal) {
|
|
if (props.work && newVal) {
|
|
|
|
|
+ showIndex.value = 0
|
|
|
workData.value = JSON.parse(decodeURIComponent(props.work.content))
|
|
workData.value = JSON.parse(decodeURIComponent(props.work.content))
|
|
|
|
|
+ workData.value.testJson.forEach(i => {
|
|
|
|
|
+ const maxLength = i.checkList.reduce((pre, cur) => {
|
|
|
|
|
+ if (pre < cur.length) return cur.length
|
|
|
|
|
+ return pre
|
|
|
|
|
+ }, 0)
|
|
|
|
|
+
|
|
|
|
|
+ if (maxLength <= 6 && i.checkList.length <= 4) {
|
|
|
|
|
+ i.showType = '1'
|
|
|
|
|
+ }
|
|
|
|
|
+ else {
|
|
|
|
|
+ i.showType = '2'
|
|
|
|
|
+ }
|
|
|
|
|
+ })
|
|
|
}
|
|
}
|
|
|
}, {
|
|
}, {
|
|
|
immediate: true,
|
|
immediate: true,
|
|
@@ -202,6 +311,17 @@ const closePreview = () => {
|
|
|
previewVisible.value = false
|
|
previewVisible.value = false
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
+const changeQuestion = (type) => {
|
|
|
|
|
+ if (type === 'prev') {
|
|
|
|
|
+ if (showIndex.value === 0) return
|
|
|
|
|
+ showIndex.value--
|
|
|
|
|
+ }
|
|
|
|
|
+ else {
|
|
|
|
|
+ if (showIndex.value === workData.value.testJson.length - 1) return
|
|
|
|
|
+ showIndex.value++
|
|
|
|
|
+ }
|
|
|
|
|
+}
|
|
|
|
|
+
|
|
|
const zoomStep = 0.2
|
|
const zoomStep = 0.2
|
|
|
const minScale = 0.2
|
|
const minScale = 0.2
|
|
|
const maxScale = 6
|
|
const maxScale = 6
|
|
@@ -270,7 +390,7 @@ const onDragEnd = () => {
|
|
|
|
|
|
|
|
<style lang="scss" scoped>
|
|
<style lang="scss" scoped>
|
|
|
|
|
|
|
|
-.wp_tool {
|
|
|
|
|
|
|
+/*.wp_tool {
|
|
|
width: 100%;
|
|
width: 100%;
|
|
|
height: auto;
|
|
height: auto;
|
|
|
max-height: 80vh;
|
|
max-height: 80vh;
|
|
@@ -302,7 +422,6 @@ const onDragEnd = () => {
|
|
|
height: auto;
|
|
height: auto;
|
|
|
padding: 15px 15px 15px 15px;
|
|
padding: 15px 15px 15px 15px;
|
|
|
display: flex;
|
|
display: flex;
|
|
|
- /* flex-wrap: wrap; */
|
|
|
|
|
background-color: #f3f7fd;
|
|
background-color: #f3f7fd;
|
|
|
border-radius: 30px;
|
|
border-radius: 30px;
|
|
|
margin: 10px 0 10px 0px;
|
|
margin: 10px 0 10px 0px;
|
|
@@ -413,5 +532,240 @@ const onDragEnd = () => {
|
|
|
.s_b_m_ti_title > div {
|
|
.s_b_m_ti_title > div {
|
|
|
font-size: 30px;
|
|
font-size: 30px;
|
|
|
font-weight: bold;
|
|
font-weight: bold;
|
|
|
|
|
+}*/
|
|
|
|
|
+
|
|
|
|
|
+.wp_tool45 {
|
|
|
|
|
+ width: 100%;
|
|
|
|
|
+ height: 100%;
|
|
|
|
|
+ display: flex;
|
|
|
|
|
+ align-items: center;
|
|
|
|
|
+ /* justify-content: center; */
|
|
|
|
|
+ flex-direction: column;
|
|
|
|
|
+ box-sizing: border-box;
|
|
|
|
|
+ padding: 50px 10%;
|
|
|
|
|
+ overflow: auto;
|
|
|
|
|
+ position: relative;
|
|
|
|
|
+}
|
|
|
|
|
+
|
|
|
|
|
+.cq_title {
|
|
|
|
|
+ font-size: 35px;
|
|
|
|
|
+ font-weight: bold;
|
|
|
|
|
+ text-align: center;
|
|
|
|
|
+ width: 70%;
|
|
|
|
|
+ position: relative;
|
|
|
|
|
+}
|
|
|
|
|
+
|
|
|
|
|
+.cq_image{
|
|
|
|
|
+ width: auto;
|
|
|
|
|
+ height: 300px;
|
|
|
|
|
+ object-fit: cover;
|
|
|
|
|
+ margin: 20px 0;
|
|
|
|
|
+ cursor: pointer;
|
|
|
|
|
+}
|
|
|
|
|
+
|
|
|
|
|
+.cq_changeBtnArea {
|
|
|
|
|
+ position: absolute;
|
|
|
|
|
+ top: 0px;
|
|
|
|
|
+ right: -200px;
|
|
|
|
|
+ width: 200px;
|
|
|
|
|
+ height: auto;
|
|
|
|
|
+ display: flex;
|
|
|
|
|
+ justify-content: flex-end;
|
|
|
|
|
+ align-items: flex-start;
|
|
|
|
|
+}
|
|
|
|
|
+
|
|
|
|
|
+.cq_changeBtnArea > span{
|
|
|
|
|
+ width: 100px;
|
|
|
|
|
+ height: 40px;
|
|
|
|
|
+ background: #3681FC;
|
|
|
|
|
+ border-radius: 8px;
|
|
|
|
|
+ color: #fff;
|
|
|
|
|
+ font-size: 16px;
|
|
|
|
|
+ text-align: center;
|
|
|
|
|
+ font-weight: 500;
|
|
|
|
|
+ display: flex;
|
|
|
|
|
+ align-items: center;
|
|
|
|
|
+ justify-content: center;
|
|
|
|
|
+ cursor: pointer;
|
|
|
|
|
+ margin-left: 20px;
|
|
|
|
|
+ transition: .2s;
|
|
|
|
|
+}
|
|
|
|
|
+
|
|
|
|
|
+.cq_changeBtnArea > span:hover{
|
|
|
|
|
+ background: #5893FF;
|
|
|
|
|
+}
|
|
|
|
|
+
|
|
|
|
|
+.cq_cba_disabled{
|
|
|
|
|
+ background: #D9D9D9 !important;
|
|
|
|
|
+ cursor: not-allowed !important;
|
|
|
|
|
+}
|
|
|
|
|
+
|
|
|
|
|
+.cq_type {
|
|
|
|
|
+ margin: 20px 0 40px 0;
|
|
|
|
|
+ font-size: 22px;
|
|
|
|
|
+ color: #808080;
|
|
|
|
|
+}
|
|
|
|
|
+
|
|
|
|
|
+.cq_checkListArea {
|
|
|
|
|
+ width: 100%;
|
|
|
|
|
+ height: auto;
|
|
|
|
|
+ box-sizing: border-box;
|
|
|
|
|
+ display: flex;
|
|
|
|
|
+ align-items: center;
|
|
|
|
|
+ justify-content: center;
|
|
|
|
|
+}
|
|
|
|
|
+
|
|
|
|
|
+.cq_ca_type1 {
|
|
|
|
|
+ width: auto;
|
|
|
|
|
+ height: auto;
|
|
|
|
|
+ display: grid;
|
|
|
|
|
+ grid-template-columns: repeat(2, 1fr);
|
|
|
|
|
+ grid-template-rows: repeat(2, 1fr);
|
|
|
|
|
+ gap: 30px; /* 可根据需要调整间距 */
|
|
|
|
|
+ justify-content: center;
|
|
|
|
|
+ align-items: center;
|
|
|
|
|
+ margin: 40px 20px;
|
|
|
|
|
+}
|
|
|
|
|
+
|
|
|
|
|
+.cq_ca_t1_item {
|
|
|
|
|
+ width: 100%;
|
|
|
|
|
+ max-width: 400px;
|
|
|
|
|
+ min-width: 300px;
|
|
|
|
|
+ height: 100px;
|
|
|
|
|
+ display: flex;
|
|
|
|
|
+ align-items: center;
|
|
|
|
|
+ justify-content: center;
|
|
|
|
|
+
|
|
|
|
|
+ background: #fff;
|
|
|
|
|
+ box-shadow: 2px 4px 20px 0px rgba(0, 0, 0, 0.2);
|
|
|
|
|
+ border-radius: 12px;
|
|
|
|
|
+ margin: auto;
|
|
|
|
|
+ cursor: pointer;
|
|
|
|
|
+ transition: 0.3s;
|
|
|
|
|
+ font-size: 20px;
|
|
|
|
|
+ color: #000;
|
|
|
|
|
+ user-select: none;
|
|
|
|
|
+ /* 不可选中 */
|
|
|
|
|
+ /* box-sizing: border-box;
|
|
|
|
|
+ padding: 20px 40px; */
|
|
|
|
|
+}
|
|
|
|
|
+
|
|
|
|
|
+.cq_ca_t1_item_active {
|
|
|
|
|
+ box-shadow: 4px 4px 14px 0px rgba(252, 207, 0, 0.5);
|
|
|
|
|
+}
|
|
|
|
|
+
|
|
|
|
|
+.cq_ca_t1_item > div {
|
|
|
|
|
+ color: #fff;
|
|
|
|
|
+ position: relative;
|
|
|
|
|
+ margin-right: 20px;
|
|
|
|
|
+}
|
|
|
|
|
+
|
|
|
|
|
+.cq_ca_t1_item>img{
|
|
|
|
|
+ width: 80px;
|
|
|
|
|
+ height: 80px;
|
|
|
|
|
+ cursor: pointer;
|
|
|
|
|
+ object-fit: cover;
|
|
|
|
|
+}
|
|
|
|
|
+
|
|
|
|
|
+.cq_ca_t1_item > div > span {
|
|
|
|
|
+ position: relative;
|
|
|
|
|
+ z-index: 2;
|
|
|
|
|
+ color: #fff;
|
|
|
|
|
+ font-size: 20px;
|
|
|
|
|
+}
|
|
|
|
|
+
|
|
|
|
|
+.cq_ca_t1_item > div::after {
|
|
|
|
|
+ content: "";
|
|
|
|
|
+ width: 25px;
|
|
|
|
|
+ height: 25px;
|
|
|
|
|
+ background: rgba(252, 207, 0, 1);
|
|
|
|
|
+ border-radius: 50%;
|
|
|
|
|
+ position: absolute;
|
|
|
|
|
+ left: 50%;
|
|
|
|
|
+ top: 50%;
|
|
|
|
|
+ transform: translate(-50%, -50%);
|
|
|
|
|
+ z-index: 1; /* after在内容下方 */
|
|
|
|
|
+ pointer-events: none;
|
|
|
|
|
+}
|
|
|
|
|
+
|
|
|
|
|
+.cq_ca_type2{
|
|
|
|
|
+ width: 100%;
|
|
|
|
|
+ height: auto;
|
|
|
|
|
+ display: flex;
|
|
|
|
|
+ align-items: center;
|
|
|
|
|
+ justify-content: center;
|
|
|
|
|
+ flex-direction: column;
|
|
|
|
|
+}
|
|
|
|
|
+
|
|
|
|
|
+.cq_ca_t2_item{
|
|
|
|
|
+ width: 100%;
|
|
|
|
|
+ height: 72px;
|
|
|
|
|
+ display: flex;
|
|
|
|
|
+ align-items: center;
|
|
|
|
|
+ justify-content: flex-start;
|
|
|
|
|
+ box-sizing: border-box;
|
|
|
|
|
+ padding-left: 40px;
|
|
|
|
|
+ padding-right: 20px;
|
|
|
|
|
+ margin-bottom: 20px;
|
|
|
|
|
+ background: #fff;
|
|
|
|
|
+ box-shadow: 2px 4px 20px 0px rgba(0, 0, 0, 0.2);
|
|
|
|
|
+ border-radius: 12px;
|
|
|
|
|
+ cursor: pointer;
|
|
|
|
|
+ transition: 0.3s;
|
|
|
|
|
+ font-size: 20px;
|
|
|
|
|
+ color: #000;
|
|
|
|
|
+ user-select: none;
|
|
|
|
|
+ overflow: auto;
|
|
|
|
|
+ overflow-y: hidden;
|
|
|
|
|
+}
|
|
|
|
|
+
|
|
|
|
|
+.cq_ca_t2_item>div{
|
|
|
|
|
+ color: #fff;
|
|
|
|
|
+ position: relative;
|
|
|
|
|
+ margin-right: 20px;
|
|
|
|
|
+}
|
|
|
|
|
+
|
|
|
|
|
+.cq_ca_t2_item>span{
|
|
|
|
|
+ display: flex;
|
|
|
|
|
+ align-items: center;
|
|
|
|
|
+ white-space: nowrap;
|
|
|
|
|
+}
|
|
|
|
|
+
|
|
|
|
|
+.cq_ca_t2_item>img{
|
|
|
|
|
+ width: 70px;
|
|
|
|
|
+ height: 70px;
|
|
|
|
|
+ cursor: pointer;
|
|
|
|
|
+ object-fit: cover;
|
|
|
|
|
+}
|
|
|
|
|
+
|
|
|
|
|
+
|
|
|
|
|
+.cq_ca_t2_item_active {
|
|
|
|
|
+ box-shadow: 4px 4px 14px 0px rgba(252, 207, 0, 0.5);
|
|
|
|
|
+}
|
|
|
|
|
+
|
|
|
|
|
+.cq_ca_t2_item > div {
|
|
|
|
|
+ color: #fff;
|
|
|
|
|
+ position: relative;
|
|
|
|
|
+ margin-right: 20px;
|
|
|
|
|
+}
|
|
|
|
|
+.cq_ca_t2_item > div > span {
|
|
|
|
|
+ position: relative;
|
|
|
|
|
+ z-index: 2;
|
|
|
|
|
+ color: #fff;
|
|
|
|
|
+ font-size: 20px;
|
|
|
|
|
+}
|
|
|
|
|
+
|
|
|
|
|
+.cq_ca_t2_item > div::after {
|
|
|
|
|
+ content: "";
|
|
|
|
|
+ width: 25px;
|
|
|
|
|
+ height: 25px;
|
|
|
|
|
+ background: rgba(252, 207, 0, 1);
|
|
|
|
|
+ border-radius: 50%;
|
|
|
|
|
+ position: absolute;
|
|
|
|
|
+ left: 50%;
|
|
|
|
|
+ top: 50%;
|
|
|
|
|
+ transform: translate(-50%, -50%);
|
|
|
|
|
+ z-index: 1; /* after在内容下方 */
|
|
|
|
|
+ pointer-events: none;
|
|
|
}
|
|
}
|
|
|
</style>
|
|
</style>
|