lsc 1 年之前
父节点
当前提交
906b599c8e

+ 1 - 1
dist/index.html

@@ -25,7 +25,7 @@
       height: 100%;
       width: 100%;
       background: #e6eaf0;
-    }</style><link href=./static/css/app.99a86940e1704e3fd9476c59804c35af.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.b99f0ffaf6e2bdd0ae12.js></script><script type=text/javascript src=./static/js/app.32b4a5c6cf90117f45e4.js></script></body></html><script>function stopSafari() {
+    }</style><link href=./static/css/app.00c80ac92914b43a26880448f5d6b7cc.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.b99f0ffaf6e2bdd0ae12.js></script><script type=text/javascript src=./static/js/app.6943b89e81b9a792c731.js></script></body></html><script>function stopSafari() {
     //阻止safari浏览器双击放大功能
     let lastTouchEnd = 0  //更新手指弹起的时间
     document.documentElement.addEventListener("touchstart", function (event) {

文件差异内容过多而无法显示
+ 0 - 0
dist/static/css/app.00c80ac92914b43a26880448f5d6b7cc.css


文件差异内容过多而无法显示
+ 0 - 0
dist/static/css/app.00c80ac92914b43a26880448f5d6b7cc.css.map


文件差异内容过多而无法显示
+ 0 - 0
dist/static/js/app.6943b89e81b9a792c731.js


文件差异内容过多而无法显示
+ 0 - 0
dist/static/js/app.6943b89e81b9a792c731.js.map


文件差异内容过多而无法显示
+ 0 - 0
dist/static/js/manifest.3512a67a6213c2df4180.js.map


+ 8 - 6
src/components/pages/test/add/addTest.vue

@@ -95,22 +95,24 @@ export default {
                         if (this.title == "") {
                             this.$message.error("请补充填写课程名称");
                             return;
-                        }else if(!this.juriList.length){
-                            this.$message.error("请选择权限")
-                            return
                         }else {
                             this.addWork(5);
                         }
+                        // else if(!this.juriList.length){
+                        //     this.$message.error("请选择权限")
+                        //     return
+                        // }
                     } else {
                         if (this.title == "") {
                             this.$message.error("请补充填写课程名称");
                             return;
-                        }else if(!this.juriList.length){
-                            this.$message.error("请选择权限")
-                            return
                         }else {
                             this.updateWork(5);
                         }
+                        // else if(!this.juriList.length){
+                        //     this.$message.error("请选择权限")
+                        //     return
+                        // }
                     }
                 })
                 .catch((v) => {

+ 51 - 2
src/components/pages/test/add/components/choice/index.vue

@@ -10,8 +10,10 @@
                     </el-option>
                 </el-select>
             </div>
-            <div class="set_title">
-                <span>表单问题:</span><el-input v-model="checkJson.title" class="input" placeholder="请输入标题"></el-input>
+            <div class="set_title" style="align-items: flex-start;">
+                <span>表单问题:</span><textarea v-autoHeight="68" rows="2" class="binfo_input binfo_textarea" cols v-model="checkJson.title"
+                    placeholder="请输入标题"></textarea>
+                    <!-- <el-input v-model="checkJson.title" class="input" placeholder="请输入标题"></el-input> -->
             </div>
             <div class="set_title">
                 <span>题目分数:</span><el-input v-model="checkJson.score" class="input" placeholder="请输入分数" style="width: 120px" @change="numberPan"></el-input>
@@ -65,6 +67,21 @@ export default {
             checkJson: {}
         }
     },
+    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`
+            },
+        },
+    },
     watch: {
         checkJson: {
             handler(newVal) {
@@ -245,4 +262,36 @@ export default {
     border-bottom: 10px solid #f6f6f6;
     border-top: 10px solid transparent;
 } */
+
+.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: 16px;
+    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: 16px;
+    resize: none;
+    /* background: #f6f6f6; */
+    font-family: 'Microsoft YaHei';
+}
+
+.binfo_input:focus-visible {
+    border: 1px solid #3681FC !important;
+}
 </style>

+ 7 - 2
src/components/pages/test/add/edit/check/choice.vue

@@ -5,8 +5,13 @@
         <!-- <div v-if="!cJson">暂未设置题目</div> -->
         <div class="set_box" v-if="!cJson">请设置题目</div>
         <div v-else class="choice_box">
-            <div class="title">{{ tindex + 1 + "、" + `(${option[checkJson.type].name})` + checkJson.title }}<span style="color: #efa030;"
-                    v-if="checkJson.score">({{ '分值:' + checkJson.score + '分' }})</span></div>
+            <div class="title" style="display: flex;">
+                <!-- + `(${option[checkJson.type].name})` -->
+                <span style="min-width: fit-content;">{{ tindex + 1 + "、"  }}</span>
+                <span>{{ checkJson.title }}</span>
+                <!-- {{ tindex + 1 + "、" + `(${option[checkJson.type].name})` + checkJson.title }} -->
+                <span style="min-width: fit-content;" v-if="checkJson.type == 2">{{ `(${option[checkJson.type].name})` }}</span>
+                <span style="color: #efa030;min-width: fit-content;" v-if="checkJson.score">({{ '分值:' + checkJson.score + '分' }})</span></div>
             <div class="choices">
                 <div class="choice" v-for="(item, index) in checkJson.array" :key="index">
                     <div class="choice_c" v-if="checkJson.type == 2"><el-checkbox v-model="checkJson.answer2" :label="index"

+ 3 - 1
src/components/pages/test/add/edit/check/file.vue

@@ -11,7 +11,8 @@
         <div v-else class="choice_box">
             <!-- <div class="title"><div>{{ `(${option[checkJson.type].name})` }}</div><div v-html="checkJson.title"></div></div> -->
             <div class="title" style="display: flex;">
-                <span style="min-width: fit-content;">{{ tindex + 1 + "、" + `(${option[checkJson.type].name})` }}</span>
+                <!-- + `(${option[checkJson.type].name})` -->
+                <span style="min-width: fit-content;">{{ tindex + 1 + "、" }}</span>
                 <span>{{ checkJson.title }}</span>
                 <span style="color: #efa030;min-width: fit-content;" v-if="checkJson.score">({{ '分值:' + checkJson.score + '分' }})</span>
                 <!-- </div><div v-html="checkJson.title"></div> -->
@@ -339,6 +340,7 @@ export default {
         },
         delFile(index) {
             this.checkJson.file.splice(index, 1)
+            this.$forceUpdate();
         }
     },
     mounted() {

+ 2 - 1
src/components/pages/test/add/edit/check/gap.vue

@@ -7,7 +7,8 @@
             <!-- <div class="title"><div>{{ `(${option[checkJson.type].name})` }}</div><div v-html="checkJson.title"></div></div> -->
             <div class="title">
                 <div  style="display: flex;">
-                    <span style="min-width: fit-content;">{{ tindex + 1 + "、" + `(${option[checkJson.type].name})` }}</span>
+                    <!--  + `(${option[checkJson.type].name})` -->
+                    <span style="min-width: fit-content;">{{ tindex + 1 + "、" }}</span>
                     <span>{{ checkJson.title }}</span>
                     <span style="min-width: fit-content;color: #efa030;">{{ checkJson.score ? '(分值:'+checkJson.score+'分)' : '' }}</span>
                 </div>

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

@@ -28,7 +28,7 @@
                                 </el-select>
                             </div> -->
                             <div class="typeBox" style="display: flex;align-items: center;">
-                                <span>权限选择:</span>
+                                <span>教研室权限:</span>
                                 <div class="checkJuri" @click="checkJuri">
                                     <span v-if="!getCName(checkList)" style="color: #c0c4d6;">选择权限</span>
                                     <span>{{ getCName(checkList) }}</span>

+ 42 - 16
src/components/pages/test/index.vue

@@ -173,7 +173,7 @@
                             <div class="test_btn">
                                 <div class="test_o_btn">
                                     <el-tooltip content="编辑" placement="top" effect="dark">
-                                        <span class="edit" @click="goToCourse2(item.courseId)" v-if="((item.userid == userid) ||
+                                        <span class="edit" @click="goToCourse2(item)" v-if="((item.userid == userid) ||
                                             (item.course_teacher &&
                                                 item.course_teacher.indexOf(userid) !== -1) || role == '1')"></span>
                                     </el-tooltip>
@@ -231,7 +231,7 @@
                     </el-table-column>
                     <el-table-column label="操作" width="350px">
                         <template slot-scope="scope">
-                            <el-button @click="goToCourse2(scope.row.courseId)" type="text" size="small" v-if="((scope.row.userid == userid) ||
+                            <el-button @click="goToCourse2(scope.row)" type="text" size="small" v-if="((scope.row.userid == userid) ||
                                 (scope.row.course_teacher &&
                                     scope.row.course_teacher.indexOf(userid) !== -1) || role == '1')">编辑</el-button>
                             <el-button @click="checkToTest(scope.row.courseId)" type="text" size="small">查看</el-button>
@@ -513,20 +513,46 @@ export default {
             }
             // this.$router.push(path);
         },
-        goToCourse2(cid) {
-            this.$router.push(
-                "/addTest?cid=" +
-                cid +
-                "&userid=" +
-                this.userid +
-                "&oid=" +
-                this.oid +
-                "&org=" +
-                this.org +
-                "&type=2" +
-                "&role=" +
-                this.role
-            );
+        goToCourse2(item) {
+            if(item.worksCount > 0){
+                this.$confirm("该表单已存在数据,如果修改题目可能会导致数据错乱,是否进入编辑编辑?", "提示", {
+                    confirmButtonText: "确定",
+                    cancelButtonText: "取消",
+                    type: "warning",
+                })
+                    .then(() => {
+                        this.$router.push(
+                            "/addTest?cid=" +
+                            item.courseId +
+                            "&userid=" +
+                            this.userid +
+                            "&oid=" +
+                            this.oid +
+                            "&org=" +
+                            this.org +
+                            "&type=2" +
+                            "&role=" +
+                            this.role
+                        );
+                    })
+                    .catch(() => {
+                        return;
+                    });
+            }else{
+                this.$router.push(
+                    "/addTest?cid=" +
+                    item.courseId +
+                    "&userid=" +
+                    this.userid +
+                    "&oid=" +
+                    this.oid +
+                    "&org=" +
+                    this.org +
+                    "&type=2" +
+                    "&role=" +
+                    this.role
+                );
+            }
         },
         checkToTest(cid) {
             this.$router.push(

+ 7 - 1
src/components/pages/testStudent/view/component/choice.vue

@@ -4,7 +4,13 @@
         <div v-if="!checkJson">暂未设置题目</div>
         <div v-else class="choice_box">
             <div class="c_title">
-                <div class="title">{{ tindex + 1 + "、" +`(${option[checkJson.type].name})` + checkJson.title }}<span style="color: #efa030;" v-if="checkJson.score">({{ '分值:'+checkJson.score+'分' }})</span></div>
+                <div class="title" style="display: flex;">
+                    <!-- + `(${option[checkJson.type].name})` -->
+                <span style="min-width: fit-content;">{{ tindex + 1 + "、" }}</span>
+                <span>{{ checkJson.title }}</span>
+                <!-- {{ tindex + 1 + "、" + `(${option[checkJson.type].name})` + checkJson.title }} -->
+                <span style="min-width: fit-content;" v-if="checkJson.type == 2">{{ `(${option[checkJson.type].name})` }}</span>
+                <span style="color: #efa030;min-width: fit-content;" v-if="checkJson.score">({{ '分值:' + checkJson.score + '分' }})</span></div>
                 <div class="p_box" v-if="isTeacher == 1 && checkJson.score">
                     <el-input v-model="score2" class="c_input" disabled></el-input><span style="margin: 0 10px;">/</span><span>{{ checkJson.score }}分</span>
                 </div>

+ 3 - 1
src/components/pages/testStudent/view/component/file.vue

@@ -6,7 +6,8 @@
             <!-- <div class="title"><div>{{ `(${option[checkJson.type].name})` }}</div><div v-html="checkJson.title"></div></div> -->
             <div class="c_title">
                 <div class="title" style="display: flex;">
-                    <span style="min-width: fit-content;">{{ tindex + 1 + "、" + `(${option[checkJson.type].name})` }}</span>
+                    <!-- + `(${option[checkJson.type].name})` -->
+                    <span style="min-width: fit-content;">{{ tindex + 1 + "、"  }}</span>
                     <span>{{ checkJson.title }}</span>
                     <span style="color: #efa030;min-width: fit-content;" v-if="checkJson.score">({{ '分值:' + checkJson.score + '分' }})</span>
                 </div>
@@ -402,6 +403,7 @@ export default {
         },
         delFile(index) {
             this.checkJson.file.splice(index, 1)
+            this.$forceUpdate();
         }
     },
     mounted() {

+ 2 - 1
src/components/pages/testStudent/view/component/gap.vue

@@ -7,7 +7,8 @@
             <div class="c_title">
                 <div class="title">
                     <div  style="display: flex;">
-                    <span style="min-width: fit-content;">{{ tindex + 1 + "、" + `(${option[checkJson.type].name})` }}</span>
+                        <!-- + `(${option[checkJson.type].name})` -->
+                    <span style="min-width: fit-content;">{{ tindex + 1 + "、" }}</span>
                     <span>{{ checkJson.title }}</span>
                     <span style="min-width: fit-content;color: #efa030;">{{ checkJson.score ? '(分值:'+checkJson.score+'分)' : '' }}</span>
                 </div>

部分文件因为文件数量过多而无法显示