|
@@ -0,0 +1,288 @@
|
|
|
+<template>
|
|
|
+ <div class="paperbox">
|
|
|
+ <!--试卷信息 难度总分-->
|
|
|
+ <div class="paperbox-header">
|
|
|
+ <div class="header-info">
|
|
|
+ <div class="header-info-items">
|
|
|
+ <div class="header-info-title">总分:<span class="header-info-num">{{paperdata.totalnum}}</span>分</div>
|
|
|
+ <div class="header-info-title">题目数:<span class="header-info-num">{{paperdata.paperList.length}}</span></div>
|
|
|
+ <div class="header-info-title difficulty">难度:
|
|
|
+ <el-rate v-model="paperdata.difficulty" disabled />
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+ <div class="header-info-operate">
|
|
|
+ <div>
|
|
|
+ <el-button type="primary" size="small" @click="backDefault">返回列表</el-button>
|
|
|
+ </div>
|
|
|
+ <div>
|
|
|
+ <el-button type="primary" size="small">全部展开</el-button>
|
|
|
+ </div>
|
|
|
+ <div>
|
|
|
+ <el-button type="primary" size="small">拷贝当前试卷</el-button>
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+ <div class="paper-name">{{paperdata.title}}</div>
|
|
|
+ <div class="paper-view">
|
|
|
+ <div>
|
|
|
+ <p class="paper-view-title"><span>一、</span><span>单选题</span><span class="aggregate">(共 1 题,总计 10 分)</span></p>
|
|
|
+ <div class="problem">
|
|
|
+ <!--题目-->
|
|
|
+ <div class="problem-details">
|
|
|
+ <div class="problem-num">1:</div>
|
|
|
+ <div class="problem-content" v-html="paper"></div>
|
|
|
+ </div>
|
|
|
+ <!--题目end-->
|
|
|
+ <!--分数-->
|
|
|
+ <div class="numshow">
|
|
|
+ <div class="numshow-nums"><span>10 分</span></div>
|
|
|
+ <div class="numshow-icon">
|
|
|
+ <div class="numshow-icon-item">
|
|
|
+ <svg class="tagicons" aria-hidden="true" @click="unfold('1')">
|
|
|
+ <use :xlink:href="shows ? '#icon-shouhuishangxia':'#icon-moduanzhankai_o'"></use>
|
|
|
+ </svg>
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+ <!--分数end-->
|
|
|
+ <!--选项-->
|
|
|
+ <div class="proble-single">
|
|
|
+ <div class="item-single">
|
|
|
+ <div class="item-single-tag">A:</div>
|
|
|
+ <div class="item-single-content">123456</div>
|
|
|
+ </div>
|
|
|
+ <div class="item-single">
|
|
|
+ <div class="item-single-tag">B:</div>
|
|
|
+ <div class="item-single-content">154323456</div>
|
|
|
+ </div>
|
|
|
+ <div class="item-single">
|
|
|
+ <div class="item-single-tag">C:</div>
|
|
|
+ <div class="item-single-content">123534534456</div>
|
|
|
+ </div>
|
|
|
+ <div class="item-single">
|
|
|
+ <div class="item-single-tag">D:</div>
|
|
|
+ <div class="item-single-content">123453543456</div>
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+ <!--选项end-->
|
|
|
+ <!--展开内容-->
|
|
|
+ <div :class="[unfoldnum == 1 ? 'unfoldIndex':'','spreadbox']">
|
|
|
+ <p><span class="spreadbox-title">【题型】</span><span>单选题</span></p>
|
|
|
+ <p><span class="spreadbox-title">【答案】</span><span>D</span></p>
|
|
|
+ <p><span class="spreadbox-title">【解析】</span><span>不等式</span></p>
|
|
|
+ <p><span class="spreadbox-title">【知识点】</span><span> 不等式计算</span></p>
|
|
|
+ <p><span class="spreadbox-title">【认知层次】</span><span>应用</span></p>
|
|
|
+ <p><span class="spreadbox-title">【补救资源】</span><span>暂无</span></p>
|
|
|
+ </div>
|
|
|
+ <!--展开内容end-->
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+</template>
|
|
|
+<script>
|
|
|
+import { ref, watch, getCurrentInstance } from 'vue'
|
|
|
+import { useStore } from 'vuex'
|
|
|
+export default ({
|
|
|
+ props: {
|
|
|
+ paperInfo: {
|
|
|
+ type: Object,
|
|
|
+ default: () => { },
|
|
|
+ }
|
|
|
+ },
|
|
|
+ setup (props, context) {
|
|
|
+ const store = useStore()
|
|
|
+ let paper = ref("若CE=1,EB=3,求⊙O的半径;")
|
|
|
+ let paperdata = ref({
|
|
|
+ totalnum: 0,
|
|
|
+ difficulty: 0,
|
|
|
+ title: '',
|
|
|
+ paperList: []
|
|
|
+ })
|
|
|
+ let value1 = ref(4)
|
|
|
+ let shows = ref(false)
|
|
|
+ let unfoldnum = ref(-1)
|
|
|
+ console.log(store.state.paperData, '试卷信息')
|
|
|
+ function unfold (index) {
|
|
|
+ if (index == unfoldnum.value) {
|
|
|
+ console.log('进入相同判断')
|
|
|
+ shows.value = !shows.value
|
|
|
+ unfoldnum.value = -1
|
|
|
+ } else {
|
|
|
+ shows.value = !shows.value
|
|
|
+ console.log(shows.value, '现在的值')
|
|
|
+ unfoldnum.value = 1
|
|
|
+ }
|
|
|
+ }
|
|
|
+ function backDefault () {
|
|
|
+ context.emit('renew', 'default')
|
|
|
+ }
|
|
|
+ function paperInit (val) {
|
|
|
+ paperdata.value.totalnum = val.total
|
|
|
+ paperdata.value.title = val.title
|
|
|
+ paperdata.value.paperList = val.list
|
|
|
+ paperdata.value.difficulty = Number(val.difficulty)
|
|
|
+ console.log(paperdata.value)
|
|
|
+ }
|
|
|
+ watch(props, (newpaper) => {
|
|
|
+ console.log(newpaper, '监听试卷的相关内容')
|
|
|
+ newpaper.paperInfo ? paperInit(newpaper.paperInfo) : ''
|
|
|
+ }, { deep: true, })
|
|
|
+ return {
|
|
|
+ paper,
|
|
|
+ value1,
|
|
|
+ shows,
|
|
|
+ unfold,
|
|
|
+ unfoldnum,
|
|
|
+ backDefault,
|
|
|
+ paperdata
|
|
|
+ }
|
|
|
+ },
|
|
|
+})
|
|
|
+</script>
|
|
|
+<style scoped>
|
|
|
+.paperbox {
|
|
|
+ width: 98%;
|
|
|
+ min-height: 65vh;
|
|
|
+ background: #fff;
|
|
|
+ margin: 1%;
|
|
|
+ line-height: 20px;
|
|
|
+ flex-wrap: wrap;
|
|
|
+}
|
|
|
+.paperbox-header {
|
|
|
+ width: 100%;
|
|
|
+}
|
|
|
+.header-info {
|
|
|
+ display: flex;
|
|
|
+ border-bottom: 1px dashed #ccc;
|
|
|
+ height: 80px;
|
|
|
+ line-height: 80px;
|
|
|
+}
|
|
|
+.header-info-items {
|
|
|
+ display: flex;
|
|
|
+ width: 45%;
|
|
|
+}
|
|
|
+.header-info-title {
|
|
|
+ width: 18%;
|
|
|
+ display: flex;
|
|
|
+ padding-left: 15px;
|
|
|
+}
|
|
|
+.difficulty {
|
|
|
+ width: 35%;
|
|
|
+}
|
|
|
+.header-info-operate {
|
|
|
+ width: 50%;
|
|
|
+ display: flex;
|
|
|
+ flex-direction: row-reverse;
|
|
|
+}
|
|
|
+.header-info-operate div {
|
|
|
+ margin-right: 10px;
|
|
|
+}
|
|
|
+.paper-name {
|
|
|
+ font-size: 30px;
|
|
|
+ font-weight: bold;
|
|
|
+ line-height: 60px;
|
|
|
+ margin-top: 1%;
|
|
|
+}
|
|
|
+.paper-view-title {
|
|
|
+ text-align: left;
|
|
|
+ font-size: 18px;
|
|
|
+ font-weight: bold;
|
|
|
+ padding-left: 1%;
|
|
|
+}
|
|
|
+.aggregate {
|
|
|
+ font-size: 16px;
|
|
|
+ padding-left: 5px;
|
|
|
+}
|
|
|
+.problem {
|
|
|
+ position: relative;
|
|
|
+ cursor: pointer;
|
|
|
+ text-align: left;
|
|
|
+ margin: 1%;
|
|
|
+ padding: 1%;
|
|
|
+ border: 1px solid transparent;
|
|
|
+}
|
|
|
+.problem-details {
|
|
|
+ width: 85%;
|
|
|
+ display: inline-block;
|
|
|
+ vertical-align: top;
|
|
|
+}
|
|
|
+.numshow {
|
|
|
+ width: 15%;
|
|
|
+ display: inline-block;
|
|
|
+ vertical-align: top;
|
|
|
+ text-align: right;
|
|
|
+}
|
|
|
+.problem-num {
|
|
|
+ display: inline-block;
|
|
|
+ vertical-align: top;
|
|
|
+ width: 30px;
|
|
|
+ font-weight: bold;
|
|
|
+}
|
|
|
+.problem-content {
|
|
|
+ display: inline-block;
|
|
|
+ vertical-align: top;
|
|
|
+}
|
|
|
+.proble-single {
|
|
|
+ width: 85%;
|
|
|
+ margin-top: 1%;
|
|
|
+}
|
|
|
+.item-single {
|
|
|
+ margin: 8px 0px;
|
|
|
+ font-size: 16px;
|
|
|
+}
|
|
|
+.item-single div {
|
|
|
+ display: inline-block;
|
|
|
+ vertical-align: top;
|
|
|
+}
|
|
|
+.item-single-tag {
|
|
|
+ width: 35px;
|
|
|
+ font-weight: bold;
|
|
|
+}
|
|
|
+.tagicons {
|
|
|
+ width: 18px;
|
|
|
+ height: 18px;
|
|
|
+ fill: currentColor;
|
|
|
+ overflow: hidden;
|
|
|
+}
|
|
|
+.numshow-nums,
|
|
|
+.numshow-icon {
|
|
|
+ display: inline-block;
|
|
|
+ vertical-align: top;
|
|
|
+}
|
|
|
+.numshow-icon {
|
|
|
+ margin-left: 2%;
|
|
|
+}
|
|
|
+.numshow-icon-item {
|
|
|
+ width: 24px;
|
|
|
+ height: 24px;
|
|
|
+ background-color: #fff;
|
|
|
+ border: 1px solid #ccc;
|
|
|
+ border-radius: 50%;
|
|
|
+ text-align: center;
|
|
|
+}
|
|
|
+.problem:hover {
|
|
|
+ border: 1px solid #48dbfb;
|
|
|
+}
|
|
|
+.spreadbox {
|
|
|
+ margin-top: 1%;
|
|
|
+ padding-top: 1%;
|
|
|
+ /* border-top: 1px dashed #ccc; */
|
|
|
+ transition: all 0.8s;
|
|
|
+ max-height: 0;
|
|
|
+ overflow: hidden;
|
|
|
+}
|
|
|
+.spreadbox-title {
|
|
|
+ color: #48dbfb;
|
|
|
+}
|
|
|
+.unfoldIndex {
|
|
|
+ max-height: 230px;
|
|
|
+ border-top: 1px dashed #ccc;
|
|
|
+}
|
|
|
+</style>
|
|
|
+<style>
|
|
|
+.header-info .el-rate {
|
|
|
+ line-height: 4.7;
|
|
|
+}
|
|
|
+</style>
|