Ming 4 vuotta sitten
vanhempi
commit
482524b4e7
3 muutettua tiedostoa jossa 40 lisäystä ja 15 poistoa
  1. 22 4
      js/main.js
  2. 17 10
      js/plan-inner.js
  3. 1 1
      operate-manage.html

+ 22 - 4
js/main.js

@@ -39,15 +39,23 @@ $(document).on('click', '.pure-table tbody.multipleChoice  tr', function() {
         $(this).find("td:eq(0)").removeClass('checked');
         filterAll();
 
-        removeByValue(arr99, $(this).find("td:eq(0)").data('id'));
+        // 取消选中,del数组里push id
+        if ($(this).find("td:eq(0)").data('pd')) {
+            arrDelPd.push($(this).find("td:eq(0)").data('id'))
+            arrDelPd = unique(arrDelPd);
+            console.log('arrDelPd');
+            console.log(arrDelPd)
 
-        console.log('数组变量')
-        console.log(arr99)
+        } else {
 
-        if (arrDelPd.indexOf($(this).find("td:eq(0)").data('id')) > -1) {
+            removeByValue(arr99, $(this).find("td:eq(0)").data('id'));
+
+            console.log('数组变量')
+            console.log(arr99)
 
         }
 
+
     } else {
         $(this).addClass("selected");
         $(this).find("td:eq(0)").addClass('checked');
@@ -55,9 +63,19 @@ $(document).on('click', '.pure-table tbody.multipleChoice  tr', function() {
         filterAll()
 
         arr99.push($(this).find("td:eq(0)").data('id'))
+        arr99 = unique(arr99);
         console.log('数组变量')
         console.log(arr99)
 
+
+        // pd的 取消选中再选中,del数组里去除 id
+        if ($(this).find("td:eq(0)").data('pd')) {
+            removeByValue(arrDelPd, $(this).find("td:eq(0)").data('id'));
+            arrDelPd = unique(arrDelPd);
+            console.log('arrDelPd');
+            console.log(arrDelPd)
+        }
+
     }
 });
 

+ 17 - 10
js/plan-inner.js

@@ -14,24 +14,31 @@ function getTeamInnerList(queryParam = {}, innerPage = 1) {
 
             let data = result.RESULT;
             let items = '';
+            let items2 = '';
             if (result.totalCount > 0) {
+                console.log('arrDelPd')
+                console.log(arrDelPd)
+
+                console.log('arr99-------')
+                console.log(arr99)
+
                 data.forEach(function(item, key) {
-                    if (item.pd) {
 
-                        arr99.push(item.id)
-                        arr99 = unique(arr99);
 
-                        arrDelPd.push(item.id);
-                        arrDelPd = unique(arrDelPd);
-                        console.log('arr99')
-                        console.log(arr99)
-                    }
-                    // 如果数组里含有item.id  被选中
                     if (arr99.indexOf(item.id) > -1) {
-                        items += "<tr class='selected'>" + "<td class='status checked' data-id='" + item.id + "'></td>" + "<td>" + item.spot_name + "</td>" + "<td>" + item.spot_address + "</td>" + "<td ><a class='pointDetail' data-id=" + item.id + "><img src='../../images/tupianbtn.png'></a></td>" + "</tr>"
+                        items += "<tr class='selected'>" + "<td class='status checked' data-id='" + item.id + "' data-pd='" + item.pd + "'></td>" + "<td>" + item.spot_name + "</td>" + "<td>" + item.spot_address + "</td>" + "<td ><a class='pointDetail' data-id=" + item.id + "><img src='../../images/tupianbtn.png'></a></td>" + "</tr>"
                     } else {
                         items += "<tr>" + "<td class='status' data-id='" + item.id + "'></td>" + "<td>" + item.spot_name + "</td>" + "<td>" + item.spot_address + "</td>" + "<td ><a class='pointDetail' data-id=" + item.id + "><img src='../../images/tupianbtn.png'></a></td>" + "</tr>"
                     }
+
+
+
+                    if (item.pd) {
+                        items += "<tr class='selected'>" + "<td class='status checked' data-id='" + item.id + "' data-pd='" + item.pd + "'></td>" + "<td>" + item.spot_name + "</td>" + "<td>" + item.spot_address + "</td>" + "<td ><a class='pointDetail' data-id=" + item.id + "><img src='../../images/tupianbtn.png'></a></td>" + "</tr>"
+                    }
+
+
+
                 });
                 $('#dataList2').html(items);
                 $('#dataList3').html(items);

+ 1 - 1
operate-manage.html

@@ -30,7 +30,7 @@
                 </ul>
             </div>
             <div class="column3 flex10">
-                <iframe name="iframe" width="100%" height="100%" frameborder="0" src="pages/operation/record.html"></iframe>
+                <iframe name="iframe" width="100%" height="100%" frameborder="0" src="pages/operation/plan.html"></iframe>
             </div>
         </div>
     </section>