52e7300add55194e4c4ca7136ea824c8c7cb1e1f.svn-base 23 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631
  1. BemsWebApplication.MainDashboardFMS = function (params, viewInfo) {
  2. "use strict";
  3. var initialized = false;
  4. var useBusinessFiltering = ko.observable(false);
  5. var visiblePopup = ko.observable(false);
  6. var works = ko.observableArray();
  7. var works2 = ko.observableArray();
  8. var works3 = ko.observableArray();
  9. var eq = BWA.DataUtil.constructEqualFilter,
  10. and = BWA.DataUtil.andFilter;
  11. var BFDataSource = BemsWebApplication.db.createDataSource('CmBusinessField'),
  12. progressDataSource = BemsWebApplication.db.createDataSource('FmsWorkCodeType'),
  13. chartPieDay = BWA.Chart.Instance('chartPieDayTReport', 'dxPieChart');
  14. var progresses = ko.observableArray();
  15. var workDataSource = BWA.DataUtil.createDataSource({
  16. dataSourceOptions: {
  17. select: [
  18. 'SiteId', 'WorkRequestId', 'FmsWorkRequest/FmsWorkCodeType/Name',
  19. 'FmsWorkRequest/WorkTypeId', 'Title', 'OrderDate', 'FmsWorkRequest/WorkProgressId',
  20. 'CmUser/Name', // 작업지시자
  21. 'FmsWorkRequest/CmBusinessField/Name',
  22. 'BusinessFieldId', 'FmsWorkRequest/CmBusinessField/Name', 'FmsWorkRequest/BusinessFieldId'
  23. ],
  24. expand: ['FmsWorkRequest',
  25. 'FmsWorkResult',
  26. 'FmsWorkResult/CmUser',
  27. 'FmsWorkResult/IsConfirmed',
  28. 'FmsWorkResult/ConfirmedDate',
  29. 'FmsWorkRequest/FmsWorkCodeType',
  30. 'FmsWorkRequest/CmBusinessField',
  31. 'FmsWorkRequest/FmsWorkCodeProgress',
  32. 'CmBusinessField', 'CmUser'],
  33. extendOptions: {
  34. forceOriginalField: true,
  35. }
  36. },
  37. }, 'FmsWorkOrder');
  38. //}, 'FmsWorkRequest');
  39. // 2016 05 11 추가
  40. var workDataSource2 = BWA.DataUtil.createDataSource({
  41. dataSourceOptions: {
  42. select: [
  43. 'SiteId', 'WorkRequestId',
  44. 'StartDate', 'EndDate',
  45. 'ConfirmedDate', 'ConfirmedUserId', 'IsConfirmed',
  46. 'CauseClassId', 'Content',
  47. 'FmsWorkRequest/WorkTypeId',
  48. 'FmsWorkOrder/Title',
  49. 'FmsWorkOrder/OrderDate',
  50. 'FmsWorkRequest/WorkProgressId',
  51. 'CmUser/Name', // 작업자
  52. 'FmsWorkRequest/FmsWorkCodeType/Name',
  53. 'FmsWorkRequest/CmBusinessField/Name',
  54. 'FmsWorkRequest/FmsWorkCodeProgress/Name',
  55. 'FmsWorkOrder/BusinessFieldId',
  56. ],
  57. expand: [
  58. 'FmsWorkRequest',
  59. 'FmsWorkOrder',
  60. 'FmsWorkRequest/FmsWorkCodeType',
  61. 'FmsWorkRequest/CmBusinessField',
  62. 'FmsWorkRequest/FmsWorkCodeProgress',
  63. 'FmsWorkOrder/CmBusinessField', 'CmUser'],
  64. extendOptions: {
  65. forceOriginalField: true
  66. }
  67. },
  68. }, 'FmsWorkResult');
  69. var AnnounceDataSource = BWA.DataUtil.createDataSource({
  70. dataSourceOptions: {
  71. select: [
  72. 'SiteId',
  73. 'AnnouncementId',
  74. 'BusinessFieldId',
  75. 'CmBusinessField/Name',
  76. 'Title',
  77. 'Contents',
  78. 'RegisterUserId ',
  79. 'CmUser/Name', // 등록자
  80. 'AddDate',
  81. 'UpdateDate',
  82. 'IsUse',
  83. 'ReadCount',
  84. ],
  85. expand: [
  86. 'CmBusinessField',
  87. 'CmUser'
  88. ],
  89. extendOptions: {
  90. forceOriginalField: true
  91. }
  92. },
  93. }, 'CmAnnouncement');
  94. var initialized_cal = false;
  95. function handleViewShown() {
  96. if (initialized === false) {
  97. BFDataSource.filter([
  98. eq('SiteId', BWA.UserInfo.SiteId()),//**kgpark
  99. ]);
  100. $.when(
  101. BFDataSource.load(),
  102. progressDataSource.load()
  103. ).done(function (BFResult, progressResult) {
  104. progresses = progressResult[0];
  105. chartPieDay = chartPieDay(BWA.ChartOptions.MainDashboardFMS.getPieChartDayOptions());
  106. handleSearchInSearchView();
  107. });
  108. initialized = true;
  109. }
  110. else
  111. handleSearchInSearchView();
  112. if (initialized_cal === false) {
  113. holidayCalendar = utils.fullCalendar.create('holidayCalendar', calendarOptions);
  114. var date = moment();
  115. currentYear = date.year();
  116. check_button();
  117. }
  118. else
  119. refreshList_cal();
  120. }
  121. function handleSearchInSearchView() {
  122. if (!useBusinessFiltering) {
  123. workDataSource2.filter([
  124. eq('SiteId', BWA.UserInfo.SiteId()),
  125. and,
  126. [
  127. eq('FmsWorkRequest/WorkProgressId', $Code.WorkProgress.WORK_COMPLETE)
  128. ]
  129. ]);
  130. } else {
  131. workDataSource2.filter([
  132. eq('SiteId', BWA.UserInfo.SiteId()),
  133. and,
  134. [eq('FmsWorkRequest/WorkProgressId', $Code.WorkProgress.WORK_COMPLETE)],
  135. and,
  136. [eq('FmsWorkRequest/BusinessFieldId', BWA.UserInfo.BusinessFieldId()), 'or', eq('FmsWorkRequest/BusinessFieldId', 1)]]);
  137. }
  138. workDataSource2.load().done(function (workResult) {
  139. works(workResult);
  140. });
  141. if (!useBusinessFiltering) {
  142. workDataSource2.filter([
  143. eq('SiteId', BWA.UserInfo.SiteId()),
  144. and,
  145. [
  146. eq('FmsWorkRequest/WorkProgressId', $Code.WorkProgress.WORKING),
  147. 'or',
  148. eq('FmsWorkRequest/WorkProgressId', $Code.WorkProgress.WORK_HOLD)
  149. ]
  150. ]);
  151. } else {
  152. workDataSource2.filter([
  153. eq('SiteId', BWA.UserInfo.SiteId()),
  154. and,
  155. [eq('FmsWorkRequest/WorkProgressId', $Code.WorkProgress.WORKING), 'or', eq('FmsWorkRequest/WorkProgressId', $Code.WorkProgress.WORK_HOLD)],
  156. and,
  157. [eq('FmsWorkRequest/BusinessFieldId', BWA.UserInfo.BusinessFieldId()), 'or', eq('FmsWorkRequest/BusinessFieldId', 1)]
  158. ]);
  159. }
  160. workDataSource2.load().done(function (workResult) {
  161. works2(workResult);
  162. });
  163. //공지사항 추가
  164. if (!useBusinessFiltering) {
  165. AnnounceDataSource.filter([
  166. [eq('SiteId', BWA.UserInfo.SiteId()), 'or', eq('SiteId',BemsWebApplication.config.HOSiteId)]
  167. ]);
  168. } else {
  169. AnnounceDataSource.filter([
  170. [eq('SiteId', BWA.UserInfo.SiteId())],
  171. and,
  172. [eq('BusinessFieldId', BWA.UserInfo.BusinessFieldId()), 'or', eq('BusinessFieldId', 1)]
  173. ]);
  174. }
  175. AnnounceDataSource.load().done(function (AnnounceResult) {
  176. works3(AnnounceResult);
  177. });
  178. var now_st = new Date();
  179. now_st = new Date(now_st.getFullYear(), now_st.getMonth(), now_st.getDate(), 0, 0, 0);
  180. workDataSource.filter([
  181. [
  182. eq('SiteId', BWA.UserInfo.SiteId()),
  183. and,
  184. ['FmsWorkRequest/WorkProgressId',"<=", $Code.WorkProgress.WORKING],
  185. //and,
  186. //['OrderDate', ">=", now_st]
  187. ]
  188. ]);
  189. workDataSource.load().done(function (workResult2) {
  190. var pieDataArray = [];
  191. _.each(progresses, function (x) {
  192. if (x.WorkTypeId() >= 1)
  193. pieDataArray.push({
  194. FuelTypeName: x.Name(),
  195. Value: (x.WorkTypeId() == 1) ? workResult2.length : getWorkProcessCount(workResult2, x.WorkTypeId(), null)
  196. })
  197. });
  198. chartPieDay().option('dataSource', pieDataArray);
  199. });
  200. //$("#large-indicator").dxLoadIndicator({
  201. // height: 60,
  202. // width: 60
  203. //});
  204. }
  205. function handleViewHidden() {
  206. visiblePopup(false);
  207. holidayCalendar.clearEvents(true);
  208. }
  209. function handleViewShowing() {
  210. useBusinessFiltering = BWA.UserInfo.isDependBusinessField(viewInfo.viewName);
  211. }
  212. function getWorkProcessCount(datas, type, bf) {
  213. var cnt = 0;
  214. _.each(datas, function (x) {
  215. if (x['SiteId']() == BWA.UserInfo.SiteId() && x['FmsWorkRequest/WorkTypeId']() == type && (bf == null || x['FmsWorkRequest/BusinessFieldId']() == bf)) //**kgpark
  216. cnt++;
  217. });
  218. return cnt;
  219. }
  220. function refreshList() {
  221. //dataSource.pageIndex(0);
  222. //dataSource.load();
  223. }
  224. //****************** 달력 조회 ***********************//
  225. var holidayDataSource = BemsWebApplication.db.createDataSource('CmHoliday', true, true);
  226. var holidayCustomDataSource = BemsWebApplication.db.createDataSource('CmHolidayCustom', true);
  227. var holidayWeekendDataSource = BemsWebApplication.db.createDataSource('CmHolidayWeekend', true);
  228. var checkBox_regular = true, checkBox_legal = true, checkBox_any = true;
  229. var workScheduleDataSource = BWA.DataUtil.createDataSource({
  230. dataSourceOptions: {
  231. select: [
  232. 'SiteId', 'WorkScheduleId', 'WorkTypeId', 'BusinessFieldId', 'Title', 'FmsWorkSchedule/CycleUnitId',
  233. 'FmsWorkSchedule/CycleSize', 'FmsWorkSchedule/IsUse', 'FmsWorkSchedule/IsAutoOrder', 'StartWorkDate',
  234. 'CmUser/Name', 'CmBusinessField/Name', 'FmsWorkResult/EndDate', 'FmsWorkResult/IsConfirmed',
  235. 'CmPartner/Name', 'FmsWorkSchedule/HolidayWorkTypeId'
  236. ],
  237. expand: ['FmsWorkSchedule', 'CmUser', 'CmBusinessField', 'CmPartner', 'FmsWorkResult'],
  238. extendOptions: {
  239. forceOriginalField: true
  240. }
  241. }
  242. }, 'FmsWorkRequest');
  243. var holidaySources;
  244. var holidayCustomSources;
  245. var workScheduleSources;
  246. var cc = new CalendarConverter;
  247. var holidayWeekendDataViewModel = new BemsWebApplication.CmHolidayWeekendViewModel();
  248. var loadedYears = [];
  249. var viewDate = null;
  250. var currentYear = null;
  251. var holidays = [];
  252. var weekends = [];
  253. var isSaturday = false;
  254. var isSunday = false;
  255. var holidayCalendar = null;
  256. var calendarOptions = {
  257. selectable: false,
  258. editable: false,
  259. //weekends: true,
  260. weekNumbers: false,
  261. changedMonth: function (view) {
  262. var date = view.calendar.getDate();
  263. viewDate = date; //hcLee 2016 03 21
  264. if (currentYear !== null && date.year() !== currentYear) {
  265. currentYear = date.year();
  266. check_button();
  267. }
  268. else {
  269. applyWeekends(date);
  270. }
  271. }
  272. }
  273. function refreshHolidays(date) {
  274. holidays = [];
  275. var currentYear = date.year();
  276. if (loadedYears.indexOf(currentYear) < 0) {
  277. loadedYears.push(currentYear);
  278. var year;
  279. var month;
  280. var day;
  281. var solar;
  282. $.each(holidaySources, function (i, item) {
  283. year = currentYear;
  284. month = item.HolidayMonth() - 1;
  285. day = item.HolidayDay();
  286. if (item.IsLunar()) {
  287. solar = cc.lunar2solar(new Date(year - 1, month, day));
  288. if (solar.sYear !== year) {
  289. solar = cc.lunar2solar(new Date(year, month, day));
  290. }
  291. year = solar.sYear;
  292. month = solar.sMonth - 1;
  293. day = solar.sDay;
  294. }
  295. utils.holiday.pushHolidayEventInArray(holidays, item.Name(), moment([year, month, day]), true, undefined, 0);
  296. });
  297. $.each(holidayCustomSources, function (i, item) {
  298. var itemDate = item.HolidayDate();
  299. if (itemDate.getFullYear() === currentYear) {
  300. utils.holiday.pushHolidayEventInArray(holidays, item.Name(), moment([itemDate.getFullYear(), itemDate.getMonth(), itemDate.getDate()]), false, undefined, 1);
  301. }
  302. });
  303. $.each(workScheduleSources, function (i, item) {
  304. var itemDate = item['FmsWorkResult/EndDate']();//추가
  305. item.Name = item.Title;
  306. if (itemDate.getFullYear() === currentYear) {
  307. utils.holiday.pushWorkScheduleEventInArray(holidays, item, moment([itemDate.getFullYear(), itemDate.getMonth(), itemDate.getDate()]), false, undefined, item.WorkTypeId());
  308. }
  309. });
  310. }
  311. applyWeekends(date);
  312. }
  313. function loadHolidays(date) {
  314. holidays = [];
  315. loadedYears = [];
  316. workScheduleDataSource.filter().push('and', eq("SiteId", BWA.UserInfo.SiteId()));
  317. if (useBusinessFiltering)
  318. workScheduleDataSource.filter().push('and', [eq('BusinessFieldId', BWA.UserInfo.BusinessFieldId()), 'or', eq('BusinessFieldId', 1)]);
  319. $.when(
  320. holidayDataSource.load(),
  321. holidayCustomDataSource.load(),
  322. holidayWeekendDataSource.load(),
  323. workScheduleDataSource.load())//수정
  324. .done(function (result1, result2, result3, result4) {
  325. holidaySources = result1[0];
  326. holidayCustomSources = result2[0];
  327. var tempworkScheduleSources = result4[0];
  328. workScheduleSources = [];
  329. for (var i = 0; i < tempworkScheduleSources.length; i++) {
  330. if (tempworkScheduleSources[i]['FmsWorkResult/IsConfirmed'] != null) {
  331. if (tempworkScheduleSources[i]['FmsWorkResult/IsConfirmed']() == true) {
  332. workScheduleSources.push(tempworkScheduleSources[i]);
  333. }
  334. }
  335. }
  336. if (result3.length > 0) {
  337. var weekend = result3[0][0];
  338. isSaturday = weekend.Saturday();
  339. isSunday = weekend.Sunday();
  340. holidayWeekendDataViewModel.SiteId(weekend.SiteId());
  341. holidayWeekendDataViewModel.Saturday(weekend.Saturday());
  342. holidayWeekendDataViewModel.Sunday(weekend.Sunday());
  343. }
  344. refreshHolidays(date);
  345. });
  346. }
  347. function applyWeekends(date) {
  348. if (holidayCalendar === null) return;
  349. if (isSunday == false && isSaturday == false) {
  350. holidayCalendar.updateEvents(holidays);
  351. return;
  352. }
  353. weekends = utils.holiday.getWeekendHolidays(date, isSaturday, isSunday);
  354. holidayCalendar.updateEvents(holidays.concat(weekends));
  355. }
  356. function check_button() {
  357. $("#checkBox_regular").dxCheckBox({
  358. text: "정기 점검",
  359. value: true,
  360. onValueChanged: function (e) {
  361. switch (e.value) {
  362. case true:
  363. checkBox_regular = true;
  364. break;
  365. case false:
  366. checkBox_regular = false;
  367. break;
  368. }
  369. Data_filter(viewDate);
  370. }
  371. });
  372. $("#checkBox_legal").dxCheckBox({
  373. text: "법정 검사",
  374. value: true,
  375. onValueChanged: function (e) {
  376. switch (e.value) {
  377. case true:
  378. checkBox_legal = true;
  379. break;
  380. case false:
  381. checkBox_legal = false;
  382. break;
  383. }
  384. Data_filter(viewDate);
  385. }
  386. });
  387. $("#checkBox_any").dxCheckBox({
  388. text: "수시 점검",
  389. value: true,
  390. onValueChanged: function (e) {
  391. switch (e.value) {
  392. case true:
  393. checkBox_any = true;
  394. break;
  395. case false:
  396. checkBox_any = false;
  397. break;
  398. }
  399. Data_filter(viewDate);
  400. }
  401. });
  402. Data_filter(viewDate);
  403. }
  404. function Data_filter(date) {
  405. workScheduleDataSource.filter([]);
  406. if (checkBox_regular) {//1
  407. if (checkBox_legal) {//2
  408. if (checkBox_any) {//5
  409. workScheduleDataSource.filter().push(["WorkTypeId", ">=", 1]);//1,2,5
  410. }
  411. else {
  412. workScheduleDataSource.filter().push([["WorkTypeId", "=", 1], 'or', ["WorkTypeId", "=", 2]]);//1,2
  413. }
  414. }
  415. else {
  416. if (checkBox_any) {//5
  417. workScheduleDataSource.filter().push([["WorkTypeId", "=", 1], 'or', ["WorkTypeId", "=", 5]]);//1,5
  418. }
  419. else {
  420. workScheduleDataSource.filter().push(["WorkTypeId", "=", 1]);//1
  421. }
  422. }
  423. }
  424. else {
  425. if (checkBox_legal) {//2
  426. if (checkBox_any) {//5
  427. workScheduleDataSource.filter().push([["WorkTypeId", "=", 2], 'or', ["WorkTypeId", "=", 5]]);//2,5
  428. }
  429. else {
  430. workScheduleDataSource.filter().push(["WorkTypeId", "=", 2]);//2
  431. }
  432. }
  433. else {
  434. if (checkBox_any) {//5
  435. workScheduleDataSource.filter().push(["WorkTypeId", "=", 5]);//5
  436. }
  437. else {
  438. workScheduleDataSource.filter().push(["WorkTypeId", "=", 0]);//0
  439. }
  440. }
  441. }
  442. loadHolidays(date);
  443. initialized_cal = true;
  444. }
  445. function refreshList_cal() {
  446. currentYear = viewDate.year();
  447. Data_filter(viewDate);
  448. }
  449. //****************** 달력 조회 ***********************//
  450. //var viewModel = $.extend(BWA.CommonView.create(params, viewInfo, searchViewOptions, ko.observable(null), handleViewShown, null, handleSearchInSearchView), {
  451. var viewModel = $.extend(BWA.CommonView.create(params, viewInfo, null, ko.observable(null), handleViewShown), {
  452. refreshList: refreshList,
  453. viewShowing: handleViewShowing,
  454. workDataGridOptions: utils.datagrid.defaultOptions({
  455. rowClick: function (row) {
  456. },
  457. //rowAlternationEnabled: true,
  458. useNumberColumn: false,
  459. dataSource: works,
  460. datagridId: 'gridContainer',
  461. paging: {
  462. enabled: true,
  463. pageSize: 4
  464. },
  465. pager: {
  466. //allowedPageSizes: true,
  467. showPageSizeSelector: false,
  468. allowedPageSizes: [4],
  469. visible: false
  470. },
  471. columns: [
  472. // dataField: 'WorkRequestId', caption: $G('number'), width: '8%', alignment: 'center' },
  473. { dataField: 'FmsWorkRequest/CmBusinessField/Name', caption: $G('businessFieldName'), width: '15%', alignment: 'center' },
  474. { dataField: 'FmsWorkRequest/FmsWorkCodeType/Name', caption: $G('workTypeName'), width: '15%', alignment: 'center' },
  475. {
  476. dataField: 'FmsWorkOrder/OrderDate', caption: $G('orderedDate'), width: '17.5%', alignment: 'center',
  477. customizeText: function (cellInfo) {
  478. return $G.date(cellInfo.value);
  479. }
  480. },
  481. {
  482. dataField: 'EndDate', caption: '종료일', width: '17.5%', alignment: 'center', sortOrder: 'desc',
  483. customizeText: function (cellInfo) {
  484. return $G.date(cellInfo.value);
  485. }
  486. },
  487. { dataField: 'FmsWorkOrder/Title', caption: '작업명', width: '20%', alignment: 'center' },
  488. { dataField: 'CmUser/Name', caption: '작업지시자', width: '15%', alignment: 'center' },
  489. ],
  490. }),
  491. workDataGridOptions2: utils.datagrid.defaultOptions({
  492. //rowAlternationEnabled: true,
  493. dataSource: works2,
  494. datagridId: 'gridContainer2',
  495. useNumberColumn: false,
  496. columns: [
  497. //{ dataField: 'WorkRequestId', caption: $G('number'), width: '8%', alignment: 'center' },
  498. { dataField: 'FmsWorkRequest/CmBusinessField/Name', caption: $G('businessFieldName'), width: '20%', alignment: 'center' },
  499. { dataField: 'FmsWorkRequest/FmsWorkCodeType/Name', caption: $G('workTypeName'), width: '20%', alignment: 'center' },
  500. //{
  501. // dataField: 'FmsWorkOrder/OrderDate', caption: $G('orderedDate'), width: '15%', alignment: 'center', sortOrder: 'desc',
  502. // customizeText: function (cellInfo) {
  503. // return $G.date(cellInfo.value);
  504. // }
  505. //},
  506. {
  507. dataField: 'EndDate', caption: '종료예정일', width: '30%', alignment: 'center', sortOrder: 'desc',
  508. customizeText: function (cellInfo) {
  509. return $G.date(cellInfo.value);
  510. }
  511. },
  512. { dataField: 'FmsWorkOrder/Title', caption: '작업명', width: '30%', alignment: 'center' },
  513. //{ dataField: 'CmUser/Name', caption: '작업자', width: '10%', alignment: 'center' },
  514. ],
  515. paging: {
  516. enabled: true,
  517. pageSize: 4
  518. },
  519. pager: {
  520. //allowedPageSizes: true,
  521. showPageSizeSelector: false,
  522. allowedPageSizes: [4],
  523. visible: false
  524. },
  525. }),
  526. workDataGridOptions3: utils.datagrid.defaultOptions({
  527. //rowAlternationEnabled: true,
  528. dataSource: works3,
  529. datagridId: 'gridContainer3',
  530. useNumberColumn: false,
  531. columns: [
  532. { dataField: 'CmBusinessField/Name', caption: $G('businessFieldName'), width: '15%', alignment: 'center' },
  533. { dataField: 'Title', caption: '제목', width: '35%', alignment: 'center' },
  534. { dataField: 'CmUser/Name', caption: '등록자', width: '20%', alignment: 'center' },
  535. {
  536. dataField: 'UpdateDate', caption: '수정일', width: '20%', alignment: 'center', sortOrder: 'desc',
  537. customizeText: function (cellInfo) {
  538. return $G.date(cellInfo.value);
  539. }
  540. },
  541. { dataField: 'ReadCount', caption: '조회수', width: '10%', alignment: 'center' },
  542. ],
  543. paging: {
  544. enabled: true,
  545. pageSize: 4
  546. },
  547. pager: {
  548. //allowedPageSizes: true,
  549. showPageSizeSelector: false,
  550. allowedPageSizes: [4],
  551. visible: false
  552. },
  553. rowPrepared: function (rowElement, rowInfo) {
  554. if (rowInfo.rowType == 'data') {
  555. var data = rowInfo.data;
  556. if (data.SiteId() == BemsWebApplication.config.HOSiteId) {
  557. rowElement.css('background-color', 'rgba(255,0,0,0.1)');
  558. }
  559. }
  560. },
  561. })
  562. });
  563. return viewModel;
  564. };