Blame view

src/views/examinationPaper/add.vue 61.2 KB
77ebf04d   梁保满   个人版
1
2
3
4
5
6
7
8
  <template>
    <div ref="content" class="content-box">
      <back-box>
        <template slot="title">
          <span>{{ "创建答题卡" }}</span>
        </template>
      </back-box>
      <div class="content">
352c53cc   梁保满   上传word回传数据
9
        <el-steps :active="step" finish-status="success" simple style="margin: 20px 0">
77ebf04d   梁保满   个人版
10
          <el-step title="基础信息" icon="el-icon-edit"></el-step>
352c53cc   梁保满   上传word回传数据
11
          <el-step v-if="!isUpload" title="题目编辑" icon="el-icon-tickets"></el-step>
77ebf04d   梁保满   个人版
12
          <el-step title="设置答案" icon="el-icon-edit-outline"></el-step>
8af7657f   梁保满   修改添加备题,组卷
13
          <el-step v-if="isUpload" title="试卷预览" icon="el-icon-edit-outline"></el-step>
77ebf04d   梁保满   个人版
14
15
        </el-steps>
        <div v-show="step == 0">
352c53cc   梁保满   上传word回传数据
16
          <el-form ref="forms" :model="form" :rules="formRules" label-width="140px">
77ebf04d   梁保满   个人版
17
            <el-form-item label="答题卡名称:" prop="title">
352c53cc   梁保满   上传word回传数据
18
19
              <el-input class="sel2" type="text" placeholder="请输入答题卡名称" v-model.trim="form.title" maxlength="30" size="45"
                show-word-limit>
77ebf04d   梁保满   个人版
20
21
22
23
24
              </el-input>
            </el-form-item>
            <el-form-item label="测验类型:">
              <el-select v-model="form.tagId" placeholder="选择测验类型">
                <el-option label="--" value=""> </el-option>
352c53cc   梁保满   上传word回传数据
25
26
                <el-option v-for="item in answerTypeList" :key="item.id" :label="item.typeName" :value="item.id">{{
                  item.typeName }}</el-option>
77ebf04d   梁保满   个人版
27
              </el-select>
352c53cc   梁保满   上传word回传数据
28
              <el-button class="ml-20" type="primary" round circle icon="el-icon-edit" @click="openTagDia"></el-button>
77ebf04d   梁保满   个人版
29
            </el-form-item>
352c53cc   梁保满   上传word回传数据
30
31
32
            <el-form-item v-if="role != 'ROLE_PERSONAL'" label="年级:" prop="gradeName">
              <el-select class="sel" v-model="form.gradeName" placeholder="" @change="changeGrade">
                <el-option v-for="item in gradeList" :key="item" :label="item" :value="item">
e371f2dc   梁保满   软件下载,学校,班级老师等报表导入...
33
34
35
                </el-option>
              </el-select>
            </el-form-item>
77ebf04d   梁保满   个人版
36
37
            <el-form-item label="科目:" prop="subjectName">
              <el-select class="sel" v-model="form.subjectName" placeholder="">
352c53cc   梁保满   上传word回传数据
38
39
                <el-option v-for="item in subjectList" :key="item.value" :label="item.label" :value="item.value">{{
                  item.label }}
77ebf04d   梁保满   个人版
40
41
42
43
                </el-option>
              </el-select>
            </el-form-item>
            <el-form-item label="考试时长:">
352c53cc   梁保满   上传word回传数据
44
45
              <el-input-number size="medium" :min="1" :max="140" :step-strictly="true" :step="1"
                v-model="form.examsDuration" label="考试时长"></el-input-number>
77ebf04d   梁保满   个人版
46
            </el-form-item>
352c53cc   梁保满   上传word回传数据
47
            <el-form-item v-if="role != 'ROLE_PERSONAL'" label="分享范围:" prop="sharingType">
e371f2dc   梁保满   软件下载,学校,班级老师等报表导入...
48
49
50
51
52
              <el-radio-group v-model="form.sharingType">
                <el-radio :label="0">任课班级分享</el-radio>
                <el-radio :label="1">全年级分享</el-radio>
              </el-radio-group>
            </el-form-item>
77ebf04d   梁保满   个人版
53
54
          </el-form>
          <div class="btn-box">
352c53cc   梁保满   上传word回传数据
55
56
            <el-button type="danger" plain round @click="linkBack">取消</el-button>
            <el-button type="primary" round @click="isUpload ? setStep2() : setStep1()">下一步</el-button>
77ebf04d   梁保满   个人版
57
          </div>
352c53cc   梁保满   上传word回传数据
58
          <el-dialog :close-on-click-modal="false" title="设置测验类型" :visible.sync="dialogVisible" width="500px">
77ebf04d   梁保满   个人版
59
60
61
            <div class="dia-content">
              <p class="add-type" v-for="item in tagList" :key="item.id">
                <el-row :gutter="10">
352c53cc   梁保满   上传word回传数据
62
63
                  <el-col :span="18"><el-input v-model="item.typeName" :maxlength="10"
                      placeholder="请输入答题卡类型名称"></el-input></el-col>
77ebf04d   梁保满   个人版
64
65
                  <el-col :span="6">
                    <el-tooltip effect="dark" content="保存" placement="top">
352c53cc   梁保满   上传word回传数据
66
67
                      <el-button class="js-set" type="primary" size="small" round circle icon="el-icon-check"
                        @click="editTypeName(item)"></el-button>
77ebf04d   梁保满   个人版
68
69
                    </el-tooltip>
                    <el-tooltip effect="dark" content="删除" placement="right">
352c53cc   梁保满   上传word回传数据
70
71
72
                      <el-popconfirm title="确定删除这道大题吗?" @confirm="removeTypeName(item)">
                        <el-button class="js-set" type="danger" size="small" round circle icon="el-icon-delete"
                          slot="reference"></el-button>
77ebf04d   梁保满   个人版
73
74
75
76
77
78
79
80
                      </el-popconfirm>
                    </el-tooltip>
                  </el-col>
                </el-row>
              </p>
              <p class="add-type">
                <el-row :gutter="10">
                  <el-col :span="18">
352c53cc   梁保满   上传word回传数据
81
                    <el-input type="text" placeholder="请输入答题卡类型名称" v-model.trim="answerTypeName" :maxlength="10">
77ebf04d   梁保满   个人版
82
83
84
85
                    </el-input>
                  </el-col>
                  <el-col :span="6">
                    <el-tooltip effect="dark" content="添加" placement="right">
352c53cc   梁保满   上传word回传数据
86
87
                      <el-button class="js-set" type="primary" size="small" round circle icon="el-icon-plus"
                        @click="addPaperType"></el-button>
77ebf04d   梁保满   个人版
88
89
90
91
92
93
94
95
96
97
                    </el-tooltip>
                  </el-col>
                </el-row>
              </p>
            </div>
            <div class="" slot="footer">
              <el-button @click="dialogVisible = false">关 闭</el-button>
            </div>
          </el-dialog>
        </div>
352c53cc   梁保满   上传word回传数据
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
        <template v-if="!isUpload">
          <div v-show="step == 1">
            <div class="question-box" v-for="(question, index) in form.questionList" :key="index">
              <p class="question-title">
                <el-tooltip effect="dark" :content="question.show ? '收起' : '展开'" placement="left">
                  <i class="el-icon-caret-right" :class="question.show ? 'active' : ''"
                    @click="question.show = !question.show"></i>
                </el-tooltip>
                <span>{{ setBigNum(index) }}、</span>
                <el-input class="ipt" v-model.trim="question.questionTitle" maxlength="30" placeholder="填写大题名称"></el-input>
                <el-popconfirm title="确定删除这道大题吗?" @confirm="form.questionList.splice(index, 1)">
                  <el-button slot="reference" class="delete" type="danger" size="mini" circle
                    icon="el-icon-delete"></el-button>
                </el-popconfirm>
                <span class="m20">共:{{ question.subQuestions?.length }}题</span>
                <span>共:{{ setScore(question) }}分</span>
              </p>
              <transition name="el-zoom-in-top">
                <ul v-show="question.show" class="questions-ul">
                  <li class="sub-questions">
                    <div class="qs-num">题号</div>
                    <div class="qs-type">题型</div>
                    <div class="qs-score">分数</div>
                    <div class="qs-partScore">漏选得分</div>
                    <div class="qs-options">选项设置</div>
                    <div class="qs-set">操作</div>
                  </li>
                  <li class="sub-questions" v-for="(subQuestions, indexs) in question.subQuestions" :key="indexs">
                    <div class="qs-num">{{ setNum(index, indexs) }}</div>
                    <div class="qs-type">
                      <el-select v-model="subQuestions.questionType" placeholder="选择题目类型"
                        @change="changeSubQuestions($event, subQuestions)">
                        <el-option label="单选题" :value="2"></el-option>
                        <el-option label="多选题" :value="3"></el-option>
                        <el-option label="判断题" :value="4"></el-option>
                        <el-option label="主观题" :value="5"></el-option>
                      </el-select>
                    </div>
                    <div class="qs-score">
                      <el-input-number class="number-ipt" size="medium" :min="1" :max="200" :precision="2" :step="1"
                        v-model="subQuestions.score" label="单题分值"></el-input-number>
                    </div>
                    <div class="qs-partScore">
                      <p v-if="subQuestions.questionType != 3">--</p>
                      <el-input-number class="number-ipt" v-else size="medium" :min="0" :precision="2"
                        :max="subQuestions.score" :step="0.5" v-model="subQuestions.partScore"
                        label="漏选得分"></el-input-number>
                    </div>
                    <div class="qs-options">
                      <p v-if="subQuestions.questionType == 5">--</p>
                      <p v-if="subQuestions.questionType == 4" class="answer-box">
                        <span class="answer-s" :class="subQuestions.correctAnswer == 1 ? 'active' : ''"
                          @click="subQuestions.correctAnswer = 1">✓</span>
                        <span class="answer-s" :class="subQuestions.correctAnswer == 2 ? 'active' : ''"
                          @click="subQuestions.correctAnswer = 2">✗</span>
                      </p>
                      <p v-if="subQuestions.questionType == 3" class="answer-box">
                        <span class="answer-s" v-for="option in subQuestions.answerOptions.split(',')" :class="subQuestions.correctAnswer?.includes(option)
                          ? 'active'
                          : ''
                          " :key="option" @click="changAnswer(subQuestions, option)">{{ option }}</span>
                      </p>
                      <p v-if="subQuestions.questionType == 2" class="answer-box">
                        <span class="answer-s" v-for="option in subQuestions.answerOptions.split(',')" :class="subQuestions.correctAnswer == option ? 'active' : ''
                          " :key="option" @click="subQuestions.correctAnswer = option">{{ option }}</span>
                      </p>
                      <p v-if="subQuestions.questionType == 3 ||
