(function (window, undefined) { var nodesArr = new Array(); var id = UrlParm.parm("id"); var cid = UrlParm.parm("cid"); var tid = UrlParm.parm("tid"); var gid = new Array(); var templetid = new Array(); var width = 0; var height = 0; LayShow = function () { return new LayShow.fn.init(); } LayShow.fn = LayShow.prototype = { init: function () { LayShow.fn.Construction(); setInterval(function () { LayShow.fn.Count(); }, 120000) //每1000毫秒(即1秒) 执行一次本段代码 }, OpenURL: function (url) { var MainCenter = window.parent.parent.panelEdit.MainCenter; var children = MainCenter.items; var mod = ""; var title = ""; var finded = false; //得到mod的name var _store = Ext.create('DsExt.ux.RefTableStore', { fields: [ { name: 'ModuleName', type: 'string' }, { name: 'ModuleDescription', type: 'string' } ], proxy: { url: '/MvcShipping/MsTemplet/GetModuleName' }, scope: this }); _store.load({ params: { url: url} }); _store.on("load", function (_store) { mod = _store.getAt(0).get("ModuleName"); title = _store.getAt(0).get("ModuleDescription"); for (var i = 0; i < children.length; i++) { if (children.items[i].id) { if (children.items[i].id == 'pnl' + mod) { MainCenter.setActiveTab(i); finded = true; } } } if (!finded) { var paneltabitems = new Ext.Panel({ id: 'pnl' + mod, layout: "fit", region: "center", autoScroll: true, frame: false, closable: true, bodyStyle: {}, title: title, html: ' ' }); MainCenter.add(paneltabitems); MainCenter.setActiveTab(paneltabitems); MainCenter.doLayout(); } }); }, Construction: function () { //构建页面元素 var strConstruction = ""; var strChildConstruction = ""; var strContain = ""; gid.length = 0; templetid.length = 0; Ext.Ajax.request({ async: false, url: '/MvcShipping/MsTemplet/ReadPageStructure', params: { url: "LayShow2", id: ".", param: "1" }, callback: function (options, success, response) { if (success) { var result = Ext.JSON.decode(response.responseText); var data = result.data; for (var iCount = 0; iCount < data.length; iCount++) { height = parseInt(document.documentElement.clientHeight / 3.9); strConstruction += "
  • "; strConstruction += "
    "; strConstruction += "
    " + data[iCount].ITEMNAME + "
    "; strConstruction += ""; strConstruction += "
  • "; } } }, scope: this }); document.getElementById("containUL").innerHTML = strConstruction; }, Count: function () { for (var iCount = 0; iCount < gid.length; iCount++) { Ext.Ajax.request({ async: false, url: '/MvcShipping/MsTemplet/GetCount', params: { id: gid[iCount], templetid: templetid[iCount] }, //data[iCount].GID gid templetid callback: function (option, success, response) { if (success) { var result = Ext.JSON.decode(response.responseText); var data = result.data; document.getElementById(gid[iCount]).innerText = data; } }, scope: this }); } } } LayShow.fn.init.prototype = LayShow.fn; LayShow.fn.init.prototype = LayShow.fn; var rootjLayShow = LayShow(document); } (window));