'use strict';
/**
 *
 *
 * @author Mai
 * @date 2019/2/27
 * @version
 */
$(document).ready(function () {
    let timer = null
    let oldSearchVal = null
    // 获取审核相关url
    function getUrlPre () {
        const path = window.location.pathname.split('/');
        return _.take(path, 6).join('/');
    }
    $('#gr-search').bind('input propertychange', function(e) {
        oldSearchVal = e.target.value
        timer && clearTimeout(timer)
        timer = setTimeout(() => {
            const newVal = $('#gr-search').val()
            let html = ''
            if (newVal && newVal === oldSearchVal) {
                accountList.filter(item => item && cur_uid !== item.id && (item.name.indexOf(newVal) !== -1 || (item.mobile && item.mobile.indexOf(newVal) !== -1))).forEach(item => {
                    html += `
`
                        group.groupList.forEach(item => {
                            if (item.id !== cur_uid) {
                                html += `
                                    ${item.name}${item.mobile || ''}
                                    ${item.role || ''}
                                `
                            }
                        });
                        html += '