77ebf04d   梁保满   个人版
165
                        subQuestions.questionType == 2
352c53cc   梁保满   上传word回传数据
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
                        " class="answer-box answer-box2">
                        <el-button size="mini" type="primary" icon="el-icon-plus" circle
                          @click="addOptions(subQuestions)"></el-button>
                        <el-button size="mini" type="primary" icon="el-icon-minus" round circle
                          @click="removeOptions(subQuestions)"></el-button>
                      </p>
                    </div>
                    <div class="qs-set">
                      <el-popconfirm title="确定删除这道题吗?" @confirm="delTabData(indexs, index)">
                        <el-button slot="reference" class="delete" type="danger" size="mini" circle
                          icon="el-icon-delete"></el-button>
                      </el-popconfirm>
                    </div>
                  </li>
                  <li class="sub-questions">
                    <div class="qs-num">添加</div>
                    <div class="qs-type">
                      <el-select v-model="addSubQuestionsType" placeholder="选择题目类型"
                        @change="changeAddSubQuestions($event, question)">
                        <el-option label="单选题" :value="2"></el-option>
                        <el-option label="多选题" :value="3"></el-option>
                        <el-option label="判断题" :value="4"></el-option>
                        <el-option label="主观题" :value="5"></el-option>
                      </el-select>
                    </div>
                    <div class="qs-score"></div>
                    <div class="qs-partScore"></div>
                    <div class="qs-options"></div>
                    <div class="qs-set"></div>
                  </li>
                </ul>
              </transition>
            </div>
            <div class="add-box">
              <p class="add-question" @click="openQuestion">
                <el-button size="mini" type="primary" icon="el-icon-plus" circle></el-button>
                <span class="s1">添加大题</span>
              </p>
            </div>
            <div class="btn-box">
              <el-button type="danger" plain round @click="linkBack">取消</el-button>
              <el-button round @click="step = 0">上一步</el-button>
              <el-button :type="form.questionList.length == 0 ? 'info' : 'primary'" round @click="setStep2">下一步</el-button>
            </div>
            <el-dialog :close-on-click-modal="false" title="添加大题" :visible.sync="addQuestionVisible" width="600px">
              <div class="dia-content">
                <el-form ref="form" :model="questionForm" :rules="questionFormRules" label-width="100px">
                  <el-form-item label="标题:">
                    <el-col :span="20">
                      <el-input v-model.trim="questionForm.questionTitle" maxlength="30" placeholder="输入大题名称"></el-input>
                    </el-col>
                  </el-form-item>
                  <el-form-item label="选择题型:">
                    <el-select v-model="questionForm.questionType" placeholder="" @change="setQuestionForm">
                      <el-option v-for="item in questionOptions" :key="item.value" :label="item.label" :value="item.value">
                      </el-option>
                      <el-option label="混合题" :value="6"> </el-option>
77ebf04d   梁保满   个人版
223
                    </el-select>
352c53cc   梁保满   上传word回传数据
224
225
226
227
228
229
                  </el-form-item>
                  <el-form-item label="题数:">
                    <el-input-number v-model="questionForm.number" @change="changeQesNum" :min="1" :max="100"
                      :step-strictly="true" :step="1" label="label"></el-input-number>
                  </el-form-item>
                  <el-form-item label="选项个数:" v-show="questionForm.questionType != 4 &&
77ebf04d   梁保满   个人版
230
                    questionForm.questionType != 5
352c53cc   梁保满   上传word回传数据
231
232
233
234
235
236
237
238
239
240
241
242
243
                    ">
                    <el-input-number v-model="questionForm.selectNum" :min="3" :max="10" :step-strictly="true" :step="1"
                      label="label"></el-input-number>
                  </el-form-item>
                  <el-form-item label="单题分数:">
                    <el-input-number v-model="questionForm.score" :min="1" :max="200" :precision="2" :step="1"
                      label="label"></el-input-number>
                  </el-form-item>
                  <el-form-item label="漏选得分:" v-if="questionForm.questionType == 3">
                    <el-input-number v-model="questionForm.partScore" :min="0" :max="questionForm.score" :precision="2"
                      :step="0.5" label="label"></el-input-number>
                  </el-form-item>
                  <el-form-item label="设置答案:" v-show="questionForm.questionType != 5 &&
3617eaad   梁保满   长水账号设置
244
                    questionForm.questionType != 6
352c53cc   梁保满   上传word回传数据
245
246
247
248
                    ">
                    <div class="qs-options">
                      <p class="ipt">
                        <el-input v-if="questionForm.questionType == 2 ||
77ebf04d   梁保满   个人版
249
250
                          questionForm.questionType == 3 ||
                          questionForm.questionType == 6
352c53cc   梁保满   上传word回传数据
251
252
253
254
255
256
257
258
259
260
261
                          " ref="formAnsIpt2" v-model="questionForm.answerList" @keydown.native="
      keydownAnswer($event, questionForm.questionType, 1)
      " @input="
      setAllAnswer($event, questionForm.questionType, 1)
      "></el-input>
                        <el-input v-if="questionForm.questionType == 4" v-model="questionForm.answerList"
                          readonly=""></el-input>
                      </p>
                      <p class="answer-box">
                        <template v-if="questionForm.questionType == 4">
                          <span class="answer-s active" @click="
77ebf04d   梁保满   个人版
262
263
264
                            questionForm.answerList.length < questionForm.number
                              ? (questionForm.answerList += '✓')
                              : ''
352c53cc   梁保满   上传word回传数据
265
266
                            ">✓</span>
                          <span class="answer-s active" @click="
77ebf04d   梁保满   个人版
267
268
269
                            questionForm.answerList.length < questionForm.number
                              ? (questionForm.answerList += '✗')
                              : ''
352c53cc   梁保满   上传word回传数据
270
271
272
273
274
275
276
277
                            ">✗</span>
                        </template>
                        <template v-if="questionForm.questionType == 3">
                          <template v-for="(option, opIdx) in rightOptions">
                            <span v-if="opIdx < questionForm.selectNum" class="answer-s active" :key="option"
                              @click="setMultiple(questionForm, option, 1)">{{ option }}</span>
                          </template>
                          <span class="answer-s active" @click="setMultiple(questionForm, ',', 1)">,</span>
77ebf04d   梁保满   个人版
278
                        </template>
352c53cc   梁保满   上传word回传数据
279
                        <template v-if="questionForm.questionType == 2 ||
77ebf04d   梁保满   个人版
280
                          questionForm.questionType == 6
352c53cc   梁保满   上传word回传数据
281
282
283
                          ">
                          <template v-for="(option, opIdx) in rightOptions">
                            <span v-if="opIdx < questionForm.selectNum" class="answer-s active" :key="option" @click="
77ebf04d   梁保满   个人版
284
285
286
                              questionForm.answerList.length < questionForm.number
                                ? (questionForm.answerList += option)
                                : ''
352c53cc   梁保满   上传word回传数据
287
288
                              ">{{ option }}</span>
                          </template>
77ebf04d   梁保满   个人版
289
                        </template>
352c53cc   梁保满   上传word回传数据
290
                        <span class="answer-s delButton" @click="
77ebf04d   梁保满   个人版
291
292
293
294
                          questionForm.answerList = questionForm.answerList.slice(
                            0,
                            -1
                          )
352c53cc   梁保满   上传word回传数据
295
296
297
298
299
300
301
302
303
304
305
306
307
308
                          ">x</span>
                        <span class="answer-s ac" @click="questionForm.answerList = ''">ac</span>
                      </p>
                    </div>
                  </el-form-item>
                </el-form>
              </div>
              <div class="dialog-footer" slot="footer">
                <el-button type="primary" @click="addQuestion">确 定</el-button>
                <el-button @click="addQuestionVisible = false">取 消</el-button>
              </div>
            </el-dialog>
          </div>
        </template>
77ebf04d   梁保满   个人版
309
310
311
312
313
        <div v-show="step == 2">
          <div class="answer-title">
            <p class="name">{{ form.title }}</p>
            <p class="totals">卷面总分:{{ allScore }}分</p>
          </div>
352c53cc   梁保满   上传word回传数据
314
          <div class="question-box" v-for="(question, index) in form.questionList" :key="index">
77ebf04d   梁保满   个人版
315
316
317
318
319
320
321
322
323
324
325
326
327
            <p class="question-title">
              <span>{{ setBigNum(index) }}、</span>
              <span class="title-txt">{{ question.questionTitle }}</span>
              <span class="m20">共:{{ setNums(question.subQuestions) }}题</span>
              <span>共:{{ setScore(question) }} 分</span>
            </p>
            <ul class="questions-ul">
              <li class="sub-questions">
                <div class="qs-num">题号</div>
                <div class="qs-type">题型</div>
                <div class="qs-score">分数</div>
                <div class="qs-partScore">漏选得分</div>
                <div class="qs-options qs-options2">选项设置</div>
8af7657f   梁保满   修改添加备题,组卷
328
329
                <div class="qs-upload" v-if="isUpload">提干</div>
                <div class="qs-set">操作</div>
77ebf04d   梁保满   个人版
330
              </li>
352c53cc   梁保满   上传word回传数据
331
332
333
334
335
336
              <li v-for="(subQuestions, indexs) in question.subQuestions" :key="indexs">
                <p class="set-ans-btn" v-if="subQuestions.qusType &&
                  subQuestions.subNum &&
                  subQuestions.subNum > 4
                  ">
                  <el-button type="primary" @click="setFormAns(indexs, index)">批量设置答案</el-button>
77ebf04d   梁保满   个人版
337
338
339
340
341
342
                </p>
                <div v-else class="sub-questions">
                  <div class="qs-num">
                    {{ setNum(index, indexs, subQuestions) }}
                  </div>
                  <div class="qs-type">
8af7657f   梁保满   修改添加备题,组卷
343
344
345
346
347
348
349
350
351
352
353
354
                    <template v-if="isUpload">
                      <el-select v-model="subQuestions.questionType" placeholder="选择题目类型"
                        @change="changeSubQuestions($event, subQuestions)">
                        <el-option label="单选题" :value="2"></el-option>
                        <el-option label="多选题" :value="3"></el-option>
                        <el-option label="判断题" :value="4"></el-option>
                        <el-option label="主观题" :value="5"></el-option>
                      </el-select>
                    </template>
                    <template v-else>
                      {{ setSubPro(subQuestions.questionType) }}
                    </template>
