lsc 1 年之前
父节点
当前提交
365391527e

+ 1 - 1
dist/index.html

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

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


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


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


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


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


+ 192 - 175
src/components/pages/test/add/edit/check/file.vue

@@ -18,6 +18,8 @@
                     '分' }})</span>
                 <!-- </div><div v-html="checkJson.title"></div> -->
             </div>
+            <div class="detail" v-if="checkJson.detail" v-html="checkJson.detail" style="color: #00000099;margin-top: 5px;">
+            </div>
             <div class="choices">
                 <div class="binfo_input">
                     <div class="fileBox" v-if="checkJson.file && checkJson.file.length">
@@ -43,20 +45,20 @@
                         <!-- @click.stop="addImg($event)" -->
                         <div class="btn" @click.stop="openFileBox()">
                             <span>点击添加文件</span>
-                            <input type="file" accept="*" style="display: none" @change="beforeUpload($event)" />
+                            <input type="file" accept="*" style="display: none" multiple="multiple" @change="beforeUpload($event)" />
                         </div>
                     </div>
                     <!-- @click.stop="addImg($event)" -->
                     <div class="uploadQ" @click.stop="openFileBox()" v-else>
                         <span>点击添加文件</span>
-                        <input type="file" accept="*" style="display: none" @change="beforeUpload($event)" />
+                        <input type="file" accept="*" style="display: none" multiple="multiple" @change="beforeUpload($event)" />
                     </div>
                     <div v-if="proVisible" class="mask">
                         <div class="progressBox">
                             <div class="lbox">
                                 <img src="../../../../../../assets/loading.gif" />上传中,请稍后
                             </div>
-                            <div style="margin-bottom: 10px">
+                            <!-- <div style="margin-bottom: 10px">
                                 <span>{{
                                     isFinishSize
                                 }}M</span>
@@ -64,11 +66,11 @@
                                 <span>{{
                                     isAllSize
                                 }}M</span>
-                            </div>
-                            <el-progress :text-inside="true" :stroke-width="20" :percentage="progress
+                            </div> -->
+                            <!-- <el-progress :text-inside="true" :stroke-width="20" :percentage="progress
                                 ? progress
                                 : 0
-                                " style="width: 80%"></el-progress>
+                                " style="width: 80%"></el-progress> -->
                         </div>
                     </div>
                 </div>
