|
@@ -3576,7 +3576,7 @@
|
|
|
:append-to-body="true"
|
|
|
width="100%"
|
|
|
:before-close="handleClose"
|
|
|
- class="dialog_diy lineCss"
|
|
|
+ class="dialog_diy source_diy"
|
|
|
>
|
|
|
<div>
|
|
|
<sourceDialog @update="updateSourceData"></sourceDialog>
|
|
@@ -3855,7 +3855,10 @@
|
|
|
<el-input v-model="testJson.testTitle" placeholder="请输入标题" style="width: 400px"></el-input>
|
|
|
</div> -->
|
|
|
<div class="a_addBox">
|
|
|
- <div style="font-size: 16px; color: #c7c7c7">请输入题目内容</div>
|
|
|
+ <div style="font-size: 16px; color: #c7c7c7">
|
|
|
+ 请输入题目内容
|
|
|
+ <el-button type="primary" size="small" @click="pasteOption" style="margin-left:10px">粘贴题目</el-button>
|
|
|
+ </div>
|
|
|
<div
|
|
|
class="a_add_box"
|
|
|
v-for="(item1, index1) in testJson.testCount"
|
|
@@ -5881,18 +5884,22 @@ export default {
|
|
|
this.sourceData = data
|
|
|
},
|
|
|
addSource(){
|
|
|
- if(!this.sourceData.id){
|
|
|
+ if(!Object.keys(this.sourceData).length){
|
|
|
this.$message.error("请选择要上传的资源")
|
|
|
return;
|
|
|
}
|
|
|
- this.unitJson[this.unitIndex].chapterInfo[0].taskJson[
|
|
|
- this.lineCount
|
|
|
- ].chapterData.push({
|
|
|
- name: "链接",
|
|
|
- title: this.sourceData.name,
|
|
|
- url: this.sourceData.url,
|
|
|
- type: 8,
|
|
|
- });
|
|
|
+ let keys = Object.keys(this.sourceData)
|
|
|
+ for(var i = 0;i<keys.length;i++){
|
|
|
+ this.unitJson[this.unitIndex].chapterInfo[0].taskJson[
|
|
|
+ this.lineCount
|
|
|
+ ].chapterData.push({
|
|
|
+ name: "链接",
|
|
|
+ title: this.sourceData[keys[i]].name,
|
|
|
+ url: this.sourceData[keys[i]].url,
|
|
|
+ type: 8,
|
|
|
+ });
|
|
|
+ }
|
|
|
+ this.$forceUpdate();
|
|
|
this.dialogVisibleSource = false;
|
|
|
},
|
|
|
deleteM(i, j) {
|
|
@@ -8068,6 +8075,47 @@ export default {
|
|
|
this.addTools(45, this.taskCount, this.toolIndex);
|
|
|
}
|
|
|
},
|
|
|
+ //自动获取剪贴板
|
|
|
+ pasteOption() {
|
|
|
+ let copyData = top.document.querySelectorAll("#AIChat iframe")[0].contentWindow.copyData
|
|
|
+ if(!copyData || !copyData.selectData.length){
|
|
|
+ this.$message.error("请使用AI共创生成题目")
|
|
|
+ return;
|
|
|
+ }
|
|
|
+ let selectData = copyData.selectData;
|
|
|
+ for(var i = 0;i<selectData.length;i++){
|
|
|
+ let answer = 0
|
|
|
+ switch (selectData[i].answer[0]) {
|
|
|
+ case 'A':
|
|
|
+ answer = 0
|
|
|
+ break;
|
|
|
+ case 'B':
|
|
|
+ answer = 1
|
|
|
+ break;
|
|
|
+ case 'C':
|
|
|
+ answer = 2
|
|
|
+ break;
|
|
|
+ case 'D':
|
|
|
+ answer = 3
|
|
|
+ break;
|
|
|
+ case 'E':
|
|
|
+ answer = 4
|
|
|
+ break;
|
|
|
+ default:
|
|
|
+ break;
|
|
|
+ }
|
|
|
+ this.testJson.testJson.push({
|
|
|
+ teststitle: selectData[i].subject,
|
|
|
+ testItem: selectData[i].length,
|
|
|
+ checkList: selectData[i].options,
|
|
|
+ timuList: [],
|
|
|
+ answer: answer,
|
|
|
+ type: "1",
|
|
|
+ });
|
|
|
+ this.testJson.testCount++;
|
|
|
+ }
|
|
|
+ this.$forceUpdate();
|
|
|
+ },
|
|
|
addAnswer() {
|
|
|
if (this.answerQ == "") {
|
|
|
this.$message.error("请输入您想要问的问题");
|
|
@@ -9339,6 +9387,16 @@ export default {
|
|
|
padding: 20px 20px;
|
|
|
}
|
|
|
|
|
|
+.source_diy >>> .el-dialog{
|
|
|
+ height: 100% !important;
|
|
|
+ margin: 0 auto !important;
|
|
|
+}
|
|
|
+
|
|
|
+.source_diy .el-dialog__body{
|
|
|
+ height: calc(100% - 185px);
|
|
|
+ overflow: auto;
|
|
|
+}
|
|
|
+
|
|
|
.left {
|
|
|
border-right: 1px solid rgb(60, 94, 143);
|
|
|
display: flex;
|
|
@@ -10524,6 +10582,7 @@ ol {
|
|
|
margin-top: 10px;
|
|
|
display: flex;
|
|
|
font-size: 16px;
|
|
|
+ align-items: center;
|
|
|
}
|
|
|
|
|
|
.a_add_checkType span {
|