61d6c4a1e769dd63eead8460aaab323c4927f5c4.svn-base 25 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627
  1. BemsWebApplication.FloorPlan = function (params, viewInfo) {
  2. "use strict";
  3. var FloorInPopUpForSearch = ko.observableArray(),
  4. FloorInPopUp = ko.observableArray();
  5. var imagefileUrl = ko.observable(), uploadedFileInfo = {}, dropZone = null;
  6. var deferredForSearch = new $.Deferred();
  7. var floorplan = ko.observableArray();
  8. var isImageUpload = ko.observableArray();
  9. var enableDataBoxInPopup = ko.observable(false);
  10. var visibleEditButton = ko.observable(false); // 수정 버튼 활성화 여부 플래그
  11. var hasnotModificationPermission = ko.observable(true); // 수정버튼 비활성화 플래그
  12. var visibleDeleteButton = ko.observable(false); // 삭제버튼 활성화 플래그
  13. var visibleCancelButton = ko.observable(false); // 취소버튼 활성화 플래그
  14. var isEditModeInPopup = ko.observable(); // 저장버튼 활성화 플래그
  15. var isNotModifyMode = ko.observable(false); // 저장버튼 비활성화 플래그
  16. var backupDataViewModel = null;
  17. var backup_data;
  18. var floorAll;
  19. var endpointSelector = "";
  20. if (BemsWebApplication.config.mode == "production") {
  21. endpointSelector = new DevExpress.EndpointSelector(BemsWebApplication.config.endpoints).config.db.production;
  22. } else {
  23. endpointSelector = new DevExpress.EndpointSelector(BemsWebApplication.config.endpoints).config.db.local;
  24. }
  25. var floorplanPopupToolbarItems = [
  26. { location: 'before', text: '평면도 등록' },
  27. { location: 'after', widget: 'button', options: { text: $G('edit'), icon: 'edit', visible: visibleEditButton, disabled: hasnotModificationPermission, clickAction: handlePopupButtonEdit } },
  28. { location: 'after', widget: 'button', options: { text: $G('delete'), type: 'danger', icon: 'remove', visible: visibleDeleteButton, disabled: hasnotModificationPermission, clickAction: handlePopupButtonDelete } },
  29. { location: 'after', widget: 'button', options: { text: $G('cancel'), icon: 'cancel', visible: visibleCancelButton, clickAction: handlePopupButtonCancel } },
  30. { location: 'after', widget: 'button', options: { text: $G('save'), icon: 'save', visible: isEditModeInPopup, disabled: isNotModifyMode, clickAction: handlePopupButtonSave } },
  31. { location: 'after', widget: 'button', options: { text: $G('close'), icon: 'close', clickAction: PopupButtonClose } }
  32. ];
  33. function setupDropZone(dataViewModel) {
  34. var timer = null;
  35. viewModel.isEditModeInPopup.subscribe(function (value) {
  36. if (value) {
  37. if (timer) {
  38. clearInterval(timer);
  39. }
  40. timer = setInterval(function () {
  41. if ($('#FloorPlanDropZone').length) {
  42. if (_.isNull(dropZone)) {
  43. dropZone = BWA.DropZone.create({
  44. id: '#FloorPlanDropZone',
  45. categoryId: $Code.FileCategory.FLOOR,
  46. uploadedFileInfo: uploadedFileInfo,
  47. handleRemoveBeforePromise: function () {
  48. var keys = BWA.db.extractKeysObject('BemsFloorPlan', dataViewModel);
  49. utils.toast.show($G('successDatabaseInsertionMsg'));
  50. PopupButtonClose();
  51. return BWA.db.BemsFloorPlan.update(keys, { ImageFileId: null });
  52. },
  53. handleSuccess: function (fileInfo) {
  54. if (uploadedFileInfo.FileId) {
  55. dataViewModel.ImageFileId(uploadedFileInfo.FileId);
  56. var keys = BWA.db.extractKeysObject('BemsFloorPlan', dataViewModel);
  57. var insert_data = {
  58. SiteId: BWA.UserInfo.SiteId(),
  59. FloorId: backup_data.FloorId,
  60. Name: dataViewModel.Name(),
  61. ImageFileId: uploadedFileInfo.FileId
  62. };
  63. if (keys.Name != null) {
  64. //update(insert_data, tmp_data);
  65. BemsWebApplication.db['BemsFloorPlan'].remove(backup_data).done(function () {
  66. var store = new DevExpress.data.ODataStore({
  67. url: endpointSelector + "/BemsFloorPlan",
  68. key: ["SiteId", "Name"],
  69. keyType: {
  70. SiteId: "Int32", Name: "String"
  71. }
  72. });
  73. store.insert(insert_data).done(function (key, result) {
  74. utils.toast.show($G('successDatabaseInsertionMsg'));
  75. PopupButtonClose();
  76. })
  77. .fail(function (error) {
  78. utils.toast.show(error);
  79. });
  80. viewModel.refreshList();
  81. setTimeout(function () {
  82. GetGridData();
  83. }, 100);
  84. });
  85. }
  86. }
  87. },
  88. handleRemovedFile: function () {
  89. dataViewModel.ImageFileId(null);
  90. }
  91. });
  92. }
  93. }
  94. }, 100);
  95. }
  96. else {
  97. if (timer) {
  98. clearInterval(timer);
  99. timer = null;
  100. }
  101. dropZone = null;
  102. }
  103. });
  104. }
  105. function update(postData, backupData) {
  106. var floorplanDataModel = new BemsWebApplication.BemsFloorPlanViewModel();
  107. if (postData.Name == null || postData.FloorId == null) {
  108. utils.toast.show("층 정보가 입력되지 않았습니다.", 'error');
  109. return;
  110. }
  111. backup_data = {
  112. SiteId: BWA.UserInfo.SiteId(),
  113. FloorId: backupData.FloorId,
  114. Name: backupData.Name,
  115. ImageFileId: backupData.ImageFileId
  116. };
  117. var temp = {
  118. SiteId: BWA.UserInfo.SiteId(),
  119. FileId: backupData.ImageFileId
  120. }
  121. if (backupData.ImageFileId != null) {
  122. BWA.db.CmFile.byKey(temp).done(function (data) {
  123. dropZone.removeFile(data);
  124. });
  125. }
  126. dropZone.processQueue();
  127. }
  128. function insert(postData) {
  129. if (postData.Name == null || postData.FloorId == null) {
  130. utils.toast.show("층 정보가 입력되지 않았습니다.", 'error');
  131. return;
  132. }
  133. backup_data = {
  134. SiteId: BWA.UserInfo.SiteId(),
  135. FloorId: viewModel.dataModel.FloorId(),
  136. Name: viewModel.dataModel.Name(),
  137. ImageFileId: null
  138. };
  139. if (_.isNull(dropZone) === false) { //추가
  140. if (viewModel.dataModel.ImageFileId() == null) {
  141. dropZone.processQueue();
  142. }
  143. }
  144. var store = new DevExpress.data.ODataStore({
  145. url: endpointSelector + "/BemsFloorPlan",
  146. key: ["SiteId", "Name"],
  147. keyType: {
  148. SiteId: "Int32", Name: "String"
  149. }
  150. });
  151. store.insert(postData).done(function (key, result) {
  152. utils.toast.show($G('successDatabaseInsertionMsg'));
  153. PopupButtonClose();
  154. })
  155. .fail(function (error) {
  156. utils.toast.show(error);
  157. });
  158. }
  159. //저장버튼
  160. function handlePopupButtonSave() {
  161. var dataViewModel = viewModel.dataModel;
  162. var postViewModel = new BemsWebApplication.BemsFloorPlanViewModel();
  163. postViewModel.SiteId(dataViewModel.SiteId());
  164. postViewModel.FloorId(dataViewModel.FloorId());
  165. postViewModel.Name(dataViewModel.Name());
  166. postViewModel.ImageFileId(dataViewModel.ImageFileId());
  167. var postData = postViewModel.toJS();
  168. if (viewModel.isNewInPopup())
  169. insert(postData);
  170. else
  171. update(postData, backupDataViewModel);
  172. //예외 처리(ImageFileId가 기존과 수정버전 모두 null인 경우)
  173. if (dataViewModel.ImageFileId() == null && backupDataViewModel.ImageFileId == null) {
  174. utils.toast.show($G('successDatabaseInsertionMsg'));
  175. PopupButtonClose();
  176. }
  177. //DB 저장에 시간이 걸리기때문에 딜레이 후 데이터 로드
  178. setTimeout(function () {
  179. UpdateSelectBoxInPopUp();
  180. GetGridData();
  181. }, 100);
  182. }
  183. function getBackupDataViewModel(model) {
  184. var object = {};
  185. $.each(model, function (name, value) {
  186. if (ko.isObservable(value)) {
  187. object[name] = value();
  188. }
  189. });
  190. return object;
  191. }
  192. function restoreDataViewModelFromBackup(model, backupModel) {
  193. $.each(backupModel, function (name, value) {
  194. model[name](value);
  195. });
  196. }
  197. // 수정버튼 클릭
  198. function handlePopupButtonEdit() {
  199. viewModel.isNewInPopup(false);
  200. viewModel.visibleEditButton(false);
  201. viewModel.visibleDeleteButton(false);
  202. viewModel.visibleCancelButton(true);
  203. viewModel.isEditModeInPopup(true);
  204. viewModel.isNotModifyMode(false);
  205. viewModel.enableDataBoxInPopup(false);
  206. viewModel.isImageUpload(true);
  207. backupDataViewModel = getBackupDataViewModel(viewModel.dataModel);
  208. dropZone = null;
  209. }
  210. //////
  211. // 삭제버튼 클릭
  212. function handlePopupButtonDelete() {
  213. DevExpress.ui.dialog.confirm($G('deleteConfirmMsg'), "삭제").then(function (result) {
  214. if (result) {
  215. var temp = {
  216. SiteId: BWA.UserInfo.SiteId(),
  217. FileId: viewModel.dataModel.ImageFileId()
  218. }
  219. if (viewModel.dataModel.ImageFileId() != null) {
  220. BWA.db.CmFile.byKey(temp).done(function (data) {
  221. if ($('#FloorPlanDropZone1').length) {
  222. if (_.isNull(dropZone)) {
  223. dropZone = BWA.DropZone.create({
  224. id: '#FloorPlanDropZone1',
  225. categoryId: $Code.FileCategory.FLOOR
  226. });
  227. dropZone.removeFile(data);
  228. dropZone = null;
  229. }
  230. }
  231. });
  232. }
  233. var selectedId = {};
  234. selectedId.SiteId = viewModel.dataModel.SiteId();
  235. selectedId.FloorId = viewModel.dataModel.FloorId();
  236. selectedId.Name = viewModel.dataModel.Name();
  237. selectedId.ImageFileId = viewModel.dataModel.ImageFileId();
  238. BemsWebApplication.db['BemsFloorPlan'].remove(selectedId).done(function () {
  239. viewModel.refreshList();
  240. setTimeout(function () {
  241. GetGridData();
  242. UpdateSelectBoxInPopUp();
  243. }, 100);
  244. PopupButtonClose();
  245. utils.toast.show('데이터베이스 항목 삭제 작업이 성공하였습니다.');
  246. }).fail(function () {
  247. utils.toast.show('데이터베이스 항목 삭제 작업이 실패하였습니다.', 'error');
  248. });
  249. //층별 관제점도 같이 지워준다
  250. var dataSource = new DevExpress.data.DataSource({
  251. store: {
  252. type: "odata",
  253. url: endpointSelector + "/BemsFloorStatus",
  254. },
  255. requireTotalCount: true
  256. });
  257. dataSource.filter([
  258. ["SiteId", "=", BWA.UserInfo.SiteId()],
  259. "and",
  260. ["FloorId", "=", viewModel.dataModel.FloorId()]
  261. ]);
  262. dataSource.load()
  263. .done(function (result) {
  264. for (var i = 0; i < result.length; i++) {
  265. var num = 0;
  266. var removeData = {
  267. SiteId: result[i].SiteId,
  268. FloorId: result[i].FloorId,
  269. FloorName: result[i].FloorName,
  270. ImageFileId: result[i].ImageFileId,
  271. Xvalue: result[i].Xvalue,
  272. Yvalue: result[i].Yvalue,
  273. ZoneId: result[i].ZoneId,
  274. FacilityTypeId: result[i].FacilityTypeId,
  275. FacilityCode: result[i].FacilityCode,
  276. PropertyId: result[i].PropertyId,
  277. FacilityName: result[i].FacilityName,
  278. };
  279. BemsWebApplication.db['BemsFloorStatus'].remove(removeData);
  280. }
  281. })
  282. }
  283. });
  284. }
  285. // 취소버튼
  286. function handlePopupButtonCancel() {
  287. viewModel.visibleEditButton(true);
  288. viewModel.visibleDeleteButton(true);
  289. viewModel.visibleCancelButton(false);
  290. viewModel.isEditModeInPopup(false);
  291. viewModel.isNotModifyMode(true);
  292. viewModel.isImageUpload(false);
  293. restoreDataViewModelFromBackup(viewModel.dataModel, backupDataViewModel);
  294. }
  295. // 닫기버튼
  296. function PopupButtonClose() {
  297. viewModel.isNewInPopup(false);
  298. viewModel.visibleEditButton(false);
  299. viewModel.visibleDeleteButton(false);
  300. viewModel.visibleCancelButton(false);
  301. viewModel.isEditModeInPopup(false);
  302. viewModel.isNotModifyMode(false);
  303. viewModel.dataModel.ImageFileId(null);
  304. viewModel.imagefileUrl(undefined);
  305. viewModel.popupVisible(false);
  306. dropZone = null;
  307. }
  308. function GetGridData() {
  309. var gridData = new Array();
  310. var dataSource = new DevExpress.data.DataSource({
  311. store: {
  312. type: "odata",
  313. url: endpointSelector + "/BemsFloorPlan",
  314. },
  315. requireTotalCount: true,
  316. pageSize: 9999,
  317. });
  318. dataSource.filter([
  319. ["SiteId", "=", BWA.UserInfo.SiteId()]
  320. ]);
  321. dataSource.sort({ getter: "Name", asc: true });
  322. dataSource.load()
  323. .done(function (result) {
  324. for (var i = 0; i < result.length; i++) {
  325. gridData[i] = {
  326. "SiteId": 0,
  327. "FloorId": 0,
  328. "Name": "",
  329. "ImageFileId": null
  330. };
  331. gridData[i].SiteId = result[i].SiteId;
  332. gridData[i].FloorId = result[i].FloorId;
  333. gridData[i].Name = result[i].Name;
  334. gridData[i].ImageFileId = result[i].ImageFileId;
  335. }
  336. $("#gridContainer").dxDataGrid("instance").option('dataSource', gridData);
  337. //$("#gridContainer").dxDataGrid("instance").refresh();
  338. })
  339. .fail(function (error) {
  340. utils.toast.show(error);
  341. });
  342. }
  343. function UpdateSelectBoxInPopUp() {
  344. var dataSource_GridData = new DevExpress.data.DataSource({
  345. store: {
  346. type: "odata",
  347. url: endpointSelector + "/BemsFloorPlan",
  348. },
  349. requireTotalCount: true,
  350. pageSize: 100
  351. });
  352. dataSource_GridData.filter([
  353. ["SiteId", "=", BWA.UserInfo.SiteId()]
  354. ]);
  355. dataSource_GridData.load()
  356. .done(function (gridData) {
  357. var tmp = new Array(floorAll.length);
  358. for (var i = 0; i < floorAll.length; i++) {
  359. tmp[i] = 0;
  360. for (var j = 0; j < gridData.length; j++) {
  361. if (floorAll[i].FloorId == gridData[j].FloorId) {
  362. tmp[i] = 1;
  363. break;
  364. }
  365. }
  366. }
  367. var dbfloor = new Array();
  368. var idx = 0;
  369. for (var i = 0; i < floorAll.length; i++) {
  370. if (tmp[i] == 0)
  371. dbfloor.push(floorAll[i]);
  372. }
  373. FloorInPopUp(dbfloor);
  374. FloorInPopUpForSearch($SearchView.createArrayOfSelectBox('FloorId', FloorInPopUp));
  375. });
  376. }
  377. function getImageSize(width, height) {
  378. var viewIndoor = $('#viewIndoor');
  379. var maxWidth = parseFloat(viewIndoor.css('width')), maxHeight = parseFloat(viewIndoor.css('height'));
  380. var widthRatio = width / maxWidth;
  381. var heightRatio = height / maxHeight;
  382. var maxRatio = max(widthRatio, heightRatio);
  383. if (maxRatio > 1) {
  384. return { width: width / maxRatio, height: height / maxRatio }
  385. }
  386. return { width: width, height: height }
  387. }
  388. function max(x, y) {
  389. if (x > y) return x;
  390. return y;
  391. }
  392. function loadImage(imageUrl) {
  393. $('#imageContext').find('text').remove();
  394. //var imageUrl = url;//'/Images/Blueprint/' + viewModel.dataModel.FloorId() + '.jpg';
  395. var image = document.getElementById("image");
  396. var newImage = new Image();
  397. newImage.onload = function () {
  398. var imageSize = getImageSize(newImage.width, newImage.height);
  399. $('#imageContext').css('width', imageSize.width).css('height', imageSize.height);
  400. $('#image').attr('width', imageSize.width).attr('height', imageSize.height); // 2016 05 30 추가, IE 문제해결, 종화
  401. }
  402. newImage.src = imageUrl;
  403. image.setAttributeNS('http://www.w3.org/1999/xlink', 'href', imageUrl);
  404. }
  405. var viewModel = BWA.DataGrid.createViewWithDataGrid(params, viewInfo, 'BemsFloorPlan', {
  406. dataSourceOptions: {
  407. select: [
  408. 'SiteId',
  409. 'FloorId',
  410. 'Name',
  411. 'ImageFileId'
  412. ],
  413. filter: [
  414. ['SiteId', '=', BWA.UserInfo.SiteId()]
  415. ],
  416. extendOptions: {
  417. forceOriginalField: true
  418. },
  419. },
  420. columns: [
  421. { dataField: 'SiteId', caption: '번호', width: '30%', alignment: 'center' },
  422. { dataField: 'Name', caption: '층 명칭', width: '70%', alignment: 'center' },
  423. { dataField: 'FloorId', caption: '', width: '30%', alignment: 'center', visible: false },
  424. { dataField: 'ImageFileId', caption: '', width: '70%', alignment: 'center', visible: false }
  425. ],
  426. NoSearchView: true, // 2019.07.25 kgpark 검색버튼 삭제
  427. paging: {
  428. pageSize: 20,
  429. enabled: true
  430. },
  431. pager: {
  432. },
  433. handlePopupShowing: function (isNewInPopup, dataViewModel) {
  434. // 저장 버튼
  435. if (isNewInPopup() == false) {
  436. imagefileUrl(undefined);
  437. dropZone = null; // 신규등록인 경우
  438. } else {
  439. dataViewModel.Name('');
  440. dataViewModel.ImageFileId(null);
  441. viewModel.imagefileUrl(undefined);
  442. viewModel.isNewInPopup(true);
  443. viewModel.isEditModeInPopup(true);
  444. imagefileUrl('');
  445. loadImage(imagefileUrl());
  446. }
  447. // 탭으로 표시하지 않음
  448. isImageUpload(false);
  449. enableDataBoxInPopup(true);
  450. // tabsVisible(isNewInPopup() == false);
  451. $("#Floor_Info").dxSelectBox({
  452. onValueChanged: function () {
  453. if (isNewInPopup() == false) {
  454. // 이전 이미지 잔상 문제로 인한 방어코드
  455. // 이미지 경로 강제 초기화
  456. imagefileUrl(undefined);
  457. }
  458. isImageUpload(true);
  459. enableDataBoxInPopup(true);
  460. var floor = $("#Floor_Info").dxSelectBox('instance').option('value');
  461. var dataSource = new DevExpress.data.DataSource({
  462. store: {
  463. type: "odata",
  464. url: endpointSelector + "/CmFloor",
  465. },
  466. requireTotalCount: true
  467. });
  468. dataSource.filter([
  469. ["SiteId", "=", BWA.UserInfo.SiteId()]
  470. ]);
  471. dataSource.load()
  472. .done(function (result) {
  473. for (var i = 0; i < result.length; i++) {
  474. if (result[i].FloorId == floor) {
  475. viewModel.dataModel.Name(result[i].Name);
  476. break;
  477. }
  478. }
  479. });
  480. }
  481. });
  482. },
  483. handleViewShowing: function () {
  484. //권한설정
  485. hasnotModificationPermission(!BWA.UserInfo.hasPermissionOfModification(viewInfo.viewName));
  486. var dataSource_FloorInfo = new DevExpress.data.DataSource({
  487. store: {
  488. type: "odata",
  489. url: endpointSelector + "/CmFloor",
  490. },
  491. requireTotalCount: true
  492. });
  493. dataSource_FloorInfo.filter([
  494. ["SiteId", "=", BWA.UserInfo.SiteId()]
  495. ]);
  496. dataSource_FloorInfo.load()
  497. .done(function (floorInfo) {
  498. floorAll = floorInfo;
  499. });
  500. UpdateSelectBoxInPopUp();
  501. GetGridData();
  502. enableDataBoxInPopup(true);
  503. },
  504. handleDataGridRowClick: function (id, dataGrid, clickRow, popupVisible) {
  505. dataGrid.clearSelection();
  506. viewModel.visibleEditButton(true);
  507. viewModel.visibleDeleteButton(true);
  508. viewModel.isNotModifyMode(true);
  509. viewModel.enableDataBoxInPopup(false);
  510. viewModel.isImageUpload(false);
  511. viewModel.isNewInPopup(false);
  512. var data = clickRow.data;
  513. viewModel.dataModel.Name(data.Name);
  514. viewModel.dataModel.FloorId(data.FloorId);
  515. viewModel.dataModel.ImageFileId(data.ImageFileId);
  516. viewModel.dataModel.SiteId(data.SiteId);
  517. popupVisible(true);
  518. imagefileUrl('{0}/CmFile(SiteId={1},FileId={2})/$value'.formati(BWA.db._url, BWA.UserInfo.SiteId(), viewModel.dataModel.ImageFileId()));
  519. loadImage(imagefileUrl());
  520. },
  521. handleViewShown: function (dataViewModel, isEditModeInPopup) {
  522. setupDropZone(dataViewModel);
  523. },
  524. handleSaveSuccess: function () {
  525. if (_.isNull(dropZone) === false) {
  526. dropZone.resetUploadedFileInfo();
  527. }
  528. },
  529. handleAfterLoadingModelByKey: function (data, dataViewModel, isNewInPopup) {
  530. if (isNewInPopup() == false) {
  531. if (_.isNull(dataViewModel.ImageFileId()) === false) {
  532. imagefileUrl('{0}/CmFile(SiteId={1},FileId={2})/$value'.formati(BWA.db._url, dataViewModel.SiteId(), dataViewModel.ImageFileId()));
  533. }
  534. else {
  535. imagefileUrl("images/default.png");
  536. }
  537. }
  538. },
  539. });
  540. viewModel.floorplanPopupToolbarItems = floorplanPopupToolbarItems;
  541. viewModel.imagefileUrl = imagefileUrl;
  542. viewModel.FloorInPopUp = FloorInPopUp;
  543. viewModel.dataModel.FloorId = ko.observable();
  544. viewModel.isImageUpload = isImageUpload;
  545. viewModel.backupDataViewModel = backupDataViewModel;
  546. viewModel.enableDataBoxInPopup = enableDataBoxInPopup;
  547. viewModel.visibleEditButton = visibleEditButton;
  548. viewModel.hasnotModificationPermission = hasnotModificationPermission;
  549. viewModel.visibleDeleteButton = visibleDeleteButton;
  550. viewModel.visibleCancelButton = visibleCancelButton;
  551. viewModel.isEditModeInPopup = isEditModeInPopup;
  552. viewModel.isNotModifyMode = isNotModifyMode;
  553. return viewModel;
  554. };