WorkStat.js 53 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162
  1. MWF.xApplication.Execution = MWF.xApplication.Execution || {};
  2. MWF.xDesktop.requireApp("Template", "Explorer", null, false);
  3. MWF.require("MWF.widget.Identity", null,false);
  4. MWF.xApplication.Execution.WorkStat = new Class({
  5. Extends: MWF.widget.Common,
  6. Implements: [Options, Events],
  7. options: {
  8. "style": "default"
  9. },
  10. initialize: function (node, app, actions, options) {
  11. this.app = app;
  12. this.lp = app.lp.workStat;
  13. this.path = "/x_component_Execution/$WorkStat/";
  14. this.actions = actions;
  15. this.options.style = this.getViewStyle();
  16. this.setOptions(options);
  17. this.loadCss();
  18. this.node = $(node);
  19. },
  20. loadCss: function () {
  21. this.cssPath = "/x_component_Execution/$WorkStat/" + this.options.style + "/css.wcss";
  22. this._loadCss();
  23. },
  24. load: function () {
  25. this.middleContent = this.app.middleContent;
  26. //this.middleContent.setStyles({"margin-top":"0px","border":"0px solid #f00"});
  27. this.createNaviContent();
  28. //this.createContentDiv();
  29. this.resizeWindow();
  30. this.app.addEvent("resize", function(){
  31. this.resizeWindow();
  32. }.bind(this));
  33. },
  34. resizeWindow: function(){
  35. var size = this.app.middleContent.getSize();
  36. this.naviDiv.setStyles({"height":(size.y-40)+"px"});
  37. this.naviContentDiv.setStyles({"height":(size.y-180)+"px"});
  38. this.contentDiv.setStyles({"height":(size.y-60)+"px"});
  39. if(this.deptStatContent){
  40. this.deptStatContent.setStyles({"height":(size.y-130)+"px"})
  41. }
  42. if(this.statViewListDiv){
  43. var y = this.contentDiv.getSize().y - this.dateToolbar.getSize().y - this.dateStatListDiv.getSize().y
  44. this.statViewListDiv.setStyles({"height":(y-40)+"px"})
  45. }
  46. },
  47. createNaviContent: function(){
  48. this.naviDiv = new Element("div.naviDiv",{
  49. "styles":this.css.naviDiv
  50. }).inject(this.middleContent);
  51. this.naviTitleDiv = new Element("div.naviTitleDiv",{
  52. "styles":this.css.naviTitleDiv,
  53. "text": this.lp.minderExplorerTitle
  54. }).inject(this.naviDiv);
  55. this.naviContentDiv = new Element("div.naviContentDiv",{"styles":this.css.naviContentDiv}).inject(this.naviDiv);
  56. this.naviBottomDiv = new Element("div.naviBottomDiv",{"styles":this.css.naviBottomDiv}).inject(this.naviDiv);
  57. this.createContentDiv();
  58. var jsonUrl = this.path+"navi.json";
  59. MWF.getJSON(jsonUrl, function(json){
  60. json.each(function(data, i){
  61. var naviContentLi = new Element("li.naviContentLi",{"styles":this.css.naviContentLi}).inject(this.naviContentDiv);
  62. naviContentLi.addEvents({
  63. "mouseover" : function(ev){
  64. if(this.bindObj.currentNaviItem != this.node)this.node.setStyles( this.styles )
  65. }.bind({"styles": this.css.naviContentLi_over, "node":naviContentLi, "bindObj": this }) ,
  66. "mouseout" : function(ev){
  67. if(this.bindObj.currentNaviItem != this.node)this.node.setStyles( this.styles )
  68. }.bind({"styles": this.css.naviContentLi, "node":naviContentLi, "bindObj": this }) ,
  69. "click" : function(ev){
  70. if( this.bindObj.currentNaviItem )this.bindObj.currentNaviItem.setStyles( this.bindObj.css.naviContentLi );
  71. this.node.setStyles( this.styles );
  72. this.bindObj.currentNaviItem = this.node;
  73. if( this.action && this.bindObj[this.action] ){
  74. this.bindObj[this.action]();
  75. }
  76. }.bind({"styles": this.css.naviContentLi_current, "node":naviContentLi, "bindObj": this, "action" : data.action }) ,
  77. })
  78. var naviContentImg = new Element("img.naviContentImg",{
  79. "styles":this.css.naviContentImg,
  80. "src":this.path+"default/icon/"+data.icon
  81. }).inject(naviContentLi);
  82. var naviContentSpan = new Element("span.naviContentSpan",{
  83. "styles":this.css.naviContentSpan,
  84. "text":data.title
  85. }).inject(naviContentLi);
  86. if( i == 0 ){
  87. naviContentLi.click();
  88. }
  89. }.bind(this));
  90. }.bind(this));
  91. },
  92. createContentDiv: function(){
  93. this.contentDiv = new Element("div.contentDiv",{"styles":this.css.contentDiv}).inject(this.middleContent);
  94. },
  95. //*************************中心工作开始**************************************
  96. openCenterWork: function(){
  97. this.contentDiv.empty();
  98. this.loadCategoryBar();
  99. this.loadToolbar();
  100. //this.loadView();
  101. },
  102. loadCategoryBar : function(){
  103. var _self = this;
  104. this.categoryBar = new Element("div.categoryBar",{"styles":this.css.categoryBar}).inject(this.contentDiv);
  105. this.allCategoryNode = new Element("li.allCategoryNode", {
  106. "styles": this.css.categoryNode,
  107. "text" : this.lp.category.all
  108. }).inject(this.categoryBar)
  109. this.allCategoryNode.addEvents({
  110. "mouseover" : function(){ if( this.currentCategoryNode != this.allCategoryNode)this.allCategoryNode.setStyles(this.css.categoryNode_over) }.bind(this),
  111. "mouseout" : function(){ if( this.currentCategoryNode != this.allCategoryNode)this.allCategoryNode.setStyles(this.css.categoryNode) }.bind(this),
  112. "click":function(){
  113. if( this.currentCategoryNode )this.currentCategoryNode.setStyles(this.css.categoryNode);
  114. this.currentCategoryNode = this.allCategoryNode;
  115. this.allCategoryNode.setStyles(this.css.categoryNode_current);
  116. this.loadView( )
  117. }.bind(this)
  118. })
  119. this.actions.getCategoryCountAll( function( json ){
  120. json.data.each( function( d ){
  121. var categoryNode = new Element("li.categoryNode", {
  122. "styles": this.css.categoryNode,
  123. "text" : d.workTypeName + "(" + d.centerCount +")"
  124. }).inject(this.categoryBar);
  125. categoryNode.store( "workTypeName" , d.workTypeName );
  126. categoryNode.addEvents({
  127. "mouseover" : function(){ if( _self.currentCategoryNode != this.node)this.node.setStyles(_self.css.categoryNode_over) }.bind({node : categoryNode }),
  128. "mouseout" : function(){ if( _self.currentCategoryNode != this.node)this.node.setStyles(_self.css.categoryNode) }.bind({node : categoryNode }),
  129. "click":function(){
  130. if( _self.currentCategoryNode )_self.currentCategoryNode.setStyles(_self.css.categoryNode);
  131. _self.currentCategoryNode = this.node;
  132. this.node.setStyles(_self.css.categoryNode_current);
  133. _self.loadView( )
  134. }.bind({ name : d.workTypeName, node : categoryNode })
  135. })
  136. }.bind(this))
  137. }.bind(this), null, false
  138. )
  139. this.allCategoryNode.click();
  140. },
  141. loadToolbar: function(){
  142. this.toolbar = new Element("div.toolbar",{
  143. styles : this.css.toolbar
  144. }).inject(this.categoryBar)
  145. //this.toolbarTextNode = new Element("div",{
  146. // styles : this.css.toolbarTextNode,
  147. // text: this.lp.workTask.centerWork,
  148. //}).inject(this.toolbar);
  149. this.fileterNode = new Element("div.fileterNode",{
  150. styles : this.css.fileterNode
  151. }).inject(this.toolbar);
  152. this.loadFilter();
  153. },
  154. loadFilter: function () {
  155. var _self = this;
  156. var html = "<table bordr='0' cellpadding='5' cellspacing='0' styles='filterTable'>" +
  157. "<tr>" +
  158. //" <td styles='filterTableTitle' lable='year'></td>" +
  159. //" <td styles='filterTableValue' item='year'></td>" +
  160. //" <td styles='filterTableTitle' lable='workLevel'></td>" +
  161. //" <td styles='filterTableValue' item='workLevel'></td>" +
  162. //" <td styles='filterTableTitle' lable='workType'></td>" +
  163. //" <td styles='filterTableValue' item='workType'></td>" +
  164. //" <td styles='filterTableTitle' lable='star'></td>" +
  165. //" <td styles='filterTableValue' item='star'></td>" +
  166. " <td styles='filterTableValue' item='title'></td>" +
  167. " <td styles='filterTableValue' item='searchAction'></td>" +
  168. " <td styles='filterTableValue' item='returnAction' style='display:none;'></td>" +
  169. "</tr>" +
  170. "</table>"
  171. this.fileterNode.set("html", html);
  172. MWF.xDesktop.requireApp("Template", "MForm", function () {
  173. this.filter = new MForm(this.fileterNode, {}, {
  174. style: "execution",
  175. isEdited: true,
  176. itemTemplate: {
  177. //year: {
  178. // "text": this.lp.yearCount +":", "type": "select", "className": "inputSelectUnformatWidth",
  179. // "selectValue": function () {
  180. // var years = [], year = new Date().getFullYear();
  181. // for (var i = 0; i < 6; i++) years.push(year--);
  182. // return years;
  183. // }
  184. //},
  185. //workLevel: {
  186. // "text": this.lp.level +":", "type": "select","className": "inputSelectUnformatWidth",
  187. // "selectValue": this.lp.workForm.workLevelValue.split(",")
  188. //},
  189. //workType: {
  190. // "text": this.lp.type +":","type": "select","className": "inputSelectUnformatWidth",
  191. // "selectValue": this.lp.workForm.workTypeValue.split(",")
  192. //},
  193. //star: {"text": this.lp.starWork +":", "type": "select", "className": "inputSelectUnformatWidth", "selectValue": this.lp.starWorkText.split(",")},
  194. title: { "style":this.css.filterTitle , defaultValue : this.lp.searchText, "event" : {
  195. focus : function( item ){ if(item.get("value")==_self.lp.searchText)item.setValue("") },
  196. blur : function( item ){ if(item.get("value").trim()=="")item.setValue(_self.lp.searchText) },
  197. keydown: function( item, ev){
  198. if (ev.code == 13){ //回车,搜索
  199. _self.fileterNode.getElements("[item='returnAction']").setStyle("display","");
  200. _self.loadView( );
  201. }
  202. }.bind(this)
  203. }},
  204. searchAction: {
  205. "type": "button", "value": this.lp.search, "style": this.css.filterButton,
  206. "event": {
  207. "click": function () {
  208. _self.fileterNode.getElements("[item='returnAction']").setStyle("display","");
  209. _self.loadView( );
  210. }
  211. }
  212. },
  213. returnAction : {
  214. "type": "button", "value": this.lp.return, "style": this.css.filterButton,
  215. "event": {
  216. "click": function () {
  217. _self.filter.getItem("title").setValue( _self.lp.searchText );
  218. _self.fileterNode.getElements("[item='returnAction']").setStyle("display","none");
  219. _self.loadView();
  220. }
  221. }
  222. }
  223. }
  224. }, this.app, this.css);
  225. this.filter.load();
  226. }.bind(this), true);
  227. },
  228. loadView : function( ){
  229. var filterData = {};
  230. if( this.currentCategoryNode ){
  231. var value = this.currentCategoryNode.retrieve("workTypeName");
  232. if( value && value != "" ){
  233. //filterData.defaultWorkTypes = [value];
  234. filterData.workTypes = [value];
  235. }
  236. }
  237. if( this.filter ){
  238. var fd = this.filter.getResult(true, ",", true, true, true);
  239. fd.title = fd.title.replace(this.lp.searchText,"");
  240. for( var key in fd ){
  241. if( fd[key] != "" ){
  242. filterData[key] = fd[key];
  243. }
  244. }
  245. }
  246. var flag = false;
  247. if( this.viewContainer ){
  248. flag = true;
  249. this.viewContainer.destroy();
  250. }
  251. this.viewContainer = Element("div",{
  252. "styles" : this.css.viewContainer
  253. }).inject(this.contentDiv);
  254. this.setViewSize();
  255. if( !flag ){
  256. this.setViewSizeFun = this.setViewSize.bind(this);
  257. this.app.addEvent("resize", this.setViewSizeFun );
  258. }
  259. if( this.view ){
  260. this.view.destroy();
  261. }
  262. this.getViewStyle();
  263. this.view = new MWF.xApplication.Execution.WorkStat.WorkView( this.viewContainer, this.app, this, {
  264. //templateUrl : this.path+ ( this.getViewStyle() == "default" ? "listItem.json" : "listItem_graph.json" ),
  265. templateUrl : this.path + "listItem_stat.json",
  266. "scrollEnable" : true
  267. }, {
  268. lp : this.lp.centerWorkView
  269. })
  270. if( filterData )this.view.filterData = filterData;
  271. this.view.load();
  272. },
  273. getViewStyle : function(){
  274. if( this.viewStyle ) return this.viewStyle;
  275. this.actions.getProfileByCode( { "configCode" : "MIND_LISTSTYLE"} ,function( json ){
  276. if( json.data ){
  277. this.viewStyle = ( json.data.configValue == "ICON" ? "graph" : "default");
  278. }else{
  279. this.viewStyle = "default";
  280. }
  281. }.bind(this), function(){
  282. this.viewStyle = "default";
  283. }.bind(this), false );
  284. return this.viewStyle || "default";
  285. },
  286. setViewSize: function(){
  287. var size = this.app.middleContent.getSize();
  288. var categoryBarSzie = this.categoryBar ? this.categoryBar.getSize() : {x:0, y:0};
  289. this.viewContainer.setStyles({"height":(size.y - categoryBarSzie.y - 56 )+"px"});
  290. },
  291. //*************************中心工作结束**************************************
  292. //*************************按部门统计开始**************************************
  293. statDepartment:function(){
  294. this.contentDiv.empty();
  295. this.deptToolbar = new Element("div.deptToolbar",{
  296. styles : this.css.deptToolbar
  297. }).inject(this.contentDiv)
  298. this.deptFileterNode = new Element("div.deptFileterNode",{
  299. styles : this.css.fileterNode
  300. }).inject(this.deptToolbar);
  301. this.loadDeptFilter();
  302. },
  303. loadDeptFilter: function () {
  304. var _self = this;
  305. _self.nowDate = new Date();
  306. _self.day = new Date(_self.nowDate.getFullYear(),(_self.nowDate.getMonth()+1),0);
  307. var html = "<table bordr='0' cellpadding='5' cellspacing='0' styles='filterTable'>" +
  308. "<tr>" +
  309. " <td styles='filterTableValue' item='beginDate'></td>" +
  310. " <td styles='filterTableValue' item='endDate'></td>" +
  311. " <td styles='filterTableValue' item='workType'></td>" +
  312. " <td styles='filterTableValue' item='centerWork'></td>" +
  313. " <td styles='filterTableValue' item='reportCycle'></td>" +
  314. " <td styles='filterTableValue' item='searchAction'></td>" +
  315. " <td styles='filterTableValue' item='returnAction' style='display:none;'></td>" +
  316. " <td styles='filterTableValue' item='exportAction'></td>" +
  317. "</tr>" +
  318. "</table>"
  319. this.deptFileterNode.set("html", html);
  320. var defaultWorkType="";
  321. this.actions.listCategoryAll(function(json){
  322. if(json.type=="success"){
  323. json.data.each(function(d,i){
  324. defaultWorkType = defaultWorkType + "," + d.workTypeName
  325. }.bind(this))
  326. }
  327. }.bind(this),null,false)
  328. MWF.xDesktop.requireApp("Template", "MForm", function () {
  329. this.deptFilter = new MForm(this.deptFileterNode, {}, {
  330. style: "execution",
  331. isEdited: true,
  332. onPostLoad: function(){
  333. _self.loadDeptStat()
  334. }.bind(this),
  335. itemTemplate: {
  336. beginDate:{
  337. "style":this.css.filterTitle,
  338. tType:"date",
  339. name:"beginDate",
  340. attr : {readonly:true},
  341. notEmpty:true,
  342. defaultValue : _self.nowDate.getFullYear()+"-"+(_self.nowDate.getMonth()+1)+"-01",
  343. "event":{
  344. focus : function( item ){ if(item.get("value")==_self.lp.deptStat.beginDate)item.setValue("") },
  345. blur : function( item ){ if(item.get("value").trim()=="")item.setValue(_self.lp.deptStat.beginDate) },
  346. }
  347. },
  348. endDate:{
  349. "style":this.css.filterTitle,
  350. tType:"date",
  351. name:"endDate",
  352. attr : {readonly:true},
  353. notEmpty:true,
  354. defaultValue : _self.nowDate.getFullYear()+"-"+(_self.nowDate.getMonth()+1)+"-"+_self.day.getDate(),
  355. "event":{
  356. focus : function( item ){ if(item.get("value")==_self.lp.deptStat.endDate)item.setValue("") },
  357. blur : function( item ){ if(item.get("value").trim()=="")item.setValue(_self.lp.deptStat.endDate) },
  358. }
  359. },
  360. workType:{
  361. text: this.lp.workType + ":",
  362. type: "select",
  363. readonly:true,
  364. selectValue: defaultWorkType.split(",")
  365. },
  366. centerWork:{
  367. type:"text",
  368. defaultValue:this.lp.centerWorkDefault,
  369. event:{
  370. focus:function(item){this.select()}
  371. }
  372. },
  373. reportCycle: {
  374. text: this.lp.reportCycle + ":",
  375. type: "radio",
  376. notEmpty:true,
  377. //selectValue: lp.reportCycleValue.split(","),
  378. selectText: this.lp.reportCycleText.split(","),
  379. defaultValue: this.lp.reportCycleText.split(",")[0],
  380. event: {
  381. }
  382. },
  383. searchAction: {
  384. "type": "button", "value": this.lp.search, "style": this.css.filterButton,
  385. "event": {
  386. "click": function () {
  387. //_self.deptFileterNode.getElements("[item='returnAction']").setStyle("display","");
  388. _self.loadDeptStat()
  389. }
  390. }
  391. },
  392. returnAction : {
  393. "type": "button", "value": this.lp.return, "style": this.css.filterButton,
  394. "event": {
  395. "click": function () {
  396. _self.deptFilter.getItem("beginDate").setValue( _self.lp.deptStat.beginDate );
  397. _self.deptFilter.getItem("endDate").setValue( _self.lp.deptStat.endDate );
  398. _self.deptFileterNode.getElements("[item='returnAction']").setStyle("display","none");
  399. }
  400. }
  401. },
  402. exportAction : {
  403. "type": "button", "value": this.lp.export, "style": this.css.filterButton,
  404. "event": {
  405. "click": function () {
  406. _self.exportDeptExcel()
  407. }
  408. }
  409. }
  410. }
  411. }, this.app,this.css);
  412. this.deptFilter.load();
  413. }.bind(this), true);
  414. },
  415. loadDeptStat:function(){
  416. if(this.deptStatContent){
  417. this.deptStatContent.set("text","loading...");
  418. this.deptStatContent.setStyles({"padding-left":"20px"})
  419. }
  420. this.bDate = this.deptFilter.getItem("beginDate").get("value");
  421. this.eDate = this.deptFilter.getItem("endDate").get("value");
  422. this.workType = this.deptFilter.getItem("workType").get("value");
  423. this.centerWork = this.deptFilter.getItem("centerWork").get("value");
  424. this.cycleType = this.deptFilter.getItem("reportCycle").get("value");
  425. if(this.bDate == "" || this.bDate == this.lp.deptStat.beginDate || this.eDate == "" || this.eDate == this.lp.deptStat.endDate){
  426. //this.app.notice("选择日期","error")
  427. }
  428. var filterData = {
  429. "cycleType":this.cycleType,
  430. "startDate":this.bDate,
  431. "endDate":this.eDate,
  432. "workTypeName":this.workType,
  433. "centerTitle":this.centerWork == this.lp.centerWorkDefault?"":this.centerWork
  434. }
  435. this.app.createShade()
  436. this.actions.getStatType(filterData,
  437. function(json){
  438. if(json.type == "success"){
  439. this.deptStatData = json.data
  440. this.displayDeptStat();
  441. var y = this.contentDiv.getSize().y - this.deptToolbar.getSize().y
  442. this.deptStatContent.setStyles({"height":(y-20)+"px"});
  443. }
  444. this.app.destroyShade()
  445. }.bind(this),
  446. function(xhr,text,error){
  447. this.showErrorMessage(xhr,text,error)
  448. this.app.destroyShade()
  449. }.bind(this)
  450. )
  451. },
  452. displayDeptStat: function() {
  453. if(this.deptStatContent) this.deptStatContent.destroy();
  454. this.deptStatContent = new Element("div.deptStatContent", {styles: this.css.deptStatContent}).inject(this.contentDiv);
  455. if(this.deptStatData){
  456. this.deptStatInfo = new Element("div.deptStatInfo",{
  457. "styles": this.css.deptStatInfo
  458. }).inject(this.deptStatContent)
  459. var htmlstr = "<span >已汇报:</span> <img src='"+this.path+"default/icon/Checkmark-24.png' style='vertical-align:middle;margin-right:20px; width:20px;' />";
  460. htmlstr += "<span>不需要汇报: </span><img src='"+this.path+"default/icon/Circle24.png' style='vertical-align:middle;margin-right:20px;width:20px;' />";
  461. htmlstr += "<span>未汇报:</span> <img src='"+this.path+"default/icon/Delete-24.png' style='vertical-align:middle;margin-right:20px;width:20px;' />";
  462. this.deptStatInfo.set("html",htmlstr);
  463. this.deptStatText = new Element("div.deptStatText",{"styles":this.css.deptStatText}).inject(this.deptStatInfo)
  464. this.deptStatText.set("html","统计类别: "+this.cycleType+" 统计周期: "+this.bDate+" --- " + this.eDate)
  465. if(this.deptStatData.header) cols = this.deptStatData.header.length
  466. this.deptStatTable = new Element("table.deptStatTable",{styles:this.css.deptStatTable}).inject(this.deptStatContent)
  467. this.deptStatHeadTr = new Element("tr.deptStatHeadTr",{styles:this.css.deptStatHeadTr}).inject(this.deptStatTable);
  468. this.deptStatData.header.each(function(d,i){
  469. this.tmpTd = new Element("td.deptStatTh",{
  470. "styles":this.css.deptStatTh,
  471. "text": d.title
  472. }).inject(this.deptStatHeadTr)
  473. if(i==0){
  474. this.tmpTd.setStyles({"width":"100px"})
  475. }else if(i==1 || i == 2){
  476. this.tmpTd.setStyles({
  477. "width":"300px",
  478. "height":"auto",
  479. "max-height":"50px",
  480. "overflow-y":"hidden"
  481. })
  482. }else{
  483. var bd = d.startDate;
  484. var ed = d.endDate;
  485. tmpstr = bd.split("-")[1]+"."+bd.split("-")[2]+"-" + ed.split("-")[1]+"."+ed.split("-")[2]
  486. this.tmpTd.set("text",tmpstr)
  487. }
  488. }.bind(this))
  489. this.deptStatTable.setStyles({"width":(cols * 50 + 680)+"px"})
  490. if(this.deptStatData.content){
  491. var curRow = 0;
  492. var rows1 = this.deptStatData.content.length; //多少部门
  493. this.deptStatData.content.each(function(d,i){
  494. if(d.array){
  495. var rows2 = d.array.length; //多少中心工作
  496. var rowsWork2 = d.rowCount;
  497. d.array.each(function(dd,ii){
  498. var rows3 = dd.array.length; //多少工作
  499. var rowsWork3 = dd.rowCount;
  500. if(dd.array){
  501. var _self = this
  502. dd.array.each(function(ddd,iii){
  503. _self.tmpTr = new Element("tr.deptStatTr",{styles:_self.css.deptStatTr}).inject(_self.deptStatTable);
  504. curRow ++
  505. if(iii==0){
  506. if(ii==0){
  507. _self.tmpTd = new Element("td.deptStatTd",{
  508. "styles":_self.css.deptStatTd,
  509. "rowspan": rowsWork2,
  510. "text": d.title
  511. }).inject(_self.tmpTr)
  512. _self.tmpTd.setStyles({"text-align":"center"})
  513. _self.tmpTd = new Element("td.deptStatTd",{
  514. "styles":_self.css.deptStatTd,
  515. "rowspan": rowsWork3,
  516. "text": dd.title
  517. }).inject(_self.tmpTr)
  518. }else{
  519. _self.tmpTd = new Element("td.deptStatTd",{
  520. "styles":_self.css.deptStatTd,
  521. "rowspan": rowsWork3,
  522. "text": dd.title
  523. }).inject(_self.tmpTr)
  524. }
  525. }
  526. _self.tmpTd = new Element("td.deptStatTd",{
  527. "styles":_self.css.deptStatTd,
  528. "text": ddd.title,
  529. "col":1,
  530. "row":curRow
  531. }).inject(_self.tmpTr)
  532. _self.tmpTd.setStyles({"cursor":"pointer","text-decoration":"underline"});
  533. _self.tmpTd.addEvents({
  534. "click":function(){
  535. MWF.xDesktop.requireApp("Execution", "WorkDetail", function(){
  536. var workform = new MWF.xApplication.Execution.WorkDetail(_self, _self.app.restActions,{id:ddd.id},{
  537. "isNew": false,
  538. "isEdited": false,
  539. "tabLocation":_self.category
  540. });
  541. workform.load();
  542. }.bind(_self));
  543. }.bind(_self),
  544. "mouseenter":function(e){
  545. _self.overStyles(e)
  546. }.bind(_self),
  547. "mouseleave":function(e){
  548. _self.outStyles(e)
  549. }.bind(_self)
  550. })
  551. if(ddd.fields){
  552. ddd.fields.each(function(dddd,iiii){
  553. _self.tmpTd = new Element("td.deptStatTd",{
  554. "styles":_self.css.deptStatTdStatus,
  555. "row":curRow,
  556. "col":iiii+2
  557. }).inject(_self.tmpTr);
  558. _self.tmpTd.addEvents({
  559. "mouseenter":function(e){
  560. _self.overStyles(e)
  561. }.bind(_self),
  562. "mouseleave":function(e){
  563. _self.outStyles(e)
  564. }.bind(_self)
  565. })
  566. var imgName = "";
  567. if(dddd.reportStatus == -1){
  568. imgName = "Circle24.png"
  569. }else if(dddd.reportStatus == 0){
  570. imgName = "Delete-24.png"
  571. }else if(dddd.reportStatus == 1){
  572. imgName = "Checkmark-24.png"
  573. }
  574. _self.deptStatStatusSpan = new Element("span.deptStatStatusSpan",{
  575. "styles":this.css.deptStatStatusSpan
  576. }).inject(_self.tmpTd)
  577. _self.deptStatStatusSpan.setStyles({
  578. "background":"url('"+_self.path+"default/icon/"+imgName+"')"
  579. })
  580. }.bind(_self))
  581. }
  582. }.bind(_self))
  583. }
  584. }.bind(this))
  585. }
  586. }.bind(this))
  587. }
  588. }
  589. },
  590. overStyles:function(e){
  591. var curRow = $(e.target).get("row");
  592. var curCol = $(e.target).get("col");
  593. //this.deptStatTable.getElements("[row='"+curRow+"']").setStyles({"border":"1px solid #cccccc","background-color":"#cccccc"})
  594. //this.deptStatTable.getElements("[col='"+curCol+"']").setStyles({"border":"1px solid #cccccc","background-color":"#cccccc"})
  595. //this.deptStatTable.getElements("[row='"+curRow+"']").setStyles({"background-color":"#ff0"})
  596. //this.deptStatTable.getElements("[col='"+curCol+"']").setStyles({"background-color":"#ff0"})
  597. },
  598. outStyles:function(e){
  599. var curRow = $(e.target).get("row");
  600. var curCol = $(e.target).get("col");
  601. //this.deptStatTable.getElements("[row='"+curRow+"']").setStyles({"border":"1px solid #000","background-color":""})
  602. //this.deptStatTable.getElements("[col='"+curCol+"']").setStyles({"border":"1px solid #000","background-color":""})
  603. //this.deptStatTable.getElements("[row='"+curRow+"']").setStyles({"background-color":""})
  604. //this.deptStatTable.getElements("[col='"+curCol+"']").setStyles({"background-color":""})
  605. },
  606. exportDeptExcel : function(){
  607. this.bDate = this.deptFilter.getItem("beginDate").get("value");
  608. this.eDate = this.deptFilter.getItem("endDate").get("value");
  609. this.workType = this.deptFilter.getItem("workType").get("value");
  610. this.centerWork = this.deptFilter.getItem("centerWork").get("value");
  611. this.cycleType = this.deptFilter.getItem("reportCycle").get("value");
  612. if(this.bDate == "" || this.bDate == this.lp.deptStat.beginDate || this.eDate == "" || this.eDate == this.lp.deptStat.endDate){
  613. this.app.notice("选择日期","error")
  614. return false;
  615. }
  616. var filterData = {
  617. "cycleType":this.cycleType,
  618. "startDate":this.bDate,
  619. "endDate":this.eDate,
  620. "workTypeName":this.workType,
  621. "centerTitle":this.centerWork == this.lp.centerWorkDefault?"":this.centerWork
  622. }
  623. this.actions.exportByDeptWork(filterData,function(json){
  624. if(json.data && json.data.id){
  625. var address = this.actions.action.address;
  626. var url = address + "/servlet/export/statisticreportcontent/"+json.data.id+"/stream"
  627. window.open(url)
  628. }
  629. }.bind(this),
  630. function(xhr,text,error){
  631. this.showErrorMsg(xhr,text,error)
  632. }.bind(this),false)
  633. },
  634. //*************************按部门统计结束**************************************
  635. //*************************按日期统计开始**************************************
  636. statDate:function(){
  637. this.contentDiv.empty();
  638. this.dateToolbar = new Element("div.dateToolbar",{
  639. styles : this.css.dateToolbar
  640. }).inject(this.contentDiv)
  641. this.dateFileterNode = new Element("div.dateFileterNode",{
  642. styles : this.css.fileterNode
  643. }).inject(this.dateToolbar);
  644. this.loadDateFilter();
  645. },
  646. loadDateFilter: function () {
  647. var _self = this;
  648. _self.nowDate = new Date();
  649. _self.day = new Date(_self.nowDate.getFullYear(),(_self.nowDate.getMonth()+1),0);
  650. var html = "<table bordr='0' cellpadding='5' cellspacing='0' styles='filterTable'>" +
  651. "<tr>" +
  652. " <td styles='filterTableValue' item='beginDate'></td>" +
  653. " <td styles='filterTableValue' item='endDate'></td>" +
  654. " <td styles='filterTableValue' item='workType'></td>" +
  655. " <td styles='filterTableValue' item='centerWork'></td>" +
  656. " <td styles='filterTableValue' item='reportCycle'></td>" +
  657. " <td styles='filterTableValue' item='searchAction'></td>" +
  658. " <td styles='filterTableValue' item='returnAction' style='display:none;'></td>" +
  659. " <td styles='filterTableValue' item='exportAction'></td>" +
  660. "</tr>" +
  661. "</table>"
  662. this.dateFileterNode.set("html", html);
  663. var defaultWorkType="";
  664. this.actions.listCategoryAll(function(json){
  665. if(json.type=="success"){
  666. json.data.each(function(d,i){
  667. defaultWorkType = defaultWorkType + "," + d.workTypeName
  668. }.bind(this))
  669. }
  670. }.bind(this),null,false)
  671. MWF.xDesktop.requireApp("Template", "MForm", function () {
  672. this.dateFilter = new MForm(this.dateFileterNode, {}, {
  673. style: "execution",
  674. isEdited: true,
  675. onPostLoad: function(){
  676. _self.loadDateStat()
  677. }.bind(this),
  678. itemTemplate: {
  679. beginDate:{
  680. "style":this.css.filterTitle,
  681. tType:"date",
  682. name:"beginDate",
  683. attr : {readonly:true},
  684. notEmpty:true,
  685. defaultValue : _self.nowDate.getFullYear()+"-"+(_self.nowDate.getMonth()+1)+"-01",
  686. "event":{
  687. focus : function( item ){ if(item.get("value")==_self.lp.dateStat.beginDate)item.setValue("") },
  688. blur : function( item ){ if(item.get("value").trim()=="")item.setValue(_self.lp.dateStat.beginDate) },
  689. }
  690. },
  691. endDate:{
  692. "style":this.css.filterTitle,
  693. tType:"date",
  694. name:"endDate",
  695. attr : {readonly:true},
  696. notEmpty:true,
  697. defaultValue : _self.nowDate.getFullYear()+"-"+(_self.nowDate.getMonth()+1)+"-"+_self.day.getDate(),
  698. "event":{
  699. focus : function( item ){ if(item.get("value")==_self.lp.dateStat.endDate)item.setValue("") },
  700. blur : function( item ){ if(item.get("value").trim()=="")item.setValue(_self.lp.dateStat.endDate) },
  701. }
  702. },
  703. workType:{
  704. text: this.lp.workType + ":",
  705. type: "select",
  706. attr : {readonly:true},
  707. selectValue: defaultWorkType.split(",")
  708. },
  709. centerWork:{
  710. type:"text",
  711. defaultValue:this.lp.centerWorkDefault,
  712. event:{
  713. focus:function(item){this.select()}
  714. }
  715. },
  716. reportCycle: {
  717. text: this.lp.reportCycle + ":",
  718. type: "radio",
  719. notEmpty:true,
  720. //selectValue: lp.reportCycleValue.split(","),
  721. selectText: this.lp.reportCycleText.split(","),
  722. defaultValue: this.lp.reportCycleText.split(",")[0],
  723. event: {
  724. }
  725. },
  726. searchAction: {
  727. "type": "button", "value": this.lp.search, "style": this.css.filterButton,
  728. "event": {
  729. "click": function () {
  730. //_self.deptFileterNode.getElements("[item='returnAction']").setStyle("display","");
  731. _self.loadDateStat()
  732. }
  733. }
  734. },
  735. returnAction : {
  736. "type": "button", "value": this.lp.return, "style": this.css.filterButton,
  737. "event": {
  738. "click": function () {
  739. _self.dateFilter.getItem("beginDate").setValue( _self.lp.dateStat.beginDate );
  740. _self.dateFilter.getItem("endDate").setValue( _self.lp.dateStat.endDate );
  741. _self.dateFileterNode.getElements("[item='returnAction']").setStyle("display","none");
  742. }
  743. }
  744. },
  745. exportAction : {
  746. "type": "button", "value": this.lp.export, "style": this.css.filterButton,
  747. "event": {
  748. "click": function () {
  749. _self.exportDateExcel()
  750. }
  751. }
  752. }
  753. }
  754. }, this.app, this.css);
  755. this.dateFilter.load();
  756. }.bind(this), true);
  757. },
  758. loadDateStat:function(){
  759. this.bDate = this.dateFilter.getItem("beginDate").get("value");
  760. this.eDate = this.dateFilter.getItem("endDate").get("value");
  761. this.workType = this.dateFilter.getItem("workType").get("value");
  762. this.centerWork = this.dateFilter.getItem("centerWork").get("value");
  763. this.cycleType = this.dateFilter.getItem("reportCycle").get("value");
  764. if(this.bDate == "" || this.bDate == this.lp.dateStat.beginDate || this.eDate == "" || this.eDate == this.lp.dateStat.endDate){
  765. //this.app.notice("选择日期","error")
  766. }
  767. if(this.dateStatListDiv) this.dateStatListDiv.destroy()
  768. if(this.statViewListDiv) this.statViewListDiv.destroy()
  769. var filterData = {
  770. "reportCycle":this.cycleType,
  771. "workTypeName":this.workType,
  772. "startDate":this.bDate,
  773. "centerTitle":this.centerWork == this.lp.centerWorkDefault?"":this.centerWork,
  774. "endDate":this.eDate
  775. }
  776. this.app.createShade()
  777. this.actions.getStatDateList(filterData,function(json){
  778. this.app.destroyShade();
  779. if(json.type == "success"){
  780. this.dateStatListData = json.data
  781. this.displayDateStatList();
  782. }
  783. }.bind(this),
  784. function(xhr,text,error){
  785. this.showErrorMessage(xhr,text,error);
  786. this.app.destroyShade();
  787. }.bind(this)
  788. )
  789. },
  790. displayDateStatList: function() {
  791. if(this.dateStatListDiv) this.dateStatListDiv.destroy();
  792. if(this.statViewListDiv) this.statViewListDiv.destroy()
  793. this.dateStatListDiv = new Element("div.dateStatListDiv", {
  794. "styles": this.css.dateStatListDiv
  795. }).inject(this.contentDiv);
  796. var dateStatListTitleDiv = new Element("div.dateStatListTitleDiv", {
  797. "styles": this.css.dateStatListTitleDiv,
  798. "text": this.lp.dateStatListTitle
  799. }).inject(this.dateStatListDiv);
  800. this.dateStatContentDiv = new Element("div.dateStatContentDiv", {
  801. "styles": this.css.dateStatContentDiv
  802. }).inject(this.dateStatListDiv);
  803. this.loadDateStatList();
  804. },
  805. loadDateStatList: function(){
  806. if(this.dateStatListData){
  807. this.dateStatListData.each(function(d,i){
  808. var tmpLi = new Element("li.dateStatContentLi",{
  809. "styles": this.css.dateStatContentLi,
  810. "text": d.datetime,
  811. "title": d.reportCycle
  812. }).inject(this.dateStatContentDiv)
  813. tmpLi.addEvents({
  814. "click":function(){
  815. this.dateStatContentDiv.getElements("li").setStyles({"background-color":"","color":""})
  816. tmpLi.setStyles({"background-color":"#3c76c1","color":"#ffffff"});
  817. this.currentDateData = d
  818. this.displayDateStat(d)
  819. }.bind(this)
  820. })
  821. }.bind(this))
  822. if(this.dateStatListData.length==0){
  823. this.tmpSpan = new Element("span",{
  824. styles:{"margin-left":"10px"},
  825. text :this.lp.nullReportStat
  826. }).inject(this.dateStatContentDiv)
  827. }
  828. if(this.dateStatContentDiv.getElements("li").length>0)this.dateStatContentDiv.getElements("li")[0].click()
  829. }
  830. },
  831. displayDateStat: function(d,id){
  832. if(this.statViewListDiv){
  833. this.statViewListDiv.empty()
  834. this.statViewListDiv.set("text","loading...");
  835. this.statViewListDiv.setStyles({"padding-left":"15px"})
  836. }
  837. if(d){
  838. var filterData = {
  839. "statisticTimeFlag": d.datetime,
  840. "workTypeName":this.workType,
  841. "centerTitle":this.centerWork == this.lp.centerWorkDefault?"":this.centerWork,
  842. "reportCycle": d.reportCycle
  843. }
  844. if(id){
  845. filterData.centerId = id
  846. }
  847. this.app.createShade()
  848. this.actions.getStatDate(filterData,function(json){
  849. if(json.type == "success"){
  850. this.dateStatData = json.data
  851. this.displayDateStatTable()
  852. }
  853. this.app.destroyShade();
  854. }.bind(this),
  855. function(xhr,text,error){
  856. this.showErrorMessage(xhr,text,error);
  857. this.app.destroyShade();
  858. }.bind(this)
  859. )
  860. }
  861. },
  862. displayDateStatTable:function(){
  863. if(this.statViewListDiv) this.statViewListDiv.empty()
  864. if(this.dateStatData){
  865. if(this.statViewListDiv) this.statViewListDiv.destroy()
  866. this.statViewListDiv = new Element("div.statViewListDiv", {
  867. "styles": this.css.statViewListDiv
  868. }).inject(this.contentDiv);
  869. var y = this.contentDiv.getSize().y - this.dateToolbar.getSize().y - this.dateStatListDiv.getSize().y
  870. this.statViewListDiv.setStyles({"height":(y-50)+"px"})
  871. this.statTable = new Element("table.statTable",{
  872. "styles":this.css.statTable
  873. }).inject(this.statViewListDiv)
  874. //this.statTable.set("border","1")
  875. this.statHeadTr = new Element("tr.statHeadTr",{
  876. "styles":this.css.statHeadTr
  877. }).inject(this.statTable);
  878. for(var o in this.lp.statTable){
  879. var statHeadTd = new Element("td.statHeadTd",{
  880. "styles": this.css.statHeadTd,
  881. "text":this.lp.statTable[o]
  882. }).inject(this.statHeadTr);
  883. }
  884. this.dateStatData.each(function(d,i){
  885. var centerTr = new Element("tr.centerTr").inject(this.statTable)
  886. var centerTd = new Element("td.dateStatCenterTd",{
  887. "styles": this.css.dateStatCenterTd,
  888. "colspan": 9,
  889. "text": d.title
  890. }).inject(centerTr)
  891. if(d.contents && d.contents.length>0){
  892. d.contents.each(function(dd,ii){
  893. var baseTr = new Element("tr.baseTr").inject(this.statTable)
  894. //var baseTd = new Element("td.dateStatBaseTd",{"styles":this.css.dateStatBaseTd,"text":(ii+1),"id":dd.workId}).inject(baseTr)
  895. //baseTd.setStyles({"width":"35px","text-align":"center"})
  896. for(var o in this.lp.statTable){
  897. //if(o!="order"){
  898. var val = "";
  899. if(o=="opinions") {
  900. if(dd[o]){
  901. dd[o].each(function(ddd){
  902. val = val + ddd.processorName + ":\n"+ ddd.opinion +"\n"
  903. })
  904. }
  905. }else{
  906. if(dd[o])val = dd[o]
  907. }
  908. var baseTd = new Element("td.dateStatBaseTd",{
  909. "styles": this.css.dateStatBaseTd,
  910. "html": val.length>50?val.substring(0,50)+"...":val,
  911. "title":val
  912. }).inject(baseTr);
  913. if(o=="serialNumber"){
  914. baseTd.setStyles({"width":"35px","padding-left":"15px","min-width":""})
  915. }
  916. if(o=="responsibilityOrganizationName"){
  917. baseTd.setStyles({"width":"87px"})
  918. }
  919. if(o=="workDetail"){
  920. //baseTd.setStyles({"cursor":"pointer","color":"#3d77c1","text-decoration":"underline"})
  921. //baseTd.addEvents({
  922. // "click":function(){
  923. // this.loadSubStat(id, dd.workId,baseTr);
  924. // //this.actions.getStatByWorkId(id, d.workId,function(json){
  925. // //
  926. // //}.bind(this),function(xhr,text,error){
  927. // // this.showErrorMsg(xhr,text,error)
  928. // //}.bind(this),false)
  929. // }.bind(this)
  930. //})
  931. }
  932. //}
  933. }
  934. }.bind(this))
  935. }
  936. }.bind(this))
  937. }
  938. },
  939. exportDateExcel : function(){
  940. if(this.currentDateData){
  941. var sendData = {}
  942. sendData.statisticTimeFlag = this.currentDateData.datetime;
  943. sendData.reportCycle = this.currentDateData.reportCycle;
  944. sendData.centerTitle = this.centerWork == this.lp.centerWorkDefault?"":this.centerWork;
  945. sendData.workTypeName = this.workType;
  946. this.actions.exportByCenterWork(sendData,function(json){
  947. if(json.data && json.data.id){
  948. var address = this.actions.action.address;
  949. var url = address + "/servlet/export/statisticreportcontent/"+json.data.id+"/stream"
  950. window.open(url)
  951. }
  952. }.bind(this),
  953. function(xhr,text,error){
  954. this.showErrorMsg(xhr,text,error)
  955. }.bind(this),false)
  956. }
  957. },
  958. //*************************按日期统计结束**************************************
  959. showErrorMessage:function(xhr,text,error){
  960. var errorText = error;
  961. if (xhr) errorMessage = xhr.responseText;
  962. if(errorMessage!=""){
  963. var e = JSON.parse(errorMessage);
  964. if(e.message){
  965. this.app.notice( e.message,"error");
  966. }else{
  967. this.app.notice( errorText,"error");
  968. }
  969. }else{
  970. this.app.notice(errorText,"error")
  971. }
  972. },
  973. setScrollBar: function(node, style, offset, callback){
  974. if (!style) style = "attachment";
  975. if (!offset){
  976. offset = {
  977. "V": {"x": 0, "y": 0},
  978. "H": {"x": 0, "y": 0}
  979. };
  980. };
  981. MWF.require("MWF.widget.ScrollBar", function(){
  982. new MWF.widget.ScrollBar(node, {
  983. "style": style,
  984. "offset": offset,
  985. "indent": false
  986. });
  987. if (callback) callback();
  988. });
  989. return false;
  990. }
  991. })
  992. MWF.xApplication.Execution.WorkStat.WorkView = new Class({
  993. Extends: MWF.xApplication.Template.Explorer.ComplexView,
  994. _createDocument: function(data){
  995. return new MWF.xApplication.Execution.WorkStat.WorkDocument(this.viewNode, data, this.explorer, this);
  996. },
  997. _getCurrentPageData: function(callback, count){
  998. if (!count)count = 20;
  999. var id = (this.items.length) ? this.items[this.items.length - 1].data.id : "(0)";
  1000. if(id=="(0)")this.app.createShade()
  1001. var filter = this.filterData || {};
  1002. this.actions.getCenterWorkListNext(id, count, filter, function (json) {
  1003. if (callback)callback(json);
  1004. this.app.destroyShade();
  1005. }.bind(this))
  1006. },
  1007. _removeDocument: function(documentData, all){
  1008. //this.actions.deleteSchedule(documentData.id, function(json){
  1009. // this.reload();
  1010. // this.app.notice(this.app.lp.deleteDocumentOK, "success");
  1011. //}.bind(this));
  1012. },
  1013. _create: function(){
  1014. },
  1015. _openDocument: function( documentData ){
  1016. //var workMinder = new MWF.xApplication.Execution.WorkMinder( this.explorer, documentData, {});
  1017. //workMinder.load();
  1018. MWF.xDesktop.requireApp("Execution", "StatForm", function(){
  1019. var statForm = new MWF.xApplication.Execution.StatForm( this,this.app.restActions, documentData, {
  1020. "centerWorkId":documentData.id
  1021. });
  1022. statForm.load();
  1023. }.bind(this),false);
  1024. //MWF.xDesktop.requireApp("Execution", "WorkDeploy", function(){
  1025. // this.workDeploy = new MWF.xApplication.Execution.WorkDeploy(this, this.actions,{"id":documentData.id},{
  1026. // "isEdited":false,
  1027. // "centerWorkId":documentData.id
  1028. // } );
  1029. // this.workDeploy.load();
  1030. //
  1031. //}.bind(this))
  1032. },
  1033. _queryCreateViewNode: function(){
  1034. },
  1035. _postCreateViewNode: function( viewNode ){
  1036. },
  1037. _queryCreateViewHead:function(){
  1038. },
  1039. _postCreateViewHead: function( headNode ){
  1040. }
  1041. })
  1042. MWF.xApplication.Execution.WorkStat.WorkDocument = new Class({
  1043. Extends: MWF.xApplication.Template.Explorer.ComplexDocument,
  1044. mouseoverDocument : function(){
  1045. this.node.getElements("[styles='documentItemTitleNode']").setStyles(this.css["documentItemTitleNode_over"]);
  1046. this.node.getElements("[styles='documentItemIconNode']").setStyles(this.css["documentItemIconNode_over"]);
  1047. this.node.getElements("[styles='documentItemStatNode']").setStyles(this.css["documentItemStatNode_over"]);
  1048. },
  1049. mouseoutDocument : function(){
  1050. this.node.getElements("[styles='documentItemTitleNode']").setStyles(this.css["documentItemTitleNode"]);
  1051. this.node.getElements("[styles='documentItemIconNode']").setStyles(this.css["documentItemIconNode"]);
  1052. this.node.getElements("[styles='documentItemStatNode']").setStyles(this.css["documentItemStatNode"]);
  1053. },
  1054. _queryCreateDocumentNode:function( itemData ){
  1055. },
  1056. _postCreateDocumentNode: function( itemNode, itemData ){
  1057. },
  1058. removeCenterWork : function(itemData){
  1059. //如果是管理员有删除部署的中心工作的权限
  1060. //if(isAdmin){
  1061. // return true;
  1062. //}
  1063. return false;
  1064. }
  1065. })