lsc 1 year ago
parent
commit
02df65c2f3

+ 1 - 1
dist/index.html

@@ -25,7 +25,7 @@
       height: 100%;
       width: 100%;
       background: #e6eaf0;
-    }</style><link href=./static/css/app.0851ea4a48bfe40c357a7b315016a6ad.css rel=stylesheet></head><body><div id=app></div><script type=text/javascript src=./static/js/manifest.3512a67a6213c2df4180.js></script><script type=text/javascript src=./static/js/vendor.b01159b52abeac4e6216.js></script><script type=text/javascript src=./static/js/app.ef074665431374c28319.js></script></body></html><script>function stopSafari() {
+    }</style><link href=./static/css/app.58a6b41197bea4871a9880be0e71c882.css rel=stylesheet></head><body><div id=app></div><script type=text/javascript src=./static/js/manifest.3512a67a6213c2df4180.js></script><script type=text/javascript src=./static/js/vendor.b01159b52abeac4e6216.js></script><script type=text/javascript src=./static/js/app.fe4284aa32465342a4e0.js></script></body></html><script>function stopSafari() {
     //阻止safari浏览器双击放大功能
     let lastTouchEnd = 0  //更新手指弹起的时间
     document.documentElement.addEventListener("touchstart", function (event) {

File diff suppressed because it is too large
+ 0 - 0
dist/static/css/app.0851ea4a48bfe40c357a7b315016a6ad.css


File diff suppressed because it is too large
+ 0 - 0
dist/static/css/app.0851ea4a48bfe40c357a7b315016a6ad.css.map


File diff suppressed because it is too large
+ 0 - 0
dist/static/css/app.58a6b41197bea4871a9880be0e71c882.css


File diff suppressed because it is too large
+ 0 - 0
dist/static/css/app.58a6b41197bea4871a9880be0e71c882.css.map


File diff suppressed because it is too large
+ 0 - 0
dist/static/js/app.ef074665431374c28319.js


File diff suppressed because it is too large
+ 0 - 0
dist/static/js/app.fe4284aa32465342a4e0.js


File diff suppressed because it is too large
+ 0 - 0
dist/static/js/app.fe4284aa32465342a4e0.js.map


File diff suppressed because it is too large
+ 0 - 0
dist/static/js/manifest.3512a67a6213c2df4180.js.map


BIN
src/assets/icon/test/type_page_icon.png


+ 1 - 0
src/components/pages/dataBoardNew/course/index.vue

@@ -1427,6 +1427,7 @@ export default {
         })
         .catch((err) => {
           this.isLoading = false;
+          this.$message.error('因加载数据量过大,服务器统计异常,请联系管理员。');
           console.error(err);
         });
     },

+ 1 - 0
src/components/pages/dataBoardNew/project/index.vue

@@ -750,6 +750,7 @@ export default {
         })
         .catch((err) => {
           this.isLoading = false;
+          this.$message.error('因加载数据量过大,服务器统计异常,请联系管理员。');
           console.error(err);
         });
     },

+ 1 - 0
src/components/pages/dataBoardNew/school/index.vue

@@ -935,6 +935,7 @@ export default {
         })
         .catch((err) => {
           this.isLoading = false;
+          this.$message.error('因加载数据量过大,服务器统计异常,请联系管理员。');
           console.error(err);
         });
     },

+ 1 - 0
src/components/pages/dataBoardNew/student/index.vue

@@ -1051,6 +1051,7 @@ export default {
         })
         .catch((err) => {
           this.rankLoading = false;
+          this.$message.error('因加载数据量过大,服务器统计异常,请联系管理员。');
           console.error(err);
         });
     },

+ 1 - 0
src/components/pages/dataBoardNew/teacher/index.vue

@@ -970,6 +970,7 @@ export default {
         })
         .catch((err) => {
           this.isLoading = false;
+          this.$message.error('因加载数据量过大,服务器统计异常,请联系管理员。');
           console.error(err);
         });
     },

+ 163 - 77
src/components/pages/student/addCourse.vue

@@ -877,7 +877,7 @@
                           padding: 0 0 15px 0;
                           border-bottom: 1px solid #efefef;
                           margin-bottom: 15px;
-                        " v-for="(itemTool, toolIndex) in itemTask.toolArray" :key="toolIndex">
+                        " v-for="(itemTool, toolIndex) in itemTask.toolArray" :key="toolIndex" v-loading="downLoading == 'down'+toolIndex">
                         <div style="
                             display: flex;
                             flex-direction: row;
