Bläddra i källkod

修改了几个样式问题

wangguoxi 2 månader sedan
förälder
incheckning
e0804747da

+ 2 - 0
src/App.vue

@@ -18,7 +18,9 @@ export default {
     },
     methods: {
         SubmitLogin() {
+            // const username = '5000715069857';
             const username = '4305962347220710';
+
             const password = '123456';
             // const type = '1';
             const schoolType = sessionStorage.getItem('schoolType');

+ 6 - 1
src/store/modules/question.js

@@ -1,11 +1,16 @@
 const state = {
-    isVariation: -1
+    isVariation: -1,
+    canDownloanBtnClick: true
 }
 
 const mutations = {
     SET_VARIANTION: (state, data) => {
         state.isVariation = data
     },
+
+    setCanDownloanBtnClick: (state, data) => {
+        state.canDownloanBtnClick = data
+    }
 }
 
 export default {

+ 7 - 2
src/views/analysisReport/studentPage/mainPage.vue

@@ -18,8 +18,10 @@
                     </el-select>
                 </div>
                 <template v-if="isShowBtn">
-                    <el-button size="medium" @click="downloadWrongQuestions(0)">下载错题本</el-button>
-                    <el-button type="primary" size="medium" @click="downloadWrongQuestions(1)">下载个性化提升手册</el-button>
+                    <el-button size="medium" :disabled="!canBtnClick"
+                        @click="downloadWrongQuestions(0)">下载错题本</el-button>
+                    <el-button :disabled="!canBtnClick" type="primary" size="medium"
+                        @click="downloadWrongQuestions(1)">下载个性化提升手册</el-button>
                 </template>
                 <!-- <el-button v-if="isShowPadfBtn" style="margin-left: 10px;" size="medium" type="primary" :loading="stuPdfLoading" @click="StuDownloadPDF">下载PDF</el-button> -->
             </div>
@@ -92,6 +94,9 @@ export default {
         filteredFilterData() {
             // 返回原始数据,不在个人画像页面隐藏总分选项
             return this.filterData;
+        },
+        canBtnClick() {
+            return this.$store.state.question.canDownloanBtnClick;
         }
     },
     data() {

+ 61 - 29
src/views/analysisReport/wrongQuestion/index.vue

@@ -11,9 +11,10 @@
 
         <div class="content">
             <div class="right_btn" v-if="errorType !== 1">
-                <el-button size="medium" disabled
+                <el-button size="medium" :disabled="!canBtnClick"
                     @click="downloadDialogVisible = true; isVariation = 0">下载错题本</el-button>
-                <el-button type="primary" size="medium" @click="downLoadPapers">下载个性化提升手册</el-button>
+                <el-button :disabled="!canBtnClick" type="primary" size="medium"
+                    @click="downLoadPapers">下载个性化提升手册</el-button>
             </div>
 
             <Download :visible.sync="downloadDialogVisible" :examId="examId" :subjectCode="subjectCode"
@@ -40,7 +41,7 @@
                                         :imgBase64="question.questionImg" />
                                 </template>
                                 <template v-else>
-                                    <div>暂无数据</div>
+                                    <div style="color: #999;">暂无数据</div>
                                 </template>
                             </div>
 
@@ -114,14 +115,20 @@
 
                             <div class="content" v-if="question.parseShow && !question.answerShow">
                                 <div class="flex">
-                                    <div class="flex_left" style="line-height: 28px;">【知识点】</div>
-                                    <div class="flex_right">
-                                        <template v-if="question.knowledgePoint && question.knowledgePoint.length > 0">
-                                            <template v-for="(know, index) in question.knowledgePoint">
-                                                <KnowledgePoint :text="know" />
-                                            </template>
-                                        </template>
-                                    </div>
+                                    <template v-if="question.knowledgePoint && question.knowledgePoint.length > 0">
+                                        <div class="flex_left" style="line-height: 28px;">【知识点】</div>
+                                        <div class="flex_right">
+                                            <KnowledgePoint v-for="know in question.knowledgePoint" :key="know"
+                                                :text="know" />
+                                        </div>
+                                    </template>
+
+                                    <template v-else>
+                                        <div class="flex_left">【知识点】</div>
+                                        <div class="flex_right">
+                                            <div style="color: #999;">暂无数据</div>
+                                        </div>
+                                    </template>
                                 </div>
 
                                 <div class="flex">
@@ -141,7 +148,7 @@
                                         </template>
 
                                         <template v-else>
-                                            <div>暂无数据</div>
+                                            <div style="color: #999;">暂无数据</div>
                                         </template>
                                     </div>
                                 </div>
@@ -155,22 +162,26 @@
                                                 :imgBase64="question.parseImg" />
                                         </template>
                                         <template v-else>
-                                            <div>暂无数据</div>
+                                            <div style="color: #999;">暂无数据</div>
                                         </template>
                                     </div>
                                 </div>
                             </div>
 
-                            <div class="content" style="height: 300px;"
-                                v-if="question.answerShow && !question.parseShow">
+                            <div class="content" v-if="question.answerShow && !question.parseShow">
                                 <template v-if="question.isObjective === 1">
                                     <div v-if="question.studentAnswer">{{ question.studentAnswer }}</div>
-                                    <div v-else>暂无数据</div>
+                                    <div v-else style="color: #999;">暂无数据</div>
                                 </template>
 
                                 <template v-else>
-                                    <PaperImage :imageIndex="index" :scoreFontSize="20" :rtOrWrSize="10"
-                                        :paperImgUrl="picUrl" :drawData="questionVOS" />
+                                    <template v-if="picUrl && questionVOS">
+                                        <div style="height: 300px;">
+                                            <PaperImage :imageIndex="index" :scoreFontSize="20" :rtOrWrSize="10"
+                                                :paperImgUrl="picUrl" :drawData="questionVOS" />
+                                        </div>
+                                    </template>
+                                    <div v-else style="color: #999;">暂无数据</div>
                                 </template>
                             </div>
                         </div>
@@ -292,6 +303,22 @@ export default {
         IsVariation() {
             return this.$store.state.question.isVariation;
         },
+
+        canBtnClick() {
+            const has = this.questionList.find(question => {
+                return !question.questionImg && !question.questionData?.questionStem
+            })
+
+            console.log('has', has)
+
+            if (has) {
+                this.$store.commit('question/setCanDownloanBtnClick', false)
+                return false
+            } else {
+                this.$store.commit('question/setCanDownloanBtnClick', true)
+                return true
+            }
+        }
     },
 
     watch: {
@@ -362,17 +389,22 @@ export default {
                     questionId: question.questionId,
                 }).then(res => {
                     if (res.code === 200) {
-                        // question.studentAnswer = res.data.studentAnswer;
-                        const data = res.data.pageVOS[0]
-                        this.picUrl = data.picUrl;
-                        this.questionVOS = data.questionVOS.map(item => {
-                            return {
-                                ...item,
-                                samplingPosition: '{"x":195,"y":247,"page":1}'
-                            }
-                        });
-
-                        console.log('questionVOS', this.questionVOS, this.picUrl);
+                        if (res.data && res.data.pageVOS && res.data.pageVOS.length > 0) {
+
+
+                            const data = res.data.pageVOS[0]
+                            this.picUrl = data.picUrl;
+                            this.questionVOS = data.questionVOS.map(item => {
+                                return {
+                                    ...item,
+                                    samplingPosition: '{"x":195,"y":247,"page":1}'
+                                }
+                            });
+                        } else {
+                            this.picUrl = null;
+                            this.questionVOS = [];
+                        }
+
 
                         question.answerShow = !question.answerShow;
                         question.parseShow = false