@dssp/supervision 0.0.19 → 0.0.21

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 (57) hide show
  1. package/client/pages/building-inspection/building-inspection-detail-checklist.ts +16 -8
  2. package/client/pages/building-inspection/building-inspection-list.ts +152 -48
  3. package/client/pages/building-inspection/component/inspection-event-provider.ts +32 -0
  4. package/client/pages/building-inspection/inspection-create-popup.ts +186 -124
  5. package/client/pages/checklist/checklist-view.ts +13 -16
  6. package/client/pages/checklist-template/checklist-template-list.ts +75 -1
  7. package/dist-client/pages/building-inspection/building-inspection-detail-checklist.d.ts +1 -3
  8. package/dist-client/pages/building-inspection/building-inspection-detail-checklist.js +12 -7
  9. package/dist-client/pages/building-inspection/building-inspection-detail-checklist.js.map +1 -1
  10. package/dist-client/pages/building-inspection/building-inspection-list.d.ts +5 -1
  11. package/dist-client/pages/building-inspection/building-inspection-list.js +151 -47
  12. package/dist-client/pages/building-inspection/building-inspection-list.js.map +1 -1
  13. package/dist-client/pages/building-inspection/component/inspection-event-provider.d.ts +6 -0
  14. package/dist-client/pages/building-inspection/component/inspection-event-provider.js +26 -0
  15. package/dist-client/pages/building-inspection/component/inspection-event-provider.js.map +1 -0
  16. package/dist-client/pages/building-inspection/inspection-create-popup.js +162 -97
  17. package/dist-client/pages/building-inspection/inspection-create-popup.js.map +1 -1
  18. package/dist-client/pages/checklist/checklist-view.js +9 -26
  19. package/dist-client/pages/checklist/checklist-view.js.map +1 -1
  20. package/dist-client/pages/checklist-template/checklist-template-list.d.ts +2 -0
  21. package/dist-client/pages/checklist-template/checklist-template-list.js +67 -0
  22. package/dist-client/pages/checklist-template/checklist-template-list.js.map +1 -1
  23. package/dist-client/route.d.ts +1 -1
  24. package/dist-client/tsconfig.tsbuildinfo +1 -1
  25. package/dist-server/service/building-inspection/building-inspection-history.d.ts +1 -1
  26. package/dist-server/service/building-inspection/building-inspection-history.js +3 -5
  27. package/dist-server/service/building-inspection/building-inspection-history.js.map +1 -1
  28. package/dist-server/service/building-inspection/building-inspection-mutation.js +0 -1
  29. package/dist-server/service/building-inspection/building-inspection-mutation.js.map +1 -1
  30. package/dist-server/service/building-inspection/building-inspection-query.d.ts +1 -0
  31. package/dist-server/service/building-inspection/building-inspection-query.js +32 -4
  32. package/dist-server/service/building-inspection/building-inspection-query.js.map +1 -1
  33. package/dist-server/service/building-inspection/building-inspection-type.d.ts +1 -0
  34. package/dist-server/service/building-inspection/building-inspection-type.js +4 -0
  35. package/dist-server/service/building-inspection/building-inspection-type.js.map +1 -1
  36. package/dist-server/service/building-inspection/building-inspection.d.ts +1 -1
  37. package/dist-server/service/building-inspection/building-inspection.js +3 -3
  38. package/dist-server/service/building-inspection/building-inspection.js.map +1 -1
  39. package/dist-server/service/checklist/checklist-query.d.ts +2 -0
  40. package/dist-server/service/checklist/checklist-query.js +11 -0
  41. package/dist-server/service/checklist/checklist-query.js.map +1 -1
  42. package/dist-server/service/checklist-template-item/checklist-template-item-query.d.ts +1 -0
  43. package/dist-server/service/checklist-template-item/checklist-template-item-query.js +12 -0
  44. package/dist-server/service/checklist-template-item/checklist-template-item-query.js.map +1 -1
  45. package/dist-server/service/checklist-template-item/checklist-template-item.js +2 -1
  46. package/dist-server/service/checklist-template-item/checklist-template-item.js.map +1 -1
  47. package/dist-server/service/index.d.ts +1 -1
  48. package/dist-server/tsconfig.tsbuildinfo +1 -1
  49. package/package.json +4 -4
  50. package/server/service/building-inspection/building-inspection-history.ts +3 -5
  51. package/server/service/building-inspection/building-inspection-mutation.ts +0 -1
  52. package/server/service/building-inspection/building-inspection-query.ts +31 -4
  53. package/server/service/building-inspection/building-inspection-type.ts +3 -0
  54. package/server/service/building-inspection/building-inspection.ts +3 -4
  55. package/server/service/checklist/checklist-query.ts +6 -0
  56. package/server/service/checklist-template-item/checklist-template-item-query.ts +8 -3
  57. package/server/service/checklist-template-item/checklist-template-item.ts +2 -1
@@ -8,7 +8,7 @@ import { DataGrist } from '@operato/data-grist/ox-grist.js';
8
8
  import { client } from '@operato/graphql';
9
9
  import { ButtonContainerStyles, ScrollbarStyles } from '@operato/styles';
10
10
  import { notify } from '@operato/layout';
11
- import { CHECKLIST_MAIN_TYPE_LIST } from './building-inspection-list';
11
+ import { BuildingInspectionStatus, CHECKLIST_MAIN_TYPE_LIST } from './building-inspection-list';
12
12
  import '../checklist/checklist-view';
13
13
  let InspectionCreatePopup = class InspectionCreatePopup extends LitElement {
14
14
  constructor() {
@@ -28,106 +28,117 @@ let InspectionCreatePopup = class InspectionCreatePopup extends LitElement {
28
28
  this.selectedInspectionParts = [];
29
29
  this.checklistTemplates = [];
30
30
  this.checklist = {};
31
+ this.activeTab = 'edit';
31
32
  }
32
33
  render() {
33
34
  var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m;
34
35
  return html `
35
36
  <div body>
36
- <div left>
37
- <div block-name>
38
- <hr />
39
- <span>세부 정보</span>
40
- </div>
37
+ <div tab-container ?inactive=${this.activeTab !== 'edit'} edit>
38
+ <div detail>
39
+ <h3>세부 정보</h3>
41
40
 
42
- <div>
43
- <md-filled-select label="공종" constructionType @change=${this._onSelectConstructionType}>
44
- ${(_a = this.constructionTypes) === null || _a === void 0 ? void 0 : _a.map(constructionType => {
41
+ <div data-row>
42
+ <label>공종</label>
43
+ <md-filled-select label="공종" constructionType @change=${this._onSelectConstructionType}>
44
+ ${(_a = this.constructionTypes) === null || _a === void 0 ? void 0 : _a.map(constructionType => {
45
45
  var _a;
46
46
  const selected = constructionType.id === ((_a = this.selectedConstructionType) === null || _a === void 0 ? void 0 : _a.id);
47
47
  return html `<md-select-option ?selected=${selected} .value=${constructionType.id}>
48
- <div slot="headline">${constructionType.name}</div>
49
- </md-select-option>`;
48
+ <div slot="headline">${constructionType.name}</div>
49
+ </md-select-option>`;
50
50
  })}
51
- </md-filled-select>
51
+ </md-filled-select>
52
+
53
+ <div partition></div>
52
54
 