77ebf04d   梁保满   个人版
355
356
                  </div>
                  <div class="qs-score">
352c53cc   梁保满   上传word回传数据
357
358
                    <el-input-number class="number-ipt" size="medium" :min="1" :max="200" :precision="2"
                      v-model="subQuestions.score" label="单题分值"></el-input-number>
77ebf04d   梁保满   个人版
359
360
361
                  </div>
                  <div class="qs-partScore">
                    <p v-if="subQuestions.questionType != 3">--</p>
352c53cc   梁保满   上传word回传数据
362
363
                    <el-input-number class="number-ipt" v-else size="medium" :min="0" :precision="2"
                      :max="subQuestions.score" :step="0.5" v-model="subQuestions.partScore" label="漏选得分"></el-input-number>
77ebf04d   梁保满   个人版
364
365
366
367
                  </div>
                  <div class="qs-options qs-options2">
                    <p v-if="subQuestions.questionType == 5">--</p>
                    <p v-if="subQuestions.questionType == 4" class="answer-box">
352c53cc   梁保满   上传word回传数据
368
369
370
371
                      <span class="answer-s" :class="subQuestions.correctAnswer == 1 ? 'active' : ''"
                        @click="subQuestions.correctAnswer = 1">✓</span>
                      <span class="answer-s" :class="subQuestions.correctAnswer == 2 ? 'active' : ''"
                        @click="subQuestions.correctAnswer = 2">✗</span>
77ebf04d   梁保满   个人版
372
373
                    </p>
                    <p v-if="subQuestions.questionType == 3" class="answer-box">
352c53cc   梁保满   上传word回传数据
374
375
376
377
                      <span class="answer-s" v-for="option in subQuestions.answerOptions.split(',')" :class="subQuestions.correctAnswer?.includes(option)
                        ? 'active'
                        : ''
                        " :key="option" @click="changAnswer(subQuestions, option)">{{ option }}</span>
77ebf04d   梁保满   个人版
378
379
                    </p>
                    <p v-if="subQuestions.questionType == 2" class="answer-box">
352c53cc   梁保满   上传word回传数据
380
381
                      <span class="answer-s" v-for="option in subQuestions.answerOptions.split(',')" :class="subQuestions.correctAnswer == option ? 'active' : ''
                        " :key="option" @click="subQuestions.correctAnswer = option">{{ option }}</span>
77ebf04d   梁保满   个人版
382
383
                    </p>
                  </div>
8af7657f   梁保满   修改添加备题,组卷
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
                  <div class="qs-upload" v-if="isUpload">
                    <el-popover placement="right" width="400" trigger="click">
                      <div class="screenshot-box">
                        <iframe class="screenshot"
                          v-if="subQuestions.screenshot && subQuestions.screenshot.includes('html')"
                          :src="subQuestions.screenshot"></iframe>
                        <img class="screenshot screenshot-img"
                          v-if="subQuestions.screenshot && !subQuestions.screenshot.includes('html')"
                          :src="subQuestions.screenshot" alt="">
                        <p style="textAlign:center"><el-button type="primary" round size="mini" icon="el-icon-upload"
                            @click="openStem(subQuestions, index, indexs)">重新选择图片</el-button></p>
                      </div>
                      <el-button slot="reference" class="icon-tickets" type="primary" circle size="mini"
                        icon="el-icon-tickets"></el-button>
                    </el-popover>
                  </div>
                  <div class="qs-set">
  
                    <el-popconfirm title="确定删除这道题吗?" @confirm="delTabData(indexs, index)">
                      <el-button slot="reference" class="delete" type="danger" size="mini" circle
                        icon="el-icon-delete"></el-button>
                    </el-popconfirm>
                  </div>
77ebf04d   梁保满   个人版
407
408
409
410
                </div>
              </li>
            </ul>
          </div>
352c53cc   梁保满   上传word回传数据
411
412
          <el-dialog :close-on-click-modal="false" title="批量设置答案" :visible.sync="diaSetAns" width="400"
            :modal-append-to-body="false">
77ebf04d   梁保满   个人版
413
414
415
416
417
418
            <div class="qs-options">
              <p class="dia-tips">
                请点击选项按钮设置答案,多选题题目之间用“,”隔开,若添加5道题:“AC,AD,BD,AC,CD”
              </p>
              <p>{{ setSubPro(formAns.qusType) }}:</p>
              <p class="ipt">
352c53cc   梁保满   上传word回传数据
419
                <el-input v-if="formAns.qusType == 2 || formAns.qusType == 3" ref="formAnsIpt" v-model="formAns.answerList"
77ebf04d   梁保满   个人版
420
                  @keydown.native="keydownAnswer($event, formAns.qusType)"
352c53cc   梁保满   上传word回传数据
421
422
                  @input="setAllAnswer($event, formAns.qusType)"></el-input>
                <el-input v-if="formAns.qusType == 4" v-model="formAns.answerList" readonly=""></el-input>
77ebf04d   梁保满   个人版
423
424
425
              </p>
              <p class="answer-box">
                <template v-if="formAns.qusType == 4">
352c53cc   梁保满   上传word回传数据
426
427
428
429
430
431
432
433
434
435
                  <span class="answer-s active" @click="
                    formAns.answerList.length < formAns.subNum
                      ? (formAns.answerList += '✓')
                      : ''
                    ">✓</span>
                  <span class="answer-s active" @click="
                    formAns.answerList.length < formAns.subNum
                      ? (formAns.answerList += '✗')
                      : ''
                    ">✗</span>
77ebf04d   梁保满   个人版
436
437
                </template>
                <template v-if="formAns.qusType == 3">
352c53cc   梁保满   上传word回传数据
438
439
440
                  <span class="answer-s active" v-for="option in formAns.answerOptions.split(',')" :key="option"
                    @click="setMultiple(formAns, option, 2)">{{ option }}</span>
                  <span class="answer-s active" @click="setMultiple(formAns, ',', 2)">,</span>
77ebf04d   梁保满   个人版
441
442
                </template>
                <template v-if="formAns.qusType == 2">
352c53cc   梁保满   上传word回传数据
443
444
445
446
447
                  <span class="answer-s active" v-for="option in formAns.answerOptions.split(',')" :key="option" @click="
                    formAns.answerList.length < formAns.subNum
                      ? (formAns.answerList += option)
                      : ''
                    ">{{ option }}</span>
77ebf04d   梁保满   个人版
448
                </template>
352c53cc   梁保满   上传word回传数据
449
450
                <span class="answer-s delButton" @click="formAns.answerList = formAns.answerList.slice(0, -1)">x</span>
                <span class="answer-s ac" @click="formAns.answerList = ''">ac</span>
77ebf04d   梁保满   个人版
451
452
453
454
455
456
457
458
              </p>
            </div>
            <div class="dialog-footer" slot="footer">
              <el-button @click="saveFormAns">确 定</el-button>
              <el-button @click="diaSetAns = false">取 消</el-button>
            </div>
          </el-dialog>
          <div class="btn-box">
352c53cc   梁保满   上传word回传数据
459
            <el-button type="danger" plain round @click="linkBack">取消</el-button>
8af7657f   梁保满   修改添加备题,组卷
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
            <template v-if="!isUpload">
              <el-button round @click="toStep(1)">上一步</el-button>
              <el-button type="primary" round @click="save">保存</el-button>
            </template>
            <template v-else>
              <el-button round @click="step = 0">上一步</el-button>
              <el-button type="primary" round @click="toStep(3)">下一步</el-button>
            </template>
          </div>
        </div>
        <div v-show="step == 3">
          <div class="answer-title">
            <p class="name">{{ form.title }}</p>
          </div>
          <div class="question-box">
            <template v-for="(question, index) in form.questionList">
              <div class="screenshot-box" v-for="(subQuestions, indexs) in question.subQuestions"
                :key="index + '-' + indexs">
                <iframe class="screenshot" v-if="subQuestions.screenshot && subQuestions.screenshot.includes('html')"
                  :src="subQuestions.screenshot"></iframe>
                <img class="screenshot screenshot-img"
                  v-if="subQuestions.screenshot && !subQuestions.screenshot.includes('html')" :src="subQuestions.screenshot"
                  alt="">
              </div>
            </template>
          </div>
          <div class="btn-box">
            <el-button type="danger" plain round @click="linkBack">取消</el-button>
            <el-button round @click="toStep(2)">上一步</el-button>
77ebf04d   梁保满   个人版
489
490
491
            <el-button type="primary" round @click="save">保存</el-button>
          </div>
        </div>
352c53cc   梁保满   上传word回传数据
492
493
        <el-dialog :close-on-click-modal="false" title="上传题干" :visible.sync="dialogStem" v-if="dialogStem" width="500">
          <div class="upload-box">
8af7657f   梁保满   修改添加备题,组卷
494
            <img v-if="stem.screenshot && !stem.screenshot.includes('html')" :src="stem.screenshot" class="stem-pic" />
352c53cc   梁保满   上传word回传数据
495
496
497
            <el-upload class="upload-demo" action="http://121.40.127.171/file/uploadImg" :limit="1" :on-success="upSuccess"
              :on-error="upError" accept="image/*">
              <el-button size="small" type="primary">{{
8af7657f   梁保满   修改添加备题,组卷
498
                stem.screenshot && !stem.screenshot.includes('html') ? "重新上传" : "选择照片"
352c53cc   梁保满   上传word回传数据
499
500
501
502
              }}</el-button>
            </el-upload>
          </div>
          <div slot="footer">
8af7657f   梁保满   修改添加备题,组卷
503
            <el-button @click="dialogStem = false">确定</el-button>
352c53cc   梁保满   上传word回传数据
504
505
          </div>
        </el-dialog>
77ebf04d   梁保满   个人版
506
507
508
509
510
      </div>
    </div>
  </template>
  
  <script>
8af7657f   梁保满   修改添加备题,组卷
511
  import { deepClone, checkAnswer, cNum } from "utils";
