SanHQin 5 days ago
parent
commit
93b11d1188

+ 1 - 1
dist/index.html

@@ -32,7 +32,7 @@
       width: 100%;
       background: #e6eaf0;
       font-family: '黑体';
-    }</style><link href=./static/css/app.7a0cb1561e75ad229de627f9ba86ff60.css rel=stylesheet></head><body><div id=app></div><script type=text/javascript src=./static/js/manifest.3eade43afd174522bb8a.js></script><script type=text/javascript src=./static/js/vendor.5e9ad9b4b6b6930254c8.js></script><script type=text/javascript src=./static/js/app.c343f868dae8d6eb89e5.js></script></body></html><script>function stopSafari() {
+    }</style><link href=./static/css/app.6d6ab1c4c3b3ae6bdc7b59ae82a445d7.css rel=stylesheet></head><body><div id=app></div><script type=text/javascript src=./static/js/manifest.161e82026ac2ae03ab6f.js></script><script type=text/javascript src=./static/js/vendor.c046dd5e92c8da101466.js></script><script type=text/javascript src=./static/js/app.9321b34ba1f2d9894840.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.6d6ab1c4c3b3ae6bdc7b59ae82a445d7.css


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


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


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


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


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


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


+ 2 - 2
dist/static/js/manifest.3eade43afd174522bb8a.js → dist/static/js/manifest.161e82026ac2ae03ab6f.js

@@ -1,2 +1,2 @@
-!function(e){var n=window.webpackJsonp;window.webpackJsonp=function(r,a,c){for(var i,u,f,s=0,l=[];s<r.length;s++)u=r[s],t[u]&&l.push(t[u][0]),t[u]=0;for(i in a)Object.prototype.hasOwnProperty.call(a,i)&&(e[i]=a[i]);for(n&&n(r,a,c);l.length;)l.shift()();if(c)for(s=0;s<c.length;s++)f=o(o.s=c[s]);return f};var r={},t={6:0};function o(n){if(r[n])return r[n].exports;var t=r[n]={i:n,l:!1,exports:{}};return e[n].call(t.exports,t,t.exports,o),t.l=!0,t.exports}o.e=function(e){var n=t[e];if(0===n)return new Promise(function(e){e()});if(n)return n[2];var r=new Promise(function(r,o){n=t[e]=[r,o]});n[2]=r;var a=document.getElementsByTagName("head")[0],c=document.createElement("script");c.type="text/javascript",c.charset="utf-8",c.async=!0,c.timeout=12e4,o.nc&&c.setAttribute("nonce",o.nc),c.src=o.p+"static/js/"+e+"."+{0:"7da288988865a9378b49",1:"14e8e8c7e44fc858e4a6",2:"94e1427bfc7ef0b4c685",3:"3a9f53a78da16650e6b8"}[e]+".js";var i=setTimeout(u,12e4);function u(){c.onerror=c.onload=null,clearTimeout(i);var n=t[e];0!==n&&(n&&n[1](new Error("Loading chunk "+e+" failed.")),t[e]=void 0)}return c.onerror=c.onload=u,a.appendChild(c),r},o.m=e,o.c=r,o.d=function(e,n,r){o.o(e,n)||Object.defineProperty(e,n,{configurable:!1,enumerable:!0,get:r})},o.n=function(e){var n=e&&e.__esModule?function(){return e.default}:function(){return e};return o.d(n,"a",n),n},o.o=function(e,n){return Object.prototype.hasOwnProperty.call(e,n)},o.p="./",o.oe=function(e){throw console.error(e),e}}([]);
-//# sourceMappingURL=manifest.3eade43afd174522bb8a.js.map
+!function(e){var n=window.webpackJsonp;window.webpackJsonp=function(r,c,a){for(var i,u,f,s=0,l=[];s<r.length;s++)u=r[s],t[u]&&l.push(t[u][0]),t[u]=0;for(i in c)Object.prototype.hasOwnProperty.call(c,i)&&(e[i]=c[i]);for(n&&n(r,c,a);l.length;)l.shift()();if(a)for(s=0;s<a.length;s++)f=o(o.s=a[s]);return f};var r={},t={6:0};function o(n){if(r[n])return r[n].exports;var t=r[n]={i:n,l:!1,exports:{}};return e[n].call(t.exports,t,t.exports,o),t.l=!0,t.exports}o.e=function(e){var n=t[e];if(0===n)return new Promise(function(e){e()});if(n)return n[2];var r=new Promise(function(r,o){n=t[e]=[r,o]});n[2]=r;var c=document.getElementsByTagName("head")[0],a=document.createElement("script");a.type="text/javascript",a.charset="utf-8",a.async=!0,a.timeout=12e4,o.nc&&a.setAttribute("nonce",o.nc),a.src=o.p+"static/js/"+e+"."+{0:"4f3b05586c3acc102a54",1:"14e8e8c7e44fc858e4a6",2:"94e1427bfc7ef0b4c685",3:"3a9f53a78da16650e6b8"}[e]+".js";var i=setTimeout(u,12e4);function u(){a.onerror=a.onload=null,clearTimeout(i);var n=t[e];0!==n&&(n&&n[1](new Error("Loading chunk "+e+" failed.")),t[e]=void 0)}return a.onerror=a.onload=u,c.appendChild(a),r},o.m=e,o.c=r,o.d=function(e,n,r){o.o(e,n)||Object.defineProperty(e,n,{configurable:!1,enumerable:!0,get:r})},o.n=function(e){var n=e&&e.__esModule?function(){return e.default}:function(){return e};return o.d(n,"a",n),n},o.o=function(e,n){return Object.prototype.hasOwnProperty.call(e,n)},o.p="./",o.oe=function(e){throw console.error(e),e}}([]);
+//# sourceMappingURL=manifest.161e82026ac2ae03ab6f.js.map

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


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


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


