Blame view

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