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

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (58) hide show
  1. package/dist-client/pages/building-inspection/building-inspection-list.js +2 -2
  2. package/dist-client/pages/building-inspection/building-inspection-list.js.map +1 -1
  3. package/dist-client/pages/building-inspection/building-inspection-management.d.ts +8 -0
  4. package/dist-client/pages/building-inspection/building-inspection-management.js +297 -45
  5. package/dist-client/pages/building-inspection/building-inspection-management.js.map +1 -1
  6. package/dist-client/pages/building-inspection/component/field-document/field-document-constants.d.ts +18 -0
  7. package/dist-client/pages/building-inspection/component/field-document/field-document-constants.js +630 -0
  8. package/dist-client/pages/building-inspection/component/field-document/field-document-constants.js.map +1 -0
  9. package/dist-client/pages/building-inspection/component/field-document/field-document-detail-popup.d.ts +10 -0
  10. package/dist-client/pages/building-inspection/component/field-document/field-document-detail-popup.js +219 -0
  11. package/dist-client/pages/building-inspection/component/field-document/field-document-detail-popup.js.map +1 -0
  12. package/dist-client/pages/building-inspection/component/field-document/field-document-list-panel.d.ts +22 -0
  13. package/dist-client/pages/building-inspection/component/field-document/field-document-list-panel.js +472 -0
  14. package/dist-client/pages/building-inspection/component/field-document/field-document-list-panel.js.map +1 -0
  15. package/dist-client/pages/building-inspection/component/field-document/field-document-popup.d.ts +38 -0
  16. package/dist-client/pages/building-inspection/component/field-document/field-document-popup.js +651 -0
  17. package/dist-client/pages/building-inspection/component/field-document/field-document-popup.js.map +1 -0
  18. package/dist-client/pages/building-inspection/component/inspection-event-provider.d.ts +3 -2
  19. package/dist-client/pages/building-inspection/component/inspection-event-provider.js +129 -34
  20. package/dist-client/pages/building-inspection/component/inspection-event-provider.js.map +1 -1
  21. package/dist-client/pages/checklist-template/construction-checklist-template-list.js +9 -14
  22. package/dist-client/pages/checklist-template/construction-checklist-template-list.js.map +1 -1
  23. package/dist-client/pages/project-checklist/project-checklist-management.d.ts +2 -0
  24. package/dist-client/pages/project-checklist/project-checklist-management.js +24 -2
  25. package/dist-client/pages/project-checklist/project-checklist-management.js.map +1 -1
  26. package/dist-client/route.d.ts +1 -1
  27. package/dist-client/tsconfig.tsbuildinfo +1 -1
  28. package/dist-server/service/building-inspection/building-inspection-query.d.ts +5 -1
  29. package/dist-server/service/building-inspection/building-inspection-query.js +114 -0
  30. package/dist-server/service/building-inspection/building-inspection-query.js.map +1 -1
  31. package/dist-server/service/building-inspection/building-inspection-type.d.ts +4 -0
  32. package/dist-server/service/building-inspection/building-inspection-type.js +15 -1
  33. package/dist-server/service/building-inspection/building-inspection-type.js.map +1 -1
  34. package/dist-server/service/building-inspection/index.d.ts +1 -1
  35. package/dist-server/service/field-document/field-document-auto-file.d.ts +21 -0
  36. package/dist-server/service/field-document/field-document-auto-file.js +47 -0
  37. package/dist-server/service/field-document/field-document-auto-file.js.map +1 -0
  38. package/dist-server/service/field-document/field-document-mutation.d.ts +9 -0
  39. package/dist-server/service/field-document/field-document-mutation.js +136 -0
  40. package/dist-server/service/field-document/field-document-mutation.js.map +1 -0
  41. package/dist-server/service/field-document/field-document-query.d.ts +13 -0
  42. package/dist-server/service/field-document/field-document-query.js +107 -0
  43. package/dist-server/service/field-document/field-document-query.js.map +1 -0
  44. package/dist-server/service/field-document/field-document-summary-service.d.ts +2 -0
  45. package/dist-server/service/field-document/field-document-summary-service.js +55 -0
  46. package/dist-server/service/field-document/field-document-summary-service.js.map +1 -0
  47. package/dist-server/service/field-document/field-document-type.d.ts +22 -0
  48. package/dist-server/service/field-document/field-document-type.js +83 -0
  49. package/dist-server/service/field-document/field-document-type.js.map +1 -0
  50. package/dist-server/service/field-document/field-document.d.ts +28 -0
  51. package/dist-server/service/field-document/field-document.js +123 -0
  52. package/dist-server/service/field-document/field-document.js.map +1 -0
  53. package/dist-server/service/field-document/index.d.ts +5 -0
  54. package/dist-server/service/field-document/index.js +9 -0
  55. package/dist-server/service/field-document/index.js.map +1 -0
  56. package/dist-server/service/index.d.ts +1 -1
  57. package/dist-server/tsconfig.tsbuildinfo +1 -1
  58. package/package.json +4 -4
@@ -0,0 +1 @@
1
+ {"version":3,"file":"field-document-popup.js","sourceRoot":"","sources":["../../../../../client/pages/building-inspection/component/field-document/field-document-popup.ts"],"names":[],"mappings":";AAAA,OAAO,4BAA4B,CAAA;AACnC,OAAO,uCAAuC,CAAA;AAC9C,OAAO,yCAAyC,CAAA;AAChD,OAAO,6BAA6B,CAAA;AAEpC,OAAO,EAAE,eAAe,EAAE,MAAM,iBAAiB,CAAA;AACjD,OAAO,EAAE,GAAG,EAAE,IAAI,EAAE,UAAU,EAAE,MAAM,KAAK,CAAA;AAC3C,OAAO,EAAE,aAAa,EAAE,QAAQ,EAAE,KAAK,EAAE,MAAM,mBAAmB,CAAA;AAClE,OAAO,EAAE,MAAM,EAAE,MAAM,kBAAkB,CAAA;AACzC,OAAO,EAAE,MAAM,EAAE,MAAM,iBAAiB,CAAA;AACxC,OAAO,EAAE,SAAS,EAAE,MAAM,iBAAiB,CAAA;AAC3C,OAAO,GAAG,MAAM,aAAa,CAAA;AAE7B,OAAO,EAEL,8BAA8B,EAC9B,sBAAsB,EACvB,MAAM,4BAA4B,CAAA;AACnC,OAAO,+BAA+B,CAAA;AAG/B,IAAM,kBAAkB,GAAxB,MAAM,kBAAmB,SAAQ,UAAU;IAA3C;;QA6KuB,cAAS,GAAW,EAAE,CAAA;QAEjC,kBAAa,GAA0B,IAAI,CAAA;QAC3C,mBAAc,GAA0B,IAAI,CAAA;QAC5C,kBAAa,GAA0B,IAAI,CAAA;QAC3C,cAAS,GAAU,EAAE,CAAA;QACrB,mBAAc,GAAgB,IAAI,GAAG,EAAE,CAAA;QACvC,eAAU,GAAwB,IAAI,GAAG,EAAE,CAAA;QAC3C,iBAAY,GAAW,EAAE,CAAA;IA0b5C,CAAC;IAxbC,MAAM;;QACJ,MAAM,MAAM,GAAG,8BAA8B,CAAA;QAC7C,MAAM,OAAO,GAAG,CAAA,MAAA,IAAI,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;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;KAuKF;CACF,AA1KY,CA0KZ;AAE2B;IAA3B,QAAQ,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC;;qDAAuB;AAEjC;IAAhB,KAAK,EAAE;;yDAAoD;AAC3C;IAAhB,KAAK,EAAE;;0DAAqD;AAC5C;IAAhB,KAAK,EAAE;;yDAAoD;AAC3C;IAAhB,KAAK,EAAE;;qDAA8B;AACrB;IAAhB,KAAK,EAAE;8BAAyB,GAAG;0DAAoB;AACvC;IAAhB,KAAK,EAAE;8BAAqB,GAAG;sDAA4B;AAC3C;IAAhB,KAAK,EAAE;;wDAAkC;AArL/B,kBAAkB;IAD9B,aAAa,CAAC,sBAAsB,CAAC;GACzB,kBAAkB,CA+mB9B","sourcesContent":["import '@material/web/icon/icon.js'\nimport '@material/web/button/filled-button.js'\nimport '@material/web/button/outlined-button.js'\nimport './field-document-list-panel'\n\nimport { ScrollbarStyles } from '@operato/styles'\nimport { css, html, LitElement } from 'lit'\nimport { customElement, property, state } from 'lit/decorators.js'\nimport { client } from '@operato/graphql'\nimport { notify } from '@operato/layout'\nimport { openPopup } from '@operato/layout'\nimport gql from 'graphql-tag'\n\nimport {\n Classification,\n FIELD_DOCUMENT_CLASSIFICATIONS,\n findClassificationPath\n} from './field-document-constants'\nimport './field-document-detail-popup'\n\n@customElement('field-document-popup')\nexport class FieldDocumentPopup extends LitElement {\n static styles = [\n ScrollbarStyles,\n css`\n :host {\n display: grid;\n grid-template-rows: auto 1fr auto;\n background-color: #fff;\n width: 100%;\n height: 80vh;\n overflow: hidden;\n }\n\n div[header] {\n display: flex;\n align-items: center;\n padding: 12px 20px;\n border-bottom: 1px solid #e0e0e0;\n background: linear-gradient(135deg, #f8f9fa, #e8eef5);\n\n h2 {\n display: flex;\n align-items: center;\n gap: 8px;\n margin: 0;\n font-size: 16px;\n color: #3f71a0;\n\n md-icon {\n --md-icon-size: 22px;\n }\n }\n\n span[breadcrumb] {\n margin-left: auto;\n font-size: 12px;\n color: #888;\n }\n }\n\n div[content] {\n display: grid;\n grid-template-columns: 3fr 7fr;\n overflow: hidden;\n }\n\n div[classification-panel] {\n display: grid;\n grid-template-columns: 1fr 1fr 1fr;\n border-right: 1px solid #e0e0e0;\n overflow: hidden;\n }\n\n div[column] {\n display: flex;\n flex-direction: column;\n border-right: 1px solid #eee;\n overflow-y: auto;\n\n &:last-child {\n border-right: none;\n }\n\n div[column-header] {\n position: sticky;\n top: 0;\n background: #f5f5f5;\n padding: 8px 12px;\n font-size: 12px;\n font-weight: bold;\n color: #666;\n border-bottom: 1px solid #e0e0e0;\n z-index: 1;\n }\n\n div[item] {\n display: flex;\n align-items: center;\n padding: 8px 12px;\n cursor: pointer;\n font-size: 13px;\n color: #333;\n border-bottom: 1px solid #f0f0f0;\n transition: background-color 0.15s;\n\n &:hover {\n background-color: #e3f2fd;\n }\n\n span[code] {\n font-size: 11px;\n color: #999;\n margin-right: 6px;\n min-width: 32px;\n }\n\n span[name] {\n flex: 1;\n overflow: hidden;\n text-overflow: ellipsis;\n white-space: nowrap;\n }\n\n span[count] {\n font-size: 11px;\n color: #fff;\n background: #0595e5;\n border-radius: 10px;\n padding: 1px 6px;\n min-width: 16px;\n text-align: center;\n margin-left: 4px;\n }\n }\n\n div[item][selected] {\n background-color: #0595e5;\n color: #fff;\n\n span[code] {\n color: rgba(255, 255, 255, 0.7);\n }\n\n span[count] {\n background: rgba(255, 255, 255, 0.3);\n }\n }\n\n div[item][drag-over] {\n background-color: #bbdefb;\n outline: 2px dashed #1976d2;\n }\n }\n\n div[footer] {\n display: flex;\n align-items: center;\n justify-content: center;\n gap: 8px;\n padding: 12px 20px;\n border-top: 1px solid #e0e0e0;\n background: #f8f8f8;\n\n md-filled-button {\n --md-filled-button-container-height: 36px;\n --md-filled-button-trailing-space: 16px;\n --md-filled-button-leading-space: 16px;\n }\n\n md-filled-button[share] {\n --md-filled-button-container-color: #607d8b;\n }\n md-filled-button[move] {\n --md-filled-button-container-color: #ff9800;\n }\n md-filled-button[favorite] {\n --md-filled-button-container-color: #ffc107;\n --md-filled-button-label-text-color: #333;\n }\n md-filled-button[upload] {\n --md-filled-button-container-color: #4caf50;\n }\n md-filled-button[delete] {\n --md-filled-button-container-color: #f44336;\n }\n }\n\n ox-input-file {\n display: none;\n }\n `\n ]\n\n @property({ type: String }) projectId: string = ''\n\n @state() private selectedMajor: Classification | null = null\n @state() private selectedMiddle: Classification | null = null\n @state() private selectedMinor: Classification | null = null\n @state() private documents: any[] = []\n @state() private selectedDocIds: Set<string> = new Set()\n @state() private codeCounts: Map<string, number> = new Map()\n @state() private dragOverItem: string = ''\n\n render() {\n const majors = FIELD_DOCUMENT_CLASSIFICATIONS\n const middles = this.selectedMajor?.children || []\n const minors = this.selectedMiddle?.children || []\n\n return html`\n <div header>\n <h2>\n <md-icon>folder_open</md-icon>\n 현장 문서 확인\n </h2>\n <span breadcrumb>\n ${this.selectedMajor ? this.selectedMajor.name : ''}\n ${this.selectedMiddle ? ` > ${this.selectedMiddle.name}` : ''}\n ${this.selectedMinor ? ` > ${this.selectedMinor.name}` : ''}\n </span>\n </div>\n\n <div content>\n <div classification-panel>\n <div column>\n <div column-header>대분류</div>\n ${majors.map(\n item => html`\n <div\n item\n ?selected=${this.selectedMajor?.code === item.code}\n @click=${() => this._selectMajor(item)}\n @dragover=${(e: DragEvent) => this._onFolderDragOver(e, item.code)}\n @dragleave=${() => (this.dragOverItem = '')}\n @drop=${(e: DragEvent) => this._onFolderDrop(e, item.code)}\n ?drag-over=${this.dragOverItem === item.code}\n >\n <span code>${item.code}</span>\n <span name>${item.name}</span>\n ${this._getMajorCount(item.code) > 0\n ? html`<span count>${this._getMajorCount(item.code)}</span>`\n : ''}\n </div>\n `\n )}\n </div>\n\n <div column>\n <div column-header>중분류</div>\n ${middles.map(\n item => html`\n <div\n item\n ?selected=${this.selectedMiddle?.code === item.code}\n @click=${() => this._selectMiddle(item)}\n @dragover=${(e: DragEvent) => this._onFolderDragOver(e, item.code)}\n @dragleave=${() => (this.dragOverItem = '')}\n @drop=${(e: DragEvent) => this._onFolderDrop(e, item.code)}\n ?drag-over=${this.dragOverItem === item.code}\n >\n <span code>${item.code}</span>\n <span name>${item.name}</span>\n ${this._getMiddleCount(item.code) > 0\n ? html`<span count>${this._getMiddleCount(item.code)}</span>`\n : ''}\n </div>\n `\n )}\n </div>\n\n <div column>\n <div column-header>소분류</div>\n ${minors.map(\n item => html`\n <div\n item\n ?selected=${this.selectedMinor?.code === item.code}\n @click=${() => this._selectMinor(item)}\n @dragover=${(e: DragEvent) => this._onFolderDragOver(e, item.code)}\n @dragleave=${() => (this.dragOverItem = '')}\n @drop=${(e: DragEvent) => this._onFolderDrop(e, item.code)}\n ?drag-over=${this.dragOverItem === item.code}\n >\n <span code>${item.code}</span>\n <span name>${item.name}</span>\n ${(this.codeCounts.get(item.code) || 0) > 0\n ? html`<span count>${this.codeCounts.get(item.code)}</span>`\n : ''}\n </div>\n `\n )}\n </div>\n </div>\n\n <field-document-list-panel\n .projectId=${this.projectId}\n .code=${this.selectedMinor?.code || ''}\n .folderName=${this.selectedMinor?.name || ''}\n .documents=${this.documents}\n @document-selected=${(e: CustomEvent) => (this.selectedDocIds = e.detail)}\n @documents-changed=${(e: CustomEvent) => this._onDocumentsChanged(e)}\n @open-detail=${(e: CustomEvent) => this._openDetail(e.detail)}\n ></field-document-list-panel>\n </div>\n\n <div footer>\n <md-filled-button share @click=${this._shareDocuments}>\n <md-icon slot=\"icon\">share</md-icon>공유\n </md-filled-button>\n <md-filled-button move @click=${this._openMoveDialog}>\n <md-icon slot=\"icon\">drive_file_move</md-icon>이동\n </md-filled-button>\n <md-filled-button favorite @click=${this._toggleFavorites}>\n <md-icon slot=\"icon\">star</md-icon>즐겨찾기\n </md-filled-button>\n <md-filled-button upload @click=${this._triggerUpload}>\n <md-icon slot=\"icon\">upload</md-icon>업로드\n </md-filled-button>\n <md-filled-button delete @click=${this._deleteDocuments}>\n <md-icon slot=\"icon\">delete</md-icon>삭제\n </md-filled-button>\n\n <ox-input-file\n id=\"file-input\"\n accept=\"*/*\"\n multiple=\"true\"\n hide-filelist\n @change=${this._onFileSelected}\n ></ox-input-file>\n </div>\n `\n }\n\n async firstUpdated() {\n await this._loadCounts()\n // 첫 번째 대분류 자동 선택\n if (FIELD_DOCUMENT_CLASSIFICATIONS.length > 0) {\n this._selectMajor(FIELD_DOCUMENT_CLASSIFICATIONS[0])\n }\n }\n\n private _selectMajor(item: Classification) {\n this.selectedMajor = item\n this.selectedMiddle = null\n this.selectedMinor = null\n this.documents = []\n this.selectedDocIds = new Set()\n\n if (item.children?.length) {\n this._selectMiddle(item.children[0])\n }\n }\n\n private _selectMiddle(item: Classification) {\n this.selectedMiddle = item\n this.selectedMinor = null\n this.documents = []\n this.selectedDocIds = new Set()\n\n if (item.children?.length) {\n this._selectMinor(item.children[0])\n }\n }\n\n private async _selectMinor(item: Classification) {\n this.selectedMinor = item\n this.selectedDocIds = new Set()\n await this._loadDocuments()\n }\n\n private async _loadDocuments() {\n if (!this.selectedMinor?.code || !this.projectId) {\n this.documents = []\n return\n }\n\n const response = await client.query({\n query: gql`\n query FieldDocumentsByCode($projectId: String!, $code: String!) {\n fieldDocumentsByCode(projectId: $projectId, code: $code) {\n items {\n id\n name\n code\n isFavorite\n aiSummary\n aiSummaryStatus\n sourceType\n fullpath\n createdAt\n creator {\n id\n name\n }\n }\n total\n }\n }\n `,\n variables: { projectId: this.projectId, code: this.selectedMinor.code }\n })\n\n this.documents = response.data?.fieldDocumentsByCode?.items || []\n }\n\n private async _loadCounts() {\n if (!this.projectId) return\n\n const response = await client.query({\n query: gql`\n query FieldDocumentCountsByProject($projectId: String!) {\n fieldDocumentCountsByProject(projectId: $projectId) {\n code\n count\n }\n }\n `,\n variables: { projectId: this.projectId }\n })\n\n const counts = response.data?.fieldDocumentCountsByProject || []\n this.codeCounts = new Map(counts.map((c: any) => [c.code, c.count]))\n }\n\n private _getMajorCount(majorCode: string): number {\n let total = 0\n for (const [code, count] of this.codeCounts) {\n if (code.startsWith(majorCode)) total += count\n }\n return total\n }\n\n private _getMiddleCount(middleCode: string): number {\n let total = 0\n for (const [code, count] of this.codeCounts) {\n if (code.startsWith(middleCode)) total += count\n }\n return total\n }\n\n private async _shareDocuments() {\n const selected = this.documents.filter(d => this.selectedDocIds.has(d.id))\n if (!selected.length) {\n notify({ message: '공유할 문서를 선택해주세요.', level: 'info' })\n return\n }\n\n if (navigator.share) {\n try {\n await navigator.share({\n title: '현장 문서',\n text: selected.map(d => d.name).join(', '),\n url: window.location.href\n })\n } catch {\n // 사용자 취소\n }\n } else {\n const links = selected.map(d => d.fullpath || d.name).join('\\n')\n await navigator.clipboard.writeText(links)\n notify({ message: '링크가 복사되었습니다.' })\n }\n }\n\n private _openMoveDialog() {\n if (!this.selectedDocIds.size) {\n notify({ message: '이동할 문서를 선택해주세요.', level: 'info' })\n return\n }\n notify({ message: '이동할 폴더를 왼쪽 분류 패널에서 선택하거나, 문서를 드래그하여 폴더에 놓으세요.', level: 'info' })\n }\n\n private async _toggleFavorites() {\n if (!this.selectedDocIds.size) {\n notify({ message: '즐겨찾기할 문서를 선택해주세요.', level: 'info' })\n return\n }\n\n for (const id of this.selectedDocIds) {\n await client.mutate({\n mutation: gql`\n mutation ToggleFieldDocumentFavorite($id: String!) {\n toggleFieldDocumentFavorite(id: $id) {\n id\n isFavorite\n }\n }\n `,\n variables: { id }\n })\n }\n\n await this._loadDocuments()\n notify({ message: '즐겨찾기가 변경되었습니다.' })\n }\n\n private _triggerUpload() {\n if (!this.selectedMinor?.code) {\n notify({ message: '파일을 업로드할 소분류 폴더를 먼저 선택해주세요.', level: 'info' })\n return\n }\n\n const fileInput = this.renderRoot.querySelector('#file-input') as HTMLElement\n fileInput?.click()\n }\n\n private async _onFileSelected(e: CustomEvent) {\n const files = e.detail as File[]\n if (!files?.length || !this.selectedMinor?.code) return\n\n await this._uploadFiles(files, this.selectedMinor.code)\n }\n\n private async _uploadFiles(files: File[], code: string) {\n for (const file of files) {\n await client.mutate({\n mutation: gql`\n mutation CreateFieldDocument($patch: NewFieldDocument!) {\n createFieldDocument(patch: $patch) {\n id\n }\n }\n `,\n variables: {\n patch: {\n projectId: this.projectId,\n code,\n name: file.name,\n file\n }\n },\n context: { hasUpload: true }\n })\n }\n\n await this._loadDocuments()\n await this._loadCounts()\n notify({ message: `${files.length}개 파일이 업로드되었습니다.` })\n }\n\n private async _deleteDocuments() {\n if (!this.selectedDocIds.size) {\n notify({ message: '삭제할 문서를 선택해주세요.', level: 'info' })\n return\n }\n\n if (!confirm('선택한 문서를 삭제하시겠습니까?')) return\n\n const ids = Array.from(this.selectedDocIds)\n\n const response = await client.mutate({\n mutation: gql`\n mutation DeleteFieldDocuments($ids: [String!]!) {\n deleteFieldDocuments(ids: $ids)\n }\n `,\n variables: { ids }\n })\n\n if (!response.errors) {\n this.selectedDocIds = new Set()\n await this._loadDocuments()\n await this._loadCounts()\n notify({ message: '삭제되었습니다.' })\n }\n }\n\n private _onFolderDragOver(e: DragEvent, code: string) {\n const types = e.dataTransfer?.types || []\n if (types.includes('application/x-field-document-ids')) {\n e.preventDefault()\n this.dragOverItem = code\n\n // 대분류/중분류 위에 hover 시 자동 확장\n if (code.length === 2) {\n const major = FIELD_DOCUMENT_CLASSIFICATIONS.find(m => m.code === code)\n if (major && this.selectedMajor?.code !== code) {\n clearTimeout(this._expandTimeout)\n this._expandTimeout = setTimeout(() => this._selectMajor(major), 500)\n }\n } else if (code.length === 4) {\n const middles = this.selectedMajor?.children || []\n const middle = middles.find(m => m.code === code)\n if (middle && this.selectedMiddle?.code !== code) {\n clearTimeout(this._expandTimeout)\n this._expandTimeout = setTimeout(() => {\n this.selectedMiddle = middle\n this.selectedMinor = null\n }, 500)\n }\n }\n }\n }\n\n private _expandTimeout: any\n\n private async _onFolderDrop(e: DragEvent, code: string) {\n e.preventDefault()\n this.dragOverItem = ''\n clearTimeout(this._expandTimeout)\n\n const idsJson = e.dataTransfer?.getData('application/x-field-document-ids')\n if (!idsJson) return\n\n const ids: string[] = JSON.parse(idsJson)\n\n // 소분류 코드에만 이동 가능\n if (code.length !== 6) {\n notify({ message: '소분류 폴더에만 이동할 수 있습니다.', level: 'info' })\n return\n }\n\n const response = await client.mutate({\n mutation: gql`\n mutation MoveFieldDocuments($ids: [String!]!, $targetCode: String!) {\n moveFieldDocuments(ids: $ids, targetCode: $targetCode)\n }\n `,\n variables: { ids, targetCode: code }\n })\n\n if (!response.errors) {\n const path = findClassificationPath(code)\n notify({ message: `${ids.length}개 문서가 \"${path.minor?.name || code}\" 폴더로 이동되었습니다.` })\n await this._loadDocuments()\n await this._loadCounts()\n }\n }\n\n private async _onDocumentsChanged(e: CustomEvent) {\n const files = e.detail?.files as File[]\n if (files?.length && this.selectedMinor?.code) {\n await this._uploadFiles(files, this.selectedMinor.code)\n } else {\n await this._loadDocuments()\n }\n }\n\n private _openDetail(doc: any) {\n openPopup(\n html`<field-document-detail-popup .document=${doc}></field-document-detail-popup>`,\n { backdrop: true, size: 'large', title: doc.name }\n )\n }\n}\n"]}
@@ -1,8 +1,9 @@
1
1
  import { BizEvent, CALENDAR, EventProvider } from '@operato/event-view';