77ebf04d   梁保满   个人版
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
  const questionForm = {
    questionTitle: "",
    questionType: 2,
    number: 10,
    selectNum: 4,
    score: 1,
    partScore: 0,
    answerList: "",
  };
  const subQuesOptions = {
    questionType: 2,
    score: 1,
    partScore: 0,
    selectNum: 4,
    answerOptions: "A,B,C,D",
    correctAnswer: "",
  };
  export default {
    computed: {
      allScore: function () {
        let score = 0;
        this.form.questionList.map((item) => {
352c53cc   梁保满   上传word回传数据
534
          score += item.subQuestions?.reduce((a, b) => {
77ebf04d   梁保满   个人版
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
            return a + Number(b.score ? b.score : 0);
          }, 0);
        }, 0);
        return Number(score).toFixed(2);
      },
    },
    watch: {
      step: function () {
        this.$nextTick(function () {
          this.$refs.content.scrollTop = 0;
        });
      },
    },
    data() {
      return {
e371f2dc   梁保满   软件下载,学校,班级老师等报表导入...
550
551
        role: "",
        step: 0, //步骤
77ebf04d   梁保满   个人版
552
553
554
555
556
557
558
559
560
561
562
        gradeList: [], //年级
        subjectList: [], //科目
        answerTypeList: [], //测验类型
        answerTypeName: "", //测验类型名称
        form: {
          //答题卡详情
          title: "",
          tagId: "",
          subjectName: "",
          examsDuration: 90,
          questionList: [],
e371f2dc   梁保满   软件下载,学校,班级老师等报表导入...
563
564
          gradeName: "",
          sharingType: 0,
77ebf04d   梁保满   个人版
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
        },
        formRules: {
          //答题卡验证
          title: [
            { required: true, message: "请输入答题卡名称", trigger: "blur" },
            {
              min: 1,
              max: 30,
              message: "长度在 1 到 30 个字符",
              trigger: "blur",
            },
          ],
          subjectName: [
            { required: true, message: "请选择科目", trigger: "blur" },
          ],
          examsDuration: [
            { required: true, message: "请设置考试时长", trigger: "blur" },
          ],
        },
        tagList: [],
e371f2dc   梁保满   软件下载,学校,班级老师等报表导入...
585
        diaSetAns: false, //答案开关
77ebf04d   梁保满   个人版
586
587
588
589
590
591
592
593
594
        formAns: {
          listIndex: 0, //大题位置
          endIndex: 0, //相同题目最后一位题目的questionIndex
          index: 0, //相同题目最后一位题目的位置
          qusType: "", //题目类型
          subNum: 0, //数量
          answerOptions: [], //答案选项
          answerList: "", //答案列表-字符串
        },
e371f2dc   梁保满   软件下载,学校,班级老师等报表导入...
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
        type: 1, //1-创建,2-复制答题卡
        dialogVisible: false, //测验类型设置弹窗
        addQuestionVisible: false, //添加大题弹窗
        questionForm: { ...questionForm },
        questionFormRules: {
          questionTitle: [
            { required: true, message: "请输入大题名称", trigger: "blur" },
            {
              min: 1,
              max: 30,
              message: "长度在 1 到 30 个字符",
              trigger: "blur",
            },
          ],
        },
        questionOptions: [
          { label: "单选题", value: 2 },
          { label: "多选题", value: 3 },
          { label: "判断题", value: 4 },
          { label: "主观题", value: 5 },
        ],
ec6394d1   梁保满   v1.3.1。细节调整
616
        rightOptions: ["A", "B", "C", "D", "E", "F", "G", "H", "I", "J"],
e371f2dc   梁保满   软件下载,学校,班级老师等报表导入...
617
        addSubQuestionsType: "",
352c53cc   梁保满   上传word回传数据
618
619
620
621
622
623
624
625
626
  
        //v1.5
        isUpload: false,
        dialogStem: false, //截图开关
        stem: {
          index: 0, //大题位置
          indexs: 0, //小题位置
          screenshot: "", //题干图片地址
        },
77ebf04d   梁保满   个人版
627
628
629
630
      };
    },
    async created() {
      this.type = this.$route.query.type ? this.$route.query.type : 1;
e371f2dc   梁保满   软件下载,学校,班级老师等报表导入...
631
632
633
634
635
636
637
638
639
      this.role =
        this.$store.getters.info.showRole ||
        this.$store.getters.info.permissions[0].role;
      if (this.role != "ROLE_PERSONAL") {
        this.formRules.gradeName = [
          { required: true, message: "请选择年级", trigger: "blur" },
        ];
        await this._GradeList();
      }
352c53cc   梁保满   上传word回传数据
640
641
642
643
644
      this.isUpload = this.$route.query.isUpload || false
      if (this.isUpload) {
        let params = this.$route.query.params && JSON.parse(this.$route.query.params) || null
        this.form.title = params?.name
        this.form.id = params?.id
8af7657f   梁保满   修改添加备题,组卷
645
646
        this.form.examsDuration = params?.examsDuration || 90
        this.form.sharingType = params?.sharingType || 0
352c53cc   梁保满   上传word回传数据
647
648
        this.formatData(params)
      }
77ebf04d   梁保满   个人版
649
650
651
652
653
654
655
      await this._QuerySubjectList(this.gradeList[0]);
      await this._TypeList();
      if (this.type == 2) {
        this._QueryDetail();
      }
    },
    methods: {
352c53cc   梁保满   上传word回传数据
656
657
658
659
660
      // v1.5
      //上传截图
      openStem(obj, index, indexs) {
        this.stem.index = index;
        this.stem.indexs = indexs;
8af7657f   梁保满   修改添加备题,组卷
661
        this.stem.screenshot = obj.screenshot || "";
352c53cc   梁保满   上传word回传数据
662
663
664
665
666
667
        this.dialogStem = true;
      },
      //图片上传成功
      upSuccess(res, file) {
        if (res && res.status == 0) {
          this.stem.screenshot = res.data.url;
8af7657f   梁保满   修改添加备题,组卷
668
          this.form.questionList[this.stem.index].subQuestions[this.stem.indexs].screenshot = this.stem.screenshot;
352c53cc   梁保满   上传word回传数据
669
670
671
672
673
674
675
676
677
678
679
          this.$message.success("上传成功");
        } else {
          this.$message.error(res.info);
        }
      },
  
      upError(res) {
        this.$message.error("上传失败");
      },
      //end
  
8af7657f   梁保满   修改添加备题,组卷
680
      //取消创建
77ebf04d   梁保满   个人版
681
682
683
      linkBack() {
        this.$confirm(
          (this.type == 2 ? "修改复制的" : "组建的") +
352c53cc   梁保满   上传word回传数据
684
          "答题卡未保存,确认退出吗?",
77ebf04d   梁保满   个人版
685
686
687
688
689
690
691
692
693
694
695
696
          "提示",
          {
            confirmButtonText: "取消",
            cancelButtonText: "确定",
            confirmButtonClass: "el-button--danger1",
            cancelButtonClass: "el-button--primary",
            showClose: false,
            roundButton: true,
            center: true,
            type: "warning",
          }
        )
352c53cc   梁保满   上传word回传数据
697
          .then(() => { })
77ebf04d   梁保满   个人版
698
699
700
701
702
703
          .catch(() => {
            this.$router.push({
              path: "/examinationPaper",
            });
          });
      },
8af7657f   梁保满   修改添加备题,组卷
704
      //转换题型显示方式
77ebf04d   梁保满   个人版
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
      setSubPro(type) {
        let tit;
        switch (type) {
          case 2:
            tit = "单选题";
            break;
          case 3:
            tit = "多选题";
            break;
          case 4:
            tit = "判断题";
            break;
          case 5:
            tit = "主观题";
            break;
        }
        return tit;
      },
8af7657f   梁保满   修改添加备题,组卷
723
      //计算题号
77ebf04d   梁保满   个人版
724
      setNum(index, indexs, sub) {
8af7657f   梁保满   修改添加备题,组卷
725
726
        let lengths = 0;//所在大题之前的所有小题数量
        let subIndex = 0;//所在大题的位置
77ebf04d   梁保满   个人版
727
728
729
730
731
732
        for (let i = 0; i < index; i++) {
          let subArr = this.form.questionList[i].subQuestions.filter((item) => {
            return !!item.questionType;
          });
          lengths += subArr.length;
        }
77ebf04d   梁保满   个人版
733
734
735
736
737
738
739
        for (let i = 0; i < indexs; i++) {
          if (!!this.form.questionList[index].subQuestions[i].questionType) {
            subIndex += 1;
          }
        }
        return lengths + subIndex + 1;
      },
8af7657f   梁保满   修改添加备题,组卷
740
      //统计小题数量
77ebf04d   梁保满   个人版
741
742
      setNums(ques) {
        let lengths = 0;
352c53cc   梁保满   上传word回传数据
743
        let subArr = ques?.filter((item) => {
77ebf04d   梁保满   个人版
744
          return !!item.questionType;
352c53cc   梁保满   上传word回传数据
745
        }) || [];
77ebf04d   梁保满   个人版
746
747
748
        lengths = subArr.length;
        return lengths;
      },
8af7657f   梁保满   修改添加备题,组卷
749
      //转换中文大题题号
77ebf04d   梁保满   个人版
750
751
      setBigNum(num) {
        let txt = "";
8af7657f   梁保满   修改添加备题,组卷
752
        let bigNum = [...cNum]
77ebf04d   梁保满   个人版
753
754
755
756
        txt = bigNum[num];
  
        return txt;
      },
b31444fa   梁保满   复制归档答题卡后续流程
757
      //切换题型清空答案
77ebf04d   梁保满   个人版
758
      setQuestionForm(val) {
77ebf04d   梁保满   个人版
759
760
        this.questionForm.answerList = "";
      },
b31444fa   梁保满   复制归档答题卡后续流程
761
      //减少题数设置答案
77ebf04d   梁保满   个人版
762
      changeQesNum(val) {
77ebf04d   梁保满   个人版
763
764
765
766
767
768
769
770
771
        if (
          this.questionForm.questionType == 2 ||
          this.questionForm.questionType == 4
        ) {
          this.questionForm.answerList = this.questionForm.answerList.substring(
            0,
            val
          );
        } else {
77ebf04d   梁保满   个人版
772
773
774
775
776
777
          this.questionForm.answerList = this.questionForm.answerList
            .split(",")
            .splice(0, val)
            .join(",");
        }
      },
b31444fa   梁保满   复制归档答题卡后续流程
778
      //初始化要修改的答案
77ebf04d   梁保满   个人版
779
      setFormAns(indexs, index) {
77ebf04d   梁保满   个人版
780
781
        this.formAns = { ...this.form.questionList[index].subQuestions[indexs] };
        this.formAns.listIndex = index;
77ebf04d   梁保满   个人版
782
        let answerList = "";
8af7657f   梁保满   修改添加备题,组卷
783
        let startIndex = indexs - this.formAns.subNum; //批量设置大难开始位置
77ebf04d   梁保满   个人版
784
        this.form.questionList[index].subQuestions.map((item, subIdx) => {
8af7657f   梁保满   修改添加备题,组卷
785
          if (subIdx >= startIndex && subIdx < indexs) {
77ebf04d   梁保满   个人版
786
            answerList += this.setAnswer(item.questionType, item.correctAnswer);
8af7657f   梁保满   修改添加备题,组卷
787
788
789
  
            if (item.qusType == 3) {
              answerList = answerList.slice(0, -1);
77ebf04d   梁保满   个人版
790
791
792
            }
          }
        });
8af7657f   梁保满   修改添加备题,组卷
793
        this.formAns.answerList = answerList;
77ebf04d   梁保满   个人版
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
  
        this.diaSetAns = true;
      },
      insertTxtAndSetcursor(element, answerList, str) {
        let startPos = element.selectionStart; // 获取光标开始的位置
        if (startPos === undefined) {
          // 如果没有光标位置 不操作
          return answerList;
        } else {
          return {
            text:
              answerList.substring(0, startPos) +
              str +
              answerList.substring(startPos), // 将文本插入
            startPos: startPos + str.length,
          };
        }
      },
b31444fa   梁保满   复制归档答题卡后续流程
812
      //多选答案设置
77ebf04d   梁保满   个人版
813
      setMultiple(obj, answer, type) {
77ebf04d   梁保满   个人版
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
        let elements =
          type == 1
            ? this.$refs["formAnsIpt2"].$el.children[0]
            : this.$refs["formAnsIpt"].$el.children[0];
        let resault = this.insertTxtAndSetcursor(
          elements,
          obj.answerList || "",
          answer
        );
        obj.answerList = resault.text;
        let str = obj.answerList;
        let str2;
        if (!!obj.answerOptions) {
          str2 = checkAnswer(
            str,
            3,
            obj.answerOptions.split(",").length,
            obj.subNum
          );
        } else {
          str2 = checkAnswer(str, 3, obj.selectNum, obj.number);
        }
        obj.answerList = str2;
        elements.focus();
        elements.selectionStart = resault.startPos;
      },
b31444fa   梁保满   复制归档答题卡后续流程
840
      //批量修改答案
77ebf04d   梁保满   个人版
841
      saveFormAns() {
77ebf04d   梁保满   个人版
842
843
844
845
846
847
        let EndIndex;
        let subNum = this.formAns.subNum - 1;
        this.form.questionList[this.formAns.listIndex].subQuestions.some(
          (item, index) => {
            if (this.formAns.endIndex == item.questionIndex) {
              EndIndex = index;
77ebf04d   梁保满   个人版
848
            }
8af7657f   梁保满   修改添加备题,组卷
849
            return this.formAns.endIndex == item.questionIndex
77ebf04d   梁保满   个人版
850
851
          }
        );
8af7657f   梁保满   修改添加备题,组卷
852
          console.log(EndIndex)
77ebf04d   梁保满   个人版
853
854
855
856
857
858
859
860
861
862
863
        for (let i = 0; i <= subNum; i++) {
          let correctAnswer = "";
          if (this.formAns.qusType == 2) {
            correctAnswer = this.formAns.answerList[subNum - i] || "";
          } else if (this.formAns.qusType == 3) {
            correctAnswer = this.formAns.answerList.split(",")[subNum - i] || "";
          } else if (this.formAns.qusType == 4) {
            correctAnswer =
              this.formAns.answerList[subNum - i] == "✓"
                ? 1
                : this.formAns.answerList[subNum - i] == "✗"
352c53cc   梁保满   上传word回传数据
864
865
                  ? 2
                  : "";
77ebf04d   梁保满   个人版
866
867
868
869
870
871
872
873
          }
          this.form.questionList[this.formAns.listIndex].subQuestions[
            EndIndex - i
          ].correctAnswer = correctAnswer;
        }
        this.diaSetAns = false;
      },
      keydownAnswer(event, type, isAddBig) {
ec6394d1   梁保满   v1.3.1。细节调整
874
875
        let answerA = "ABCDEFGHIJ";
        let answer_a = "abcdefghij";
77ebf04d   梁保满   个人版
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
        if (isAddBig) {
          answerA = answerA.substring(0, this.questionForm.selectNum);
          answer_a = answer_a.substring(0, this.questionForm.selectNum);
        } else {
          answerA = answerA.substring(0, this.formAns.subNum);
          answer_a = answer_a.substring(0, this.formAns.subNum);
        }
        answerA += answer_a;
        answerA = type == 2 ? answerA : answerA + ",";
        if (
          event.key == "Meta" ||
          event.key == "CapsLock" ||
          event.key == "Shift" ||
          event.key == "Enter" ||
          event.key == "Alt" ||
          event.key == "Backspace" ||
          event.key == "Delete" ||
          event.key == "ArrowUp" ||
          event.key == "ArrowDown" ||
          event.key == "ArrowLeft" ||
          event.key == "v" ||
          event.key == "V" ||
          event.key == "ArrowRight"
        )
          return;
        if (!answerA.includes(event.key)) {
          event.returnValue = "";
        }
      },
      setAllAnswer(event, type, isAddBig) {
        if (isAddBig) {
          let str = this.questionForm.answerList;
          let str2 = checkAnswer(
            str,
            type,
            this.questionForm.selectNum,
            this.questionForm.number
          );
          this.questionForm.answerList = str2;
        } else {
          let str = this.formAns.answerList;
          let str2 = checkAnswer(
            str,
            type,
            this.formAns.answerOptions.split(",").length,
            this.formAns.subNum
          );
          this.formAns.answerList = str2;
        }
      },
      setAnswer(type, ans) {
        let txt = "";
        if (type == 2) {
          txt = ans;
        } else if (type == 3) {
          txt = ans + ",";
        } else if (type == 4) {
          txt = ans == 1 ? "✓" : ans == 2 ? "✗" : "";
        }
        return txt;
      },
8af7657f   梁保满   修改添加备题,组卷
937
938
939
940
941
942
943
      toStep(step) {
        if (step == 2) {
          this.setStep2()
        } else {
          this.formatQuestionList();
          this.step = step;
        }
77ebf04d   梁保满   个人版
944
945
      },
      setStep1() {
b31444fa   梁保满   复制归档答题卡后续流程
946
947
948
949
        if (this.subjectList.length == 0) {
          this.$message.warning("暂无绑定年级信息,请先联系管理员设置。");
          return;
        }
77ebf04d   梁保满   个人版
950
951
952
953
954
955
956
957
958
959
960
961
962
963
        this.$refs["forms"].validate((valid) => {
          // 验证通过:保存
          if (valid) {
            this.step = 1;
          } else {
            this.$message.error("数据有误,请检查!");
            return false;
          }
        });
      },
      setStep2() {
        if (!this.form.questionList.length) {
          this.$message.warning("请添加题目!");
          return;
8af7657f   梁保满   修改添加备题,组卷
964
        } this.formatQuestionList()
77ebf04d   梁保满   个人版
965
966
967
        //添加题目ID、序号
        this.form.questionList.map((item, index) => {
          item.questionType = 0;
352c53cc   梁保满   上传word回传数据
968
          item.subQuestions?.map((items, indexs) => {
77ebf04d   梁保满   个人版
969
970
971
972
973
            items.questionId = this.setNum(index, indexs);
            items.questionIndex = this.setNum(index, indexs);
          });
        });
        //整理问题
8af7657f   梁保满   修改添加备题,组卷
974
975
976
977
978
979
        this.formateQuestion()
        this.step = 2;
        return;
      },
      formateQuestion() {
        this.formatQuestionList()
77ebf04d   梁保满   个人版
980
981
982
        this.form.questionList?.map((item) => {
          let types = [{}];
          let addndex = 0;
352c53cc   梁保满   上传word回传数据
983
          item.subQuestions?.map((sub, index) => {
77ebf04d   梁保满   个人版
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
1001
1002
1003
1004
1005
1006
1007
1008
1009
1010
1011
1012
1013
1014
1015
1016
1017
1018
1019
1020
1021
1022
1023
1024
1025
1026
1027
            if (!!sub.questionType) {
              if (
                sub.questionType == types[addndex].qusType &&
                sub.questionType != 5
              ) {
                //同类型批量答案+1
                types[addndex].subNum += 1;
                if (
                  types[addndex].answerOptions.length < sub.answerOptions.length
                ) {
                  types[addndex].answerOptions = sub.answerOptions;
                }
  
                // types[addndex].answerList += this.setAnswer(
                //   sub.questionType,
                //   sub.correctAnswer
                // );
                types[addndex].answerList = "";
                if (index == item.subQuestions.length - 1) {
                  //循环最后类型数量大于等于5,保存批量答案
                  if (types[addndex].subNum && types[addndex].subNum >= 5) {
                    types[addndex].endIndex = sub.questionIndex;
                    types[addndex].index = index;
                  }
                }
              } else {
                if (types[addndex].subNum && types[addndex].subNum >= 5) {
                  //不同类型时如果原有类型数量大于等于5,保存批量答案
                  types[addndex].endIndex =
                    item.subQuestions[index - 1].questionIndex;
                  types[addndex].index = index - 1;
                  addndex += 1;
                  types[addndex] = {};
                }
                //不同类型初始化批量答案
                types[addndex].qusType = sub.questionType;
                types[addndex].subNum = 1;
                types[addndex].answerOptions = sub.answerOptions;
                types[addndex].answerList = "";
              }
            }
          });
          for (let i = 0; i < types.length; i++) {
            if (types[i].subNum >= 5) {
352c53cc   梁保满   上传word回传数据
1028
              item.subQuestions?.splice(
77ebf04d   梁保满   个人版
1029
1030
1031
1032
1033
1034
                types[i].index + i + 1,
                0,
                deepClone(types[i])
              );
            }
          }
77ebf04d   梁保满   个人版
1035
        });
77ebf04d   梁保满   个人版
1036
      },
8af7657f   梁保满   修改添加备题,组卷
1037
  
b31444fa   梁保满   复制归档答题卡后续流程
1038
      //删除批量操作数据
77ebf04d   梁保满   个人版
1039
      formatQuestionList() {
77ebf04d   梁保满   个人版
1040
1041
1042
        for (let i = 0; i < this.form.questionList.length; i++) {
          for (
            let j = 0;
352c53cc   梁保满   上传word回传数据
1043
            j < this.form.questionList[i].subQuestions?.length;
77ebf04d   梁保满   个人版
1044
1045
            j++
          ) {
352c53cc   梁保满   上传word回传数据
1046
1047
            if (this.form.questionList[i].subQuestions[j]?.qusType) {
              this.form.questionList[i].subQuestions?.splice(j, 1);
77ebf04d   梁保满   个人版
1048
1049
1050
1051
1052
1053
1054
1055
            }
          }
        }
      },
      openQuestion() {
        this.questionForm = { ...questionForm };
        this.addQuestionVisible = true;
      },
b31444fa   梁保满   复制归档答题卡后续流程
1056
      //添加大题
77ebf04d   梁保满   个人版
1057
      addQuestion() {
77ebf04d   梁保满   个人版
1058
1059
1060
1061
1062
1063
1064
1065
1066
1067
1068
1069
1070
1071
1072
1073
1074
1075
1076
1077
1078
1079
1080
1081
1082
1083
1084
1085
1086
1087
1088
1089
1090
1091
1092
1093
1094
        let subQuestions = [];
        let questionsOptions = {
          ...subQuesOptions,
          selectNum: this.questionForm.selectNum,
          score: this.questionForm.score,
          partScore: this.questionForm.partScore,
          questionType:
            this.questionForm.questionType == 6
              ? 2
              : this.questionForm.questionType,
        };
        switch (questionsOptions.questionType) {
          case 2:
            questionsOptions.answerOptions = this.rightOptions
              .slice(0, questionsOptions.selectNum)
              .join(",");
            break;
          case 3:
            questionsOptions.answerOptions = this.rightOptions
              .slice(0, questionsOptions.selectNum)
              .join(",");
            break;
          case 4:
            questionsOptions.selectNum = 0;
            questionsOptions.answerOptions = "1,2";
            break;
          case 5:
            questionsOptions.selectNum = 0;
            break;
        }
        for (let i = 0; i < this.questionForm.number; i++) {
          let answer = "";
          if (questionsOptions.questionType == 4) {
            answer =
              this.questionForm.answerList[i] == "✓"
                ? 1
                : this.questionForm.answerList[i] == "✗"
352c53cc   梁保满   上传word回传数据
1095
1096
                  ? 2
                  : "";
77ebf04d   梁保满   个人版
1097
1098
1099
1100
1101
1102
1103
1104
1105
1106
1107
1108
1109
1110
1111
1112
1113
          } else if (questionsOptions.questionType == 3) {
            answer = this.questionForm.answerList.split(",")[i] || "";
          } else if (questionsOptions.questionType == 2) {
            answer = this.questionForm.answerList[i] || "";
          }
          questionsOptions.correctAnswer = answer;
          subQuestions.push({ ...questionsOptions });
        }
        this.form.questionList.push({
          questionTitle: this.questionForm.questionTitle,
          number: this.questionForm.number,
          source: 10,
          subQuestions: [...subQuestions],
          show: false,
        });
        this.addQuestionVisible = false;
      },
b31444fa   梁保满   复制归档答题卡后续流程
1114
      //删除小题
77ebf04d   梁保满   个人版
1115
      delTabData(subIndex, index) {
77ebf04d   梁保满   个人版
1116
        this.form.questionList[index].subQuestions.splice(subIndex, 1);
8af7657f   梁保满   修改添加备题,组卷
1117
        this.formateQuestion()
77ebf04d   梁保满   个人版
1118
1119
      },
      setScore(question) {
352c53cc   梁保满   上传word回传数据
1120
        let score = question.subQuestions?.reduce((a, b) => {
77ebf04d   梁保满   个人版
1121
1122
1123
1124
1125
1126
1127
1128
1129
1130
1131
1132
1133
1134
1135
1136
1137
1138
1139
1140
1141
1142
1143
1144
1145
1146
1147
1148
1149
1150
          return a + (b.score ? b.score : 0);
        }, 0);
        return Number(score).toFixed(2);
      },
      changeAddSubQuestions(val, question) {
        if (val) {
          let questionsOptions = {
            ...subQuesOptions,
            questionType: val,
          };
          switch (questionsOptions.questionType) {
            case 2:
              questionsOptions.answerOptions = this.rightOptions
                .slice(0, questionsOptions.selectNum)
                .join(",");
              break;
            case 3:
              questionsOptions.answerOptions = this.rightOptions
                .slice(0, questionsOptions.selectNum)
                .join(",");
              questionsOptions.partScore = 0;
              break;
            case 4:
              questionsOptions.selectNum = 0;
              questionsOptions.answerOptions = "1,2";
              break;
            case 5:
              questionsOptions.selectNum = 0;
              break;
          }
352c53cc   梁保满   上传word回传数据
1151
          question.subQuestions ? question.subQuestions.push(questionsOptions) : question.subQuestions = [(questionsOptions)];
77ebf04d   梁保满   个人版
1152
1153
1154
          this.addSubQuestionsType = "";
        }
      },
b31444fa   梁保满   复制归档答题卡后续流程
1155
      //切换多题型-小题题型
77ebf04d   梁保满   个人版
1156
      changeSubQuestions(val, subQuestions) {
77ebf04d   梁保满   个人版
1157
1158
1159
1160
1161
1162
1163
1164
1165
1166
1167
1168
1169
1170
1171
1172
1173
1174
1175
1176
1177
1178
1179
1180
1181
        const that = this;
        subQuestions.score = 1;
        subQuestions.partScore = 0;
        subQuestions.correctAnswer = "";
        subQuestions.selectNum = 4;
        switch (val) {
          case 2:
            subQuestions.answerOptions = that.rightOptions
              .slice(0, subQuestions.selectNum)
              .join(",");
            break;
          case 3:
            subQuestions.answerOptions = that.rightOptions
              .slice(0, subQuestions.selectNum)
              .join(",");
            break;
          case 4:
            subQuestions.selectNum = 0;
            subQuestions.answerOptions = "1,2";
            break;
          case 5:
            subQuestions.selectNum = 0;
            break;
        }
      },
b31444fa   梁保满   复制归档答题卡后续流程
1182
      //添加选项
77ebf04d   梁保满   个人版
1183
      addOptions(subQuestions) {
77ebf04d   梁保满   个人版
1184
        let length = subQuestions.answerOptions.split(",").length;
ec6394d1   梁保满   v1.3.1。细节调整
1185
        if (length > 9) return;
77ebf04d   梁保满   个人版
1186
1187
1188
1189
1190
        subQuestions.selectNum = length + 1;
        subQuestions.answerOptions = this.rightOptions
          .slice(0, subQuestions.selectNum)
          .join(",");
      },
b31444fa   梁保满   复制归档答题卡后续流程
1191
      //删除选项
77ebf04d   梁保满   个人版
1192
      removeOptions(subQuestions) {
77ebf04d   梁保满   个人版
1193
1194
1195
1196
1197
1198
1199
1200
1201
1202
1203
        let length = subQuestions.answerOptions.split(",").length;
        if (length < 3) return;
        subQuestions.selectNum = length - 1;
        subQuestions.answerOptions = this.rightOptions
          .slice(0, subQuestions.selectNum)
          .join(",");
        subQuestions.correctAnswer = subQuestions.correctAnswer.slice(
          0,
          subQuestions.selectNum
        );
      },
b31444fa   梁保满   复制归档答题卡后续流程
1204
      //设置多选答案
77ebf04d   梁保满   个人版
1205
      changAnswer(sub, option) {
77ebf04d   梁保满   个人版
1206
1207
1208
1209
1210
1211
1212
1213
1214
1215
1216
1217
1218
1219
1220
1221
1222
1223
1224
1225
1226
1227
1228
1229
1230
        let str = new RegExp(option, "g");
        if (sub.correctAnswer?.includes(option)) {
          sub.correctAnswer = sub.correctAnswer.replace(str, "");
        } else {
          let arrs = (sub.correctAnswer && sub.correctAnswer.split("")) || [];
          arrs.push(option);
          sub.correctAnswer = arrs.sort().join("");
        }
      },
      openTagDia() {
        this.tagList = deepClone(this.answerTypeList);
        this.dialogVisible = true;
      },
      async editTypeName(obj) {
        let isRepeat = false;
        this.answerTypeList.map((item) => {
          if (item.typeName == obj.typeName) {
            isRepeat = true;
          }
        });
        if (isRepeat) {
          this.$message.error("类型已存在请重新填写!");
          return;
        }
        //修改测验类型
e371f2dc   梁保满   软件下载,学校,班级老师等报表导入...
1231
1232
1233
1234
1235
        let editPaperType =
          this.role == "ROLE_PERSONAL"
            ? this.$request.pModifyPaperType
            : this.$request.editPaperType;
        const { data, status, info } = await editPaperType({
77ebf04d   梁保满   个人版
1236
1237
1238
1239
1240
1241
1242
1243
1244
1245
1246
1247
1248
          tagId: obj.id,
          tag: obj.typeName,
        });
        if (status == 0) {
          await this._TypeList();
          this.tagList = deepClone(this.answerTypeList);
          this.$message.success("修改成功");
        } else {
          this.$message.error(info);
        }
      },
      async removeTypeName(obj) {
        //删除测验类型
e371f2dc   梁保满   软件下载,学校,班级老师等报表导入...
1249
1250
1251
1252
1253
        let delPaperType =
          this.role == "ROLE_PERSONAL"
            ? this.$request.pDelPaperType
            : this.$request.delPaperType;
        const { data, status, info } = await delPaperType({
77ebf04d   梁保满   个人版
1254
1255
1256
1257
1258
1259
1260
1261
1262
1263
1264
1265
1266
1267
1268
1269
1270
1271
1272
1273
1274
1275
1276
1277
1278
1279
1280
          tagId: obj.id,
        });
        if (status == 0) {
          await this._TypeList();
          this.tagList = deepClone(this.answerTypeList);
          this.$message.success("删除成功");
        } else {
          this.$message.error(info);
        }
      },
      async addPaperType() {
        //保存测验类型
        if (!this.answerTypeName) {
          this.$message.error("请填写测验名称!");
          return;
        }
        let isRepeat = false;
        this.answerTypeList.map((item) => {
          if (item.typeName == this.answerTypeName) {
            isRepeat = true;
          }
        });
        if (isRepeat) {
          this.$message.error("类型已存在请重新填写!");
          return;
        }
        //添加测验类型
e371f2dc   梁保满   软件下载,学校,班级老师等报表导入...
1281
1282
1283
1284
1285
        let addPaperType =
          this.role == "ROLE_PERSONAL"
            ? this.$request.pAddPaperType
            : this.$request.addPaperType;
        const { data, status, info } = await addPaperType({
77ebf04d   梁保满   个人版
1286
1287
1288
1289
1290
1291
1292
1293
1294
1295
1296
1297
1298
1299
1300
1301
1302
1303
1304
          tag: this.answerTypeName,
        });
        if (status == 0) {
          await this._TypeList();
          this.tagList = deepClone(this.answerTypeList);
          this.form.tagId = data || "";
          this.answerTypeName = "";
          this.$message.success("添加成功");
        } else {
          this.$message.error(info);
        }
      },
      async save() {
        if (this.saveLoading) return;
        this.saveLoading = true;
        this.formatQuestionList();
        let formDatas = deepClone(this.form);
        for (let i = 0; i < formDatas.questionList.length; i++) {
          delete formDatas.questionList[i].show;
77ebf04d   梁保满   个人版
1305
        }
e371f2dc   梁保满   软件下载,学校,班级老师等报表导入...
1306
1307
1308
1309
1310
        let addPaper =
          this.role == "ROLE_PERSONAL"
            ? this.$request.pAddPaper
            : this.$request.addPaper;
        const { data, status, info } = await addPaper({
77ebf04d   梁保满   个人版
1311
1312
1313
1314
1315
1316
1317
1318
1319
1320
1321
          ...formDatas,
        });
        this.saveLoading = false;
        if (status == 0) {
          this.$router.push({
            path: "/examinationPaper",
          });
        } else {
          this.$message.error(info);
        }
      },
e371f2dc   梁保满   软件下载,学校,班级老师等报表导入...
1322
1323
1324
1325
      async changeGrade() {
        //切换年级查询科目
        this._QuerySubjectList(this.form.gradeName);
      },
77ebf04d   梁保满   个人版
1326
1327
      async _TypeList() {
        //测验类型查询
e371f2dc   梁保满   软件下载,学校,班级老师等报表导入...
1328
1329
1330
1331
1332
        let fetchTypeNames =
          this.role == "ROLE_PERSONAL"
            ? this.$request.pPaperTagList
            : this.$request.fetchTypeNames;
        const { data, status, info } = await fetchTypeNames({
77ebf04d   梁保满   个人版
1333
1334
1335
1336
1337
1338
1339
1340
1341
1342
1343
1344
1345
1346
1347
1348
1349
          type: 1,
        });
        if (status == 0) {
          this.answerTypeList =
            data.list?.map((item) => {
              return {
                typeName: item.tag,
                id: item.tagId,
              };
            }) || [];
          if (this.type != 2) {
            this.form.tagId = this.answerTypeList[0]?.id || "";
          }
        } else {
          this.$message.error(info);
        }
      },
e371f2dc   梁保满   软件下载,学校,班级老师等报表导入...
1350
1351
1352
1353
1354
1355
1356
1357
1358
1359
1360
1361
1362
      async _GradeList() {
        //查询年级列表
        const { data, status, info } = await this.$request.fetchGradeList();
        if (status == 0) {
          this.gradeList = (data.gradeNames && [...data.gradeNames]) || [];
          if (this.type != 2) {
            this.form.gradeName = this.gradeList[0];
          }
        } else {
          this.$message.error(info);
        }
      },
      async _QuerySubjectList(grade) {
77ebf04d   梁保满   个人版
1363
        //查询科目列表
352c53cc   梁保满   上传word回传数据
1364
        if (!grade && this.role != "ROLE_PERSONAL") {
b31444fa   梁保满   复制归档答题卡后续流程
1365
1366
          return;
        }
e371f2dc   梁保满   软件下载,学校,班级老师等报表导入...
1367
1368
1369
1370
1371
1372
1373
1374
1375
        let query = {};
        let fetchSubjectList =
          this.role == "ROLE_PERSONAL"
            ? this.$request.pSubjectList
            : this.$request.fetchSubjectList;
        if (this.role != "ROLE_PERSONAL") {
          query.gradeName = grade;
        }
        const { data, status, info } = await fetchSubjectList({ ...query });
77ebf04d   梁保满   个人版
1376
1377
1378
1379
        if (status === 0) {
          this.subjectList =
            data.subjectNames?.map((item) => {
              return {
cffc1a98   梁保满   3-8BUG
1380
1381
                value: this.role == "ROLE_PERSONAL" ? item.subjectName : item,
                label: this.role == "ROLE_PERSONAL" ? item.subjectName : item,
77ebf04d   梁保满   个人版
1382
1383
              };
            }) || [];
77ebf04d   梁保满   个人版
1384
1385
1386
          if (this.subjectList.length) {
            this.form.subjectName = this.subjectList[0].value;
          }
77ebf04d   梁保满   个人版
1387
1388
1389
1390
1391
        } else {
          this.$message.error(info);
        }
      },
      async _QueryDetail() {
03bce046   梁保满   个人版调整
1392
        //查询答题卡详情
e371f2dc   梁保满   软件下载,学校,班级老师等报表导入...
1393
1394
1395
1396
1397
        let fetchPaperDetail =
          this.role == "ROLE_PERSONAL"
            ? this.$request.pPaperDetail
            : this.$request.fetchPaperDetail;
        const { data, status, info } = await fetchPaperDetail({
77ebf04d   梁保满   个人版
1398
1399
1400
1401
1402
          paperId: this.$route.query.paperId,
        });
        if (status == 0) {
          this.form.title = data.title + "_副本";
          this.form.tagId = data.tagId === 0 ? "" : data.tagId;
8af7657f   梁保满   修改添加备题,组卷
1403
1404
1405
1406
          this.form.examsDuration = data.examsDuration;
          if (this.role != "ROLE_PERSONAL") {
            this.form.sharingType = data.sharingType;
          }
352c53cc   梁保满   上传word回传数据
1407
1408
1409
1410
1411
1412
1413
1414
1415
1416
1417
1418
1419
1420
1421
1422
          this.formatData(data)
        } else {
          this.$message.error(info);
        }
      },
  
      formatData(data) {
        if (this.subjectList.length) {
          this.subjectList.map((item) => {
            if (item.label == data.subjectName) {
              this.form.subjectName = item.value;
            }
          });
        } else {
          this.form.subjectName = "";
        }
8af7657f   梁保满   修改添加备题,组卷
1423
  
352c53cc   梁保满   上传word回传数据
1424
        if (this.role != "ROLE_PERSONAL") {
352c53cc   梁保满   上传word回传数据
1425
1426
1427
1428
          if (this.gradeList.length) {
            this.gradeList.map((item) => {
              if (item == data.gradeName) {
                this.form.gradeName = data.gradeName;
47a01cb6   梁保满   v1.3测试问题
1429
1430
1431
              }
            });
          } else {
352c53cc   梁保满   上传word回传数据
1432
            this.form.gradeName = "";
47a01cb6   梁保满   v1.3测试问题
1433
          }
77ebf04d   梁保满   个人版
1434
        }
352c53cc   梁保满   上传word回传数据
1435
1436
1437
1438
1439
1440
1441
1442
1443
1444
1445
1446
1447
1448
1449
1450
1451
1452
1453
1454
        this.form.questionList = data.questionList?.map((item) => {
          let subQuestions =
            item.subQuestions?.map((items) => {
              return {
                questionType: items.questionType,
                score: items.score,
                partScore: items.partScore,
                selectNum: items.answerOptions.split(",").length,
                answerOptions: items.answerOptions || "A,B,C,D",
                correctAnswer: items.correctAnswer,
                screenshot: items.screenshot || "",
              };
            }) || [];
          return {
            questionTitle: item.questionTitle,
            subQuestions: subQuestions,
            show: false,
          };
        });
      }
77ebf04d   梁保满   个人版
1455
1456
1457
    },
  };
  </script>
