@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
@@ -1 +1 @@
1
- {"version":3,"file":"building-inspection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AiB;IACjB,GAAG,CAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;KAiCF;CACF,CAAA;AAED;IAAC,KAAK,EAAE;;kEAAkB;AAC1B;IAAC,KAAK,EAAE;;6EAA6B;AAzC1B,iCAAiC;IAD7C,aAAa,CAAC,sCAAsC,CAAC;GACzC,iCAAiC,CA6M7C;SA7MY,iCAAiC","sourcesContent":["import '@material/web/icon/icon.js'\nimport '@operato/data-grist'\n\nimport { CommonGristStyles, CommonButtonStyles, ScrollbarStyles } from '@operato/styles'\nimport { PageView } from '@operato/shell'\nimport { css, html } from 'lit'\nimport { PageLifecycle } from '@operato/shell/dist/src/app/pages/page-view'\nimport { customElement, query, state } from 'lit/decorators.js'\nimport { ScopedElementsMixin } from '@open-wc/scoped-elements'\nimport { client } from '@operato/graphql'\nimport { notify } from '@operato/layout'\nimport gql from 'graphql-tag'\nimport { openPopup } from '@operato/layout'\n\nimport './component/building-inspection-detail-header'\nimport '../checklist/checklist-view'\nimport { ChecklistMode } from '../checklist/checklist-view'\n\n@customElement('building-inspection-detail-checklist')\nexport class BuildingInspectionDetailChecklist extends ScopedElementsMixin(PageView) {\n static styles = [\n ScrollbarStyles,\n CommonGristStyles,\n css`\n :host {\n display: grid;\n grid-template-rows: 75px auto;\n color: #4e5055;\n\n width: 100%;\n background-color: #f7f7f7;\n overflow-y: auto;\n\n --grid-record-emphasized-background-color: red;\n --grid-record-emphasized-color: yellow;\n }\n\n *[bold] {\n font-weight: bold;\n }\n\n div[body] {\n display: flex;\n justify-content: center;\n flex-direction: column;\n align-items: center;\n\n div[button-container] {\n display: flex;\n justify-content: flex-end;\n width: 100%;\n gap: 10px;\n margin-right: 50px;\n margin-bottom: 15px;\n }\n }\n `\n ]\n\n @state() project: any = {}\n @state() buildingInspection: any = {}\n\n get context() {\n return {\n title: '검측 관리 상세 - 검측 체크리스트'\n }\n }\n\n render() {\n return html`\n <building-inspection-detail-header\n .buildingInspectionId=${this.buildingInspection?.id}\n .buildingLevelId=${this.buildingInspection?.buildingLevel?.id}\n .projectName=${this.project.name}\n .buildingName=${this.buildingInspection?.buildingLevel?.building?.name}\n .buildingLevelFloor=${this.buildingInspection?.buildingLevel?.floor}\n ></building-inspection-detail-header>\n\n <div body>\n <checklist-view\n .mode=${ChecklistMode.EDITOR}\n status=${this.buildingInspection.status}\n .checklist=${this.buildingInspection.checklist || {}}\n ></checklist-view>\n\n <div button-container>\n <md-elevated-button @click=${this._onClickModifyChecklist}>\n <md-icon slot=\"icon\">assignment</md-icon>등록\n </md-elevated-button>\n </div>\n </div>\n `\n }\n\n async pageUpdated(changes: any, lifecycle: PageLifecycle) {\n if (this.active) {\n const buildingInspectionId = lifecycle.resourceId || ''\n await this.initBuildingInspection(buildingInspectionId)\n }\n }\n\n async initBuildingInspection(buildingInspectionId: string = '') {\n const response = await client.query({\n query: gql`\n query BuildingInspection($buildingInspectionId: String!) {\n buildingInspection(id: $buildingInspectionId) {\n id\n status\n requestDate\n checklist {\n id\n name\n constructionType\n constructionDetailType\n location\n inspectionParts\n documentNo\n constructionInspectionDate\n supervisorInspectionDate\n overallConstructorSignature\n taskConstructorSignature\n overallSupervisorySignature\n taskSupervisorySignature\n checklistItems {\n id\n name\n sequence\n mainType\n detailType\n inspctionCriteria\n constructionConfirmStatus\n supervisoryConfirmStatus\n comment\n }\n }\n buildingLevel {\n id\n floor\n mainDrawing {\n id\n name\n fullpath\n }\n mainDrawingImage\n building {\n id\n name\n buildingComplex {\n id\n }\n }\n }\n }\n }\n `,\n variables: {\n buildingInspectionId\n }\n })\n\n if (response.errors) return\n\n this.buildingInspection = response.data.buildingInspection\n\n await this._getProjectByBuildingComplexId(this.buildingInspection?.buildingLevel?.building?.buildingComplex?.id)\n }\n\n private async _getProjectByBuildingComplexId(buildingComplexId) {\n const response = await client.query({\n query: gql`\n query ProjectByBuildingComplexId($buildingComplexId: String!) {\n project: projectByBuildingComplexId(buildingComplexId: $buildingComplexId) {\n id\n name\n }\n }\n `,\n variables: {\n buildingComplexId\n }\n })\n\n if (response.errors) return\n\n this.project = response.data.project\n }\n\n private _onClickModifyChecklist() {\n this.validateChecklist(this.buildingInspection.checklist)\n }\n\n private async validateChecklist(checklist: any) {\n const response = await client.mutate({\n mutation: gql`\n mutation UpdateBuildingInspectionChecklist($buildingInspection: UpdateBuildingInspectionSubmitType!) {\n updateBuildingInspectionChecklist(buildingInspection: $buildingInspection)\n }\n `,\n variables: {\n buildingInspection: {\n id: this.buildingInspection.id,\n checklist: {\n id: checklist.id,\n overallConstructorSignature: checklist.overallConstructorSignature,\n taskConstructorSignature: checklist.taskConstructorSignature,\n overallSupervisorySignature: checklist.overallSupervisorySignature,\n taskSupervisorySignature: checklist.taskSupervisorySignature\n },\n checklistItem: checklist.checklistItems.map(item => ({\n id: item.id,\n constructionConfirmStatus: item.constructionConfirmStatus,\n supervisoryConfirmStatus: item.supervisoryConfirmStatus\n }))\n }\n }\n })\n\n if (!response.errors) {\n notify({ message: '검측요청서를 등록하였습니다.' })\n this.initBuildingInspection(this.buildingInspection.id)\n } else {\n notify({ message: response.errors?.[0]?.message || '검측 요청서 등록에 실패하였습니다.', level: 'error' })\n }\n }\n}\n"]}
1
+ {"version":3,"file":"building-inspection-detail-checklist.js","sourceRoot":"","sources":["../../../client/pages/building-inspection/building-inspection-detail-checklist.ts"],"names":[],"mappings":";AAAA,OAAO,4BAA4B,CAAA;AACnC,OAAO,qBAAqB,CAAA;AAE5B,OAAO,EAAE,iBAAiB,EAAsB,eAAe,EAAE,MAAM,iBAAiB,CAAA;AACxF,OAAO,EAAE,QAAQ,EAAE,MAAM,gBAAgB,CAAA;AACzC,OAAO,EAAE,GAAG,EAAE,IAAI,EAAE,MAAM,KAAK,CAAA;AAC/B,OAAO,EAAE,aAAa,EAAE,KAAK,EAAE,MAAM,mBAAmB,CAAA;AACxD,OAAO,EAAE,KAAK,EAAE,MAAM,yBAAyB,CAAA;AAE/C,OAAO,EAAE,MAAM,EAAE,MAAM,kBAAkB,CAAA;AACzC,O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AA2B;wBAClE,wBAAwB,EAAE,SAAS,CAAC,wBAAwB;wBAC5D,2BAA2B,EAAE,SAAS,CAAC,2BAA2B;wBAClE,wBAAwB,EAAE,SAAS,CAAC,wBAAwB;qBAC7D;oBACD,aAAa,EAAE,SAAS,CAAC,cAAc,CAAC,GAAG,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC;wBACnD,EAAE,EAAE,IAAI,CAAC,EAAE;wBACX,yBAAyB,EAAE,IAAI,CAAC,yBAAyB;wBACzD,wBAAwB,EAAE,IAAI,CAAC,wBAAwB;qBACxD,CAAC,CAAC;iBACJ;aACF;SACF,CAAC,CAAA;QAEF,IAAI,CAAC,QAAQ,CAAC,MAAM,EAAE;YACpB,MAAM,CAAC,EAAE,OAAO,EAAE,iBAAiB,EAAE,CAAC,CAAA;YACtC,IAAI,CAAC,sBAAsB,CAAC,IAAI,CAAC,kBAAkB,CAAC,EAAE,CAAC,CAAA;SACxD;aAAM;YACL,MAAM,CAAC,EAAE,OAAO,EAAE,CAAA,MAAA,MAAA,QAAQ,CAAC,MAAM,0CAAG,CAAC,CAAC,0CAAE,OAAO,KAAI,qBAAqB,EAAE,KAAK,EAAE,OAAO,EAAE,CAAC,CAAA;SAC5F;IACH,CAAC;;AAnNM,wCAAM,GAAG;IACd,eAAe;IACf,iBAAiB;IACjB,GAAG,CAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;KAiCF;CACF,CAAA;AAED;IAAC,KAAK,EAAE;;kEAAkB;AAC1B;IAAC,KAAK,EAAE;;6EAA6B;AAzC1B,iCAAiC;IAD7C,aAAa,CAAC,sCAAsC,CAAC;GACzC,iCAAiC,CAqN7C;SArNY,iCAAiC","sourcesContent":["import '@material/web/icon/icon.js'\nimport '@operato/data-grist'\n\nimport { CommonGristStyles, CommonButtonStyles, ScrollbarStyles } from '@operato/styles'\nimport { PageView } from '@operato/shell'\nimport { css, html } from 'lit'\nimport { customElement, state } from 'lit/decorators.js'\nimport { keyed } from 'lit/directives/keyed.js'\nimport { PageLifecycle } from '@operato/shell/dist/src/app/pages/page-view'\nimport { client } from '@operato/graphql'\nimport { notify } from '@operato/layout'\nimport gql from 'graphql-tag'\nimport { openPopup } from '@operato/layout'\n\nimport './component/building-inspection-detail-header'\nimport '../checklist/checklist-view'\nimport { ChecklistMode } from '../checklist/checklist-view'\n\n@customElement('building-inspection-detail-checklist')\nexport class BuildingInspectionDetailChecklist extends PageView {\n static styles = [\n ScrollbarStyles,\n CommonGristStyles,\n css`\n :host {\n display: grid;\n grid-template-rows: 75px auto;\n color: #4e5055;\n\n width: 100%;\n background-color: #f7f7f7;\n overflow-y: auto;\n\n --grid-record-emphasized-background-color: red;\n --grid-record-emphasized-color: yellow;\n }\n\n *[bold] {\n font-weight: bold;\n }\n\n div[body] {\n display: flex;\n justify-content: center;\n flex-direction: column;\n align-items: center;\n\n div[button-container] {\n display: flex;\n justify-content: flex-end;\n width: 100%;\n gap: 10px;\n margin-right: 50px;\n margin-bottom: 15px;\n }\n }\n `\n ]\n\n @state() project: any = {}\n @state() buildingInspection: any = {}\n\n get context() {\n return {\n title: '검측 관리 상세 - 검측 체크리스트'\n }\n }\n\n render() {\n return html`\n <building-inspection-detail-header\n .buildingInspectionId=${this.buildingInspection?.id}\n .buildingLevelId=${this.buildingInspection?.buildingLevel?.id}\n .projectName=${this.project.name}\n .buildingName=${this.buildingInspection?.buildingLevel?.building?.name}\n .buildingLevelFloor=${this.buildingInspection?.buildingLevel?.floor}\n ></building-inspection-detail-header>\n\n <div body>\n ${keyed(\n this.buildingInspection.id,\n html`\n <checklist-view\n .mode=${ChecklistMode.EDITOR}\n status=${this.buildingInspection.status}\n .checklist=${this.buildingInspection.checklist || {}}\n ></checklist-view>\n `\n )}\n\n <div button-container>\n <md-elevated-button @click=${this._onClickModifyChecklist}>\n <md-icon slot=\"icon\">assignment</md-icon>등록\n </md-elevated-button>\n </div>\n </div>\n `\n }\n\n async pageUpdated(changes: any, lifecycle: PageLifecycle) {\n if (this.active) {\n const buildingInspectionId = lifecycle.resourceId || ''\n await this.initBuildingInspection(buildingInspectionId)\n }\n }\n\n async initBuildingInspection(buildingInspectionId: string = '') {\n const response = await client.query({\n query: gql`\n query BuildingInspection($buildingInspectionId: String!) {\n buildingInspection(id: $buildingInspectionId) {\n id\n status\n requestDate\n checklist {\n id\n name\n constructionType\n constructionDetailType\n location\n inspectionParts\n documentNo\n constructionInspectionDate\n supervisorInspectionDate\n overallConstructorSignature\n taskConstructorSignature\n overallSupervisorySignature\n taskSupervisorySignature\n buildingInspection {\n status\n }\n checklistItems {\n id\n name\n sequence\n mainType\n detailType\n inspctionCriteria\n constructionConfirmStatus\n supervisoryConfirmStatus\n comment\n }\n }\n buildingLevel {\n id\n floor\n mainDrawing {\n id\n name\n fullpath\n }\n mainDrawingImage\n building {\n id\n name\n buildingComplex {\n id\n }\n }\n }\n }\n }\n `,\n variables: {\n buildingInspectionId\n }\n })\n\n if (response.errors) return\n\n this.buildingInspection = response.data.buildingInspection\n\n await this._getProjectByBuildingComplexId(this.buildingInspection?.buildingLevel?.building?.buildingComplex?.id)\n }\n\n private async _getProjectByBuildingComplexId(buildingComplexId) {\n const response = await client.query({\n query: gql`\n query ProjectByBuildingComplexId($buildingComplexId: String!) {\n project: projectByBuildingComplexId(buildingComplexId: $buildingComplexId) {\n id\n name\n }\n }\n `,\n variables: {\n buildingComplexId\n }\n })\n\n if (response.errors) return\n\n this.project = response.data.project\n }\n\n private _onClickModifyChecklist() {\n this.validateChecklist(this.buildingInspection.checklist)\n }\n\n private async validateChecklist(checklist: any) {\n const response = await client.mutate({\n mutation: gql`\n mutation UpdateBuildingInspectionChecklist($buildingInspection: UpdateBuildingInspectionSubmitType!) {\n updateBuildingInspectionChecklist(buildingInspection: $buildingInspection)\n }\n `,\n variables: {\n buildingInspection: {\n id: this.buildingInspection.id,\n checklist: {\n id: checklist.id,\n overallConstructorSignature: checklist.overallConstructorSignature,\n taskConstructorSignature: checklist.taskConstructorSignature,\n overallSupervisorySignature: checklist.overallSupervisorySignature,\n taskSupervisorySignature: checklist.taskSupervisorySignature\n },\n checklistItem: checklist.checklistItems.map(item => ({\n id: item.id,\n constructionConfirmStatus: item.constructionConfirmStatus,\n supervisoryConfirmStatus: item.supervisoryConfirmStatus\n }))\n }\n }\n })\n\n if (!response.errors) {\n notify({ message: '검측요청서를 등록하였습니다.' })\n this.initBuildingInspection(this.buildingInspection.id)\n } else {\n notify({ message: response.errors?.[0]?.message || '검측 요청서 등록에 실패하였습니다.', level: 'error' })\n }\n }\n}\n"]}
@@ -1,10 +1,12 @@
1
1
  import '@material/web/icon/icon.js';
