Browse Source

Merge branch 'dev/v4.9.87_yf' of qmx/jy into feature/v4.9.91

yangfeng 6 months ago
parent
commit
bfcedc8ea3

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

@@ -432,7 +432,8 @@ input.w {
   width: 590px;
 }
 
-input.w:focus{
+input.w:focus,
+input.sm:focus{
   border: 1px solid #2cb7ca;
 }
 
@@ -1434,4 +1435,4 @@ body .loading_ p span {
 .new-box .add-input-w .l,
 .new-box .sm {
   width: 328px;
-}
+}

+ 27 - 17
src/web/staticres/dataExport/js/conditions_order.js

@@ -418,7 +418,7 @@ function addDelInputB(t,type) {
 /* 添加排除/附加词 */
 var excludeArr = []
 var appendArr = []
-function addOtherInput(t,f) {
+function addOtherInput(t,f, type) {
 	if($("#keyInput").val()==""){
 		return false;
 	}
@@ -441,26 +441,33 @@ function addOtherInput(t,f) {
   input.placeholder = temp
   input.maxLength = 20;
   if(f){
-    var l = appendArr.length
-    $(input).on('input',function () {
+    if(type !== 'edit') {
+      var l = appendArr.length
+      console.log($(input), 'input input');
+      console.log(appendArr, l, 'append--add');  
+       $(input).on('input',function () {
         var val = $.trim($(this).val()).replace(/\s/g,"");
+        console.log(val, 'val');
         if(val){
             appendArr[l] = val
         }else {
-            // appendArr.splice(l,1)
+            appendArr.splice(l,1)
         }
-    })
-    // console.log(appendArr, 'appendArr');
+      })
+    }
+    
   }else {
-    var l = excludeArr.length
-    $(input).on('input',function () {
-        var val = $.trim($(this).val()).replace(/\s/g,"");
-        if(val){
-            excludeArr[l] = val
-        }else{
-            // excludeArr.splice(l,1)
-        }
-    })
+    if (type !== 'edit') {
+      var l = excludeArr.length
+      $(input).on('input',function () {
+          var val = $.trim($(this).val()).replace(/\s/g,"");
+          if(val){
+              excludeArr[l] = val
+          }else{
+              excludeArr.splice(l,1)
+          }
+      })
+    }
   }
   // console.log('附加词:' + appendArr, '排除词:'+ excludeArr);
   $(t).before(input)
@@ -565,8 +572,10 @@ $(document).on('click','#inputDel_0 .icon-edit-img',function (e) {
   if(append){
     $('.new-box .add-input-w').show()
     append = append.split(",")
+    // console.log(append, 'append-1');
     append.forEach(function (value, index) {
-      addOtherInput('.new-box .l .add-w', true)
+      addOtherInput('.new-box .l .add-w', true, 'edit')
+
       $('.new-box .l .sm:eq(' + index + ')').val(value)
       $('.new-box .l .sm:eq(' + index + ')').on('input', function() {
         if ($(this).val()) {
@@ -577,12 +586,13 @@ $(document).on('click','#inputDel_0 .icon-edit-img',function (e) {
       })
     })
     appendArr = append
+    console.log(appendArr, 'append-edit');
   }
   if(exclude){
     $('.new-box.r.add-w').show()
     exclude = exclude.split(",")
     exclude.forEach(function (value, index) {
-      addOtherInput('.new-box .r .add-w', false)
+      addOtherInput('.new-box .r .add-w', false, 'edit')
       $('.new-box .r .sm:eq(' + index + ')').val(value)
       $('.new-box .r .sm:eq(' + index + ')').on('input', function() {
         if ($(this).val()) {