77ebf04d   梁保满   个人版
1458
1459
1460
1461
  <style lang="scss" scoped>
  .red {
    color: #f30;
  }
352c53cc   梁保满   上传word回传数据
1462
  
77ebf04d   梁保满   个人版
1463
1464
  .qs-options {
    flex: 1;
352c53cc   梁保满   上传word回传数据
1465
  
77ebf04d   梁保满   个人版
1466
1467
1468
    .ipt {
      margin-bottom: 5px;
    }
352c53cc   梁保满   上传word回传数据
1469
  
77ebf04d   梁保满   个人版
1470
1471
1472
1473
    .answer-box {
      .answer-s {
        cursor: pointer;
        user-select: none;
ec6394d1   梁保满   v1.3.1。细节调整
1474
        margin-bottom: 10px;
352c53cc   梁保满   上传word回传数据
1475
  
77ebf04d   梁保满   个人版
1476
1477
1478
1479
1480
        &:first-of-type {
          margin-left: 0;
        }
      }
    }
352c53cc   梁保满   上传word回传数据
1481
  
ec6394d1   梁保满   v1.3.1。细节调整
1482
1483
1484
    .answer-box2 {
      margin-bottom: 10px;
    }
352c53cc   梁保满   上传word回传数据
1485
  
77ebf04d   梁保满   个人版
1486
1487
1488
    .delButton {
      text-indent: -9999999px;
      border-color: #ff6868;
e371f2dc   梁保满   软件下载,学校,班级老师等报表导入...
1489
      background: #ff6868 url("../../assets/images/arrow.png") no-repeat center;
77ebf04d   梁保满   个人版
1490
1491
1492
      background-size: 19px;
      color: transparent;
    }
352c53cc   梁保满   上传word回传数据
1493
  
77ebf04d   梁保满   个人版
1494
1495
1496
    .answer-s.ac {
      border: none;
    }
352c53cc   梁保满   上传word回传数据
1497
  
77ebf04d   梁保满   个人版
1498
1499
1500
1501
1502
1503
1504
1505
1506
1507
    .ac {
      border-color: #ff6868;
      background: #ff6868;
      color: #fff !important;
    }
  }
  
  .sel2 {
    width: 480px;
  }