2
2
  import '@operato/data-grist';
3
3
  import { PageView } from '@operato/shell';
4
+ import { TemplateResult } from 'lit';
4
5
  import { PageLifecycle } from '@operato/shell/dist/src/app/pages/page-view';
5
6
  import { FetchOption } from '@operato/data-grist';
6
7
  import './inspection-create-popup';
7
8
  import '@operato/event-view/ox-event-view.js';
9
+ import { EventProvider } from '@operato/event-view';
8
10
  export declare enum ChecklistTypeMainType {
9
11
  BASIC = "10",
10
12
  NON_BASIC = "20"
@@ -36,6 +38,7 @@ export declare class BuildingInspectionList extends BuildingInspectionList_base
36
38
  building: any;
37
39
  drawingImage: string;
38
40
  buildingInspectionSummary: any;
41
+ calendarData?: EventProvider;
39
42
  private grist;
40
43
  private eventView;
41
44
  get context(): {
@@ -52,7 +55,7 @@ export declare class BuildingInspectionList extends BuildingInspectionList_base
52
55
  action: () => void;
53
56
  }[];
54
57
  };
55
- render(): import("lit-html").TemplateResult<1>;
58
+ render(): TemplateResult<1>;
56
59
  pageUpdated(changes: any, lifecycle: PageLifecycle): Promise<void>;
