@dssp/supervision 1.0.0-alpha.66 → 1.0.0-alpha.74
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.
- package/dist-client/pages/building-inspection/building-inspection-detail-ai-defect.js +1 -0
- package/dist-client/pages/building-inspection/building-inspection-detail-ai-defect.js.map +1 -1
- package/dist-client/pages/building-inspection/building-inspection-detail-ai-measurement.js +1 -0
- package/dist-client/pages/building-inspection/building-inspection-detail-ai-measurement.js.map +1 -1
- package/dist-client/pages/building-inspection/building-inspection-detail-camera.js +1 -0
- package/dist-client/pages/building-inspection/building-inspection-detail-camera.js.map +1 -1
- package/dist-client/pages/building-inspection/building-inspection-detail-checklist.d.ts +2 -0
- package/dist-client/pages/building-inspection/building-inspection-detail-checklist.js +16 -0
- package/dist-client/pages/building-inspection/building-inspection-detail-checklist.js.map +1 -1
- package/dist-client/pages/building-inspection/building-inspection-detail-drawing.js +1 -0
- package/dist-client/pages/building-inspection/building-inspection-detail-drawing.js.map +1 -1
- package/dist-client/pages/building-inspection/building-inspection-management.d.ts +72 -0
- package/dist-client/pages/building-inspection/building-inspection-management.js +1256 -0
- package/dist-client/pages/building-inspection/building-inspection-management.js.map +1 -0
- package/dist-client/pages/building-inspection/component/building-inspection-detail-header.js +8 -3
- package/dist-client/pages/building-inspection/component/building-inspection-detail-header.js.map +1 -1
- package/dist-client/pages/building-inspection/component/image-preview-popup.js +0 -3
- package/dist-client/pages/building-inspection/component/image-preview-popup.js.map +1 -1
- package/dist-client/pages/building-inspection/component/inspection-document/inspection-request-document.d.ts +5 -0
- package/dist-client/pages/building-inspection/component/inspection-document/inspection-request-document.js +62 -3
- package/dist-client/pages/building-inspection/component/inspection-document/inspection-request-document.js.map +1 -1
- package/dist-client/pages/building-inspection/component/inspection-document/inspection-result-notification.d.ts +1 -0
- package/dist-client/pages/building-inspection/component/inspection-document/inspection-result-notification.js +8 -2
- package/dist-client/pages/building-inspection/component/inspection-document/inspection-result-notification.js.map +1 -1
- package/dist-client/pages/building-inspection/component/inspection-event-provider.js +3 -1
- package/dist-client/pages/building-inspection/component/inspection-event-provider.js.map +1 -1
- package/dist-client/pages/building-inspection/inspection-with-checklist-create-popup.d.ts +3 -0
- package/dist-client/pages/building-inspection/inspection-with-checklist-create-popup.js +791 -0
- package/dist-client/pages/building-inspection/inspection-with-checklist-create-popup.js.map +1 -0
- package/dist-client/pages/checklist/checklist-view.js +76 -5
- package/dist-client/pages/checklist/checklist-view.js.map +1 -1
- package/dist-client/pages/checklist-database/checklist-database.d.ts +35 -0
- package/dist-client/pages/checklist-database/checklist-database.js +539 -0
- package/dist-client/pages/checklist-database/checklist-database.js.map +1 -0
- package/dist-client/pages/checklist-template/construction-checklist-template-item-popup.d.ts +2 -0
- package/dist-client/pages/checklist-template/construction-checklist-template-item-popup.js +242 -0
- package/dist-client/pages/checklist-template/construction-checklist-template-item-popup.js.map +1 -0
- package/dist-client/pages/checklist-template/construction-checklist-template-list.d.ts +55 -0
- package/dist-client/pages/checklist-template/construction-checklist-template-list.js +409 -0
- package/dist-client/pages/checklist-template/construction-checklist-template-list.js.map +1 -0
- package/dist-client/pages/project-checklist/project-checklist-management.d.ts +50 -0
- package/dist-client/pages/project-checklist/project-checklist-management.js +910 -0
- package/dist-client/pages/project-checklist/project-checklist-management.js.map +1 -0
- package/dist-client/route.d.ts +1 -1
- package/dist-client/route.js +12 -0
- package/dist-client/route.js.map +1 -1
- package/dist-client/tsconfig.tsbuildinfo +1 -1
- package/dist-server/service/action-plan/action-plan-mutation.js +5 -6
- package/dist-server/service/action-plan/action-plan-mutation.js.map +1 -1
- package/dist-server/service/action-plan/action-plan-query.d.ts +2 -2
- package/dist-server/service/action-plan/action-plan-query.js +5 -11
- package/dist-server/service/action-plan/action-plan-query.js.map +1 -1
- package/dist-server/service/building-inspection/building-inspection-mutation.js +3 -3
- package/dist-server/service/building-inspection/building-inspection-mutation.js.map +1 -1
- package/dist-server/service/building-inspection/building-inspection-query.d.ts +2 -2
- package/dist-server/service/building-inspection/building-inspection-query.js +19 -22
- package/dist-server/service/building-inspection/building-inspection-query.js.map +1 -1
- package/dist-server/service/building-inspection/building-inspection-type.d.ts +1 -0
- package/dist-server/service/building-inspection/building-inspection-type.js +4 -0
- package/dist-server/service/building-inspection/building-inspection-type.js.map +1 -1
- package/dist-server/service/building-inspection/building-inspection.js +14 -1
- package/dist-server/service/building-inspection/building-inspection.js.map +1 -1
- package/dist-server/service/checklist-template/checklist-template-query.d.ts +1 -1
- package/dist-server/service/checklist-template/checklist-template-query.js +2 -5
- package/dist-server/service/checklist-template/checklist-template-query.js.map +1 -1
- package/dist-server/service/checklist-type/checklist-type-query.d.ts +1 -1
- package/dist-server/service/checklist-type/checklist-type-query.js +2 -5
- package/dist-server/service/checklist-type/checklist-type-query.js.map +1 -1
- package/dist-server/service/construction-checklist-template/construction-checklist-template-mutation.d.ts +7 -0
- package/dist-server/service/construction-checklist-template/construction-checklist-template-mutation.js +107 -0
- package/dist-server/service/construction-checklist-template/construction-checklist-template-mutation.js.map +1 -0
- package/dist-server/service/construction-checklist-template/construction-checklist-template-query.d.ts +10 -0
- package/dist-server/service/construction-checklist-template/construction-checklist-template-query.js +62 -0
- package/dist-server/service/construction-checklist-template/construction-checklist-template-query.js.map +1 -0
- package/dist-server/service/construction-checklist-template/construction-checklist-template-type.d.ts +11 -0
- package/dist-server/service/construction-checklist-template/construction-checklist-template-type.js +43 -0
- package/dist-server/service/construction-checklist-template/construction-checklist-template-type.js.map +1 -0
- package/dist-server/service/construction-checklist-template/construction-checklist-template.d.ts +18 -0
- package/dist-server/service/construction-checklist-template/construction-checklist-template.js +80 -0
- package/dist-server/service/construction-checklist-template/construction-checklist-template.js.map +1 -0
- package/dist-server/service/construction-checklist-template/index.d.ts +5 -0
- package/dist-server/service/construction-checklist-template/index.js +9 -0
- package/dist-server/service/construction-checklist-template/index.js.map +1 -0
- package/dist-server/service/construction-checklist-template-item/construction-checklist-template-item-mutation.d.ts +6 -0
- package/dist-server/service/construction-checklist-template-item/construction-checklist-template-item-mutation.js +60 -0
- package/dist-server/service/construction-checklist-template-item/construction-checklist-template-item-mutation.js.map +1 -0
- package/dist-server/service/construction-checklist-template-item/construction-checklist-template-item-query.d.ts +9 -0
- package/dist-server/service/construction-checklist-template-item/construction-checklist-template-item-query.js +53 -0
- package/dist-server/service/construction-checklist-template-item/construction-checklist-template-item-query.js.map +1 -0
- package/dist-server/service/construction-checklist-template-item/construction-checklist-template-item-type.d.ts +17 -0
- package/dist-server/service/construction-checklist-template-item/construction-checklist-template-item-type.js +67 -0
- package/dist-server/service/construction-checklist-template-item/construction-checklist-template-item-type.js.map +1 -0
- package/dist-server/service/construction-checklist-template-item/construction-checklist-template-item.d.ts +24 -0
- package/dist-server/service/construction-checklist-template-item/construction-checklist-template-item.js +113 -0
- package/dist-server/service/construction-checklist-template-item/construction-checklist-template-item.js.map +1 -0
- package/dist-server/service/construction-checklist-template-item/index.d.ts +5 -0
- package/dist-server/service/construction-checklist-template-item/index.js +9 -0
- package/dist-server/service/construction-checklist-template-item/index.js.map +1 -0
- package/dist-server/service/construction-checklist-template-item/spec-matching-service.d.ts +2 -0
- package/dist-server/service/construction-checklist-template-item/spec-matching-service.js +50 -0
- package/dist-server/service/construction-checklist-template-item/spec-matching-service.js.map +1 -0
- package/dist-server/service/index.d.ts +5 -1
- package/dist-server/service/index.js +16 -0
- package/dist-server/service/index.js.map +1 -1
- package/dist-server/service/issue/issue-mutation.js +5 -6
- package/dist-server/service/issue/issue-mutation.js.map +1 -1
- package/dist-server/service/issue/issue-query.d.ts +2 -2
- package/dist-server/service/issue/issue-query.js +5 -11
- package/dist-server/service/issue/issue-query.js.map +1 -1
- package/dist-server/service/project-checklist/index.d.ts +5 -0
- package/dist-server/service/project-checklist/index.js +9 -0
- package/dist-server/service/project-checklist/index.js.map +1 -0
- package/dist-server/service/project-checklist/project-checklist-mutation.d.ts +7 -0
- package/dist-server/service/project-checklist/project-checklist-mutation.js +109 -0
- package/dist-server/service/project-checklist/project-checklist-mutation.js.map +1 -0
- package/dist-server/service/project-checklist/project-checklist-query.d.ts +12 -0
- package/dist-server/service/project-checklist/project-checklist-query.js +76 -0
- package/dist-server/service/project-checklist/project-checklist-query.js.map +1 -0
- package/dist-server/service/project-checklist/project-checklist-type.d.ts +18 -0
- package/dist-server/service/project-checklist/project-checklist-type.js +69 -0
- package/dist-server/service/project-checklist/project-checklist-type.js.map +1 -0
- package/dist-server/service/project-checklist/project-checklist.d.ts +20 -0
- package/dist-server/service/project-checklist/project-checklist.js +90 -0
- package/dist-server/service/project-checklist/project-checklist.js.map +1 -0
- package/dist-server/service/project-checklist-item/index.d.ts +4 -0
- package/dist-server/service/project-checklist-item/index.js +9 -0
- package/dist-server/service/project-checklist-item/index.js.map +1 -0
- package/dist-server/service/project-checklist-item/project-checklist-item-mutation.d.ts +2 -0
- package/dist-server/service/project-checklist-item/project-checklist-item-mutation.js +13 -0
- package/dist-server/service/project-checklist-item/project-checklist-item-mutation.js.map +1 -0
- package/dist-server/service/project-checklist-item/project-checklist-item-query.d.ts +5 -0
- package/dist-server/service/project-checklist-item/project-checklist-item-query.js +34 -0
- package/dist-server/service/project-checklist-item/project-checklist-item-query.js.map +1 -0
- package/dist-server/service/project-checklist-item/project-checklist-item-type.d.ts +5 -0
- package/dist-server/service/project-checklist-item/project-checklist-item-type.js +21 -0
- package/dist-server/service/project-checklist-item/project-checklist-item-type.js.map +1 -0
- package/dist-server/service/project-checklist-item/project-checklist-item.d.ts +17 -0
- package/dist-server/service/project-checklist-item/project-checklist-item.js +82 -0
- package/dist-server/service/project-checklist-item/project-checklist-item.js.map +1 -0
- package/dist-server/service/project-report/project-report-mutation.js +5 -6
- package/dist-server/service/project-report/project-report-mutation.js.map +1 -1
- package/dist-server/service/project-report/project-report-query.d.ts +2 -2
- package/dist-server/service/project-report/project-report-query.js +5 -11
- package/dist-server/service/project-report/project-report-query.js.map +1 -1
- package/dist-server/service/supervisor/supervisor-mutation.js +5 -6
- package/dist-server/service/supervisor/supervisor-mutation.js.map +1 -1
- package/dist-server/service/supervisor/supervisor-query.d.ts +2 -2
- package/dist-server/service/supervisor/supervisor-query.js +5 -11
- package/dist-server/service/supervisor/supervisor-query.js.map +1 -1
- package/dist-server/tsconfig.tsbuildinfo +1 -1
- package/package.json +4 -4
- package/things-factory.config.js +7 -1
|
@@ -31,6 +31,7 @@ let BuildingInspectionAiDefect = class BuildingInspectionAiDefect extends PageVi
|
|
|
31
31
|
.projectName=${this.project.name}
|
|
32
32
|
.buildingName=${(_f = (_e = (_d = this.buildingInspection) === null || _d === void 0 ? void 0 : _d.buildingLevel) === null || _e === void 0 ? void 0 : _e.building) === null || _f === void 0 ? void 0 : _f.name}
|
|
33
33
|
.buildingLevelFloor=${(_h = (_g = this.buildingInspection) === null || _g === void 0 ? void 0 : _g.buildingLevel) === null || _h === void 0 ? void 0 : _h.floor}
|
|
34
|
+
.projectId=${this.project.id}
|
|
34
35
|
></building-inspection-detail-header>
|
|
35
36
|
|
|
36
37
|
<div body>
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"building-inspection-detail-ai-defect.js","sourceRoot":"","sources":["../../../client/pages/building-inspection/building-inspection-detail-ai-defect.ts"],"names":[],"mappings":";AAAA,OAAO,4BAA4B,CAAA;AACnC,OAAO,mCAAmC,CAAA;AAC1C,OAAO,wCAAwC,CAAA;AAC/C,OAAO,6CAA6C,CAAA;AAEpD,OAAO,GAAG,MAAM,aAAa,CAAA;AAC7B,OAAO,EAAE,GAAG,EAAE,IAAI,EAAkB,MAAM,KAAK,CAAA;AAC/C,OAAO,EAAE,aAAa,EAAE,KAAK,EAAS,MAAM,mBAAmB,CAAA;AAE/D,OAAO,EAAE,QAAQ,EAAE,MAAM,gBAAgB,CAAA;AACzC,OAAO,EAAE,iBAAiB,EAAE,eAAe,EAAE,MAAM,iBAAiB,CAAA;AAEpE,OAAO,EAAE,MAAM,EAAE,MAAM,kBAAkB,CAAA;AAEzC,OAAO,+CAA+C,CAAA;AAG/C,IAAM,0BAA0B,GAAhC,MAAM,0BAA2B,SAAQ,QAAQ;IAAjD;;QA2CI,YAAO,GAAQ,EAAE,CAAA;QACjB,uBAAkB,GAAQ,EAAE,CAAA;QAC5B,yBAAoB,GAAW,EAAE,CAAA;
|
|
1
|
+
{"version":3,"file":"building-inspection-detail-ai-defect.js","sourceRoot":"","sources":["../../../client/pages/building-inspection/building-inspection-detail-ai-defect.ts"],"names":[],"mappings":";AAAA,OAAO,4BAA4B,CAAA;AACnC,OAAO,mCAAmC,CAAA;AAC1C,OAAO,wCAAwC,CAAA;AAC/C,OAAO,6CAA6C,CAAA;AAEpD,OAAO,GAAG,MAAM,aAAa,CAAA;AAC7B,OAAO,EAAE,GAAG,EAAE,IAAI,EAAkB,MAAM,KAAK,CAAA;AAC/C,OAAO,EAAE,aAAa,EAAE,KAAK,EAAS,MAAM,mBAAmB,CAAA;AAE/D,OAAO,EAAE,QAAQ,EAAE,MAAM,gBAAgB,CAAA;AACzC,OAAO,EAAE,iBAAiB,EAAE,eAAe,EAAE,MAAM,iBAAiB,CAAA;AAEpE,OAAO,EAAE,MAAM,EAAE,MAAM,kBAAkB,CAAA;AAEzC,OAAO,+CAA+C,CAAA;AAG/C,IAAM,0BAA0B,GAAhC,MAAM,0BAA2B,SAAQ,QAAQ;IAAjD;;QA2CI,YAAO,GAAQ,EAAE,CAAA;QACjB,uBAAkB,GAAQ,EAAE,CAAA;QAC5B,yBAAoB,GAAW,EAAE,CAAA;IAqG5C,CAAC;IAnGC,IAAI,OAAO;QACT,OAAO;YACL,KAAK,EAAE,qBAAqB;SAC7B,CAAA;IACH,CAAC;IAED,MAAM;;QACJ,OAAO,IAAI,CAAA;;gCAEiB,MAAA,IAAI,CAAC,kBAAkB,0CAAE,EAAE;2BAChC,MAAA,MAAA,IAAI,CAAC,kBAAkB,0CAAE,aAAa,0CAAE,EAAE;uBAC9C,IAAI,CAAC,OAAO,CAAC,IAAI;wBAChB,MAAA,MAAA,MAAA,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,MAAM;YAAE,OAAM;QAE3B,IAAI,CAAC,OAAO,GAAG,QAAQ,CAAC,IAAI,CAAC,OAAO,CAAA;IACtC,CAAC;;AAhJM,iCAAM,GAAG;IACd,eAAe;IACf,iBAAiB;IACjB,GAAG,CAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;KAoCF;CACF,AAxCY,CAwCZ;AAEQ;IAAR,KAAK,EAAE;;2DAAkB;AACjB;IAAR,KAAK,EAAE;;sEAA6B;AAC5B;IAAR,KAAK,EAAE;;wEAAkC;AA7C/B,0BAA0B;IADtC,aAAa,CAAC,sCAAsC,CAAC;GACzC,0BAA0B,CAkJtC","sourcesContent":["import '@material/web/icon/icon.js'\nimport '@operato/input/ox-input-switch.js'\nimport '@operato/mini-map/ox-zoomable-image.js'\nimport '@material/web/progress/circular-progress.js'\n\nimport gql from 'graphql-tag'\nimport { css, html, PropertyValues } from 'lit'\nimport { customElement, state, query } from 'lit/decorators.js'\n\nimport { PageView } from '@operato/shell'\nimport { CommonGristStyles, ScrollbarStyles } from '@operato/styles'\nimport { PageLifecycle } from '@operato/shell/dist/src/app/pages/page-view'\nimport { client } from '@operato/graphql'\n\nimport './component/building-inspection-detail-header'\n\n@customElement('building-inspection-detail-ai-defect')\nexport class BuildingInspectionAiDefect extends PageView {\n static styles = [\n ScrollbarStyles,\n CommonGristStyles,\n css`\n :host {\n display: grid;\n grid-template-rows: 75px 1fr;\n color: #4e5055;\n width: 100%;\n height: 100%;\n background-color: #f7f7f7;\n }\n\n div[body] {\n display: flex;\n justify-items: center;\n gap: var(--spacing-medium);\n margin: var(--spacing-medium);\n min-height: 0;\n }\n\n div[preview] {\n flex: 1;\n border: 2px solid #ddd;\n border-radius: 10px;\n\n display: flex;\n justify-content: center;\n align-items: center;\n min-height: 0;\n overflow: hidden;\n }\n\n div[preview] video {\n flex: 1;\n max-width: 100%;\n max-height: 100%;\n object-fit: contain;\n }\n `\n ]\n\n @state() project: any = {}\n @state() buildingInspection: any = {}\n @state() buildingInspectionId: string = ''\n\n get context() {\n return {\n title: '검측 관리 상세 - AI 하자 분석'\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 .projectId=${this.project.id}\n ></building-inspection-detail-header>\n\n <div body>\n <div preview>\n <video src=\"/attachment/21e53688-5262-4fae-961a-591db7114b75.mp4\" controls playsinline></video>\n </div>\n </div>\n `\n }\n\n protected async updated(changes: PropertyValues): Promise<void> {}\n\n async pageUpdated(changes: any, lifecycle: PageLifecycle) {\n if (this.active) {\n this.buildingInspectionId = lifecycle.resourceId || ''\n await this.initBuildingInspection(this.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 drawingMarker\n checklist {\n id\n location\n inspectionDrawingType\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"]}
|
|
@@ -102,6 +102,7 @@ let BuildingInspectionAiMeasurement = class BuildingInspectionAiMeasurement exte
|
|
|
102
102
|
.projectName=${this.project.name}
|
|
103
103
|
.buildingName=${(_f = (_e = (_d = this.buildingInspection) === null || _d === void 0 ? void 0 : _d.buildingLevel) === null || _e === void 0 ? void 0 : _e.building) === null || _f === void 0 ? void 0 : _f.name}
|
|
104
104
|
.buildingLevelFloor=${(_h = (_g = this.buildingInspection) === null || _g === void 0 ? void 0 : _g.buildingLevel) === null || _h === void 0 ? void 0 : _h.floor}
|
|
105
|
+
.projectId=${this.project.id}
|
|
105
106
|
></building-inspection-detail-header>
|
|
106
107
|
|
|
107
108
|
<div body>
|
package/dist-client/pages/building-inspection/building-inspection-detail-ai-measurement.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"building-inspection-detail-ai-measurement.js","sourceRoot":"","sources":["../../../client/pages/building-inspection/building-inspection-detail-ai-measurement.ts"],"names":[],"mappings":";AAAA,OAAO,4BAA4B,CAAA;AACnC,OAAO,mCAAmC,CAAA;AAC1C,OAAO,wCAAwC,CAAA;AAC/C,OAAO,6CAA6C,CAAA;AAEpD,OAAO,GAAG,MAAM,aAAa,CAAA;AAC7B,OAAO,EAAE,GAAG,EAAE,IAAI,EAAkB,MAAM,KAAK,CAAA;AAC/C,OAAO,EAAE,aAAa,EAAE,KAAK,EAAE,KAAK,EAAE,MAAM,mBAAmB,CAAA;AAC/D,OAAO,WAAW,MAAM,aAAa,CAAA;AAErC,OAAO,EAAE,QAAQ,EAAE,MAAM,gBAAgB,CAAA;AACzC,OAAO,EAAE,iBAAiB,EAAE,eAAe,EAAE,MAAM,iBAAiB,CAAA;AAEpE,OAAO,EAAE,MAAM,EAAE,MAAM,kBAAkB,CAAA;AACzC,OAAO,EAAE,MAAM,EAAE,MAAM,iBAAiB,CAAA;AAExC,OAAO,+CAA+C,CAAA;AAG/C,IAAM,+BAA+B,GAArC,MAAM,+BAAgC,SAAQ,QAAQ;IAAtD;;QAwTG,gCAA2B,GAAW,yCAAyC,CAAA;QAE9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,KAAK,EAAE;;6EAAkC;AACjC;IAAR,KAAK,EAAE;;yEAAuC;AACtC;IAAR,KAAK,EAAE;;kEAA8B;AAC7B;IAAR,KAAK,EAAE;;8DAAyB;AACxB;IAAR,KAAK,EAAE;;kEAA2B;AAC1B;IAAR,KAAK,EAAE;;uEAKP;AACQ;IAAR,KAAK,EAAE;;0EAA8B;AAC7B;IAAR,KAAK,EAAE;;2EAA+B;AAC9B;IAAR,KAAK,EAAE;;2EAA+F;AAC9F;IAAR,KAAK,EAAE;;iEAA+B;AAC9B;IAAR,KAAK,EAAE;;6DAA2B;AAC1B;IAAR,KAAK,EAAE;;uEAAqC;AAEZ;IAAhC,KAAK,CAAC,gBAAgB,CAAC;8BAAwB,gBAAgB;qEAAA;AAC5B;IAAnC,KAAK,CAAC,mBAAmB,CAAC;8BAA0B,cAAc;uEAAA;AACpC;IAA9B,KAAK,CAAC,cAAc,CAAC;8BAAyB,gBAAgB;sEAAA;AACjC;IAA7B,KAAK,CAAC,aAAa,CAAC;8BAAwB,gBAAgB;qEAAA;AAjVlD,+BAA+B;IAD3C,aAAa,CAAC,2CAA2C,CAAC;GAC9C,+BAA+B,CAsyB3C","sourcesContent":["import '@material/web/icon/icon.js'\nimport '@operato/input/ox-input-switch.js'\nimport '@operato/mini-map/ox-zoomable-image.js'\nimport '@material/web/progress/circular-progress.js'\n\nimport gql from 'graphql-tag'\nimport { css, html, PropertyValues } from 'lit'\nimport { customElement, state, query } from 'lit/decorators.js'\nimport html2canvas from 'html2canvas'\n\nimport { PageView } from '@operato/shell'\nimport { CommonGristStyles, ScrollbarStyles } from '@operato/styles'\nimport { PageLifecycle } from '@operato/shell/dist/src/app/pages/page-view'\nimport { client } from '@operato/graphql'\nimport { notify } from '@operato/layout'\n\nimport './component/building-inspection-detail-header'\n\n@customElement('building-inspection-detail-ai-measurement')\nexport class BuildingInspectionAiMeasurement extends PageView {\n static styles = [\n ScrollbarStyles,\n CommonGristStyles,\n css`\n :host {\n display: grid;\n grid-template-rows: 75px 1fr;\n color: #4e5055;\n width: 100%;\n height: 100%;\n background-color: #f7f7f7;\n }\n\n div[body] {\n display: flex;\n justify-items: center;\n gap: var(--spacing-medium);\n margin: var(--spacing-medium);\n min-height: 0;\n }\n\n div[preview] {\n flex: 1;\n border: 2px solid #ddd;\n border-radius: 10px;\n\n display: flex;\n justify-content: center;\n align-items: center;\n min-height: 0;\n overflow: hidden;\n }\n\n div[preview] img {\n flex: 1;\n max-width: 100%;\n max-height: 100%;\n object-fit: contain;\n }\n\n div[preview] video {\n flex: 1;\n max-width: 100%;\n max-height: 100%;\n object-fit: contain;\n }\n\n div[preview] md-icon {\n --md-icon-size: 160px;\n }\n\n .loading-container {\n display: flex;\n flex-direction: column;\n align-items: center;\n justify-content: center;\n gap: 12px;\n }\n\n .loading-text {\n font-size: 14px;\n color: #666;\n }\n\n .frame-container {\n width: 100%;\n height: 100%;\n max-height: 100%;\n min-height: 0;\n overflow-y: auto;\n display: flex;\n flex-direction: column;\n gap: 12px;\n padding: 12px;\n }\n\n .frames-header {\n display: flex;\n align-items: center;\n justify-content: center;\n gap: 12px;\n font-size: 20px;\n font-weight: 700;\n color: #333;\n text-align: center;\n padding-block: 8px;\n }\n\n .frames-count {\n font-size: 16px;\n color: #777;\n font-weight: 600;\n }\n\n .frames-grid {\n display: grid;\n grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));\n gap: 12px;\n }\n\n .frame-item {\n border: 1px solid #ddd;\n border-radius: 8px;\n overflow: hidden;\n background: #fff;\n cursor: pointer;\n transition:\n box-shadow 0.2s,\n transform 0.1s;\n }\n\n .frame-item:hover {\n box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);\n transform: translateY(-1px);\n }\n\n .frame-item img {\n display: block;\n width: 100%;\n height: 120px;\n object-fit: cover;\n }\n\n .image-wrapper {\n flex: 1;\n display: flex;\n position: relative;\n align-content: center;\n text-align: center;\n }\n\n .point-marker {\n position: absolute;\n width: 14px;\n height: 14px;\n border-radius: 50%;\n border: 2px solid #fff;\n transform: translate(-50%, -50%);\n pointer-events: none;\n box-shadow: 0 0 0 2px rgba(0, 0, 0, 0.25);\n }\n\n .point-1 {\n background-color: #e53935;\n }\n\n .point-2 {\n background-color: #1e88e5;\n }\n\n .line-overlay {\n position: absolute;\n pointer-events: none;\n background-color: #ff9800;\n transform-origin: left center;\n }\n\n .distance-label {\n position: absolute;\n background: rgba(0, 0, 0, 0.7);\n color: #fff;\n font-size: 14px;\n padding: 2px 6px;\n border-radius: 4px;\n transform: translate(-50%, -120%);\n pointer-events: none;\n white-space: nowrap;\n }\n\n div[controls] {\n width: 240px;\n display: flex;\n flex-direction: column;\n justify-content: space-between;\n align-items: center;\n }\n\n div[action-buttons] {\n display: flex;\n flex-direction: row;\n justify-content: space-between;\n gap: 15px;\n }\n\n .switch-container {\n display: flex;\n align-items: center;\n gap: 10px;\n font-size: 24px;\n font-weight: bold;\n }\n\n ox-input-switch {\n --ox-simple-switch-fullwidth: 68px;\n --ox-simple-switch-fullheight: 34px;\n --ox-simple-switch-thumbnail-size: 34px;\n }\n\n .camera-controls {\n display: flex;\n flex-direction: column;\n align-items: center;\n gap: 12px;\n }\n\n .camera-shutter {\n display: flex;\n justify-content: center;\n align-items: center;\n cursor: pointer;\n position: relative;\n }\n\n .controls-title {\n font-size: 18px;\n font-weight: 700;\n color: #333;\n margin-bottom: 8px;\n text-align: center;\n }\n\n .camera-shutter md-icon {\n --md-icon-size: 100px;\n }\n\n .camera-shutter input {\n opacity: 0;\n width: 100%;\n height: 100%;\n position: absolute;\n left: 0;\n top: 0;\n cursor: pointer;\n }\n\n button {\n padding: 10px 20px;\n font-size: 16px;\n border-radius: 5px;\n border: none;\n cursor: pointer;\n }\n\n button.save {\n background-color: #4caf50;\n color: white;\n\n &:disabled {\n background-color: #ccc;\n cursor: default;\n }\n }\n\n button.retry {\n background-color: #f0ad4e;\n color: white;\n }\n\n button.photo {\n background-color: #1e88e5;\n color: white;\n\n &:disabled {\n background-color: #ccc;\n cursor: default;\n }\n }\n\n button.album-button {\n background-color: #9c27b0;\n color: white;\n font-size: 14px;\n padding: 8px 16px;\n border-radius: 5px;\n border: none;\n cursor: pointer;\n\n &:hover {\n background-color: #7b1fa2;\n }\n\n &:disabled {\n background-color: #ccc;\n cursor: default;\n }\n }\n\n .loading-overlay {\n position: fixed;\n top: 0;\n left: 0;\n right: 0;\n bottom: 0;\n background: rgba(0, 0, 0, 0.5);\n display: flex;\n flex-direction: column;\n align-items: center;\n justify-content: center;\n gap: 12px;\n z-index: 2000;\n }\n\n .loading-overlay .loading-container {\n background: white;\n padding: 32px;\n border-radius: 12px;\n box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);\n }\n `\n ]\n\n private KEYPOINT_RULER_API_BASE_URL: string = 'https://hatiolab-korea-uni.ettisoft.com'\n\n @state() project: any = {}\n @state() buildingInspection: any = {}\n @state() buildingInspectionId: string = ''\n @state() capturedVideoUrl: string | null = null\n @state() videoFile: File | null = null\n @state() frame: any | null = null\n @state() analyzing: boolean = false\n @state() selectedPoints: { x1: number | null; y1: number | null; x2: number | null; y2: number | null } = {\n x1: null,\n y1: null,\n x2: null,\n y2: null\n }\n @state() frameNaturalWidth: number = 0\n @state() frameNaturalHeight: number = 0\n @state() displayedImageRect: { width: number; height: number; left: number; top: number } | null = null\n @state() distance: number | null = null\n @state() unit: string | null = null\n @state() analyzingError: string | null = null\n\n @query('img#frameImage') private frameImageEl!: HTMLImageElement\n @query('div.image-wrapper') private imageWrapperEl!: HTMLDivElement\n @query('#cameraInput') private cameraInputEl!: HTMLInputElement\n @query('#albumInput') private albumInputEl!: HTMLInputElement\n\n get context() {\n return {\n title: '검측 관리 상세 - AI 거리 측정'\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 <!-- Preview selected or recorded video -->\n <div preview>\n ${this.frame?.download_url\n ? html`\n <div class=\"image-wrapper\" @click=${this._onImageClick}>\n <img\n id=\"frameImage\"\n src=\"${this.KEYPOINT_RULER_API_BASE_URL + this.frame?.download_url}\"\n crossorigin=\"anonymous\"\n alt=\"frame\"\n loading=\"eager\"\n @load=${this._onImageLoad}\n />\n ${this._renderMarkers()}\n </div>\n `\n : // 동영상 선택 후 동영상 프리뷰\n this.capturedVideoUrl\n ? html`<video src=${this.capturedVideoUrl} controls playsinline></video>`\n : // 초기 상태, 동영상 선택 전\n html`<md-icon>videocam</md-icon>`}\n </div>\n\n <div controls>\n <span class=\"controls-title\">동영상 촬영</span>\n\n <!-- 가운데 버튼 -->\n ${this.frame?.download_url && this._hasTwoPoints() && this.distance && this.unit\n ? // 거리 측정 완료 시, 사진 저장 버튼 표시\n html`<button class=\"save\" ?disabled=${this.analyzing} @click=${this._savePhoto}>사진 저장</button>`\n : // 거리 측정 완료 전, 동영상 촬영 버튼 표시\n html`<div class=\"camera-controls\">\n <div class=\"camera-shutter\">\n <md-icon>camera</md-icon>\n <input id=\"cameraInput\" type=\"file\" accept=\"video/*\" capture=\"environment\" @change=\"${this._onVideoSelected}\" />\n </div>\n <button class=\"album-button\" @click=\"${this._onAlbumButtonClick}\">앨범 선택</button>\n <input id=\"albumInput\" type=\"file\" accept=\"video/*\" @change=\"${this._onVideoSelected}\" style=\"display: none;\" />\n </div>`}\n\n <!-- Action buttons -->\n <div action-buttons>\n ${this.frame\n ? html`\n <button class=\"photo\" ?disabled=${this.analyzing || !this._hasTwoPoints()} @click=${this._onAnalyzePhoto}>\n 사진 분석\n </button>\n `\n : html`\n <button class=\"save\" ?disabled=${this.analyzing || !this.capturedVideoUrl} @click=${this._onAnalyzeVideo}>\n 동영상 분석\n </button>\n `}\n <button class=\"retry\" @click=${this._onRetry}>초기화</button>\n </div>\n </div>\n </div>\n\n <!-- 전체 화면을 덮는 로딩 오버레이 -->\n ${this.analyzing\n ? html`<div class=\"loading-overlay\">\n <div class=\"loading-container\">\n <md-circular-progress indeterminate></md-circular-progress>\n <div class=\"loading-text\">분석 중...</div>\n </div>\n </div>`\n : ''}\n `\n }\n\n protected async updated(changes: PropertyValues): Promise<void> {}\n\n async pageUpdated(changes: any, lifecycle: PageLifecycle) {\n if (this.active) {\n this._onRetry()\n this.buildingInspectionId = lifecycle.resourceId || ''\n await this.initBuildingInspection(this.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 drawingMarker\n checklist {\n id\n location\n inspectionDrawingType\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 _onVideoSelected(event: Event) {\n const input = event.target as HTMLInputElement\n const file = input?.files?.[0]\n if (!file) return\n\n // Only allow video files\n if (!file.type.startsWith('video/')) {\n console.warn('선택된 파일이 동영상이 아닙니다.')\n return\n }\n\n // Revoke old object URL if exists\n if (this.capturedVideoUrl) {\n URL.revokeObjectURL(this.capturedVideoUrl)\n }\n\n this.videoFile = file\n this.capturedVideoUrl = URL.createObjectURL(file)\n }\n\n private _onAlbumButtonClick() {\n // 앨범 선택을 위해 숨겨진 input을 클릭\n this.albumInputEl?.click()\n }\n\n private async _onAnalyzeVideo() {\n if (!this.videoFile) {\n console.warn('선택된 동영상이 없습니다.')\n return\n }\n\n try {\n this.analyzing = true\n const form = new FormData()\n form.append('files', this.videoFile, this.videoFile.name)\n const response = await fetch(`${this.KEYPOINT_RULER_API_BASE_URL}/api/run/keypoint-ruler`, {\n method: 'POST',\n headers: { Authorization: `Basic ${btoa('admin:admin1234')}` },\n body: form\n })\n\n const data = await response.json()\n\n this.frame = {\n file_id: data?.result?.output_files[0]?.file_id,\n download_url: data?.result?.output_files[0]?.download_url,\n file_path: data?.result?.frames[0]?.file_path,\n calibration: data?.result?.calibration\n }\n } catch (error) {\n console.error('동영상 업로드 실패:', error)\n } finally {\n this.analyzing = false\n }\n }\n\n private _onRetry() {\n // Clear current selection and reopen camera\n if (this.capturedVideoUrl) {\n URL.revokeObjectURL(this.capturedVideoUrl)\n }\n this.capturedVideoUrl = null\n this.videoFile = null\n this.frame = null\n this.selectedPoints = { x1: null, y1: null, x2: null, y2: null }\n this.displayedImageRect = null\n this.frameNaturalWidth = 0\n this.frameNaturalHeight = 0\n this.cameraInputEl.value = ''\n this.albumInputEl.value = ''\n this.distance = null\n this.unit = null\n this.analyzingError = null\n }\n\n private _onImageLoad = () => {\n if (!this.frameImageEl || !this.imageWrapperEl) return\n const img = this.frameImageEl\n const wrapperRect = this.imageWrapperEl.getBoundingClientRect()\n const imgRect = img.getBoundingClientRect()\n this.frameNaturalWidth = img.naturalWidth\n this.frameNaturalHeight = img.naturalHeight\n this.displayedImageRect = {\n width: imgRect.width,\n height: imgRect.height,\n left: imgRect.left - wrapperRect.left,\n top: imgRect.top - wrapperRect.top\n }\n }\n\n private _onImageClick = (event: MouseEvent) => {\n if (!this.frameImageEl || !this.imageWrapperEl) return\n const imgRect = this.frameImageEl.getBoundingClientRect()\n const wrapperRect = this.imageWrapperEl.getBoundingClientRect()\n const clientX = event.clientX\n const clientY = event.clientY\n\n // Ignore clicks outside the displayed image area\n if (clientX < imgRect.left || clientX > imgRect.right || clientY < imgRect.top || clientY > imgRect.bottom) {\n return\n }\n\n // 새로운 마크 입력 시 이전 거리/단위 결과 초기화\n this.distance = null\n this.unit = null\n this.analyzingError = null\n\n const relativeX = clientX - imgRect.left\n const relativeY = clientY - imgRect.top\n\n const xOnNatural = Math.round((relativeX * this.frameNaturalWidth) / imgRect.width)\n const yOnNatural = Math.round((relativeY * this.frameNaturalHeight) / imgRect.height)\n\n if (this.selectedPoints.x1 === null || this.selectedPoints.y1 === null) {\n this.selectedPoints = { ...this.selectedPoints, x1: xOnNatural, y1: yOnNatural }\n } else if (this.selectedPoints.x2 === null || this.selectedPoints.y2 === null) {\n this.selectedPoints = { ...this.selectedPoints, x2: xOnNatural, y2: yOnNatural }\n } else {\n // 세 번째 클릭부터는 초기화 후 첫 점으로 설정\n this.selectedPoints = { x1: xOnNatural, y1: yOnNatural, x2: null, y2: null }\n }\n\n // Update displayed rect cache (in case layout changed)\n this.displayedImageRect = {\n width: imgRect.width,\n height: imgRect.height,\n left: imgRect.left - wrapperRect.left,\n top: imgRect.top - wrapperRect.top\n }\n }\n\n private _hasTwoPoints(): boolean {\n const { x1, y1, x2, y2 } = this.selectedPoints\n return x1 !== null && y1 !== null && x2 !== null && y2 !== null\n }\n\n private _renderMarkers() {\n if (!this.displayedImageRect) return html``\n const { left, top, width, height } = this.displayedImageRect\n const { x1, y1, x2, y2 } = this.selectedPoints\n const toDisplay = (x: number, y: number) => {\n const dx = left + (x * width) / (this.frameNaturalWidth || 1)\n const dy = top + (y * height) / (this.frameNaturalHeight || 1)\n return { dx, dy }\n }\n\n return html`\n <!-- 첫 번째 점 -->\n ${x1 !== null && y1 !== null\n ? (() => {\n const p = toDisplay(x1, y1)\n return html`<div class=\"point-marker point-1\" style=\"left:${p.dx}px; top:${p.dy}px;\"></div>`\n })()\n : ''}\n <!-- 두 번째 점 -->\n ${x2 !== null && y2 !== null\n ? (() => {\n const p = toDisplay(x2, y2)\n return html`<div class=\"point-marker point-2\" style=\"left:${p.dx}px; top:${p.dy}px;\"></div>`\n })()\n : ''}\n <!-- 두점 사이 선 -->\n ${this._hasTwoPoints()\n ? (() => {\n const p1 = toDisplay(x1 as number, y1 as number)\n const p2 = toDisplay(x2 as number, y2 as number)\n const cx = (p1.dx + p2.dx) / 2\n const cy = (p1.dy + p2.dy) / 2\n\n // 선의 길이와 각도 계산\n const length = Math.sqrt(Math.pow(p2.dx - p1.dx, 2) + Math.pow(p2.dy - p1.dy, 2))\n const angle = Math.atan2(p2.dy - p1.dy, p2.dx - p1.dx) * (180 / Math.PI)\n\n return html`\n <!-- DIV로 그린 선 -->\n <div\n class=\"line-overlay\"\n style=\"\n left: ${p1.dx}px; \n top: ${p1.dy}px; \n width: ${length}px; \n height: 3px;\n transform: rotate(${angle}deg);\n \"\n ></div>\n <!-- 거리 라벨 -->\n ${this.analyzingError\n ? html`<div class=\"distance-label\" style=\"left:${cx}px; top:${cy}px;\">${this.analyzingError}</div>`\n : this.distance && this.unit\n ? html`<div class=\"distance-label\" style=\"left:${cx}px; top:${cy}px;\">${this.distance} ${this.unit}</div>`\n : ''}\n `\n })()\n : ''}\n `\n }\n\n private async _onAnalyzePhoto() {\n if (!this.frame) {\n console.warn('분석할 사진이 없습니다.')\n return\n }\n if (!this._hasTwoPoints()) {\n console.warn('두 점을 먼저 선택해 주세요.')\n return\n }\n\n try {\n this.analyzing = true\n const payload = {\n x1: this.selectedPoints.x1,\n y1: this.selectedPoints.y1,\n x2: this.selectedPoints.x2,\n y2: this.selectedPoints.y2,\n file_path: this.frame.file_path,\n calibration: this.frame.calibration\n }\n\n const form = new FormData()\n form.append('input', JSON.stringify(payload))\n const response = await fetch(`${this.KEYPOINT_RULER_API_BASE_URL}/api/run/keypoint-ruler`, {\n method: 'POST',\n headers: { Authorization: `Basic ${btoa('admin:admin1234')}` },\n body: form\n })\n\n const result = await response.json()\n const { distance, unit, error } = result.result || {}\n this.distance = distance\n this.unit = unit\n this.analyzingError = error\n } catch (error) {\n console.error('사진 분석 실패:', error)\n } finally {\n this.analyzing = false\n }\n }\n\n async _savePhoto() {\n if (!this.frame || !this._hasTwoPoints() || this.distance === null || !this.unit) {\n notify({ message: '분석 완료 후 저장할 수 있습니다.', level: 'warn' })\n return\n }\n\n const checklistId = this.buildingInspection?.checklist?.id\n let file: File\n try {\n file = await this.getCurrentImage()\n } catch (e) {\n notify({ message: '이미지 합성에 실패했습니다.', level: 'error' })\n return\n }\n\n const response = await client.mutate({\n mutation: gql`\n mutation ($attachments: [NewAttachment!]!) {\n createAttachments(attachments: $attachments) {\n id\n }\n }\n `,\n variables: {\n attachments: [{ file, refBy: checklistId, refType: 'Checklist', description: this.buildingInspection?.status }]\n },\n context: { hasUpload: true }\n })\n\n if (!response.errors) {\n notify({ message: '사진 대지를 저장하였습니다.', level: 'info' })\n return\n }\n\n return response.data.createAttachments\n }\n\n async getCurrentImage(): Promise<File> {\n if (!this.imageWrapperEl) {\n throw new Error('이미지 영역을 찾을 수 없습니다.')\n }\n\n try {\n // html2canvas로 .image-wrapper 영역 캡처\n const canvas = await html2canvas(this.imageWrapperEl, {\n backgroundColor: null, // 투명 배경\n scale: 1, // 1:1 스케일\n useCORS: true, // CORS 이미지 허용\n allowTaint: false, // 보안상 false\n logging: false // 로그 비활성화\n })\n\n // 캔버스를 Blob으로 변환\n const blob: Blob = await new Promise(resolve => {\n canvas.toBlob(resolve as any, 'image/png', 1.0)\n })\n\n // File 객체로 변환하여 반환\n return new File([blob!], `inspection_${Date.now()}.png`, {\n type: 'image/png'\n })\n } catch (error) {\n console.error('html2canvas 캡처 실패:', error)\n throw new Error('화면 캡처에 실패했습니다.')\n }\n }\n}\n"]}
|
|
1
|
+
{"version":3,"file":"building-inspection-detail-ai-measurement.js","sourceRoot":"","sources":["../../../client/pages/building-inspection/building-inspection-detail-ai-measurement.ts"],"names":[],"mappings":";AAAA,OAAO,4BAA4B,CAAA;AACnC,OAAO,mC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C;8BAAyB,gBAAgB;sEAAA;AACjC;IAA7B,KAAK,CAAC,aAAa,CAAC;8BAAwB,gBAAgB;qEAAA;AAjVlD,+BAA+B;IAD3C,aAAa,CAAC,2CAA2C,CAAC;GAC9C,+BAA+B,CAuyB3C","sourcesContent":["import '@material/web/icon/icon.js'\nimport '@operato/input/ox-input-switch.js'\nimport '@operato/mini-map/ox-zoomable-image.js'\nimport '@material/web/progress/circular-progress.js'\n\nimport gql from 'graphql-tag'\nimport { css, html, PropertyValues } from 'lit'\nimport { customElement, state, query } from 'lit/decorators.js'\nimport html2canvas from 'html2canvas'\n\nimport { PageView } from '@operato/shell'\nimport { CommonGristStyles, ScrollbarStyles } from '@operato/styles'\nimport { PageLifecycle } from '@operato/shell/dist/src/app/pages/page-view'\nimport { client } from '@operato/graphql'\nimport { notify } from '@operato/layout'\n\nimport './component/building-inspection-detail-header'\n\n@customElement('building-inspection-detail-ai-measurement')\nexport class BuildingInspectionAiMeasurement extends PageView {\n static styles = [\n ScrollbarStyles,\n CommonGristStyles,\n css`\n :host {\n display: grid;\n grid-template-rows: 75px 1fr;\n color: #4e5055;\n width: 100%;\n height: 100%;\n background-color: #f7f7f7;\n }\n\n div[body] {\n display: flex;\n justify-items: center;\n gap: var(--spacing-medium);\n margin: var(--spacing-medium);\n min-height: 0;\n }\n\n div[preview] {\n flex: 1;\n border: 2px solid #ddd;\n border-radius: 10px;\n\n display: flex;\n justify-content: center;\n align-items: center;\n min-height: 0;\n overflow: hidden;\n }\n\n div[preview] img {\n flex: 1;\n max-width: 100%;\n max-height: 100%;\n object-fit: contain;\n }\n\n div[preview] video {\n flex: 1;\n max-width: 100%;\n max-height: 100%;\n object-fit: contain;\n }\n\n div[preview] md-icon {\n --md-icon-size: 160px;\n }\n\n .loading-container {\n display: flex;\n flex-direction: column;\n align-items: center;\n justify-content: center;\n gap: 12px;\n }\n\n .loading-text {\n font-size: 14px;\n color: #666;\n }\n\n .frame-container {\n width: 100%;\n height: 100%;\n max-height: 100%;\n min-height: 0;\n overflow-y: auto;\n display: flex;\n flex-direction: column;\n gap: 12px;\n padding: 12px;\n }\n\n .frames-header {\n display: flex;\n align-items: center;\n justify-content: center;\n gap: 12px;\n font-size: 20px;\n font-weight: 700;\n color: #333;\n text-align: center;\n padding-block: 8px;\n }\n\n .frames-count {\n font-size: 16px;\n color: #777;\n font-weight: 600;\n }\n\n .frames-grid {\n display: grid;\n grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));\n gap: 12px;\n }\n\n .frame-item {\n border: 1px solid #ddd;\n border-radius: 8px;\n overflow: hidden;\n background: #fff;\n cursor: pointer;\n transition:\n box-shadow 0.2s,\n transform 0.1s;\n }\n\n .frame-item:hover {\n box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);\n transform: translateY(-1px);\n }\n\n .frame-item img {\n display: block;\n width: 100%;\n height: 120px;\n object-fit: cover;\n }\n\n .image-wrapper {\n flex: 1;\n display: flex;\n position: relative;\n align-content: center;\n text-align: center;\n }\n\n .point-marker {\n position: absolute;\n width: 14px;\n height: 14px;\n border-radius: 50%;\n border: 2px solid #fff;\n transform: translate(-50%, -50%);\n pointer-events: none;\n box-shadow: 0 0 0 2px rgba(0, 0, 0, 0.25);\n }\n\n .point-1 {\n background-color: #e53935;\n }\n\n .point-2 {\n background-color: #1e88e5;\n }\n\n .line-overlay {\n position: absolute;\n pointer-events: none;\n background-color: #ff9800;\n transform-origin: left center;\n }\n\n .distance-label {\n position: absolute;\n background: rgba(0, 0, 0, 0.7);\n color: #fff;\n font-size: 14px;\n padding: 2px 6px;\n border-radius: 4px;\n transform: translate(-50%, -120%);\n pointer-events: none;\n white-space: nowrap;\n }\n\n div[controls] {\n width: 240px;\n display: flex;\n flex-direction: column;\n justify-content: space-between;\n align-items: center;\n }\n\n div[action-buttons] {\n display: flex;\n flex-direction: row;\n justify-content: space-between;\n gap: 15px;\n }\n\n .switch-container {\n display: flex;\n align-items: center;\n gap: 10px;\n font-size: 24px;\n font-weight: bold;\n }\n\n ox-input-switch {\n --ox-simple-switch-fullwidth: 68px;\n --ox-simple-switch-fullheight: 34px;\n --ox-simple-switch-thumbnail-size: 34px;\n }\n\n .camera-controls {\n display: flex;\n flex-direction: column;\n align-items: center;\n gap: 12px;\n }\n\n .camera-shutter {\n display: flex;\n justify-content: center;\n align-items: center;\n cursor: pointer;\n position: relative;\n }\n\n .controls-title {\n font-size: 18px;\n font-weight: 700;\n color: #333;\n margin-bottom: 8px;\n text-align: center;\n }\n\n .camera-shutter md-icon {\n --md-icon-size: 100px;\n }\n\n .camera-shutter input {\n opacity: 0;\n width: 100%;\n height: 100%;\n position: absolute;\n left: 0;\n top: 0;\n cursor: pointer;\n }\n\n button {\n padding: 10px 20px;\n font-size: 16px;\n border-radius: 5px;\n border: none;\n cursor: pointer;\n }\n\n button.save {\n background-color: #4caf50;\n color: white;\n\n &:disabled {\n background-color: #ccc;\n cursor: default;\n }\n }\n\n button.retry {\n background-color: #f0ad4e;\n color: white;\n }\n\n button.photo {\n background-color: #1e88e5;\n color: white;\n\n &:disabled {\n background-color: #ccc;\n cursor: default;\n }\n }\n\n button.album-button {\n background-color: #9c27b0;\n color: white;\n font-size: 14px;\n padding: 8px 16px;\n border-radius: 5px;\n border: none;\n cursor: pointer;\n\n &:hover {\n background-color: #7b1fa2;\n }\n\n &:disabled {\n background-color: #ccc;\n cursor: default;\n }\n }\n\n .loading-overlay {\n position: fixed;\n top: 0;\n left: 0;\n right: 0;\n bottom: 0;\n background: rgba(0, 0, 0, 0.5);\n display: flex;\n flex-direction: column;\n align-items: center;\n justify-content: center;\n gap: 12px;\n z-index: 2000;\n }\n\n .loading-overlay .loading-container {\n background: white;\n padding: 32px;\n border-radius: 12px;\n box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);\n }\n `\n ]\n\n private KEYPOINT_RULER_API_BASE_URL: string = 'https://hatiolab-korea-uni.ettisoft.com'\n\n @state() project: any = {}\n @state() buildingInspection: any = {}\n @state() buildingInspectionId: string = ''\n @state() capturedVideoUrl: string | null = null\n @state() videoFile: File | null = null\n @state() frame: any | null = null\n @state() analyzing: boolean = false\n @state() selectedPoints: { x1: number | null; y1: number | null; x2: number | null; y2: number | null } = {\n x1: null,\n y1: null,\n x2: null,\n y2: null\n }\n @state() frameNaturalWidth: number = 0\n @state() frameNaturalHeight: number = 0\n @state() displayedImageRect: { width: number; height: number; left: number; top: number } | null = null\n @state() distance: number | null = null\n @state() unit: string | null = null\n @state() analyzingError: string | null = null\n\n @query('img#frameImage') private frameImageEl!: HTMLImageElement\n @query('div.image-wrapper') private imageWrapperEl!: HTMLDivElement\n @query('#cameraInput') private cameraInputEl!: HTMLInputElement\n @query('#albumInput') private albumInputEl!: HTMLInputElement\n\n get context() {\n return {\n title: '검측 관리 상세 - AI 거리 측정'\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 .projectId=${this.project.id}\n ></building-inspection-detail-header>\n\n <div body>\n <!-- Preview selected or recorded video -->\n <div preview>\n ${this.frame?.download_url\n ? html`\n <div class=\"image-wrapper\" @click=${this._onImageClick}>\n <img\n id=\"frameImage\"\n src=\"${this.KEYPOINT_RULER_API_BASE_URL + this.frame?.download_url}\"\n crossorigin=\"anonymous\"\n alt=\"frame\"\n loading=\"eager\"\n @load=${this._onImageLoad}\n />\n ${this._renderMarkers()}\n </div>\n `\n : // 동영상 선택 후 동영상 프리뷰\n this.capturedVideoUrl\n ? html`<video src=${this.capturedVideoUrl} controls playsinline></video>`\n : // 초기 상태, 동영상 선택 전\n html`<md-icon>videocam</md-icon>`}\n </div>\n\n <div controls>\n <span class=\"controls-title\">동영상 촬영</span>\n\n <!-- 가운데 버튼 -->\n ${this.frame?.download_url && this._hasTwoPoints() && this.distance && this.unit\n ? // 거리 측정 완료 시, 사진 저장 버튼 표시\n html`<button class=\"save\" ?disabled=${this.analyzing} @click=${this._savePhoto}>사진 저장</button>`\n : // 거리 측정 완료 전, 동영상 촬영 버튼 표시\n html`<div class=\"camera-controls\">\n <div class=\"camera-shutter\">\n <md-icon>camera</md-icon>\n <input id=\"cameraInput\" type=\"file\" accept=\"video/*\" capture=\"environment\" @change=\"${this._onVideoSelected}\" />\n </div>\n <button class=\"album-button\" @click=\"${this._onAlbumButtonClick}\">앨범 선택</button>\n <input id=\"albumInput\" type=\"file\" accept=\"video/*\" @change=\"${this._onVideoSelected}\" style=\"display: none;\" />\n </div>`}\n\n <!-- Action buttons -->\n <div action-buttons>\n ${this.frame\n ? html`\n <button class=\"photo\" ?disabled=${this.analyzing || !this._hasTwoPoints()} @click=${this._onAnalyzePhoto}>\n 사진 분석\n </button>\n `\n : html`\n <button class=\"save\" ?disabled=${this.analyzing || !this.capturedVideoUrl} @click=${this._onAnalyzeVideo}>\n 동영상 분석\n </button>\n `}\n <button class=\"retry\" @click=${this._onRetry}>초기화</button>\n </div>\n </div>\n </div>\n\n <!-- 전체 화면을 덮는 로딩 오버레이 -->\n ${this.analyzing\n ? html`<div class=\"loading-overlay\">\n <div class=\"loading-container\">\n <md-circular-progress indeterminate></md-circular-progress>\n <div class=\"loading-text\">분석 중...</div>\n </div>\n </div>`\n : ''}\n `\n }\n\n protected async updated(changes: PropertyValues): Promise<void> {}\n\n async pageUpdated(changes: any, lifecycle: PageLifecycle) {\n if (this.active) {\n this._onRetry()\n this.buildingInspectionId = lifecycle.resourceId || ''\n await this.initBuildingInspection(this.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 drawingMarker\n checklist {\n id\n location\n inspectionDrawingType\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 _onVideoSelected(event: Event) {\n const input = event.target as HTMLInputElement\n const file = input?.files?.[0]\n if (!file) return\n\n // Only allow video files\n if (!file.type.startsWith('video/')) {\n console.warn('선택된 파일이 동영상이 아닙니다.')\n return\n }\n\n // Revoke old object URL if exists\n if (this.capturedVideoUrl) {\n URL.revokeObjectURL(this.capturedVideoUrl)\n }\n\n this.videoFile = file\n this.capturedVideoUrl = URL.createObjectURL(file)\n }\n\n private _onAlbumButtonClick() {\n // 앨범 선택을 위해 숨겨진 input을 클릭\n this.albumInputEl?.click()\n }\n\n private async _onAnalyzeVideo() {\n if (!this.videoFile) {\n console.warn('선택된 동영상이 없습니다.')\n return\n }\n\n try {\n this.analyzing = true\n const form = new FormData()\n form.append('files', this.videoFile, this.videoFile.name)\n const response = await fetch(`${this.KEYPOINT_RULER_API_BASE_URL}/api/run/keypoint-ruler`, {\n method: 'POST',\n headers: { Authorization: `Basic ${btoa('admin:admin1234')}` },\n body: form\n })\n\n const data = await response.json()\n\n this.frame = {\n file_id: data?.result?.output_files[0]?.file_id,\n download_url: data?.result?.output_files[0]?.download_url,\n file_path: data?.result?.frames[0]?.file_path,\n calibration: data?.result?.calibration\n }\n } catch (error) {\n console.error('동영상 업로드 실패:', error)\n } finally {\n this.analyzing = false\n }\n }\n\n private _onRetry() {\n // Clear current selection and reopen camera\n if (this.capturedVideoUrl) {\n URL.revokeObjectURL(this.capturedVideoUrl)\n }\n this.capturedVideoUrl = null\n this.videoFile = null\n this.frame = null\n this.selectedPoints = { x1: null, y1: null, x2: null, y2: null }\n this.displayedImageRect = null\n this.frameNaturalWidth = 0\n this.frameNaturalHeight = 0\n this.cameraInputEl.value = ''\n this.albumInputEl.value = ''\n this.distance = null\n this.unit = null\n this.analyzingError = null\n }\n\n private _onImageLoad = () => {\n if (!this.frameImageEl || !this.imageWrapperEl) return\n const img = this.frameImageEl\n const wrapperRect = this.imageWrapperEl.getBoundingClientRect()\n const imgRect = img.getBoundingClientRect()\n this.frameNaturalWidth = img.naturalWidth\n this.frameNaturalHeight = img.naturalHeight\n this.displayedImageRect = {\n width: imgRect.width,\n height: imgRect.height,\n left: imgRect.left - wrapperRect.left,\n top: imgRect.top - wrapperRect.top\n }\n }\n\n private _onImageClick = (event: MouseEvent) => {\n if (!this.frameImageEl || !this.imageWrapperEl) return\n const imgRect = this.frameImageEl.getBoundingClientRect()\n const wrapperRect = this.imageWrapperEl.getBoundingClientRect()\n const clientX = event.clientX\n const clientY = event.clientY\n\n // Ignore clicks outside the displayed image area\n if (clientX < imgRect.left || clientX > imgRect.right || clientY < imgRect.top || clientY > imgRect.bottom) {\n return\n }\n\n // 새로운 마크 입력 시 이전 거리/단위 결과 초기화\n this.distance = null\n this.unit = null\n this.analyzingError = null\n\n const relativeX = clientX - imgRect.left\n const relativeY = clientY - imgRect.top\n\n const xOnNatural = Math.round((relativeX * this.frameNaturalWidth) / imgRect.width)\n const yOnNatural = Math.round((relativeY * this.frameNaturalHeight) / imgRect.height)\n\n if (this.selectedPoints.x1 === null || this.selectedPoints.y1 === null) {\n this.selectedPoints = { ...this.selectedPoints, x1: xOnNatural, y1: yOnNatural }\n } else if (this.selectedPoints.x2 === null || this.selectedPoints.y2 === null) {\n this.selectedPoints = { ...this.selectedPoints, x2: xOnNatural, y2: yOnNatural }\n } else {\n // 세 번째 클릭부터는 초기화 후 첫 점으로 설정\n this.selectedPoints = { x1: xOnNatural, y1: yOnNatural, x2: null, y2: null }\n }\n\n // Update displayed rect cache (in case layout changed)\n this.displayedImageRect = {\n width: imgRect.width,\n height: imgRect.height,\n left: imgRect.left - wrapperRect.left,\n top: imgRect.top - wrapperRect.top\n }\n }\n\n private _hasTwoPoints(): boolean {\n const { x1, y1, x2, y2 } = this.selectedPoints\n return x1 !== null && y1 !== null && x2 !== null && y2 !== null\n }\n\n private _renderMarkers() {\n if (!this.displayedImageRect) return html``\n const { left, top, width, height } = this.displayedImageRect\n const { x1, y1, x2, y2 } = this.selectedPoints\n const toDisplay = (x: number, y: number) => {\n const dx = left + (x * width) / (this.frameNaturalWidth || 1)\n const dy = top + (y * height) / (this.frameNaturalHeight || 1)\n return { dx, dy }\n }\n\n return html`\n <!-- 첫 번째 점 -->\n ${x1 !== null && y1 !== null\n ? (() => {\n const p = toDisplay(x1, y1)\n return html`<div class=\"point-marker point-1\" style=\"left:${p.dx}px; top:${p.dy}px;\"></div>`\n })()\n : ''}\n <!-- 두 번째 점 -->\n ${x2 !== null && y2 !== null\n ? (() => {\n const p = toDisplay(x2, y2)\n return html`<div class=\"point-marker point-2\" style=\"left:${p.dx}px; top:${p.dy}px;\"></div>`\n })()\n : ''}\n <!-- 두점 사이 선 -->\n ${this._hasTwoPoints()\n ? (() => {\n const p1 = toDisplay(x1 as number, y1 as number)\n const p2 = toDisplay(x2 as number, y2 as number)\n const cx = (p1.dx + p2.dx) / 2\n const cy = (p1.dy + p2.dy) / 2\n\n // 선의 길이와 각도 계산\n const length = Math.sqrt(Math.pow(p2.dx - p1.dx, 2) + Math.pow(p2.dy - p1.dy, 2))\n const angle = Math.atan2(p2.dy - p1.dy, p2.dx - p1.dx) * (180 / Math.PI)\n\n return html`\n <!-- DIV로 그린 선 -->\n <div\n class=\"line-overlay\"\n style=\"\n left: ${p1.dx}px; \n top: ${p1.dy}px; \n width: ${length}px; \n height: 3px;\n transform: rotate(${angle}deg);\n \"\n ></div>\n <!-- 거리 라벨 -->\n ${this.analyzingError\n ? html`<div class=\"distance-label\" style=\"left:${cx}px; top:${cy}px;\">${this.analyzingError}</div>`\n : this.distance && this.unit\n ? html`<div class=\"distance-label\" style=\"left:${cx}px; top:${cy}px;\">${this.distance} ${this.unit}</div>`\n : ''}\n `\n })()\n : ''}\n `\n }\n\n private async _onAnalyzePhoto() {\n if (!this.frame) {\n console.warn('분석할 사진이 없습니다.')\n return\n }\n if (!this._hasTwoPoints()) {\n console.warn('두 점을 먼저 선택해 주세요.')\n return\n }\n\n try {\n this.analyzing = true\n const payload = {\n x1: this.selectedPoints.x1,\n y1: this.selectedPoints.y1,\n x2: this.selectedPoints.x2,\n y2: this.selectedPoints.y2,\n file_path: this.frame.file_path,\n calibration: this.frame.calibration\n }\n\n const form = new FormData()\n form.append('input', JSON.stringify(payload))\n const response = await fetch(`${this.KEYPOINT_RULER_API_BASE_URL}/api/run/keypoint-ruler`, {\n method: 'POST',\n headers: { Authorization: `Basic ${btoa('admin:admin1234')}` },\n body: form\n })\n\n const result = await response.json()\n const { distance, unit, error } = result.result || {}\n this.distance = distance\n this.unit = unit\n this.analyzingError = error\n } catch (error) {\n console.error('사진 분석 실패:', error)\n } finally {\n this.analyzing = false\n }\n }\n\n async _savePhoto() {\n if (!this.frame || !this._hasTwoPoints() || this.distance === null || !this.unit) {\n notify({ message: '분석 완료 후 저장할 수 있습니다.', level: 'warn' })\n return\n }\n\n const checklistId = this.buildingInspection?.checklist?.id\n let file: File\n try {\n file = await this.getCurrentImage()\n } catch (e) {\n notify({ message: '이미지 합성에 실패했습니다.', level: 'error' })\n return\n }\n\n const response = await client.mutate({\n mutation: gql`\n mutation ($attachments: [NewAttachment!]!) {\n createAttachments(attachments: $attachments) {\n id\n }\n }\n `,\n variables: {\n attachments: [{ file, refBy: checklistId, refType: 'Checklist', description: this.buildingInspection?.status }]\n },\n context: { hasUpload: true }\n })\n\n if (!response.errors) {\n notify({ message: '사진 대지를 저장하였습니다.', level: 'info' })\n return\n }\n\n return response.data.createAttachments\n }\n\n async getCurrentImage(): Promise<File> {\n if (!this.imageWrapperEl) {\n throw new Error('이미지 영역을 찾을 수 없습니다.')\n }\n\n try {\n // html2canvas로 .image-wrapper 영역 캡처\n const canvas = await html2canvas(this.imageWrapperEl, {\n backgroundColor: null, // 투명 배경\n scale: 1, // 1:1 스케일\n useCORS: true, // CORS 이미지 허용\n allowTaint: false, // 보안상 false\n logging: false // 로그 비활성화\n })\n\n // 캔버스를 Blob으로 변환\n const blob: Blob = await new Promise(resolve => {\n canvas.toBlob(resolve as any, 'image/png', 1.0)\n })\n\n // File 객체로 변환하여 반환\n return new File([blob!], `inspection_${Date.now()}.png`, {\n type: 'image/png'\n })\n } catch (error) {\n console.error('html2canvas 캡처 실패:', error)\n throw new Error('화면 캡처에 실패했습니다.')\n }\n }\n}\n"]}
|
|
@@ -33,6 +33,7 @@ let BuildingInspectionCamera = class BuildingInspectionCamera extends PageView {
|
|
|
33
33
|
.projectName=${this.project.name}
|
|
34
34
|
.buildingName=${(_f = (_e = (_d = this.buildingInspection) === null || _d === void 0 ? void 0 : _d.buildingLevel) === null || _e === void 0 ? void 0 : _e.building) === null || _f === void 0 ? void 0 : _f.name}
|
|
35
35
|
.buildingLevelFloor=${(_h = (_g = this.buildingInspection) === null || _g === void 0 ? void 0 : _g.buildingLevel) === null || _h === void 0 ? void 0 : _h.floor}
|
|
36
|
+
.projectId=${this.project.id}
|
|
36
37
|
></building-inspection-detail-header>
|
|
37
38
|
|
|
38
39
|
<div body>
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"building-inspection-detail-camera.js","sourceRoot":"","sources":["../../../client/pages/building-inspection/building-inspection-detail-camera.ts"],"names":[],"mappings":";AAAA,OAAO,4BAA4B,CAAA;AACnC,OAAO,6CAA6C,CAAA;AAEpD,OAAO,GAAG,MAAM,aAAa,CAAA;AAC7B,OAAO,EAAE,GAAG,EAAE,IAAI,EAAkB,MAAM,KAAK,CAAA;AAC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yDAAyB;AAEH;IAA7B,KAAK,CAAC,aAAa,CAAC;8BAAwB,gBAAgB;8DAAA;AAvIlD,wBAAwB;IADpC,aAAa,CAAC,mCAAmC,CAAC;GACtC,wBAAwB,CAsTpC","sourcesContent":["import '@material/web/icon/icon.js'\nimport '@material/web/progress/circular-progress.js'\n\nimport gql from 'graphql-tag'\nimport { css, html, PropertyValues } from 'lit'\nimport { customElement, state, query } from 'lit/decorators.js'\n\nimport { PageView } from '@operato/shell'\nimport { CommonGristStyles, ScrollbarStyles } from '@operato/styles'\nimport { PageLifecycle } from '@operato/shell/dist/src/app/pages/page-view'\nimport { client } from '@operato/graphql'\nimport { notify } from '@operato/layout'\n\nimport './component/building-inspection-detail-header'\n\n@customElement('building-inspection-detail-camera')\nexport class BuildingInspectionCamera extends PageView {\n static styles = [\n ScrollbarStyles,\n CommonGristStyles,\n css`\n :host {\n display: grid;\n grid-template-rows: 75px 1fr;\n color: #4e5055;\n width: 100%;\n height: 100%;\n background-color: #f7f7f7;\n }\n\n div[body] {\n display: flex;\n justify-items: center;\n gap: var(--spacing-medium);\n margin: var(--spacing-medium);\n min-height: 0;\n }\n\n div[preview] {\n flex: 1;\n border: 2px solid #ddd;\n border-radius: 10px;\n\n display: flex;\n justify-content: center;\n align-items: center;\n min-height: 0;\n overflow: hidden;\n }\n\n div[preview] img {\n max-width: 100%;\n max-height: 100%;\n object-fit: contain;\n }\n\n div[preview] video {\n max-width: 100%;\n max-height: 100%;\n object-fit: contain;\n }\n\n div[preview] md-icon {\n --md-icon-size: 160px;\n }\n\n .image-wrapper {\n position: relative;\n width: 100%;\n height: 100%;\n align-content: center;\n text-align: center;\n }\n\n div[controls] {\n width: 240px;\n display: flex;\n flex-direction: column;\n justify-content: space-between;\n align-items: center;\n }\n\n div[action-buttons] {\n display: flex;\n flex-direction: row;\n justify-content: space-between;\n gap: 15px;\n }\n\n .camera-shutter {\n display: flex;\n justify-content: center;\n align-items: center;\n cursor: pointer;\n position: relative;\n }\n\n .controls-title {\n font-size: 18px;\n font-weight: 700;\n color: #333;\n margin-bottom: 8px;\n text-align: center;\n }\n\n .camera-shutter md-icon {\n --md-icon-size: 100px;\n }\n\n .camera-shutter input {\n opacity: 0;\n width: 100%;\n height: 100%;\n position: absolute;\n left: 0;\n top: 0;\n cursor: pointer;\n }\n\n button {\n padding: 10px 20px;\n font-size: 16px;\n border-radius: 5px;\n border: none;\n cursor: pointer;\n }\n\n button.save {\n background-color: #4caf50;\n color: white;\n\n &:disabled {\n background-color: #ccc;\n cursor: default;\n }\n }\n\n button.retry {\n background-color: #f0ad4e;\n color: white;\n }\n `\n ]\n\n @state() project: any = {}\n @state() buildingInspection: any = {}\n @state() buildingInspectionId: string = ''\n @state() capturedImageUrl: string | null = null\n @state() imageFile: File | null = null\n @state() isSaved: boolean = false\n\n @query('#imageInput') private imageInputEl!: HTMLInputElement\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 <div preview>\n <div class=\"image-wrapper\">\n ${this.capturedImageUrl\n ? html`<img id=\"imageImage\" src=\"${this.capturedImageUrl}\" alt=\"image\" />`\n : html`<md-icon>add_a_photo</md-icon>`}\n </div>\n </div>\n\n <div controls>\n <span class=\"controls-title\">사진 촬영</span>\n\n <div class=\"camera-shutter\">\n <md-icon>camera</md-icon>\n <input id=\"imageInput\" type=\"file\" accept=\"image/*\" @change=\"${this._onImageSelected}\" />\n </div>\n\n <!-- Action buttons -->\n <div action-buttons>\n <button class=\"save\" ?disabled=${!this.imageFile || this.isSaved} @click=${this._savePhoto}>사진 저장</button>\n <button class=\"retry\" @click=${this._onRetry}>초기화</button>\n </div>\n </div>\n </div>\n `\n }\n\n protected async updated(changes: PropertyValues): Promise<void> {}\n\n async pageUpdated(changes: any, lifecycle: PageLifecycle) {\n if (this.active) {\n this._onRetry()\n this.buildingInspectionId = lifecycle.resourceId || ''\n await this.initBuildingInspection(this.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 }\n buildingLevel {\n id\n floor\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 _onImageSelected(event: Event) {\n const input = event.target as HTMLInputElement\n const file = input?.files?.[0]\n if (!file) return\n\n // Only allow video files\n if (!file.type.startsWith('image/')) {\n console.warn('선택된 파일이 이미지가 아닙니다.')\n return\n }\n\n // Revoke old object URL if exists\n if (this.capturedImageUrl) {\n URL.revokeObjectURL(this.capturedImageUrl)\n }\n\n this.imageFile = file\n this.capturedImageUrl = URL.createObjectURL(file)\n this.isSaved = false // 새 이미지 선택 시 저장 상태 초기화\n }\n\n private _onRetry() {\n // Clear current selection and reopen camera\n if (this.capturedImageUrl) {\n URL.revokeObjectURL(this.capturedImageUrl)\n }\n this.capturedImageUrl = null\n this.imageFile = null\n this.isSaved = false // 초기화 시 저장 상태도 리셋\n this.imageInputEl.value = ''\n }\n\n async _savePhoto() {\n if (!this.imageFile) {\n notify({ message: '사진을 선택한 후 저장할 수 있습니다.', level: 'warn' })\n return\n }\n\n const checklistId = this.buildingInspection?.checklist?.id\n const file = this.imageFile\n\n const response = await client.mutate({\n mutation: gql`\n mutation ($attachments: [NewAttachment!]!) {\n createAttachments(attachments: $attachments) {\n id\n }\n }\n `,\n variables: {\n attachments: [{ file, refBy: checklistId, refType: 'Checklist', description: this.buildingInspection?.status }]\n },\n context: { hasUpload: true }\n })\n\n if (!response.errors) {\n notify({ message: '사진 대지를 저장하였습니다.', level: 'info' })\n this.isSaved = true // 저장 성공 시 상태 업데이트\n return\n }\n\n return response.data.createAttachments\n }\n}\n"]}
|
|
1
|
+
{"version":3,"file":"building-inspection-detail-camera.js","sourceRoot":"","sources":["../../../client/pages/building-inspection/building-inspection-detail-camera.ts"],"names":[],"mappings":";AAAA,OAAO,4BAA4B,CAAA;AACnC,OAAO,6CAA6C,CAAA;AAEpD,OAAO,GAAG,MAAM,aAAa,CAAA;AAC7B,OAAO,EAAE,GAAG,EAAE,IAAI,EAAkB,MAAM,KAAK,CAAA;AAC/C,OAAO,EAAE,aAAa,EAAE,KAAK,EAAE,KAAK,EAAE,MAAM,mBAAmB,CAAA;AAE/D,OAAO,EAAE,QAAQ,EAAE,MAAM,gBAAgB,CAAA;AACzC,OAAO,EAAE,iBAAiB,EAAE,eAAe,EAAE,MAAM,iBAAiB,CAAA;AAEpE,OAAO,EAAE,MAAM,EAAE,MAAM,kBAAkB,CAAA;AACzC,OAAO,EAAE,MAAM,EAAE,MAAM,iBAAiB,CAAA;AAExC,OAAO,+CAA+C,CAAA;AAG/C,IAAM,wBAAwB,GAA9B,MAAM,wBAAyB,SAAQ,QAAQ;IAA/C;;QAgII,YAAO,GAAQ,EAAE,CAAA;QACjB,uBAAkB,GAAQ,EAAE,CAAA;QAC5B,yBAAoB,GAAW,EAAE,CAAA;QACjC,qBAAgB,GAAkB,IAAI,CAAA;QACtC,cAAS,GAAgB,IAAI,CAAA;QAC7B,YAAO,G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F,IAAI,CAAC,QAAQ,CAAC,MAAM,EAAE,CAAC;YACrB,MAAM,CAAC,EAAE,OAAO,EAAE,iBAAiB,EAAE,KAAK,EAAE,MAAM,EAAE,CAAC,CAAA;YACrD,IAAI,CAAC,OAAO,GAAG,IAAI,CAAA,CAAC,kBAAkB;YACtC,OAAM;QACR,CAAC;QAED,OAAO,QAAQ,CAAC,IAAI,CAAC,iBAAiB,CAAA;IACxC,CAAC;;AArTM,+BAAM,GAAG;IACd,eAAe;IACf,iBAAiB;IACjB,GAAG,CAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;KAyHF;CACF,AA7HY,CA6HZ;AAEQ;IAAR,KAAK,EAAE;;yDAAkB;AACjB;IAAR,KAAK,EAAE;;oEAA6B;AAC5B;IAAR,KAAK,EAAE;;sEAAkC;AACjC;IAAR,KAAK,EAAE;;kEAAuC;AACtC;IAAR,KAAK,EAAE;;2DAA8B;AAC7B;IAAR,KAAK,EAAE;;yDAAyB;AAEH;IAA7B,KAAK,CAAC,aAAa,CAAC;8BAAwB,gBAAgB;8DAAA;AAvIlD,wBAAwB;IADpC,aAAa,CAAC,mCAAmC,CAAC;GACtC,wBAAwB,CAuTpC","sourcesContent":["import '@material/web/icon/icon.js'\nimport '@material/web/progress/circular-progress.js'\n\nimport gql from 'graphql-tag'\nimport { css, html, PropertyValues } from 'lit'\nimport { customElement, state, query } from 'lit/decorators.js'\n\nimport { PageView } from '@operato/shell'\nimport { CommonGristStyles, ScrollbarStyles } from '@operato/styles'\nimport { PageLifecycle } from '@operato/shell/dist/src/app/pages/page-view'\nimport { client } from '@operato/graphql'\nimport { notify } from '@operato/layout'\n\nimport './component/building-inspection-detail-header'\n\n@customElement('building-inspection-detail-camera')\nexport class BuildingInspectionCamera extends PageView {\n static styles = [\n ScrollbarStyles,\n CommonGristStyles,\n css`\n :host {\n display: grid;\n grid-template-rows: 75px 1fr;\n color: #4e5055;\n width: 100%;\n height: 100%;\n background-color: #f7f7f7;\n }\n\n div[body] {\n display: flex;\n justify-items: center;\n gap: var(--spacing-medium);\n margin: var(--spacing-medium);\n min-height: 0;\n }\n\n div[preview] {\n flex: 1;\n border: 2px solid #ddd;\n border-radius: 10px;\n\n display: flex;\n justify-content: center;\n align-items: center;\n min-height: 0;\n overflow: hidden;\n }\n\n div[preview] img {\n max-width: 100%;\n max-height: 100%;\n object-fit: contain;\n }\n\n div[preview] video {\n max-width: 100%;\n max-height: 100%;\n object-fit: contain;\n }\n\n div[preview] md-icon {\n --md-icon-size: 160px;\n }\n\n .image-wrapper {\n position: relative;\n width: 100%;\n height: 100%;\n align-content: center;\n text-align: center;\n }\n\n div[controls] {\n width: 240px;\n display: flex;\n flex-direction: column;\n justify-content: space-between;\n align-items: center;\n }\n\n div[action-buttons] {\n display: flex;\n flex-direction: row;\n justify-content: space-between;\n gap: 15px;\n }\n\n .camera-shutter {\n display: flex;\n justify-content: center;\n align-items: center;\n cursor: pointer;\n position: relative;\n }\n\n .controls-title {\n font-size: 18px;\n font-weight: 700;\n color: #333;\n margin-bottom: 8px;\n text-align: center;\n }\n\n .camera-shutter md-icon {\n --md-icon-size: 100px;\n }\n\n .camera-shutter input {\n opacity: 0;\n width: 100%;\n height: 100%;\n position: absolute;\n left: 0;\n top: 0;\n cursor: pointer;\n }\n\n button {\n padding: 10px 20px;\n font-size: 16px;\n border-radius: 5px;\n border: none;\n cursor: pointer;\n }\n\n button.save {\n background-color: #4caf50;\n color: white;\n\n &:disabled {\n background-color: #ccc;\n cursor: default;\n }\n }\n\n button.retry {\n background-color: #f0ad4e;\n color: white;\n }\n `\n ]\n\n @state() project: any = {}\n @state() buildingInspection: any = {}\n @state() buildingInspectionId: string = ''\n @state() capturedImageUrl: string | null = null\n @state() imageFile: File | null = null\n @state() isSaved: boolean = false\n\n @query('#imageInput') private imageInputEl!: HTMLInputElement\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 .projectId=${this.project.id}\n ></building-inspection-detail-header>\n\n <div body>\n <div preview>\n <div class=\"image-wrapper\">\n ${this.capturedImageUrl\n ? html`<img id=\"imageImage\" src=\"${this.capturedImageUrl}\" alt=\"image\" />`\n : html`<md-icon>add_a_photo</md-icon>`}\n </div>\n </div>\n\n <div controls>\n <span class=\"controls-title\">사진 촬영</span>\n\n <div class=\"camera-shutter\">\n <md-icon>camera</md-icon>\n <input id=\"imageInput\" type=\"file\" accept=\"image/*\" @change=\"${this._onImageSelected}\" />\n </div>\n\n <!-- Action buttons -->\n <div action-buttons>\n <button class=\"save\" ?disabled=${!this.imageFile || this.isSaved} @click=${this._savePhoto}>사진 저장</button>\n <button class=\"retry\" @click=${this._onRetry}>초기화</button>\n </div>\n </div>\n </div>\n `\n }\n\n protected async updated(changes: PropertyValues): Promise<void> {}\n\n async pageUpdated(changes: any, lifecycle: PageLifecycle) {\n if (this.active) {\n this._onRetry()\n this.buildingInspectionId = lifecycle.resourceId || ''\n await this.initBuildingInspection(this.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 }\n buildingLevel {\n id\n floor\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 _onImageSelected(event: Event) {\n const input = event.target as HTMLInputElement\n const file = input?.files?.[0]\n if (!file) return\n\n // Only allow video files\n if (!file.type.startsWith('image/')) {\n console.warn('선택된 파일이 이미지가 아닙니다.')\n return\n }\n\n // Revoke old object URL if exists\n if (this.capturedImageUrl) {\n URL.revokeObjectURL(this.capturedImageUrl)\n }\n\n this.imageFile = file\n this.capturedImageUrl = URL.createObjectURL(file)\n this.isSaved = false // 새 이미지 선택 시 저장 상태 초기화\n }\n\n private _onRetry() {\n // Clear current selection and reopen camera\n if (this.capturedImageUrl) {\n URL.revokeObjectURL(this.capturedImageUrl)\n }\n this.capturedImageUrl = null\n this.imageFile = null\n this.isSaved = false // 초기화 시 저장 상태도 리셋\n this.imageInputEl.value = ''\n }\n\n async _savePhoto() {\n if (!this.imageFile) {\n notify({ message: '사진을 선택한 후 저장할 수 있습니다.', level: 'warn' })\n return\n }\n\n const checklistId = this.buildingInspection?.checklist?.id\n const file = this.imageFile\n\n const response = await client.mutate({\n mutation: gql`\n mutation ($attachments: [NewAttachment!]!) {\n createAttachments(attachments: $attachments) {\n id\n }\n }\n `,\n variables: {\n attachments: [{ file, refBy: checklistId, refType: 'Checklist', description: this.buildingInspection?.status }]\n },\n context: { hasUpload: true }\n })\n\n if (!response.errors) {\n notify({ message: '사진 대지를 저장하였습니다.', level: 'info' })\n this.isSaved = true // 저장 성공 시 상태 업데이트\n return\n }\n\n return response.data.createAttachments\n }\n}\n"]}
|
|
@@ -21,6 +21,8 @@ export declare class BuildingInspectionDetailChecklist extends PageView {
|
|
|
21
21
|
private validateChecklist;
|
|
22
22
|
private _showInspectionRequestDocument;
|
|
23
23
|
private _showInspectionResultNotification;
|
|
24
|
+
private _toISODate;
|
|
25
|
+
private _onRequestDateChange;
|
|
24
26
|
private _onInspectionMemoChange;
|
|
25
27
|
private _onInspectionResultChange;
|
|
26
28
|
private _onInspectionTypeChange;
|
|
@@ -38,6 +38,7 @@ let BuildingInspectionDetailChecklist = class BuildingInspectionDetailChecklist
|
|
|
38
38
|
.projectName=${this.project.name}
|
|
39
39
|
.buildingName=${(_f = (_e = (_d = this.buildingInspection) === null || _d === void 0 ? void 0 : _d.buildingLevel) === null || _e === void 0 ? void 0 : _e.building) === null || _f === void 0 ? void 0 : _f.name}
|
|
40
40
|
.buildingLevelFloor=${(_h = (_g = this.buildingInspection) === null || _g === void 0 ? void 0 : _g.buildingLevel) === null || _h === void 0 ? void 0 : _h.floor}
|
|
41
|
+
.projectId=${this.project.id}
|
|
41
42
|
></building-inspection-detail-header>
|
|
42
43
|
|
|
43
44
|
<div body>
|
|
@@ -136,6 +137,7 @@ let BuildingInspectionDetailChecklist = class BuildingInspectionDetailChecklist
|
|
|
136
137
|
variables: {
|
|
137
138
|
buildingInspection: {
|
|
138
139
|
id: this.buildingInspection.id,
|
|
140
|
+
requestDate: this._toISODate(this.buildingInspection.requestDate),
|
|
139
141
|
checklist: {
|
|
140
142
|
id: checklist.id,
|
|
141
143
|
overallConstructorSignature: checklist.overallConstructorSignature,
|
|
@@ -171,6 +173,7 @@ let BuildingInspectionDetailChecklist = class BuildingInspectionDetailChecklist
|
|
|
171
173
|
.checklist=${checklist}
|
|
172
174
|
.buildingInspection=${this.buildingInspection}
|
|
173
175
|
.mode=${this.buildingInspection.status == BuildingInspectionStatus.PASS ? InspectionMode.VIEW : InspectionMode.EDIT}
|
|
176
|
+
@request-date-change=${this._onRequestDateChange.bind(this)}
|
|
174
177
|
@inspection-memo-change=${this._onInspectionMemoChange.bind(this)}
|
|
175
178
|
@name-list-file-selected=${(e) => {
|
|
176
179
|
// checklist에 선택된 파일 저장
|
|
@@ -198,6 +201,19 @@ let BuildingInspectionDetailChecklist = class BuildingInspectionDetailChecklist
|
|
|
198
201
|
`, { backdrop: true, size: 'large', title: '검측 결과 통보' });
|
|
199
202
|
});
|
|
200
203
|
}
|
|
204
|
+
_toISODate(value) {
|
|
205
|
+
if (!value)
|
|
206
|
+
return undefined;
|
|
207
|
+
const d = typeof value === 'string' && /^\d+$/.test(value) ? new Date(Number(value)) : new Date(value);
|
|
208
|
+
return isNaN(d.getTime()) ? undefined : d.toISOString();
|
|
209
|
+
}
|
|
210
|
+
_onRequestDateChange(e) {
|
|
211
|
+
const { requestDate } = e.detail;
|
|
212
|
+
if (this.buildingInspection) {
|
|
213
|
+
this.buildingInspection.requestDate = requestDate;
|
|
214
|
+
}
|
|
215
|
+
this.requestUpdate();
|
|
216
|
+
}
|
|
201
217
|
_onInspectionMemoChange(e) {
|
|
202
218
|
var _a;
|
|
203
219
|
const { inspectionRequestMemo } = e.detail;
|
|
@@ -1 +1 @@
|
|
|
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,OAAO,EAAE,MAAM,EAAE,SAAS,EAAE,MAAM,iBAAiB,CAAA;AACnD,OAAO,EAAE,KAAK,EAAE,MAAM,gBAAgB,CAAA;AACtC,O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port '@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, openPopup } from '@operato/layout'\nimport { store } from '@operato/shell'\nimport gql from 'graphql-tag'\n\nimport { verifyBiometric } from '@things-factory/auth-base/dist-client'\n\nimport './component/building-inspection-detail-header'\nimport './component/inspection-document/inspection-request-document'\nimport './component/inspection-document/inspection-result-notification'\nimport '../checklist/checklist-view'\nimport { ChecklistMode } from '../checklist/checklist-view'\nimport { BuildingInspectionStatus } from './building-inspection-list'\nimport { getBuildingInspectionForChecklist } from '../../graphql/building-inspection'\nimport { InspectionMode } from './component/inspection-document/inspection-request-document'\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: 55px auto;\n color: #4e5055;\n\n width: 100%;\n background-color: var(--md-sys-color-background, #f6f6f6);\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 new Date(),\n html`\n <checklist-view\n .mode=${ChecklistMode.EDITOR}\n status=${this.buildingInspection.status}\n .failCount=${this.buildingInspection.failCount || 0}\n .checklist=${this.buildingInspection.checklist || {}}\n .buildingComplex=${this.buildingInspection?.buildingLevel?.building?.buildingComplex || {}}\n .projectType=${this.project.projectType}\n ></checklist-view>\n `\n )}\n\n <div button-container>\n <md-elevated-button\n ?disabled=${this.buildingInspection.status == BuildingInspectionStatus.PASS}\n @click=${this._onClickModifyChecklist}\n >\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 this.buildingInspection = await getBuildingInspectionForChecklist(buildingInspectionId)\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 projectType\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 // 사용자 권한 체크\n const email = (store.getState() as any).auth?.user?.email\n const isOverallConstructor =\n this.buildingInspection?.buildingLevel?.building?.buildingComplex?.overallConstructorEmails?.includes(email) || false\n const isOverallSupervisory =\n this.buildingInspection?.buildingLevel?.building?.buildingComplex?.overallSupervisoryEmails?.includes(email) || false\n\n // 권한에 따라 적절한 문서 표시\n if (this.buildingInspection.status == BuildingInspectionStatus.OVERALL_WAIT && isOverallConstructor) {\n await this._showInspectionRequestDocument(checklist)\n } else if (this.buildingInspection.status == BuildingInspectionStatus.OVERALL_REQUEST && isOverallSupervisory) {\n await this._showInspectionResultNotification(checklist)\n }\n\n try {\n const result = await verifyBiometric()\n if (result.verified) {\n console.log('Verification successful. Proceeding with sensitive action.')\n } else {\n notify({ message: 'Verification failed:' + result.message })\n return\n }\n } catch (error) {\n notify({ message: 'Error during biometric verification:' + error })\n return\n }\n\n // 실명부 파일 업로드 처리 (새로 업로드된 경우만)\n if (checklist.isNameListAttachmentUploaded) {\n await this._uploadNameListFile(checklist)\n }\n\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 inspectionRequestMemo: checklist.inspectionRequestMemo,\n inspectionResultMemo: checklist.inspectionResultMemo,\n inspectionResultStatus: checklist.inspectionResultStatus,\n inspectionResultType: checklist.inspectionResultType\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 // resolve 호출 전까지 싱크를 위해 Promise 사용\n private async _showInspectionRequestDocument(checklist: any): Promise<void> {\n return new Promise(resolve => {\n openPopup(\n html`\n <inspection-request-document\n .checklist=${checklist}\n .buildingInspection=${this.buildingInspection}\n .mode=${this.buildingInspection.status == BuildingInspectionStatus.PASS ? InspectionMode.VIEW : InspectionMode.EDIT}\n @inspection-memo-change=${this._onInspectionMemoChange.bind(this)}\n @name-list-file-selected=${(e: CustomEvent) => {\n // checklist에 선택된 파일 저장\n checklist.nameListAttachment = e.detail.file\n checklist.isNameListAttachmentUploaded = true\n }}\n @popup-close=${() => resolve()}\n ></inspection-request-document>\n `,\n { backdrop: true, size: 'large', title: '검측요청결과 통보내용' }\n )\n })\n }\n\n private async _showInspectionResultNotification(checklist: any): Promise<void> {\n return new Promise(resolve => {\n openPopup(\n html`\n <inspection-result-notification\n .checklist=${checklist}\n .buildingInspection=${this.buildingInspection}\n .project=${this.project}\n .mode=${this.buildingInspection.status == BuildingInspectionStatus.PASS ? InspectionMode.VIEW : InspectionMode.EDIT}\n @inspection-result-change=${this._onInspectionResultChange.bind(this)}\n @inspection-type-change=${this._onInspectionTypeChange.bind(this)}\n @instructions-change=${this._onInstructionsChange.bind(this)}\n @popup-close=${() => resolve()}\n ></inspection-result-notification>\n `,\n { backdrop: true, size: 'large', title: '검측 결과 통보' }\n )\n })\n }\n\n private _onInspectionMemoChange(e: CustomEvent) {\n const { inspectionRequestMemo } = e.detail\n if (this.buildingInspection?.checklist) {\n this.buildingInspection.checklist.inspectionRequestMemo = inspectionRequestMemo\n }\n this.requestUpdate()\n }\n\n private _onInspectionResultChange(e: CustomEvent) {\n const { inspectionResultStatus } = e.detail\n // checklist 업데이트 (레퍼런스 유지하여 호출부 인자에도 반영)\n if (this.buildingInspection?.checklist) {\n this.buildingInspection.checklist.inspectionResultStatus = inspectionResultStatus\n }\n this.requestUpdate()\n }\n\n private _onInspectionTypeChange(e: CustomEvent) {\n const { inspectionResultType } = e.detail\n // checklist 업데이트 (레퍼런스 유지)\n if (this.buildingInspection?.checklist) {\n this.buildingInspection.checklist.inspectionResultType = inspectionResultType\n }\n this.requestUpdate()\n }\n\n private _onInstructionsChange(e: CustomEvent) {\n const { inspectionResultMemo } = e.detail\n // checklist 업데이트 (레퍼런스 유지)\n if (this.buildingInspection?.checklist) {\n this.buildingInspection.checklist.inspectionResultMemo = inspectionResultMemo\n }\n this.requestUpdate()\n }\n\n // 실명부 파일 업로드\n private async _uploadNameListFile(checklist: any) {\n if (!checklist.isNameListAttachmentUploaded || !checklist.nameListAttachment) {\n return\n }\n\n const response = await client.mutate({\n mutation: gql`\n mutation CreateAttachments($attachments: [NewAttachment!]!) {\n createAttachments(attachments: $attachments) {\n id\n }\n }\n `,\n variables: {\n attachments: [\n {\n file: checklist.nameListAttachment,\n refBy: checklist.id,\n refType: 'Checklist_NameList'\n }\n ]\n },\n context: { hasUpload: true }\n })\n\n if (response.errors) {\n throw new Error(response.errors[0]?.message || '실명부 파일 업로드에 실패했습니다.')\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,OAAO,EAAE,MAAM,EAAE,SAAS,EAAE,MAAM,iBAAiB,CAAA;AACnD,OAAO,EAAE,KAAK,EAAE,MAAM,gBAAgB,CAAA;AACtC,OAAO,GAAG,MAAM,aAAa,CAAA;AAE7B,OAAO,EAAE,eAAe,EA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,MAAM,MAAM,CAAC,MAAM,CAAC;YACnC,QAAQ,EAAE,GAAG,CAAA;;;;;;OAMZ;YACD,SAAS,EAAE;gBACT,WAAW,EAAE;oBACX;wBACE,IAAI,EAAE,SAAS,CAAC,kBAAkB;wBAClC,KAAK,EAAE,SAAS,CAAC,EAAE;wBACnB,OAAO,EAAE,oBAAoB;qBAC9B;iBACF;aACF;YACD,OAAO,EAAE,EAAE,SAAS,EAAE,IAAI,EAAE;SAC7B,CAAC,CAAA;QAEF,IAAI,QAAQ,CAAC,MAAM,EAAE,CAAC;YACpB,MAAM,IAAI,KAAK,CAAC,CAAA,MAAA,QAAQ,CAAC,MAAM,CAAC,CAAC,CAAC,0CAAE,OAAO,KAAI,qBAAqB,CAAC,CAAA;QACvE,CAAC;IACH,CAAC;;AA7TM,wCAAM,GAAG;IACd,eAAe;IACf,iBAAiB;IACjB,GAAG,CAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;KAiCF;CACF,AArCY,CAqCZ;AAEQ;IAAR,KAAK,EAAE;;kEAAkB;AACjB;IAAR,KAAK,EAAE;;6EAA6B;AAzC1B,iCAAiC;IAD7C,aAAa,CAAC,sCAAsC,CAAC;GACzC,iCAAiC,CA+T7C","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, openPopup } from '@operato/layout'\nimport { store } from '@operato/shell'\nimport gql from 'graphql-tag'\n\nimport { verifyBiometric } from '@things-factory/auth-base/dist-client'\n\nimport './component/building-inspection-detail-header'\nimport './component/inspection-document/inspection-request-document'\nimport './component/inspection-document/inspection-result-notification'\nimport '../checklist/checklist-view'\nimport { ChecklistMode } from '../checklist/checklist-view'\nimport { BuildingInspectionStatus } from './building-inspection-list'\nimport { getBuildingInspectionForChecklist } from '../../graphql/building-inspection'\nimport { InspectionMode } from './component/inspection-document/inspection-request-document'\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: 55px auto;\n color: #4e5055;\n\n width: 100%;\n background-color: var(--md-sys-color-background, #f6f6f6);\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 .projectId=${this.project.id}\n ></building-inspection-detail-header>\n\n <div body>\n ${keyed(\n new Date(),\n html`\n <checklist-view\n .mode=${ChecklistMode.EDITOR}\n status=${this.buildingInspection.status}\n .failCount=${this.buildingInspection.failCount || 0}\n .checklist=${this.buildingInspection.checklist || {}}\n .buildingComplex=${this.buildingInspection?.buildingLevel?.building?.buildingComplex || {}}\n .projectType=${this.project.projectType}\n ></checklist-view>\n `\n )}\n\n <div button-container>\n <md-elevated-button\n ?disabled=${this.buildingInspection.status == BuildingInspectionStatus.PASS}\n @click=${this._onClickModifyChecklist}\n >\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 this.buildingInspection = await getBuildingInspectionForChecklist(buildingInspectionId)\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 projectType\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 // 사용자 권한 체크\n const email = (store.getState() as any).auth?.user?.email\n const isOverallConstructor =\n this.buildingInspection?.buildingLevel?.building?.buildingComplex?.overallConstructorEmails?.includes(email) || false\n const isOverallSupervisory =\n this.buildingInspection?.buildingLevel?.building?.buildingComplex?.overallSupervisoryEmails?.includes(email) || false\n\n // 권한에 따라 적절한 문서 표시\n if (this.buildingInspection.status == BuildingInspectionStatus.OVERALL_WAIT && isOverallConstructor) {\n await this._showInspectionRequestDocument(checklist)\n } else if (this.buildingInspection.status == BuildingInspectionStatus.OVERALL_REQUEST && isOverallSupervisory) {\n await this._showInspectionResultNotification(checklist)\n }\n\n try {\n const result = await verifyBiometric()\n if (result.verified) {\n console.log('Verification successful. Proceeding with sensitive action.')\n } else {\n notify({ message: 'Verification failed:' + result.message })\n return\n }\n } catch (error) {\n notify({ message: 'Error during biometric verification:' + error })\n return\n }\n\n // 실명부 파일 업로드 처리 (새로 업로드된 경우만)\n if (checklist.isNameListAttachmentUploaded) {\n await this._uploadNameListFile(checklist)\n }\n\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 requestDate: this._toISODate(this.buildingInspection.requestDate),\n checklist: {\n id: checklist.id,\n overallConstructorSignature: checklist.overallConstructorSignature,\n taskConstructorSignature: checklist.taskConstructorSignature,\n overallSupervisorySignature: checklist.overallSupervisorySignature,\n taskSupervisorySignature: checklist.taskSupervisorySignature,\n inspectionRequestMemo: checklist.inspectionRequestMemo,\n inspectionResultMemo: checklist.inspectionResultMemo,\n inspectionResultStatus: checklist.inspectionResultStatus,\n inspectionResultType: checklist.inspectionResultType\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 // resolve 호출 전까지 싱크를 위해 Promise 사용\n private async _showInspectionRequestDocument(checklist: any): Promise<void> {\n return new Promise(resolve => {\n openPopup(\n html`\n <inspection-request-document\n .checklist=${checklist}\n .buildingInspection=${this.buildingInspection}\n .mode=${this.buildingInspection.status == BuildingInspectionStatus.PASS ? InspectionMode.VIEW : InspectionMode.EDIT}\n @request-date-change=${this._onRequestDateChange.bind(this)}\n @inspection-memo-change=${this._onInspectionMemoChange.bind(this)}\n @name-list-file-selected=${(e: CustomEvent) => {\n // checklist에 선택된 파일 저장\n checklist.nameListAttachment = e.detail.file\n checklist.isNameListAttachmentUploaded = true\n }}\n @popup-close=${() => resolve()}\n ></inspection-request-document>\n `,\n { backdrop: true, size: 'large', title: '검측요청결과 통보내용' }\n )\n })\n }\n\n private async _showInspectionResultNotification(checklist: any): Promise<void> {\n return new Promise(resolve => {\n openPopup(\n html`\n <inspection-result-notification\n .checklist=${checklist}\n .buildingInspection=${this.buildingInspection}\n .project=${this.project}\n .mode=${this.buildingInspection.status == BuildingInspectionStatus.PASS ? InspectionMode.VIEW : InspectionMode.EDIT}\n @inspection-result-change=${this._onInspectionResultChange.bind(this)}\n @inspection-type-change=${this._onInspectionTypeChange.bind(this)}\n @instructions-change=${this._onInstructionsChange.bind(this)}\n @popup-close=${() => resolve()}\n ></inspection-result-notification>\n `,\n { backdrop: true, size: 'large', title: '검측 결과 통보' }\n )\n })\n }\n\n private _toISODate(value: any): string | undefined {\n if (!value) return undefined\n const d = typeof value === 'string' && /^\\d+$/.test(value) ? new Date(Number(value)) : new Date(value)\n return isNaN(d.getTime()) ? undefined : d.toISOString()\n }\n\n private _onRequestDateChange(e: CustomEvent) {\n const { requestDate } = e.detail\n if (this.buildingInspection) {\n this.buildingInspection.requestDate = requestDate\n }\n this.requestUpdate()\n }\n\n private _onInspectionMemoChange(e: CustomEvent) {\n const { inspectionRequestMemo } = e.detail\n if (this.buildingInspection?.checklist) {\n this.buildingInspection.checklist.inspectionRequestMemo = inspectionRequestMemo\n }\n this.requestUpdate()\n }\n\n private _onInspectionResultChange(e: CustomEvent) {\n const { inspectionResultStatus } = e.detail\n // checklist 업데이트 (레퍼런스 유지하여 호출부 인자에도 반영)\n if (this.buildingInspection?.checklist) {\n this.buildingInspection.checklist.inspectionResultStatus = inspectionResultStatus\n }\n this.requestUpdate()\n }\n\n private _onInspectionTypeChange(e: CustomEvent) {\n const { inspectionResultType } = e.detail\n // checklist 업데이트 (레퍼런스 유지)\n if (this.buildingInspection?.checklist) {\n this.buildingInspection.checklist.inspectionResultType = inspectionResultType\n }\n this.requestUpdate()\n }\n\n private _onInstructionsChange(e: CustomEvent) {\n const { inspectionResultMemo } = e.detail\n // checklist 업데이트 (레퍼런스 유지)\n if (this.buildingInspection?.checklist) {\n this.buildingInspection.checklist.inspectionResultMemo = inspectionResultMemo\n }\n this.requestUpdate()\n }\n\n // 실명부 파일 업로드\n private async _uploadNameListFile(checklist: any) {\n if (!checklist.isNameListAttachmentUploaded || !checklist.nameListAttachment) {\n return\n }\n\n const response = await client.mutate({\n mutation: gql`\n mutation CreateAttachments($attachments: [NewAttachment!]!) {\n createAttachments(attachments: $attachments) {\n id\n }\n }\n `,\n variables: {\n attachments: [\n {\n file: checklist.nameListAttachment,\n refBy: checklist.id,\n refType: 'Checklist_NameList'\n }\n ]\n },\n context: { hasUpload: true }\n })\n\n if (response.errors) {\n throw new Error(response.errors[0]?.message || '실명부 파일 업로드에 실패했습니다.')\n }\n }\n}\n"]}
|
|
@@ -50,6 +50,7 @@ let BuildingInspectionDetailDrawing = class BuildingInspectionDetailDrawing exte
|
|
|
50
50
|
.projectName=${this.project.name}
|
|
51
51
|
.buildingName=${(_f = (_e = (_d = this.buildingInspection) === null || _d === void 0 ? void 0 : _d.buildingLevel) === null || _e === void 0 ? void 0 : _e.building) === null || _f === void 0 ? void 0 : _f.name}
|
|
52
52
|
.buildingLevelFloor=${(_h = (_g = this.buildingInspection) === null || _g === void 0 ? void 0 : _g.buildingLevel) === null || _h === void 0 ? void 0 : _h.floor}
|
|
53
|
+
.projectId=${this.project.id}
|
|
53
54
|
></building-inspection-detail-header>
|
|
54
55
|
|
|
55
56
|
<div
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"building-inspection-detail-drawing.js","sourceRoot":"","sources":["../../../client/pages/building-inspection/building-inspection-detail-drawing.ts"],"names":[],"mappings":";AAAA,OAAO,4BAA4B,CAAA;AACnC,OAAO,0CAA0C,CAAA;AACjD,OAAO,+CAA+C,CAAA;AAEtD,OAAO,GAAG,MAAM,aAAa,CAAA;AAC7B,OAAO,EAAE,GAAG,EAAE,IAAI,EAAkB,MAAM,KAAK,CAAA;AAC/C,OAAO,EAAE,aAAa,EAAE,KAAK,EAAE,KAAK,EAAE,MAAM,mBAAmB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cAAc,CAAC;;mEAAiB;AACtB;IAAhB,KAAK,CAAC,QAAQ,CAAC;8BAAU,iBAAiB;+DAAA;AA/ChC,+BAA+B;IAD3C,aAAa,CAAC,oCAAoC,CAAC;GACvC,+BAA+B,CAkW3C","sourcesContent":["import '@material/web/icon/icon.js'\nimport '@operato/image-marker/ox-image-marker.js'\nimport '@operato/image-marker/ox-image-marker-view.js'\n\nimport gql from 'graphql-tag'\nimport { css, html, PropertyValues } from 'lit'\nimport { customElement, query, state } from 'lit/decorators.js'\nimport { consume } from '@lit/context'\nimport { ScopedElementsMixin } from '@open-wc/scoped-elements'\n\nimport { PageView } from '@operato/shell'\nimport { CommonGristStyles, ScrollbarStyles } from '@operato/styles'\nimport { PageLifecycle } from '@operato/shell/dist/src/app/pages/page-view'\nimport { client } from '@operato/graphql'\nimport { notify } from '@operato/layout'\nimport { Shape } from '@operato/image-marker'\n\nimport { DrawingImageProvider } from '@dssp/drawing/dist-client/drawing-management/drawing-image-provider.js'\n\nimport './component/building-inspection-detail-header'\nimport { BuildingInspectionStatus } from './building-inspection-list'\n\n@customElement('building-inspection-detail-drawing')\nexport class BuildingInspectionDetailDrawing extends ScopedElementsMixin(PageView) {\n static styles = [\n ScrollbarStyles,\n CommonGristStyles,\n css`\n :host {\n display: grid;\n grid-template-rows: 55px auto;\n color: #4e5055;\n\n width: 100%;\n background-color: var(--md-sys-color-background, #f6f6f6);\n overflow-y: auto;\n\n --grid-record-emphasized-background-color: red;\n --grid-record-emphasized-color: yellow;\n }\n\n div[body] {\n display: flex;\n justify-content: center;\n\n ox-image-marker-view {\n width: 100%;\n }\n }\n\n dialog ox-image-marker-view {\n width: 80vw;\n height: 80vh;\n }\n `\n ]\n\n @state() project: any = {}\n @state() buildingInspection: any = {}\n @state() buildingInspectionId: string = ''\n @state() imageUrl?: string\n @state() shapes: Shape[] = []\n @state() linkUrl?: string\n @state() linkShapes: Shape[] = []\n\n @state() drawingImageProvider: DrawingImageProvider = new DrawingImageProvider()\n // @consume({ context: OxUserPreferencesContext, subscribe: true })\n\n @query('#image-marker') imageMarker!: any\n @query('#link-viewer') linkViewer!: any\n @query('dialog') dialog!: HTMLDialogElement\n\n get context() {\n return {\n title: '검측 관리 상세 - 검측 도면'\n }\n }\n\n connectedCallback(): void {\n super.connectedCallback()\n\n requestAnimationFrame(() => {\n this.dialog.addEventListener('click', event => {\n const rect = this.dialog.getBoundingClientRect()\n const isInDialog =\n rect.top <= event.clientY && event.clientY <= rect.bottom && rect.left <= event.clientX && event.clientX <= rect.right\n\n // 다이아로그 내부를 클릭한 것이 아니면 다이아로그 닫기\n if (!isInDialog) {\n this.dialog.close()\n }\n })\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\n body\n @link-clicked=${async (e: CustomEvent) => {\n const { link } = e.detail\n const { id, type, symbol, box, dwgId } = JSON.parse(link) || {}\n\n // 좌표 파싱 및 유효성 검증\n const coordinates = this.parseBoxCoordinates(box, {\n id,\n type,\n symbol,\n dwgId,\n currentPdfId: this.linkUrl || 'unknown',\n buildingInspectionId: this.buildingInspectionId\n })\n\n this.linkUrl = `DWGID:${dwgId}`\n\n // 유효한 좌표가 있으면 마커 표시, 없으면 빈 배열\n if (coordinates) {\n this.linkShapes = [\n {\n id: id || 'unknown',\n type: 'link' as const,\n ...coordinates,\n link: JSON.stringify({ id, type, symbol, dwgId })\n }\n ]\n } else {\n // 좌표가 유효하지 않아도 팝업은 열고 마커만 숨김\n this.linkShapes = []\n console.warn('Invalid link coordinates, popup will open without marker:', {\n box,\n id,\n type,\n symbol,\n dwgId,\n currentPdfId: this.linkUrl || 'unknown',\n buildingInspectionId: this.buildingInspectionId,\n fullLink: link\n })\n }\n\n if (this.dialog) {\n this.dialog.showModal()\n\n requestAnimationFrame(() => {\n this.linkViewer.reset()\n })\n }\n }}\n >\n ${this.buildingInspection?.status == BuildingInspectionStatus.PASS\n ? html`<ox-image-marker-view\n id=\"image-marker\"\n .imageUrl=${this.imageUrl}\n .shapes=${this.shapes}\n .imageProvider=${this.drawingImageProvider}\n ></ox-image-marker-view>`\n : html` <ox-image-marker\n id=\"image-marker\"\n .imageUrl=${this.imageUrl}\n .shapes=${this.shapes}\n .imageProvider=${this.drawingImageProvider}\n @shapes-changed=${this.onClickMarkerSave}\n .currentMode=${'view'}\n ></ox-image-marker>`}\n </div>\n\n <dialog>\n <ox-image-marker-view\n id=\"link-viewer\"\n .imageUrl=${this.linkUrl}\n .shapes=${this.linkShapes}\n .imageProvider=${this.drawingImageProvider}\n ></ox-image-marker-view>\n </dialog>\n `\n }\n\n protected async updated(changes: PropertyValues): Promise<void> {\n if (changes.has('buildingInspection') && this.buildingInspection?.checklist) {\n // 1-1. 위치 정보 - 체크리스트에 들어가는 위치정보 텍스트\n const location_1 = this.buildingInspection.checklist?.location\n\n // 1-2. 위치 정보 - 실제 위치정보 텍스트 (동 + 층) - ID 필드를 사용하면 DB ID 필드입니다.\n const location_building = this.buildingInspection.buildingLevel.building.name\n const location_floor = this.buildingInspection.buildingLevel.floor\n\n // 2. 평면도 pdf 파일\n // mainDrawing {\n // id\n // name\n // fullpath\n // }\n const mainDrawing = this.buildingInspection.buildingLevel.mainDrawing\n\n // 3. 선택 도면\n const inspectionDrawingType = this.buildingInspection.checklist.inspectionDrawingType\n\n const shapes = JSON.parse(this.buildingInspection?.drawingMarker || null) || []\n const markers = await this.drawingImageProvider.getMarkers(inspectionDrawingType)\n\n this.imageUrl = String(inspectionDrawingType).normalize('NFC')\n this.shapes = [...shapes, ...markers]\n }\n }\n\n async pageUpdated(changes: any, lifecycle: PageLifecycle) {\n if (this.active) {\n this.buildingInspectionId = lifecycle.resourceId || ''\n await this.initBuildingInspection(this.buildingInspectionId)\n\n this.imageMarker?.reset()\n } else {\n this.dialog?.close()\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 drawingMarker\n checklist {\n location\n inspectionDrawingType\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 async onClickMarkerSave(e) {\n const response = await client.query({\n query: gql`\n mutation UpdateBuildingInspection($patch: UpdateBuildingInspection!) {\n updateBuildingInspection(patch: $patch) {\n id\n drawingMarker\n }\n }\n `,\n variables: {\n patch: {\n id: this.buildingInspectionId,\n drawingMarker: JSON.stringify(e.detail)\n }\n }\n })\n\n if (response.errors) return\n\n notify({ message: '저장되었습니다.' })\n }\n\n private parseBoxCoordinates(\n box: string | undefined,\n context: {\n id?: string\n type?: string\n symbol?: string\n dwgId?: string\n currentPdfId?: string\n buildingInspectionId?: string\n } = {}\n ): {\n x: number\n y: number\n width: number\n height: number\n } | null {\n if (!box || typeof box !== 'string') {\n console.warn('Invalid box coordinate for link:', {\n box,\n context,\n reason: 'Box is undefined, null, or not a string'\n })\n return null\n }\n\n try {\n const coords = box.split(',').map(str => {\n const num = Number(str.trim())\n return Number.isFinite(num) ? num : NaN\n })\n\n if (coords.length !== 4 || coords.some(coord => isNaN(coord))) {\n console.warn('Box coordinate should have 4 valid numbers:', {\n box,\n parsedCoords: coords,\n context,\n reason: `Expected 4 numbers, got ${coords.length} values with NaN: ${coords.some(coord => isNaN(coord))}`\n })\n return null\n }\n\n const [x, y, width, height] = coords\n\n // width, height가 0 이하면 유효하지 않음\n if (width <= 0 || height <= 0) {\n console.warn('Invalid width or height for link:', {\n box,\n coords: { x, y, width, height },\n context,\n reason: `Width (${width}) or height (${height}) is <= 0`\n })\n return null\n }\n\n return { x, y, width, height }\n } catch (error) {\n console.warn('Error parsing box coordinates:', {\n box,\n context,\n error: error instanceof Error ? error.message : String(error),\n reason: 'Exception thrown during parsing'\n })\n return null\n }\n }\n}\n"]}
|
|
1
|
+
{"version":3,"file":"building-inspection-detail-drawing.js","sourceRoot":"","sources":["../../../client/pages/building-inspection/building-inspection-detail-drawing.ts"],"names":[],"mappings":";AAAA,OAAO,4BAA4B,CAAA;AACnC,OAAO,0CAA0C,CAAA;AACjD,OAAO,+CAA+C,CAAA;AAEtD,OAAO,GAAG,MAAM,aAAa,CAAA;AAC7B,OAAO,EAAE,GAAG,EAAE,IAAI,EAAkB,MAAM,KAAK,CAAA;AAC/C,OAAO,EAAE,aAAa,EAAE,KAAK,EAAE,KAAK,EAAE,MAAM,mBAAmB,CAAA;AAE/D,OAAO,EAAE,mBAAmB,EAAE,MAAM,0BAA0B,CAAA;AAE9D,OAAO,EAAE,QAAQ,EAAE,MAAM,gBAAgB,CAAA;AACzC,OAAO,EAAE,iBAAiB,EAAE,eAAe,EAAE,MAAM,iBAAiB,CAAA;AAEpE,OAAO,EAAE,MAAM,EAAE,MAAM,kBAAkB,CAAA;AACzC,OAAO,EAAE,MAAM,EAAE,MAAM,iBAAiB,CAAA;AAGxC,OAAO,EAAE,oBAAoB,EAAE,MAAM,wEAAwE,CAAA;AAE7G,OAAO,+CAA+C,CAAA;AACtD,OAAO,EAAE,wBAAwB,EAAE,MAAM,4BAA4B,CAAA;AAG9D,IA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AAC,EAAE,KAAK,EAAE,MAAM,EAAE,CAAA;QAChC,CAAC;QAAC,OAAO,KAAK,EAAE,CAAC;YACf,OAAO,CAAC,IAAI,CAAC,gCAAgC,EAAE;gBAC7C,GAAG;gBACH,OAAO;gBACP,KAAK,EAAE,KAAK,YAAY,KAAK,CAAC,CAAC,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC,CAAC,MAAM,CAAC,KAAK,CAAC;gBAC7D,MAAM,EAAE,iCAAiC;aAC1C,CAAC,CAAA;YACF,OAAO,IAAI,CAAA;QACb,CAAC;IACH,CAAC;;AAjWM,sCAAM,GAAG;IACd,eAAe;IACf,iBAAiB;IACjB,GAAG,CAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;KA2BF;CACF,AA/BY,CA+BZ;AAEQ;IAAR,KAAK,EAAE;;gEAAkB;AACjB;IAAR,KAAK,EAAE;;2EAA6B;AAC5B;IAAR,KAAK,EAAE;;6EAAkC;AACjC;IAAR,KAAK,EAAE;;iEAAkB;AACjB;IAAR,KAAK,EAAE;;+DAAqB;AACpB;IAAR,KAAK,EAAE;;gEAAiB;AAChB;IAAR,KAAK,EAAE;;mEAAyB;AAExB;IAAR,KAAK,EAAE;8BAAuB,oBAAoB;6EAA6B;AAGxD;IAAvB,KAAK,CAAC,eAAe,CAAC;;oEAAkB;AAClB;IAAtB,KAAK,CAAC,cAAc,CAAC;;mEAAiB;AACtB;IAAhB,KAAK,CAAC,QAAQ,CAAC;8BAAU,iBAAiB;+DAAA;AA/ChC,+BAA+B;IAD3C,aAAa,CAAC,oCAAoC,CAAC;GACvC,+BAA+B,CAmW3C","sourcesContent":["import '@material/web/icon/icon.js'\nimport '@operato/image-marker/ox-image-marker.js'\nimport '@operato/image-marker/ox-image-marker-view.js'\n\nimport gql from 'graphql-tag'\nimport { css, html, PropertyValues } from 'lit'\nimport { customElement, query, state } from 'lit/decorators.js'\nimport { consume } from '@lit/context'\nimport { ScopedElementsMixin } from '@open-wc/scoped-elements'\n\nimport { PageView } from '@operato/shell'\nimport { CommonGristStyles, ScrollbarStyles } from '@operato/styles'\nimport { PageLifecycle } from '@operato/shell/dist/src/app/pages/page-view'\nimport { client } from '@operato/graphql'\nimport { notify } from '@operato/layout'\nimport { Shape } from '@operato/image-marker'\n\nimport { DrawingImageProvider } from '@dssp/drawing/dist-client/drawing-management/drawing-image-provider.js'\n\nimport './component/building-inspection-detail-header'\nimport { BuildingInspectionStatus } from './building-inspection-list'\n\n@customElement('building-inspection-detail-drawing')\nexport class BuildingInspectionDetailDrawing extends ScopedElementsMixin(PageView) {\n static styles = [\n ScrollbarStyles,\n CommonGristStyles,\n css`\n :host {\n display: grid;\n grid-template-rows: 55px auto;\n color: #4e5055;\n\n width: 100%;\n background-color: var(--md-sys-color-background, #f6f6f6);\n overflow-y: auto;\n\n --grid-record-emphasized-background-color: red;\n --grid-record-emphasized-color: yellow;\n }\n\n div[body] {\n display: flex;\n justify-content: center;\n\n ox-image-marker-view {\n width: 100%;\n }\n }\n\n dialog ox-image-marker-view {\n width: 80vw;\n height: 80vh;\n }\n `\n ]\n\n @state() project: any = {}\n @state() buildingInspection: any = {}\n @state() buildingInspectionId: string = ''\n @state() imageUrl?: string\n @state() shapes: Shape[] = []\n @state() linkUrl?: string\n @state() linkShapes: Shape[] = []\n\n @state() drawingImageProvider: DrawingImageProvider = new DrawingImageProvider()\n // @consume({ context: OxUserPreferencesContext, subscribe: true })\n\n @query('#image-marker') imageMarker!: any\n @query('#link-viewer') linkViewer!: any\n @query('dialog') dialog!: HTMLDialogElement\n\n get context() {\n return {\n title: '검측 관리 상세 - 검측 도면'\n }\n }\n\n connectedCallback(): void {\n super.connectedCallback()\n\n requestAnimationFrame(() => {\n this.dialog.addEventListener('click', event => {\n const rect = this.dialog.getBoundingClientRect()\n const isInDialog =\n rect.top <= event.clientY && event.clientY <= rect.bottom && rect.left <= event.clientX && event.clientX <= rect.right\n\n // 다이아로그 내부를 클릭한 것이 아니면 다이아로그 닫기\n if (!isInDialog) {\n this.dialog.close()\n }\n })\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 .projectId=${this.project.id}\n ></building-inspection-detail-header>\n\n <div\n body\n @link-clicked=${async (e: CustomEvent) => {\n const { link } = e.detail\n const { id, type, symbol, box, dwgId } = JSON.parse(link) || {}\n\n // 좌표 파싱 및 유효성 검증\n const coordinates = this.parseBoxCoordinates(box, {\n id,\n type,\n symbol,\n dwgId,\n currentPdfId: this.linkUrl || 'unknown',\n buildingInspectionId: this.buildingInspectionId\n })\n\n this.linkUrl = `DWGID:${dwgId}`\n\n // 유효한 좌표가 있으면 마커 표시, 없으면 빈 배열\n if (coordinates) {\n this.linkShapes = [\n {\n id: id || 'unknown',\n type: 'link' as const,\n ...coordinates,\n link: JSON.stringify({ id, type, symbol, dwgId })\n }\n ]\n } else {\n // 좌표가 유효하지 않아도 팝업은 열고 마커만 숨김\n this.linkShapes = []\n console.warn('Invalid link coordinates, popup will open without marker:', {\n box,\n id,\n type,\n symbol,\n dwgId,\n currentPdfId: this.linkUrl || 'unknown',\n buildingInspectionId: this.buildingInspectionId,\n fullLink: link\n })\n }\n\n if (this.dialog) {\n this.dialog.showModal()\n\n requestAnimationFrame(() => {\n this.linkViewer.reset()\n })\n }\n }}\n >\n ${this.buildingInspection?.status == BuildingInspectionStatus.PASS\n ? html`<ox-image-marker-view\n id=\"image-marker\"\n .imageUrl=${this.imageUrl}\n .shapes=${this.shapes}\n .imageProvider=${this.drawingImageProvider}\n ></ox-image-marker-view>`\n : html` <ox-image-marker\n id=\"image-marker\"\n .imageUrl=${this.imageUrl}\n .shapes=${this.shapes}\n .imageProvider=${this.drawingImageProvider}\n @shapes-changed=${this.onClickMarkerSave}\n .currentMode=${'view'}\n ></ox-image-marker>`}\n </div>\n\n <dialog>\n <ox-image-marker-view\n id=\"link-viewer\"\n .imageUrl=${this.linkUrl}\n .shapes=${this.linkShapes}\n .imageProvider=${this.drawingImageProvider}\n ></ox-image-marker-view>\n </dialog>\n `\n }\n\n protected async updated(changes: PropertyValues): Promise<void> {\n if (changes.has('buildingInspection') && this.buildingInspection?.checklist) {\n // 1-1. 위치 정보 - 체크리스트에 들어가는 위치정보 텍스트\n const location_1 = this.buildingInspection.checklist?.location\n\n // 1-2. 위치 정보 - 실제 위치정보 텍스트 (동 + 층) - ID 필드를 사용하면 DB ID 필드입니다.\n const location_building = this.buildingInspection.buildingLevel.building.name\n const location_floor = this.buildingInspection.buildingLevel.floor\n\n // 2. 평면도 pdf 파일\n // mainDrawing {\n // id\n // name\n // fullpath\n // }\n const mainDrawing = this.buildingInspection.buildingLevel.mainDrawing\n\n // 3. 선택 도면\n const inspectionDrawingType = this.buildingInspection.checklist.inspectionDrawingType\n\n const shapes = JSON.parse(this.buildingInspection?.drawingMarker || null) || []\n const markers = await this.drawingImageProvider.getMarkers(inspectionDrawingType)\n\n this.imageUrl = String(inspectionDrawingType).normalize('NFC')\n this.shapes = [...shapes, ...markers]\n }\n }\n\n async pageUpdated(changes: any, lifecycle: PageLifecycle) {\n if (this.active) {\n this.buildingInspectionId = lifecycle.resourceId || ''\n await this.initBuildingInspection(this.buildingInspectionId)\n\n this.imageMarker?.reset()\n } else {\n this.dialog?.close()\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 drawingMarker\n checklist {\n location\n inspectionDrawingType\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 async onClickMarkerSave(e) {\n const response = await client.query({\n query: gql`\n mutation UpdateBuildingInspection($patch: UpdateBuildingInspection!) {\n updateBuildingInspection(patch: $patch) {\n id\n drawingMarker\n }\n }\n `,\n variables: {\n patch: {\n id: this.buildingInspectionId,\n drawingMarker: JSON.stringify(e.detail)\n }\n }\n })\n\n if (response.errors) return\n\n notify({ message: '저장되었습니다.' })\n }\n\n private parseBoxCoordinates(\n box: string | undefined,\n context: {\n id?: string\n type?: string\n symbol?: string\n dwgId?: string\n currentPdfId?: string\n buildingInspectionId?: string\n } = {}\n ): {\n x: number\n y: number\n width: number\n height: number\n } | null {\n if (!box || typeof box !== 'string') {\n console.warn('Invalid box coordinate for link:', {\n box,\n context,\n reason: 'Box is undefined, null, or not a string'\n })\n return null\n }\n\n try {\n const coords = box.split(',').map(str => {\n const num = Number(str.trim())\n return Number.isFinite(num) ? num : NaN\n })\n\n if (coords.length !== 4 || coords.some(coord => isNaN(coord))) {\n console.warn('Box coordinate should have 4 valid numbers:', {\n box,\n parsedCoords: coords,\n context,\n reason: `Expected 4 numbers, got ${coords.length} values with NaN: ${coords.some(coord => isNaN(coord))}`\n })\n return null\n }\n\n const [x, y, width, height] = coords\n\n // width, height가 0 이하면 유효하지 않음\n if (width <= 0 || height <= 0) {\n console.warn('Invalid width or height for link:', {\n box,\n coords: { x, y, width, height },\n context,\n reason: `Width (${width}) or height (${height}) is <= 0`\n })\n return null\n }\n\n return { x, y, width, height }\n } catch (error) {\n console.warn('Error parsing box coordinates:', {\n box,\n context,\n error: error instanceof Error ? error.message : String(error),\n reason: 'Exception thrown during parsing'\n })\n return null\n }\n }\n}\n"]}
|