352c53cc   梁保满   上传word回传数据
1508
  
77ebf04d   梁保满   个人版
1509
1510
1511
1512
1513
1514
1515
  .set-ans-btn {
    width: 100%;
    padding: 10px 0 10px 630px;
    box-sizing: border-box;
    border-right: 1px solid #e2e2e2;
    border-bottom: 1px solid #e2e2e2;
  }
352c53cc   梁保满   上传word回传数据
1516
  
77ebf04d   梁保满   个人版
1517
1518
1519
1520
1521
  .content-box {
    width: 100%;
    height: 100%;
    overflow-y: auto;
  }
352c53cc   梁保满   上传word回传数据
1522
  
77ebf04d   梁保满   个人版
1523
1524
1525
1526
  .content {
    width: 100%;
    box-sizing: border-box;
    padding: 0 24px;
352c53cc   梁保满   上传word回传数据
1527
  
77ebf04d   梁保满   个人版
1528
1529
1530
    .ml-20 {
      margin-left: 20px;
    }
352c53cc   梁保满   上传word回传数据
1531
  
77ebf04d   梁保满   个人版
1532
1533
1534
1535
1536
    .btn-box {
      text-align: right;
      margin-left: 140px;
    }
  }
352c53cc   梁保满   上传word回传数据
1537
  
