@dssp/supervision 1.0.0-alpha.76 → 1.0.0-alpha.77

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (58) hide show
  1. package/dist-client/pages/building-inspection/building-inspection-list.js +2 -2
  2. package/dist-client/pages/building-inspection/building-inspection-list.js.map +1 -1
  3. package/dist-client/pages/building-inspection/building-inspection-management.d.ts +8 -0
  4. package/dist-client/pages/building-inspection/building-inspection-management.js +297 -45
  5. package/dist-client/pages/building-inspection/building-inspection-management.js.map +1 -1
  6. package/dist-client/pages/building-inspection/component/field-document/field-document-constants.d.ts +18 -0
  7. package/dist-client/pages/building-inspection/component/field-document/field-document-constants.js +630 -0
  8. package/dist-client/pages/building-inspection/component/field-document/field-document-constants.js.map +1 -0
  9. package/dist-client/pages/building-inspection/component/field-document/field-document-detail-popup.d.ts +10 -0
  10. package/dist-client/pages/building-inspection/component/field-document/field-document-detail-popup.js +219 -0
  11. package/dist-client/pages/building-inspection/component/field-document/field-document-detail-popup.js.map +1 -0
  12. package/dist-client/pages/building-inspection/component/field-document/field-document-list-panel.d.ts +22 -0
  13. package/dist-client/pages/building-inspection/component/field-document/field-document-list-panel.js +472 -0
  14. package/dist-client/pages/building-inspection/component/field-document/field-document-list-panel.js.map +1 -0
  15. package/dist-client/pages/building-inspection/component/field-document/field-document-popup.d.ts +38 -0
  16. package/dist-client/pages/building-inspection/component/field-document/field-document-popup.js +651 -0
  17. package/dist-client/pages/building-inspection/component/field-document/field-document-popup.js.map +1 -0
  18. package/dist-client/pages/building-inspection/component/inspection-event-provider.d.ts +3 -2
  19. package/dist-client/pages/building-inspection/component/inspection-event-provider.js +129 -34
  20. package/dist-client/pages/building-inspection/component/inspection-event-provider.js.map +1 -1
  21. package/dist-client/pages/checklist-template/construction-checklist-template-list.js +9 -14
  22. package/dist-client/pages/checklist-template/construction-checklist-template-list.js.map +1 -1
  23. package/dist-client/pages/project-checklist/project-checklist-management.d.ts +2 -0
  24. package/dist-client/pages/project-checklist/project-checklist-management.js +24 -2
  25. package/dist-client/pages/project-checklist/project-checklist-management.js.map +1 -1
  26. package/dist-client/route.d.ts +1 -1
  27. package/dist-client/tsconfig.tsbuildinfo +1 -1
  28. package/dist-server/service/building-inspection/building-inspection-query.d.ts +5 -1
  29. package/dist-server/service/building-inspection/building-inspection-query.js +114 -0
  30. package/dist-server/service/building-inspection/building-inspection-query.js.map +1 -1
  31. package/dist-server/service/building-inspection/building-inspection-type.d.ts +4 -0
  32. package/dist-server/service/building-inspection/building-inspection-type.js +15 -1
  33. package/dist-server/service/building-inspection/building-inspection-type.js.map +1 -1
  34. package/dist-server/service/building-inspection/index.d.ts +1 -1
  35. package/dist-server/service/field-document/field-document-auto-file.d.ts +21 -0
  36. package/dist-server/service/field-document/field-document-auto-file.js +47 -0
  37. package/dist-server/service/field-document/field-document-auto-file.js.map +1 -0
  38. package/dist-server/service/field-document/field-document-mutation.d.ts +9 -0
  39. package/dist-server/service/field-document/field-document-mutation.js +136 -0
  40. package/dist-server/service/field-document/field-document-mutation.js.map +1 -0
  41. package/dist-server/service/field-document/field-document-query.d.ts +13 -0
  42. package/dist-server/service/field-document/field-document-query.js +107 -0
  43. package/dist-server/service/field-document/field-document-query.js.map +1 -0
  44. package/dist-server/service/field-document/field-document-summary-service.d.ts +2 -0
  45. package/dist-server/service/field-document/field-document-summary-service.js +55 -0
  46. package/dist-server/service/field-document/field-document-summary-service.js.map +1 -0
  47. package/dist-server/service/field-document/field-document-type.d.ts +22 -0
  48. package/dist-server/service/field-document/field-document-type.js +83 -0
  49. package/dist-server/service/field-document/field-document-type.js.map +1 -0
  50. package/dist-server/service/field-document/field-document.d.ts +28 -0
  51. package/dist-server/service/field-document/field-document.js +123 -0
  52. package/dist-server/service/field-document/field-document.js.map +1 -0
  53. package/dist-server/service/field-document/index.d.ts +5 -0
  54. package/dist-server/service/field-document/index.js +9 -0
  55. package/dist-server/service/field-document/index.js.map +1 -0
  56. package/dist-server/service/index.d.ts +1 -1
  57. package/dist-server/tsconfig.tsbuildinfo +1 -1
  58. package/package.json +2 -2