@@ -159,177 +161,192 @@ export default {
         },
         beforeUpload(event, type) {
             // const loading = this.openLoading();
-            var file = event.target.files[0];
-            var credentials = {
-                accessKeyId: "AKIATLPEDU37QV5CHLMH",
-                secretAccessKey: "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",
-            }; //秘钥形式的登录上传
-            window.AWS.config.update(credentials);
-            window.AWS.config.region = "cn-northwest-1"; //设置区域
-
-            var bucket = new window.AWS.S3({ params: { Bucket: "ccrb" } }); //选择桶
-            var _this = this;
-
-            _this.progress = 0;
-            _this.proVisible = true;
-            _this.isFinishSize = 0;
-            _this.isAllSize = (file.size / 1024 / 1024).toFixed(2);
-            _this.$forceUpdate();
-            if (file) {
-                var params = {
-                    Key:
-                        file.name.split(".")[0] +
-                        new Date().getTime() +
-                        "." +
-                        file.name.split(".")[file.name.split(".").length - 1],
-                    ContentType: file.type,
-                    Body: file,
-                    "Access-Control-Allow-Credentials": "*",
-                    ACL: "public-read",
-                }; //key可以设置为桶的相抵路径,Body为文件, ACL最好要设置
-                var options = {
-                    partSize: 2048 * 1024 * 1024,
-                    queueSize: 2,
-                    leavePartsOnError: true,
-                };
-                bucket
-                    .upload(params, options)
-                    .on("httpUploadProgress", function (evt) {
-                        //这里可以写进度条
-                        // console.log("Uploaded : " + parseInt((evt.loaded * 80) / evt.total) + '%');
-                        _this.progress = parseInt((evt.loaded / evt.total) * 100);
-                        _this.isFinishSize = (evt.loaded / 1024 / 1024).toFixed(2);
-                        _this.$forceUpdate();
-                    })
-                    .send(function (err, data) {
-                        _this.progress = 100;
-                        _this.isFinishSize = _this.isAllSize;
-                        _this.$forceUpdate();
-                        setTimeout(() => {
-                            _this.proVisible = false;
-                            _this.$forceUpdate();
-                        }, 1000);
-                        // loading.close();
-                        if (err) {
-                            _this.$message.error("上传失败");
-                        } else {
-                            let _type = 2;
-                            var imgA = [
-                                "png",
-                                "jpg",
-                                "jpeg",
-                                "bmp",
-                                "gif",
-                                "webp",
-                                "psd",
-                                "svg",
-                                "tiff",
-                            ];
-                            var fileA = [
-                                "DOC",
-                                "DOCX",
-                                "DOCM",
-                                "DOTM",
-                                "DOTX",
-                                "PPTX",
-                                "PPSX",
-                                "PPT",
-                                "PPS",
-                                "PPTM",
-                                "POTM",
-                                "PPAM",
-                                "POTX",
-                                "PPSM",
-                                "XLSX",
-                                "XLS",
-                            ];
-                            var videoA = [
-                                "AVI",
-                                "NAVI",
-                                "MPEG",
-                                "ASF",
-                                "MOV",
-                                "WMV",
-                                "3GP",
-                                "RM",
-                                "RMVB",
-                                "FLV",
-                                "F4V",
-                                "H.264",
-                                "H.265",
-                                "REAL VIDEO",
-                                "MKV",
-                                "WebM",
-                                "HDDVD",
-                                "MP4",
-                                "MPG",
-                                "M4V",
-                                "MGV",
-                                "OGV",
-                                "QTM",
-                                "STR",
-                                "AMC",
-                                "DVX",
-                                "EVO",
-                                "DAT",
-                                "OGG",
-                                "OGM",
-                            ];
-                            if (
-                                fileA.indexOf(
-                                    data.Location.split(".")[
-                                        data.Location.split(".").length - 1
-                                    ].toLocaleUpperCase()
-                                ) != -1
-                            ) {
-                                _type = 1; //word 文件
-                            } else if (
-                                videoA.indexOf(
-                                    data.Location.split(".")[
-                                        data.Location.split(".").length - 1
-                                    ].toLocaleUpperCase()
-                                ) != -1
-                            ) {
-                                _type = 2; //视频
-                            } else if (
-                                imgA.indexOf(
-                                    data.Location.split(".")[
-                                        data.Location.split(".").length - 1
-                                    ].toLocaleLowerCase()
-                                ) != -1
-                            ) {
-                                _type = 3; //图片
-                            } else if (
-                                'pdf'.indexOf(
-                                    data.Location.split(".")[
-                                        data.Location.split(".").length - 1
-                                    ].toLocaleLowerCase()
-                                ) != -1
-                            ) {
-                                _type = 4; //pdf
+            let file = "";
+            let cfindex2 = 0;
+            for (var cfindex = 0; cfindex < event.target.files.length; cfindex++) {
+                file = event.target.files[cfindex];
+            
+                var credentials = {
+                    accessKeyId: "AKIATLPEDU37QV5CHLMH",
+                    secretAccessKey: "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",
+                }; //秘钥形式的登录上传
+                window.AWS.config.update(credentials);
+                window.AWS.config.region = "cn-northwest-1"; //设置区域
+
+                var bucket = new window.AWS.S3({ params: { Bucket: "ccrb" } }); //选择桶
+                var _this = this;
+
+                // _this.progress = 0;
+                _this.proVisible = true;
+                // _this.isFinishSize = 0;
+                // _this.isAllSize = (file.size / 1024 / 1024).toFixed(2);
+                _this.$forceUpdate();
+                if (file) {
+                    var params = {
+                        Key:
+                            file.name.split(".")[0] +
+                            new Date().getTime() +
+                            "." +
+                            file.name.split(".")[file.name.split(".").length - 1],
+                        ContentType: file.type,
+                        Body: file,
+                        "Access-Control-Allow-Credentials": "*",
+                        ACL: "public-read",
+                    }; //key可以设置为桶的相抵路径,Body为文件, ACL最好要设置
+                    var options = {
+                        partSize: 2048 * 1024 * 1024,
+                        queueSize: 2,
+                        leavePartsOnError: true,
+                    };
+                    bucket
+                        .upload(params, options)
+                        .on("httpUploadProgress", function (evt) {
+                            //这里可以写进度条
+                            // console.log("Uploaded : " + parseInt((evt.loaded * 80) / evt.total) + '%');
+                            // _this.progress = parseInt((evt.loaded / evt.total) * 100);
+                            // _this.isFinishSize = (evt.loaded / 1024 / 1024).toFixed(2);
+                            // _this.$forceUpdate();
+                        })
+                        .send(function (err, data) {
+                            cfindex2++;
+
+                            // _this.progress = 100;
+                            // _this.isFinishSize = _this.isAllSize;
+                            // _this.$forceUpdate();
+                            // setTimeout(() => {
+                            //     _this.proVisible = false;
+                            //     _this.$forceUpdate();
+                            // }, 1000);
+                            setTimeout(() => {
+                                if (
+                                cfindex2 == event.target.files.length - 1 ||
+                                cfindex2 > event.target.files.length - 1
+                                ) {
+                                _this.proVisible = false;
+                                }
+                            }, 1000);
+                            // loading.close();
+                            if (err) {
+                                _this.$message.error("上传失败");
                             } else {
-                                _type = 5; //文件
+                                let _type = 2;
+                                var imgA = [
+                                    "png",
+                                    "jpg",
+                                    "jpeg",
+                                    "bmp",
+                                    "gif",
+                                    "webp",
+                                    "psd",
+                                    "svg",
+                                    "tiff",
+                                ];
+                                var fileA = [
+                                    "DOC",
+                                    "DOCX",
+                                    "DOCM",
+                                    "DOTM",
+                                    "DOTX",
+                                    "PPTX",
+                                    "PPSX",
+                                    "PPT",
+                                    "PPS",
+                                    "PPTM",
+                                    "POTM",
+                                    "PPAM",
+                                    "POTX",
+                                    "PPSM",
+                                    "XLSX",
+                                    "XLS",
+                                ];
+                                var videoA = [
+                                    "AVI",
+                                    "NAVI",
+                                    "MPEG",
+                                    "ASF",
+                                    "MOV",
+                                    "WMV",
+                                    "3GP",
+                                    "RM",
+                                    "RMVB",
+                                    "FLV",
+                                    "F4V",
+                                    "H.264",
+                                    "H.265",
+                                    "REAL VIDEO",
+                                    "MKV",
+                                    "WebM",
+                                    "HDDVD",
+                                    "MP4",
+                                    "MPG",
+                                    "M4V",
+                                    "MGV",
+                                    "OGV",
+                                    "QTM",
+                                    "STR",
+                                    "AMC",
+                                    "DVX",
+                                    "EVO",
+                                    "DAT",
+                                    "OGG",
+                                    "OGM",
+                                ];
+                                if (
+                                    fileA.indexOf(
+                                        data.Location.split(".")[
+                                            data.Location.split(".").length - 1
+                                        ].toLocaleUpperCase()
+                                    ) != -1
+                                ) {
+                                    _type = 1; //word 文件
+                                } else if (
+                                    videoA.indexOf(
+                                        data.Location.split(".")[
+                                            data.Location.split(".").length - 1
+                                        ].toLocaleUpperCase()
+                                    ) != -1
+                                ) {
+                                    _type = 2; //视频
+                                } else if (
+                                    imgA.indexOf(
+                                        data.Location.split(".")[
+                                            data.Location.split(".").length - 1
+                                        ].toLocaleLowerCase()
+                                    ) != -1
+                                ) {
+                                    _type = 3; //图片
+                                } else if (
+                                    'pdf'.indexOf(
+                                        data.Location.split(".")[
+                                            data.Location.split(".").length - 1
+                                        ].toLocaleLowerCase()
+                                    ) != -1
+                                ) {
+                                    _type = 4; //pdf
+                                } else {
+                                    _type = 5; //文件
+                                }
+                                if (_this.checkJson.file) {
+                                    _this.checkJson.file.push({
+                                        name: file.name,
+                                        url: data.Location,
+                                        type: _type,
+                                    });
+                                } else {
+                                    _this.checkJson.file = []
+                                    _this.checkJson.file.push({
+                                        name: file.name,
+                                        url: data.Location,
+                                        type: _type,
+                                    });
+                                }
+                                _this.$forceUpdate();
+
+                                console.log(_this.checkJson);
+                                console.log(data.Location);
                             }
-                            if (_this.checkJson.file) {
-                                _this.checkJson.file.push({
-                                    name: file.name,
-                                    url: data.Location,
-                                    type: _type,
-                                });
-                            } else {
-                                _this.checkJson.file = []
-                                _this.checkJson.file.push({
-                                    name: file.name,
-                                    url: data.Location,
-                                    type: _type,
-                                });
-                            }
-                            _this.$forceUpdate();
-
-                            console.log(_this.checkJson);
-                            console.log(data.Location);
-                        }
-                    });
+                        });
+                }
             }
         },
         setCheckJson(name, url, type) {

+ 187 - 174
src/components/pages/test/file/checkfile.vue

@@ -5,7 +5,7 @@
             <div>
                 <button class="info_btn" @click="addImg($event)">
                     选择本地文件
-                    <input type="file" accept="*" style="display: none" @change="beforeUpload" />
+                    <input type="file" accept="*" style="display: none" multiple="multiple" @change="beforeUpload" />
                 </button>
                 <div class="spanName">选择本地文件</div>
             </div>
@@ -19,7 +19,7 @@
                 <div class="lbox">
                     <img src="../../../../assets/loading.gif" />上传中,请稍后
                 </div>
-                <div style="margin-bottom: 10px">
+                <!-- <div style="margin-bottom: 10px">
                     <span>{{
                         isFinishSize
                     }}M</span>
@@ -31,7 +31,7 @@
                 <el-progress :text-inside="true" :stroke-width="20" :percentage="progress
                     ? progress
                     : 0
-                    " style="width: 80%"></el-progress>
+                    " style="width: 80%"></el-progress> -->
             </div>
         </div>
         <el-dialog title="选择素材库文件" :visible.sync="dialogVisiblefile2" :append-to-body="true" width="710px"
@@ -202,179 +202,192 @@ export default {
         },
         beforeUpload(event, type) {
             // const loading = this.openLoading();
-            var file = event.target.files[0];
-            var credentials = {
-                accessKeyId: "AKIATLPEDU37QV5CHLMH",
-                secretAccessKey: "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",
-            }; //秘钥形式的登录上传
-            window.AWS.config.update(credentials);
-            window.AWS.config.region = "cn-northwest-1"; //设置区域
-
-            var bucket = new window.AWS.S3({ params: { Bucket: "ccrb" } }); //选择桶
-            var _this = this;
-
-            _this.progress = 0;
-            _this.proVisible = true;
-            _this.isFinishSize = 0;
-            _this.isAllSize = (file.size / 1024 / 1024).toFixed(2);
-            _this.$forceUpdate();
-            if (file) {
-                var params = {
-                    Key:
-                        file.name.split(".")[0] +
-                        new Date().getTime() +
-                        "." +
-                        file.name.split(".")[file.name.split(".").length - 1],
-                    ContentType: file.type,
-                    Body: file,
-                    "Access-Control-Allow-Credentials": "*",
-                    ACL: "public-read",
-                }; //key可以设置为桶的相抵路径,Body为文件, ACL最好要设置
-                var options = {
-                    partSize: 2048 * 1024 * 1024,
-                    queueSize: 2,
-                    leavePartsOnError: true,
-                };
-                bucket
-                    .upload(params, options)
-                    .on("httpUploadProgress", function (evt) {
-                        //这里可以写进度条
-                        // console.log("Uploaded : " + parseInt((evt.loaded * 80) / evt.total) + '%');
-                        _this.progress = parseInt((evt.loaded / evt.total) * 100);
-                        _this.isFinishSize = (evt.loaded / 1024 / 1024).toFixed(2);
-                        _this.$forceUpdate();
-                    })
-                    .send(function (err, data) {
-                        _this.progress = 100;
-                        _this.isFinishSize = _this.isAllSize;
-                        _this.$forceUpdate();
-                        setTimeout(() => {
-                            _this.proVisible = false;
-                            _this.$forceUpdate();
-                        }, 1000);
-                        // loading.close();
-                        if (err) {
-                            _this.$message.error("上传失败");
-                        } else {
-                            let _type = 2;
-                            var imgA = [
-                                "png",
-                                "jpg",
-                                "jpeg",
-                                "bmp",
-                                "gif",
-                                "webp",
-                                "psd",
-                                "svg",
-                                "tiff",
-                            ];
-                            var fileA = [
-                                "DOC",
-                                "DOCX",
-                                "DOCM",
-                                "DOTM",
-                                "DOTX",
-                                "PPTX",
-                                "PPSX",
-                                "PPT",
-                                "PPS",
-                                "PPTM",
-                                "POTM",
-                                "PPAM",
-                                "POTX",
-                                "PPSM",
-                                "XLSX",
-                                "XLS",
-                            ];
-                            var videoA = [
-                                "AVI",
-                                "NAVI",
-                                "MPEG",
-                                "ASF",
-                                "MOV",
-                                "WMV",
-                                "3GP",
-                                "RM",
-                                "RMVB",
-                                "FLV",
-                                "F4V",
-                                "H.264",
-                                "H.265",
-                                "REAL VIDEO",
-                                "MKV",
-                                "WebM",
-                                "HDDVD",
-                                "MP4",
-                                "MPG",
-                                "M4V",
-                                "MGV",
-                                "OGV",
-                                "QTM",
-                                "STR",
-                                "AMC",
-                                "DVX",
-                                "EVO",
-                                "DAT",
-                                "OGG",
-                                "OGM",
-                            ];
-                            if (
-                                fileA.indexOf(
-                                    data.Location.split(".")[
-                                        data.Location.split(".").length - 1
-                                    ].toLocaleUpperCase()
-                                ) != -1
-                            ) {
-                                _type = 1; //word 文件
-                            } else if (
-                                videoA.indexOf(
-                                    data.Location.split(".")[
-                                        data.Location.split(".").length - 1
-                                    ].toLocaleUpperCase()
-                                ) != -1
-                            ) {
-                                _type = 2; //视频
-                            } else if (
-                                imgA.indexOf(
-                                    data.Location.split(".")[
-                                        data.Location.split(".").length - 1
-                                    ].toLocaleLowerCase()
-                                ) != -1
-                            ) {
-                                _type = 3; //图片
-                            } else if (
-                                'pdf'.indexOf(
-                                    data.Location.split(".")[
-                                        data.Location.split(".").length - 1
-                                    ].toLocaleLowerCase()
-                                ) != -1
-                            ) {
-                                _type = 4; //pdf
+            let cfindex2 = 0;
+            for (var cfindex = 0; cfindex < event.target.files.length; cfindex++) {
+                let file = event.target.files[cfindex];
+                var credentials = {
+                    accessKeyId: "AKIATLPEDU37QV5CHLMH",
+                    secretAccessKey: "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",
+                }; //秘钥形式的登录上传
+                window.AWS.config.update(credentials);
+                window.AWS.config.region = "cn-northwest-1"; //设置区域
+
+                var bucket = new window.AWS.S3({ params: { Bucket: "ccrb" } }); //选择桶
+                var _this = this;
+
+                // _this.progress = 0;
+                _this.proVisible = true;
+                // _this.isFinishSize = 0;
+                // _this.isAllSize = (file.size / 1024 / 1024).toFixed(2);
+                _this.$forceUpdate();
+                if (file) {
+                    var params = {
+                        Key:
+                            file.name.split(".")[0] +
+                            new Date().getTime() +
+                            "." +
+                            file.name.split(".")[file.name.split(".").length - 1],
+                        ContentType: file.type,
+                        Body: file,
+                        "Access-Control-Allow-Credentials": "*",
+                        ACL: "public-read",
+                    }; //key可以设置为桶的相抵路径,Body为文件, ACL最好要设置
+                    var options = {
+                        partSize: 2048 * 1024 * 1024,
+                        queueSize: 2,
+                        leavePartsOnError: true,
+                    };
+                    bucket
+                        .upload(params, options)
+                        .on("httpUploadProgress", function (evt) {
+                            //这里可以写进度条
+                            // console.log("Uploaded : " + parseInt((evt.loaded * 80) / evt.total) + '%');
+                            // _this.progress = parseInt((evt.loaded / evt.total) * 100);
+                            // _this.isFinishSize = (evt.loaded / 1024 / 1024).toFixed(2);
+                            // _this.$forceUpdate();
+                        })
+                        .send(function (err, data) {
+                            cfindex2++;
+
+                            // _this.progress = 100;
+                            // _this.isFinishSize = _this.isAllSize;
+                            // _this.$forceUpdate();
+                            // setTimeout(() => {
+                            //     _this.proVisible = false;
+                            //     _this.$forceUpdate();
+                            // }, 1000);
+                            setTimeout(() => {
+                                if (
+                                cfindex2 == event.target.files.length - 1 ||
+                                cfindex2 > event.target.files.length - 1
+                                ) {
+                                _this.proVisible = false;
+                                _this.close();
+                                }
+                            }, 1000);
+                            // loading.close();
+                            if (err) {
+                                _this.$message.error("上传失败");
                             } else {
-                                _type = 5; //文件
+                                let _type = 2;
+                                var imgA = [
+                                    "png",
+                                    "jpg",
+                                    "jpeg",
+                                    "bmp",
+                                    "gif",
+                                    "webp",
+                                    "psd",
+                                    "svg",
+                                    "tiff",
+                                ];
+                                var fileA = [
+                                    "DOC",
+                                    "DOCX",
+                                    "DOCM",
+                                    "DOTM",
+                                    "DOTX",
+                                    "PPTX",
+                                    "PPSX",
+                                    "PPT",
+                                    "PPS",
+                                    "PPTM",
+                                    "POTM",
+                                    "PPAM",
+                                    "POTX",
+                                    "PPSM",
+                                    "XLSX",
+                                    "XLS",
+                                ];
+                                var videoA = [
+                                    "AVI",
+                                    "NAVI",
+                                    "MPEG",
+                                    "ASF",
+                                    "MOV",
+                                    "WMV",
+                                    "3GP",
+                                    "RM",
+                                    "RMVB",
+                                    "FLV",
+                                    "F4V",
+                                    "H.264",
+                                    "H.265",
+                                    "REAL VIDEO",
+                                    "MKV",
+                                    "WebM",
+                                    "HDDVD",
+                                    "MP4",
+                                    "MPG",
+                                    "M4V",
+                                    "MGV",
+                                    "OGV",
+                                    "QTM",
+                                    "STR",
+                                    "AMC",
+                                    "DVX",
+                                    "EVO",
+                                    "DAT",
+                                    "OGG",
+                                    "OGM",
+                                ];
+                                if (
+                                    fileA.indexOf(
+                                        data.Location.split(".")[
+                                            data.Location.split(".").length - 1
+                                        ].toLocaleUpperCase()
+                                    ) != -1
+                                ) {
+                                    _type = 1; //word 文件
+                                } else if (
+                                    videoA.indexOf(
+                                        data.Location.split(".")[
+                                            data.Location.split(".").length - 1
+                                        ].toLocaleUpperCase()
+                                    ) != -1
+                                ) {
+                                    _type = 2; //视频
+                                } else if (
+                                    imgA.indexOf(
+                                        data.Location.split(".")[
+                                            data.Location.split(".").length - 1
+                                        ].toLocaleLowerCase()
+                                    ) != -1
+                                ) {
+                                    _type = 3; //图片
+                                } else if (
+                                    'pdf'.indexOf(
+                                        data.Location.split(".")[
+                                            data.Location.split(".").length - 1
+                                        ].toLocaleLowerCase()
+                                    ) != -1
+                                ) {
+                                    _type = 4; //pdf
+                                } else {
+                                    _type = 5; //文件
+                                }
+                                // if (_this.checkJson.file) {
+                                // _this.checkJson.file.push({
+                                //     name: file.name,
+                                //     url: data.Location,
+                                //     type: _type,
+                                // });
+                                // } else {
+                                //     _this.checkJson.file = []
+                                //     _this.checkJson.file.push({
+                                //         name: file.name,
+                                //         url: data.Location,
+                                //         type: _type,
+                                //     });
+                                // }
+                                _this.$emit("setCheckJson", file.name, data.Location, _type);
+                                _this.$forceUpdate();
+
+                                console.log(_this.checkJson);
+                                console.log(data.Location);
                             }
-                            // if (_this.checkJson.file) {
-                            // _this.checkJson.file.push({
-                            //     name: file.name,
-                            //     url: data.Location,
-                            //     type: _type,
-                            // });
-                            // } else {
-                            //     _this.checkJson.file = []
-                            //     _this.checkJson.file.push({
-                            //         name: file.name,
-                            //         url: data.Location,
-                            //         type: _type,
-                            //     });
-                            // }
-                            _this.$emit("setCheckJson", file.name, data.Location, _type);
-                            _this.close();
-                            _this.$forceUpdate();
-
-                            console.log(_this.checkJson);
-                            console.log(data.Location);
-                        }
-                    });
+                        });
+                }
             }
         },
         checkJson(json) {

+ 2 - 0
src/components/pages/testStudent/view/component/file.vue

@@ -27,6 +27,8 @@
                     }}分</span>
                 </div>
             </div>
+            <div class="detail" v-if="checkJson.detail" v-html="checkJson.detail" style="color: #00000099;margin-top: 5px;">
+            </div>
             <div class="choices">
                 <div class="binfo_input">
                     <div class="fileBox" v-if="checkJson.file && checkJson.file.length">

+ 1 - 1
src/components/pages/testStudent/view/preview.vue

@@ -357,7 +357,7 @@ export default {
         {
           uid: (this.type == 3 && this.tid) ? this.tid : this.userid,
           cid: this.cid,
-          cjson: JSON.stringify(cjson),
+          cjson: encodeURIComponent(JSON.stringify(cjson)),
           type: '2',
         },
       ];

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