77ebf04d   梁保满   个人版
1538
1539
1540
1541
1542
1543
1544
  .dia-content {
    .dia-tit {
      font-size: 20px;
      color: #333;
      font-weight: 700;
      text-align: center;
    }
352c53cc   梁保满   上传word回传数据
1545
  
77ebf04d   梁保满   个人版
1546
1547
1548
    .add-type {
      width: 100%;
      margin-bottom: 10px;
352c53cc   梁保满   上传word回传数据
1549
  
77ebf04d   梁保满   个人版
1550
1551
1552
1553
1554
      .js-set {
        margin: 2.5px 10px 0 0;
        font-size: 14px;
      }
    }
352c53cc   梁保满   上传word回传数据
1555
  
77ebf04d   梁保满   个人版
1556
1557
1558
1559
    .add-btn {
      margin-left: 20px;
    }
  }
352c53cc   梁保满   上传word回传数据
1560
  
77ebf04d   梁保满   个人版
1561
1562
1563
1564
1565
  .el-message-box {
    :deep(.el-button--default) {
      color: #fff;
    }
  }
352c53cc   梁保满   上传word回传数据
1566
  
77ebf04d   梁保满   个人版
1567
1568
1569
1570
  .add-box {
    display: flex;
    justify-content: center;
    align-items: center;
352c53cc   梁保满   上传word回传数据
1571
  
77ebf04d   梁保满   个人版
1572
1573
1574
1575
1576
1577
1578
1579
    .add-question {
      display: flex;
      justify-content: center;
      align-items: center;
      font-size: 16px;
      font-weight: bolder;
      padding: 2px;
      cursor: pointer;
352c53cc   梁保满   上传word回传数据
1580
  
77ebf04d   梁保满   个人版
1581
1582
1583
      .s1 {
        margin-left: 6px;
      }
352c53cc   梁保满   上传word回传数据
1584
  
77ebf04d   梁保满   个人版
1585
1586
1587
1588
      :deep(.el-icon-plus) {
        font-size: 24px;
        font-weight: 900;
      }
352c53cc   梁保满   上传word回传数据
1589
  
77ebf04d   梁保满   个人版
1590
1591
1592
1593
1594
      :deep(.el-button--mini.is-circle) {
        padding: 3px;
      }
    }
  }