+ 102 - 28
src/components/pages/test/add/components/timeBox/time.vue

@@ -1,10 +1,10 @@
 <template>
   <div class="c_box">
     <div class="mask" v-if="!isOpen"></div>
-    <div class="choice_box">
+    <div class="timeBox">
       <div class="title" style="display: flex;">
         <span @click.stop="updateTitle()" v-if="!updateList.title">{{
-          cJson.title
+          cJson.title?cJson.title:"输入问题"
         }}</span>
         <input
           v-if="updateList.title"
@@ -13,7 +13,7 @@
           v-model="checkJson.title"
           @blur="save"
           @keyup.enter="save"
-          placeholder="请填写标题"
+          placeholder="输入问题"
         />
       </div>
       <div
@@ -33,6 +33,46 @@
         @keyup.enter="save"
         placeholder="请填写描述"
       />
+
+      <div class="setting">
+        自定义筛选
+      </div>
+      <div v-for="(item, index) in checkJson.timeSort" :key="index">
+        <div
+          v-if="!updateList.timeSort[index]"
+          class="timeSortTitle"
+          @click.stop="updateTimeSortTitle(index)"
+        >
+          {{ item.title ? item.title : "筛选名称" }}
+        </div>
+        <input
+          v-if="updateList.timeSort[index]"
+          :ref="`timeSortTitle-${index}`"
+          class="editInput"
+          v-model="checkJson.timeSort[index].title"
+          @blur="save"
+          style="margin-top: 20px;"
+          @keyup.enter="save"
+          placeholder="请填写筛选名称"
+        />
+        <el-date-picker
+          style="margin-top: 10px;"
+          v-model="checkJson.timeSort[index].time"
+          type="datetimerange"
+          @blur="save"
+          range-separator="至"
+          start-placeholder="开始日期"
+          end-placeholder="结束日期"
+        >
+        </el-date-picker>
+
+      </div>
+      <el-button
+        size="mini"
+        icon="el-icon-plus"
+        style="margin-top: 20px;"
+        @click.stop="addTimeSort"
+      ></el-button>
     </div>
   </div>
 </template>
@@ -64,7 +104,8 @@ export default {
       checkJson: {},
       updateList: {
         title: false,
-        detail: false
+        detail: false,
+        timeSort: []
       }
     };
   },
@@ -73,22 +114,23 @@ export default {
       handler(newVal) {
         // console.log("测试测试保存",newVal)
         this.$emit("setJson", newVal, this.index);
+        this.$forceUpdate();
         console.log("gapW", this.cJson);
       },
       deep: true
     },
-		isOpen(newValue) {
-      if (newValue) {
-        if (!this.cJson2 || Object.keys(this.cJson2).length == 0) {
-          this.checkJson = {
-            title: "标题",
-            type: 1,
-            answer: ""
-          };
-        } else {
-          this.checkJson = this.depthCopy(this.cJson2);
-        }
-      }
+    isOpen(newValue) {
+      // if (newValue) {
+      //   if (!this.cJson2 || Object.keys(this.cJson2).length == 0) {
+      //     this.checkJson = {
+      //       title: "标题",
+      //       type: 1,
+      //       answer: ""
+      //     };
+      //   } else {
+      //     this.checkJson = this.depthCopy(this.cJson2);
+      //   }
+      // }
     }
   },
   methods: {
@@ -109,30 +151,51 @@ export default {
         this.$refs["detailRef"].focus();
       });
     },
+    updateTimeSortTitle(index) {
+      this.updateList.timeSort[index] = true;
+      this.$forceUpdate();
+      this.$nextTick(() => {
+        // 聚焦到输入框
+        // console.log(this.$refs[`timeSortTitle-${index}`])
+        this.$refs[`timeSortTitle-${index}`][0].focus();
+      });
+    },
     save() {
       for (let key in this.updateList) {
-        this.updateList[key] = false;
+        if ((key = "timeSort")) {
+          this.updateList.timeSort = [];
+        } else {
+          this.updateList[key] = false;
+        }
       }
+      this.$forceUpdate();
+    },
+    addTimeSort() {
+      if (!this.checkJson.timeSort) this.checkJson.timeSort = [];
+      this.checkJson.timeSort.push({ title: "", time: [] });
+      this.$forceUpdate();
     }
   },
   mounted() {
-    // if (!this.cJson || Object.keys(this.cJson).length == 0) {
-    //   this.checkJson = {
-    //     title: "标题",
-    //     detail: ""
-    //   };
-    // } else {
-    //   this.$nextTick(() => {
-    //     this.checkJson = this.depthCopy(this.cJson2);
-    //   });
-    // }
+    if (!this.cJson || Object.keys(this.cJson).length == 0) {
+      this.checkJson = {
+        title: "标题",
+        detail: "",
+        timeSort: []
+      };
+    } else {
+      this.$nextTick(() => {
+        this.checkJson = this.depthCopy(this.cJson);
+        if (!this.checkJson.timeSort) this.checkJson.timeSort = [];
+      });
+    }
   }
 };
 </script>
 
 <style scoped>
 @import "../../global_styles.css";
-.choice_box > .choices {
+.timeBox > .choices {
   margin-top: 10px;
 }
 
@@ -167,4 +230,15 @@ export default {
   color: rgb(124, 124, 124);
   border-radius: 5px;
 }
+
+.setting {
+  margin-top: 20px;
+}
+
+.timeSortTitle {
+  margin-top: 20px;
+}
+.detail{
+  margin-top: 10px;
+}
 </style>

+ 31 - 3
src/components/pages/test/check/index.vue

@@ -1240,6 +1240,7 @@
                         @change="tableDataPickerChange"
                         type="daterange"
                         range-separator="▼"
+                        :picker-options="pickerOptions(item.json.timeSort)"
                       >
                       </el-date-picker>
                     </div>
@@ -2101,6 +2102,30 @@ export default {
           value: child.id
         })) : null;
       };
+    },
+    pickerOptions(){
+      return (dataList)=>{
+        let _result = {
+          shortcuts:[]
+        }
+
+        if(dataList.length>0){
+          for(let i = 0;i<dataList.length;i++){
+            if(dataList[i].time.length<=0)continue;
+            _result.shortcuts.push({
+              text:dataList[i].title?dataList[i].title:"-",
+              onClick(picker){
+                let startTime = dataList[i].time[0];
+                let endTime = dataList[i].time[1]
+                picker.$emit('pick', [startTime, endTime]);
+              }
+            })
+          }
+        }
+
+
+        return _result;
+      }
     }
   },
   methods: {
@@ -2711,7 +2736,8 @@ export default {
               delete item2.json.answer2;
               delete item2.json.score2;
               delete item2.json.file;
-              delete item2.json.codeScanningTime
+              delete item2.json.codeScanningTime;
+              delete item2.json.timeSort;
             }
             if (item2.array) {
               item2.array = item2.array.filter((item3) => {
@@ -2719,7 +2745,8 @@ export default {
                   delete item3.json.answer2;
                   delete item3.json.score2;
                   delete item3.json.file;
-                  delete item3.json.codeScanningTime
+                  delete item3.json.codeScanningTime;
+                  delete item3.json.timeSort;
                 }
                 return item3;
               });
@@ -2730,7 +2757,8 @@ export default {
           delete item.json.answer2;
           delete item.json.score2;
           delete item.json.file;
-          delete item.json.codeScanningTime
+          delete item.json.codeScanningTime;
+          delete item.json.timeSort;
         }
         return item;
         console.log(item.array);

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