53
- <md-filled-select label="세부 공종" constructionDetailType @change=${this._onSelectConstructionDetailType}>
54
- ${(_c = (_b = this.selectedConstructionType) === null || _b === void 0 ? void 0 : _b.constructionDetailTypes) === null || _c === void 0 ? void 0 : _c.map(constructionDetailType => {
55
+ <label>세부 공종</label>
56
+ <md-filled-select label="세부 공종" constructionDetailType @change=${this._onSelectConstructionDetailType}>
57
+ ${(_c = (_b = this.selectedConstructionType) === null || _b === void 0 ? void 0 : _b.constructionDetailTypes) === null || _c === void 0 ? void 0 : _c.map(constructionDetailType => {
55
58
  const selected = constructionDetailType.id === this.selectedConstructionDetailType.id;
56
59
  return html `<md-select-option ?selected=${selected} .value=${constructionDetailType.id}>
57
- <div slot="headline">${constructionDetailType.name}</div>
58
- </md-select-option>`;
60
+ <div slot="headline">${constructionDetailType.name}</div>
61
+ </md-select-option>`;
59
62
  })}
60
- </md-filled-select>
61
- </div>
63
+ </md-filled-select>
64
+ </div>
62
65
 
63
- <div>
64
- <md-filled-select label="동" building @change=${this._onSelectBuilding}>
65
- ${(_d = this.buildings) === null || _d === void 0 ? void 0 : _d.map(building => {
66
+ <div data-row>
67
+ <label>동</label>
68
+ <md-filled-select label="동" building @change=${this._onSelectBuilding}>
69
+ ${(_d = this.buildings) === null || _d === void 0 ? void 0 : _d.map(building => {
66
70
  return html ` <md-select-option .value=${building.id}>
67
- <div slot="headline">${building.name}</div>
68
- </md-select-option>`;
71
+ <div slot="headline">${building.name}</div>
72
+ </md-select-option>`;
69
73
  })}
70
- </md-filled-select>
74
+ </md-filled-select>
71
75
 
72
- <md-filled-select label="층" level @change=${this._onSelectBuildingLevel}>
73
- ${(_f = (_e = this.selectedBuilding) === null || _e === void 0 ? void 0 : _e.buildingLevels) === null || _f === void 0 ? void 0 : _f.map(level => {
76
+ <div partition></div>
77
+
78
+ <label>층</label>
79
+ <md-filled-select label="층" level @change=${this._onSelectBuildingLevel}>
80
+ ${(_f = (_e = this.selectedBuilding) === null || _e === void 0 ? void 0 : _e.buildingLevels) === null || _f === void 0 ? void 0 : _f.map(level => {
74
81
  return html `<md-select-option .value=${level.id}>
75
- <div slot="headline">${level.floor}</div>
76
- </md-select-option>`;
82
+ <div slot="headline">${level.floor}</div>
83
+ </md-select-option>`;
77
84
  })}
78
- </md-filled-select>
79
- </div>
85
+ </md-filled-select>
86
+ </div>
80
87
 
81
- <div>
82
- <md-filled-select label="검측 도면" inspectionDrawingType @change=${this._onSelectInspectionDrawingType}>
83
- ${(_g = this.inspectionDrawingTypes) === null || _g === void 0 ? void 0 : _g.map(inspectionDrawingType => {
88
+ <div data-row>
89
+ <label>검측 도면</label>
90
+ <md-filled-select label="검측 도면" inspectionDrawingType @change=${this._onSelectInspectionDrawingType}>
91
+ ${(_g = this.inspectionDrawingTypes) === null || _g === void 0 ? void 0 : _g.map(inspectionDrawingType => {
84
92
  return html ` <md-select-option .value=${inspectionDrawingType.id}>
85
- <div slot="headline">${inspectionDrawingType.name}</div>
86
- </md-select-option>`;
93
+ <div slot="headline">${inspectionDrawingType.name}</div>
94
+ </md-select-option>`;
87
95
  })}
88
- </md-filled-select>
96
+ </md-filled-select>
97
+
98
+ <div partition></div>
89
99
 
90
- <md-filled-select label="검측 부위" inspectionParts>
91
- <div slot="label">${((_h = this.selectedInspectionParts) === null || _h === void 0 ? void 0 : _h.join(', ')) || ''}</div>
100
+ <label>검측 부위</label>
101
+ <md-filled-select label="검측 부위" inspectionParts>
102
+ <div slot="label">${((_h = this.selectedInspectionParts) === null || _h === void 0 ? void 0 : _h.join(', ')) || ''}</div>
92
103
 
93
- ${(_k = (_j = this.selectedInspectionDrawingType) === null || _j === void 0 ? void 0 : _j.inspectionParts) === null || _k === void 0 ? void 0 : _k.map(inspectionPart => {
104
+ ${(_k = (_j = this.selectedInspectionDrawingType) === null || _j === void 0 ? void 0 : _j.inspectionParts) === null || _k === void 0 ? void 0 : _k.map(inspectionPart => {
94
105
  return html `
95
- <md-list-option @click=${() => this._onSelectInspectionPart(inspectionPart)}>
96
- <md-checkbox ?checked="${this.isSelected(inspectionPart)}"></md-checkbox>
97
- ${inspectionPart.name}
98
- </md-list-option>
99
- `;
106
+ <md-list-option @click=${() => this._onSelectInspectionPart(inspectionPart)}>
107
+ <md-checkbox ?checked="${this.isSelected(inspectionPart)}"></md-checkbox>
108
+ ${inspectionPart.name}
109
+ </md-list-option>
110
+ `;
100
111
  })}
101
- </md-filled-select>
112
+ </md-filled-select>
113
+ </div>
102
114
  </div>
103
115
 
104
- <div block-name>
105
- <hr />
106
- <span>체크리스트</span>
107
- </div>
116
+ <div checklist>
117
+ <h3>체크리스트</h3>
118
+
119
+ <div data-row>
120
+ <label>이름</label>
121
+ <md-filled-text-field
122
+ name="checklistName"
123
+ type="text"
124
+ label="체크리스트 이름"
125
+ .value=${((_l = this.checklist) === null || _l === void 0 ? void 0 : _l.name) || ''}
126
+ @input=${this._onInputChange}
127
+ >
128
+ </md-filled-text-field>
108
129
 
109
- <div>
110
- <label>체크리스트 템플릿 불러오기</label>
130
+ <div partition></div>
111
131
 
112
- <md-filled-select label="템플릿" checklistTemplate @change=${this._onSelectChecklistTemplate}>
113
- <md-select-option></md-select-option>
114
- ${(_l = this.checklistTemplates) === null || _l === void 0 ? void 0 : _l.map((checklistTemplate, idx) => {
132
+ <label>템플릿</label>
133
+ <md-filled-select label="템플릿" checklistTemplate @change=${this._onSelectChecklistTemplate}>
134
+ <md-select-option></md-select-option>
135
+ ${(_m = this.checklistTemplates) === null || _m === void 0 ? void 0 : _m.map((checklistTemplate, idx) => {
115
136
  return html ` <md-select-option .value=${checklistTemplate.id}>
116
- <div slot="headline">${checklistTemplate.name}</div>
117
- </md-select-option>`;
137
+ <div slot="headline">${checklistTemplate.name}</div>
138
+ </md-select-option>`;
118
139
  })}
119
- </md-filled-select>
120
- </div>
121
-
122
- <div>
123
- <md-filled-text-field
124
- name="checklistName"
125
- type="text"
126
- label="체크리스트 이름"
127
- .value=${((_m = this.checklist) === null || _m === void 0 ? void 0 : _m.name) || ''}
128
- @input=${this._onInputChange}
129
- >
130
- </md-filled-text-field>
140
+ </md-filled-select>
141
+ </div>
131
142
  </div>
132
143
 
133
144
  <ox-grist
@@ -137,18 +148,23 @@ let InspectionCreatePopup = class InspectionCreatePopup extends LitElement {
137
148
  @field-change=${this.onChangeGird}
138
149
  >
139
150
  </ox-grist>
140
-
141
- <div button-container>
142
- <md-elevated-button @click=${this._createInspection}>
143
- <md-icon slot="icon">add</md-icon>검측 요청서 등록
144
- </md-elevated-button>
145
- </div>
146
151
  </div>
147
152
 
148
- <div right>
153
+ <div tab-container ?inactive=${this.activeTab !== 'preview'} preview>
149
154
  <checklist-view .mode=${"VIEWER" /* ChecklistMode.VIEWER */} .checklist=${this.checklist}></checklist-view>
150
155
  </div>
151
156
  </div>
157
+
158
+ <div tabs>
159
+ <button ?active=${this.activeTab === 'edit'} @click=${() => (this.activeTab = 'edit')}>검측 요청 정보</button>
160
+ <button ?active=${this.activeTab === 'preview'} @click=${() => (this.activeTab = 'preview')}>미리보기</button>
161
+ </div>
162
+
163
+ <div button-container>
164
+ <md-elevated-button @click=${this._createInspection}>
165
+ <md-icon slot="icon">add</md-icon>검측 요청서 등록
166
+ </md-elevated-button>
167
+ </div>
152
168
  `;
153
169
  }
154
170
  updated() {
@@ -254,7 +270,10 @@ let InspectionCreatePopup = class InspectionCreatePopup extends LitElement {
254
270
  constructionType: (_s = this.selectedConstructionType) === null || _s === void 0 ? void 0 : _s.name,
255
271
  constructionDetailType: (_t = this.selectedConstructionDetailType) === null || _t === void 0 ? void 0 : _t.name,
256
272
  location: `${((_u = this.selectedBuilding) === null || _u === void 0 ? void 0 : _u.name) || ''} ${this.selectedLevel.floor || ''}층`,
257
- documentNo: '0000-000-000000'
273
+ documentNo: '0000-000-000000',
274
+ buildingInspection: {
275
+ status: BuildingInspectionStatus.WAIT
276
+ }
258
277
  };
259
278
  // 그리드 셋팅
260
279
  this.setGristConfig();
@@ -479,21 +498,21 @@ let InspectionCreatePopup = class InspectionCreatePopup extends LitElement {
479
498
  sortings: [{ name: 'mainType' }, { name: 'sequence' }]
480
499
  }
481
500
  });
501
+ // 체크리스트 아이템 데이터 갱신
502
+ this.onChangeGird();
482
503
  return {
483
504
  records: response.data.checklistTemplateItems.items || []
484
505
  };
485
506
  }
486
507
  _onSelectChecklistTemplate(e) {
487
508
  const checklistTemplateId = e.target.value;
509
+ // 체크 리스트 이름 셋팅
510
+ this.checklist = Object.assign(Object.assign({}, this.checklist), { name: e.target.displayText });
488
511
  // 그리드 아이템 셋팅
489
512
  if (checklistTemplateId) {
490
513
  this.checklistTemplateId = checklistTemplateId;
491
514
  this.grist.fetch();
492
515
  }
493
- // 체크 리스트 이름 셋팅
494
- this.checklist = Object.assign(Object.assign({}, this.checklist), { name: e.target.displayText });
495
- // 체크리스트 아이템 데이터 갱신
496
- this.onChangeGird();
497
516
  }
498
517
  async _createInspection() {
499
518
  var _a, _b, _c;
@@ -562,6 +581,7 @@ InspectionCreatePopup.styles = [
562
581
  :host {
563
582
  display: flex;
564
583
  flex-direction: column;
584
+ padding: 15px 20px;
565
585
 
566
586
  background-color: var(--md-sys-color-surface);
567
587
  }
@@ -586,39 +606,80 @@ InspectionCreatePopup.styles = [
586
606
  }
587
607
 
588
608
  div[body] {
589
- display: flex;
590
609
  height: 100%;
591
- gap: 15px;
592
- justify-content: flex-start;
593
610
  overflow-y: auto;
594
611
 
595
- div[left] {
596
- width: 60%;
612
+ div[tab-container][inactive] {
613
+ display: none !important;
614
+ }
615
+
616
+ div[edit] {
617
+ width: 100%;
618
+
619
+ div[detail] {
620
+ margin-bottom: 30px;
621
+ }
597
622
 
598
- div[block-name] {
623
+ h3 {
599
624
  position: relative;
625
+ color: #0595e5;
626
+ font-size: 17px;
627
+ font-weight: 700;
628
+ background-color: var(--md-sys-color-surface);
629
+ margin-top: 0;
630
+ margin-bottom: 5px;
631
+ }
600
632
 
601
- hr {
602
- position: absolute;
603
- width: 100%;
604
- margin-block: 0;
605
- top: 50%;
606
- }
607
- span {
608
- position: relative;
609
- background-color: var(--md-sys-color-surface);
610
- margin-left: 1rem;
633
+ div[data-row] {
634
+ display: grid;
635
+ grid-template-columns: 100px 1fr 0.3fr 100px 1fr;
636
+ gap: 15px;
637
+ margin-bottom: 11px;
638
+
639
+ label {
640
+ display: flex;
641
+ justify-content: flex-end;
642
+ align-items: center;
643
+ font-size: 15px;
611
644
  }
612
645
  }
613
646
  }
614
647
 
615
- div[right] {
648
+ div[preview] {
616
649
  display: flex;
617
650
  overflow-y: auto;
618
651
  overflow-x: hidden;
619
652
  max-width: calc(40% - 15px);
620
653
  }
621
654
  }
655
+
656
+ div[tabs] {
657
+ display: flex;
658
+
659
+ button {
660
+ background-color: #fff;
661
+ padding: 6px 14px;
662
+ color: #999;
663
+ border: solid 1px #999;
664
+ border-top: none;
665
+ border-radius: 0px 0px 8px 8px;
666
+ margin-right: -2px;
667
+
668
+ &[active] {
669
+ color: var(--button-color, var(--md-sys-color-on-secondary-container));
670
+ font-weight: 600;
671
+ }
672
+ }
673
+ }
674
+
675
+ div[button-container] {
676
+ display: flex;
677
+ justify-content: flex-end;
678
+
679
+ md-elevated-button {
680
+ --md-filled-button-container-color: #0595e5;
681
+ }
682
+ }
622
683
  `
623
684
  ];
624
685
  __decorate([
@@ -689,6 +750,10 @@ __decorate([
689
750
  state(),
690
751
  __metadata("design:type", Object)
691
752
  ], InspectionCreatePopup.prototype, "checklist", void 0);
753
+ __decorate([
754
+ state(),
755
+ __metadata("design:type", String)
756
+ ], InspectionCreatePopup.prototype, "activeTab", void 0);
692
757
  __decorate([
693
758
  query('md-filled-select[building]'),
694
759
  __metadata("design:type", Object)
@@ -1 +1 @@
1
- {"version":3,"file":"inspection-create-popup.js","sourceRoot":"","sources":["../../../client/pages/building-inspection/inspection-create-popup.ts"],"names":[],"mappings":";AAAA,OAAO,4BAA4B,CAAA;AACnC,OAAO,iCAAiC,CAAA;AAExC,OAAO,GAAG,MAAM,aAAa,CAAA;AAC7B,OAAO,EAAE,GAAG,EAAE,IAAI,EAAE,UAAU,EAAE,MAAM,KAAK,CAAA;AAC3C,O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EhE;IAAC,KAAK,EAAE;;wDAAoB;AAC5B;IAAC,KAAK,EAAE;;+DAA2B;AACnC;IAAC,KAAK,EAAE;;4DAAwB;AAEhC;IAAC,KAAK,EAAE;;gEAA4B;AACpC;IAAC,KAAK,EAAE;;uEAAmC;AAC3C;IAAC,KAAK,EAAE;;6EAAyC;AAEjD;IAAC,KAAK,EAAE;;qEAAiC;AACzC;IAAC,KAAK,EAAE;;4EAAwC;AAChD;IAAC,KAAK,EAAE;8BAA0B,KAAK;sEAAa;AAEpD;IAAC,KAAK,EAAE;;iEAA6B;AACrC;IAAC,KAAK,EAAE;;wDAAoB;AAE5B;IAAC,KAAK,CAAC,4BAA4B,CAAC;;iEAAmB;AACvD;IAAC,KAAK,CAAC,yBAAyB,CAAC;;8DAAgB;AACjD;IAAC,KAAK,CAAC,oCAAoC,CAAC;;yEAA2B;AACvE;IAAC,KAAK,CAAC,0CAA0C,CAAC;;+EAAiC;AACnF;IAAC,KAAK,CAAC,yCAAyC,CAAC;;8EAAgC;AACjF;IAAC,KAAK,CAAC,kCAAkC,CAAC;;uEAAyB;AACnE;IAAC,KAAK,CAAC,qCAAqC,CAAC;;0EAA4B;AACzE;IAAC,KAAK,CAAC,UAAU,CAAC;8BAAS,SAAS;oDAAA;AACpC;IAAC,KAAK,CAAC,YAAY,CAAC;8BAA0B,cAAc;qEAAA;AAC5D;IAAC,KAAK,CAAC,gBAAgB,CAAC;8BAAiB,WAAW;4DAAA;AAnGhD,qBAAqB;IAD1B,aAAa,CAAC,yBAAyB,CAAC;GACnC,qBAAqB,CAwqB1B","sourcesContent":["import '@material/web/icon/icon.js'\nimport '@operato/data-grist/ox-grist.js'\n\nimport gql from 'graphql-tag'\nimport { css, html, LitElement } from 'lit'\nimport { customElement, property, query, state } from 'lit/decorators.js'\nimport { DataGrist } from '@operato/data-grist/ox-grist.js'\nimport { client } from '@operato/graphql'\nimport { ButtonContainerStyles, ScrollbarStyles } from '@operato/styles'\nimport { notify } from '@operato/layout'\nimport { CHECKLIST_MAIN_TYPE_LIST } from './building-inspection-list'\nimport '../checklist/checklist-view'\nimport { ChecklistMode } from '../checklist/checklist-view'\n\n@customElement('inspection-create-popup')\nclass InspectionCreatePopup extends LitElement {\n static styles = [\n ButtonContainerStyles,\n ScrollbarStyles,\n css`\n :host {\n display: flex;\n flex-direction: column;\n\n background-color: var(--md-sys-color-surface);\n }\n\n md-filled-select {\n width: auto;\n min-width: 150px;\n --md-filled-select-text-field-container-color: transparent;\n --md-filled-select-text-field-active-indicator-color: #999;\n --md-filled-select-text-field-input-text-size: 14px;\n --md-filled-select-text-field-input-text-weight: bold;\n --md-filled-select-text-field-input-text-line-height: 6px;\n }\n md-filled-select[level] {\n min-width: 110px;\n margin-left: 20px;\n }\n\n checklist-view {\n pointer-events: none;\n transform-origin: top left;\n }\n\n div[body] {\n display: flex;\n height: 100%;\n gap: 15px;\n justify-content: flex-start;\n overflow-y: auto;\n\n div[left] {\n width: 60%;\n\n div[block-name] {\n position: relative;\n\n hr {\n position: absolute;\n width: 100%;\n margin-block: 0;\n top: 50%;\n }\n span {\n position: relative;\n background-color: var(--md-sys-color-surface);\n margin-left: 1rem;\n }\n }\n }\n\n div[right] {\n display: flex;\n overflow-y: auto;\n overflow-x: hidden;\n max-width: calc(40% - 15px);\n }\n }\n `\n ]\n\n @property({ type: Object }) gristConfig: any\n @property({ type: Object }) checklistDetailTypes: any\n @property({ type: String }) projectId: string = ''\n @property({ type: String }) checklistTemplateId: string = ''\n @property({ type: String }) selectedBuildingId: string = ''\n @property({ type: String }) selectedBuildingLevelId: string = ''\n\n @state() buildings: any = []\n @state() selectedBuilding: any = {}\n @state() selectedLevel: any = {}\n\n @state() constructionTypes: any = []\n @state() selectedConstructionType: any = {}\n @state() selectedConstructionDetailType: any = {}\n\n @state() inspectionDrawingTypes: any = []\n @state() selectedInspectionDrawingType: any = {}\n @state() selectedInspectionParts: Array<string> = []\n\n @state() checklistTemplates: any = []\n @state() checklist: any = {}\n\n @query('md-filled-select[building]') htmlSelectBuilding\n @query('md-filled-select[level]') htmlSelectLevel\n @query('md-filled-select[constructionType]') htmlSelectConstructionType\n @query('md-filled-select[constructionDetailType]') htmlSelectConstructionDetailType\n @query('md-filled-select[inspectionDrawingType]') htmlSelectInspectionDrawingType\n @query('md-filled-select[inspectionPart]') htmlSelectInspectionPart\n @query('md-filled-select[checklistTemplate]') htmlSelectChecklistTemplate\n @query('ox-grist') grist!: DataGrist\n @query('div[right]') checklistViewContainer!: HTMLDivElement\n @query('checklist-view') checklistView!: HTMLElement\n\n render() {\n return html`\n <div body>\n <div left>\n <div block-name>\n <hr />\n <span>세부 정보</span>\n </div>\n\n <div>\n <md-filled-select label=\"공종\" constructionType @change=${this._onSelectConstructionType}>\n ${this.constructionTypes?.map(constructionType => {\n const selected = constructionType.id === this.selectedConstructionType?.id\n return html`<md-select-option ?selected=${selected} .value=${constructionType.id}>\n <div slot=\"headline\">${constructionType.name}</div>\n </md-select-option>`\n })}\n </md-filled-select>\n\n <md-filled-select label=\"세부 공종\" constructionDetailType @change=${this._onSelectConstructionDetailType}>\n ${this.selectedConstructionType?.constructionDetailTypes?.map(constructionDetailType => {\n const selected = constructionDetailType.id === this.selectedConstructionDetailType.id\n return html`<md-select-option ?selected=${selected} .value=${constructionDetailType.id}>\n <div slot=\"headline\">${constructionDetailType.name}</div>\n </md-select-option>`\n })}\n </md-filled-select>\n </div>\n\n <div>\n <md-filled-select label=\"동\" building @change=${this._onSelectBuilding}>\n ${this.buildings?.map(building => {\n return html` <md-select-option .value=${building.id}>\n <div slot=\"headline\">${building.name}</div>\n </md-select-option>`\n })}\n </md-filled-select>\n\n <md-filled-select label=\"층\" level @change=${this._onSelectBuildingLevel}>\n ${this.selectedBuilding?.buildingLevels?.map(level => {\n return html`<md-select-option .value=${level.id}>\n <div slot=\"headline\">${level.floor}</div>\n </md-select-option>`\n })}\n </md-filled-select>\n </div>\n\n <div>\n <md-filled-select label=\"검측 도면\" inspectionDrawingType @change=${this._onSelectInspectionDrawingType}>\n ${this.inspectionDrawingTypes?.map(inspectionDrawingType => {\n return html` <md-select-option .value=${inspectionDrawingType.id}>\n <div slot=\"headline\">${inspectionDrawingType.name}</div>\n </md-select-option>`\n })}\n </md-filled-select>\n\n <md-filled-select label=\"검측 부위\" inspectionParts>\n <div slot=\"label\">${this.selectedInspectionParts?.join(', ') || ''}</div>\n\n ${this.selectedInspectionDrawingType?.inspectionParts?.map(inspectionPart => {\n return html`\n <md-list-option @click=${() => this._onSelectInspectionPart(inspectionPart)}>\n <md-checkbox ?checked=\"${this.isSelected(inspectionPart)}\"></md-checkbox>\n ${inspectionPart.name}\n </md-list-option>\n `\n })}\n </md-filled-select>\n </div>\n\n <div block-name>\n <hr />\n <span>체크리스트</span>\n </div>\n\n <div>\n <label>체크리스트 템플릿 불러오기</label>\n\n <md-filled-select label=\"템플릿\" checklistTemplate @change=${this._onSelectChecklistTemplate}>\n <md-select-option></md-select-option>\n ${this.checklistTemplates?.map((checklistTemplate, idx) => {\n return html` <md-select-option .value=${checklistTemplate.id}>\n <div slot=\"headline\">${checklistTemplate.name}</div>\n </md-select-option>`\n })}\n </md-filled-select>\n </div>\n\n <div>\n <md-filled-text-field\n name=\"checklistName\"\n type=\"text\"\n label=\"체크리스트 이름\"\n .value=${this.checklist?.name || ''}\n @input=${this._onInputChange}\n >\n </md-filled-text-field>\n </div>\n\n <ox-grist\n .mode=${'GRID'}\n .config=${this.gristConfig}\n .fetchHandler=${this.fetchHandler.bind(this)}\n @field-change=${this.onChangeGird}\n >\n </ox-grist>\n\n <div button-container>\n <md-elevated-button @click=${this._createInspection}>\n <md-icon slot=\"icon\">add</md-icon>검측 요청서 등록\n </md-elevated-button>\n </div>\n </div>\n\n <div right>\n <checklist-view .mode=${ChecklistMode.VIEWER} .checklist=${this.checklist}></checklist-view>\n </div>\n </div>\n `\n }\n\n updated() {\n const ratio = Math.round((this.checklistViewContainer?.offsetWidth / this.checklistView?.offsetWidth) * 100) / 100 || 1\n this.checklistView.style.transform = `scale(${ratio})`\n }\n\n async firstUpdated() {\n const response = await client.query({\n query: gql`\n query Project($id: String!) {\n project(id: $id) {\n id\n name\n buildingComplex {\n id\n buildings {\n id\n name\n }\n }\n }\n\n constructionTypes {\n items {\n name\n id\n }\n }\n\n inspectionDrawingTypes {\n items {\n name\n id\n }\n }\n\n checklistTemplates {\n items {\n id\n name\n }\n }\n\n checklistTypes {\n items {\n id\n mainType\n detailType\n }\n }\n }\n `,\n variables: {\n id: this.projectId\n }\n })\n\n if (response.errors) return\n\n const project = response.data?.project\n const constructionTypes = response.data?.constructionTypes?.items || []\n const inspectionDrawingTypes = response.data?.inspectionDrawingTypes?.items || []\n const checklistTemplates = response.data?.checklistTemplates?.items || []\n this.checklistDetailTypes = response.data.checklistTypes?.items?.map(v => {\n return {\n display: v.detailType,\n value: v.id,\n mainType: v.mainType\n }\n })\n\n this.buildings = [...(project?.buildingComplex?.buildings || [])]\n this.constructionTypes = [...constructionTypes]\n this.inspectionDrawingTypes = [...inspectionDrawingTypes]\n this.checklistTemplates = [...checklistTemplates]\n\n // selectedBuildingId가 있으면 해당 빌딩 선택, 없으면 첫번째 빌딩 선택\n this.selectedBuilding = this.selectedBuildingId\n ? this.buildings.find(building => building.id == this.selectedBuildingId)\n : this.buildings[0]\n\n this.selectedConstructionType = constructionTypes?.[0]\n this.selectedInspectionDrawingType = inspectionDrawingTypes?.[0]\n\n // 선택된 동의 층 리스트 가져오기\n this.selectedBuilding = await this._getBuilding(this.selectedBuilding.id)\n this.selectedConstructionType = await this._getConstructionType(this.selectedConstructionType.id)\n this.selectedInspectionDrawingType = await this._getInspectionDrawingType(this.selectedInspectionDrawingType.id)\n\n // selectedBuildingLevelId가 있으면 선택된 층, 없으면 첫번째 층 선택\n this.selectedLevel = this.selectedBuildingLevelId\n ? this.selectedBuilding?.buildingLevels?.find(level => level.id == this.selectedBuildingLevelId)\n : this.selectedBuilding?.buildingLevels?.[0]\n\n this.selectedConstructionDetailType = this.selectedConstructionType?.constructionDetailTypes?.[0]\n this.selectedInspectionParts = []\n\n // 동, 층이 랜더링 된 후에 select를 위해 이 시점에서 랜더링\n this.selectedBuilding = await { ...this.selectedBuilding }\n this.selectedConstructionType = await { ...this.selectedConstructionType }\n\n // 기본 값 셋팅 select\n await this.htmlSelectBuilding.select(this.selectedBuilding.id)\n await this.htmlSelectLevel.select(this.selectedLevel.id)\n await this.htmlSelectConstructionType.select(this.selectedConstructionType.id)\n await this.htmlSelectConstructionDetailType.select(this.selectedConstructionDetailType.id)\n await this.htmlSelectInspectionDrawingType.select(this.selectedInspectionDrawingType.id)\n await this.htmlSelectChecklistTemplate.selectIndex(0)\n\n this.checklist = {\n constructionType: this.selectedConstructionType?.name,\n constructionDetailType: this.selectedConstructionDetailType?.name,\n location: `${this.selectedBuilding?.name || ''} ${this.selectedLevel.floor || ''}층`,\n documentNo: '0000-000-000000'\n }\n\n // 그리드 셋팅\n this.setGristConfig()\n }\n\n async _getBuilding(buildingId: string = '') {\n const response = await client.query({\n query: gql`\n query Building($id: String!) {\n building(id: $id) {\n id\n name\n buildingLevels {\n id\n floor\n mainDrawing {\n id\n name\n fullpath\n }\n mainDrawingImage\n }\n }\n }\n `,\n variables: {\n id: buildingId\n }\n })\n\n if (response.errors) return\n\n return response.data?.building || {}\n }\n\n async _getConstructionType(id: string = '') {\n const response = await client.query({\n query: gql`\n query ConstructionType($id: String!) {\n constructionType(id: $id) {\n id\n name\n description\n constructionDetailTypes {\n id\n name\n }\n }\n }\n `,\n variables: { id }\n })\n\n if (response.errors) return\n\n return response.data?.constructionType || {}\n }\n\n async _getInspectionDrawingType(id: string = '') {\n const response = await client.query({\n query: gql`\n query InspectionDrawingType($id: String!) {\n inspectionDrawingType(id: $id) {\n id\n name\n inspectionParts {\n id\n name\n }\n }\n }\n `,\n variables: { id }\n })\n\n if (response.errors) return\n\n return response.data?.inspectionDrawingType || {}\n }\n\n private async _onSelectBuilding(e) {\n const buildingId = e.target.value\n this.selectedBuilding = await this._getBuilding(buildingId)\n this.selectedLevel = await { ...this.selectedBuilding?.buildingLevels?.[0] }\n this.checklist = { ...this.checklist, location: `${this.selectedBuilding?.name || ''} ${this.selectedLevel.floor || ''}층` }\n\n await this.htmlSelectLevel.selectIndex(0)\n }\n\n private _onSelectBuildingLevel(e) {\n const buildingLevelId = e.target.value\n this.selectedLevel = {\n ...(this.selectedBuilding?.buildingLevels?.find(v => v.id == buildingLevelId) || {})\n }\n this.checklist = { ...this.checklist, location: `${this.selectedBuilding?.name || ''} ${this.selectedLevel.floor || ''}층` }\n }\n\n private async _onSelectConstructionType(e) {\n const constructionTypeId = e.target.value\n this.selectedConstructionType = await this._getConstructionType(constructionTypeId)\n this.selectedConstructionDetailType = await { ...this.selectedConstructionType?.constructionDetailTypes?.[0] }\n this.checklist = {\n ...this.checklist,\n constructionType: this.selectedConstructionType?.name,\n constructionDetailType: this.selectedConstructionDetailType?.name\n }\n\n await this.htmlSelectConstructionDetailType.selectIndex(0)\n }\n\n private _onSelectConstructionDetailType(e) {\n const constructionDetailTypeId = e.target.value\n this.selectedConstructionDetailType = {\n ...(this.selectedConstructionType?.constructionDetailTypes?.find(v => v.id == constructionDetailTypeId) || {})\n }\n this.checklist = {\n ...this.checklist,\n constructionType: this.selectedConstructionType?.name,\n constructionDetailType: this.selectedConstructionDetailType?.name\n }\n }\n\n private async _onSelectInspectionDrawingType(e) {\n const inspectionDrawingTypeId = e.target.value\n this.selectedInspectionDrawingType = await this._getInspectionDrawingType(inspectionDrawingTypeId)\n this.selectedInspectionParts = []\n this.checklist = {\n ...this.checklist,\n inspectionParts: this.selectedInspectionParts\n }\n }\n\n private async _onSelectInspectionPart(part) {\n if (this.selectedInspectionParts.includes(part.name)) {\n this.selectedInspectionParts = this.selectedInspectionParts.filter(item => item !== part.name)\n } else {\n this.selectedInspectionParts.push(part.name)\n }\n\n this.selectedInspectionParts = [...this.selectedInspectionParts]\n this.checklist = {\n ...this.checklist,\n inspectionParts: this.selectedInspectionParts\n }\n }\n\n isSelected(option: any): boolean {\n return this.selectedInspectionParts.includes(option.name)\n }\n\n requestRefresh() {\n this.dispatchEvent(new CustomEvent('requestRefresh'))\n }\n\n private _close() {\n history.back()\n }\n\n setGristConfig() {\n this.gristConfig = {\n columns: [\n { type: 'gutter', gutterName: 'row-selector', multiple: true },\n {\n type: 'gutter',\n gutterName: 'button',\n icon: 'arrow_upward',\n handlers: {\n click: 'move-up'\n }\n },\n {\n type: 'gutter',\n gutterName: 'button',\n icon: 'arrow_downward',\n handlers: {\n click: 'move-down'\n }\n },\n {\n type: 'select',\n name: 'mainType',\n header: '구분',\n record: {\n editable: true,\n options: [{ display: '', value: '' }].concat(\n Object.keys(CHECKLIST_MAIN_TYPE_LIST).map(key => ({ display: CHECKLIST_MAIN_TYPE_LIST[key], value: key }))\n )\n },\n width: 100\n },\n {\n type: 'select',\n name: 'detailType',\n header: '상세 구분',\n record: {\n editable: true,\n options: (columns, data, column) => [\n { display: '', value: '' },\n ...this.checklistDetailTypes.filter(v => v.mainType == column.mainType)\n ]\n },\n width: 200\n },\n {\n type: 'string',\n name: 'name',\n header: '검사 항목',\n record: {\n editable: true\n },\n width: 200\n },\n {\n type: 'string',\n name: 'inspctionCriteria',\n header: '검사 기준',\n record: {\n editable: true\n },\n width: 200\n }\n ],\n pagination: {\n infinite: true\n },\n sorters: [{ name: 'mainType' }, { name: 'sequence' }]\n }\n }\n\n async fetchHandler() {\n if (!this.checklistTemplateId) return []\n\n const response = await client.query({\n query: gql`\n query ($filters: [Filter!], $pagination: Pagination, $sortings: [Sorting!]) {\n checklistTemplateItems(filters: $filters, pagination: $pagination, sortings: $sortings) {\n items {\n id\n sequence\n name\n inspctionCriteria\n mainType\n detailType\n }\n }\n }\n `,\n variables: {\n filters: {\n name: 'checklistTemplateId',\n value: this.checklistTemplateId,\n operator: 'eq'\n },\n sortings: [{ name: 'mainType' }, { name: 'sequence' }]\n }\n })\n\n return {\n records: response.data.checklistTemplateItems.items || []\n }\n }\n\n private _onSelectChecklistTemplate(e) {\n const checklistTemplateId = e.target.value\n\n // 그리드 아이템 셋팅\n if (checklistTemplateId) {\n this.checklistTemplateId = checklistTemplateId\n this.grist.fetch()\n }\n\n // 체크 리스트 이름 셋팅\n this.checklist = { ...this.checklist, name: e.target.displayText }\n\n // 체크리스트 아이템 데이터 갱신\n this.onChangeGird()\n }\n\n async _createInspection() {\n let patch: any = {}\n\n patch.buildingLevelId = this.htmlSelectLevel.value\n patch.checklist = {\n name: this.checklist.name,\n constructionType: this.htmlSelectConstructionType.displayText,\n constructionDetailType: this.htmlSelectConstructionDetailType.displayText,\n location: `${this.htmlSelectBuilding.displayText} ${this.htmlSelectLevel.displayText}층`,\n inspectionDrawingType: this.selectedInspectionDrawingType.name,\n inspectionParts: this.checklist.inspectionParts\n }\n patch.checklistItem = this.checklist.checklistItems?.map(item => {\n return {\n name: item.name,\n mainType: item.mainType,\n detailType: item.detailType,\n inspctionCriteria: item.inspctionCriteria\n }\n })\n\n const response = await client.mutate({\n mutation: gql`\n mutation CreateBuildingInspection($patch: NewBuildingInspection!) {\n createBuildingInspection(patch: $patch) {\n id\n }\n }\n `,\n variables: {\n patch\n }\n })\n\n if (!response.errors) {\n notify({ message: '검측 요청서를 등록하였습니다.' })\n this.requestRefresh()\n this._close()\n } else {\n notify({ message: response.errors?.[0]?.message || '검측 요청서 등록에 실패하였습니다.', level: 'error' })\n }\n }\n // Input 요소의 값이 변경될 때 호출되는 콜백 함수\n private _onInputChange(event: InputEvent) {\n const target = event.target as HTMLInputElement\n this[target.name] = target.value\n this.checklist = { ...this.checklist, name: target.value }\n }\n\n // 체크리스트 아이템 데이터 갱신\n private onChangeGird() {\n const checklistDetailTypes = Object.fromEntries(this.checklistDetailTypes.map(item => [item.value, item.display]))\n const grist = this.grist\n\n // grist field-change가 오는 시점이 데이터 변경 전이라 setTimeout으로 변경\n setTimeout(() => {\n this.checklist.checklistItems = grist.dirtyData.records.map((row, idx) => {\n return {\n ...row,\n detailType: checklistDetailTypes[row.detailType],\n sequence: idx\n }\n })\n this.checklist = { ...this.checklist }\n }, 100)\n }\n}\n"]}
1
+ {"version":3,"file":"inspection-create-popup.js","sourceRoot":"","sources":["../../../client/pages/building-inspection/inspection-create-popup.ts"],"names":[],"mappings":";AAAA,OAAO,4BAA4B,CAAA;AACnC,OAAO,iCAAiC,CAAA;AAExC,OAAO,GAAG,MAAM,aAAa,CAAA;AAC7B,OAAO,EAAE,GAAG,EAAE,IAAI,EAAE,UAAU,EAAE,MAAM,KAAK,CAAA;AAC3C,OAAO,EAAE,aAAa,EAAE,QAAQ,EAAE,KAAK,EAAE,KAAK,EAAE,MAAM,mBAAmB,CAAA;AACzE,OAAO,EAAE,SAAS,EAAE,MAAM,iCAAiC,CAAA;AAC3D,OAAO,EAAE,MAAM,EAAE,MAAM,kBAAkB,CAAA;AACzC,OAAO,EAAE,qBAAqB,EAAE,eAAe,EAAE,MAAM,iBAAiB,CAAA;AACxE,OAAO,EAAE,MAAM,EAAE,MAAM,iBAAiB,CAAA;AACxC,OAAO,EAAE,wBAAwB,EAAE,wBAAwB,EAAE,MAAM,4BAA4B,CAAA;AAC/F,OAAO,6BAA6B,CAAA;AAIpC,IAAM,qBAAqB,GAA3B,MAAM,qBAAsB,SAAQ,UAAU;IAA9C;;QAgH8B,cAAS,GAAW,EAAE,CAAA;QACtB,wBAAmB,GAAW,EAAE,CAAA;QAChC,uBAAkB,GAAW,EAAE,CAAA;QAC/B,4BAAuB,GAAW,EAAE,CAAA;QAEvD,cAAS,GAAQ,EAAE,CAAA;QACnB,qBAAgB,GAAQ,EAAE,CAAA;QAC1B,kBAAa,GAAQ,EAAE,CAAA;QAEvB,sBAAiB,GAAQ,EAAE,CAAA;QAC3B,6BAAwB,GAAQ,EAAE,CAAA;QAClC,mCAA8B,GAAQ,EAAE,CAAA;QAExC,2BAAsB,GAAQ,EAAE,CAAA;QAChC,kCAA6B,GAAQ,EAAE,CAAA;QACvC,4BAAuB,GAAkB,EAAE,CAAA;QAE3C,uBAAkB,GAAQ,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C;;iEAAmB;AACvD;IAAC,KAAK,CAAC,yBAAyB,CAAC;;8DAAgB;AACjD;IAAC,KAAK,CAAC,oCAAoC,CAAC;;yEAA2B;AACvE;IAAC,KAAK,CAAC,0CAA0C,CAAC;;+EAAiC;AACnF;IAAC,KAAK,CAAC,yCAAyC,CAAC;;8EAAgC;AACjF;IAAC,KAAK,CAAC,kCAAkC,CAAC;;uEAAyB;AACnE;IAAC,KAAK,CAAC,qCAAqC,CAAC;;0EAA4B;AACzE;IAAC,KAAK,CAAC,UAAU,CAAC;8BAAS,SAAS;oDAAA;AACpC;IAAC,KAAK,CAAC,YAAY,CAAC;8BAA0B,cAAc;qEAAA;AAC5D;IAAC,KAAK,CAAC,gBAAgB,CAAC;8BAAiB,WAAW;4DAAA;AA/IhD,qBAAqB;IAD1B,aAAa,CAAC,yBAAyB,CAAC;GACnC,qBAAqB,CAsuB1B","sourcesContent":["import '@material/web/icon/icon.js'\nimport '@operato/data-grist/ox-grist.js'\n\nimport gql from 'graphql-tag'\nimport { css, html, LitElement } from 'lit'\nimport { customElement, property, query, state } from 'lit/decorators.js'\nimport { DataGrist } from '@operato/data-grist/ox-grist.js'\nimport { client } from '@operato/graphql'\nimport { ButtonContainerStyles, ScrollbarStyles } from '@operato/styles'\nimport { notify } from '@operato/layout'\nimport { BuildingInspectionStatus, CHECKLIST_MAIN_TYPE_LIST } from './building-inspection-list'\nimport '../checklist/checklist-view'\nimport { ChecklistMode } from '../checklist/checklist-view'\n\n@customElement('inspection-create-popup')\nclass InspectionCreatePopup extends LitElement {\n static styles = [\n ButtonContainerStyles,\n ScrollbarStyles,\n css`\n :host {\n display: flex;\n flex-direction: column;\n padding: 15px 20px;\n\n background-color: var(--md-sys-color-surface);\n }\n\n md-filled-select {\n width: auto;\n min-width: 150px;\n --md-filled-select-text-field-container-color: transparent;\n --md-filled-select-text-field-active-indicator-color: #999;\n --md-filled-select-text-field-input-text-size: 14px;\n --md-filled-select-text-field-input-text-weight: bold;\n --md-filled-select-text-field-input-text-line-height: 6px;\n }\n md-filled-select[level] {\n min-width: 110px;\n margin-left: 20px;\n }\n\n checklist-view {\n pointer-events: none;\n transform-origin: top left;\n }\n\n div[body] {\n height: 100%;\n overflow-y: auto;\n\n div[tab-container][inactive] {\n display: none !important;\n }\n\n div[edit] {\n width: 100%;\n\n div[detail] {\n margin-bottom: 30px;\n }\n\n h3 {\n position: relative;\n color: #0595e5;\n font-size: 17px;\n font-weight: 700;\n background-color: var(--md-sys-color-surface);\n margin-top: 0;\n margin-bottom: 5px;\n }\n\n div[data-row] {\n display: grid;\n grid-template-columns: 100px 1fr 0.3fr 100px 1fr;\n gap: 15px;\n margin-bottom: 11px;\n\n label {\n display: flex;\n justify-content: flex-end;\n align-items: center;\n font-size: 15px;\n }\n }\n }\n\n div[preview] {\n display: flex;\n overflow-y: auto;\n overflow-x: hidden;\n max-width: calc(40% - 15px);\n }\n }\n\n div[tabs] {\n display: flex;\n\n button {\n background-color: #fff;\n padding: 6px 14px;\n color: #999;\n border: solid 1px #999;\n border-top: none;\n border-radius: 0px 0px 8px 8px;\n margin-right: -2px;\n\n &[active] {\n color: var(--button-color, var(--md-sys-color-on-secondary-container));\n font-weight: 600;\n }\n }\n }\n\n div[button-container] {\n display: flex;\n justify-content: flex-end;\n\n md-elevated-button {\n --md-filled-button-container-color: #0595e5;\n }\n }\n `\n ]\n\n @property({ type: Object }) gristConfig: any\n @property({ type: Object }) checklistDetailTypes: any\n @property({ type: String }) projectId: string = ''\n @property({ type: String }) checklistTemplateId: string = ''\n @property({ type: String }) selectedBuildingId: string = ''\n @property({ type: String }) selectedBuildingLevelId: string = ''\n\n @state() buildings: any = []\n @state() selectedBuilding: any = {}\n @state() selectedLevel: any = {}\n\n @state() constructionTypes: any = []\n @state() selectedConstructionType: any = {}\n @state() selectedConstructionDetailType: any = {}\n\n @state() inspectionDrawingTypes: any = []\n @state() selectedInspectionDrawingType: any = {}\n @state() selectedInspectionParts: Array<string> = []\n\n @state() checklistTemplates: any = []\n @state() checklist: any = {}\n\n @state() activeTab: 'edit' | 'preview' = 'edit'\n\n @query('md-filled-select[building]') htmlSelectBuilding\n @query('md-filled-select[level]') htmlSelectLevel\n @query('md-filled-select[constructionType]') htmlSelectConstructionType\n @query('md-filled-select[constructionDetailType]') htmlSelectConstructionDetailType\n @query('md-filled-select[inspectionDrawingType]') htmlSelectInspectionDrawingType\n @query('md-filled-select[inspectionPart]') htmlSelectInspectionPart\n @query('md-filled-select[checklistTemplate]') htmlSelectChecklistTemplate\n @query('ox-grist') grist!: DataGrist\n @query('div[right]') checklistViewContainer!: HTMLDivElement\n @query('checklist-view') checklistView!: HTMLElement\n\n render() {\n return html`\n <div body>\n <div tab-container ?inactive=${this.activeTab !== 'edit'} edit>\n <div detail>\n <h3>세부 정보</h3>\n\n <div data-row>\n <label>공종</label>\n <md-filled-select label=\"공종\" constructionType @change=${this._onSelectConstructionType}>\n ${this.constructionTypes?.map(constructionType => {\n const selected = constructionType.id === this.selectedConstructionType?.id\n return html`<md-select-option ?selected=${selected} .value=${constructionType.id}>\n <div slot=\"headline\">${constructionType.name}</div>\n </md-select-option>`\n })}\n </md-filled-select>\n\n <div partition></div>\n\n <label>세부 공종</label>\n <md-filled-select label=\"세부 공종\" constructionDetailType @change=${this._onSelectConstructionDetailType}>\n ${this.selectedConstructionType?.constructionDetailTypes?.map(constructionDetailType => {\n const selected = constructionDetailType.id === this.selectedConstructionDetailType.id\n return html`<md-select-option ?selected=${selected} .value=${constructionDetailType.id}>\n <div slot=\"headline\">${constructionDetailType.name}</div>\n </md-select-option>`\n })}\n </md-filled-select>\n </div>\n\n <div data-row>\n <label>동</label>\n <md-filled-select label=\"동\" building @change=${this._onSelectBuilding}>\n ${this.buildings?.map(building => {\n return html` <md-select-option .value=${building.id}>\n <div slot=\"headline\">${building.name}</div>\n </md-select-option>`\n })}\n </md-filled-select>\n\n <div partition></div>\n\n <label>층</label>\n <md-filled-select label=\"층\" level @change=${this._onSelectBuildingLevel}>\n ${this.selectedBuilding?.buildingLevels?.map(level => {\n return html`<md-select-option .value=${level.id}>\n <div slot=\"headline\">${level.floor}</div>\n </md-select-option>`\n })}\n </md-filled-select>\n </div>\n\n <div data-row>\n <label>검측 도면</label>\n <md-filled-select label=\"검측 도면\" inspectionDrawingType @change=${this._onSelectInspectionDrawingType}>\n ${this.inspectionDrawingTypes?.map(inspectionDrawingType => {\n return html` <md-select-option .value=${inspectionDrawingType.id}>\n <div slot=\"headline\">${inspectionDrawingType.name}</div>\n </md-select-option>`\n })}\n </md-filled-select>\n\n <div partition></div>\n\n <label>검측 부위</label>\n <md-filled-select label=\"검측 부위\" inspectionParts>\n <div slot=\"label\">${this.selectedInspectionParts?.join(', ') || ''}</div>\n\n ${this.selectedInspectionDrawingType?.inspectionParts?.map(inspectionPart => {\n return html`\n <md-list-option @click=${() => this._onSelectInspectionPart(inspectionPart)}>\n <md-checkbox ?checked=\"${this.isSelected(inspectionPart)}\"></md-checkbox>\n ${inspectionPart.name}\n </md-list-option>\n `\n })}\n </md-filled-select>\n </div>\n </div>\n\n <div checklist>\n <h3>체크리스트</h3>\n\n <div data-row>\n <label>이름</label>\n <md-filled-text-field\n name=\"checklistName\"\n type=\"text\"\n label=\"체크리스트 이름\"\n .value=${this.checklist?.name || ''}\n @input=${this._onInputChange}\n >\n </md-filled-text-field>\n\n <div partition></div>\n\n <label>템플릿</label>\n <md-filled-select label=\"템플릿\" checklistTemplate @change=${this._onSelectChecklistTemplate}>\n <md-select-option></md-select-option>\n ${this.checklistTemplates?.map((checklistTemplate, idx) => {\n return html` <md-select-option .value=${checklistTemplate.id}>\n <div slot=\"headline\">${checklistTemplate.name}</div>\n </md-select-option>`\n })}\n </md-filled-select>\n </div>\n </div>\n\n <ox-grist\n .mode=${'GRID'}\n .config=${this.gristConfig}\n .fetchHandler=${this.fetchHandler.bind(this)}\n @field-change=${this.onChangeGird}\n >\n </ox-grist>\n </div>\n\n <div tab-container ?inactive=${this.activeTab !== 'preview'} preview>\n <checklist-view .mode=${ChecklistMode.VIEWER} .checklist=${this.checklist}></checklist-view>\n </div>\n </div>\n\n <div tabs>\n <button ?active=${this.activeTab === 'edit'} @click=${() => (this.activeTab = 'edit')}>검측 요청 정보</button>\n <button ?active=${this.activeTab === 'preview'} @click=${() => (this.activeTab = 'preview')}>미리보기</button>\n </div>\n\n <div button-container>\n <md-elevated-button @click=${this._createInspection}>\n <md-icon slot=\"icon\">add</md-icon>검측 요청서 등록\n </md-elevated-button>\n </div>\n `\n }\n\n updated() {\n const ratio = Math.round((this.checklistViewContainer?.offsetWidth / this.checklistView?.offsetWidth) * 100) / 100 || 1\n this.checklistView.style.transform = `scale(${ratio})`\n }\n\n async firstUpdated() {\n const response = await client.query({\n query: gql`\n query Project($id: String!) {\n project(id: $id) {\n id\n name\n buildingComplex {\n id\n buildings {\n id\n name\n }\n }\n }\n\n constructionTypes {\n items {\n name\n id\n }\n }\n\n inspectionDrawingTypes {\n items {\n name\n id\n }\n }\n\n checklistTemplates {\n items {\n id\n name\n }\n }\n\n checklistTypes {\n items {\n id\n mainType\n detailType\n }\n }\n }\n `,\n variables: {\n id: this.projectId\n }\n })\n\n if (response.errors) return\n\n const project = response.data?.project\n const constructionTypes = response.data?.constructionTypes?.items || []\n const inspectionDrawingTypes = response.data?.inspectionDrawingTypes?.items || []\n const checklistTemplates = response.data?.checklistTemplates?.items || []\n this.checklistDetailTypes = response.data.checklistTypes?.items?.map(v => {\n return {\n display: v.detailType,\n value: v.id,\n mainType: v.mainType\n }\n })\n\n this.buildings = [...(project?.buildingComplex?.buildings || [])]\n this.constructionTypes = [...constructionTypes]\n this.inspectionDrawingTypes = [...inspectionDrawingTypes]\n this.checklistTemplates = [...checklistTemplates]\n\n // selectedBuildingId가 있으면 해당 빌딩 선택, 없으면 첫번째 빌딩 선택\n this.selectedBuilding = this.selectedBuildingId\n ? this.buildings.find(building => building.id == this.selectedBuildingId)\n : this.buildings[0]\n\n this.selectedConstructionType = constructionTypes?.[0]\n this.selectedInspectionDrawingType = inspectionDrawingTypes?.[0]\n\n // 선택된 동의 층 리스트 가져오기\n this.selectedBuilding = await this._getBuilding(this.selectedBuilding.id)\n this.selectedConstructionType = await this._getConstructionType(this.selectedConstructionType.id)\n this.selectedInspectionDrawingType = await this._getInspectionDrawingType(this.selectedInspectionDrawingType.id)\n\n // selectedBuildingLevelId가 있으면 선택된 층, 없으면 첫번째 층 선택\n this.selectedLevel = this.selectedBuildingLevelId\n ? this.selectedBuilding?.buildingLevels?.find(level => level.id == this.selectedBuildingLevelId)\n : this.selectedBuilding?.buildingLevels?.[0]\n\n this.selectedConstructionDetailType = this.selectedConstructionType?.constructionDetailTypes?.[0]\n this.selectedInspectionParts = []\n\n // 동, 층이 랜더링 된 후에 select를 위해 이 시점에서 랜더링\n this.selectedBuilding = await { ...this.selectedBuilding }\n this.selectedConstructionType = await { ...this.selectedConstructionType }\n\n // 기본 값 셋팅 select\n await this.htmlSelectBuilding.select(this.selectedBuilding.id)\n await this.htmlSelectLevel.select(this.selectedLevel.id)\n await this.htmlSelectConstructionType.select(this.selectedConstructionType.id)\n await this.htmlSelectConstructionDetailType.select(this.selectedConstructionDetailType.id)\n await this.htmlSelectInspectionDrawingType.select(this.selectedInspectionDrawingType.id)\n await this.htmlSelectChecklistTemplate.selectIndex(0)\n\n this.checklist = {\n constructionType: this.selectedConstructionType?.name,\n constructionDetailType: this.selectedConstructionDetailType?.name,\n location: `${this.selectedBuilding?.name || ''} ${this.selectedLevel.floor || ''}층`,\n documentNo: '0000-000-000000',\n buildingInspection: {\n status: BuildingInspectionStatus.WAIT\n }\n }\n\n // 그리드 셋팅\n this.setGristConfig()\n }\n\n async _getBuilding(buildingId: string = '') {\n const response = await client.query({\n query: gql`\n query Building($id: String!) {\n building(id: $id) {\n id\n name\n buildingLevels {\n id\n floor\n mainDrawing {\n id\n name\n fullpath\n }\n mainDrawingImage\n }\n }\n }\n `,\n variables: {\n id: buildingId\n }\n })\n\n if (response.errors) return\n\n return response.data?.building || {}\n }\n\n async _getConstructionType(id: string = '') {\n const response = await client.query({\n query: gql`\n query ConstructionType($id: String!) {\n constructionType(id: $id) {\n id\n name\n description\n constructionDetailTypes {\n id\n name\n }\n }\n }\n `,\n variables: { id }\n })\n\n if (response.errors) return\n\n return response.data?.constructionType || {}\n }\n\n async _getInspectionDrawingType(id: string = '') {\n const response = await client.query({\n query: gql`\n query InspectionDrawingType($id: String!) {\n inspectionDrawingType(id: $id) {\n id\n name\n inspectionParts {\n id\n name\n }\n }\n }\n `,\n variables: { id }\n })\n\n if (response.errors) return\n\n return response.data?.inspectionDrawingType || {}\n }\n\n private async _onSelectBuilding(e) {\n const buildingId = e.target.value\n this.selectedBuilding = await this._getBuilding(buildingId)\n this.selectedLevel = await { ...this.selectedBuilding?.buildingLevels?.[0] }\n this.checklist = { ...this.checklist, location: `${this.selectedBuilding?.name || ''} ${this.selectedLevel.floor || ''}층` }\n\n await this.htmlSelectLevel.selectIndex(0)\n }\n\n private _onSelectBuildingLevel(e) {\n const buildingLevelId = e.target.value\n this.selectedLevel = {\n ...(this.selectedBuilding?.buildingLevels?.find(v => v.id == buildingLevelId) || {})\n }\n this.checklist = { ...this.checklist, location: `${this.selectedBuilding?.name || ''} ${this.selectedLevel.floor || ''}층` }\n }\n\n private async _onSelectConstructionType(e) {\n const constructionTypeId = e.target.value\n this.selectedConstructionType = await this._getConstructionType(constructionTypeId)\n this.selectedConstructionDetailType = await { ...this.selectedConstructionType?.constructionDetailTypes?.[0] }\n this.checklist = {\n ...this.checklist,\n constructionType: this.selectedConstructionType?.name,\n constructionDetailType: this.selectedConstructionDetailType?.name\n }\n\n await this.htmlSelectConstructionDetailType.selectIndex(0)\n }\n\n private _onSelectConstructionDetailType(e) {\n const constructionDetailTypeId = e.target.value\n this.selectedConstructionDetailType = {\n ...(this.selectedConstructionType?.constructionDetailTypes?.find(v => v.id == constructionDetailTypeId) || {})\n }\n this.checklist = {\n ...this.checklist,\n constructionType: this.selectedConstructionType?.name,\n constructionDetailType: this.selectedConstructionDetailType?.name\n }\n }\n\n private async _onSelectInspectionDrawingType(e) {\n const inspectionDrawingTypeId = e.target.value\n this.selectedInspectionDrawingType = await this._getInspectionDrawingType(inspectionDrawingTypeId)\n this.selectedInspectionParts = []\n this.checklist = {\n ...this.checklist,\n inspectionParts: this.selectedInspectionParts\n }\n }\n\n private async _onSelectInspectionPart(part) {\n if (this.selectedInspectionParts.includes(part.name)) {\n this.selectedInspectionParts = this.selectedInspectionParts.filter(item => item !== part.name)\n } else {\n this.selectedInspectionParts.push(part.name)\n }\n\n this.selectedInspectionParts = [...this.selectedInspectionParts]\n this.checklist = {\n ...this.checklist,\n inspectionParts: this.selectedInspectionParts\n }\n }\n\n isSelected(option: any): boolean {\n return this.selectedInspectionParts.includes(option.name)\n }\n\n requestRefresh() {\n this.dispatchEvent(new CustomEvent('requestRefresh'))\n }\n\n private _close() {\n history.back()\n }\n\n setGristConfig() {\n this.gristConfig = {\n columns: [\n { type: 'gutter', gutterName: 'row-selector', multiple: true },\n {\n type: 'gutter',\n gutterName: 'button',\n icon: 'arrow_upward',\n handlers: {\n click: 'move-up'\n }\n },\n {\n type: 'gutter',\n gutterName: 'button',\n icon: 'arrow_downward',\n handlers: {\n click: 'move-down'\n }\n },\n {\n type: 'select',\n name: 'mainType',\n header: '구분',\n record: {\n editable: true,\n options: [{ display: '', value: '' }].concat(\n Object.keys(CHECKLIST_MAIN_TYPE_LIST).map(key => ({ display: CHECKLIST_MAIN_TYPE_LIST[key], value: key }))\n )\n },\n width: 100\n },\n {\n type: 'select',\n name: 'detailType',\n header: '상세 구분',\n record: {\n editable: true,\n options: (columns, data, column) => [\n { display: '', value: '' },\n ...this.checklistDetailTypes.filter(v => v.mainType == column.mainType)\n ]\n },\n width: 200\n },\n {\n type: 'string',\n name: 'name',\n header: '검사 항목',\n record: {\n editable: true\n },\n width: 200\n },\n {\n type: 'string',\n name: 'inspctionCriteria',\n header: '검사 기준',\n record: {\n editable: true\n },\n width: 200\n }\n ],\n pagination: {\n infinite: true\n },\n sorters: [{ name: 'mainType' }, { name: 'sequence' }]\n }\n }\n\n async fetchHandler() {\n if (!this.checklistTemplateId) return []\n\n const response = await client.query({\n query: gql`\n query ($filters: [Filter!], $pagination: Pagination, $sortings: [Sorting!]) {\n checklistTemplateItems(filters: $filters, pagination: $pagination, sortings: $sortings) {\n items {\n id\n sequence\n name\n inspctionCriteria\n mainType\n detailType\n }\n }\n }\n `,\n variables: {\n filters: {\n name: 'checklistTemplateId',\n value: this.checklistTemplateId,\n operator: 'eq'\n },\n sortings: [{ name: 'mainType' }, { name: 'sequence' }]\n }\n })\n\n // 체크리스트 아이템 데이터 갱신\n this.onChangeGird()\n\n return {\n records: response.data.checklistTemplateItems.items || []\n }\n }\n\n private _onSelectChecklistTemplate(e) {\n const checklistTemplateId = e.target.value\n\n // 체크 리스트 이름 셋팅\n this.checklist = { ...this.checklist, name: e.target.displayText }\n\n // 그리드 아이템 셋팅\n if (checklistTemplateId) {\n this.checklistTemplateId = checklistTemplateId\n this.grist.fetch()\n }\n }\n\n async _createInspection() {\n let patch: any = {}\n\n patch.buildingLevelId = this.htmlSelectLevel.value\n patch.checklist = {\n name: this.checklist.name,\n constructionType: this.htmlSelectConstructionType.displayText,\n constructionDetailType: this.htmlSelectConstructionDetailType.displayText,\n location: `${this.htmlSelectBuilding.displayText} ${this.htmlSelectLevel.displayText}층`,\n inspectionDrawingType: this.selectedInspectionDrawingType.name,\n inspectionParts: this.checklist.inspectionParts\n }\n patch.checklistItem = this.checklist.checklistItems?.map(item => {\n return {\n name: item.name,\n mainType: item.mainType,\n detailType: item.detailType,\n inspctionCriteria: item.inspctionCriteria\n }\n })\n\n const response = await client.mutate({\n mutation: gql`\n mutation CreateBuildingInspection($patch: NewBuildingInspection!) {\n createBuildingInspection(patch: $patch) {\n id\n }\n }\n `,\n variables: {\n patch\n }\n })\n\n if (!response.errors) {\n notify({ message: '검측 요청서를 등록하였습니다.' })\n this.requestRefresh()\n this._close()\n } else {\n notify({ message: response.errors?.[0]?.message || '검측 요청서 등록에 실패하였습니다.', level: 'error' })\n }\n }\n // Input 요소의 값이 변경될 때 호출되는 콜백 함수\n private _onInputChange(event: InputEvent) {\n const target = event.target as HTMLInputElement\n this[target.name] = target.value\n this.checklist = { ...this.checklist, name: target.value }\n }\n\n // 체크리스트 아이템 데이터 갱신\n private onChangeGird() {\n const checklistDetailTypes = Object.fromEntries(this.checklistDetailTypes.map(item => [item.value, item.display]))\n const grist = this.grist\n\n // grist field-change가 오는 시점이 데이터 변경 전이라 setTimeout으로 변경\n setTimeout(() => {\n this.checklist.checklistItems = grist.dirtyData.records.map((row, idx) => {\n return {\n ...row,\n detailType: checklistDetailTypes[row.detailType],\n sequence: idx\n }\n })\n this.checklist = { ...this.checklist }\n }, 100)\n }\n}\n"]}