@@ -44,7 +44,7 @@ let BuildingInspectionManagement = class BuildingInspectionManagement extends Sc
44
44
  this.project = Object.assign({}, this.defaultProject);
45
45
  this.selectedBuilding = {};
46
46
  this.building = {};
47
- this.currentFloor = -1;
47
+ this.currentFloor = 1;
48
48
  this.buildingLevelId = '';
49
49
  this.buildingInspectionSummary = {};
50
50
  this.selectedYearMonth = moment().tz('Asia/Seoul').format('YYYY-MM');
@@ -53,10 +53,33 @@ let BuildingInspectionManagement = class BuildingInspectionManagement extends Sc
53
53
  this.viewMode = 'calendar';
54
54
  }
55
55
  get context() {
56
+ var _a;
56
57
  return {
57
- title: '업무 대시보드'
58
+ title: ((_a = this.project) === null || _a === void 0 ? void 0 : _a.name) ? `업무 대시보드 - ${this.project.name}` : '업무 대시보드'
58
59
  };
59
60
  }
61
+ // 동 미선택 시 프로젝트 전체 데이터 모드
62
+ get _isProjectMode() {
63
+ var _a;
64
+ return !((_a = this.selectedBuilding) === null || _a === void 0 ? void 0 : _a.id);
65
+ }
66
+ // 동 선택 + 층 미선택 시 동 전체 데이터 모드
67
+ get _isBuildingMode() {
68
+ var _a;
69
+ return !!((_a = this.selectedBuilding) === null || _a === void 0 ? void 0 : _a.id) && !this.buildingLevelId;
70
+ }
71
+ // 현재 데이터 스코프 표시 라벨
72
+ get _scopeLabel() {
73
+ var _a, _b, _c, _d;
74
+ if (this.buildingLevelId) {
75
+ const level = (_b = (_a = this.building) === null || _a === void 0 ? void 0 : _a.buildingLevels) === null || _b === void 0 ? void 0 : _b.find(l => l.id === this.buildingLevelId);
76
+ return `${((_c = this.selectedBuilding) === null || _c === void 0 ? void 0 : _c.name) || ''} ${(level === null || level === void 0 ? void 0 : level.floorDisplayName) || ''}층`;
77
+ }
78
+ if ((_d = this.selectedBuilding) === null || _d === void 0 ? void 0 : _d.id) {
79
+ return `${this.selectedBuilding.name} 전체`;
80
+ }
81
+ return '프로젝트 전체';
82
+ }
60
83
  render() {
61
84
  var _a, _b, _c, _d, _e, _f;
62
85
  const cards = ((_b = (_a = this.building) === null || _a === void 0 ? void 0 : _a.buildingLevels) === null || _b === void 0 ? void 0 : _b.map(({ mainDrawingImage, floor }) => {
@@ -117,9 +140,13 @@ let BuildingInspectionManagement = class BuildingInspectionManagement extends Sc
117
140
  </div>
118
141
 
119
142
  <div right-panel>
120
- ${this.buildingLevelId
143
+ ${this.buildingLevelId || this._isBuildingMode || this._isProjectMode
121
144
  ? html `
122
145
  <div inspection-container>
146
+ <div scope-header>
147
+ <h3>검측 현황</h3>
148
+ <span scope-label>${this._scopeLabel}</span>
149
+ </div>
123
150
  <div inspection>
124
151
  <div name bold>
125
152
  <md-icon slot="icon">fact_check</md-icon>
@@ -169,6 +196,9 @@ let BuildingInspectionManagement = class BuildingInspectionManagement extends Sc
169
196
  const month = (_c = (_b = (_a = e.detail) === null || _a === void 0 ? void 0 : _a.month) === null || _b === void 0 ? void 0 : _b.toString()) === null || _c === void 0 ? void 0 : _c.padStart(2, '0');
170
197
  this.selectedYearMonth = `${year}-${month}`;
171
198
  this._refreshListGrists();
199
+ }}
200
+ @open-worklog=${(e) => {
201
+ this._openWorklogForDate(e.detail.date);
172
202
  }}
173
203
  ></ox-event-view>
174
204
  </div>
@@ -238,6 +268,19 @@ let BuildingInspectionManagement = class BuildingInspectionManagement extends Sc
238
268
  </div>
239
269
  `;
240
270
  }
271
+ updated(changedProperties) {
272
+ var _a;
273
+ super.updated(changedProperties);
274
+ // ox-grist shadow DOM 내부 #wrap의 overflow를 제어
275
+ (_a = this.renderRoot) === null || _a === void 0 ? void 0 : _a.querySelectorAll('ox-grist').forEach(grist => {
276
+ var _a, _b;
277
+ const oxGrid = (_a = grist.shadowRoot) === null || _a === void 0 ? void 0 : _a.querySelector('ox-grid');
278
+ const gridBody = (_b = oxGrid === null || oxGrid === void 0 ? void 0 : oxGrid.shadowRoot) === null || _b === void 0 ? void 0 : _b.querySelector('ox-grid-body');
279
+ if (gridBody) {
280
+ gridBody.style.maxHeight = '150px';
281
+ }
282
+ });
283
+ }
241
284
  async pageUpdated(changes, lifecycle) {
242
285
  if (this.active) {
243
286
  this.projectId = lifecycle.resourceId || '';
@@ -294,6 +337,12 @@ let BuildingInspectionManagement = class BuildingInspectionManagement extends Sc
294
337
  },
295
338
  width: 200
296
339
  },
340
+ {
341
+ type: 'string',
342
+ name: 'createdDate',
343
+ header: '검측 등록일시',
344
+ width: 110
345
+ },
297
346
  {
298
347
  type: 'string',
299
348
  name: 'requestDate',
@@ -371,7 +420,7 @@ let BuildingInspectionManagement = class BuildingInspectionManagement extends Sc
371
420
  };
372
421
  }
373
422
  async _initProject(projectId = '') {
374
- var _a, _b, _c;
423
+ var _a;
375
424
  const response = await client.query({
376
425
  query: gql `
377
426
  query Project($id: String!) {
@@ -409,11 +458,12 @@ let BuildingInspectionManagement = class BuildingInspectionManagement extends Sc
409
458
  if (response.errors)
410
459
  return;
411
460
  this.project = (_a = response.data) === null || _a === void 0 ? void 0 : _a.project;
412
- // 첫번째 빌딩 선택
413
- this.selectedBuilding = (_c = (_b = this.project) === null || _b === void 0 ? void 0 : _b.buildingComplex) === null || _c === void 0 ? void 0 : _c.buildings[0];
414
- if (this.selectedBuilding) {
415
- await this._getBuilding(this.selectedBuilding.id);
416
- }
461
+ this.updateContext();
462
+ // 미선택 상태 프로젝트 전체 데이터 로드
463
+ this.selectedBuilding = {};
464
+ this.building = {};
465
+ this.buildingLevelId = '';
466
+ await this._initProjectLevel();
417
467
  }
418
468
  async _getBuilding(buildingId = '') {
419
469
  var _a;
@@ -456,15 +506,86 @@ let BuildingInspectionManagement = class BuildingInspectionManagement extends Sc
456
506
  }
457
507
  }
458
508
  async _onClickBuilding(building) {
509
+ var _a;
510
+ if (((_a = this.selectedBuilding) === null || _a === void 0 ? void 0 : _a.id) === building.id) {
511
+ // 토글: 이미 선택된 동 클릭 시 해제 → 프로젝트 전체 데이터
512
+ this.selectedBuilding = {};
513
+ this.building = {};
514
+ this.buildingLevelId = '';
515
+ this.currentFloor = 0;
516
+ await this._initProjectLevel();
517
+ return;
518
+ }
459
519
  this.selectedBuilding = Object.assign({}, building);
460
520
  this.buildingLevelId = '';
461
521
  this.buildingInspectionSummary = {};
462
522
  await this._getBuilding(this.selectedBuilding.id);
523
+ await this._initBuildingData(this.selectedBuilding.id);
463
524
  }
464
525
  async _onSelectFloor(levelId) {
465
526
  this.buildingLevelId = levelId;
466
527
  await this._initBuildingLevel(levelId);
467
528
  }
529
+ async _initProjectLevel() {
530
+ var _a;
531
+ if (!this.projectId)
532
+ return;
533
+ // 프로젝트 전체 검측 현황 조회
534
+ const response = await client.query({
535
+ query: gql `
536
+ query BuildingInspectionSummaryOfProject($projectId: String!) {
537
+ buildingInspectionSummaryOfProject(projectId: $projectId) {
538
+ wait
539
+ request
540
+ pass
541
+ fail
542
+ reWait
543
+ }
544
+ }
545
+ `,
546
+ variables: { projectId: this.projectId }
547
+ });
548
+ if (response.errors)
549
+ return;
550
+ this.buildingInspectionSummary = (_a = response.data) === null || _a === void 0 ? void 0 : _a.buildingInspectionSummaryOfProject;
551
+ // 달력 데이터 생성 (프로젝트 레벨 - buildingLevelId 없이)
552
+ this.calendarData = new InspectionEventProvider('', this.projectId);
553
+ await this.updateComplete;
554
+ // 일일 업무일지 조회
555
+ await this._fetchDailyWorklog(this.selectedDate);
556
+ // 목록 모드일 경우 그리스트 갱신
557
+ this._refreshListGrists();
558
+ }
559
+ async _initBuildingData(buildingId) {
560
+ var _a;
561
+ if (!buildingId)
562
+ return;
563
+ // 동 전체 검측 현황 조회
564
+ const response = await client.query({
565
+ query: gql `
566
+ query BuildingInspectionSummaryOfBuilding($buildingId: String!) {
567
+ buildingInspectionSummaryOfBuilding(buildingId: $buildingId) {
568
+ wait
569
+ request
570
+ pass
571
+ fail
572
+ reWait
573
+ }
574
+ }
575
+ `,
576
+ variables: { buildingId }
577
+ });
578
+ if (response.errors)
579
+ return;
580
+ this.buildingInspectionSummary = (_a = response.data) === null || _a === void 0 ? void 0 : _a.buildingInspectionSummaryOfBuilding;
581
+ // 달력 데이터 생성 (동 레벨)
582
+ this.calendarData = new InspectionEventProvider('', this.projectId, buildingId);
583
+ await this.updateComplete;
584
+ // 일일 업무일지 조회
585
+ await this._fetchDailyWorklog(this.selectedDate);
586
+ // 목록 모드일 경우 그리스트 갱신
587
+ this._refreshListGrists();
588
+ }
468
589
  async _initBuildingLevel(buildingLevelId) {
469
590
  var _a;
470
591
  const response = await client.query({
@@ -496,54 +617,147 @@ let BuildingInspectionManagement = class BuildingInspectionManagement extends Sc
496
617
  this._refreshListGrists();
497
618
  }
498
619
  async _fetchInspectionsByStatus(statuses, { page = 1, limit = 100 }, extraFilter) {
499
- var _a, _b;
500
- if (!this.buildingLevelId)
620
+ var _a, _b, _c, _d, _e, _f;
621
+ if (!this.buildingLevelId && !this._isBuildingMode && !this._isProjectMode)
501
622
  return { total: 0, records: [] };
502
- const response = await client.query({
503
- query: gql `
504
- query BuildingInspectionsOfBuildingLevel($params: BuildingInspectionsOfBuildingLevel!) {
505
- buildingInspectionsOfBuildingLevel(params: $params) {
506
- items {
507
- id
508
- status
509
- failCount
510
- requestDate
623
+ if ((this._isProjectMode || this._isBuildingMode) && !this.projectId)
624
+ return { total: 0, records: [] };
625
+ let items;
626
+ if (this.buildingLevelId) {
627
+ // 층 레벨 조회
628
+ const response = await client.query({
629
+ query: gql `
630
+ query BuildingInspectionsOfBuildingLevel($params: BuildingInspectionsOfBuildingLevel!) {
631
+ buildingInspectionsOfBuildingLevel(params: $params) {
632
+ items {
633
+ id
634
+ status
635
+ failCount
636
+ requestDate
637
+ createdAt
511
638
 
512
- checklist {
513
- checklistId: id
514
- name
515
- constructionType
516
- constructionDetailType
517
- location
518
- inspectionParts
519
- inspectionDrawingType
639
+ checklist {
640
+ checklistId: id
641
+ name
642
+ constructionType
643
+ constructionDetailType
644
+ location
645
+ inspectionParts
646
+ inspectionDrawingType
647
+
648
+ nameListAttachment {
649
+ id
650
+ name
651
+ fullpath
652
+ }
653
+ }
654
+ drawingMarker
655
+ }
656
+ total
657
+ }
658
+ }
659
+ `,
660
+ variables: {
661
+ params: {
662
+ buildingLevelId: this.buildingLevelId,
663
+ limit: 0
664
+ }
665
+ }
666
+ });
667
+ items = ((_b = (_a = response.data) === null || _a === void 0 ? void 0 : _a.buildingInspectionsOfBuildingLevel) === null || _b === void 0 ? void 0 : _b.items) || [];
668
+ }
669
+ else if (this._isBuildingMode) {
670
+ // 동 레벨 조회
671
+ const response = await client.query({
672
+ query: gql `
673
+ query BuildingInspectionsOfBuilding($params: BuildingInspectionsOfBuilding!) {
674
+ buildingInspectionsOfBuilding(params: $params) {
675
+ items {
676
+ id
677
+ status
678
+ failCount
679
+ requestDate
680
+ createdAt
520
681
 
521
- nameListAttachment {
522
- id
682
+ checklist {
683
+ checklistId: id
523
684
  name
524
- fullpath
685
+ constructionType
686
+ constructionDetailType
687
+ location
688
+ inspectionParts
689
+ inspectionDrawingType
690
+
691
+ nameListAttachment {
692
+ id
693
+ name
694
+ fullpath
695
+ }
525
696
  }
697
+ drawingMarker
526
698
  }
527
- drawingMarker
699
+ total
528
700
  }
529
- total
530
701
  }
702
+ `,
703
+ variables: {
704
+ params: {
705
+ buildingId: this.selectedBuilding.id,
706
+ limit: 0
707
+ }
708
+ }
709
+ });
710
+ items = ((_d = (_c = response.data) === null || _c === void 0 ? void 0 : _c.buildingInspectionsOfBuilding) === null || _d === void 0 ? void 0 : _d.items) || [];
531
711
  }
532
- `,
533
- variables: {
534
- params: {
535
- buildingLevelId: this.buildingLevelId,
536
- limit: 0
712
+ else {
713
+ // 프로젝트 레벨 조회 (동 미선택 시)
714
+ const response = await client.query({
715
+ query: gql `
716
+ query BuildingInspectionsOfProject($params: BuildingInspectionsOfProject!) {
717
+ buildingInspectionsOfProject(params: $params) {
718
+ items {
719
+ id
720
+ status
721
+ failCount
722
+ requestDate
723
+ createdAt
724
+
725
+ checklist {
726
+ checklistId: id
727
+ name
728
+ constructionType
729
+ constructionDetailType
730
+ location
731
+ inspectionParts
732
+ inspectionDrawingType
733
+
734
+ nameListAttachment {
735
+ id
736
+ name
737
+ fullpath
738
+ }
537
739
  }
740
+ drawingMarker
741
+ }
742
+ total
538
743
  }
539
- });
540
- let items = ((_b = (_a = response.data) === null || _a === void 0 ? void 0 : _a.buildingInspectionsOfBuildingLevel) === null || _b === void 0 ? void 0 : _b.items) || [];
744
+ }
745
+ `,
746
+ variables: {
747
+ params: {
748
+ projectId: this.projectId,
749
+ limit: 0
750
+ }
751
+ }
752
+ });
753
+ items = ((_f = (_e = response.data) === null || _e === void 0 ? void 0 : _e.buildingInspectionsOfProject) === null || _f === void 0 ? void 0 : _f.items) || [];
754
+ }
541
755
  // 상태별 필터링
542
756
  items = items.filter(item => statuses.includes(item.status));
543
757
  if (extraFilter) {
544
758
  items = items.filter(extraFilter);
545
759
  }
546
- items = items.map(item => (Object.assign(Object.assign(Object.assign({}, item), item.checklist), { statusDisplay: (item.failCount > 0 ? BUILDING_INSPECTION_RE_STATUS_DISPLAY : BUILDING_INSPECTION_STATUS_DISPLAY)[item.status], requestDate: this._formatDateTime(item.requestDate) })));
760
+ items = items.map(item => (Object.assign(Object.assign(Object.assign({}, item), item.checklist), { statusDisplay: (item.failCount > 0 ? BUILDING_INSPECTION_RE_STATUS_DISPLAY : BUILDING_INSPECTION_STATUS_DISPLAY)[item.status], createdDate: this._formatDate(item.createdAt), requestDate: this._formatDateTime(item.requestDate) })));
547
761
  return {
548
762
  total: items.length,
549
763
  records: items
@@ -606,6 +820,27 @@ let BuildingInspectionManagement = class BuildingInspectionManagement extends Sc
606
820
  return '';
607
821
  }
608
822
  }
823
+ _formatDate(date) {
824
+ if (!date)
825
+ return '';
826
+ try {
827
+ const parsed = typeof date === 'string' && /^\d+$/.test(date) ? new Date(Number(date)) : new Date(date);
828
+ return new Intl.DateTimeFormat('ko-KR', {
829
+ timeZone: 'Asia/Seoul',
830
+ year: 'numeric',
831
+ month: '2-digit',
832
+ day: '2-digit'
833
+ }).format(parsed);
834
+ }
835
+ catch (_a) {
836
+ return '';
837
+ }
838
+ }
839
+ async _openWorklogForDate(date) {
840
+ this.selectedDate = date;
841
+ await this._fetchDailyWorklog(date);
842
+ this._openDailyWorklogPopup();
843
+ }
609
844
  _openDailyWorklogPopup() {
610
845
  const date = this.selectedDate;
611
846
  openPopup(html `<daily-worklog-popup
@@ -1005,6 +1240,25 @@ BuildingInspectionManagement.styles = [
1005
1240
  overflow: hidden;
1006
1241
  }
1007
1242
 
1243
+ div[scope-header] {
1244
+ display: flex;
1245
+ align-items: center;
1246
+ gap: var(--spacing-medium, 8px);
1247
+ margin-bottom: var(--spacing-small, 4px);
1248
+
1249
+ h3 {
1250
+ margin: 0;
1251
+ }
1252
+
1253
+ span[scope-label] {
1254
+ font-size: 12px;
1255
+ color: #888;
1256
+ background: #f0f0f0;
1257
+ padding: 2px 8px;
1258
+ border-radius: 4px;
1259
+ }
1260
+ }
1261
+
1008
1262
  div[inspection-container] {
1009
1263
  gap: var(--spacing-medium, 8px);
1010
1264
  display: flex;
@@ -1124,7 +1378,7 @@ BuildingInspectionManagement.styles = [
1124
1378
  div[list-section] {
1125
1379
  display: flex;
1126
1380
  flex-direction: column;
1127
- gap: var(--spacing-small, 4px);
1381
+ gap: 6px;
1128
1382
 
1129
1383
  h3[section-title] {
1130
1384
  color: #e15757;
@@ -1142,9 +1396,7 @@ BuildingInspectionManagement.styles = [
1142
1396
  }
1143
1397
 
1144
1398
  ox-grist {
1145
- overflow-y: auto;
1146
- flex: 1;
1147
- min-height: 150px;
1399
+ padding: 0px 16px 10px;
1148
1400
  }
1149
1401
 
1150
1402
  div[action-buttons] {