You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

admin-users.js 913B

1234567891011121314151617181920212223242526272829303132
  1. export function initAdminUserListSearchForm() {
  2. const searchForm = window.config.pageData.adminUserListSearchForm;
  3. if (!searchForm) return;
  4. const $form = $('#user-list-search-form');
  5. if (!$form.length) return;
  6. $form.find(`button[name=sort][value=${searchForm.SortType}]`).addClass('active');
  7. if (searchForm.StatusFilterMap) {
  8. for (const [k, v] of Object.entries(searchForm.StatusFilterMap)) {
  9. if (!v) continue;
  10. $form.find(`input[name="status_filter[${k}]"][value=${v}]`).prop('checked', true);
  11. }
  12. }
  13. $form.find(`input[type=radio]`).click(() => {
  14. $form.submit();
  15. return false;
  16. });
  17. $form.find('.j-reset-status-filter').click(() => {
  18. $form.find(`input[type=radio]`).each((_, e) => {
  19. const $e = $(e);
  20. if ($e.attr('name').startsWith('status_filter[')) {
  21. $e.prop('checked', false);
  22. }
  23. });
  24. $form.submit();
  25. return false;
  26. });
  27. }