62393cdb8bd815a751430bc131c21089299d9754.svn-base 24 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588
  1. BemsWebApplication.HeatExchangerAnalysis = function (params, viewInfo) {
  2. "use strict";
  3. var initialized = false,
  4. shouldReload = false,
  5. datagrid = null,
  6. currentTabIndex = ko.observable(0),
  7. facilityViewModel = new BWA.CmFacilityViewModel(),
  8. dataSource;
  9. var m_Facility;
  10. var multiViewItems = [{
  11. template: 'mainCharts'
  12. }, {
  13. template: 'subCharts'
  14. }
  15. ];
  16. var facilityDataSource = BWA.db.createDataSource('CmFacility'),
  17. facilitiesForSearch = ko.observableArray(),
  18. facilityCodeForSearch = ko.observable(0),
  19. deferredForSearch = new $.Deferred();
  20. var visiblePopup = ko.observable(false);
  21. var dataCalorie = ko.observableArray(),
  22. dataAtfw = ko.observableArray(),
  23. dataTemperatureCalorie = ko.observableArray(),
  24. dataTemperatureElectricity = ko.observableArray()
  25. ;
  26. var formulaGet = new BWA.Chart.FormulaGet(BWA.UserInfo.SiteId());
  27. //var timeBoxForSearch = BWA.SearchView.createDateTimeBox();
  28. // cyim 2016.08.22 : 성능분석 그래프의 경우 시간 데이타만 표시되어야 한다
  29. var timeBoxForSearch = BWA.SearchView.createDateTimeBox($G.TimeTypesForHourOnly, null, false);
  30. var chartEffi = BWA.Chart.Instance('chartEffiHEA', 'dxChart'),
  31. chartAV = BWA.Chart.Instance('chartAVHEA', 'dxChart'),
  32. chartPump = BWA.Chart.Instance('chartPumpHEA', 'dxChart'),
  33. chartATF = BWA.Chart.Instance('chartATFHEA', 'dxChart');
  34. var chartLayout = new BWA.ChartLayout({
  35. divs: [[{
  36. id: 'HeatExchangerDetail'
  37. }, {
  38. id: 'Effi',
  39. chartId: 'chartEffiHEA'
  40. }, {
  41. id: 'AV',
  42. chartId: 'chartAVHEA'
  43. }, {
  44. id: 'Pump',
  45. chartId: 'chartPumpHEA'
  46. }, {
  47. id: 'ATF',
  48. chartId: 'chartATFHEA'
  49. }
  50. ]],
  51. multiViewOptions: {
  52. viewIndex: currentTabIndex,
  53. viewCount: 1
  54. }
  55. });
  56. // 2018.08.21 : 그리드 도표 작업 : 팝업창 추가
  57. // 팝업창뷰 보이기 속성 제어용 변수 선언
  58. var DataGridPopup_Visible = ko.observable(false);
  59. // 그래프 출력 이후 엑셀출력을 위한 팝업창을 위해 임시 저장용 배열 선언
  60. var dataArrayresult = ko.observableArray();
  61. // 2018.08.21 : 그리드 도표 작업 : 팝업창 추가
  62. var m = moment();
  63. dataCalorie([
  64. { DateTime: new Date(m.year(), m.month(), 1), Value: 50 },
  65. { DateTime: new Date(m.year(), m.month(), 2), Value: 50 },
  66. { DateTime: new Date(m.year(), m.month(), 3), Value: 60 },
  67. { DateTime: new Date(m.year(), m.month(), 4), Value: 80 },
  68. { DateTime: new Date(m.year(), m.month(), 5), Value: 100 },
  69. { DateTime: new Date(m.year(), m.month(), 6), Value: 40, },
  70. { DateTime: new Date(m.year(), m.month(), 7), Value: 120 },
  71. { DateTime: new Date(m.year(), m.month(), 31), Value: 120 }
  72. ]);
  73. // 추가 2015 04 20 hcLee ->
  74. var CODE = $Code,
  75. FuelType = CODE.FuelType,
  76. FT = CODE.FacilityType,
  77. FC = CODE.FacilityCode,
  78. F = CODE.Formula,
  79. TIT = CODE.TimeIntervalType;
  80. // 추가 2015 04 20 hcLee <-
  81. //dataMonthForBar(dataDayForBar());
  82. //dataDayForPie([
  83. // { FuelTypeName: '전기', Value: 320 },
  84. // { FuelTypeName: '가스', Value: 350 },
  85. // { FuelTypeName: '수도', Value: 360 },
  86. //]);
  87. //dataMonthForPie(dataDayForPie());
  88. function handleViewShown() {
  89. if (initialized === false) {
  90. var chartOption = BWA.ChartOptions.HeatExchangerAnalysis;
  91. //chartEffi = chartEffi(chartOption.getChartEffiOptions($Code.TimeType.HOUR));
  92. chartEffi = chartEffi(chartOption.getChart_1_Options($Code.TimeType.HOUR));
  93. //chartAV = chartAV(chartOption.getChartAVOptions($Code.TimeType.HOUR));
  94. chartAV = chartAV(chartOption.getChart_2_Options($Code.TimeType.HOUR));
  95. chartPump = chartPump(chartOption.getChart_3_Options($Code.TimeType.HOUR));
  96. //chartATF = chartATF(chartOption.getChartATFOptions($Code.TimeType.HOUR));
  97. chartATF = chartATF(chartOption.getChart_4_Options($Code.TimeType.HOUR));
  98. initialized = true;
  99. }
  100. //hcLee 2016 07 12
  101. timeBoxForSearch.setDefaultDate();
  102. var eq = BWA.DataUtil.constructEqualFilter;
  103. facilityDataSource.filter([
  104. eq('SiteId', BWA.UserInfo.SiteId()),
  105. 'and',
  106. eq('FacilityTypeId', $Code.FacilityType.EARTH)
  107. ]);
  108. facilityDataSource.load().done(function(facilities) {
  109. facilitiesForSearch(facilities);
  110. if (_.isEmpty(facilities) === false) {
  111. var f = facilities[0];
  112. handleSelectedFacilityInSearchView(f);
  113. handleSearchInSearchView();
  114. var datagrid = $('#HeatExchangerDataGridViewInSearchView').dxDataGrid('instance');
  115. if (_.has(datagrid, 'selectRows')) {
  116. datagrid.selectRows(f);
  117. }
  118. }
  119. });
  120. }
  121. if (shouldReload) {
  122. //shouldReload = false;
  123. //dataSource.pageIndex(0);
  124. //dataSource.load();
  125. }
  126. function handleViewHidden() {
  127. var paging = BWA.ChartLayout.Paging;
  128. paging.sideOverlayVisible(false);
  129. $SearchView.visibleObservable(false); // hcLee 2015 03 23
  130. visiblePopup(false);
  131. }
  132. function handleViewShowing() {
  133. }
  134. function refreshList() {
  135. //dataSource.pageIndex(0);
  136. //dataSource.load();
  137. }
  138. var searchViewOptions = {
  139. searchViewItems: [
  140. { id: 'FacilityCode', ignoreValue: 0, defaultValue: 0, value: facilityCodeForSearch, dataSource: facilitiesForSearch },
  141. ],
  142. promiseDataInSearchView: deferredForSearch.promise()
  143. };
  144. function handleSelectedFacilityInSearchView(facility) {
  145. m_Facility = facility;
  146. return;
  147. }
  148. function handleSearchInSearchView(filter, searchViewItems) {
  149. if (m_Facility == null) return;
  150. visiblePopup(true);
  151. var f = m_Facility.toJS();
  152. facilityViewModel.fromJS(f);
  153. //var timeIntervalType = $Code.TimeIntervalType.QUARTERMIN;
  154. var timeIntervalType = timeBoxForSearch.type();
  155. //var formula = $Code.Formula[$Code.FacilityType.HEAT_EXCHANGER];
  156. var formula = $Code.Formula[$Code.FacilityType.EARTH];
  157. var formulaIds = _.values(formula);
  158. var date = timeBoxForSearch.getDate();
  159. /*
  160. timeBoxForSearch.type($Code.TimeIntervalType.DAY);
  161. timeIntervalType = $Code.TimeIntervalType.DAY;
  162. date.startDate = new Date(2015, 0, 1);
  163. date.endDate = new Date(2015, 11, 31);
  164. */
  165. //utils.toast.displayTime=1000000;
  166. //utils.toast.show('공조기 성능분석 중 입니다. 잠시만 기다려 주세요');
  167. // var startDate = moment().
  168. var promises = [];
  169. _.each(formulaIds, function (formulaId) {
  170. var p = formulaGet.apiGet({
  171. FacilityTypeId: f.FacilityTypeId,
  172. FacilityCode: f.FacilityCode,
  173. FormulaId: formulaId,
  174. TimeIntervalType: timeIntervalType,
  175. StartDate: date.startDate,
  176. EndDate: date.endDate
  177. });
  178. promises.push(p);
  179. });
  180. // 외기 온도
  181. var commonParameters = {
  182. //TimeIntervalType: $Code.TimeIntervalType.QUARTERMIN,
  183. TimeIntervalType: timeIntervalType,
  184. StartDate: date.startDate,
  185. EndDate: date.endDate
  186. };
  187. var temperatureParameters = {
  188. FacilityTypeId: FT.OUTDOOR,
  189. FacilityCode: FC.OUTDOOR,
  190. FormulaId: F[FT.OUTDOOR].TEMPERATURE,
  191. };
  192. var humidityParameters = _.extend({}, temperatureParameters, {
  193. FormulaId: F[FT.OUTDOOR].HUMIDITY,
  194. });
  195. promises.push(formulaGet.apiGet(_.extend(temperatureParameters, commonParameters)));
  196. promises.push(formulaGet.apiGet(_.extend(humidityParameters, commonParameters)));
  197. /*
  198. $.when.apply(this, promises).done(function (effi, r_effi, elec, s_water_temp, r_water_temp, sw, lift, atf,
  199. OUTtemperatures) {
  200. effi = effi[0];
  201. r_effi = r_effi[0];
  202. elec = elec[0];
  203. s_water_temp = s_water_temp[0];
  204. r_water_temp = r_water_temp[0];
  205. sw = sw[0];
  206. lift = lift[0];
  207. atf = atf[0]; */
  208. $.when.apply(this, promises)
  209. //.done(function (cop, load, in_temp, out_temp, kw, OUTtemperatures, humidities) {
  210. .done(function (cop, load, in_temp, out_temp, kw, green, OUTtemperatures, humidities) {
  211. cop = cop[0];
  212. load = load[0];
  213. in_temp = in_temp[0];
  214. out_temp = out_temp[0];
  215. kw = kw[0];
  216. // chart 1
  217. //var EffiDataArray = [];
  218. var maxValuecops = 0;
  219. _.each(cop, function (x) {
  220. if (maxValuecops < x.Value) maxValuecops = x.Value;
  221. });
  222. var EffiDataArray = BWA.Chart.mapNewWithConvertingDateTime(cop, timeBoxForSearch.type());
  223. _.each(OUTtemperatures[0], function (x) {
  224. EffiDataArray.push({
  225. DateTime: BWA.Chart.getCustermTimeArgumentAxisString(timeBoxForSearch.type(), moment(x.DateTime).toDate()),
  226. Temperature: x.Value
  227. });
  228. });
  229. _.each(humidities[0], function (x) {
  230. EffiDataArray.push({
  231. DateTime: BWA.Chart.getCustermTimeArgumentAxisString(timeBoxForSearch.type(), moment(x.DateTime).toDate()),
  232. Humidity: x.Value
  233. });
  234. });
  235. var options = BWA.ChartOptions.HeatExchangerAnalysis.getChart_1_Options(timeBoxForSearch.type());
  236. options.valueAxis[0].tickInterval = Math.round(maxValuecops / 5) + 1;
  237. options.dataSource = EffiDataArray;
  238. chartEffi().option(options);
  239. /*
  240. _.each(effi, function (x) {
  241. EffiDataArray.push({
  242. //DateTime: moment(x.DateTime).toDate(),
  243. DateTime: BWA.Chart.getCustermTimeArgumentAxisString(timeBoxForSearch.type(), moment(x.DateTime).toDate()),
  244. effi: x.Value
  245. });
  246. });
  247. _.each(r_effi, function (x) {
  248. EffiDataArray.push({
  249. //DateTime: moment(x.DateTime).toDate(),
  250. DateTime: BWA.Chart.getCustermTimeArgumentAxisString(timeBoxForSearch.type(), moment(x.DateTime).toDate()),
  251. r_effi: x.Value
  252. });
  253. });
  254. _.each(elec, function (x) {
  255. EffiDataArray.push({
  256. //DateTime: moment(x.DateTime).toDate(),
  257. DateTime: BWA.Chart.getCustermTimeArgumentAxisString(timeBoxForSearch.type(), moment(x.DateTime).toDate()),
  258. elec: x.Value
  259. });
  260. });
  261. //chartEffi().option('dataSource', EffiDataArray);
  262. var options = BWA.ChartOptions.HeatExchangerAnalysis.getChartEffiOptions(timeBoxForSearch.type());
  263. //chartEffi().option('argumentAxis', null); // 2015 05 21 결국 이 코드가 필요 함 (시간 축 에러 해결)
  264. options.dataSource = EffiDataArray;
  265. chartEffi().option(options); */
  266. //chart2
  267. /*
  268. var AVDataArray = [];
  269. _.each(s_water_temp, function (x) {
  270. AVDataArray.push({
  271. //DateTime: moment(x.DateTime).toDate(),
  272. DateTime: BWA.Chart.getCustermTimeArgumentAxisString(timeBoxForSearch.type(), moment(x.DateTime).toDate()),
  273. s_water_temp: x.Value
  274. });
  275. });
  276. _.each(r_water_temp, function (x) {
  277. AVDataArray.push({
  278. //DateTime: moment(x.DateTime).toDate(),
  279. DateTime: BWA.Chart.getCustermTimeArgumentAxisString(timeBoxForSearch.type(), moment(x.DateTime).toDate()),
  280. r_water_temp: x.Value
  281. });
  282. });
  283. _.each(elec, function (x) {
  284. AVDataArray.push({
  285. //DateTime: moment(x.DateTime).toDate(),
  286. DateTime: BWA.Chart.getCustermTimeArgumentAxisString(timeBoxForSearch.type(), moment(x.DateTime).toDate()),
  287. elec: x.Value
  288. });
  289. });
  290. //chartAV().option('dataSource', AVDataArray);
  291. options = BWA.ChartOptions.HeatExchangerAnalysis.getChartAVOptions(timeBoxForSearch.type());
  292. chartAV().option('argumentAxis', null); // 2015 05 21 결국 이 코드가 필요 함 (시간 축 에러 해결)
  293. options.dataSource = AVDataArray;
  294. chartAV().option(options);
  295. */
  296. var dataArray = BWA.Chart.getRelationDataArrayOnDateTime(cop, load, 'cop', 'load');
  297. var options = BWA.ChartOptions.HeatExchangerAnalysis.getChart_2_Options(timeBoxForSearch.type());
  298. //chartElectricityLoadRate().option('argumentAxis', null); // 2015 05 21 결국 이 코드가 필요 함 (시간 축 에러 해결)
  299. options.dataSource = dataArray;
  300. chartAV().option(options);
  301. //chart3
  302. /*
  303. var PumpDataArray = [];
  304. _.each(sw, function (x) {
  305. PumpDataArray.push({
  306. //DateTime: moment(x.DateTime).toDate(),
  307. DateTime: BWA.Chart.getCustermTimeArgumentAxisString(timeBoxForSearch.type(), moment(x.DateTime).toDate()),
  308. sw: x.Value
  309. });
  310. });
  311. _.each(lift, function (x) {
  312. PumpDataArray.push({
  313. //DateTime: moment(x.DateTime).toDate(),
  314. DateTime: BWA.Chart.getCustermTimeArgumentAxisString(timeBoxForSearch.type(), moment(x.DateTime).toDate()),
  315. lift: x.Value
  316. });
  317. });
  318. _.each(elec, function (x) {
  319. PumpDataArray.push({
  320. //DateTime: moment(x.DateTime).toDate(),
  321. DateTime: BWA.Chart.getCustermTimeArgumentAxisString(timeBoxForSearch.type(), moment(x.DateTime).toDate()),
  322. elec: x.Value
  323. });
  324. });
  325. //chartPump().option('dataSource', PumpDataArray);
  326. options = BWA.ChartOptions.HeatExchangerAnalysis.getChartPumpOptions(timeBoxForSearch.type());
  327. //chartPump().option('argumentAxis', null); // 2015 05 21 결국 이 코드가 필요 함 (시간 축 에러 해결)
  328. options.dataSource = PumpDataArray;
  329. chartPump().option(options); */
  330. var maxValuecops = 0;
  331. _.each(load, function (x) {
  332. if (maxValuecops < x.Value) maxValuecops = x.Value;
  333. });
  334. EffiDataArray = BWA.Chart.mapNewWithConvertingDateTime(load, timeBoxForSearch.type());
  335. //_.each(OUTtemperatures[0], function (x) {
  336. // EffiDataArray.push({
  337. // DateTime: BWA.Chart.getCustermTimeArgumentAxisString(timeBoxForSearch.type(), moment(x.DateTime).toDate()),
  338. // Temperature: x.Value
  339. // });
  340. //});
  341. //_.each(humidities[0], function (x) {
  342. // EffiDataArray.push({
  343. // DateTime: BWA.Chart.getCustermTimeArgumentAxisString(timeBoxForSearch.type(), moment(x.DateTime).toDate()),
  344. // Humidity: x.Value
  345. // });
  346. //});
  347. var options = BWA.ChartOptions.HeatExchangerAnalysis.getChart_3_Options(timeBoxForSearch.type());
  348. //options.valueAxis[0].tickInterval = Math.round(maxValuecops / 5) + 1;
  349. options.dataSource = EffiDataArray;
  350. chartPump().option(options);
  351. //chart4
  352. /*
  353. var maxValue = 0;
  354. var ATFDataArray = [];
  355. _.each(atf, function (x) {
  356. ATFDataArray.push({
  357. //DateTime: moment(x.DateTime).toDate(),
  358. DateTime: BWA.Chart.getCustermTimeArgumentAxisString(timeBoxForSearch.type(), moment(x.DateTime).toDate()),
  359. atf: x.Value
  360. });
  361. if (maxValue < x.Value) maxValue = x.Value;
  362. });
  363. _.each(OUTtemperatures[0], function (x) {
  364. ATFDataArray.push({
  365. //DateTime: moment(x.DateTime).toDate(),
  366. DateTime: BWA.Chart.getCustermTimeArgumentAxisString(timeBoxForSearch.type(), moment(x.DateTime).toDate()),
  367. temp: x.Value
  368. });
  369. });
  370. //chartATF().option('dataSource', ATFDataArray);
  371. options = BWA.ChartOptions.HeatExchangerAnalysis.getChartATFOptions(timeBoxForSearch.type());
  372. //chartATF().option('argumentAxis', null); // 2015 05 21 결국 이 코드가 필요 함 (시간 축 에러 해결)
  373. options.valueAxis[0].tickInterval = Math.round(maxValue / 5) + 1;
  374. options.dataSource = ATFDataArray;
  375. chartATF().option(options); */
  376. var DataArray_temp = [], DataArray_temp1 = [], DataArray_temp2 = [], DataArray_temp3 = [];
  377. EffiDataArray = BWA.Chart.mapNewWithConvertingDateTime(kw, timeBoxForSearch.type());
  378. DataArray_temp = BWA.Chart.mapNewWithConvertingDateTime(kw, timeBoxForSearch.type());
  379. _.each(in_temp, function (x) {
  380. EffiDataArray.push({
  381. DateTime: BWA.Chart.getCustermTimeArgumentAxisString(timeBoxForSearch.type(), moment(x.DateTime).toDate()),
  382. in_temp: x.Value
  383. });
  384. });
  385. _.each(out_temp, function (x) {
  386. EffiDataArray.push({
  387. DateTime: BWA.Chart.getCustermTimeArgumentAxisString(timeBoxForSearch.type(), moment(x.DateTime).toDate()),
  388. out_temp: x.Value
  389. });
  390. });
  391. _.each(in_temp, function (x) {
  392. DataArray_temp1.push({
  393. DateTime: BWA.Chart.getCustermTimeArgumentAxisString($Code.TimeType.QUARTERMIN, moment(x.DateTime).toDate()),
  394. in_temp: x.Value
  395. });
  396. });
  397. _.each(out_temp, function (x) {
  398. DataArray_temp2.push({
  399. DateTime: BWA.Chart.getCustermTimeArgumentAxisString(timeBoxForSearch.type(), moment(x.DateTime).toDate()),
  400. out_temp: x.Value
  401. });
  402. });
  403. var array_length_size = Math.max(DataArray_temp.length, DataArray_temp1.length, DataArray_temp2.length);
  404. // 크기가 동일한 경우에만 허용함 (예외 방어용)
  405. if (DataArray_temp.length == DataArray_temp1.length && DataArray_temp1.length == DataArray_temp2.length) {
  406. for (var i = 0; i < array_length_size; i++) {
  407. DataArray_temp3.push(
  408. {
  409. DateTime: DataArray_temp1[i].DateTime,
  410. 'kw': DataArray_temp[i].Value,
  411. 'in_temp': DataArray_temp1[i].in_temp,
  412. 'out_temp': DataArray_temp2[i].out_temp,
  413. });
  414. }
  415. }
  416. var options = BWA.ChartOptions.HeatExchangerAnalysis.getChart_4_Options(timeBoxForSearch.type());
  417. //options.valueAxis[0].tickInterval = Math.round(maxValuecops / 5) + 1;
  418. options.dataSource = EffiDataArray;
  419. // 2018.08.21 : 그리드 도표 작업 : 팝업창 추가
  420. dataArrayresult = DataArray_temp3;
  421. chartATF().option(options);
  422. visiblePopup(false);
  423. })
  424. .fail(function (error) {
  425. visiblePopup(false);
  426. });
  427. }
  428. // 2018.08.21 : 그리드 도표 작업 : 팝업창 추가
  429. function DataGridPopup_ButtonClick() {
  430. DataGridPopup_Visible(true);
  431. }
  432. function handlePopupShown() {
  433. // 데이타소스 업데이트
  434. $("#HeatExchangerDataGrid_Container").dxDataGrid("instance").option("dataSource", dataArrayresult);
  435. // 팝업창 갱신
  436. DataGridPopup_Visible(true);
  437. }
  438. var viewModel = $.extend(BWA.CommonView.create(
  439. params, viewInfo, searchViewOptions, ko.observable(null),
  440. handleViewShown, null, handleSearchInSearchView, undefined,
  441. chartLayout), {
  442. // facility: facilityViewModel,
  443. refreshList: refreshList,
  444. viewHidden: handleViewHidden, // hcLee 2015 06 03
  445. viewShowing: handleViewShowing,
  446. scrolling: { mode: 'infinite' },
  447. HeatExchangerDataGridOptions: {
  448. dataSource: facilitiesForSearch,
  449. columns: [
  450. { dataField: 'Name', caption: $G('facilityName'), width: '100%', alignment: 'left' }
  451. ],
  452. filterRow: {
  453. visible: true,
  454. showOperationChooser: false
  455. },
  456. selection: {
  457. mode: 'single'
  458. },
  459. rowClick: function(clickRow) {
  460. handleSelectedFacilityInSearchView(clickRow.data);
  461. }
  462. },
  463. contentReadyAction: function (e) {
  464. datagrid = e.component;
  465. }
  466. // 2018.08.21 : 그리드 도표 작업 : 팝업창 추가
  467. , HeatExchangerDataGridPopup_ButtonClicked: DataGridPopup_ButtonClick
  468. // 2018.08.21 : 그리드 도표 작업 : 팝업창 추가
  469. });
  470. // 2018.08.21 : 그리드 도표 작업 : 팝업창 추가
  471. viewModel.HeatExchangerDataGridPopupOptions = {
  472. width: '480px',
  473. height: '750px', // cyim 2017.05.30 : 테스트 결과 Devextreme 버그임. px 로 지정하면 초기 출력시 정확하게 가운데에 있지만, auto 설정시 화면아래에 위치하게 됨
  474. contentTemplate: "content",
  475. showTitle: true,
  476. title: "도표",
  477. visible: DataGridPopup_Visible,
  478. dragEnabled: true,
  479. closeOnOutsideClick: true,
  480. shownAction: handlePopupShown,
  481. animation: window.utils.popup.createAnimation()
  482. };
  483. // 2018.08.21 : 그리드 도표 작업 : 팝업창 추가
  484. viewModel.timeBoxForSearch = timeBoxForSearch;
  485. viewModel.currentTabIndex = currentTabIndex;
  486. viewModel.multiViewItems = [{
  487. facility: facilityViewModel,
  488. template: 'mainCharts'
  489. }, {
  490. template: 'subCharts'
  491. }
  492. ];
  493. $HourGlassPopup(viewModel, visiblePopup);
  494. // 2018.08.21 : 그리드 도표 작업 : 팝업창 추가
  495. viewModel.HeatExchangerDataGridOptions1 = {
  496. dataSource: dataArrayresult,
  497. paging: { pageSize: 17 },
  498. columns: [
  499. { dataField: 'DateTime', caption: "날짜", width: '31%', alignment: 'center', },// dataType: 'date', format: 'yyyy-MM-dd HH:mm' },
  500. { dataField: 'kw', caption: "소비전력", width: '23%', alignment: 'center', format: 'fixedPoint', precision: 2 },
  501. { dataField: 'in_temp', caption: "공급온도", width: '23%', alignment: 'center', format: 'fixedPoint', precision: 2 },
  502. { dataField: 'out_temp', caption: "환수온도", width: '23%', alignment: 'center', format: 'fixedPoint', precision: 2 }
  503. ],
  504. // 엑셀 출력
  505. "export": {
  506. enabled: true,
  507. fileName: '지열시스템 성능분석'
  508. }
  509. };
  510. // 2018.08.21 : 그리드 도표 작업 : 팝업창 추가
  511. return viewModel;
  512. };