1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192 |
- "use strict";
- var Config = {
- title: "陕西广电融媒体集团",
- logoUrl: "http://zyx-data-base.oss-cn-beijing.aliyuncs.com/img/logonew2.png",
- baseUrl: "http://zyx-data-base.oss-cn-beijing.aliyuncs.com"
- };
- document.title = Config.title;
- $(".proName").append($("<img src='" + Config.logoUrl + "' alt='" + Config.title + "' class='img-rounded'>"));
- var pageName = getPageName();
- if (/skeleton/.test(pageName) && !localStorage.login) {
- location.href = "./index.html";
- }
- function getPageName() {
- var pathList = location.href.split('/');
- return pathList[pathList.length - 1];
- }
- function showAlert(text, s) {
- var ele = $("<div id='local-alert'><i class='glyphicon glyphicon-info-sign'></i>" + text + "</div>");
- $(document.body).prepend(ele);
- var timeout;
- timeout = window.setTimeout(function () {
- window.clearTimeout(timeout);
- $("#local-alert").addClass("fadeOutRightBig animated infinite");
- timeout = window.setTimeout(function () {
- window.clearTimeout(timeout);
- $("#local-alert").remove();
- }, 500);
- }, s || 2000);
- }
- function createTable(ele, theadList, list) {
- $(ele + " .localtable").remove();
- var pele = $(ele);
- var table = $("<table class='table localtable'></table>");
- var thead = $("<thead></thead>");
- var tbody = $("<tbody></tbody>");
- var trHead = $("<tr></tr>");
- var theadListL = theadList || [];
- var listL = list || [];
- theadListL.map(function (v, i) {
- var td = $("<td class='" + v.className + " " + (i % 2 === 1 ? 'deepBlue' : '') + "'>" + v.title + "</td>");
- trHead.append(td);
- });
- listL.map(function (v, o) {
- var className = o % 2 === 1 ? "oddRow" : "";
- var trBody = $("<tr class='" + className + "'></tr>");
- theadListL.map(function (titleI) {
- var val = titleI.value === "#index" ? o + 1 : v[titleI.value];
- titleI.formatValue && (val = titleI.formatValue(val));
- var td = $("<td class='" + titleI.className + "'>" + val + "</td>");
- trBody.append(td);
- });
- tbody.append(trBody);
- });
- thead.append(trHead);
- table.append(thead);
- table.append(tbody);
- pele.append(table);
- }
- function createPager(totalPage, pageIndex, pele, section) {
- $("nav.localnavigation").remove();
- var sectionReal = section || 2;
- var nav = $("<nav class='localnavigation' aria-label='Page navigation'></nav>");
- var ul = $("<ul class='pagination'><li class='proPage'><a href='##' aria-label='Previous'><span aria-hidden='true'>«</span></a></li></ul>");
- var next = $('<li class="nextPage"><a href="##" aria-label="Next"><span aria-hidden="true">»</span></a></li>');
- var minPage = pageIndex - sectionReal > 1 ? pageIndex - sectionReal : 1;
- var maxPage = pageIndex + sectionReal < totalPage ? pageIndex + sectionReal : totalPage;
- if (minPage !== 1) {
- ul.append($("<li class='inPage'><a href='##'>1</a></li>"));
- ul.append($("<li><a href='##'>...</a></li>"));
- }
- for (var i = minPage; i <= maxPage; i++) {
- var li = $("<li class='inPage " + (i == pageIndex ? "selectPage" : "") + "'><a href='##'>" + i + "</a></li>");
- ul.append(li);
- }
- if (maxPage !== totalPage) {
- ul.append($("<li><a href='##'>...</a></li>"));
- ul.append($("<li class='inPage'><a href='##'>" + totalPage + "</a></li>"));
- }
- ul.append(next);
- nav.append(ul);
- $(pele).append(nav);
- }
|