Last active
May 26, 2023 09:10
-
-
Save ViKingIX/d4e9d4cffdc56bdc7912f2890abcadea 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
javascript:(function confirmAsset($taskList_html = null) { | |
let taskList_url = 'personalManagement.do?action=listPersonalTask'; | |
jQuery.ajaxSetup({async:false}); | |
if (!$taskList_html) | |
$taskList_page = $(document); | |
else | |
$taskList_page = $($taskList_html); | |
$.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) { | |
confirmAsset(taskList_html)}); | |
}, 1500); | |
return false; | |
} else { | |
$.get(elem.href, function(page) { | |
let $page = $(page); | |
$page.find('input[name=action]').val('confirmAsset'); | |
$page.find('input[name=confirmed][value=0]').prop('checked', true); | |
data = $page.find('#asset_form').serialize(); | |
setTimeout(function() { | |
$.post('asset.do', data, function (resp) { | |
console.log(`${$page.find('#customizedId')[0].value} finished`); | |
setTimeout(() => { | |
$.get(taskList_url, function (taskList_html) { | |
confirmAsset(taskList_html)}); | |
}, 1500); | |
}); | |
}, 500); | |
}); | |
return false; | |
} | |
}); | |
console.log(`finished`); | |
})(); |
Author
ViKingIX
commented
May 26, 2023
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment