Explorar o código

fix:修复数据导出关键词附加词、排除词删除异常

yangfeng hai 6 meses
pai
achega
376dfe3710

+ 2 - 1
src/web/staticres/dataExport/css/conditions.css

@@ -745,7 +745,8 @@ input.sm {
 }
 }
 
 
 .text-box .title-other {
 .text-box .title-other {
-  width: 230px;
+  width: 220px;
+  padding-right: 8px;
   white-space: pre-wrap
   white-space: pre-wrap
 }
 }
 
 

+ 19 - 3
src/web/staticres/dataExport/js/conditions_order.js

@@ -447,9 +447,10 @@ function addOtherInput(t,f) {
         if(val){
         if(val){
             appendArr[l] = val
             appendArr[l] = val
         }else {
         }else {
-            appendArr.splice(l,1)
+            // appendArr.splice(l,1)
         }
         }
     })
     })
+    // console.log(appendArr, 'appendArr');
   }else {
   }else {
     var l = excludeArr.length
     var l = excludeArr.length
     $(input).on('input',function () {
     $(input).on('input',function () {
@@ -457,7 +458,7 @@ function addOtherInput(t,f) {
         if(val){
         if(val){
             excludeArr[l] = val
             excludeArr[l] = val
         }else{
         }else{
-            excludeArr.splice(l,1)
+            // excludeArr.splice(l,1)
         }
         }
     })
     })
   }
   }
@@ -567,6 +568,13 @@ $(document).on('click','#inputDel_0 .icon-edit-img',function (e) {
     append.forEach(function (value, index) {
     append.forEach(function (value, index) {
       addOtherInput('.new-box .l .add-w', true)
       addOtherInput('.new-box .l .add-w', true)
       $('.new-box .l .sm:eq(' + index + ')').val(value)
       $('.new-box .l .sm:eq(' + index + ')').val(value)
+      $('.new-box .l .sm:eq(' + index + ')').on('input', function() {
+        if ($(this).val()) {
+          append[index] = $(this).val()
+        }else{
+          append.splice(index,1)
+        }
+      })
     })
     })
     appendArr = append
     appendArr = append
   }
   }
@@ -576,6 +584,13 @@ $(document).on('click','#inputDel_0 .icon-edit-img',function (e) {
     exclude.forEach(function (value, index) {
     exclude.forEach(function (value, index) {
       addOtherInput('.new-box .r .add-w', false)
       addOtherInput('.new-box .r .add-w', false)
       $('.new-box .r .sm:eq(' + index + ')').val(value)
       $('.new-box .r .sm:eq(' + index + ')').val(value)
+      $('.new-box .r .sm:eq(' + index + ')').on('input', function() {
+        if ($(this).val()) {
+          exclude[index] = $(this).val()
+        }else{
+          exclude.splice(index,1)
+        }
+      })
     })
     })
     excludeArr = exclude
     excludeArr = exclude
   }
   }
@@ -636,7 +651,7 @@ $('.new-box .new-confirm').click(function () {
   // }
   // }
   // end
   // end
   var editIndex = $(this).attr('data-index')
   var editIndex = $(this).attr('data-index')
-  // console.log(editIndex, text, appendArr, excludeArr, 'editIndex');
+  console.log(editIndex,type, text, appendArr, excludeArr, 'editIndex');
 
 
   var keyTemArr = window[arr] || []
   var keyTemArr = window[arr] || []
   if(!Array.isArray(keyTemArr)) {
   if(!Array.isArray(keyTemArr)) {
@@ -658,6 +673,7 @@ $('.new-box .new-confirm').click(function () {
     })
     })
     keyTemArr.push(text)
     keyTemArr.push(text)
   }
   }
+  console.log(keyAllArr, keyTemArr, 'keyAllArr');
 
 
   // var tempArr = keyAllArr.map(function(v){return v.name})
   // var tempArr = keyAllArr.map(function(v){return v.name})
   // if(tempArr.indexOf(text) === -1) {
   // if(tempArr.indexOf(text) === -1) {

+ 2 - 2
src/web/templates/pc/dataExport_sieve.html

@@ -2525,7 +2525,7 @@
         $("input.sm").on("input", function () {
         $("input.sm").on("input", function () {
             // console.log(window["inputDel_0"]);
             // console.log(window["inputDel_0"]);
             // console.log($(".edit-user-input").css("display"));
             // console.log($(".edit-user-input").css("display"));
-            window["inputDel_0"] = [];
+            // window["inputDel_0"] = [];
             var ad = $(this).val().trim();
             var ad = $(this).val().trim();
             if (ad !== "") {
             if (ad !== "") {
                 $(".edit-user-input > button.sussecc").attr("disabled", false);
                 $(".edit-user-input > button.sussecc").attr("disabled", false);
@@ -3821,7 +3821,7 @@
                         $('.new-action').hide()
                         $('.new-action').hide()
                         $('.new-box').removeClass('bg-active')
                         $('.new-box').removeClass('bg-active')
                         $('#keyInput').val('').hide()
                         $('#keyInput').val('').hide()
-                        window[keyName] = tempArr
+                        window[keyName] = keyAllArr.map(function(v){return v.name})
 
 
                         var nnTemplate = ''
                         var nnTemplate = ''
                         for (var i = 0; i<keyAllArr.length;i++) {
                         for (var i = 0; i<keyAllArr.length;i++) {