123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140 |
- $ElecPeakFacilityPopup = function (viewModel, selectPatrolPosData, isMultipleSelect, onSelectedPatrolPoss, datagridId) {
-
-
-
- var dataViewModel = new BemsWebApplication.FmsWorkRequestToFacilityViewModel(),
- gridView,
- popupVisible = ko.observable(false),
- dataView = ko.observableArray(),
-
- findKey = ko.observable(new Date()),
-
- dataSource = BWA.DataUtil.createDataSource({
- dataSourceOptions: {
- select: ['SiteId',
- 'MaxDateTime',
- 'FacilityCode',
- 'CmFacility/Name',
- ],
- expand: ["CmFacility"],
- extendOptions: { forceOriginalField: true }
- }
- }, 'BemsPeakFacility');
- var dataGridOptions = utils.datagrid.defaultOptions({
-
- dataSource: dataView,
- selectedSourceItem: dataViewModel,
- datagridId: 'gridFacility',
- dbId: 'BemsPeakFacility',
- useNumberColumn: true,
- columns: [
- { dataField: 'FacilityCode', caption: $G('number'), width: '10%', alignment: 'center', allowFiltering: false },
- { dataField: 'CmFacility/Name', caption: '설비', width: '20%', alignment: 'center' },
- ],
- searchPanelPlaceHolder: '설비명칭 검색',
- });
- if (isMultipleSelect) {
-
- dataGridOptions.handleDataGridRowClick = function (id, dataGrid, clickRow) {
-
- };
- }
- else {
-
- }
- function handlePopupShowing(e) {
- var eq = BWA.DataUtil.constructEqualFilter;
- var and = BWA.DataUtil.andFilter;
- dataSource.filter([
- eq('SiteId', BWA.UserInfo.SiteId()),
- and,
- eq('MaxDateTime', findKey()),
- ]);
- dataSource.load().done(function (datas) {
- dataView(datas);
- $('#gridFacility').dxDataGrid('instance').refresh();
- gridView = $('#gridFacility').dxDataGrid('instance');
- });
- }
- function handlePopupShown() {
- }
- function handlePopupButtonSelect() {
-
- }
- function handlePopupButtonClose() {
-
- popupVisible(false);
- }
- var toolbarItems = [
-
-
- { location: 'after', widget: 'button', options: { text: $G('close'), icon: 'close', clickAction: handlePopupButtonClose } }
- ];
- var popupOptions = {
-
- width: '600px',
- height: 'auto',
- visible: popupVisible,
- closeOnOutsideClick: true,
- shading: false,
- showingAction: handlePopupShowing,
- shownAction: handlePopupShown,
- animation: {
- show: { type: "pop", duration: 200, from: { opacity: 1, scale: 0.4 }, to: { scale: 1 } },
- hide: { type: "fade", duration: 200, from: 1, to: 0 }
- }
- };
- return {
- dataModel: dataViewModel,
- dataSource: dataSource,
- popupOptions: popupOptions,
- toolbarItems: toolbarItems,
- dataGridOptions: dataGridOptions,
- show: function (MaxDateTime) {
- findKey(MaxDateTime());
- popupVisible(true);
- }
- };
- }
|