352c53cc   梁保满   上传word回传数据
1595
  
77ebf04d   梁保满   个人版
1596
1597
  .dialog-footer {
    text-align: center;
352c53cc   梁保满   上传word回传数据
1598
  
77ebf04d   梁保满   个人版
1599
1600
1601
1602
1603
1604
    :deep(.el-button) {
      border-radius: 20px;
      padding: 8px 20px 7px;
      margin: 0 12px;
    }
  }
352c53cc   梁保满   上传word回传数据
1605
  
77ebf04d   梁保满   个人版
1606
1607
  .question-box {
    margin-bottom: 20px;
8af7657f   梁保满   修改添加备题,组卷
1608
1609
1610
1611
1612
1613
1614
1615
1616
1617
  
    .screenshot-box {
      width: 100%;
      border: 1px solid #e2e2e2;
      margin-bottom: 20px;
  
      .screenshot-img {
        margin: 0;
      }
    }
77ebf04d   梁保满   个人版
1618
  }
352c53cc   梁保满   上传word回传数据
1619
  
77ebf04d   梁保满   个人版
1620
1621
1622
1623
1624
  .question-title {
    line-height: 40px;
    display: flex;
    align-items: center;
    margin-bottom: 12px;
352c53cc   梁保满   上传word回传数据
1625
  
77ebf04d   梁保满   个人版
1626
1627
1628
    .m20 {
      margin: 0 20px;
    }
352c53cc   梁保满   上传word回传数据
1629
  
77ebf04d   梁保满   个人版
1630
1631
1632
    .ipt {
      width: 300px;
      margin: 0 16px 0 10px;
352c53cc   梁保满   上传word回传数据
1633
  
77ebf04d   梁保满   个人版
1634
1635
1636
1637
1638
1639
      :deep(.el-input__inner) {
        border-radius: 20px;
        border-color: #667ffd;
        background: rgba($color: #667ffd, $alpha: 0.05);
      }
    }
352c53cc   梁保满   上传word回传数据
1640
  
77ebf04d   梁保满   个人版
1641
1642
1643
    .delete {
      margin-right: 8px;
    }
352c53cc   梁保满   上传word回传数据
1644
  
77ebf04d   梁保满   个人版
1645
1646
1647
1648
1649
    .title-txt {
      margin-right: 20px;
      font-size: 16px;
      font-weight: 700;
    }
352c53cc   梁保满   上传word回传数据
1650
  
77ebf04d   梁保满   个人版
1651
1652
1653
1654
1655
1656
    .el-icon-caret-right {
      font-size: 24px;
      color: #888;
      transition: all 0.4s;
      margin-right: 12px;
      cursor: pointer;
352c53cc   梁保满   上传word回传数据
1657
  
77ebf04d   梁保满   个人版
1658
1659
1660
1661
1662
      &.active {
        transform: rotate(90deg);
      }
    }
  }
352c53cc   梁保满   上传word回传数据
1663
  
77ebf04d   梁保满   个人版
1664
1665
1666
1667
  .questions-ul {
    border-left: 1px solid #e2e2e2;
    border-top: 1px solid #e2e2e2;
  }
352c53cc   梁保满   上传word回传数据
1668
  
77ebf04d   梁保满   个人版
1669
1670
1671
  .el-input-number {
    width: 140px;
  }
352c53cc   梁保满   上传word回传数据
1672
  
77ebf04d   梁保满   个人版
1673
1674
1675
1676
1677
1678
  .answer-title {
    text-align: center;
    font-size: 20px;
    color: #333;
    font-weight: 700;
    padding-bottom: 20px;
352c53cc   梁保满   上传word回传数据
1679
  
77ebf04d   梁保满   个人版
1680
1681
1682
1683
1684
1685
    .totals {
      font-size: 16px;
      color: #888;
      font-weight: normal;
    }
  }
352c53cc   梁保满   上传word回传数据
1686
  
77ebf04d   梁保满   个人版
1687
1688
1689
1690
1691
1692
1693
1694
1695
1696
1697
1698
  .answer-box {
    .answer-s {
      display: inline-block;
      width: 30px;
      height: 30px;
      border: 1px solid #e2e2e2;
      border-radius: 3px;
      margin: 0 6px;
      font-size: 16px;
      color: #333;
      text-align: center;
      line-height: 30px;
352c53cc   梁保满   上传word回传数据
1699
  
77ebf04d   梁保满   个人版
1700
1701
1702
1703
1704
1705
1706
      &.active {
        background: #5e78fa;
        border-color: #5e78fa;
        color: #fff;
      }
    }
  }
352c53cc   梁保满   上传word回传数据
1707
  
77ebf04d   梁保满   个人版
1708
1709
1710
1711
1712
1713
1714
1715
1716
1717
1718
1719
1720
  .qs-options {
    .answer-s {
      display: inline-block;
      width: 30px;
      height: 30px;
      border: 1px solid #e2e2e2;
      border-radius: 3px;
      margin: 0 6px;
      font-size: 16px;
      color: #333;
      text-align: center;
      line-height: 30px;
      cursor: pointer;
352c53cc   梁保满   上传word回传数据
1721
  
77ebf04d   梁保满   个人版
1722
1723
1724
1725
1726
1727
1728
      &.active {
        background: #5e78fa;
        border-color: #5e78fa;
        color: #fff;
      }
    }
  }
352c53cc   梁保满   上传word回传数据
1729
  
77ebf04d   梁保满   个人版
1730
1731
1732
1733
  .sub-questions {
    width: 100%;
    display: flex;
    border-bottom: 1px solid #e2e2e2;
352c53cc   梁保满   上传word回传数据
1734
1735
  
    &>div {
77ebf04d   梁保满   个人版
1736
1737
1738
1739
1740
1741
1742
1743
      min-height: 40px;
      padding: 5px;
      flex-shrink: 0;
      border-right: 1px solid #e2e2e2;
      display: flex;
      justify-content: center;
      align-items: center;
    }
352c53cc   梁保满   上传word回传数据
1744
  
77ebf04d   梁保满   个人版
1745
1746
1747
    .qs-num {
      width: 70px;
    }
352c53cc   梁保满   上传word回传数据
1748
  
77ebf04d   梁保满   个人版
1749
1750
1751
    .qs-type {
      width: 160px;
    }
352c53cc   梁保满   上传word回传数据
1752
  
77ebf04d   梁保满   个人版
1753
1754
1755
1756
    .qs-score,
    .qs-partScore {
      width: 160px;
    }
352c53cc   梁保满   上传word回传数据
1757
  
77ebf04d   梁保满   个人版
1758
1759
1760
    .qs-options {
      flex: 1;
    }
352c53cc   梁保满   上传word回传数据
1761
  
8af7657f   梁保满   修改添加备题,组卷
1762
1763
1764
1765
    .qs-upload {
      width: 60px;
    }
  
77ebf04d   梁保满   个人版
1766
    .qs-set {
ec6394d1   梁保满   v1.3.1。细节调整
1767
      width: 60px;
77ebf04d   梁保满   个人版
1768
    }
352c53cc   梁保满   上传word回传数据
1769
  
77ebf04d   梁保满   个人版
1770
1771
1772
1773
    .qs-options2 {
      text-align: left;
      justify-content: flex-start;
      padding-left: 20px;
352c53cc   梁保满   上传word回传数据
1774
  
77ebf04d   梁保满   个人版
1775
1776
1777
1778
      .answer-s {
        cursor: pointer;
      }
    }
352c53cc   梁保满   上传word回传数据
1779
  
77ebf04d   梁保满   个人版
1780
1781
1782
1783
1784
1785
1786
1787
1788
    :deep(.el-select) {
      .el-input__inner {
        border-radius: 20px;
        border-color: #667ffd;
        width: 150px;
        height: 32px;
        line-height: 32px;
        background: rgba($color: #667ffd, $alpha: 0.05);
      }
352c53cc   梁保满   上传word回传数据
1789
  
77ebf04d   梁保满   个人版
1790
1791
1792
1793
1794
      .el-input__icon {
        line-height: 32px;
      }
    }
  }
8af7657f   梁保满   修改添加备题,组卷
1795
1796
1797
1798
1799
1800
1801
1802
1803
1804
1805
1806
1807
  
  .upload-box {
    .upload-demo {
      text-align: center;
    }
  
    .stem-pic {
      display: block;
      margin: 0 auto 20px;
      height: 200px;
      object-fit: cover;
    }
  }
77ebf04d   梁保满   个人版
1808
  </style>