123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276 |
-
- Namespace.register("U.PG");
- U.PG.PPage = function (UOD, USN, UNP, UDN, UCF, UTF) {
- var i, j, _USE, _UKE,
- _UME = U.PG.PPage.setPage(USN, UNP, UDN, UCF);
- if (U.Ut.isFunction(UTF)) {
- _USE = UTF(this);
- _UKE = {
- "pre": { "onclick": [[U.PG.PPage.exec, [UNP - 1, _UBE[1], UOD, USN, UNP, UDN, UCF]]] },
- "next": { "onclick": [[U.PG.PPage.exec, [UNP + 1, _UBE[2], UOD, USN, UNP, UDN, UCF]]] },
- "frit": { "onclick": [[U.PG.PPage.exec, [1, _UBE[0], UOD, USN, UNP, UDN, UCF]]] },
- "last": { "onclick": [[U.PG.PPage.exec, [UNP + 1, _UBE[2], UOD, USN, UNP, UDN, UCF]]] },
- "input": [{ "onkeyup": [U.M.returnkeylogin, [null, [[U.PG.PPage.PageAchieve, [UDE[3], UOD, USN, UNP, UDN, UCF, null, UDP]]]]] },
- { "onclick": [[U.PG.PPage.PageAchieve, [UDE[3], UOD, USN, UNP, UDN, UCF, null, UDP]]]}],
- "page": []
- };
- for (i in _USE) {
- if (_USE.hasOwnProperty(i) && _UKE[i]) {
- if (U.Ut.isArray(_UKE[i])) {
- for (j = 0; j < _UKE[i].length; j++) {
- }
- }
- else {
- for (j in _UKE[i]) {
- _USE[i][j] = _UKE[i][j]
- }
- }
- }
- }
- }
- else if (!UTF) {
- U.PG.PPage.CPage(_UME[0], UOD, _UME[1], UNP, USN, UDN, UCF)
- }
- return _UME;
- }
- U.PG.PPage.CPage = function (UDE, UOD, UDP, UNP, USN, UDN, UCF, UDOD) {
- var i, _UN, _USP, _UDOD, _UDTD, _UDSD, _UDGD, _UTE, _UAE, _UCE = [], _UBE = [];
- for (i = 0; i < 4; i++) {
- switch (i) {
- case 0:
- _UTF = UNP != 1;
- break;
- case 1:
- _UTF = UNP > 1;
- break;
- case 2:
- _UTF = UNP < UDP;
- break;
- case 3:
- _UTF = UNP != UDP;
- break;
- }
- if (_UTF) {
- _UBE[i] = UDE[i == 3 ? i + 1 : i];
- } else {
- _UCE[i] = "O";
- }
- }
- if (UDOD) {
-
- _UDTD = $(UDOD).Child(),
- _UDAD = $(_UDTD[0]).childg(),
- _UTE = [1, UNP - 1, UNP + 1, UDP];
- $(_UDTD[1]).Child()[2].innerText = UNP + "页";
- _UAE = ["O", "T", "S", "F"];
-
- for (i = 0; i < 4; i++) {
- _UDAD.addAttrArray({
- "onclick": _UCE[i] ? "" : [[U.PG.PPage.exec, [_UTE[i], _UBE[i], UOD, USN, UNP, UDN, UCF, UDOD]]],
- "className": "UD_SYI UD_SYFYL" + _UAE[i] + (_UCE[i] || "")
- }, (UCF.isp && i > 1) ? i + 1 : i);
- }
-
- if (UCF.isp) {
- _UDAD[2].innerText = "";
- _UN = UNP > 5 ? UNP - 5 : 0;
- _USP = UNP + UCF.isp > UDP ? UDP : UNP + UCF.isp;
- _UAE = U.PG.PPage.setPage([_UN, _USP], null, null, UCF);
- for (i = _UN; i < _USP; i++) {
- $$("div", { "onclick": [[U.PG.PPage.exec, [i + 1, _UAE[i - _UN], UOD, USN, UNP, UDN, UCF, UDOD]]], "className": "UD_SYFYNO" + ((i + 1 == UNP) ? " UD_SYFYNOO" : ""), "innerHTML": i + 1 }, _UDAD[2]);
- }
- }
- $(_UDTD[1]).childg(0, 1).addAttrArray({
- "onclick": (_UTE = [[U.PG.PPage.PageAchieve, [UDE[3], UOD, USN, UNP, UDN, UCF, UDOD, UDP]]])
- }, 8);
- $("input", UDOD).addAttrArray({
- "onkeyup": [[U.M.returnkeylogin, [null, _UTE]]]
- });
- }
- else {
- _UDOD = $$("div", {
- "className": "UD_SYFY"
- });
- _UDTD = $$("div", {
- "className": "UD_SYFYL"
- }, _UDOD);
- $$("div", {
- "className": "UD_SYI UD_SYFYLO" + (_UCE[0] || ""),
- "onclick": _UCE[0] ? null : [[U.PG.PPage.exec, [1, _UBE[0], UOD, USN, UNP, UDN, UCF, _UDOD]]],
- "title": "首页"
- }, _UDTD);
- $$("div", {
- "className": "UD_SYI UD_SYFYLT" + (_UCE[1] || ""),
- "onclick": _UCE[1] ? null : [[U.PG.PPage.exec, [UNP - 1, _UBE[1], UOD, USN, UNP, UDN, UCF, _UDOD]]],
- "title": "上一页"
- }, _UDTD);
- if (UCF.isp && UDP > 0) {
- _UDSD = $$("div", { "className": "UD_SYFYN" }, _UDTD);
- _UN = UNP > 5 ? UNP - 5 : 0;
- _USP = UNP + UCF.isp > UDP ? UDP : UNP + UCF.isp;
- _UAE = U.PG.PPage.setPage([_UN, _USP], null, null, UCF);
- for (i = _UN; i < _USP; i++) {
- $$("div", { "onclick": [[U.PG.PPage.exec, [i + 1, _UAE[i - _UN], UOD, USN, UNP, UDN, UCF, _UDOD]]], "className": "UD_SYFYNO" + ((i + 1 == UNP) ? " UD_SYFYNOO" : ""), "innerHTML": i + 1 }, _UDSD);
- }
- }
- $$("div", {
- "className": "UD_SYI UD_SYFYLS" + (_UCE[2] || ""),
- "onclick": _UCE[2] ? null : [[U.PG.PPage.exec, [UNP + 1, _UBE[2], UOD, USN, UNP, UDN, UCF, _UDOD]]],
- "title": "下一页"
- }, _UDTD);
- $$("div", {
- "className": "UD_SYI UD_SYFYLF" + (_UCE[3] || ""),
- "onclick": _UCE[3] ? null : [[U.PG.PPage.exec, [UDP, _UBE[3], UOD, USN, UNP, UDN, UCF, _UDOD]]],
- "title": "尾页"
- }, _UDTD);
- _UDTD = $$("div", {
- "className": "UD_SYFYR"
- }, _UDOD);
- _UDSD = $$("div", {
- "className": "UD_SYFYRL"
- }, _UDTD);
- $$("span", {
- "innerHTML": "到"
- }, _UDSD);
- _UDGD = $$("div", {}, _UDSD);
- $$("input", {
- "type": "text",
- "onkeyup": [U.M.returnkeylogin, [null, [[U.PG.PPage.PageAchieve, [UDE[3], UOD, USN, UNP, UDN, UCF, _UDOD, UDP]]]]]
- }, _UDGD);
- $$("span", {
- "innerHTML": "页"
- }, _UDSD);
- $$("div", {
- "className": "UD_SYFYRZ",
- "innerHTML": "确定",
- "onclick": [[U.PG.PPage.PageAchieve, [UDE[3], UOD, USN, UNP, UDN, UCF, _UDOD, UDP]]]
- }, _UDTD);
- $$("div", {
- "className": "UD_SYFYRR",
- "innerHTML": UNP + "页"
- }, _UDTD);
- UOD.appendChild(_UDOD);
- }
- }
- U.PG.PPage.exec = function (UTF, UFN, UOD, USN, UNP, UDN, UCF, UDOD) {
- if (UFN != null) {
- var _UDE = U.PG.PPage.main(UOD, USN, UTF, UDN, UCF, true);
- U.PG.PPage.CPage(_UDE[0], UOD, Math.ceil(USN / UDN), UTF, USN, UDN, UCF, UDOD);
- U.M.apply(this, UFN)();
- }
- }
- U.PG.PPage.PageAchieve = function (UFN, UOD, USN, UNP, UDN, UCF, UDOD, UDP) {
- var _UN = $(event.srcElement).parentg().find("input")[0].value;
- if (U.MS.Number.test(_UN)) {
- _UN = _UN.toInt();
- if (_UN <= UDP && _UN > 0) {
- (UNP != _UN) && (U.PG.PPage.exec(_UN, UFN, UOD, USN, UNP, UDN, UCF, UDOD));
- }
- else {
- parent.U.Alert("输入范围异常!");
- }
- }
- else {
- parent.U.Alert("无效输入!");
- }
- };
- U.PG.PPage.setPage = function (USN, UNP, UDN, UCF) {
- var i, j, k, _USE, _UKE, _UGE, _UME = [],
- _UCE = UCF["fun"],
- _UIP = UCF["page"];
- if (U.Ut.isArray(USN)) {
- for (i = USN[0]; i < USN[1]; i++) {
- _UGE = [];
- for (j = 0; j < _UCE.length; j++) {
- _USE = _UCE[j][1];
- if (_UIP[j] != null) {
- _USE = _USE.concat();
- _USE[_UIP[j]] = i + 1;
- }
- _UGE.push[_UCE[j][0], _USE];
- }
- _UME.push(_UGE);
- }
- return _UME;
- }
- else {
- var _UDP = Math.ceil(USN / UDN),
- _UDE = [1, UNP - 1, UNP + 1, "$(event.srcElement).parentg().find('input')[0].value", _UDP];
- for (i = 0; i < _UDE.length; i++) {
- _UGE = [];
- for (j = 0; j < _UCE.length; j++) {
- _USE = _UCE[j][1];
- if (_UIP[j] != null) {
- _USE = _USE.concat();
- _USE[_UIP[j]] = _UDE[i];
- }
- _UGE.push[_UCE[j][0], _USE];
- }
- _UME.push(_UGE);
- }
- return [_UME, _UDP];
- }
- }
- U.PG.PPage.main = function (UOD, USN, UNP, UDN, UCF, UTF) {
- var i, j, _USE, _UKE,
- _UME = U.PG.PPage.setPage(USN, UNP, UDN, UCF);
- if (U.Ut.isFunction(UTF)) {
- _USE = UTF(this);
- _UKE = {
- "pre": { "onclick": [[U.PG.PPage.exec, [UNP - 1, _UBE[1], UOD, USN, UNP, UDN, UCF]]] },
- "next": { "onclick": [[U.PG.PPage.exec, [UNP + 1, _UBE[2], UOD, USN, UNP, UDN, UCF]]] },
- "frit": { "onclick": [[U.PG.PPage.exec, [1, _UBE[0], UOD, USN, UNP, UDN, UCF]]] },
- "last": { "onclick": [[U.PG.PPage.exec, [UNP + 1, _UBE[2], UOD, USN, UNP, UDN, UCF]]] },
- "input": [{ "onkeyup": [U.M.returnkeylogin, [null, [[U.PG.PPage.PageAchieve, [UDE[3], UOD, USN, UNP, UDN, UCF, null, UDP]]]]] },
- { "onclick": [[U.PG.PPage.PageAchieve, [UDE[3], UOD, USN, UNP, UDN, UCF, null, UDP]]]}],
- "page": []
- };
- for (i in _USE) {
- if (_USE.hasOwnProperty(i) && _UKE[i]) {
- if (U.Ut.isArray(_UKE[i])) {
- for (j = 0; j < _UKE[i].length; j++) {
- }
- }
- else {
- for (j in _UKE[i]) {
- _USE[i][j] = _UKE[i][j]
- }
- }
- }
- }
- }
- else if (!UTF) {
- U.PG.PPage.CPage(_UME[0], UOD, _UME[1], UNP, USN, UDN, UCF)
- }
- return _UME;
- }
- ;
|