57
60
  initProject(buildingLevelId?: string): Promise<void>;
58
61
  pageInitialized(lifecycle: any): Promise<void>;
@@ -63,5 +66,6 @@ export declare class BuildingInspectionList extends BuildingInspectionList_base
63
66
  private _deleteChecklistType;
64
67
  private _openCreateInspection;
65
68
  private _formatDate;
69
+ private getCalendarTemplate;
66
70
  }
67
71
  export {};
@@ -13,6 +13,7 @@ import gql from 'graphql-tag';
13
13
  import { openPopup } from '@operato/layout';
14
14
  import './inspection-create-popup';
15
15
  import '@operato/event-view/ox-event-view.js';
16
+ import { InspectionEventProvider } from './component/inspection-event-provider';
16
17
  export var ChecklistTypeMainType;
17
18
  (function (ChecklistTypeMainType) {
18
19
  ChecklistTypeMainType["BASIC"] = "10";
@@ -63,20 +64,43 @@ let BuildingInspectionList = class BuildingInspectionList extends ScopedElements
63
64
  render() {
64
65
  return html `
65
66
  <div header>
66
- <h2>${this.project.name} ${this.location}</h2>
67
+ <h2>${this.project.name}</h2>
67
68
  </div>
68
69
 
69
70
  <div body>
70
71
  <div top>
71
- <img drawing src=${this.drawingImage || '/assets/images/img-drawing-default.png'} />
72
- <div status>
73
- <h3>${this.location} 검측 현황</h3>
74
- <div inspection-data>
75
- <div>
76
- ${Object.entries(BUILDING_INSPECTION_STATUS).map(status => html ` <div>${status[1]} ${this.buildingInspectionSummary[status[0].toLowerCase()]}건</div> `)}
77
- </div>
78
- <ox-event-view mode=${'monthly'}> </ox-event-view>
72
+ <div drawing>
73
+ <h3>도면: ${this.location}</h3>
74
+ <img src=${this.drawingImage || '/assets/images/img-drawing-default.png'} />
75
+ </div>
76
+
77
+ <div inspection-container>
78
+ <div inspection>
79
+ <span name bold>
80
+ <md-icon slot="icon">fact_check</md-icon>
81
+ 검측<br />현황
82
+ </span>
83
+
84
+ ${Object.entries(BUILDING_INSPECTION_STATUS).map(inspectionStatus => {
85
+ const displayName = inspectionStatus[1];
86
+ const status = inspectionStatus[0].toLowerCase();
87
+ return html `
88
+ <span>
89
+ <div>${displayName}</div>
90
+ <div bold status=${status}><span dot>●</span> ${this.buildingInspectionSummary[status]}</div>
91
+ </span>
92
+ `;
93
+ })}
79
94
  </div>
95
+
96
+ <ox-event-view
97
+ .mode=${'monthly'}
98
+ .eventProvider=${this.calendarData}
99
+ @select-date=${(e) => {
100
+ console.log('select-date', e.detail);
101
+ }}
102
+ >
103
+ </ox-event-view>
80
104
  </div>
81
105
  </div>
82
106
 
@@ -94,10 +118,10 @@ let BuildingInspectionList = class BuildingInspectionList extends ScopedElements
94
118
  }
95
119
  }
96
120
  async initProject(buildingLevelId = '') {
97
- var _a, _b;
121
+ var _a, _b, _c;
98
122
  const response = await client.query({
99
123
  query: gql `
100
- query ProjectByBuildingLevelId($buildingLevelId: String!) {
124
+ query ProjectByBuildingLevelId($buildingLevelId: String!, $yearMonth: String!) {
101
125
  projectByBuildingLevelId(buildingLevelId: $buildingLevelId) {
102
126
  id
103
127
  name
@@ -124,16 +148,27 @@ let BuildingInspectionList = class BuildingInspectionList extends ScopedElements
124
148
  pass
125
149
  fail
126
150
  }
151
+
152
+ buildingInspectionDateSummaryOfLevelAndMonth(buildingLevelId: $buildingLevelId, yearMonth: $yearMonth) {
153
+ requestDate
154
+ wait
155
+ request
156
+ pass
157
+ fail
158
+ }
127
159
  }
128
160
  `,
129
161
  variables: {
130
- buildingLevelId
162
+ buildingLevelId,
163
+ yearMonth: '2024-10'
131
164
  }
132
165
  });
133
166
  if (response.errors)
134
167
  return;
135
168
  this.project = (_a = response.data) === null || _a === void 0 ? void 0 : _a.projectByBuildingLevelId;
136
169
  this.buildingInspectionSummary = (_b = response.data) === null || _b === void 0 ? void 0 : _b.buildingInspectionSummaryOfBuildingLevel;
170
+ const calendarData = this.getCalendarTemplate((_c = response.data) === null || _c === void 0 ? void 0 : _c.buildingInspectionDateSummaryOfLevelAndMonth);
171
+ this.calendarData = new InspectionEventProvider(calendarData);
137
172
  // 캘린더 최소 높이 속성 수정
138
173
  this.eventView.style.setProperty('--calendar-monthly-date-min-height', '50px');
139
174
  }
@@ -205,30 +240,17 @@ let BuildingInspectionList = class BuildingInspectionList extends ScopedElements
205
240
  };
206
241
  }
207
242
  async fetchHandler({ page = 1, limit = 100, sortings = [], filters = [] }) {
208
- var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k;
243
+ var _a, _b, _c, _d, _e;
209
244
  if (!this.buildingLevelId)
210
245
  return;
211
246
  const response = await client.query({
212
247
  query: gql `
213
- query BuildingInspectionsOfBuildingLevel($params: BuildingInspectionsOfBuildingLevel!) {
248
+ query BuildingInspectionsOfBuildingLevel($params: BuildingInspectionsOfBuildingLevel!, $buildingLevelId: String!) {
214
249
  buildingInspectionsOfBuildingLevel(params: $params) {
215
250
  items {
216
251
  id
217
252
  status
218
253
  requestDate
219
- buildingLevel {
220
- floor
221
- building {
222
- id
223
- name
224
- }
225
- mainDrawing {
226
- id
227
- name
228
- fullpath
229
- }
230
- mainDrawingImage
231
- }
232
254
  checklist {
233
255
  checklistId: id
234
256
  name
@@ -240,22 +262,39 @@ let BuildingInspectionList = class BuildingInspectionList extends ScopedElements
240
262
  }
241
263
  total
242
264
  }
265
+
266
+ buildingLevel(id: $buildingLevelId) {
267
+ id
268
+ floor
269
+ building {
270
+ id
271
+ name
272
+ }
273
+ mainDrawing {
274
+ id
275
+ name
276
+ fullpath
277
+ }
278
+ mainDrawingImage
279
+ }
243
280
  }
244
281
  `,
245
282
  variables: {
246
283
  params: {
247
284
  buildingLevelId: this.buildingLevelId,
248
285
  limit: 0
249
- }
286
+ },
287
+ buildingLevelId: this.buildingLevelId
250
288
  }
251
289
  });
252
290
  let items = ((_b = (_a = response.data) === null || _a === void 0 ? void 0 : _a.buildingInspectionsOfBuildingLevel) === null || _b === void 0 ? void 0 : _b.items) || [];
253
291
  items = items.map(item => (Object.assign(Object.assign(Object.assign({}, item), item.checklist), { requestDate: this._formatDate(item.requestDate) })));
254
- this.location = ((_d = (_c = items[0]) === null || _c === void 0 ? void 0 : _c.checklist) === null || _d === void 0 ? void 0 : _d.location) || '';
255
- this.drawingImage = ((_f = (_e = items[0]) === null || _e === void 0 ? void 0 : _e.buildingLevel) === null || _f === void 0 ? void 0 : _f.mainDrawingImage) || '';
256
- this.building = ((_h = (_g = items[0]) === null || _g === void 0 ? void 0 : _g.buildingLevel) === null || _h === void 0 ? void 0 : _h.building) || {};
292
+ const buildingLevel = (_c = response.data) === null || _c === void 0 ? void 0 : _c.buildingLevel;
293
+ this.location = `${buildingLevel.building.name} ${buildingLevel.floor}층` || '';
294
+ this.drawingImage = (buildingLevel === null || buildingLevel === void 0 ? void 0 : buildingLevel.mainDrawingImage) || '';
295
+ this.building = (buildingLevel === null || buildingLevel === void 0 ? void 0 : buildingLevel.building) || {};
257
296
  return {
258
- total: ((_k = (_j = response.data) === null || _j === void 0 ? void 0 : _j.buildingInspectionsOfBuildingLevel) === null || _k === void 0 ? void 0 : _k.total) || 0,
297
+ total: ((_e = (_d = response.data) === null || _d === void 0 ? void 0 : _d.buildingInspectionsOfBuildingLevel) === null || _e === void 0 ? void 0 : _e.total) || 0,
259
298
  records: items
260
299
  };
261
300
  }
@@ -304,6 +343,21 @@ let BuildingInspectionList = class BuildingInspectionList extends ScopedElements
304
343
  }).format(new Date(date))
305
344
  : '';
306
345
  }
346
+ // 검측 개수가 있는 데이터들만 날짜별로 템플릿 만들기
347
+ getCalendarTemplate(inspectionData = []) {
348
+ const template = {};
349
+ for (let date of inspectionData) {
350
+ template[date.requestDate] = html `
351
+ <div style="display: grid; grid-template-columns: repeat(2, 1fr); padding-inline: 7px;">
352
+ ${date.wait !== 0 ? html `<div><span style="font-size: 1.3em; color: #4e5055">●</span> ${date.wait}</div>` : ''}
353
+ ${date.request !== 0 ? html `<div><span style="font-size: 1.3em; color: #3395f1">●</span> ${date.request}</div>` : ''}
354
+ ${date.pass !== 0 ? html `<div><span style="font-size: 1.3em; color: #1bb401">●</span> ${date.pass}</div>` : ''}
355
+ ${date.fail !== 0 ? html `<div><span style="font-size: 1.3em; color: #ff4444">●</span> ${date.fail}</div>` : ''}
356
+ </div>
357
+ `;
358
+ }
359
+ return template;
360
+ }
307
361
  };
308
362
  BuildingInspectionList.styles = [
309
363
  ScrollbarStyles,
@@ -366,7 +420,6 @@ BuildingInspectionList.styles = [
366
420
  div[body] > div {
367
421
  display: flex;
368
422
  gap: 10px;
369
- padding: 15px;
370
423
  border-radius: 5px;
371
424
  }
372
425
 
@@ -374,30 +427,77 @@ BuildingInspectionList.styles = [
374
427
  flex: 1;
375
428
 
376
429
  display: flex;
377
- background-color: #ffffff;
378
- border: 1px solid #cccccc80;
430
+ background-color: #f7f7f7;
379
431
  }
380
432
 
381
- img[drawing] {
382
- width: 400px;
433
+ div[drawing] {
434
+ flex: 0.4;
435
+ border: 1px solid #cccccc80;
436
+ background-color: #fff;
437
+ padding: 10px;
438
+ border-radius: 5px;
383
439
 
384
- display: block;
385
- object-fit: contain; /* 이미지 비율 유지하고 컨테이너에 맞춰서 축소/확대 */
386
- object-position: center; /* 이미지를 중앙에 배치 */
440
+ img {
441
+ width: 100%;
442
+
443
+ display: block;
444
+ object-fit: contain;
445
+ object-position: center;
446
+ }
387
447
  }
388
448
 
389
- div[status] {
390
- flex: 1;
449
+ div[inspection-container] {
450
+ flex: 0.6;
451
+ gap: 5px;
391
452
 
392
453
  display: flex;
393
454
  flex-direction: column;
394
- }
395
455
 
396
- div[inspection-data] {
397
- flex: 1;
456
+ div[inspection] {
457
+ display: grid;
458
+ grid-template-columns: 120px 0.9fr 0.9fr 0.9fr 0.9fr;
459
+ margin-top: 5px;
460
+ background: #ebc8321a;
461
+ border-radius: 7px;
462
+ padding: 7px 0px;
398
463
 
399
- display: flex;
400
- gap: 10px;
464
+ & > span {
465
+ display: flex;
466
+ flex-direction: column;
467
+ align-items: center;
468
+ justify-content: center;
469
+
470
+ div[status='wait'] {
471
+ color: #4e5055;
472
+ }
473
+ div[status='request'] {
474
+ color: #3395f1;
475
+ }
476
+ div[status='pass'] {
477
+ color: #1bb401;
478
+ }
479
+ div[status='fail'] {
480
+ color: #ff4444;
481
+ }
482
+ span[dot] {
483
+ font-size: 1.3em;
484
+ }
485
+ }
486
+ & > span[name] {
487
+ flex-direction: row;
488
+ text-align: right;
489
+ gap: 10px;
490
+ border-right: 2px dotted #ccc;
491
+
492
+ md-icon {
493
+ width: 40px;
494
+ height: 40px;
495
+ border-radius: 7px;
496
+ color: #fff;
497
+ background: #f16154;
498
+ }
499
+ }
500
+ }
401
501
  }
402
502
 
403
503
  ox-event-view {
@@ -446,6 +546,10 @@ __decorate([
446
546
  state(),
447
547
  __metadata("design:type", Object)
448
548
  ], BuildingInspectionList.prototype, "buildingInspectionSummary", void 0);
549
+ __decorate([
550
+ state(),
551
+ __metadata("design:type", Object)
552
+ ], BuildingInspectionList.prototype, "calendarData", void 0);
449
553
  __decorate([
450
554
  query('ox-grist'),
451
555
  __metadata("design:type", DataGrist)
@@ -1 +1 @@
1
- {"version":3,"file":"building-inspection-list.js","sourceRoot":"","sources":["../../../client/pages/building-inspection/building-inspection-list.ts"],"names":[],"mappings":";AAAA,OAAO,4BAA4B,CAAA;AACnC,OAAO,qBAAqB,CAAA;AAE5B,OAAO,EAAE,iBAAiB,EAAE,kBAAkB,EAAE,eAAe,EAAE,MAAM,iBAAiB,CAAA;AACxF,OAAO,EAAE,QAAQ,EAAE,QAAQ,EAAE,MAAM,gBAAgB,CAAA;AACnD,OAAO,EAAE,GAAG,EAAE,IAAI,EAAE,MAAM,KAAK,CAAA;AAE/B,OAAO,EAAE,aAAa,EAAE,KAAK,EAAE,KAAK,EAAE,MAAM,mBAAmB,CAAA;AAC/D,OAAO,EAAE,mBAAmB,EAAE,MAAM,0BAA0B,CAAA;AAC9D,OAAO,EAAE,SAAS,EAAe,MAAM,qBAAqB,CAAA;AAC5D,OAAO,EAAE,MAAM,EAAE,MAAM,kBAAkB,CAAA;AACzC,OAAO,EAAE,MAAM,EAAE,MAAM,iBAAiB,CAAA;AACxC,OAAO,GAAG,MAAM,aAAa,CAAA;AAC7B,OAAO,EAAE,SAAS,EAAE,MAAM,iBAAiB,CAAA;AAC3C,OAAO,2BAA2B,CAAA;AAClC,OAAO,sCAAsC,CAAA;AAE7C,MAAM,CAAN,IAAY,qBAGX;AAHD,WAAY,qBAAqB;IAC/B,qCAAY,CAAA;IACZ,yCAAgB,CAAA;AAClB,CAAC,EAHW,qBAAqB,KAArB,qBAAqB,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C;GAC7B,sBAAsB,CAgalC;SAhaY,sBAAsB","sourcesContent":["import '@material/web/icon/icon.js'\nimport '@operato/data-grist'\n\nimport { CommonGristStyles, CommonButtonStyles, ScrollbarStyles } from '@operato/styles'\nimport { PageView, navigate } from '@operato/shell'\nimport { css, html } from 'lit'\nimport { PageLifecycle } from '@operato/shell/dist/src/app/pages/page-view'\nimport { customElement, query, state } from 'lit/decorators.js'\nimport { ScopedElementsMixin } from '@open-wc/scoped-elements'\nimport { DataGrist, FetchOption } from '@operato/data-grist'\nimport { client } from '@operato/graphql'\nimport { notify } from '@operato/layout'\nimport gql from 'graphql-tag'\nimport { openPopup } from '@operato/layout'\nimport './inspection-create-popup'\nimport '@operato/event-view/ox-event-view.js'\n\nexport enum ChecklistTypeMainType {\n BASIC = '10',\n NON_BASIC = '20'\n}\nexport const CHECKLIST_MAIN_TYPE_LIST = {\n [ChecklistTypeMainType.BASIC]: '기본 업무',\n [ChecklistTypeMainType.NON_BASIC]: '기본 외 업무'\n}\n\nexport enum BuildingInspectionStatus {\n WAIT = 'WAIT',\n REQUEST = 'REQUEST',\n PASS = 'PASS',\n FAIL = 'FAIL'\n}\nexport const BUILDING_INSPECTION_STATUS = {\n [BuildingInspectionStatus.WAIT]: '검측 대기',\n [BuildingInspectionStatus.REQUEST]: '검측 요청',\n [BuildingInspectionStatus.PASS]: '합격',\n [BuildingInspectionStatus.FAIL]: '불합격'\n}\n\n@customElement('building-inspection-list')\nexport class BuildingInspectionList extends ScopedElementsMixin(PageView) {\n static styles = [\n ScrollbarStyles,\n CommonGristStyles,\n css`\n :host {\n display: grid;\n grid-template-rows: 75px auto;\n color: #4e5055;\n\n width: 100%;\n background-color: #f7f7f7;\n overflow-y: auto;\n\n --grid-record-emphasized-background-color: red;\n --grid-record-emphasized-color: yellow;\n }\n\n md-filled-button {\n --md-filled-button-container-color: #0595e5;\n --md-filled-button-container-height: 30px;\n --md-filled-button-trailing-space: 15px;\n --md-filled-button-leading-space: 15px;\n }\n\n md-outlined-button {\n --md-outlined-button-container-height: 30px;\n --md-outlined-button-trailing-space: 15px;\n --md-outlined-button-leading-space: 15px;\n }\n\n *[bold] {\n font-weight: bold;\n }\n\n div[header] {\n display: flex;\n margin: 0px 20px;\n }\n\n div[header] h2 {\n flex: 0.5;\n color: #3f71a0;\n }\n\n div[body] {\n display: flex;\n flex-direction: column;\n margin: 0px 25px 0px 25px;\n gap: 10px;\n min-height: fit-content;\n }\n\n div[body] h3 {\n color: #2e79be;\n font-size: 18px;\n margin: 0px;\n }\n\n div[body] > div {\n display: flex;\n gap: 10px;\n padding: 15px;\n border-radius: 5px;\n }\n\n div[top] {\n flex: 1;\n\n display: flex;\n background-color: #ffffff;\n border: 1px solid #cccccc80;\n }\n\n img[drawing] {\n width: 400px;\n\n display: block;\n object-fit: contain; /* 이미지 비율 유지하고 컨테이너에 맞춰서 축소/확대 */\n object-position: center; /* 이미지를 중앙에 배치 */\n }\n\n div[status] {\n flex: 1;\n\n display: flex;\n flex-direction: column;\n }\n\n div[inspection-data] {\n flex: 1;\n\n display: flex;\n gap: 10px;\n }\n\n ox-event-view {\n flex: 1;\n }\n\n div[bottom] {\n flex: 1;\n\n display: flex;\n flex-direction: column;\n overflow: hidden;\n }\n\n ox-grist {\n overflow-y: auto;\n flex: 1;\n }\n `\n ]\n\n private defaultProject = {\n name: '',\n buildingComplex: {\n buildings: []\n }\n }\n\n @state() private gristConfig: any\n @state() buildingLevelId: string = ''\n @state() project: any = { ...this.defaultProject }\n @state() location: string = ''\n @state() building: any = {}\n @state() drawingImage: string = ''\n @state() buildingInspectionSummary: any = {}\n\n @query('ox-grist') private grist!: DataGrist\n @query('ox-event-view') private eventView!: HTMLElement\n\n get context() {\n return {\n title: '검측 관리',\n actions: [\n {\n title: '검측 등록',\n action: this._openCreateInspection.bind(this),\n ...CommonButtonStyles.submit\n },\n {\n title: '삭제',\n action: this._deleteChecklistType.bind(this),\n ...CommonButtonStyles.delete\n }\n ]\n }\n }\n\n render() {\n return html`\n <div header>\n <h2>${this.project.name} ${this.location}</h2>\n </div>\n\n <div body>\n <div top>\n <img drawing src=${this.drawingImage || '/assets/images/img-drawing-default.png'} />\n <div status>\n <h3>${this.location} 검측 현황</h3>\n <div inspection-data>\n <div>\n ${Object.entries(BUILDING_INSPECTION_STATUS).map(\n status => html` <div>${status[1]} ${this.buildingInspectionSummary[status[0].toLowerCase()]}건</div> `\n )}\n </div>\n <ox-event-view mode=${'monthly'}> </ox-event-view>\n </div>\n </div>\n </div>\n\n <div bottom>\n <ox-grist .mode=${'GRID'} .config=${this.gristConfig} .fetchHandler=${this.fetchHandler.bind(this)}> </ox-grist>\n </div>\n </div>\n `\n }\n\n async pageUpdated(changes: any, lifecycle: PageLifecycle) {\n if (this.active) {\n this.buildingLevelId = lifecycle.resourceId || ''\n\n await this.initProject(this.buildingLevelId)\n this.grist.fetch()\n }\n }\n\n async initProject(buildingLevelId: string = '') {\n const response = await client.query({\n query: gql`\n query ProjectByBuildingLevelId($buildingLevelId: String!) {\n projectByBuildingLevelId(buildingLevelId: $buildingLevelId) {\n id\n name\n mainPhoto {\n fullpath\n }\n buildingComplex {\n id\n drawing {\n id\n name\n fullpath\n }\n buildings {\n id\n name\n }\n }\n }\n\n buildingInspectionSummaryOfBuildingLevel(buildingLevelId: $buildingLevelId) {\n wait\n request\n pass\n fail\n }\n }\n `,\n variables: {\n buildingLevelId\n }\n })\n\n if (response.errors) return\n\n this.project = response.data?.projectByBuildingLevelId\n this.buildingInspectionSummary = response.data?.buildingInspectionSummaryOfBuildingLevel\n\n // 캘린더 최소 높이 속성 수정\n this.eventView.style.setProperty('--calendar-monthly-date-min-height', '50px')\n }\n\n async pageInitialized(lifecycle: any) {\n this.gristConfig = {\n columns: [\n { type: 'gutter', gutterName: 'sequence' },\n { type: 'gutter', gutterName: 'row-selector', multiple: true },\n {\n type: 'string',\n name: 'id',\n hidden: true\n },\n {\n type: 'string',\n name: 'location',\n header: '위치',\n width: 150\n },\n {\n type: 'string',\n name: 'constructionType',\n header: '공종',\n width: 120\n },\n {\n type: 'string',\n name: 'inspectionParts',\n header: '검측 부위',\n record: {\n renderer: value => value?.join(', ') || ''\n },\n width: 200\n },\n {\n type: 'string',\n name: 'requestDate',\n header: '검측 요청일',\n width: 120\n },\n {\n type: 'string',\n name: 'status',\n header: '검측 결과',\n record: {\n renderer: value => BUILDING_INSPECTION_STATUS[value]\n },\n width: 120\n },\n {\n type: 'datetime',\n name: '',\n header: '검측 결과 데이터',\n width: 180\n }\n ],\n rows: {\n selectable: {\n multiple: true\n },\n appendable: false,\n handlers: {\n click: (columns, data, column, record, rowIndex) => {\n navigate(`building-inspection-detail-drawing/${record.id}`)\n }\n }\n },\n sorters: [{ name: 'requestDate' }]\n }\n }\n\n async fetchHandler({ page = 1, limit = 100, sortings = [], filters = [] }: FetchOption) {\n if (!this.buildingLevelId) return\n\n const response = await client.query({\n query: gql`\n query BuildingInspectionsOfBuildingLevel($params: BuildingInspectionsOfBuildingLevel!) {\n buildingInspectionsOfBuildingLevel(params: $params) {\n items {\n id\n status\n requestDate\n buildingLevel {\n floor\n building {\n id\n name\n }\n mainDrawing {\n id\n name\n fullpath\n }\n mainDrawingImage\n }\n checklist {\n checklistId: id\n name\n constructionType\n constructionDetailType\n location\n inspectionParts\n }\n }\n total\n }\n }\n `,\n variables: {\n params: {\n buildingLevelId: this.buildingLevelId,\n limit: 0\n }\n }\n })\n\n let items = response.data?.buildingInspectionsOfBuildingLevel?.items || []\n items = items.map(item => ({\n ...item,\n ...item.checklist,\n requestDate: this._formatDate(item.requestDate)\n }))\n\n this.location = items[0]?.checklist?.location || ''\n this.drawingImage = items[0]?.buildingLevel?.mainDrawingImage || ''\n this.building = items[0]?.buildingLevel?.building || {}\n\n return {\n total: response.data?.buildingInspectionsOfBuildingLevel?.total || 0,\n records: items\n }\n }\n\n private async _deleteChecklistType() {\n if (confirm('삭제하시겠습니까?')) {\n const ids = this.grist.selected.map(record => record.id)\n if (ids && ids.length > 0) {\n const response = await client.mutate({\n mutation: gql`\n mutation ($ids: [String!]!) {\n deleteBuildingInspections(ids: $ids)\n }\n `,\n variables: {\n ids\n }\n })\n\n if (!response.errors) {\n this.grist.fetch()\n notify({ message: '삭제되었습니다.' })\n }\n }\n }\n }\n\n private _openCreateInspection() {\n openPopup(\n html`\n <inspection-create-popup\n .projectId=${this.project.id}\n .selectedBuildingId=${this.building.id}\n .selectedBuildingLevelId=${this.buildingLevelId}\n @requestRefresh=\"${() => this.grist.fetch()}\"\n ></inspection-create-popup>\n `,\n {\n backdrop: true,\n size: 'large',\n title: '검측 요청서 등록'\n }\n )\n }\n\n private _formatDate(date: Date | undefined) {\n return date\n ? new Intl.DateTimeFormat('en-CA', {\n timeZone: 'Asia/Seoul',\n year: 'numeric',\n month: '2-digit',\n day: '2-digit'\n }).format(new Date(date))\n : ''\n }\n}\n"]}
1
+ {"version":3,"file":"building-inspection-list.js","sourceRoot":"","sources":["../../../client/pages/building-inspection/building-inspection-list.ts"],"names":[],"mappings":";AAAA,OAAO,4BAA4B,CAAA;AACnC,OAAO,qBAAqB,CAAA;AAE5B,OAAO,EAAE,iBAAiB,EAAE,kBAAkB,EAAE,eAAe,EAAE,MAAM,iBAAiB,CAAA;AACxF,OAAO,EAAE,QAAQ,EAAE,QAAQ,EAAE,MAAM,gBAAgB,CAAA;AACnD,OAAO,EAAE,GAAG,EAAE,IAAI,EAAkB,MAAM,KAAK,CAAA;AAE/C,OAAO,EAAE,aAAa,EAAE,KAAK,EAAE,KAAK,EAAE,MAAM,mBAAmB,CAAA;AAC/D,OAAO,EAAE,mBAAmB,EAAE,MAAM,0BAA0B,CAAA;AAC9D,OAAO,EAAE,SAAS,EAAe,MAAM,qBAAqB,CAAA;AAC5D,OAAO,EAAE,MAAM,EAAE,MAAM,kBAAkB,CAAA;AACzC,OAAO,EAAE,MAAM,EAAE,MAAM,iBAAiB,CAAA;AACxC,OAAO,GAAG,MAAM,aAAa,CAAA;AAC7B,OAAO,EAAE,SAAS,EAAE,MAAM,iB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;+DAA6B;AACrC;IAAC,KAAK,EAAE;;uDAA0C;AAClD;IAAC,KAAK,EAAE;;wDAAsB;AAC9B;IAAC,KAAK,EAAE;;wDAAmB;AAC3B;IAAC,KAAK,EAAE;;4DAA0B;AAClC;IAAC,KAAK,EAAE;;yEAAoC;AAC5C;IAAC,KAAK,EAAE;;4DAA6B;AAErC;IAAC,KAAK,CAAC,UAAU,CAAC;8BAAiB,SAAS;qDAAA;AAC5C;IAAC,KAAK,CAAC,eAAe,CAAC;8BAAqB,WAAW;yDAAA;AAlL5C,sBAAsB;IADlC,aAAa,CAAC,0BAA0B,CAAC;GAC7B,sBAAsB,CAsgBlC;SAtgBY,sBAAsB","sourcesContent":["import '@material/web/icon/icon.js'\nimport '@operato/data-grist'\n\nimport { CommonGristStyles, CommonButtonStyles, ScrollbarStyles } from '@operato/styles'\nimport { PageView, navigate } from '@operato/shell'\nimport { css, html, TemplateResult } from 'lit'\nimport { PageLifecycle } from '@operato/shell/dist/src/app/pages/page-view'\nimport { customElement, query, state } from 'lit/decorators.js'\nimport { ScopedElementsMixin } from '@open-wc/scoped-elements'\nimport { DataGrist, FetchOption } from '@operato/data-grist'\nimport { client } from '@operato/graphql'\nimport { notify } from '@operato/layout'\nimport gql from 'graphql-tag'\nimport { openPopup } from '@operato/layout'\nimport './inspection-create-popup'\nimport '@operato/event-view/ox-event-view.js'\nimport { InspectionEventProvider } from './component/inspection-event-provider'\nimport { EventProvider } from '@operato/event-view'\n\nexport enum ChecklistTypeMainType {\n BASIC = '10',\n NON_BASIC = '20'\n}\nexport const CHECKLIST_MAIN_TYPE_LIST = {\n [ChecklistTypeMainType.BASIC]: '기본 업무',\n [ChecklistTypeMainType.NON_BASIC]: '기본 외 업무'\n}\n\nexport enum BuildingInspectionStatus {\n WAIT = 'WAIT',\n REQUEST = 'REQUEST',\n PASS = 'PASS',\n FAIL = 'FAIL'\n}\nexport const BUILDING_INSPECTION_STATUS = {\n [BuildingInspectionStatus.WAIT]: '검측 대기',\n [BuildingInspectionStatus.REQUEST]: '검측 요청',\n [BuildingInspectionStatus.PASS]: '합격',\n [BuildingInspectionStatus.FAIL]: '불합격'\n}\n\n@customElement('building-inspection-list')\nexport class BuildingInspectionList extends ScopedElementsMixin(PageView) {\n static styles = [\n ScrollbarStyles,\n CommonGristStyles,\n css`\n :host {\n display: grid;\n grid-template-rows: 75px auto;\n color: #4e5055;\n\n width: 100%;\n background-color: #f7f7f7;\n overflow-y: auto;\n\n --grid-record-emphasized-background-color: red;\n --grid-record-emphasized-color: yellow;\n }\n\n md-filled-button {\n --md-filled-button-container-color: #0595e5;\n --md-filled-button-container-height: 30px;\n --md-filled-button-trailing-space: 15px;\n --md-filled-button-leading-space: 15px;\n }\n\n md-outlined-button {\n --md-outlined-button-container-height: 30px;\n --md-outlined-button-trailing-space: 15px;\n --md-outlined-button-leading-space: 15px;\n }\n\n *[bold] {\n font-weight: bold;\n }\n\n div[header] {\n display: flex;\n margin: 0px 20px;\n }\n\n div[header] h2 {\n flex: 0.5;\n color: #3f71a0;\n }\n\n div[body] {\n display: flex;\n flex-direction: column;\n margin: 0px 25px 0px 25px;\n gap: 10px;\n min-height: fit-content;\n }\n\n div[body] h3 {\n color: #2e79be;\n font-size: 18px;\n margin: 0px;\n }\n\n div[body] > div {\n display: flex;\n gap: 10px;\n border-radius: 5px;\n }\n\n div[top] {\n flex: 1;\n\n display: flex;\n background-color: #f7f7f7;\n }\n\n div[drawing] {\n flex: 0.4;\n border: 1px solid #cccccc80;\n background-color: #fff;\n padding: 10px;\n border-radius: 5px;\n\n img {\n width: 100%;\n\n display: block;\n object-fit: contain;\n object-position: center;\n }\n }\n\n div[inspection-container] {\n flex: 0.6;\n gap: 5px;\n\n display: flex;\n flex-direction: column;\n\n div[inspection] {\n display: grid;\n grid-template-columns: 120px 0.9fr 0.9fr 0.9fr 0.9fr;\n margin-top: 5px;\n background: #ebc8321a;\n border-radius: 7px;\n padding: 7px 0px;\n\n & > span {\n display: flex;\n flex-direction: column;\n align-items: center;\n justify-content: center;\n\n div[status='wait'] {\n color: #4e5055;\n }\n div[status='request'] {\n color: #3395f1;\n }\n div[status='pass'] {\n color: #1bb401;\n }\n div[status='fail'] {\n color: #ff4444;\n }\n span[dot] {\n font-size: 1.3em;\n }\n }\n & > span[name] {\n flex-direction: row;\n text-align: right;\n gap: 10px;\n border-right: 2px dotted #ccc;\n\n md-icon {\n width: 40px;\n height: 40px;\n border-radius: 7px;\n color: #fff;\n background: #f16154;\n }\n }\n }\n }\n\n ox-event-view {\n flex: 1;\n }\n\n div[bottom] {\n flex: 1;\n\n display: flex;\n flex-direction: column;\n overflow: hidden;\n }\n\n ox-grist {\n overflow-y: auto;\n flex: 1;\n }\n `\n ]\n\n private defaultProject = {\n name: '',\n buildingComplex: {\n buildings: []\n }\n }\n\n @state() private gristConfig: any\n @state() buildingLevelId: string = ''\n @state() project: any = { ...this.defaultProject }\n @state() location: string = ''\n @state() building: any = {}\n @state() drawingImage: string = ''\n @state() buildingInspectionSummary: any = {}\n @state() calendarData?: EventProvider\n\n @query('ox-grist') private grist!: DataGrist\n @query('ox-event-view') private eventView!: HTMLElement\n\n get context() {\n return {\n title: '검측 관리',\n actions: [\n {\n title: '검측 등록',\n action: this._openCreateInspection.bind(this),\n ...CommonButtonStyles.submit\n },\n {\n title: '삭제',\n action: this._deleteChecklistType.bind(this),\n ...CommonButtonStyles.delete\n }\n ]\n }\n }\n\n render() {\n return html`\n <div header>\n <h2>${this.project.name}</h2>\n </div>\n\n <div body>\n <div top>\n <div drawing>\n <h3>도면: ${this.location}</h3>\n <img src=${this.drawingImage || '/assets/images/img-drawing-default.png'} />\n </div>\n\n <div inspection-container>\n <div inspection>\n <span name bold>\n <md-icon slot=\"icon\">fact_check</md-icon>\n 검측<br />현황\n </span>\n\n ${Object.entries(BUILDING_INSPECTION_STATUS).map(inspectionStatus => {\n const displayName = inspectionStatus[1]\n const status = inspectionStatus[0].toLowerCase()\n\n return html`\n <span>\n <div>${displayName}</div>\n <div bold status=${status}><span dot>●</span> ${this.buildingInspectionSummary[status]}</div>\n </span>\n `\n })}\n </div>\n\n <ox-event-view\n .mode=${'monthly'}\n .eventProvider=${this.calendarData}\n @select-date=${(e: CustomEvent) => {\n console.log('select-date', e.detail)\n }}\n >\n </ox-event-view>\n </div>\n </div>\n\n <div bottom>\n <ox-grist .mode=${'GRID'} .config=${this.gristConfig} .fetchHandler=${this.fetchHandler.bind(this)}> </ox-grist>\n </div>\n </div>\n `\n }\n\n async pageUpdated(changes: any, lifecycle: PageLifecycle) {\n if (this.active) {\n this.buildingLevelId = lifecycle.resourceId || ''\n\n await this.initProject(this.buildingLevelId)\n this.grist.fetch()\n }\n }\n\n async initProject(buildingLevelId: string = '') {\n const response = await client.query({\n query: gql`\n query ProjectByBuildingLevelId($buildingLevelId: String!, $yearMonth: String!) {\n projectByBuildingLevelId(buildingLevelId: $buildingLevelId) {\n id\n name\n mainPhoto {\n fullpath\n }\n buildingComplex {\n id\n drawing {\n id\n name\n fullpath\n }\n buildings {\n id\n name\n }\n }\n }\n\n buildingInspectionSummaryOfBuildingLevel(buildingLevelId: $buildingLevelId) {\n wait\n request\n pass\n fail\n }\n\n buildingInspectionDateSummaryOfLevelAndMonth(buildingLevelId: $buildingLevelId, yearMonth: $yearMonth) {\n requestDate\n wait\n request\n pass\n fail\n }\n }\n `,\n variables: {\n buildingLevelId,\n yearMonth: '2024-10'\n }\n })\n\n if (response.errors) return\n\n this.project = response.data?.projectByBuildingLevelId\n this.buildingInspectionSummary = response.data?.buildingInspectionSummaryOfBuildingLevel\n\n const calendarData = this.getCalendarTemplate(response.data?.buildingInspectionDateSummaryOfLevelAndMonth)\n this.calendarData = new InspectionEventProvider(calendarData)\n\n // 캘린더 최소 높이 속성 수정\n this.eventView.style.setProperty('--calendar-monthly-date-min-height', '50px')\n }\n\n async pageInitialized(lifecycle: any) {\n this.gristConfig = {\n columns: [\n { type: 'gutter', gutterName: 'sequence' },\n { type: 'gutter', gutterName: 'row-selector', multiple: true },\n {\n type: 'string',\n name: 'id',\n hidden: true\n },\n {\n type: 'string',\n name: 'location',\n header: '위치',\n width: 150\n },\n {\n type: 'string',\n name: 'constructionType',\n header: '공종',\n width: 120\n },\n {\n type: 'string',\n name: 'inspectionParts',\n header: '검측 부위',\n record: {\n renderer: value => value?.join(', ') || ''\n },\n width: 200\n },\n {\n type: 'string',\n name: 'requestDate',\n header: '검측 요청일',\n width: 120\n },\n {\n type: 'string',\n name: 'status',\n header: '검측 결과',\n record: {\n renderer: value => BUILDING_INSPECTION_STATUS[value]\n },\n width: 120\n },\n {\n type: 'datetime',\n name: '',\n header: '검측 결과 데이터',\n width: 180\n }\n ],\n rows: {\n selectable: {\n multiple: true\n },\n appendable: false,\n handlers: {\n click: (columns, data, column, record, rowIndex) => {\n navigate(`building-inspection-detail-drawing/${record.id}`)\n }\n }\n },\n sorters: [{ name: 'requestDate' }]\n }\n }\n\n async fetchHandler({ page = 1, limit = 100, sortings = [], filters = [] }: FetchOption) {\n if (!this.buildingLevelId) return\n\n const response = await client.query({\n query: gql`\n query BuildingInspectionsOfBuildingLevel($params: BuildingInspectionsOfBuildingLevel!, $buildingLevelId: String!) {\n buildingInspectionsOfBuildingLevel(params: $params) {\n items {\n id\n status\n requestDate\n checklist {\n checklistId: id\n name\n constructionType\n constructionDetailType\n location\n inspectionParts\n }\n }\n total\n }\n\n buildingLevel(id: $buildingLevelId) {\n id\n floor\n building {\n id\n name\n }\n mainDrawing {\n id\n name\n fullpath\n }\n mainDrawingImage\n }\n }\n `,\n variables: {\n params: {\n buildingLevelId: this.buildingLevelId,\n limit: 0\n },\n buildingLevelId: this.buildingLevelId\n }\n })\n\n let items = response.data?.buildingInspectionsOfBuildingLevel?.items || []\n items = items.map(item => ({\n ...item,\n ...item.checklist,\n requestDate: this._formatDate(item.requestDate)\n }))\n const buildingLevel = response.data?.buildingLevel\n\n this.location = `${buildingLevel.building.name} ${buildingLevel.floor}층` || ''\n this.drawingImage = buildingLevel?.mainDrawingImage || ''\n this.building = buildingLevel?.building || {}\n\n return {\n total: response.data?.buildingInspectionsOfBuildingLevel?.total || 0,\n records: items\n }\n }\n\n private async _deleteChecklistType() {\n if (confirm('삭제하시겠습니까?')) {\n const ids = this.grist.selected.map(record => record.id)\n if (ids && ids.length > 0) {\n const response = await client.mutate({\n mutation: gql`\n mutation ($ids: [String!]!) {\n deleteBuildingInspections(ids: $ids)\n }\n `,\n variables: {\n ids\n }\n })\n\n if (!response.errors) {\n this.grist.fetch()\n notify({ message: '삭제되었습니다.' })\n }\n }\n }\n }\n\n private _openCreateInspection() {\n openPopup(\n html`\n <inspection-create-popup\n .projectId=${this.project.id}\n .selectedBuildingId=${this.building.id}\n .selectedBuildingLevelId=${this.buildingLevelId}\n @requestRefresh=\"${() => this.grist.fetch()}\"\n ></inspection-create-popup>\n `,\n {\n backdrop: true,\n size: 'large',\n title: '검측 요청서 등록'\n }\n )\n }\n\n private _formatDate(date: Date | undefined) {\n return date\n ? new Intl.DateTimeFormat('en-CA', {\n timeZone: 'Asia/Seoul',\n year: 'numeric',\n month: '2-digit',\n day: '2-digit'\n }).format(new Date(date))\n : ''\n }\n\n // 검측 개수가 있는 데이터들만 날짜별로 템플릿 만들기\n private getCalendarTemplate(inspectionData: any[] = []): { [date: string]: TemplateResult } {\n const template = {}\n for (let date of inspectionData) {\n template[date.requestDate] = html`\n <div style=\"display: grid; grid-template-columns: repeat(2, 1fr); padding-inline: 7px;\">\n ${date.wait !== 0 ? html`<div><span style=\"font-size: 1.3em; color: #4e5055\">●</span> ${date.wait}</div>` : ''}\n ${date.request !== 0 ? html`<div><span style=\"font-size: 1.3em; color: #3395f1\">●</span> ${date.request}</div>` : ''}\n ${date.pass !== 0 ? html`<div><span style=\"font-size: 1.3em; color: #1bb401\">●</span> ${date.pass}</div>` : ''}\n ${date.fail !== 0 ? html`<div><span style=\"font-size: 1.3em; color: #ff4444\">●</span> ${date.fail}</div>` : ''}\n </div>\n `\n }\n\n return template\n }\n}\n"]}
@@ -0,0 +1,6 @@
1
+ import { BizEvent, CALENDAR, EventProvider } from '@operato/event-view';
2
+ export declare class InspectionEventProvider implements EventProvider {
3
+ calendarData: {};
4
+ constructor(calendarData?: {});
5
+ fetchEventsForCalendar(calendar: CALENDAR): Map<Date, BizEvent[]>;
6
+ }
@@ -0,0 +1,26 @@
1
+ export class InspectionEventProvider {
2
+ constructor(calendarData = {}) {
3
+ this.calendarData = {};
4
+ this.calendarData = calendarData;
5
+ }
6
+ fetchEventsForCalendar(calendar) {
7
+ const result = new Map();
8
+ calendar.forEach(({ date }) => {
9
+ const formattedDate = date.toISOString().split('T')[0];
10
+ const template = this.calendarData[formattedDate];
11
+ if (!template)
12
+ return;
13
+ result.set(date, [
14
+ {
15
+ due: formattedDate,
16
+ template: template,
17
+ title: '',
18
+ color: '',
19
+ clickEvent: e => console.log('e :', e, template)
20
+ }
21
+ ]);
22
+ });
23
+ return result;
24
+ }
25
+ }
26
+ //# sourceMappingURL=inspection-event-provider.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"inspection-event-provider.js","sourceRoot":"","sources":["../../../../client/pages/building-inspection/component/inspection-event-provider.ts"],"names":[],"mappings":"AAEA,MAAM,OAAO,uBAAuB;IAGlC,YAAY,YAAY,GAAG,EAAE;QAF7B,iBAAY,GAAG,EAAE,CAAA;QAGf,IAAI,CAAC,YAAY,GAAG,YAAY,CAAA;IAClC,CAAC;IAED,sBAAsB,CAAC,QAAkB;QACvC,MAAM,MAAM,GAAG,IAAI,GAAG,EAAoB,CAAA;QAE1C,QAAQ,CAAC,OAAO,CAAC,CAAC,EAAE,IAAI,EAAE,EAAE,EAAE;YAC5B,MAAM,aAAa,GAAG,IAAI,CAAC,WAAW,EAAE,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,CAAA;YACtD,MAAM,QAAQ,GAAG,IAAI,CAAC,YAAY,CAAC,aAAa,CAAC,CAAA;YAEjD,IAAI,CAAC,QAAQ;gBAAE,OAAM;YAErB,MAAM,CAAC,GAAG,CAAC,IAAI,EAAE;gBACf;oBACE,GAAG,EAAE,aAAa;oBAClB,QAAQ,EAAE,QAAQ;oBAClB,KAAK,EAAE,EAAE;oBACT,KAAK,EAAE,EAAE;oBACT,UAAU,EAAE,CAAC,CAAC,EAAE,CAAC,OAAO,CAAC,GAAG,CAAC,KAAK,EAAE,CAAC,EAAE,QAAQ,CAAC;iBACjD;aACF,CAAC,CAAA;QACJ,CAAC,CAAC,CAAA;QAEF,OAAO,MAAM,CAAA;IACf,CAAC;CACF","sourcesContent":["import { BizEvent, CALENDAR, EventProvider } from '@operato/event-view'\n\nexport class InspectionEventProvider implements EventProvider {\n calendarData = {}\n\n constructor(calendarData = {}) {\n this.calendarData = calendarData\n }\n\n fetchEventsForCalendar(calendar: CALENDAR) {\n const result = new Map<Date, BizEvent[]>()\n\n calendar.forEach(({ date }) => {\n const formattedDate = date.toISOString().split('T')[0]\n const template = this.calendarData[formattedDate]\n\n if (!template) return\n\n result.set(date, [\n {\n due: formattedDate,\n template: template,\n title: '',\n color: '',\n clickEvent: e => console.log('e :', e, template)\n }\n ])\n })\n\n return result\n }\n}\n"]}