{"remainingRequest":"D:\\jenkins\\workspace\\examine-fvue\\node_modules\\vue-loader\\lib\\index.js??vue-loader-options!D:\\jenkins\\workspace\\examine-fvue\\src\\views\\questionManage\\components\\questionListMenuDialog.vue?vue&type=script&lang=js&","dependencies":[{"path":"D:\\jenkins\\workspace\\examine-fvue\\src\\views\\questionManage\\components\\questionListMenuDialog.vue","mtime":1705466684692},{"path":"D:\\jenkins\\workspace\\examine-fvue\\node_modules\\babel-loader\\lib\\index.js","mtime":315532800000},{"path":"D:\\jenkins\\workspace\\examine-fvue\\node_modules\\cache-loader\\dist\\cjs.js","mtime":499162500000},{"path":"D:\\jenkins\\workspace\\examine-fvue\\node_modules\\vue-loader\\lib\\index.js","mtime":499162500000}],"contextDependencies":[],"result":["//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n\nimport questionListMenu from '@/api/examination/questionListMenu.js'\nimport dictUtils from '@/components/dict/DictSelectUtils.js'\nimport subjectDialog from './subjectDialog.vue'\nimport {\n\tmapState\n} from 'vuex'\nimport 'quill/dist/quill.core.css'\nimport 'quill/dist/quill.snow.css'\nimport 'quill/dist/quill.bubble.css'\nimport {\n\tquillEditor\n} from 'vue-quill-editor'\nconst toolbarOptions = [\n\t['bold', 'italic', 'underline', 'strike'], // 加粗,斜体,下划线,删除线\n\t['blockquote', 'code-block'], //引用,代码块\n\t[{\n\t\t\theader: 1\n\t\t},\n\t\t{\n\t\t\theader: 2\n\t\t}\n\t], // 几级标题\n\t[{\n\t\t\tlist: 'ordered'\n\t\t},\n\t\t{\n\t\t\tlist: 'bullet'\n\t\t}\n\t],\n\t// 字体大小\n\t[{\n\t\theader: [1, 2, 3, 4, 5, 6, false]\n\t}], // 标题\n\t[{\n\t\t\tcolor: []\n\t\t}\n\n\t], // 颜色选择\n\n\t['clean'], // 清除样式,\n\t['link', 'image'] // 上传图片、上传视频\n]\nexport default {\n\tname: 'questionListMenuDialog',\n\tcomponents: {\n\t\tquillEditor,\n\t\tsubjectDialog\n\t},\n\tdata() {\n\t\treturn {\n\t\t\tvisible: false,\n\t\t\tuploadUrl: window.context.portal + '/file/v1/uploadFileForConfig', // 服务器上传地址\n\t\t\tacceptImg: '.jpg,.jpeg,.png,.JPG,.JPEG,.gif,.PNG,.GIF',\n\t\t\tparams: {\n\t\t\t\tdifficulty: \"\",\n\t\t\t\tmemo: \"\",\n\t\t\t\toptions: [{\n\t\t\t\t\toptionContent: \"\",\n\t\t\t\t\toptionKey: \"A\",\n\t\t\t\t}, {\n\t\t\t\t\toptionContent: \"\",\n\t\t\t\t\toptionKey: \"B\",\n\t\t\t\t}, {\n\t\t\t\t\toptionContent: \"\",\n\t\t\t\t\toptionKey: \"C\",\n\t\t\t\t}, {\n\t\t\t\t\toptionContent: \"\",\n\t\t\t\t\toptionKey: \"D\",\n\t\t\t\t}],\n\t\t\t\tparsing: null,\n\t\t\t\tquestion: \"\",\n\t\t\t\trightOption: \"\",\n\t\t\t\tsubId: \"\",\n\t\t\t\ttype: \"\"\n\t\t\t},\n\t\t\ttitle: '',\n\t\t\tsubject: '',\n\t\t\tsubjectList: [],\n\t\t\t//难度\n\t\t\tdifficultyList: [],\n\t\t\t// 评卷方式\n\t\t\tfocusNum: false,\n\t\t\tfocusJ: false,\n\t\t\trules: {\n\t\t\t\tsubId: [{\n\t\t\t\t\trequired: true,\n\t\t\t\t\tmessage: '请输入',\n\t\t\t\t\ttrigger: 'blur',\n\t\t\t\t}, ],\n\t\t\t},\n\t\t\t// 富文本配置\n\t\t\teditorOption: {\n\t\t\t\tplaceholder: '请输入题目',\n\t\t\t\ttheme: 'snow', //主题 snow/bubble\n\t\t\t\tmodules: {\n\t\t\t\t\thistory: {\n\t\t\t\t\t\tdelay: 1000,\n\t\t\t\t\t\tmaxStack: 50,\n\t\t\t\t\t\tuserOnly: false\n\t\t\t\t\t},\n\t\t\t\t\ttoolbar: {\n\t\t\t\t\t\tcontainer: toolbarOptions,\n\t\t\t\t\t\thandlers: {\n\t\t\t\t\t\t\timage: function(value) {\n\t\t\t\t\t\t\t\tif (value) {\n\t\t\t\t\t\t\t\t\t// 调用element的图片上传组件\n\t\t\t\t\t\t\t\t\tdocument.querySelector('.avatar-qeuploader input').click()\n\t\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\t\tthis.quill.format('image', false)\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t},\n\tcreated() {\n\t\t// 难度\n\t\tthis.difficultyList = dictUtils.getDictItemsFromCache('stnd')\n\t\t//题目类型\n\t\tthis.typeList = dictUtils.getDictItemsFromCache('sttx')\n\t\t//评卷方式\n\t\t// this.markTypeList = dictUtils.getDictItemsFromCache('pjfs')\n\t},\n\tcomputed: mapState({\n\t\theader: state => {\n\t\t\treturn {\n\t\t\t\tAuthorization: `Bearer ${state.login.currentUser.token}`\n\t\t\t}\n\t\t}\n\t}),\n\tmounted() {},\n\tmethods: {\n\t\tadd(id, list) {\n\t\t\tconsole.log(id, list);\n\t\t\tthis.title = '新增'\n\t\t\tthis.visible = true\n\t\t\tthis.subjectList = []\n\t\t\tthis.subject = []\n\t\t\tif (id.length > 0 && list.length > 0) {\n\t\t\t\tthis.subjectList.push({\n\t\t\t\t\tid: list[0].id,\n\t\t\t\t\tname: list[0].name\n\t\t\t\t})\n\t\t\t\tthis.subject = list[0].id\n\t\t\t}\n\t\t\tthis.params.difficulty = this.difficultyList[0].value\n\t\t\tthis.params.type = this.typeList[0].value\n\t\t\t// this.params.markType = this.markTypeList[0].value\n\t\t},\n\t\tedit(val) {\n\t\t\tquestionListMenu.detailId(val.id, res => {\n\t\t\t\tif (res) {\n\t\t\t\t\tthis.params = res\n\t\t\t\t\tthis.focusNum = true\n\t\t\t\t\tthis.focusJ = true\n\t\t\t\t\tthis.params.options.map(e => {\n\t\t\t\t\t\te.focusNum = true\n\t\t\t\t\t})\n\t\t\t\t\tif (this.params.type == 2) {\n\t\t\t\t\t\tthis.params.rightOption = this.params.rightOption.split(',')\n\t\t\t\t\t}\n\t\t\t\t\tthis.subjectList.push({\n\t\t\t\t\t\tid: this.params.subId,\n\t\t\t\t\t\tname: this.params.subjectName\n\t\t\t\t\t})\n\t\t\t\t\tthis.subject = this.params.subId\n\t\t\t\t\tthis.title = '修改'\n\t\t\t\t\tthis.visible = true\n\t\t\t\t}\n\t\t\t})\n\n\n\t\t},\n\t\t//打开课目弹框\n\t\tsubjectDUsers() {\n\t\t\tthis.$refs.subjectDialog.add(this.subjectList)\n\t\t},\n\t\t// 课目树选中ID\n\t\thandleChange(val) {\n\t\t\tlet ArrIds = []\n\t\t\tArrIds = val\n\t\t\tif (ArrIds.length == 0) {\n\t\t\t\tthis.params.subId = ArrIds[0]\n\t\t\t} else {\n\t\t\t\tthis.params.subId = ArrIds[val.length - 1]\n\t\t\t}\n\t\t},\n\t\tfocus(val, index) {\n\t\t\tconsole.log(1);\n\t\t\tif (val == 't') {\n\t\t\t\tthis.focusNum = true\n\t\t\t} else if (val == 'j') {\n\t\t\t\tthis.focusJ = true\n\t\t\t} else {\n\t\t\t\tval.focusNum = true\n\t\t\t\tthis.$set(this.params.options, index, this.params.options[index]);\n\t\t\t}\n\t\t},\n\t\tgetUser(val) {\n\t\t\tconsole.log(val);\n\t\t\tthis.subjectList = []\n\t\t\tthis.subject = val.id\n\n\t\t\tthis.$set(this.subjectList, 0, val)\n\t\t\tconsole.log(this.subjectList);\n\t\t},\n\t\tgenerateBig() {\n\t\t\tvar ch_big = 'A';\n\t\t\tvar str_big = '';\n\t\t\tfor (var i = 0; i < 26; i++) {\n\t\t\t\tstr_big += String.fromCharCode(ch_big.charCodeAt(0) + i);\n\t\t\t}\n\t\t\tthis.params.options.push({\n\t\t\t\toptionKey: str_big[this.params.options.length],\n\t\t\t\toptionContent: '',\n\t\t\t\tfocusNum: true,\n\t\t\t})\n\t\t},\n\t\t//删除选择\n\t\tdeleteOption(index) {\n\t\t\tif (index > 0) {\n\t\t\t\tthis.params.options.splice(index, 1)\n\t\t\t}\n\t\t},\n\t\t// 关闭新增人员窗口\n\t\thandleClose() {\n\t\t\tthis.focusNum = false\n\t\t\tthis.focusJ = false\n\t\t\tthis.params = {\n\t\t\t\tdifficulty: \"\",\n\t\t\t\tgroupFlag: \"\",\n\t\t\t\t// markType: \"\",\n\t\t\t\tmemo: \"\",\n\t\t\t\toptions: [{\n\t\t\t\t\toptionContent: \"\",\n\t\t\t\t\toptionKey: \"A\",\n\t\t\t\t}, {\n\t\t\t\t\toptionContent: \"\",\n\t\t\t\t\toptionKey: \"B\",\n\t\t\t\t}, {\n\t\t\t\t\toptionContent: \"\",\n\t\t\t\t\toptionKey: \"C\",\n\t\t\t\t}, {\n\t\t\t\t\toptionContent: \"\",\n\t\t\t\t\toptionKey: \"D\",\n\t\t\t\t}],\n\t\t\t\tparsing: \"\",\n\t\t\t\tquestion: \"\",\n\t\t\t\trightOption: \"\",\n\t\t\t\tsubId: \"\",\n\t\t\t\ttype: \"\"\n\t\t\t}\n\t\t\tthis.subjectList = []\n\t\t\tthis.subject = ''\n\t\t\tthis.visible = false\n\t\t\tthis.$emit('loadData')\n\t\t},\n\t\ttopicType(val) {\n\t\t\tif (this.params.question != '') {\n\t\t\t\tthis.$confirm('您确定要修改题目类型吗?切换后原有的题目将清空', '温馨提示', {\n\t\t\t\t\tconfirmButtonText: '是',\n\t\t\t\t\tcancelButtonText: '否',\n\t\t\t\t\ttype: 'warning'\n\t\t\t\t}).then(() => {\n\t\t\t\t\tthis.params.type = val.value\n\t\t\t\t\tthis.focusNum = false\n\t\t\t\t\tthis.focusJ = false\n\t\t\t\t\tthis.params.question = ''\n\t\t\t\t\tthis.params.parsing = ''\n\t\t\t\t\tif (this.params.type == 2) {\n\t\t\t\t\t\tthis.params.rightOption = []\n\t\t\t\t\t} else {\n\t\t\t\t\t\tthis.params.rightOption = ''\n\t\t\t\t\t}\n\t\t\t\t\tif (this.params.type == '1' || this.params.type == '2') {\n\t\t\t\t\t\tthis.params.options = [{\n\t\t\t\t\t\t\toptionContent: \"\",\n\t\t\t\t\t\t\toptionKey: \"A\",\n\t\t\t\t\t\t}, {\n\t\t\t\t\t\t\toptionContent: \"\",\n\t\t\t\t\t\t\toptionKey: \"B\",\n\t\t\t\t\t\t}, {\n\t\t\t\t\t\t\toptionContent: \"\",\n\t\t\t\t\t\t\toptionKey: \"C\",\n\t\t\t\t\t\t}, {\n\t\t\t\t\t\t\toptionContent: \"\",\n\t\t\t\t\t\t\toptionKey: \"D\",\n\t\t\t\t\t\t}]\n\t\t\t\t\t\tthis.$set(this.params.options)\n\t\t\t\t\t} else {\n\t\t\t\t\t\tthis.params.options = []\n\t\t\t\t\t}\n\t\t\t\t}).catch(() => {\n\n\t\t\t\t});\n\t\t\t} else {\n\t\t\t\tthis.params.type = val.value\n\t\t\t\tthis.focusNum = false\n\t\t\t\tthis.focusJ = false\n\t\t\t\tthis.params.question = ''\n\t\t\t\tthis.params.parsing = ''\n\t\t\t\tif (this.params.type == 2) {\n\t\t\t\t\tthis.params.rightOption = []\n\t\t\t\t} else {\n\t\t\t\t\tthis.params.rightOption = ''\n\t\t\t\t}\n\t\t\t\tif (this.params.type == '1' || this.params.type == '2') {\n\t\t\t\t\tthis.params.options = [{\n\t\t\t\t\t\toptionContent: \"\",\n\t\t\t\t\t\toptionKey: \"A\",\n\t\t\t\t\t}, {\n\t\t\t\t\t\toptionContent: \"\",\n\t\t\t\t\t\toptionKey: \"B\",\n\t\t\t\t\t}, {\n\t\t\t\t\t\toptionContent: \"\",\n\t\t\t\t\t\toptionKey: \"C\",\n\t\t\t\t\t}, {\n\t\t\t\t\t\toptionContent: \"\",\n\t\t\t\t\t\toptionKey: \"D\",\n\t\t\t\t\t}]\n\t\t\t\t\tthis.$set(this.params.options)\n\t\t\t\t} else {\n\t\t\t\t\tthis.params.options = []\n\t\t\t\t}\n\t\t\t}\n\n\n\t\t},\n\t\t// 保存\n\t\thandleSave(val) {\n\t\t\tthis.typeList.forEach(item => {\n\t\t\t\tif (item.name == this.params.type) {\n\t\t\t\t\tthis.params.type = item.value\n\t\t\t\t}\n\t\t\t})\n\t\t\tif (typeof this.params.rightOption == 'object') {\n\t\t\t\tthis.params.rightOption = this.params.rightOption.toString()\n\t\t\t}\n\t\t\tthis.params.subId = this.subject\n\t\t\tthis.$refs.formInfo.validate(valid => {\n\t\t\t\tif (valid) {\n\t\t\t\t\tlet method\n\t\t\t\t\tif (this.title === '新增') {\n\t\t\t\t\t\tmethod = questionListMenu.addQuestions\n\t\t\t\t\t}\n\t\t\t\t\tif (this.title === '修改') {\n\t\t\t\t\t\tmethod = questionListMenu.editQuestions\n\t\t\t\t\t}\n\t\t\t\t\tmethod(this.params, response => {\n\t\t\t\t\t\tif (response.state) {\n\t\t\t\t\t\t\tthis.$notify({\n\t\t\t\t\t\t\t\ttype: 'success',\n\t\t\t\t\t\t\t\tmessage: this.title + '成功',\n\t\t\t\t\t\t\t\tduration: 2000\n\t\t\t\t\t\t\t})\n\t\t\t\t\t\t\tif (val == 1) {\n\t\t\t\t\t\t\t\tthis.params.options = [{\n\t\t\t\t\t\t\t\t\toptionContent: \"\",\n\t\t\t\t\t\t\t\t\toptionKey: \"A\",\n\t\t\t\t\t\t\t\t}, {\n\t\t\t\t\t\t\t\t\toptionContent: \"\",\n\t\t\t\t\t\t\t\t\toptionKey: \"B\",\n\t\t\t\t\t\t\t\t}, {\n\t\t\t\t\t\t\t\t\toptionContent: \"\",\n\t\t\t\t\t\t\t\t\toptionKey: \"C\",\n\t\t\t\t\t\t\t\t}, {\n\t\t\t\t\t\t\t\t\toptionContent: \"\",\n\t\t\t\t\t\t\t\t\toptionKey: \"D\",\n\t\t\t\t\t\t\t\t}]\n\t\t\t\t\t\t\t\tthis.params.parsing = ''\n\t\t\t\t\t\t\t\tthis.params.question = ''\n\t\t\t\t\t\t\t\tif (this.params.type == 2) {\n\t\t\t\t\t\t\t\t\tthis.params.rightOption = []\n\t\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\t\tthis.params.rightOption = ''\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t} else if (val == 2) {\n\t\t\t\t\t\t\t\tthis.handleClose()\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\tthis.$message.warning(response.message)\n\t\t\t\t\t\t}\n\t\t\t\t\t})\n\t\t\t\t}\n\t\t\t})\n\t\t},\n\t\t//继续添加\n\t\tcontinueAdd() {\n\n\t\t},\n\t\tqeuploadSuccess(res) {\n\t\t\t// 获取富文本组件实例\n\t\t\tlet quill = this.$refs.QuillEditor.quill\n\t\t\t// 如果上传成功\n\t\t\tif (res) {\n\t\t\t\t// 获取光标所在位置\n\t\t\t\tlet fileId = res.fileId\n\t\t\t\tlet url = this.previewUrl + fileId\n\t\t\t\tlet length = quill.getSelection().index\n\t\t\t\t// 插入图片,res为服务器返回的图片链接地址\n\t\t\t\tquill.insertEmbed(length, 'image', url)\n\t\t\t\t// 调整光标到最后\n\t\t\t\tquill.setSelection(length + 1)\n\t\t\t} else {\n\t\t\t\t// 提示信息,需引入Message\n\t\t\t\tthis.$message.error('图片插入失败!')\n\t\t\t}\n\t\t},\n\t\tbeforeUpload(file) {\n\t\t\treturn true\n\t\t},\n\t\t// 失去焦点\n\t\tonEditorBlur(editor) {},\n\t\t// 获得焦点\n\t\tonEditorFocus(editor) {},\n\t\t// 开始\n\t\tonEditorReady(editor) {},\n\t\t// 值发生变化\n\t\tonEditorChange(editor) {},\n\n\t},\n}\n",null]}