@@ -1135,7 +1135,7 @@
                                       <div class="vedioTimeBox" v-for="(
                                         chapter, cIndex
                                       ) in itemTool.toolData" :key="cIndex + '1'"
-                                        @click="setChapterIndex(itemTool, cIndex)">
+                                        @click="setChapterIndex(itemTool, cIndex, toolIndex)">
                                         <div class="vedioName" :class="{
                                           isClickNav:
                                             itemTool.sourceIndex == cIndex,
@@ -1169,7 +1169,7 @@
                                     .type == 9
                                   " type="primary" @click="
                                 downloadFile(
-                                  itemTool.toolData[itemTool.sourceIndex].src
+                                  itemTool.toolData[itemTool.sourceIndex].src,toolIndex
                                 )
                                 ">文件下载</el-button>
                                 <el-button v-if="itemTool.toolData[itemTool.sourceIndex]
@@ -1225,7 +1225,7 @@
                               openAsk(photo.content, itemTaskIndex, toolIndex)
                               " />
                             <img v-if="photo.type == 13" src="../../../assets/icon/zip.png" alt=""
-                              @click="downloadFile(photo.content)" />
+                              @click="downloadFile(photo.content, toolIndex)" />
                             <img v-if="photo.type == 5" src="../../../assets/icon/isVideo.png" alt=""
                               @click="openVideo(photo.content)" />
                             <img class="deleteImg" src="../../../assets/deleteworks.png" v-if="photo.userid == userid &&
