Last active
May 15, 2023 10:03
-
-
Save ViKingIX/205696d061e6d60d18e7121cbd6749fe to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(function confirmRiskItemChained($taskList_html = null) { | |
let taskList_url = 'personalManagement.do?action=listPersonalTask'; | |
if (!$taskList_html) | |
$taskList_page = $(document); | |
else | |
$taskList_page = $($taskList_html); | |
if ($taskList_page.find('table#countTask1 tr td:nth-child(7) a').length == 0) | |
console.log('finished'); | |
$.each($taskList_page.find('table#countTask1 tr td:nth-child(7) a'), function(i, elem) { | |
let task = $taskList_page.find('table#countTask1 tr td:nth-child(2)')[i].innerHTML.split(/\s+/).join(' '); | |
if (task == localStorage.getItem('task')) { | |
setTimeout(() => { | |
$.get(taskList_url, function (taskList_html) { | |
confirmRiskItemChained(taskList_html)}); | |
}, 1500).fail(function () { | |
location.reload(); | |
}); | |
} else { | |
$.get(elem.href, function(page) { | |
let $page = $(page); | |
$page.find('input[name=action]').val('confirmRiskItem'); | |
data = $page.find('#risk_form').serialize(); | |
setTimeout(function() { | |
$.post('riskManagement.do', data, function (resp) { | |
console.log(`${$page.find('#customizedId')[0].value} finished`); | |
setTimeout(() => { | |
$.get(taskList_url, function (taskList_html) { | |
confirmRiskItemChained(taskList_html) | |
}).fail(function () { | |
location.reload(); | |
}); | |
}, 1500); | |
}); | |
}, 500); | |
}); | |
} | |
return false; | |
}); | |
})(); |
Author
ViKingIX
commented
May 15, 2023
•
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment