!function(){var e={InviteCategoryId:[],PostCategoryId:[]},t=[],a=10;function i(e){var t={},a={};$(".list-body").empty(),$.each(data.InviteCategory,function(e,a){t[a.Value]=a.Name}),$.each(data.PostCategory,function(e,t){a[t.Value]=t.Name}),$.each(e,function(e,i){var s=i.ModifyTime.split("T")[0].split("-"),n=`${s[0]}骞?{Number(s[1])}鏈?{s[2]}鏃,o=`
${i.Name}
灞曞紑
${i.Addr}|${a[i.PostCategoryId]}|${t[i.InviteCategoryId]}|${n}鍙戝竷
\n \n
${i.JobDescription}
\n \n
`;$(".list-body").append(o)})}function s(){var e="";if($(".page-list").empty(),$(".page-total").html(t.length),$(".job-num").text(t.length),t.length){for(var i=1;i<=Math.ceil(t.length/a);i++)e+=`
${i}
`;$(".page-list").append(e),$(".page-num").eq(0).addClass("active"),$(".page-sorter").css("margin-top","25px")}else $(".list-body").append('
鏆傛棤宀椾綅
')}function n(e){var t=$(".search-input").val();return data.RecruitPost.filter(function(a){return!(e.InviteCategoryId.length||e.PostCategoryId.length||t)||(e.InviteCategoryId.length||e.PostCategoryId.length||!t?e.InviteCategoryId.length||!e.PostCategoryId.length||t?!e.InviteCategoryId.length&&e.PostCategoryId.length&&t?e.PostCategoryId.includes(a.PostCategoryId+"")&&a.Name.includes(t):!e.InviteCategoryId.length||e.PostCategoryId.length||t?e.InviteCategoryId.length&&!e.PostCategoryId.length&&t?e.InviteCategoryId.includes(a.InviteCategoryId+"")&&a.Name.includes(t):e.InviteCategoryId.length&&e.PostCategoryId.length&&!t?e.InviteCategoryId.includes(a.InviteCategoryId+"")&&e.PostCategoryId.includes(a.PostCategoryId+""):e.InviteCategoryId.includes(a.InviteCategoryId+"")&&e.PostCategoryId.includes(a.PostCategoryId+"")&&a.Name.includes(t):e.InviteCategoryId.includes(a.InviteCategoryId+""):e.PostCategoryId.includes(a.PostCategoryId+""):a.Name.includes(t))})}function o(){document.body.scrollTop=350,document.documentElement.scrollTop=350}$(function(){$(".search-btn").click(function(){var o=$(".search-input").val();i((t=o?t.filter(function(e){return e.Name.includes(o)}):n(e)).slice(0,a)),s()}),$(".search-input").change(function(){$(this).val()||(i((t=n(e)).slice(0,a)),s())}),$('input[type="checkbox"]').change(function(){var o=$(this)[0].name;$(this).is(":checked")?"InviteCategoryId"===o?e.InviteCategoryId.push($(this)[0].value):"PostCategoryId"===o&&e.PostCategoryId.push($(this)[0].value):"InviteCategoryId"===o?e.InviteCategoryId.splice(e.InviteCategoryId.indexOf($(this)[0].value),1):"PostCategoryId"===o&&e.PostCategoryId.splice(e.PostCategoryId.indexOf($(this)[0].value),1),i((t=n(e)).slice(0,a)),s()}),$(".clear-type").click(function(){t=data.RecruitPost,e.InviteCategoryId=[],e.PostCategoryId=[],$('input[type="checkbox"]').prop("checked",!1),i(t.slice(0,a)),s()}),$("body").on("click",".btn-open",function(){var e="鏀惰捣"===$(this).text()?"灞曞紑":"鏀惰捣",t=$(this).data("index"),a=$(".list-item")[t];$(this).text(e),"灞曞紑"===e?($(a).removeClass("heightFit"),$(a).find(".orange-prefix").addClass("hidden"),$(a).find(".job-contro").addClass("h45"),$(a).find(".job-respon").addClass("hidden"),$(a).find(".arrow").removeClass("arrow-top").addClass("arrow-bottom")):($(a).addClass("heightFit"),$(a).find(".orange-prefix").removeClass("hidden"),$(a).find(".job-contro").removeClass("h45"),$(a).find(".job-respon").removeClass("hidden"),$(a).find(".arrow").removeClass("arrow-bottom").addClass("arrow-top"))}),$("body").on("click",".list-item",function(e){"btn-open"!==e.target.className&&($(this).addClass("heightFit"),$(this).find(".btn-open").text("鏀惰捣"),$(this).find(".orange-prefix").removeClass("hidden"),$(this).find(".job-contro").removeClass("h45"),$(this).find(".job-respon").removeClass("hidden"),$(this).find(".arrow").removeClass("arrow-bottom").addClass("arrow-top"))}),$("body").on("click",".page-num",function(){var e=Number($(this).text());$(this).addClass("active").siblings().removeClass("active"),i(t.slice(a*(e-1),a*e)),o()}),$(".arrow-left").click(function(){var e=Number($(".page-num.active").text());1!=e&&(i(t.slice(a*(e-2),a*(e-1))),o(),$(".page-num.active").prev().addClass("active").siblings().removeClass("active"))}),$(".arrow-right").click(function(){var e=Number($(".page-num.active").text())+1;e>$(".page-num").length||(i(t.slice(a*(e-1),a*e)),o(),$(".page-num.active").next().addClass("active").siblings().removeClass("active"))})}),t=data.RecruitPost,$.each(data.InviteCategory,function(e,t){var a=`
`;$(".recruit-body").append(a)}),$.each(data.PostCategory,function(e,t){var a=`
`;$(".offer-body").append(a)}),i(t.slice(0,a)),s()}();