@@ -2868,7 +2868,8 @@ export default {
       total: 0,
       page: 0,
       sourceData: {},
-      updateWorkJson: {}
+      updateWorkJson: {},
+      downLoading: ''
     };
   },
   computed: {
@@ -3966,12 +3967,13 @@ export default {
       this.$forceUpdate();
       this.dialogVisibleSource2 = false;
     },
-    downloadFile2(f) {
-      const loading = this.$loading.service({
-        background: "rgba(255, 255, 255, 0.7)",
-        target: document.body,
-        text: "文件加载中...",
-      });
+    downloadFile2(f,toolIndex) {
+      var credentials = {
+        accessKeyId: "AKIATLPEDU37QV5CHLMH",
+        secretAccessKey: "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",
+      }; //秘钥形式的登录上传
+      window.AWS.config.update(credentials);
+      window.AWS.config.region = "cn-northwest-1"; //设置区域
       let url2 = f.url;
       let _url2 = "";
       if (
@@ -3983,35 +3985,76 @@ export default {
       } else {
         _url2 = url2;
       }
-      let params = {
-        url: _url2,
-        name: f.name,
+      let _this = this;
+
+      _this.downLoading = 'down'+toolIndex
+      var s3 = new window.AWS.S3({ params: { Bucket: "ccrb" } });
+      let name = decodeURIComponent(decodeURIComponent(_url2).split("https://ccrb.s3.cn-northwest-1.amazonaws.com.cn/")[1])
+      var params = {
+        Bucket: "ccrb",
+        Key: name
       };
-      this.ajax
-        .get(this.$store.state.api + "download", params)
-        .then((res) => {
-          loading.close();
-          let content = res.data.data.data;
-          let ab = new ArrayBuffer(content.length);
-          let view = new Uint8Array(ab);
-          for (var i = 0; i < content.length; ++i) {
-            view[i] = content[i];
-          }
-          let elink = document.createElement("a");
-          elink.download = f.name;
-          elink.style.display = "none";
-          let blob = new Blob([ab], {
-            type: res.data.response.headers["content-type"] + ";charset=UTF-8",
-          });
-          elink.href = URL.createObjectURL(blob);
-          document.body.appendChild(elink);
-          elink.click();
-          document.body.removeChild(elink);
-        })
-        .catch((err) => {
-          loading.close();
-          console.error(err);
-        });
+      s3.getObject(params, function (err, data) {
+        _this.downLoading = ''
+        if (err) console.log(err, err.stack); // an error occurred
+        else {
+          let url = window.URL.createObjectURL(new Blob([data.Body]));
+          let a = document.createElement("a");
+          a.name = f.name;
+          a.href = url;
+          a.download = f.name;
+          a.click();
+          console.log(data); 
+        }          // sxuccessful response
+
+      });
+      
+      return;
+      // const loading = this.$loading.service({
+      //   background: "rgba(255, 255, 255, 0.7)",
+      //   target: document.body,
+      //   text: "文件加载中...",
+      // });
+      // let url2 = f.url;
+      // let _url2 = "";
+      // if (
+      //   url2.indexOf("https://view.officeapps.live.com/op/view.aspx?src=") != -1
+      // ) {
+      //   _url2 = url2.split(
+      //     "https://view.officeapps.live.com/op/view.aspx?src="
+      //   )[1];
+      // } else {
+      //   _url2 = url2;
+      // }
+      // let params = {
+      //   url: _url2,
+      //   name: f.name,
+      // };
+      // this.ajax
+      //   .get(this.$store.state.api + "download", params)
+      //   .then((res) => {
+      //     loading.close();
+      //     let content = res.data.data.data;
+      //     let ab = new ArrayBuffer(content.length);
+      //     let view = new Uint8Array(ab);
+      //     for (var i = 0; i < content.length; ++i) {
+      //       view[i] = content[i];
+      //     }
+      //     let elink = document.createElement("a");
+      //     elink.download = f.name;
+      //     elink.style.display = "none";
+      //     let blob = new Blob([ab], {
+      //       type: res.data.response.headers["content-type"] + ";charset=UTF-8",
+      //     });
+      //     elink.href = URL.createObjectURL(blob);
+      //     document.body.appendChild(elink);
+      //     elink.click();
+      //     document.body.removeChild(elink);
+      //   })
+      //   .catch((err) => {
+      //     loading.close();
+      //     console.error(err);
+      //   });
     },
     pasteLine(i) {
       navigator.clipboard
@@ -5181,9 +5224,9 @@ export default {
       this.taskCount = itemTaskIndex;
       this.dialogVisibleSource = true;
     },
-    setChapterIndex(itemTool, index) {
+    setChapterIndex(itemTool, index, toolIndex) {
       if (itemTool.toolData[index].type == 12) {
-        this.downloadFile2(itemTool.toolData[index])
+        this.downloadFile2(itemTool.toolData[index], toolIndex)
         return;
       }
       itemTool.sourceIndex = index;
@@ -5270,6 +5313,7 @@ export default {
       this.sourcesData = [];
       this.dialogVisibleSource = false;
       this.dialogVisibleTool = false;
+      this.$forceUpdate();
       this.setVHeight();
     },
     openToolFun(tool, taskCount, i) {
@@ -8243,49 +8287,91 @@ export default {
       this.fulltype = type;
       this.fullUrl = url;
     },
-    downloadFile(url) {
-      let _this = this;
-      let _url = "";
+    downloadFile(url, toolIndex) {
+      var credentials = {
+        accessKeyId: "AKIATLPEDU37QV5CHLMH",
+        secretAccessKey: "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",
+      }; //秘钥形式的登录上传
+      window.AWS.config.update(credentials);
+      window.AWS.config.region = "cn-northwest-1"; //设置区域
+      let url2 = url;
+      let _url2 = "";
       if (
-        url.indexOf("https://view.officeapps.live.com/op/view.aspx?src=") != -1
+        url2.indexOf("https://view.officeapps.live.com/op/view.aspx?src=") != -1
       ) {
-        _url = url.split(
+        _url2 = url2.split(
           "https://view.officeapps.live.com/op/view.aspx?src="
         )[1];
       } else {
-        _url = url;
+        _url2 = url2;
       }
-      const x = new XMLHttpRequest();
-      x.open("GET", _url, true);
-      x.responseType = "blob";
-      const loading = _this.$loading.service({
-        background: "rgba(255, 255, 255, 0.7)",
-        target: document.body,
-        text: '文件加载中...'
-      });
-      // _this.$message.success("文件下载中...");
-      x.onload = function (e) {
-        loading.close();
-        // const url = window.URL.createObjectURL(x.response);
-        // const a = document.createElement("a");
-        // a.href = url;
-        // a.target = "_blank";
-        // a.download = url;
-        // a.click();
-        // a.remove();
-        let content = x.response;
-        let elink = document.createElement("a");
-        elink.download = decodeURI(
-          _url.split("https://ccrb.s3.cn-northwest-1.amazonaws.com.cn/")[1]
-        );
-        elink.style.display = "none";
-        let blob = new Blob([content]);
-        elink.href = URL.createObjectURL(blob);
-        document.body.appendChild(elink);
-        elink.click();
-        document.body.removeChild(elink);
+      let _this = this;
+
+      _this.downLoading = 'down'+toolIndex
+      var s3 = new window.AWS.S3({ params: { Bucket: "ccrb" } });
+      let name = decodeURIComponent(decodeURIComponent(_url2).split("https://ccrb.s3.cn-northwest-1.amazonaws.com.cn/")[1])
+      var params = {
+        Bucket: "ccrb",
+        Key: name
       };
-      x.send();
+      s3.getObject(params, function (err, data) {
+        _this.downLoading = ''
+        if (err) console.log(err, err.stack); // an error occurred
+        else {
+          let url = window.URL.createObjectURL(new Blob([data.Body]));
+          let a = document.createElement("a");
+          a.name = name;
+          a.href = url;
+          a.download = name;
+          a.click();
+          console.log(data); 
+        }          // sxuccessful response
+
+      });
+      
+      return;
+      // let _this = this;
+      // let _url = "";
+      // if (
+      //   url.indexOf("https://view.officeapps.live.com/op/view.aspx?src=") != -1
+      // ) {
+      //   _url = url.split(
+      //     "https://view.officeapps.live.com/op/view.aspx?src="
+      //   )[1];
+      // } else {
+      //   _url = url;
+      // }
+      // const x = new XMLHttpRequest();
+      // x.open("GET", _url, true);
+      // x.responseType = "blob";
+      // const loading = _this.$loading.service({
+      //   background: "rgba(255, 255, 255, 0.7)",
+      //   target: document.body,
+      //   text: '文件加载中...'
+      // });
+      // // _this.$message.success("文件下载中...");
+      // x.onload = function (e) {
+      //   loading.close();
+      //   // const url = window.URL.createObjectURL(x.response);
+      //   // const a = document.createElement("a");
+      //   // a.href = url;
+      //   // a.target = "_blank";
+      //   // a.download = url;
+      //   // a.click();
+      //   // a.remove();
+      //   let content = x.response;
+      //   let elink = document.createElement("a");
+      //   elink.download = decodeURI(
+      //     _url.split("https://ccrb.s3.cn-northwest-1.amazonaws.com.cn/")[1]
+      //   );
+      //   elink.style.display = "none";
+      //   let blob = new Blob([content]);
+      //   elink.href = URL.createObjectURL(blob);
+      //   document.body.appendChild(elink);
+      //   elink.click();
+      //   document.body.removeChild(elink);
+      // };
+      // x.send();
     },
     editSourceUpadte(taskCount, index) {
       this.taskCount = taskCount;

+ 5 - 3
src/components/pages/test/add/addTest.vue

@@ -25,7 +25,7 @@
                 </div>
                 <div class="step_box" :style="{ width: steps == 2 && '100%' }">
                     <setInfo v-if="steps == 1 && !loading" :oid="oid" :org="org" :steps.sync="steps" :title.sync="title"
-                        :testType.sync="testType" :see.sync="see" :cJson.sync="cJson" :typeid.sync="typeid" :brief.sync="brief"></setInfo>
+                        :testType.sync="testType" :see.sync="see" :cJson.sync="cJson" :typeid.sync="typeid" :brief.sync="brief" :juri.sync="juri"></setInfo>
                     <editInfo v-if="steps == 2 && !loading" :oid="oid" :org="org" :steps.sync="steps" :title.sync="title"
                         :cJson.sync="cJson" @save="save" @publish="publish"></editInfo>
                 </div>
@@ -57,6 +57,7 @@ export default {
             look:"",
             typeid:"",
             brief:"",
+            juri:'0',
         }
     },
     watch: {
@@ -126,7 +127,7 @@ export default {
                     brief: this.brief.replace(/%/g, "%25"),
                     cover: "",
                     evaId: "",
-                    astudent: "",
+                    astudent: this.juri,
                     see: this.see == true ? 1 : 0,
                     chapters: JSON.stringify(this.cJson).replaceAll(/%/g, "%25"),
                     template: "",
@@ -170,7 +171,7 @@ export default {
                     brief: this.brief.replace(/%/g, "%25"),
                     cover: "",
                     evaId: "",
-                    astudent: "",
+                    astudent: this.juri,
                     see: this.see == true ? 1 : 0,
                     chapters: JSON.stringify(this.cJson).replaceAll(/%/g, "%25"),
                     uid: this.userid,
@@ -237,6 +238,7 @@ export default {
                     .then((res) => {
                         this.cJson = JSON.parse(res.data[0][0].chapters);
                         this.title = res.data[0][0].title;
+                        this.juri = res.data[0][0].juri ? res.data[0][0].juri : '0';
 
                         this.see = res.data[0][0].open == 1 ? true : false;
 

+ 363 - 0
src/components/pages/test/add/setInfo/aiCreate2.vue

@@ -0,0 +1,363 @@
+<template>
+  <div v-loading="loading" style="width: 100%;">
+    <div>
+      <div class="ex_box">
+        <span>例子:</span>
+        <el-button type="primary" size="mini" @click="checkExample('1')">选择题</el-button>
+        <el-button type="primary" size="mini" @click="checkExample('2')">问答题</el-button>
+      </div>
+      <div class="ac_box">
+        <!-- <el-input v-autoHeight="75" v-model="text" placeholder="请在这里输入要发送的消息" size="normal" type="textarea" resize="none"
+          :rows="3"></el-input> -->
+          <textarea v-autoHeight="75" rows="3" class="binfo_input binfo_textarea" cols v-model="text" placeholder="请在这里输入要发送的消息"></textarea>
+          <el-button type="primary" size="mini" @click="generate" style="margin-left:10px">生成</el-button>
+      </div>
+      <div class="ac_content" v-if="aiCreate.length">
+        <div class="title">生成内容:</div>
+        <div class="box" v-if="aiType == 1">
+          <div v-for="(item, index) in aiCreate" :key="index" class="choice">
+            <div class="title">{{ `${index + 1}:${item.title}` }}</div>
+            <div class="options">
+              <span v-for="(option, oIndex) in item.options" :key="`${index}-${oIndex}`">{{ option }}</span>
+            </div>
+            <div class="answer">{{ `答案:${item.answer}` }}</div>
+          </div>
+        </div>
+        <div class="box" v-if="aiType == 3">
+          <div v-for="(item, index) in aiCreate" :key="index" class="choice">
+            <div class="title">{{ `${index + 1}:${item.title}` }}</div>
+            <div class="answer">{{ `答案:${item.answer}` }}</div>
+          </div>
+        </div>
+      </div>
+    </div>
+    <el-button type="primary" @click="exportT" size="mini">导入</el-button>
+  </div>
+</template>
+
+<script>
+
+export default {
+  props: {
+    aiJson: {
+      type: Array,
+    },
+  },
+  directives: {
+    autoHeight: {
+      update(el, binding) {
+        const { value } = binding
+        if (value && typeof value === 'number') {
+          el.style.height = `${value}px`
+        } else {
+          el.style.height = 'auto'
+        }
+      },
+      componentUpdated(el) {
+        el.style.height = `${el.scrollHeight + 5}px`
+      },
+    },
+  },
+  data() {
+    return {
+      example: {
+        '1': {
+          'title': '请你以富文本的形式给我出三个关于小学数学单位换算的选择题,每个选择题选项不少于4个,需要答案,但不需要解释,符号请使用中文的'
+        },
+        '2': {
+          'title': '请你以富文本的形式给我出三个关于三年级语文知识问答的问答题,需要答案,但不需要解释'
+        }
+      },
+      text: "",
+      aiCreate: [],
+      aiType: "",
+      loading: false
+    }
+  },
+  methods: {
+    checkExample(type) {
+      this.text += this.example[type].title
+    },
+    guid() {
+      var _num,
+        i,
+        _guid = "";
+      for (i = 0; i < 32; i++) {
+        _guid += Math.floor(Math.random() * 16).toString(16); //随机0  - 16 的数字 转变为16进制的字符串
+        _num = Math.floor((i - 7) / 4); //计算 (i-7)除4
+        if (_num > -1 && _num < 4 && i == 7 + 4 * _num) {
+          //会使guid中间加 "-"   形式为xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx
+          _guid += "-";
+        }
+      }
+      return _guid;
+    },
+    generate() {
+      if (this.text == "") {
+        this.$message.error("请输入要发送的消息")
+        return
+      }
+      // else if (this.text.indexOf("添加文档") !== -1) {
+      //   this.aiType = 4
+      // }
+      if (this.text.indexOf("选择题") !== -1) {
+        this.aiType = 1
+      } else if (this.text.indexOf("问答题") !== -1) {
+        this.aiType = 3
+      } else {
+        this.$message.error("生成的文字中要包含选择题或者问答题才能生成题目哦,请重新编辑下吧")
+        return
+      }
+
+      if(this.text.indexOf("选择题") !== -1 && this.text.indexOf("问答题") !== -1){
+        this.$message.error("目前暂不支持问答题和选择题一起创建")
+        return
+      }
+      this.loading = true
+      let param = {
+        model: "gpt-3.5-turbo",
+        temperature: 0,
+        max_tokens: 2048,
+        top_p: 1,
+        frequency_penalty: 0,
+        presence_penalty: 0,
+        messages: [
+          {
+            role: "user",
+            content: this.text,
+          },
+        ],
+        uid: this.guid(),
+        stream: false,
+      };
+      this.ajax.post("https://gpt.cocorobo.cn/chat", param).then(
+        (res) => {
+          if (
+            res.data.FunctionResponse &&
+            res.data.FunctionResponse.result &&
+            res.data.FunctionResponse.result == "无效请求,请重新发起对话"
+          ) {
+            this.$message.error("你的内容太长,无法使用Ai创建!");
+            this.loading = false
+            return;
+          }
+          let aiReturn = res.data.FunctionResponse.choices[0].message.content;
+          aiReturn = aiReturn.split("\n")
+          aiReturn = aiReturn.filter(e => e != "")
+          this.loading = false
+          this.generate2(aiReturn)
+        },
+        (err) => {
+          console.log(err);
+          this.loading = false
+        }
+      );
+    },
+    generate2(aiReturn) {
+      this.loading = true
+      let content = ''
+      if (this.aiType == 1) {
+        content = `${JSON.stringify(aiReturn)},要求返回格式是Array [{"title":"",options:[],answer:[]}]`
+      } else if (this.aiType == 3) {
+        content = `${JSON.stringify(aiReturn)},要求返回格式是Array [{title: "",answer: ""}]`
+      }
+      let param = {
+        model: "gpt-3.5-turbo",
+        temperature: 0,
+        max_tokens: 2048,
+        top_p: 1,
+        frequency_penalty: 0,
+        presence_penalty: 0,
+        messages: [
+          {
+            role: "user",
+            content: content
+          },
+        ],
+        uid: this.guid(),
+        stream: false,
+      };
+      this.ajax.post("https://gpt.cocorobo.cn/chat", param).then(
+        (res) => {
+          if (
+            res.data.FunctionResponse &&
+            res.data.FunctionResponse.result &&
+            res.data.FunctionResponse.result == "无效请求,请重新发起对话"
+          ) {
+            this.$message.error("你的内容太长,无法使用Ai创建!");
+            this.loading = false
+            return;
+          }
+          let aiCreate = res.data.FunctionResponse.choices[0].message.content;
+          try {
+            aiCreate = JSON.parse(aiCreate)
+          } catch (error) {
+            this.generate2(aiReturn)
+          }
+          console.log(aiCreate)
+          this.aiCreate = aiCreate;
+          this.loading = false
+        },
+        (err) => {
+          console.log(err);
+          this.loading = false
+        }
+      );
+    },
+    exportT() {
+      if (!this.aiCreate.length) {
+        this.$message.error("请先创建Ai内容!");
+        return;
+      }
+      if (this.aiType !== 1 && this.aiType !== 3) {
+        this.$message.error("目前只支持选择题/问答题的创建!输入内容必须包含选择题/问答题!");
+        return;
+      }
+      var json = JSON.parse(JSON.stringify(this.aiJson))
+      let array = []
+      let englishIndex = ['A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'I', 'J', 'K', 'L', 'M', 'N', 'O', 'P', 'Q', 'R', 'S', 'T', 'U', 'V', 'W', 'X', 'Y', 'Z']
+      if (this.aiType === 1) {
+        for (var i = 0; i < this.aiCreate.length; i++) {
+          let answer = []
+          let type = 1
+          if (this.aiCreate[i].answer) {
+            if (this.aiCreate[i].answer.length > 1) {
+              type = 2
+              for (var j = 0; j < this.aiCreate[i].answer.length; j++) {
+                answer.push(englishIndex.indexOf(this.aiCreate[i].answer[j].toLocaleUpperCase()))
+              }
+            } else {
+              answer = [englishIndex.indexOf(this.aiCreate[i].answer[0].toLocaleUpperCase())]
+            }
+          }
+
+          let options = []
+          for (var j = 0; j < this.aiCreate[i].options.length; j++) {
+            options.push({
+              img: "",
+              option: this.aiCreate[i].options[j]
+            })
+          }
+          array.push(
+            {
+              json: {
+                answer: answer,
+                array: options,
+                title: this.aiCreate[i].title,
+                type: type
+              },
+              ttype: 1,
+              type: 1
+            }
+          )
+        }
+      } else if (this.aiType === 3) {
+        for (var i = 0; i < this.aiCreate.length; i++) {
+          array.push(
+            {
+              json: {
+                answer: this.aiCreate[i].answer,
+                title: this.aiCreate[i].title,
+                type: 1
+              },
+              ttype: 1,
+              type: 3
+            }
+          )
+        }
+      }
+      if (!json.length || json[0].ttype == 1) {
+        json = [...json, ...array]
+      } else if ((json[0].ttype == 2 || json[0].ttype == 3) && !json[0].array.length) {
+        json[0].array = array
+      } else if (json[0].ttype == 2 && json[0].array.length) {
+        json[0].array = [...json[0].array, ...array]
+      } else if (json[0].ttype == 3 && json[0].array.length) {
+        if (json[0].array[0].ttype == 2) {
+          json[0].array[0].array = [...json[0].array[0].array, ...array]
+        } else {
+          json[0].array = [...json[0].array, ...array]
+        }
+      }
+      this.$emit("changeJson", json)
+      this.aiCreate = []
+    }
+  },
+}
+</script>
+
+<style scoped>
+.ac_box {
+  display: flex;
+  width: 100%;
+  align-items: flex-end;
+  margin-bottom: 10px;
+}
+
+.ex_box {
+  margin-bottom: 10px;
+  color: #909090;
+  font-size: 14px;
+}
+
+.ac_content {
+  margin-bottom: 10px;
+  font-size: 14px;
+}
+
+.ac_content>.title {
+  margin-bottom: 10px;
+}
+
+.ac_content>.box {}
+
+.ac_content>.box>.choice+.choice {
+  margin-top: 10px;
+}
+
+.ac_content>.box>.choice>div+div {
+  margin-top: 10px;
+}
+
+.ac_content>.box>.choice>.options {
+  display: flex;
+  flex-wrap: wrap;
+}
+
+.ac_content>.box>.choice>.options>span {
+  margin-right: 10px;
+  margin-bottom: 5px;
+}
+
+.binfo_input {
+    width: 100%;
+    margin: 0;
+    padding: 12px 14px;
+    display: block;
+    min-width: 0;
+    outline: none;
+    box-sizing: border-box;
+    background: none;
+    border: none;
+    border-radius: 4px;
+    background: #fff;
+    font-size: 14px;
+    resize: none;
+    font-family: 'Microsoft YaHei';
+    min-height: 48px;
+    /* border: 1px solid #3682fc00; */
+    border: 1px solid #CAD1DC;
+}
+
+.binfo_textarea {
+    border: 1px solid #CAD1DC;
+    font-size: 14px;
+    resize: none;
+    /* background: #f6f6f6; */
+    font-family: 'Microsoft YaHei';
+}
+
+.binfo_input:focus-visible {
+    border: 1px solid #3681FC !important;
+}
+</style>

+ 18 - 3
src/components/pages/test/add/setInfo/index.vue

@@ -19,13 +19,20 @@
                                     </div>
                                 </div>
                             </div>
+                            <div class="typeBox">
+                                <span>权限:</span>
+                                <el-select v-model="sJuri" placeholder="权限" @change="juriChange">
+                                    <el-option label="所有人" value="0"></el-option>
+                                    <el-option label="老师" value="1"></el-option>
+                                    <el-option label="学生" value="2"></el-option>
+                                </el-select>
+                            </div>
                             <div class="typeBox" v-if="typeArray.length">
                                 <span>类型:</span>
                                 <el-select v-model="typeCheck" placeholder="选择类型" clearable @change="typeChange2">
                                     <el-option v-for="(item, index) in typeArray" :key="index" :label="item.name"
                                         :value="item.id"></el-option>
                                 </el-select>
-
                             </div>
                             <div class="both">
                                 <div class="choose">
@@ -62,7 +69,7 @@
                         <span :class="{ active: type == 2 }" @click="type = 2">手动创建</span>
                         <!-- <span :class="{ active: type == 3 }" @click="type = 3">题库导入</span> -->
                         <div class="skip_btn">
-                            <el-button type="primary" size="mini" @click="openAiCreate">智能创建</el-button>
+                            <!-- <el-button type="primary" size="mini" @click="openAiCreate">智能创建</el-button> -->
                             <el-button type="primary" size="mini" @click="nextSteps">跳过</el-button>
                         </div>
 
@@ -106,6 +113,9 @@ export default {
         },
         brief:{
             type: String
+        },
+        juri:{
+            type: String
         }
     },
     data() {
@@ -120,6 +130,7 @@ export default {
             aiDialogVisible: false,
             typeArray: [],
             typeCheck: '',
+            sJuri: '',
             courseText: ''
         }
     },
@@ -223,6 +234,9 @@ export default {
         typeChange2(){
             this.$emit("update:typeid", this.typeCheck)
         },
+        juriChange(){
+            this.$emit("update:juri", this.sJuri)
+        },
         briefChange(){
             this.$emit("update:brief", this.courseText)
         },
@@ -252,7 +266,7 @@ export default {
                 .catch((err) => {
                     console.error(err);
                 });
-        }
+        },
     },
     mounted() {
         this.courseTypeId = this.depthCopy(this.testType)
@@ -261,6 +275,7 @@ export default {
         this.manualJson = this.depthCopy(this.cJson)
         this.typeCheck = this.depthCopy(this.typeid)
         this.courseText = this.depthCopy(this.brief)
+        this.sJuri = this.depthCopy(this.juri)
         this.$forceUpdate()
         this.selectAllType();
         this.selectType();

+ 20 - 11
src/components/pages/test/add/setInfo/manualCreated.vue

@@ -18,11 +18,17 @@
                 <div class="btnBox">
                     <!-- <el-button type="primary" size="mini" v-for="item in buttonOptions" :key="item.type" class="e-button"
                         @click="addQtype(item.type)">{{ item.name }}</el-button> -->
-                        <button v-for="item in buttonOptions" :key="item.type" class="pub_test_btn" 
+                    <button v-for="item in buttonOptions" :key="item.type" class="pub_test_btn"
                         :class="{ pub_test_btn_group: item.type == 1, pub_test_btn_page: item.type == 2 }"
                         @click="addQtype(item.type)">{{ item.name }}</button>
                 </div>
             </div>
+            <div class="mc_addBox_add">
+                <div class="title">智能创建</div>
+                <div class="btnBox">
+                    <aiCreate2 :aiJson="manualJson" @changeJson="changeJson"></aiCreate2>
+                </div>
+            </div>
         </div>
         <div class="mc_checkBox">
             <checkOrder :checkC.sync="checkC" :checkJson="checkJson" @changeJson="changeJson"></checkOrder>
@@ -35,12 +41,14 @@
 
 <script>
 import checkOrder from '../components/checkOrder.vue';
+import aiCreate2 from './aiCreate2.vue';
 import minxinVue from '../minxins/minxin';
 
 export default {
-    mixins:[minxinVue],
+    mixins: [minxinVue],
     components: {
         checkOrder,
+        aiCreate2
     },
     props: {
         manualJson: {
@@ -62,8 +70,8 @@ export default {
         };
     },
     watch: {
-        manualJson :{
-            handler: function (newVal, oldVal) { 
+        manualJson: {
+            handler: function (newVal, oldVal) {
                 this.checkJson = this.depthCopy(newVal);
             },
             deep: true,
@@ -131,11 +139,11 @@ export default {
                             this.checkJson[_check[0]].array.push(json)
                         }
                     } else if (type == 3 && _check.length == 1) {
-                        if(this.checkJson[_check[0]].array[0] && this.checkJson[_check[0]].array[0].array){
+                        if (this.checkJson[_check[0]].array[0] && this.checkJson[_check[0]].array[0].array) {
                             for (var i = 0; i < this.number; i++) {
                                 this.checkJson[_check[0]].array[0].array.push(json)
                             }
-                        }else{
+                        } else {
                             for (var i = 0; i < this.number; i++) {
                                 this.checkJson[_check[0]].array.push(json)
                             }
@@ -258,8 +266,8 @@ export default {
         depthCopy(s) {
             return JSON.parse(JSON.stringify(s));
         },
-        
-        nextSteps(){
+
+        nextSteps() {
             this.$emit("nextSteps")
         }
     },
@@ -283,7 +291,8 @@ export default {
     border-radius: 8px;
     padding: 20px 20px;
     box-sizing: border-box;
-    height: 350px;
+    min-height: 350px;
+    height: fit-content;
 }
 
 .mc_addBox_add {}
@@ -300,7 +309,7 @@ export default {
     align-items: center;
 }
 
-.mc_addBox_add .title::before{
+.mc_addBox_add .title::before {
     content: '';
     width: 10px;
     height: 10px;
@@ -346,7 +355,7 @@ export default {
 }
 
 
-.e_btn{
+.e_btn {
     width: 100%;
     margin-top: auto;
     display: flex;

Some files were not shown because too many files changed in this diff