1824d07dcca2330d2ddb627bb3e92ab98e1c2655.svn-base 25 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626
  1. BemsWebApplication.Zone_TempHumi = function (params, viewInfo) {
  2. "use strict";
  3. var endpointSelector = "";
  4. if (BemsWebApplication.config.mode == "production") {
  5. endpointSelector = new DevExpress.EndpointSelector(BemsWebApplication.config.endpoints).config.db.production;
  6. } else {
  7. endpointSelector = new DevExpress.EndpointSelector(BemsWebApplication.config.endpoints).config.db.local;
  8. }
  9. var AIR_HANDLING = $Code.FacilityType.AIR_HANDLING;
  10. var BUILDING_DEPTH = 1, FLOOR_DEPTH = 2, ZONE_DEPTH = 3;
  11. var CODE = $Code, FuelType = CODE.FuelType, FT = CODE.FacilityType, FC = CODE.FacilityCode, F = CODE.Formula, TIT = CODE.TimeIntervalType;
  12. var QUARTERMIN = $Code.TimeType.QUARTERMIN;
  13. var visiblePopup = ko.observable(false);
  14. var tempvisiblePopup = ko.observable(false);
  15. var initialized = false,
  16. shouldReload = false,
  17. facilityViewModel = new BWA.CmFacilityViewModel(),
  18. dataSource;
  19. var eq = BWA.DataUtil.constructEqualFilter, and = BWA.DataUtil.andFilter;
  20. var currentTabIndex = ko.observable(0);
  21. var m_Facility;
  22. var FacilityCode;
  23. var facilityDataSource = BWA.db.createDataSource('CmFacility'), facilitiesForSearch = ko.observableArray(), facilityCodeForSearch = ko.observable(0), deferredForSearch = new $.Deferred();
  24. var SiteId = BWA.UserInfo.SiteId();
  25. var formulaGet = new BWA.Chart.FormulaGet(SiteId);
  26. var timeBoxForSearch = BWA.SearchView.createDateTimeBox();
  27. var deferredForLoadData = new $.Deferred();
  28. var chart = BWA.Chart.Instance('chartZTH', 'dxChart');
  29. var locationEnableForSearch = ko.observable(false);
  30. var t_temp = ko.observable(22);
  31. var t_humi = ko.observable(33);
  32. // 2017.09.08 : 그리드 도표 작업 : 팝업창 추가
  33. // 팝업창뷰 보이기 속성 제어용 변수 선언
  34. var DataGridPopup_Visible = ko.observable(false);
  35. // 그래프 출력 이후 엑셀출력을 위한 팝업창을 위해 임시 저장용 배열 선언
  36. var dataArrayresult = ko.observableArray();
  37. // 2017.09.08 : 그리드 도표 작업 : 팝업창 추가
  38. function isNumber(s) {
  39. s += ''; // 문자열로 변환
  40. s = s.replace(/^\s*|\s*$/g, ''); // 좌우 공백 제거
  41. if (s == '' || isNaN(s)) return false;
  42. return true;
  43. }
  44. function handleClickTreeItem(element, data) {
  45. var eq = BWA.DataUtil.constructEqualFilter;
  46. var depth = data.depth;
  47. //data = data.data;
  48. switch (depth) {
  49. case BUILDING_DEPTH: // building
  50. data = data.data;
  51. buildingIdForSearch(data.BuildingId());
  52. buildingNameForSearch(data.Name());
  53. floorIdForSearch(null);
  54. floorNameForSearch('');
  55. zoneIdForSearch(null);
  56. zoneNameForSearch('');
  57. break;
  58. case FLOOR_DEPTH: // floor
  59. buildingNameForSearch(data.parentData.data.Name());
  60. //alert(buildingIdForSearch());
  61. data = data.data;
  62. buildingIdForSearch(data.BuildingId());
  63. floorIdForSearch(data.FloorId());
  64. floorNameForSearch(data.Name());
  65. zoneIdForSearch(null);
  66. zoneNameForSearch('');
  67. break;
  68. case ZONE_DEPTH: // zone
  69. floorNameForSearch(data.parentData.data.Name());
  70. buildingNameForSearch(data.parentData.parentData.data.Name());
  71. data = data.data;
  72. buildingIdForSearch(data.BuildingId());
  73. floorIdForSearch(data.FloorId());
  74. zoneIdForSearch(data.ZoneId());
  75. zoneNameForSearch(data.Name());
  76. break;
  77. }
  78. }
  79. function handleViewShown() {
  80. if (initialized === false) {
  81. chart = chart(BWA.ChartOptions.Zone_TempHumi.getSeriesOptions(timeBoxForSearch.type(), t_temp(22), t_humi(33)));
  82. initialized = true;
  83. }
  84. var eq = BWA.DataUtil.constructEqualFilter;
  85. facilityDataSource.filter([
  86. eq('SiteId', SiteId),
  87. 'and',
  88. eq('FacilityTypeId', AIR_HANDLING)
  89. ]);
  90. facilityDataSource.load().done(function (facilities) {
  91. facilitiesForSearch(facilities);
  92. if (_.isEmpty(facilities) === false) {
  93. var f = facilities[0];
  94. handleSelectedFacilityInSearchView(f);
  95. handleSearchInSearchView();
  96. var datagrid = $('#airHandlingDataGridViewInSearchView').dxDataGrid('instance');
  97. if (_.has(datagrid, 'selectRows')) {
  98. datagrid.selectRows(f);
  99. }
  100. }
  101. });
  102. if (shouldReload) {
  103. }
  104. $("#S_Temp_Btn").dxButton({
  105. text: "기준온도 설정",
  106. onClick: function () {
  107. if ($("#Set_Max_Temp").dxTextBox("instance") != null)
  108. $("#Set_Max_Temp").dxTextBox("instance").option('value', null);
  109. if ($("#Set_Min_Temp").dxTextBox("instance") != null)
  110. $("#Set_Min_Temp").dxTextBox("instance").option('value', null);
  111. tempvisiblePopup(true);
  112. }
  113. });
  114. }
  115. function handleViewHidden() {
  116. $SearchView.visibleObservable(false); // hcLee 2015 03 23
  117. visiblePopup(false);
  118. }
  119. function handleViewShowing() {
  120. }
  121. function refreshList() {
  122. }
  123. var searchViewOptions = {
  124. searchViewItems: [
  125. { id: 'FacilityCode', ignoreValue: 0, defaultValue: 0, value: facilityCodeForSearch, dataSource: facilitiesForSearch },
  126. ],
  127. promiseDataInSearchView: deferredForSearch.promise()
  128. };
  129. function handleSelectedFacilityInSearchView(facility) {
  130. m_Facility = facility;
  131. return;
  132. }
  133. function handleSearchInSearchView(filter, searchViewItems) {
  134. if (m_Facility == null) return;
  135. visiblePopup(true);
  136. var f = m_Facility.toJS();
  137. facilityViewModel.fromJS(f);
  138. FacilityCode = f.FacilityCode;
  139. var timeIntervalType = timeBoxForSearch.type();
  140. var formula = $Code.Formula[AIR_HANDLING];
  141. var formulaIds = _.values(formula);
  142. var date = timeBoxForSearch.getDate();
  143. var promises = [];
  144. _.each(formulaIds, function (formulaId) {
  145. var p = formulaGet.apiGet({
  146. FacilityTypeId: f.FacilityTypeId,
  147. FacilityCode: FacilityCode,
  148. FormulaId: formulaId,
  149. TimeIntervalType: timeIntervalType,
  150. StartDate: date.startDate,
  151. EndDate: date.endDate
  152. });
  153. promises.push(p);
  154. });
  155. // 외기 온도와 습도를 위해 추가 hcLee 2015 04 20 ->
  156. var commonParameters = {
  157. TimeIntervalType: timeIntervalType,
  158. StartDate: date.startDate,
  159. EndDate: date.endDate
  160. };
  161. var temperatureParameters = {
  162. FacilityTypeId: FT.OUTDOOR,
  163. FacilityCode: FC.OUTDOOR,
  164. FormulaId: F[FT.OUTDOOR].TEMPERATURE,
  165. };
  166. var humidityParameters = _.extend({}, temperatureParameters, {
  167. FormulaId: F[FT.OUTDOOR].HUMIDITY,
  168. });
  169. promises.push(formulaGet.apiGet(_.extend(temperatureParameters, commonParameters)));
  170. promises.push(formulaGet.apiGet(_.extend(humidityParameters, commonParameters)));
  171. // 외기 온도와 습도를 위해 추가 hcLee 2015 04 20 <-
  172. //promises.push(utils.toast.show('공조기 성능분석 중 입니다. 잠시만 기다려 주세요'));
  173. $.when.apply(this, promises)
  174. .done(function (coldWaterCalories, hotWaterCalories, coldWaterAtfws,
  175. hotWaterAtfws, in_temperatures, out_temperatures, cold_electricities, hot_electricities,
  176. cold_vopen, hot_vopen,
  177. cold_in_temperatures, cold_out_temperatures, // 이 2개는 2015 06 15일 추가
  178. f_temp, f_humi, // 2015 07 10 추가 실내 온, 습도
  179. co2, // 2015 07 10 추가
  180. x16, x17, x18, x19, X20,
  181. A21, A22, A23, A24, A25, A26,
  182. S_TEMP, M_TEMP, S_HUMY, CO, DUST, OZONE, S_VOLUME, M_OPENING_RATE, ONOFF, DUTYCYCLE_CHECK, ENTHALPY_CHECK,
  183. OUTtemperatures, OUTHumi) {
  184. coldWaterCalories = coldWaterCalories[0];
  185. hotWaterCalories = hotWaterCalories[0];
  186. coldWaterAtfws = coldWaterAtfws[0];
  187. hotWaterAtfws = hotWaterAtfws[0];
  188. in_temperatures = in_temperatures[0];
  189. out_temperatures = out_temperatures[0];
  190. cold_electricities = cold_electricities[0];
  191. hot_electricities = hot_electricities[0];
  192. cold_vopen = cold_vopen[0];
  193. hot_vopen = hot_vopen[0];
  194. cold_in_temperatures = cold_in_temperatures[0];
  195. cold_out_temperatures = cold_out_temperatures[0];
  196. X20 = X20[0]; // 목표온도
  197. f_temp = f_temp[0],// 2015 07 10 추가 실내 온도
  198. f_humi = f_humi[0], // 2015 07 10 추가 실내 습도
  199. co2 = co2[0]; // co2
  200. OUTtemperatures = OUTtemperatures[0];
  201. OUTHumi = OUTHumi[0];
  202. var temp = f_temp;
  203. var humi = f_humi;
  204. var dataArray = [];
  205. // 2017.09.08 : 그리드 도표 작업 : 팝업창 추가
  206. var dataArray_Temp = [];
  207. var dataArray_Temp1 = [];
  208. var dataArray_Temp2 = [];
  209. var dataArray_Temp3 = [];
  210. var dataArray_Temp4 = [];
  211. var dataArray_Temp5 = [];
  212. var dataArray_final = []
  213. // 2017.09.08 : 그리드 도표 작업 : 팝업창 추가
  214. _.each(temp, function (x) {
  215. dataArray_Temp.push({
  216. DateTime: BWA.Chart.getCustermTimeArgumentAxisString(timeBoxForSearch.type(), moment(x.DateTime).toDate()),
  217. temp: x.Value, //실내온도
  218. });
  219. });
  220. // 2016 04 12 추가
  221. _.each(OUTtemperatures, function (x) {
  222. dataArray_Temp2.push({
  223. DateTime: BWA.Chart.getCustermTimeArgumentAxisString(timeBoxForSearch.type(), moment(x.DateTime).toDate()),
  224. Temperature: x.Value //외기온도
  225. });
  226. });
  227. _.each(humi, function (x) {
  228. dataArray_Temp3.push({
  229. DateTime: BWA.Chart.getCustermTimeArgumentAxisString(timeBoxForSearch.type(), moment(x.DateTime).toDate()),
  230. humi: x.Value, //실내습도
  231. });
  232. });
  233. // 2016 04 12 추가
  234. _.each(OUTHumi, function (x) {
  235. dataArray_Temp4.push({
  236. DateTime: BWA.Chart.getCustermTimeArgumentAxisString(timeBoxForSearch.type(), moment(x.DateTime).toDate()),
  237. Humidity: x.Value //외기습도
  238. });
  239. });
  240. _.each(co2, function (x) {
  241. dataArray_Temp5.push({
  242. DateTime: BWA.Chart.getCustermTimeArgumentAxisString(timeBoxForSearch.type(), moment(x.DateTime).toDate()),
  243. co2: x.Value, //CO2농도
  244. });
  245. });
  246. t_temp(0);
  247. t_humi(0);
  248. // 2017.09.08 : 그리드 도표 작업 : 팝업창 추가
  249. // 배열을 하나로 합치자
  250. var array_length_size = Math.max(dataArray_Temp.length, dataArray_Temp2.length, dataArray_Temp3.length, dataArray_Temp4.length, dataArray_Temp5.length);
  251. // 크기가 동일한 경우에만 허용함 (예외 방어용)
  252. if ((dataArray_Temp.length == dataArray_Temp2.length) && (dataArray_Temp2.length == dataArray_Temp3.length) && (dataArray_Temp3.length == dataArray_Temp4.length) && (dataArray_Temp4.length == dataArray_Temp5.length)) {
  253. for (var i = 0; i < array_length_size; i++) {
  254. dataArray.push(
  255. {
  256. DateTime: dataArray_Temp[i].DateTime,
  257. temp: dataArray_Temp[i].temp,
  258. Temperature: dataArray_Temp2[i].Temperature,
  259. humi: dataArray_Temp3[i].humi,
  260. Humidity: dataArray_Temp4[i].Humidity,
  261. co2: dataArray_Temp5[i].co2
  262. });
  263. }
  264. }
  265. var BemsSTempDataSource = new DevExpress.data.DataSource({
  266. store: {
  267. type: "odata",
  268. url: endpointSelector + "/BemsControlAHUTempConfig"
  269. },
  270. requireTotalCount: true,
  271. pageSize: 1
  272. });
  273. BemsSTempDataSource.filter([
  274. ['SiteId', "=", SiteId],
  275. 'and',
  276. ['FacilityCode', "=", FacilityCode]
  277. ]);
  278. BemsSTempDataSource.load()
  279. .done(function (STemp) {
  280. var Maxtemp, Mintemp;
  281. if (STemp.length == 0) {
  282. //utils.toast.show("공조기 기준온도가 없습니다.");
  283. dataArray_final = dataArray;
  284. }
  285. else {
  286. Maxtemp = STemp[0].MaxTemperature;
  287. Mintemp = STemp[0].MinTemperature;
  288. for (var i = 0; i < dataArray.length; i++) {
  289. dataArray_final.push(
  290. {
  291. DateTime: dataArray[i].DateTime,
  292. temp: dataArray[i].temp,
  293. Temperature: dataArray[i].Temperature,
  294. humi: dataArray[i].humi,
  295. Humidity: dataArray[i].Humidity,
  296. co2: dataArray[i].co2,
  297. tempSetminT: Mintemp,
  298. tempSetmaxT: Maxtemp,
  299. });
  300. }
  301. }
  302. dataArrayresult = dataArray_final;
  303. // 2017.09.08 : 그리드 도표 작업 : 팝업창 추가
  304. var options = BWA.ChartOptions.Zone_TempHumi.getSeriesOptions(timeBoxForSearch.type(), t_temp(), t_humi());
  305. options.dataSource = dataArray_final;
  306. chart().option(options);
  307. $('#st').text(f.Name + ' : ' + '(' + f.FacilityUsage + ') 온,습도 현황');
  308. visiblePopup(false);
  309. });
  310. })
  311. .fail(function (error) {
  312. visiblePopup(false);
  313. });
  314. }
  315. function handleMenuItemClick(e) {
  316. var chartIntance = chart();
  317. var chartOptions = chartIntance._options;
  318. var series = chartIntance.getAllSeries();
  319. var table = [];
  320. var columns = [chartOptions.argumentAxis.title];
  321. var values = {};
  322. _.each(chartOptions.valueAxis, function (a) {
  323. columns.push(a.title.text);
  324. });
  325. _.each(series, function (s, i) {
  326. _.each(s.pointsByArgument, function (point, argument) {
  327. var array = values[argument];
  328. if (_.isArray(array) === false) {
  329. array = values[argument] = [];
  330. }
  331. array[i] = point.value;
  332. });
  333. });
  334. var csvRows = [columns.join(',')];
  335. _.each(values, function (values, argument) {
  336. csvRows.push([$G.dateTime(moment(Number(argument))), values.join(',')].join(','));
  337. });
  338. var csvContent = csvRows.join("\r\n");
  339. var agent = navigator.userAgent.toLowerCase();
  340. if (window.navigator.msSaveOrOpenBlob) {
  341. var fileData = ['\uFEFF' + csvContent];
  342. var blobObject = new Blob(fileData);
  343. window.navigator.msSaveOrOpenBlob(blobObject, 'export.csv');
  344. }
  345. else {
  346. var csvString = 'data:text/csv;utf-8,\uFEFF' + encodeURI(csvContent);
  347. var a = $('#csvExporter');
  348. a.attr({
  349. 'href': csvString,
  350. 'target': '_blank',
  351. 'download': 'export.csv'
  352. });
  353. var aa = document.getElementById('csvExporter');
  354. aa.click();
  355. }
  356. }
  357. // 2017.09.08 : 그리드 도표 작업 : 팝업창 추가
  358. function DataGridPopup_ButtonClick() {
  359. DataGridPopup_Visible(true);
  360. }
  361. function handlePopupShown() {
  362. // 데이타소스 업데이트
  363. $("#Zone_TempHumiDataGrid_Container").dxDataGrid("instance").option("dataSource", dataArrayresult);
  364. // 팝업창 갱신
  365. DataGridPopup_Visible(true);
  366. }
  367. // 2017.09.08 : 그리드 도표 작업 : 팝업창 추가
  368. var viewModel = $.extend(BWA.CommonView.create(
  369. params, viewInfo, searchViewOptions, ko.observable(null), handleViewShown, null,
  370. handleSearchInSearchView, undefined), {
  371. refreshList: refreshList,
  372. viewShowing: handleViewShowing,
  373. viewHidden: handleViewHidden, // hcLee 2015 03 23
  374. airHandlingDataGridOptions: {
  375. dataSource: facilitiesForSearch,
  376. columns: [
  377. { dataField: 'Name', caption: $G('facilityName'), width: '100%', alignment: 'left' },
  378. ],
  379. filterRow: {
  380. visible: true,
  381. showOperationChooser: false
  382. },
  383. selection: {
  384. mode: 'single'
  385. },
  386. rowClick: function (clickRow) {
  387. handleSelectedFacilityInSearchView(clickRow.data);
  388. }
  389. },
  390. handleMenuItemClick: handleMenuItemClick,
  391. menuItems: [{
  392. text: '엑셀(csv) 내보내기'
  393. }]
  394. // 2017.09.08 : 그리드 도표 작업 : 팝업창 추가
  395. , Zone_TempHumiDataGridPopup_ButtonClicked: DataGridPopup_ButtonClick
  396. // 2017.09.08 : 그리드 도표 작업 : 팝업창 추가
  397. });
  398. // 2017.09.08 : 그리드 도표 작업 : 팝업창 추가
  399. viewModel.Zone_TempHumiDataGridPopupOptions = {
  400. width: '700px',
  401. height: '750px', // cyim 2017.05.30 : 테스트 결과 Devextreme 버그임. px 로 지정하면 초기 출력시 정확하게 가운데에 있지만, auto 설정시 화면아래에 위치하게 됨
  402. contentTemplate: "content",
  403. showTitle: true,
  404. title: "도표",
  405. visible: DataGridPopup_Visible,
  406. dragEnabled: true,
  407. closeOnOutsideClick: true,
  408. shownAction: handlePopupShown,
  409. animation: window.utils.popup.createAnimation()
  410. };
  411. // 2017.09.08 : 그리드 도표 작업 : 팝업창 추가
  412. viewModel.timeBoxForSearch = timeBoxForSearch;
  413. viewModel.temppopupOptions = {
  414. width: 330,
  415. height: 200,
  416. visible: tempvisiblePopup,
  417. dragEnabled: true,
  418. shading: true,
  419. closeOnOutsideClick: true,
  420. shadingColor: 'transparent',
  421. showTitle: true,
  422. title: "기준온도 설정",
  423. showCloseButton: true,
  424. onShowing: function () {
  425. },
  426. onShown: function (t, tt) {
  427. $("#Save_Btn").dxButton({
  428. text: "저장",
  429. onClick: function () {
  430. var tempMaxvalue = $("#Set_Max_Temp").dxTextBox("instance").option('value');
  431. var tempMinvalue = $("#Set_Min_Temp").dxTextBox("instance").option('value');
  432. if (!isNumber(tempMaxvalue) || !isNumber(tempMinvalue)) {
  433. utils.toast.show("숫자를 입력해주십시요.");
  434. }
  435. if (!(tempMaxvalue >= tempMinvalue)) {
  436. utils.toast.show("기준온도 최대값 , 최소값이 잘못 입력되었습니다.");
  437. return;
  438. }
  439. else {
  440. tempMaxvalue = parseFloat(parseFloat(tempMaxvalue).toFixed(2));
  441. tempMinvalue = parseFloat(parseFloat(tempMinvalue).toFixed(2));
  442. $("#Set_Max_Temp").dxTextBox("instance").option('value', tempMaxvalue);
  443. $("#Set_Min_Temp").dxTextBox("instance").option('value', tempMinvalue);
  444. var BemsSTempDataSource = new DevExpress.data.DataSource({
  445. store: {
  446. type: "odata",
  447. url: endpointSelector + "/BemsControlAHUTempConfig"
  448. },
  449. requireTotalCount: true,
  450. pageSize: 1
  451. });
  452. BemsSTempDataSource.filter([
  453. ['SiteId', "=", SiteId],
  454. 'and',
  455. ['FacilityCode', "=", FacilityCode]
  456. ]);
  457. BemsSTempDataSource.load()
  458. .done(function (STemp) {
  459. if (STemp.length == 0) {
  460. BWA.api.post('BemsControlAHUTempConfig/Insert', {
  461. SiteId: SiteId,
  462. FacilityTypeId: AIR_HANDLING,
  463. FacilityCode: FacilityCode,
  464. MaxTemperature: tempMaxvalue,
  465. MinTemperature: tempMinvalue
  466. }).done(function () {
  467. utils.toast.show("공조기 기준온도를 설정하였습니다.");
  468. tempvisiblePopup(false);
  469. }).fail(function (error) {
  470. utils.toast.show("공조기 기준온도 설정를 실패하였습니다.");
  471. });
  472. }
  473. else {
  474. BWA.api.post('BemsControlAHUTempConfig/Update', {
  475. SiteId: SiteId,
  476. FacilityTypeId: AIR_HANDLING,
  477. FacilityCode: FacilityCode,
  478. MaxTemperature: tempMaxvalue,
  479. MinTemperature: tempMinvalue
  480. }).done(function () {
  481. utils.toast.show("공조기 기준온도를 설정하였습니다.");
  482. tempvisiblePopup(false);
  483. }).fail(function (error) {
  484. utils.toast.show("공조기 기준온도 설정를 실패하였습니다.");
  485. });
  486. }
  487. handleSelectedFacilityInSearchView(m_Facility);
  488. handleSearchInSearchView();
  489. var datagrid = $('#airHandlingDataGridViewInSearchView').dxDataGrid('instance');
  490. if (_.has(datagrid, 'selectRows')) {
  491. datagrid.selectRows(f);
  492. }
  493. });
  494. }
  495. }
  496. });
  497. $("#Set_Max_Temp").dxTextBox({
  498. placeholder: "기준온도 최대값 설정"
  499. });
  500. $("#Set_Min_Temp").dxTextBox({
  501. placeholder: "기준온도 최소값 설정"
  502. });
  503. },
  504. onHidden: function () {
  505. }
  506. };
  507. viewModel.popupOptions = {
  508. width: 300,
  509. height: 100,
  510. contentTemplate: "info",
  511. showTitle: false,
  512. title: "메세지",
  513. visible: visiblePopup,
  514. dragEnabled: false,
  515. shading: false,
  516. closeOnOutsideClick: false
  517. };
  518. // 2017.09.08 : 그리드 도표 작업 : 팝업창 추가
  519. // 주석이 너무 없음. 나중에 변경 작업을 진행하는 누군가가 시간 소비를 하지 않기 위해...남김
  520. // 시간 포맷은 그래프에 귀속해야 되므로 포맷은 변경하지 않는 것이 유리함
  521. // 전기,가스,수도 와 같이 선택적으로 변경해야 된다면 아래와 같이 캡션은 고정하지 말것
  522. viewModel.Zone_TempHumiDataGridOptions = {
  523. dataSource: dataArrayresult,
  524. paging: { pageSize: 17 },
  525. columns: [
  526. { dataField: 'DateTime', caption: "날짜", width: '12%', alignment: 'center', format: 'fixedPoint', precision: 2 },
  527. { dataField: 'tempSetminT', caption: "목표실내온도(최소)", width: '19%', alignment: 'center', format: 'fixedPoint', precision: 2 },
  528. { dataField: 'tempSetmaxT', caption: "목표실내온도(최대)", width: '19%', alignment: 'center', format: 'fixedPoint', precision: 2 },
  529. { dataField: 'temp', caption: "실내온도", width: '10%', alignment: 'center', format: 'fixedPoint', precision: 2 },
  530. { dataField: 'Temperature', caption: "외기온도", width: '10%', alignment: 'center', format: 'fixedPoint', precision: 2 },
  531. { dataField: 'humi', caption: "실내습도", width: '10%', alignment: 'center', format: 'fixedPoint', precision: 2 },
  532. { dataField: 'Humidity', caption: "외기습도", width: '10%', alignment: 'center', format: 'fixedPoint', precision: 2 },
  533. { dataField: 'co2', caption: "CO2농도", width: '10%', alignment: 'center', format: 'fixedPoint', precision: 2 }
  534. ],
  535. // 엑셀 출력
  536. "export": {
  537. enabled: true,
  538. fileName: '실내환경 분석'
  539. }
  540. };
  541. // 2017.09.08 : 그리드 도표 작업 : 팝업창 추가
  542. return viewModel;
  543. };