2
2
  export declare class InspectionEventProvider implements EventProvider {
3
- buildingLevelId: {};
3
+ buildingLevelId: string;
4
+ buildingId: string;
4
5
  projectId: string;
5
- constructor(buildingLevelId?: string, projectId?: string);
6
+ constructor(buildingLevelId?: string, projectId?: string, buildingId?: string);
6
7
  fetchEventsForCalendar(calendar: CALENDAR): Promise<Map<Date, BizEvent[]>>;
7
8
  private getCalendarTemplate;
8
9
  }
@@ -3,52 +3,134 @@ import gql from 'graphql-tag';
3
3
  import { client } from '@operato/graphql';
4
4
  import moment from 'moment-timezone';
5
5
  export class InspectionEventProvider {
6
- constructor(buildingLevelId = '', projectId = '') {
7
- this.buildingLevelId = {};
6
+ constructor(buildingLevelId = '', projectId = '', buildingId = '') {
7
+ this.buildingLevelId = '';
8
+ this.buildingId = '';
8
9
  this.projectId = '';
9
10
  this.buildingLevelId = buildingLevelId;
10
11
  this.projectId = projectId;
12
+ this.buildingId = buildingId;
11
13
  }
12
14
  async fetchEventsForCalendar(calendar) {
13
- var _a, _b;
15
+ var _a, _b, _c, _d, _e, _f, _g, _h, _j;
14
16
  const result = new Map();
15
17
  const startDate = moment(calendar[0]['date']).format('YYYY-MM-DD');
16
18
  const endDate = moment(calendar[calendar.length - 1]['date']).format('YYYY-MM-DD');
17
- const response = await client.query({
18
- query: gql `
19
- query BuildingInspectionDateSummaryOfLevelAndPeriod(
20
- $buildingLevelId: String!
21
- $startDate: String!
22
- $endDate: String!
23
- $projectId: String!
24
- ) {
25
- buildingInspectionDateSummaryOfLevelAndPeriod(
26
- buildingLevelId: $buildingLevelId
27
- startDate: $startDate
28
- endDate: $endDate
19
+ let inspectionData = [];
20
+ let worklogDates = [];
21
+ if (this.buildingLevelId) {
22
+ // 층 레벨 조회
23
+ const response = await client.query({
24
+ query: gql `
25
+ query BuildingInspectionDateSummaryOfLevelAndPeriod(
26
+ $buildingLevelId: String!
27
+ $startDate: String!
28
+ $endDate: String!
29
+ $projectId: String!
29
30
  ) {
30
- requestDate
31
- wait
32
- request
33
- pass
34
- fail
35
- reWait
31
+ buildingInspectionDateSummaryOfLevelAndPeriod(
32
+ buildingLevelId: $buildingLevelId
33
+ startDate: $startDate
34
+ endDate: $endDate
35
+ ) {
36
+ requestDate
37
+ wait
38
+ request
39
+ pass
40
+ fail
41
+ reWait
42
+ }
43
+ dailyWorklogDatesOfProject(projectId: $projectId, startDate: $startDate, endDate: $endDate) {
44
+ id
45
+ date
46
+ }
36
47
  }
37
- dailyWorklogDatesOfProject(projectId: $projectId, startDate: $startDate, endDate: $endDate) {
38
- id
39
- date
48
+ `,
49
+ variables: {
50
+ buildingLevelId: this.buildingLevelId,
51
+ projectId: this.projectId,
52
+ startDate,
53
+ endDate
54
+ }
55
+ });
56
+ inspectionData = ((_a = response.data) === null || _a === void 0 ? void 0 : _a.buildingInspectionDateSummaryOfLevelAndPeriod) || [];
57
+ worklogDates = ((_c = (_b = response.data) === null || _b === void 0 ? void 0 : _b.dailyWorklogDatesOfProject) === null || _c === void 0 ? void 0 : _c.map(v => v.date)) || [];
58
+ }
59
+ else if (this.buildingId) {
60
+ // 동 레벨 조회
61
+ const response = await client.query({
62
+ query: gql `
63
+ query BuildingInspectionDateSummaryOfBuilding(
64
+ $buildingId: String!
65
+ $startDate: String!
66
+ $endDate: String!
67
+ $projectId: String!
68
+ ) {
69
+ buildingInspectionDateSummaryOfBuilding(
70
+ buildingId: $buildingId
71
+ startDate: $startDate
72
+ endDate: $endDate
73
+ ) {
74
+ requestDate
75
+ wait
76
+ request
77
+ pass
78
+ fail
79
+ reWait
80
+ }
81
+ dailyWorklogDatesOfProject(projectId: $projectId, startDate: $startDate, endDate: $endDate) {
82
+ id
83
+ date
84
+ }
40
85
  }
86
+ `,
87
+ variables: {
88
+ buildingId: this.buildingId,
89
+ projectId: this.projectId,
90
+ startDate,
91
+ endDate
92
+ }
93
+ });
94
+ inspectionData = ((_d = response.data) === null || _d === void 0 ? void 0 : _d.buildingInspectionDateSummaryOfBuilding) || [];
95
+ worklogDates = ((_f = (_e = response.data) === null || _e === void 0 ? void 0 : _e.dailyWorklogDatesOfProject) === null || _f === void 0 ? void 0 : _f.map(v => v.date)) || [];
41
96
  }
42
- `,
43
- variables: {
44
- buildingLevelId: this.buildingLevelId,
45
- projectId: this.projectId,
46
- startDate,
47
- endDate
97
+ else {
98
+ // 프로젝트 레벨 조회 (동 미선택 시)
99
+ const response = await client.query({
100
+ query: gql `
101
+ query BuildingInspectionDateSummaryOfProject(
102
+ $projectId: String!
103
+ $startDate: String!
104
+ $endDate: String!
105
+ ) {
106
+ buildingInspectionDateSummaryOfProject(
107
+ projectId: $projectId
108
+ startDate: $startDate
109
+ endDate: $endDate
110
+ ) {
111
+ requestDate
112
+ wait
113
+ request
114
+ pass
115
+ fail
116
+ reWait
48
117
  }
49
- });
50
- const calendarData = this.getCalendarTemplate((_a = response.data) === null || _a === void 0 ? void 0 : _a.buildingInspectionDateSummaryOfLevelAndPeriod);
51
- const worklogDates = ((_b = response.data) === null || _b === void 0 ? void 0 : _b.dailyWorklogDatesOfProject.map(v => v.date)) || [];
118
+ dailyWorklogDatesOfProject(projectId: $projectId, startDate: $startDate, endDate: $endDate) {
119
+ id
120
+ date
121
+ }
122
+ }
123
+ `,
124
+ variables: {
125
+ projectId: this.projectId,
126
+ startDate,
127
+ endDate
128
+ }
129
+ });
130
+ inspectionData = ((_g = response.data) === null || _g === void 0 ? void 0 : _g.buildingInspectionDateSummaryOfProject) || [];
131
+ worklogDates = ((_j = (_h = response.data) === null || _h === void 0 ? void 0 : _h.dailyWorklogDatesOfProject) === null || _j === void 0 ? void 0 : _j.map(v => v.date)) || [];
132
+ }
133
+ const calendarData = this.getCalendarTemplate(inspectionData);
52
134
  const worklogSet = new Set(worklogDates);
53
135
  calendar.forEach(({ date }) => {
54
136
  const formattedDate = date.toLocaleDateString('en-CA'); // 'en-CA'는 'YYYY-MM-DD' 형식으로 반환됩니다.
@@ -62,7 +144,20 @@ export class InspectionEventProvider {
62
144
  <div style="display:grid;grid-template-columns:repeat(2,1fr);padding-inline:7px;align-items:center;gap:4px;">
63
145
  ${template || html ``}
64
146
  ${hasWorklog
65
- ? html `<div style="justify-self:end"><md-icon style="color:#008000;">description</md-icon></div>`
147
+ ? html `<div style="justify-self:end">
148
+ <md-icon
149
+ style="color:#008000;cursor:pointer;"
150
+ @click=${(e) => {
151
+ e.stopPropagation();
152
+ e.preventDefault();
153
+ e.target.dispatchEvent(new CustomEvent('open-worklog', {
154
+ detail: { date: formattedDate },
155
+ bubbles: true,
156
+ composed: true
157
+ }));
158
+ }}
159
+ >description</md-icon>
160
+ </div>`
66
161
  : html ``}
67
162
  </div>
68
163
  `,
@@ -1 +1 @@
1
- {"version":3,"file":"inspection-event-provider.js","sourceRoot":"","sources":["../../../../client/pages/building-inspection/component/inspection-event-provider.ts"],"names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AC,CAAC,EAAE;YAC5G,IAAI,CAAC,OAAO,KAAK,CAAC,CAAC,CAAC,CAAC,IAAI,CAAA,gEAAgE,IAAI,CAAC,OAAO,QAAQ,CAAC,CAAC,CAAC,EAAE;YAClH,IAAI,CAAC,IAAI,KAAK,CAAC,CAAC,CAAC,CAAC,IAAI,CAAA,gEAAgE,IAAI,CAAC,IAAI,QAAQ,CAAC,CAAC,CAAC,EAAE;YAC5G,IAAI,CAAC,IAAI,KAAK,CAAC,CAAC,CAAC,CAAC,IAAI,CAAA,gEAAgE,IAAI,CAAC,IAAI,QAAQ,CAAC,CAAC,CAAC,EAAE;YAC5G,IAAI,CAAC,MAAM,CAAC,CAAC,CAAC,IAAI,CAAA,gEAAgE,IAAI,CAAC,MAAM,QAAQ,CAAC,CAAC,CAAC,EAAE;;OAE/G,CAAA;QACH,CAAC;QAED,OAAO,QAAQ,CAAA;IACjB,CAAC;CACF","sourcesContent":["import { BizEvent, CALENDAR, EventProvider } from '@operato/event-view'\nimport { html, TemplateResult } from 'lit'\nimport gql from 'graphql-tag'\nimport { client } from '@operato/graphql'\nimport moment from 'moment-timezone'\n\nexport class InspectionEventProvider implements EventProvider {\n buildingLevelId = {}\n projectId: string = ''\n\n constructor(buildingLevelId: string = '', projectId: string = '') {\n this.buildingLevelId = buildingLevelId\n this.projectId = projectId\n }\n\n async fetchEventsForCalendar(calendar: CALENDAR): Promise<Map<Date, BizEvent[]>> {\n const result = new Map<Date, BizEvent[]>()\n const startDate = moment(calendar[0]['date']).format('YYYY-MM-DD')\n const endDate = moment(calendar[calendar.length - 1]['date']).format('YYYY-MM-DD')\n\n const response = await client.query({\n query: gql`\n query BuildingInspectionDateSummaryOfLevelAndPeriod(\n $buildingLevelId: String!\n $startDate: String!\n $endDate: String!\n $projectId: String!\n ) {\n buildingInspectionDateSummaryOfLevelAndPeriod(\n buildingLevelId: $buildingLevelId\n startDate: $startDate\n endDate: $endDate\n ) {\n requestDate\n wait\n request\n pass\n fail\n reWait\n }\n dailyWorklogDatesOfProject(projectId: $projectId, startDate: $startDate, endDate: $endDate) {\n id\n date\n }\n }\n `,\n variables: {\n buildingLevelId: this.buildingLevelId,\n projectId: this.projectId,\n startDate,\n endDate\n }\n })\n\n const calendarData = this.getCalendarTemplate(response.data?.buildingInspectionDateSummaryOfLevelAndPeriod)\n const worklogDates: string[] = response.data?.dailyWorklogDatesOfProject.map(v => v.date) || []\n const worklogSet = new Set(worklogDates)\n\n calendar.forEach(({ date }) => {\n const formattedDate = date.toLocaleDateString('en-CA') // 'en-CA'는 'YYYY-MM-DD' 형식으로 반환됩니다.\n const template = calendarData[formattedDate]\n\n const hasWorklog = worklogSet.has(formattedDate)\n if (template || hasWorklog) {\n result.set(date, [\n {\n due: formattedDate,\n template: html`\n <div style=\"display:grid;grid-template-columns:repeat(2,1fr);padding-inline:7px;align-items:center;gap:4px;\">\n ${template || html``}\n ${hasWorklog\n ? html`<div style=\"justify-self:end\"><md-icon style=\"color:#008000;\">description</md-icon></div>`\n : html``}\n </div>\n `,\n title: '',\n color: '',\n clickEvent: e => console.log('calendar click', formattedDate)\n }\n ])\n }\n })\n\n return result\n }\n\n // 검측 개수가 있는 데이터들만 날짜별로 템플릿 만들기\n private getCalendarTemplate(inspectionData: any[] = []): { [date: string]: TemplateResult } {\n const template = {}\n for (let date of inspectionData) {\n template[date.requestDate] = html`\n <div style=\"display: grid; grid-template-columns: repeat(2, 1fr); padding-inline: 7px;\">\n ${date.wait !== 0 ? html`<div><span style=\"font-size: 1.3em; color: #4e5055\">●</span> ${date.wait}</div>` : ''}\n ${date.request !== 0 ? html`<div><span style=\"font-size: 1.3em; color: #2e79be\">●</span> ${date.request}</div>` : ''}\n ${date.pass !== 0 ? html`<div><span style=\"font-size: 1.3em; color: #1bb401\">●</span> ${date.pass}</div>` : ''}\n ${date.fail !== 0 ? html`<div><span style=\"font-size: 1.3em; color: #ff4444\">●</span> ${date.fail}</div>` : ''}\n ${date.reWait ? html`<div><span style=\"font-size: 1.3em; color: #e89c0e\">●</span> ${date.reWait}</div>` : ''}\n </div>\n `\n }\n\n return template\n }\n}\n"]}
1
+ {"version":3,"file":"inspection-event-provider.js","sourceRoot":"","sources":["../../../../client/pages/building-inspection/component/inspection-event-provider.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,IAAI,EAAkB,MAAM,KAAK,CAAA;AAC1C,OAAO,GAAG,MAAM,aAAa,CAAA;AAC7B,OAAO,EAAE,MAAM,EAAE,MAAM,kBAAkB,CAAA;AACzC,OAAO,MAAM,MAAM,iBAAiB,CAAA;AAEpC,MAAM,OAAO,uBAAuB;IAKlC,YAAY,kBAA0B,EAAE,EAAE,YAAoB,EAAE,EAAE,aAAqB,EAAE;QAJzF,oBAAe,GAAW,EAAE,CAAA;QAC5B,eAAU,GAAW,EAAE,CAAA;QACvB,cAAS,GAAW,EAAE,CAAA;QAGpB,IAAI,CAAC,eAAe,GAAG,eAAe,CAAA;QACtC,IAAI,CAAC,SAAS,GAAG,SAAS,CAAA;QAC1B,IAAI,CAAC,UAAU,GAAG,UAAU,CAAA;IAC9B,CAAC;IAED,KAAK,CAAC,sBAAsB,CAAC,QAAkB;;QAC7C,MAAM,MAAM,GAAG,IAAI,GAAG,EAAoB,CAAA;QAC1C,MAAM,SAAS,GAAG,MAAM,CAAC,QAAQ,CAAC,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,MAAM,CAAC,YAAY,CAAC,CAAA;QAClE,MAAM,OAAO,GAAG,MAAM,CAAC,QAAQ,CAAC,QAAQ,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,MAAM,CAAC,YAAY,CAAC,CAAA;QAElF,IAAI,cAAc,GAAU,EAAE,CAAA;QAC9B,IAAI,YAAY,GAAa,EAAE,CAAA;QAE/B,IAAI,IAAI,CAAC,eAAe,EAAE,CAAC;YACzB,UAAU;YACV,MAAM,QAAQ,GAAG,MAAM,MAAM,CAAC,KAAK,CAAC;gBAClC,KAAK,EAAE,G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it'\nimport gql from 'graphql-tag'\nimport { client } from '@operato/graphql'\nimport moment from 'moment-timezone'\n\nexport class InspectionEventProvider implements EventProvider {\n buildingLevelId: string = ''\n buildingId: string = ''\n projectId: string = ''\n\n constructor(buildingLevelId: string = '', projectId: string = '', buildingId: string = '') {\n this.buildingLevelId = buildingLevelId\n this.projectId = projectId\n this.buildingId = buildingId\n }\n\n async fetchEventsForCalendar(calendar: CALENDAR): Promise<Map<Date, BizEvent[]>> {\n const result = new Map<Date, BizEvent[]>()\n const startDate = moment(calendar[0]['date']).format('YYYY-MM-DD')\n const endDate = moment(calendar[calendar.length - 1]['date']).format('YYYY-MM-DD')\n\n let inspectionData: any[] = []\n let worklogDates: string[] = []\n\n if (this.buildingLevelId) {\n // 층 레벨 조회\n const response = await client.query({\n query: gql`\n query BuildingInspectionDateSummaryOfLevelAndPeriod(\n $buildingLevelId: String!\n $startDate: String!\n $endDate: String!\n $projectId: String!\n ) {\n buildingInspectionDateSummaryOfLevelAndPeriod(\n buildingLevelId: $buildingLevelId\n startDate: $startDate\n endDate: $endDate\n ) {\n requestDate\n wait\n request\n pass\n fail\n reWait\n }\n dailyWorklogDatesOfProject(projectId: $projectId, startDate: $startDate, endDate: $endDate) {\n id\n date\n }\n }\n `,\n variables: {\n buildingLevelId: this.buildingLevelId,\n projectId: this.projectId,\n startDate,\n endDate\n }\n })\n\n inspectionData = response.data?.buildingInspectionDateSummaryOfLevelAndPeriod || []\n worklogDates = response.data?.dailyWorklogDatesOfProject?.map(v => v.date) || []\n } else if (this.buildingId) {\n // 동 레벨 조회\n const response = await client.query({\n query: gql`\n query BuildingInspectionDateSummaryOfBuilding(\n $buildingId: String!\n $startDate: String!\n $endDate: String!\n $projectId: String!\n ) {\n buildingInspectionDateSummaryOfBuilding(\n buildingId: $buildingId\n startDate: $startDate\n endDate: $endDate\n ) {\n requestDate\n wait\n request\n pass\n fail\n reWait\n }\n dailyWorklogDatesOfProject(projectId: $projectId, startDate: $startDate, endDate: $endDate) {\n id\n date\n }\n }\n `,\n variables: {\n buildingId: this.buildingId,\n projectId: this.projectId,\n startDate,\n endDate\n }\n })\n\n inspectionData = response.data?.buildingInspectionDateSummaryOfBuilding || []\n worklogDates = response.data?.dailyWorklogDatesOfProject?.map(v => v.date) || []\n } else {\n // 프로젝트 레벨 조회 (동 미선택 시)\n const response = await client.query({\n query: gql`\n query BuildingInspectionDateSummaryOfProject(\n $projectId: String!\n $startDate: String!\n $endDate: String!\n ) {\n buildingInspectionDateSummaryOfProject(\n projectId: $projectId\n startDate: $startDate\n endDate: $endDate\n ) {\n requestDate\n wait\n request\n pass\n fail\n reWait\n }\n dailyWorklogDatesOfProject(projectId: $projectId, startDate: $startDate, endDate: $endDate) {\n id\n date\n }\n }\n `,\n variables: {\n projectId: this.projectId,\n startDate,\n endDate\n }\n })\n\n inspectionData = response.data?.buildingInspectionDateSummaryOfProject || []\n worklogDates = response.data?.dailyWorklogDatesOfProject?.map(v => v.date) || []\n }\n\n const calendarData = this.getCalendarTemplate(inspectionData)\n const worklogSet = new Set(worklogDates)\n\n calendar.forEach(({ date }) => {\n const formattedDate = date.toLocaleDateString('en-CA') // 'en-CA'는 'YYYY-MM-DD' 형식으로 반환됩니다.\n const template = calendarData[formattedDate]\n\n const hasWorklog = worklogSet.has(formattedDate)\n if (template || hasWorklog) {\n result.set(date, [\n {\n due: formattedDate,\n template: html`\n <div style=\"display:grid;grid-template-columns:repeat(2,1fr);padding-inline:7px;align-items:center;gap:4px;\">\n ${template || html``}\n ${hasWorklog\n ? html`<div style=\"justify-self:end\">\n <md-icon\n style=\"color:#008000;cursor:pointer;\"\n @click=${(e: Event) => {\n e.stopPropagation()\n e.preventDefault()\n ;(e.target as HTMLElement).dispatchEvent(\n new CustomEvent('open-worklog', {\n detail: { date: formattedDate },\n bubbles: true,\n composed: true\n })\n )\n }}\n >description</md-icon>\n </div>`\n : html``}\n </div>\n `,\n title: '',\n color: '',\n clickEvent: e => console.log('calendar click', formattedDate)\n }\n ])\n }\n })\n\n return result\n }\n\n // 검측 개수가 있는 데이터들만 날짜별로 템플릿 만들기\n private getCalendarTemplate(inspectionData: any[] = []): { [date: string]: TemplateResult } {\n const template = {}\n for (let date of inspectionData) {\n template[date.requestDate] = html`\n <div style=\"display: grid; grid-template-columns: repeat(2, 1fr); padding-inline: 7px;\">\n ${date.wait !== 0 ? html`<div><span style=\"font-size: 1.3em; color: #4e5055\">●</span> ${date.wait}</div>` : ''}\n ${date.request !== 0 ? html`<div><span style=\"font-size: 1.3em; color: #2e79be\">●</span> ${date.request}</div>` : ''}\n ${date.pass !== 0 ? html`<div><span style=\"font-size: 1.3em; color: #1bb401\">●</span> ${date.pass}</div>` : ''}\n ${date.fail !== 0 ? html`<div><span style=\"font-size: 1.3em; color: #ff4444\">●</span> ${date.fail}</div>` : ''}\n ${date.reWait ? html`<div><span style=\"font-size: 1.3em; color: #e89c0e\">●</span> ${date.reWait}</div>` : ''}\n </div>\n `\n }\n\n return template\n }\n}\n"]}
@@ -71,10 +71,7 @@ let ConstructionChecklistTemplateList = class ConstructionChecklistTemplateList
71
71
  this._buildGristConfig();
72
72
  }
73
73
  _buildGristConfig() {
74
- const ctOptions = [
75
- { display: '', value: '' },
76
- ...this.constructionTypes.map(ct => ({ display: ct.name, value: ct.id }))
77
- ];
74
+ const ctOptions = [{ display: '', value: '' }, ...this.constructionTypes.map(ct => ({ display: ct.name, value: ct.id }))];
78
75
  this.gristConfig = {
79
76
  columns: [
80
77
  { type: 'gutter', gutterName: 'sequence' },
@@ -95,10 +92,7 @@ let ConstructionChecklistTemplateList = class ConstructionChecklistTemplateList
95
92
  const response = await client.mutate({
96
93
  mutation: gql `
97
94
  mutation ($ctId: String!, $cdtId: String!) {
98
- upsertConstructionChecklistTemplate(
99
- constructionTypeId: $ctId
100
- constructionDetailTypeId: $cdtId
101
- ) {
95
+ upsertConstructionChecklistTemplate(constructionTypeId: $ctId, constructionDetailTypeId: $cdtId) {
102
96
  id
103
97
  constructionTypeId
104
98
  constructionDetailTypeId
@@ -157,10 +151,7 @@ let ConstructionChecklistTemplateList = class ConstructionChecklistTemplateList
157
151
  };
158
152
  openPopup(html `
159
153
  <div style="overflow-y: auto;">
160
- <checklist-view
161
- .mode=${"VIEWER" /* ChecklistMode.VIEWER */}
162
- .checklist=${checklist}
163
- ></checklist-view>
154
+ <checklist-view .mode=${"VIEWER" /* ChecklistMode.VIEWER */} .checklist=${checklist}></checklist-view>
164
155
  </div>
165
156
  `, {
166
157
  backdrop: true,
@@ -230,6 +221,7 @@ let ConstructionChecklistTemplateList = class ConstructionChecklistTemplateList
230
221
  items {
231
222
  id
232
223
  name
224
+ projectType
233
225
  constructionDetailTypes {
234
226
  id
235
227
  name
@@ -242,7 +234,7 @@ let ConstructionChecklistTemplateList = class ConstructionChecklistTemplateList
242
234
  `
243
235
  });
244
236
  const items = ((_b = (_a = response.data) === null || _a === void 0 ? void 0 : _a.constructionTypes) === null || _b === void 0 ? void 0 : _b.items) || [];
245
- this.constructionTypes = items;
237
+ this.constructionTypes = items.filter(ct => ct.projectType === 'DCSP');
246
238
  // 모든 세부공종을 평탄화 (constructionTypeId 포함)
247
239
  this.allDetailTypes = items.flatMap(ct => (ct.constructionDetailTypes || []).map(dt => (Object.assign(Object.assign({}, dt), { constructionTypeId: ct.id }))));
248
240
  // config가 이미 만들어진 경우 갱신
@@ -260,7 +252,10 @@ let ConstructionChecklistTemplateList = class ConstructionChecklistTemplateList
260
252
  id
261
253
  constructionTypeId
262
254
  constructionDetailTypeId
263
- updater { id name }
255
+ updater {
256
+ id
257
+ name
258
+ }
264
259
  updatedAt
265
260
  }
266
261
  total
@@ -1 +1 @@
1
- {"version":3,"file":"construction-checklist-template-list.js","sourceRoot":"","sources":["../../../client/pages/checklist-template/construction-checklist-template-list.ts"],"names":[],"mappings":";AAAA,OAAO,4BAA4B,CAAA;AACnC,OAAO,6CAA6C,CAAA;AACpD,OAAO,qBAAqB,CAAA;AAC5B,OAAO,8CAA8C,CAAA;AACrD,OAAO,6BAA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;YACH,CAAC;QACH,CAAC;IACH,CAAC;IAEO,KAAK,CAAC,iBAAiB,CAAC,UAAkB;;QAChD,MAAM,QAAQ,GAAG,MAAM,MAAM,CAAC,KAAK,CAAC;YAClC,KAAK,EAAE,GAAG,CAAA;;;;;;;;;;;;;;;;OAgBT;YACD,SAAS,EAAE;gBACT,OAAO,EAAE;oBACP,IAAI,EAAE,iCAAiC;oBACvC,KAAK,EAAE,UAAU;oBACjB,QAAQ,EAAE,IAAI;iBACf;gBACD,QAAQ,EAAE,CAAC,EAAE,IAAI,EAAE,UAAU,EAAE,CAAC;aACjC;SACF,CAAC,CAAA;QAEF,OAAO,CAAA,MAAA,MAAA,QAAQ,CAAC,IAAI,0CAAE,kCAAkC,0CAAE,KAAK,KAAI,EAAE,CAAA;IACvE,CAAC;;AAzZM,wCAAM,GAAG;IACd,eAAe;IACf,iBAAiB;IACjB,kBAAkB;IAClB,GAAG,CAAA;;;;;;;;;;;;;;;;;;KAkBF;CACF,AAvBY,CAuBZ;AAEgB;IAAhB,KAAK,EAAE;;sEAAyB;AAChB;IAAhB,KAAK,EAAE;;4EAAsC;AAC7B;IAAhB,KAAK,EAAE;;yEAAmC;AAChB;IAA1B,KAAK,CAAC,UAAU,CAAC;8BAAiB,SAAS;gEAAA;AA7BjC,iCAAiC;IAD7C,aAAa,CAAC,sCAAsC,CAAC;GACzC,iCAAiC,CA2Z7C","sourcesContent":["import '@material/web/icon/icon.js'\nimport '@operato/context/ox-context-page-toolbar.js'\nimport '@operato/data-grist'\nimport './construction-checklist-template-item-popup'\nimport '../checklist/checklist-view'\n\nimport { CommonGristStyles, CommonButtonStyles, CommonHeaderStyles, ScrollbarStyles } from '@operato/styles'\nimport { PageView } from '@operato/shell'\nimport { css, html } from 'lit'\nimport { customElement, query, state } from 'lit/decorators.js'\nimport { DataGrist, FetchOption } from '@operato/data-grist'\nimport { client } from '@operato/graphql'\nimport { notify, openPopup } from '@operato/layout'\nimport { i18next, localize } from '@operato/i18n'\nimport { p13n } from '@operato/p13n'\n\nimport gql from 'graphql-tag'\nimport { ChecklistMode } from '../checklist/checklist-view'\nimport { BuildingInspectionStatus } from '../building-inspection/building-inspection-list'\n\n@customElement('construction-checklist-template-list')\nexport class ConstructionChecklistTemplateList extends p13n(localize(i18next)(PageView)) {\n static styles = [\n ScrollbarStyles,\n CommonGristStyles,\n CommonHeaderStyles,\n css`\n :host {\n display: flex;\n flex-direction: column;\n width: 100%;\n\n --grid-record-emphasized-background-color: red;\n --grid-record-emphasized-color: yellow;\n }\n\n ox-grist {\n overflow-y: auto;\n flex: 1;\n }\n\n .header {\n grid-template-areas: 'filters actions';\n }\n `\n ]\n\n @state() private gristConfig: any\n @state() private constructionTypes: any[] = []\n @state() private allDetailTypes: any[] = []\n @query('ox-grist') private grist!: DataGrist\n\n get context() {\n return {\n title: '공종 체크리스트 템플릿',\n search: {\n handler: (search: string) => {\n this.grist.searchText = search\n },\n value: this.grist?.searchText\n },\n filter: {\n handler: () => {\n this.grist.toggleHeadroom()\n }\n },\n actions: [\n {\n title: '저장',\n action: this._save.bind(this),\n ...CommonButtonStyles.submit\n },\n {\n title: '삭제',\n action: this._delete.bind(this),\n ...CommonButtonStyles.delete\n }\n ],\n toolbar: false\n }\n }\n\n render() {\n return html`\n <ox-grist\n .mode=${'GRID'}\n .config=${this.gristConfig}\n .fetchHandler=${this.fetchHandler.bind(this)}\n .personalConfigProvider=${this.getPagePreferenceProvider('ox-grist')!}\n >\n <div slot=\"headroom\" class=\"header\">\n <div class=\"filters\">\n <ox-filters-form autofocus without-search></ox-filters-form>\n </div>\n <ox-context-page-toolbar class=\"actions\" .context=${this.context}></ox-context-page-toolbar>\n </div>\n <ox-grist-personalizer slot=\"setting\"></ox-grist-personalizer>\n </ox-grist>\n `\n }\n\n async pageUpdated(changes: any, lifecycle) {\n if (this.active) {\n await this._fetchConstructionTypes()\n }\n }\n\n async pageInitialized(lifecycle: any) {\n await this._fetchConstructionTypes()\n this._buildGristConfig()\n }\n\n private _buildGristConfig() {\n const ctOptions = [\n { display: '', value: '' },\n ...this.constructionTypes.map(ct => ({ display: ct.name, value: ct.id }))\n ]\n\n this.gristConfig = {\n columns: [\n { type: 'gutter', gutterName: 'sequence' },\n { type: 'gutter', gutterName: 'row-selector', multiple: true },\n {\n type: 'gutter',\n gutterName: 'button',\n fixed: true,\n icon: 'reorder',\n handlers: {\n click: async (columns, data, column, record, rowIndex) => {\n if (!record.constructionTypeId || !record.constructionDetailTypeId) {\n notify({ message: '공종과 세부공종을 먼저 선택해주세요.', level: 'warn' })\n return\n }\n\n // upsert로 템플릿 find-or-create\n const response = await client.mutate({\n mutation: gql`\n mutation ($ctId: String!, $cdtId: String!) {\n upsertConstructionChecklistTemplate(\n constructionTypeId: $ctId\n constructionDetailTypeId: $cdtId\n ) {\n id\n constructionTypeId\n constructionDetailTypeId\n }\n }\n `,\n variables: {\n ctId: record.constructionTypeId,\n cdtId: record.constructionDetailTypeId\n }\n })\n\n if (response.errors) {\n notify({ message: '템플릿 생성에 실패했습니다.', level: 'error' })\n return\n }\n\n const template = response.data?.upsertConstructionChecklistTemplate\n const ctName = this.constructionTypes.find(ct => ct.id === record.constructionTypeId)?.name || ''\n const cdtName = this.allDetailTypes.find(dt => dt.id === record.constructionDetailTypeId)?.name || ''\n\n openPopup(\n html`\n <construction-checklist-template-item-popup\n .constructionChecklistTemplate=${template}\n @requestRefresh=\"${() => this.grist.fetch()}\"\n ></construction-checklist-template-item-popup>\n `,\n {\n backdrop: true,\n size: 'large',\n title: `검사항목 - ${ctName} > ${cdtName}`\n }\n )\n }\n }\n },\n {\n type: 'gutter',\n gutterName: 'button',\n fixed: true,\n icon: 'preview',\n handlers: {\n click: async (columns, data, column, record, rowIndex) => {\n if (!record.id) return\n\n const items = await this._getTemplateItems(record.id)\n const ctName = this.constructionTypes.find(ct => ct.id === record.constructionTypeId)?.name || ''\n const cdtName = this.allDetailTypes.find(dt => dt.id === record.constructionDetailTypeId)?.name || ''\n\n const checklist = {\n name: `${ctName} - ${cdtName}`,\n constructionType: ctName,\n constructionDetailType: cdtName,\n location: '',\n documentNo: '',\n inspectionParts: [],\n buildingInspection: {\n status: BuildingInspectionStatus.WAIT\n },\n checklistItems: items.map(item => ({\n ...item,\n detailType: '',\n inspctionCriteria: ''\n }))\n }\n\n openPopup(\n html`\n <div style=\"overflow-y: auto;\">\n <checklist-view\n .mode=${ChecklistMode.VIEWER}\n .checklist=${checklist}\n ></checklist-view>\n </div>\n `,\n {\n backdrop: true,\n size: 'large',\n title: `체크리스트 미리보기 - ${ctName} > ${cdtName}`\n }\n )\n }\n }\n },\n {\n type: 'select',\n name: 'constructionTypeId',\n header: '공종',\n record: {\n editable: true,\n options: ctOptions\n },\n width: 180\n },\n {\n type: 'select',\n name: 'constructionDetailTypeId',\n header: '세부공종',\n record: {\n editable: true,\n options: (columns, data, column) => {\n const ctId = column.constructionTypeId\n if (!ctId) return [{ display: '', value: '' }]\n return [\n { display: '', value: '' },\n ...this.allDetailTypes\n .filter(dt => dt.constructionTypeId === ctId)\n .map(dt => ({ display: dt.name, value: dt.id }))\n ]\n }\n },\n width: 180\n },\n {\n type: 'resource-object',\n name: 'updater',\n header: '수정자',\n record: { editable: false },\n width: 120\n },\n {\n type: 'datetime',\n name: 'updatedAt',\n header: '수정일시',\n record: { editable: false },\n width: 180\n }\n ],\n rows: {\n selectable: { multiple: true }\n },\n sorters: [{ name: 'updatedAt' }]\n }\n }\n\n private async _fetchConstructionTypes() {\n const response = await client.query({\n query: gql`\n query ConstructionTypes {\n constructionTypes {\n items {\n id\n name\n constructionDetailTypes {\n id\n name\n sequence\n }\n }\n total\n }\n }\n `\n })\n\n const items = response.data?.constructionTypes?.items || []\n this.constructionTypes = items\n\n // 모든 세부공종을 평탄화 (constructionTypeId 포함)\n this.allDetailTypes = items.flatMap(ct =>\n (ct.constructionDetailTypes || []).map(dt => ({\n ...dt,\n constructionTypeId: ct.id\n }))\n )\n\n // config가 이미 만들어진 경우 갱신\n if (this.gristConfig) {\n this._buildGristConfig()\n }\n }\n\n async fetchHandler({ page = 1, limit = 100, sortings = [], filters = [] }: FetchOption) {\n const response = await client.query({\n query: gql`\n query ($filters: [Filter!], $pagination: Pagination, $sortings: [Sorting!]) {\n responses: constructionChecklistTemplates(filters: $filters, pagination: $pagination, sortings: $sortings) {\n items {\n id\n constructionTypeId\n constructionDetailTypeId\n updater { id name }\n updatedAt\n }\n total\n }\n }\n `,\n variables: {\n filters,\n pagination: { page, limit },\n sortings\n }\n })\n\n const items = response.data?.responses?.items || []\n const records = items\n\n return {\n total: response.data?.responses?.total || 0,\n records\n }\n }\n\n private async _save() {\n let patches = this.grist.dirtyRecords\n if (patches && patches.length) {\n patches = patches.map(patch => {\n let patchField: any = patch.id ? { id: patch.id } : {}\n const dirtyFields = patch.__dirtyfields__\n for (let key in dirtyFields) {\n patchField[key] = dirtyFields[key].after\n }\n patchField.cuFlag = patch.__dirty__\n return patchField\n })\n\n const response = await client.mutate({\n mutation: gql`\n mutation ($patches: [ConstructionChecklistTemplatePatch!]!) {\n updateMultipleConstructionChecklistTemplate(patches: $patches) {\n id\n }\n }\n `,\n variables: { patches }\n })\n\n if (!response.errors) {\n this.grist.fetch()\n notify({ message: '저장되었습니다.' })\n } else {\n notify({ message: '저장에 실패하였습니다.', level: 'error' })\n }\n }\n }\n\n private async _delete() {\n if (confirm('삭제하시겠습니까?')) {\n const ids = this.grist.selected.map(record => record.id)\n if (ids && ids.length > 0) {\n const response = await client.mutate({\n mutation: gql`\n mutation ($ids: [String!]!) {\n deleteConstructionChecklistTemplates(ids: $ids)\n }\n `,\n variables: { ids }\n })\n\n if (!response.errors) {\n this.grist.fetch()\n notify({ message: '삭제되었습니다.' })\n }\n }\n }\n }\n\n private async _getTemplateItems(templateId: string) {\n const response = await client.query({\n query: gql`\n query ($filters: [Filter!], $sortings: [Sorting!]) {\n constructionChecklistTemplateItems(filters: $filters, sortings: $sortings) {\n items {\n id\n sequence\n mainType\n name\n recommendation1\n recommendation2\n recommendation3\n recommendation4\n recommendation5\n }\n }\n }\n `,\n variables: {\n filters: {\n name: 'constructionChecklistTemplateId',\n value: templateId,\n operator: 'eq'\n },\n sortings: [{ name: 'sequence' }]\n }\n })\n\n return response.data?.constructionChecklistTemplateItems?.items || []\n }\n}\n"]}
1
+ {"version":3,"file":"construction-checklist-template-list.js","sourceRoot":"","sources":["../../../client/pages/checklist-template/construction-checklist-template-list.ts"],"names":[],"mappings":";AAAA,OAAO,4BAA4B,CAAA;AACnC,OAAO,6CAA6C,CAAA;AACpD,OAAO,qBAAqB,CAAA;AAC5B,OAAO,8CAA8C,CAAA;AACrD,OAAO,6BAA6B,CAAA;AAEpC,OAAO,EAAE,iBAAiB,EAAE,kBAAkB,EAAE,kBAAkB,EAAE,eAAe,EAAE,MAAM,iBAAiB,CAAA;AAC5G,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,KAAK,EAAE,MAAM,mBAAmB,CAAA;AAC/D,OAAO,EAAE,SAAS,EAAe,MAAM,qBAAqB,CAAA;AAC5D,OAAO,EAAE,MAAM,EAAE,MAAM,kBAAkB,CAAA;AACzC,OAAO,EAAE,MAAM,EAAE,SAAS,EAAE,MAAM,iBAAiB,CAAA;AACnD,OAAO,EAAE,OAAO,EAAE,QAAQ,EAAE,MAAM,eAAe,CAAA;AACjD,OAAO,EAAE,IAAI,EAAE,MAAM,eAAe,CAAA;AAEpC,OAAO,GAAG,MAAM,aAAa,CAAA;AAE7B,OAAO,EAAE,wBAAwB,EAAE,MAAM,iDAAiD,CAAA;AAGnF,IAAM,iCAAiC,GAAvC,MAAM,iCAAkC,SAAQ,IAAI,CAAC,QAAQ,CAAC,OAAO,CAAC,CAAC,QAAQ,CAAC,CAAC;IAAjF;;QA2BY,sBAAiB,GAAU,EAAE,CAAA;QAC7B,mBAAc,GAAU,EAAE,CA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C;8BAAiB,SAAS;gEAAA;AA7BjC,iCAAiC;IAD7C,aAAa,CAAC,sCAAsC,CAAC;GACzC,iCAAiC,CAsZ7C","sourcesContent":["import '@material/web/icon/icon.js'\nimport '@operato/context/ox-context-page-toolbar.js'\nimport '@operato/data-grist'\nimport './construction-checklist-template-item-popup'\nimport '../checklist/checklist-view'\n\nimport { CommonGristStyles, CommonButtonStyles, CommonHeaderStyles, ScrollbarStyles } from '@operato/styles'\nimport { PageView } from '@operato/shell'\nimport { css, html } from 'lit'\nimport { customElement, query, state } from 'lit/decorators.js'\nimport { DataGrist, FetchOption } from '@operato/data-grist'\nimport { client } from '@operato/graphql'\nimport { notify, openPopup } from '@operato/layout'\nimport { i18next, localize } from '@operato/i18n'\nimport { p13n } from '@operato/p13n'\n\nimport gql from 'graphql-tag'\nimport { ChecklistMode } from '../checklist/checklist-view'\nimport { BuildingInspectionStatus } from '../building-inspection/building-inspection-list'\n\n@customElement('construction-checklist-template-list')\nexport class ConstructionChecklistTemplateList extends p13n(localize(i18next)(PageView)) {\n static styles = [\n ScrollbarStyles,\n CommonGristStyles,\n CommonHeaderStyles,\n css`\n :host {\n display: flex;\n flex-direction: column;\n width: 100%;\n\n --grid-record-emphasized-background-color: red;\n --grid-record-emphasized-color: yellow;\n }\n\n ox-grist {\n overflow-y: auto;\n flex: 1;\n }\n\n .header {\n grid-template-areas: 'filters actions';\n }\n `\n ]\n\n @state() private gristConfig: any\n @state() private constructionTypes: any[] = []\n @state() private allDetailTypes: any[] = []\n @query('ox-grist') private grist!: DataGrist\n\n get context() {\n return {\n title: '공종 체크리스트 템플릿',\n search: {\n handler: (search: string) => {\n this.grist.searchText = search\n },\n value: this.grist?.searchText\n },\n filter: {\n handler: () => {\n this.grist.toggleHeadroom()\n }\n },\n actions: [\n {\n title: '저장',\n action: this._save.bind(this),\n ...CommonButtonStyles.submit\n },\n {\n title: '삭제',\n action: this._delete.bind(this),\n ...CommonButtonStyles.delete\n }\n ],\n toolbar: false\n }\n }\n\n render() {\n return html`\n <ox-grist\n .mode=${'GRID'}\n .config=${this.gristConfig}\n .fetchHandler=${this.fetchHandler.bind(this)}\n .personalConfigProvider=${this.getPagePreferenceProvider('ox-grist')!}\n >\n <div slot=\"headroom\" class=\"header\">\n <div class=\"filters\">\n <ox-filters-form autofocus without-search></ox-filters-form>\n </div>\n <ox-context-page-toolbar class=\"actions\" .context=${this.context}></ox-context-page-toolbar>\n </div>\n <ox-grist-personalizer slot=\"setting\"></ox-grist-personalizer>\n </ox-grist>\n `\n }\n\n async pageUpdated(changes: any, lifecycle) {\n if (this.active) {\n await this._fetchConstructionTypes()\n }\n }\n\n async pageInitialized(lifecycle: any) {\n await this._fetchConstructionTypes()\n this._buildGristConfig()\n }\n\n private _buildGristConfig() {\n const ctOptions = [{ display: '', value: '' }, ...this.constructionTypes.map(ct => ({ display: ct.name, value: ct.id }))]\n\n this.gristConfig = {\n columns: [\n { type: 'gutter', gutterName: 'sequence' },\n { type: 'gutter', gutterName: 'row-selector', multiple: true },\n {\n type: 'gutter',\n gutterName: 'button',\n fixed: true,\n icon: 'reorder',\n handlers: {\n click: async (columns, data, column, record, rowIndex) => {\n if (!record.constructionTypeId || !record.constructionDetailTypeId) {\n notify({ message: '공종과 세부공종을 먼저 선택해주세요.', level: 'warn' })\n return\n }\n\n // upsert로 템플릿 find-or-create\n const response = await client.mutate({\n mutation: gql`\n mutation ($ctId: String!, $cdtId: String!) {\n upsertConstructionChecklistTemplate(constructionTypeId: $ctId, constructionDetailTypeId: $cdtId) {\n id\n constructionTypeId\n constructionDetailTypeId\n }\n }\n `,\n variables: {\n ctId: record.constructionTypeId,\n cdtId: record.constructionDetailTypeId\n }\n })\n\n if (response.errors) {\n notify({ message: '템플릿 생성에 실패했습니다.', level: 'error' })\n return\n }\n\n const template = response.data?.upsertConstructionChecklistTemplate\n const ctName = this.constructionTypes.find(ct => ct.id === record.constructionTypeId)?.name || ''\n const cdtName = this.allDetailTypes.find(dt => dt.id === record.constructionDetailTypeId)?.name || ''\n\n openPopup(\n html`\n <construction-checklist-template-item-popup\n .constructionChecklistTemplate=${template}\n @requestRefresh=\"${() => this.grist.fetch()}\"\n ></construction-checklist-template-item-popup>\n `,\n {\n backdrop: true,\n size: 'large',\n title: `검사항목 - ${ctName} > ${cdtName}`\n }\n )\n }\n }\n },\n {\n type: 'gutter',\n gutterName: 'button',\n fixed: true,\n icon: 'preview',\n handlers: {\n click: async (columns, data, column, record, rowIndex) => {\n if (!record.id) return\n\n const items = await this._getTemplateItems(record.id)\n const ctName = this.constructionTypes.find(ct => ct.id === record.constructionTypeId)?.name || ''\n const cdtName = this.allDetailTypes.find(dt => dt.id === record.constructionDetailTypeId)?.name || ''\n\n const checklist = {\n name: `${ctName} - ${cdtName}`,\n constructionType: ctName,\n constructionDetailType: cdtName,\n location: '',\n documentNo: '',\n inspectionParts: [],\n buildingInspection: {\n status: BuildingInspectionStatus.WAIT\n },\n checklistItems: items.map(item => ({\n ...item,\n detailType: '',\n inspctionCriteria: ''\n }))\n }\n\n openPopup(\n html`\n <div style=\"overflow-y: auto;\">\n <checklist-view .mode=${ChecklistMode.VIEWER} .checklist=${checklist}></checklist-view>\n </div>\n `,\n {\n backdrop: true,\n size: 'large',\n title: `체크리스트 미리보기 - ${ctName} > ${cdtName}`\n }\n )\n }\n }\n },\n {\n type: 'select',\n name: 'constructionTypeId',\n header: '공종',\n record: {\n editable: true,\n options: ctOptions\n },\n width: 180\n },\n {\n type: 'select',\n name: 'constructionDetailTypeId',\n header: '세부공종',\n record: {\n editable: true,\n options: (columns, data, column) => {\n const ctId = column.constructionTypeId\n if (!ctId) return [{ display: '', value: '' }]\n return [\n { display: '', value: '' },\n ...this.allDetailTypes\n .filter(dt => dt.constructionTypeId === ctId)\n .map(dt => ({ display: dt.name, value: dt.id }))\n ]\n }\n },\n width: 180\n },\n {\n type: 'resource-object',\n name: 'updater',\n header: '수정자',\n record: { editable: false },\n width: 120\n },\n {\n type: 'datetime',\n name: 'updatedAt',\n header: '수정일시',\n record: { editable: false },\n width: 180\n }\n ],\n rows: {\n selectable: { multiple: true }\n },\n sorters: [{ name: 'updatedAt' }]\n }\n }\n\n private async _fetchConstructionTypes() {\n const response = await client.query({\n query: gql`\n query ConstructionTypes {\n constructionTypes {\n items {\n id\n name\n projectType\n constructionDetailTypes {\n id\n name\n sequence\n }\n }\n total\n }\n }\n `\n })\n\n const items = response.data?.constructionTypes?.items || []\n this.constructionTypes = items.filter(ct => ct.projectType === 'DCSP')\n\n // 모든 세부공종을 평탄화 (constructionTypeId 포함)\n this.allDetailTypes = items.flatMap(ct =>\n (ct.constructionDetailTypes || []).map(dt => ({\n ...dt,\n constructionTypeId: ct.id\n }))\n )\n\n // config가 이미 만들어진 경우 갱신\n if (this.gristConfig) {\n this._buildGristConfig()\n }\n }\n\n async fetchHandler({ page = 1, limit = 100, sortings = [], filters = [] }: FetchOption) {\n const response = await client.query({\n query: gql`\n query ($filters: [Filter!], $pagination: Pagination, $sortings: [Sorting!]) {\n responses: constructionChecklistTemplates(filters: $filters, pagination: $pagination, sortings: $sortings) {\n items {\n id\n constructionTypeId\n constructionDetailTypeId\n updater {\n id\n name\n }\n updatedAt\n }\n total\n }\n }\n `,\n variables: {\n filters,\n pagination: { page, limit },\n sortings\n }\n })\n\n const items = response.data?.responses?.items || []\n const records = items\n\n return {\n total: response.data?.responses?.total || 0,\n records\n }\n }\n\n private async _save() {\n let patches = this.grist.dirtyRecords\n if (patches && patches.length) {\n patches = patches.map(patch => {\n let patchField: any = patch.id ? { id: patch.id } : {}\n const dirtyFields = patch.__dirtyfields__\n for (let key in dirtyFields) {\n patchField[key] = dirtyFields[key].after\n }\n patchField.cuFlag = patch.__dirty__\n return patchField\n })\n\n const response = await client.mutate({\n mutation: gql`\n mutation ($patches: [ConstructionChecklistTemplatePatch!]!) {\n updateMultipleConstructionChecklistTemplate(patches: $patches) {\n id\n }\n }\n `,\n variables: { patches }\n })\n\n if (!response.errors) {\n this.grist.fetch()\n notify({ message: '저장되었습니다.' })\n } else {\n notify({ message: '저장에 실패하였습니다.', level: 'error' })\n }\n }\n }\n\n private async _delete() {\n if (confirm('삭제하시겠습니까?')) {\n const ids = this.grist.selected.map(record => record.id)\n if (ids && ids.length > 0) {\n const response = await client.mutate({\n mutation: gql`\n mutation ($ids: [String!]!) {\n deleteConstructionChecklistTemplates(ids: $ids)\n }\n `,\n variables: { ids }\n })\n\n if (!response.errors) {\n this.grist.fetch()\n notify({ message: '삭제되었습니다.' })\n }\n }\n }\n }\n\n private async _getTemplateItems(templateId: string) {\n const response = await client.query({\n query: gql`\n query ($filters: [Filter!], $sortings: [Sorting!]) {\n constructionChecklistTemplateItems(filters: $filters, sortings: $sortings) {\n items {\n id\n sequence\n mainType\n name\n recommendation1\n recommendation2\n recommendation3\n recommendation4\n recommendation5\n }\n }\n }\n `,\n variables: {\n filters: {\n name: 'constructionChecklistTemplateId',\n value: templateId,\n operator: 'eq'\n },\n sortings: [{ name: 'sequence' }]\n }\n })\n\n return response.data?.constructionChecklistTemplateItems?.items || []\n }\n}\n"]}
@@ -12,6 +12,7 @@ import { DataGrist } from '@operato/data-grist';
12
12
  export declare class ProjectChecklistManagement extends PageView {
13
13
  static styles: import("lit").CSSResult[];
14
14
  projectId: string;
15
+ projectName: string;
15
16
  constructionTypes: any[];
16
17
  allDetailTypes: any[];
17
18
  selectedConstructionType: any;
@@ -33,6 +34,7 @@ export declare class ProjectChecklistManagement extends PageView {
33
34
  pageUpdated(changes: any, lifecycle: PageLifecycle): Promise<void>;
34
35
  pageInitialized(lifecycle: any): Promise<void>;
35
36
  private _init;
37
+ private _fetchProjectName;
36
38
  private _fetchConstructionTypes;
37
39
  private _buildLeftGristConfig;
38
40
  private _buildRightGristConfig;
@@ -20,6 +20,7 @@ let ProjectChecklistManagement = class ProjectChecklistManagement extends PageVi
20
20
  constructor() {
21
21
  super(...arguments);
22
22
  this.projectId = '';
23
+ this.projectName = '';
23
24
  this.constructionTypes = [];
24
25
  this.allDetailTypes = [];
25
26
  this.selectedConstructionType = {};
@@ -31,7 +32,7 @@ let ProjectChecklistManagement = class ProjectChecklistManagement extends PageVi
31
32
  }
32
33
  get context() {
33
34
  return {
34
- title: '체크리스트 관리'
35
+ title: this.projectName ? `체크리스트 관리 - ${this.projectName}` : '체크리스트 관리'
35
36
  };
36
37
  }
37
38
  render() {
@@ -123,10 +124,27 @@ let ProjectChecklistManagement = class ProjectChecklistManagement extends PageVi
123
124
  await this._init();
124
125
  }
125
126
  async _init() {
126
- await this._fetchConstructionTypes();
127
+ await Promise.all([this._fetchProjectName(), this._fetchConstructionTypes()]);
127
128
  this._buildLeftGristConfig();
128
129
  this._buildRightGristConfig();
129
130
  }
131
+ async _fetchProjectName() {
132
+ var _a, _b;
133
+ if (!this.projectId)
134
+ return;
135
+ const response = await client.query({
136
+ query: gql `
137
+ query Project($id: String!) {
138
+ project(id: $id) {
139
+ name
140
+ }
141
+ }
142
+ `,
143
+ variables: { id: this.projectId }
144
+ });
145
+ this.projectName = ((_b = (_a = response.data) === null || _a === void 0 ? void 0 : _a.project) === null || _b === void 0 ? void 0 : _b.name) || '';
146
+ this.updateContext();
147
+ }
130
148
  async _fetchConstructionTypes() {
131
149
  var _a, _b;
132
150
  const response = await client.query({
@@ -847,6 +865,10 @@ __decorate([
847
865
  state(),
848
866
  __metadata("design:type", String)
849
867
  ], ProjectChecklistManagement.prototype, "projectId", void 0);
868
+ __decorate([
869
+ state(),
870
+ __metadata("design:type", String)
871
+ ], ProjectChecklistManagement.prototype, "projectName", void 0);
850
872
  __decorate([
851
873
  state(),
852
874
  __metadata("design:type", Array)