@dssp/project 1.0.0-alpha.8 → 1.0.0-alpha.81

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 (155) hide show
  1. package/dist-client/index.d.ts +1 -0
  2. package/dist-client/index.js +1 -1
  3. package/dist-client/index.js.map +1 -1
  4. package/dist-client/pages/lib/chatbot-widget.d.ts +53 -0
  5. package/dist-client/pages/lib/chatbot-widget.js +631 -0
  6. package/dist-client/pages/lib/chatbot-widget.js.map +1 -0
  7. package/dist-client/pages/lib/select2-component.d.ts +1 -1
  8. package/dist-client/pages/lib/select2-component.js +35 -35
  9. package/dist-client/pages/lib/select2-component.js.map +1 -1
  10. package/dist-client/pages/project/component/pagenation.d.ts +18 -0
  11. package/dist-client/pages/project/component/pagenation.js +142 -0
  12. package/dist-client/pages/project/component/pagenation.js.map +1 -0
  13. package/dist-client/pages/project/component/project-update-header.js +26 -3
  14. package/dist-client/pages/project/component/project-update-header.js.map +1 -1
  15. package/dist-client/pages/project/popup/checklist/task-checklist-attachment-list-popup.d.ts +1 -0
  16. package/dist-client/pages/project/popup/checklist/task-checklist-attachment-list-popup.js +308 -0
  17. package/dist-client/pages/project/popup/checklist/task-checklist-attachment-list-popup.js.map +1 -0
  18. package/dist-client/pages/project/popup/checklist/task-checklist-comment-list-popup.d.ts +1 -0
  19. package/dist-client/pages/project/popup/checklist/task-checklist-comment-list-popup.js +356 -0
  20. package/dist-client/pages/project/popup/checklist/task-checklist-comment-list-popup.js.map +1 -0
  21. package/dist-client/pages/project/popup/checklist/task-checklist-create-popup.d.ts +1 -0
  22. package/dist-client/pages/project/popup/checklist/task-checklist-create-popup.js +681 -0
  23. package/dist-client/pages/project/popup/checklist/task-checklist-create-popup.js.map +1 -0
  24. package/dist-client/pages/project/popup/checklist/task-checklist-view.d.ts +32 -0
  25. package/dist-client/pages/project/popup/checklist/task-checklist-view.js +620 -0
  26. package/dist-client/pages/project/popup/checklist/task-checklist-view.js.map +1 -0
  27. package/dist-client/pages/project/popup/popup-plan-export.js +8 -2
  28. package/dist-client/pages/project/popup/popup-plan-export.js.map +1 -1
  29. package/dist-client/pages/project/popup/{popup-schedule-upload.d.ts → popup-task-upload.d.ts} +1 -1
  30. package/dist-client/pages/project/popup/{popup-schedule-upload.js → popup-task-upload.js} +9 -9
  31. package/dist-client/pages/project/popup/popup-task-upload.js.map +1 -0
  32. package/dist-client/pages/project/project-completed-list.d.ts +5 -0
  33. package/dist-client/pages/project/project-completed-list.js +32 -3
  34. package/dist-client/pages/project/project-completed-list.js.map +1 -1
  35. package/dist-client/pages/project/project-detail.d.ts +6 -0
  36. package/dist-client/pages/project/project-detail.js +225 -89
  37. package/dist-client/pages/project/project-detail.js.map +1 -1
  38. package/dist-client/pages/project/project-list.d.ts +57 -0
  39. package/dist-client/pages/project/project-list.js +80 -9
  40. package/dist-client/pages/project/project-list.js.map +1 -1
  41. package/dist-client/pages/project/project-plan-management.js +6 -1
  42. package/dist-client/pages/project/project-plan-management.js.map +1 -1
  43. package/dist-client/pages/project/project-setting-list.d.ts +7 -0
  44. package/dist-client/pages/project/project-setting-list.js +61 -7
  45. package/dist-client/pages/project/project-setting-list.js.map +1 -1
  46. package/dist-client/pages/project/{project-schedule-list.d.ts → project-task-list.d.ts} +2 -2
  47. package/dist-client/pages/project/{project-schedule-list.js → project-task-list.js} +11 -11
  48. package/dist-client/pages/project/project-task-list.js.map +1 -0
  49. package/dist-client/pages/project/{project-schedule.d.ts → project-task.d.ts} +17 -4
  50. package/dist-client/pages/project/project-task.js +691 -0
  51. package/dist-client/pages/project/project-task.js.map +1 -0
  52. package/dist-client/pages/project/project-update.d.ts +34 -0
  53. package/dist-client/pages/project/project-update.js +508 -35
  54. package/dist-client/pages/project/project-update.js.map +1 -1
  55. package/dist-client/pages/resource/construction-type-management.js +14 -0
  56. package/dist-client/pages/resource/construction-type-management.js.map +1 -1
  57. package/dist-client/pages/resource/resource-list-page.d.ts +1 -2
  58. package/dist-client/pages/resource/resource-list-page.js +1 -2
  59. package/dist-client/pages/resource/resource-list-page.js.map +1 -1
  60. package/dist-client/pages/task/task-list-page.d.ts +1 -2
  61. package/dist-client/pages/task/task-list-page.js +1 -2
  62. package/dist-client/pages/task/task-list-page.js.map +1 -1
  63. package/dist-client/pages/task-resource/task-resource-list-page.d.ts +1 -2
  64. package/dist-client/pages/task-resource/task-resource-list-page.js +1 -2
  65. package/dist-client/pages/task-resource/task-resource-list-page.js.map +1 -1
  66. package/dist-client/route.d.ts +1 -1
  67. package/dist-client/route.js +4 -4
  68. package/dist-client/route.js.map +1 -1
  69. package/dist-client/shared/domain-context.d.ts +18 -0
  70. package/dist-client/shared/domain-context.js +28 -0
  71. package/dist-client/shared/domain-context.js.map +1 -0
  72. package/dist-client/tsconfig.tsbuildinfo +1 -1
  73. package/dist-client/viewparts/domain-switch.d.ts +19 -0
  74. package/dist-client/viewparts/domain-switch.js +266 -0
  75. package/dist-client/viewparts/domain-switch.js.map +1 -0
  76. package/dist-server/controllers/parse-excel.js.map +1 -1
  77. package/dist-server/migrations/1723861466414-seed-codes.js +1 -1
  78. package/dist-server/migrations/1723861466414-seed-codes.js.map +1 -1
  79. package/dist-server/service/construction-type/construction-type-query.d.ts +2 -2
  80. package/dist-server/service/construction-type/construction-type-query.js +5 -10
  81. package/dist-server/service/construction-type/construction-type-query.js.map +1 -1
  82. package/dist-server/service/construction-type/construction-type-type.d.ts +1 -0
  83. package/dist-server/service/construction-type/construction-type-type.js +4 -0
  84. package/dist-server/service/construction-type/construction-type-type.js.map +1 -1
  85. package/dist-server/service/construction-type/construction-type.d.ts +1 -0
  86. package/dist-server/service/construction-type/construction-type.js +5 -0
  87. package/dist-server/service/construction-type/construction-type.js.map +1 -1
  88. package/dist-server/service/index.d.ts +2 -2
  89. package/dist-server/service/index.js +5 -2
  90. package/dist-server/service/index.js.map +1 -1
  91. package/dist-server/service/inspection-drawing-type/inspection-drawing-type-query.d.ts +2 -2
  92. package/dist-server/service/inspection-drawing-type/inspection-drawing-type-query.js +5 -10
  93. package/dist-server/service/inspection-drawing-type/inspection-drawing-type-query.js.map +1 -1
  94. package/dist-server/service/manager/manager-query.d.ts +1 -1
  95. package/dist-server/service/manager/manager-query.js +2 -6
  96. package/dist-server/service/manager/manager-query.js.map +1 -1
  97. package/dist-server/service/project/issue-project-code.d.ts +7 -0
  98. package/dist-server/service/project/issue-project-code.js +27 -0
  99. package/dist-server/service/project/issue-project-code.js.map +1 -0
  100. package/dist-server/service/project/project-mutation.d.ts +2 -0
  101. package/dist-server/service/project/project-mutation.js +109 -11
  102. package/dist-server/service/project/project-mutation.js.map +1 -1
  103. package/dist-server/service/project/project-query.d.ts +13 -2
  104. package/dist-server/service/project/project-query.js +138 -13
  105. package/dist-server/service/project/project-query.js.map +1 -1
  106. package/dist-server/service/project/project-type.d.ts +10 -2
  107. package/dist-server/service/project/project-type.js +32 -2
  108. package/dist-server/service/project/project-type.js.map +1 -1
  109. package/dist-server/service/project/project.d.ts +22 -0
  110. package/dist-server/service/project/project.js +84 -2
  111. package/dist-server/service/project/project.js.map +1 -1
  112. package/dist-server/service/resource/resource-mutation.js +5 -6
  113. package/dist-server/service/resource/resource-mutation.js.map +1 -1
  114. package/dist-server/service/resource/resource-query.d.ts +2 -2
  115. package/dist-server/service/resource/resource-query.js +5 -10
  116. package/dist-server/service/resource/resource-query.js.map +1 -1
  117. package/dist-server/service/task/task-query.d.ts +2 -0
  118. package/dist-server/service/task/task-query.js +11 -0
  119. package/dist-server/service/task/task-query.js.map +1 -1
  120. package/dist-server/service/task/task.d.ts +2 -0
  121. package/dist-server/service/task/task.js +6 -0
  122. package/dist-server/service/task/task.js.map +1 -1
  123. package/dist-server/service/task-checklist-binding/index.d.ts +5 -0
  124. package/dist-server/service/task-checklist-binding/index.js +9 -0
  125. package/dist-server/service/task-checklist-binding/index.js.map +1 -0
  126. package/dist-server/service/task-checklist-binding/task-checklist-binding-mutation.d.ts +5 -0
  127. package/dist-server/service/task-checklist-binding/task-checklist-binding-mutation.js +186 -0
  128. package/dist-server/service/task-checklist-binding/task-checklist-binding-mutation.js.map +1 -0
  129. package/dist-server/service/task-checklist-binding/task-checklist-binding-query.d.ts +8 -0
  130. package/dist-server/service/task-checklist-binding/task-checklist-binding-query.js +61 -0
  131. package/dist-server/service/task-checklist-binding/task-checklist-binding-query.js.map +1 -0
  132. package/dist-server/service/task-checklist-binding/task-checklist-binding-type.d.ts +15 -0
  133. package/dist-server/service/task-checklist-binding/task-checklist-binding-type.js +57 -0
  134. package/dist-server/service/task-checklist-binding/task-checklist-binding-type.js.map +1 -0
  135. package/dist-server/service/task-checklist-binding/task-checklist-binding.d.ts +22 -0
  136. package/dist-server/service/task-checklist-binding/task-checklist-binding.js +106 -0
  137. package/dist-server/service/task-checklist-binding/task-checklist-binding.js.map +1 -0
  138. package/dist-server/service/task-resource/task-resource-query.d.ts +2 -2
  139. package/dist-server/service/task-resource/task-resource-query.js +4 -9
  140. package/dist-server/service/task-resource/task-resource-query.js.map +1 -1
  141. package/dist-server/service/worker-type/worker-type-query.d.ts +2 -2
  142. package/dist-server/service/worker-type/worker-type-query.js +5 -10
  143. package/dist-server/service/worker-type/worker-type-query.js.map +1 -1
  144. package/dist-server/tsconfig.tsbuildinfo +1 -1
  145. package/package.json +15 -13
  146. package/things-factory.config.js +3 -3
  147. package/translations/en.json +10 -9
  148. package/translations/ja.json +15 -1
  149. package/translations/ko.json +3 -0
  150. package/translations/ms.json +15 -1
  151. package/translations/zh.json +15 -1
  152. package/dist-client/pages/project/popup/popup-schedule-upload.js.map +0 -1
  153. package/dist-client/pages/project/project-schedule-list.js.map +0 -1
  154. package/dist-client/pages/project/project-schedule.js +0 -407
  155. package/dist-client/pages/project/project-schedule.js.map +0 -1
@@ -0,0 +1,308 @@
1
+ import { __decorate, __metadata } from "tslib";
2
+ import '@material/web/icon/icon.js';
3
+ import gql from 'graphql-tag';
4
+ import { client } from '@operato/graphql';
5
+ import { css, html, LitElement } from 'lit';
6
+ import { customElement, property, query, state } from 'lit/decorators.js';
7
+ import { ButtonContainerStyles, ScrollbarStyles } from '@operato/styles';
8
+ import { notify } from '@operato/layout';
9
+ import { store, User, connect } from '@operato/shell';
10
+ import { OxPrompt } from '@operato/popup/ox-prompt.js';
11
+ import { openPopup } from '@operato/layout';
12
+ import { BuildingInspectionStatus } from './task-checklist-view';
13
+ let TaskChecklistAttachmentListPopup = class TaskChecklistAttachmentListPopup extends connect(store)(LitElement) {
14
+ constructor() {
15
+ super(...arguments);
16
+ this.checklistItemId = '';
17
+ this.status = BuildingInspectionStatus.WAIT;
18
+ this.item = { count: 0 };
19
+ this.checklistItemAttachments = [];
20
+ this.checklistItemAttachmentCount = 0;
21
+ this.user = {};
22
+ }
23
+ render() {
24
+ return html `
25
+ <div body>
26
+ <h3>제품검사에 대한 파일: ${this.checklistItemAttachmentCount || 0}건</h3>
27
+
28
+ <div attachment-container>
29
+ ${this.checklistItemAttachments.map(attachment => {
30
+ return html `
31
+ <div attachment-row>
32
+ <div creator-container>
33
+ <span creator><md-icon slot="icon">account_circle</md-icon> ${attachment.creator.name}</span>
34
+ <span createdAt>
35
+ <md-icon slot="icon">schedule</md-icon> ${this._formatDate(attachment.createdAt)}
36
+ ${attachment.creator.email === this.user.email && this.status != BuildingInspectionStatus.PASS
37
+ ? html ` <md-icon delete slot="icon" @click=${() => this._deleteAttachment(attachment.id)}>delete</md-icon>`
38
+ : ''}
39
+ <a button-download href=${attachment.fullpath} download=${attachment.name}>
40
+ <md-icon slot="icon">download</md-icon></a
41
+ >
42
+ </span>
43
+ </div>
44
+ <a attachment @click=${() => this._onClickPreview(attachment.fullpath)}>${attachment.name}</a>
45
+ </div>
46
+ `;
47
+ })}
48
+ </div>
49
+
50
+ <ox-input-file
51
+ accept="*/*"
52
+ multiple="true"
53
+ hide-filelist
54
+ ?disabled=${this.status == BuildingInspectionStatus.PASS}
55
+ @change=${this.onCreateAttachment.bind(this)}
56
+ ></ox-input-file>
57
+
58
+ <div button-container>
59
+ <md-elevated-button @click=${this._close}> <md-icon slot="icon">cancel</md-icon>취소 </md-elevated-button>
60
+ </div>
61
+ </div>
62
+ `;
63
+ }
64
+ async firstUpdated() {
65
+ var _a;
66
+ this.user = (_a = store.getState().auth) === null || _a === void 0 ? void 0 : _a.user;
67
+ await this._loadAttachments();
68
+ }
69
+ async _loadAttachments() {
70
+ const response = await client.query({
71
+ query: gql `
72
+ query ChecklistItem($id: String!) {
73
+ checklistItem(id: $id) {
74
+ id
75
+ checklistItemAttachmentCount
76
+ checklistItemAttachments {
77
+ id
78
+ name
79
+ fullpath
80
+ creator {
81
+ id
82
+ name
83
+ email
84
+ }
85
+ createdAt
86
+ }
87
+ }
88
+ }
89
+ `,
90
+ variables: {
91
+ id: this.checklistItemId
92
+ }
93
+ });
94
+ if (response.errors)
95
+ return;
96
+ this.checklistItemAttachments = response.data.checklistItem.checklistItemAttachments || [];
97
+ this.checklistItemAttachmentCount = response.data.checklistItem.checklistItemAttachmentCount;
98
+ }
99
+ async _deleteAttachment(attachmentId) {
100
+ var _a, _b;
101
+ if (this.status == BuildingInspectionStatus.PASS) {
102
+ notify({ message: '완료 상태인 검측정보를 변경할 수 없습니다.', level: 'error' });
103
+ return;
104
+ }
105
+ if (await OxPrompt.open({
106
+ title: '첨부 자료를 삭제',
107
+ text: '첨부 자료를 삭제 하시겠습니까?',
108
+ confirmButton: { text: '삭제' },
109
+ cancelButton: { text: '취소' }
110
+ })) {
111
+ const response = await client.mutate({
112
+ mutation: gql `
113
+ mutation DeleteAttachment($deleteAttachmentId: String!) {
114
+ deleteAttachment(id: $deleteAttachmentId)
115
+ }
116
+ `,
117
+ variables: {
118
+ deleteAttachmentId: attachmentId
119
+ }
120
+ });
121
+ if (!response.errors) {
122
+ this.checklistItemAttachments = [...this.checklistItemAttachments.filter(attachment => attachment.id != attachmentId)];
123
+ notify({ message: '첨부 자료를 삭제하였습니다.', level: 'info' });
124
+ }
125
+ else {
126
+ notify({ message: ((_b = (_a = response.errors) === null || _a === void 0 ? void 0 : _a[0]) === null || _b === void 0 ? void 0 : _b.message) || '첨부 자료 삭제에 실패하였습니다.', level: 'error' });
127
+ }
128
+ this._dispatchEvent();
129
+ }
130
+ }
131
+ _close() {
132
+ history.back();
133
+ }
134
+ // 파일 변경 시 파일을 저장할 핸들러
135
+ async onCreateAttachment(e) {
136
+ if (this.status == BuildingInspectionStatus.PASS) {
137
+ notify({ message: '완료 상태인 검측정보를 변경할 수 없습니다.', level: 'error' });
138
+ return;
139
+ }
140
+ const files = e.detail;
141
+ await this._createAttachments(files);
142
+ this._dispatchEvent();
143
+ }
144
+ async _createAttachments(files) {
145
+ const checklistItemId = this.checklistItemId;
146
+ const response = await client.mutate({
147
+ mutation: gql `
148
+ mutation ($attachments: [NewAttachment!]!) {
149
+ createAttachments(attachments: $attachments) {
150
+ id
151
+ name
152
+ fullpath
153
+ creator {
154
+ id
155
+ name
156
+ email
157
+ }
158
+ createdAt
159
+ }
160
+ }
161
+ `,
162
+ variables: {
163
+ attachments: files.map(file => {
164
+ return { file, refBy: checklistItemId, refType: 'ChecklistItem', description: this.status };
165
+ })
166
+ },
167
+ context: {
168
+ hasUpload: true
169
+ }
170
+ });
171
+ const attachments = response.data.createAttachments;
172
+ this.checklistItemAttachments = [...attachments, ...this.checklistItemAttachments];
173
+ this.checklistItemAttachmentCount = this.checklistItemAttachmentCount + attachments.length;
174
+ }
175
+ _formatDate(date) {
176
+ const _date = new Date(date.toLocaleString('en-US', { timeZone: 'Asia/Seoul' }));
177
+ const year = _date.getFullYear();
178
+ const month = String(_date.getMonth() + 1).padStart(2, '0');
179
+ const day = String(_date.getDate()).padStart(2, '0');
180
+ const hours = String(_date.getHours()).padStart(2, '0');
181
+ const minutes = String(_date.getMinutes()).padStart(2, '0');
182
+ const seconds = String(_date.getSeconds()).padStart(2, '0');
183
+ return `${year}.${month}.${day} ${hours}:${minutes}:${seconds}`;
184
+ }
185
+ // 첨부 자료 변경 이벤트 디스패치
186
+ _dispatchEvent() {
187
+ this.dispatchEvent(new CustomEvent('change-attachment', { detail: { checklistItemId: this.checklistItemId } }));
188
+ }
189
+ _onClickPreview(filepath) {
190
+ openPopup(html ` <file-preview-popup .filepath=${filepath}></file-preview-popup> `, {
191
+ backdrop: true,
192
+ size: 'large',
193
+ title: '미리보기'
194
+ });
195
+ }
196
+ };
197
+ TaskChecklistAttachmentListPopup.styles = [
198
+ ButtonContainerStyles,
199
+ ScrollbarStyles,
200
+ css `
201
+ :host {
202
+ display: flex;
203
+ flex-direction: column;
204
+ padding: 15px 20px;
205
+ background-color: var(--md-sys-color-surface);
206
+ }
207
+
208
+ div[body] {
209
+ height: 100%;
210
+ display: flex;
211
+ flex-direction: column;
212
+ gap: 12px;
213
+ }
214
+
215
+ div[attachment-container] {
216
+ overflow-y: auto;
217
+ gap: 10px;
218
+ display: flex;
219
+ flex-direction: column;
220
+ flex: 1;
221
+
222
+ div[attachment-row] {
223
+ display: flex;
224
+ flex-direction: column;
225
+
226
+ div[creator-container] {
227
+ display: flex;
228
+ justify-content: space-between;
229
+
230
+ span[creator] {
231
+ font-weight: 600;
232
+ display: flex;
233
+ align-items: center;
234
+ gap: 3px;
235
+ }
236
+ span[createdAt] {
237
+ display: flex;
238
+ align-items: center;
239
+ gap: 3px;
240
+
241
+ md-icon[delete] {
242
+ cursor: pointer;
243
+ }
244
+
245
+ a[button-download] {
246
+ display: flex;
247
+ color: #000;
248
+ }
249
+ }
250
+ }
251
+
252
+ a[attachment] {
253
+ margin-left: 20px;
254
+ text-decoration: none;
255
+ color: #000;
256
+ }
257
+ }
258
+ }
259
+
260
+ h3 {
261
+ position: relative;
262
+ color: rgb(5, 149, 229);
263
+ font-size: 17px;
264
+ font-weight: 700;
265
+ background-color: var(--md-sys-color-surface);
266
+ margin-top: 0px;
267
+ margin-bottom: 5px;
268
+ }
269
+
270
+ div[button-container] {
271
+ display: flex;
272
+ justify-content: flex-end;
273
+ gap: 10px;
274
+ }
275
+ `
276
+ ];
277
+ __decorate([
278
+ property({ type: String }),
279
+ __metadata("design:type", String)
280
+ ], TaskChecklistAttachmentListPopup.prototype, "checklistItemId", void 0);
281
+ __decorate([
282
+ property({ type: String }),
283
+ __metadata("design:type", String)
284
+ ], TaskChecklistAttachmentListPopup.prototype, "status", void 0);
285
+ __decorate([
286
+ state(),
287
+ __metadata("design:type", Object)
288
+ ], TaskChecklistAttachmentListPopup.prototype, "item", void 0);
289
+ __decorate([
290
+ state(),
291
+ __metadata("design:type", Object)
292
+ ], TaskChecklistAttachmentListPopup.prototype, "checklistItemAttachments", void 0);
293
+ __decorate([
294
+ state(),
295
+ __metadata("design:type", Number)
296
+ ], TaskChecklistAttachmentListPopup.prototype, "checklistItemAttachmentCount", void 0);
297
+ __decorate([
298
+ state(),
299
+ __metadata("design:type", User)
300
+ ], TaskChecklistAttachmentListPopup.prototype, "user", void 0);
301
+ __decorate([
302
+ query('div[attachment-container]'),
303
+ __metadata("design:type", HTMLDivElement)
304
+ ], TaskChecklistAttachmentListPopup.prototype, "attachmentContainer", void 0);
305
+ TaskChecklistAttachmentListPopup = __decorate([
306
+ customElement('task-checklist-attachment-list-popup')
307
+ ], TaskChecklistAttachmentListPopup);
308
+ //# sourceMappingURL=task-checklist-attachment-list-popup.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"task-checklist-attachment-list-popup.js","sourceRoot":"","sources":["../../../../../client/pages/project/popup/checklist/task-checklist-attachment-list-popup.ts"],"names":[],"mappings":";AAAA,OAAO,4BAA4B,CAAA;AACnC,OAAO,GAAG,MAAM,aAAa,CAAA;AAC7B,OAAO,EAAE,MAAM,EAAE,MAAM,kBAAkB,CAAA;AACzC,OAAO,EAAE,GAAG,EAAE,IAAI,EAAE,UAAU,EAAE,MAAM,KAAK,CAAA;AAC3C,OAAO,EAAE,aAAa,EAAE,QAAQ,EAAE,KAAK,EAAE,KAAK,EAAE,MAAM,mBAAmB,CAAA;AACzE,OAAO,EAAE,qBAAqB,EAAE,eAAe,EAAE,MAAM,iBAAiB,CAAA;AACxE,OAAO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C;AAClC;IAAR,KAAK,EAAE;;sFAAyC;AACxC;IAAR,KAAK,EAAE;8BAAO,IAAI;8DAAK;AACY;IAAnC,KAAK,CAAC,2BAA2B,CAAC;8BAAuB,cAAc;6EAAA;AAzFpE,gCAAgC;IADrC,aAAa,CAAC,sCAAsC,CAAC;GAChD,gCAAgC,CA6RrC","sourcesContent":["import '@material/web/icon/icon.js'\nimport gql from 'graphql-tag'\nimport { client } from '@operato/graphql'\nimport { css, html, LitElement } from 'lit'\nimport { customElement, property, query, state } from 'lit/decorators.js'\nimport { ButtonContainerStyles, ScrollbarStyles } from '@operato/styles'\nimport { notify } from '@operato/layout'\nimport { store, User, connect } from '@operato/shell'\nimport { OxPrompt } from '@operato/popup/ox-prompt.js'\nimport { openPopup } from '@operato/layout'\nimport { BuildingInspectionStatus } from './task-checklist-view'\n\n@customElement('task-checklist-attachment-list-popup')\nclass TaskChecklistAttachmentListPopup extends connect(store)(LitElement) {\n static styles = [\n ButtonContainerStyles,\n ScrollbarStyles,\n css`\n :host {\n display: flex;\n flex-direction: column;\n padding: 15px 20px;\n background-color: var(--md-sys-color-surface);\n }\n\n div[body] {\n height: 100%;\n display: flex;\n flex-direction: column;\n gap: 12px;\n }\n\n div[attachment-container] {\n overflow-y: auto;\n gap: 10px;\n display: flex;\n flex-direction: column;\n flex: 1;\n\n div[attachment-row] {\n display: flex;\n flex-direction: column;\n\n div[creator-container] {\n display: flex;\n justify-content: space-between;\n\n span[creator] {\n font-weight: 600;\n display: flex;\n align-items: center;\n gap: 3px;\n }\n span[createdAt] {\n display: flex;\n align-items: center;\n gap: 3px;\n\n md-icon[delete] {\n cursor: pointer;\n }\n\n a[button-download] {\n display: flex;\n color: #000;\n }\n }\n }\n\n a[attachment] {\n margin-left: 20px;\n text-decoration: none;\n color: #000;\n }\n }\n }\n\n h3 {\n position: relative;\n color: rgb(5, 149, 229);\n font-size: 17px;\n font-weight: 700;\n background-color: var(--md-sys-color-surface);\n margin-top: 0px;\n margin-bottom: 5px;\n }\n\n div[button-container] {\n display: flex;\n justify-content: flex-end;\n gap: 10px;\n }\n `\n ]\n\n @property({ type: String }) checklistItemId: string = ''\n @property({ type: String }) status: BuildingInspectionStatus = BuildingInspectionStatus.WAIT\n\n @state() item: any = { count: 0 }\n @state() checklistItemAttachments: any = []\n @state() checklistItemAttachmentCount: number = 0\n @state() user: User = {}\n @query('div[attachment-container]') attachmentContainer!: HTMLDivElement\n\n render() {\n return html`\n <div body>\n <h3>제품검사에 대한 파일: ${this.checklistItemAttachmentCount || 0}건</h3>\n\n <div attachment-container>\n ${this.checklistItemAttachments.map(attachment => {\n return html`\n <div attachment-row>\n <div creator-container>\n <span creator><md-icon slot=\"icon\">account_circle</md-icon> ${attachment.creator.name}</span>\n <span createdAt>\n <md-icon slot=\"icon\">schedule</md-icon> ${this._formatDate(attachment.createdAt)}\n ${attachment.creator.email === this.user.email && this.status != BuildingInspectionStatus.PASS\n ? html` <md-icon delete slot=\"icon\" @click=${() => this._deleteAttachment(attachment.id)}>delete</md-icon>`\n : ''}\n <a button-download href=${attachment.fullpath} download=${attachment.name}>\n <md-icon slot=\"icon\">download</md-icon></a\n >\n </span>\n </div>\n <a attachment @click=${() => this._onClickPreview(attachment.fullpath)}>${attachment.name}</a>\n </div>\n `\n })}\n </div>\n\n <ox-input-file\n accept=\"*/*\"\n multiple=\"true\"\n hide-filelist\n ?disabled=${this.status == BuildingInspectionStatus.PASS}\n @change=${this.onCreateAttachment.bind(this)}\n ></ox-input-file>\n\n <div button-container>\n <md-elevated-button @click=${this._close}> <md-icon slot=\"icon\">cancel</md-icon>취소 </md-elevated-button>\n </div>\n </div>\n `\n }\n\n async firstUpdated() {\n this.user = (store.getState() as any).auth?.user\n\n await this._loadAttachments()\n }\n\n private async _loadAttachments() {\n const response = await client.query({\n query: gql`\n query ChecklistItem($id: String!) {\n checklistItem(id: $id) {\n id\n checklistItemAttachmentCount\n checklistItemAttachments {\n id\n name\n fullpath\n creator {\n id\n name\n email\n }\n createdAt\n }\n }\n }\n `,\n variables: {\n id: this.checklistItemId\n }\n })\n\n if (response.errors) return\n\n this.checklistItemAttachments = response.data.checklistItem.checklistItemAttachments || []\n this.checklistItemAttachmentCount = response.data.checklistItem.checklistItemAttachmentCount\n }\n\n private async _deleteAttachment(attachmentId: string) {\n if (this.status == BuildingInspectionStatus.PASS) {\n notify({ message: '완료 상태인 검측정보를 변경할 수 없습니다.', level: 'error' })\n return\n }\n\n if (\n await OxPrompt.open({\n title: '첨부 자료를 삭제',\n text: '첨부 자료를 삭제 하시겠습니까?',\n confirmButton: { text: '삭제' },\n cancelButton: { text: '취소' }\n })\n ) {\n const response = await client.mutate({\n mutation: gql`\n mutation DeleteAttachment($deleteAttachmentId: String!) {\n deleteAttachment(id: $deleteAttachmentId)\n }\n `,\n variables: {\n deleteAttachmentId: attachmentId\n }\n })\n\n if (!response.errors) {\n this.checklistItemAttachments = [...this.checklistItemAttachments.filter(attachment => attachment.id != attachmentId)]\n notify({ message: '첨부 자료를 삭제하였습니다.', level: 'info' })\n } else {\n notify({ message: response.errors?.[0]?.message || '첨부 자료 삭제에 실패하였습니다.', level: 'error' })\n }\n\n this._dispatchEvent()\n }\n }\n\n private _close() {\n history.back()\n }\n\n // 파일 변경 시 파일을 저장할 핸들러\n private async onCreateAttachment(e: CustomEvent) {\n if (this.status == BuildingInspectionStatus.PASS) {\n notify({ message: '완료 상태인 검측정보를 변경할 수 없습니다.', level: 'error' })\n return\n }\n\n const files = e.detail\n\n await this._createAttachments(files)\n\n this._dispatchEvent()\n }\n\n async _createAttachments(files: File[]) {\n const checklistItemId = this.checklistItemId\n\n const response = await client.mutate({\n mutation: gql`\n mutation ($attachments: [NewAttachment!]!) {\n createAttachments(attachments: $attachments) {\n id\n name\n fullpath\n creator {\n id\n name\n email\n }\n createdAt\n }\n }\n `,\n variables: {\n attachments: files.map(file => {\n return { file, refBy: checklistItemId, refType: 'ChecklistItem', description: this.status }\n })\n },\n context: {\n hasUpload: true\n }\n })\n\n const attachments = response.data.createAttachments\n\n this.checklistItemAttachments = [...attachments, ...this.checklistItemAttachments]\n this.checklistItemAttachmentCount = this.checklistItemAttachmentCount + attachments.length\n }\n\n private _formatDate(date) {\n const _date = new Date(date.toLocaleString('en-US', { timeZone: 'Asia/Seoul' }))\n\n const year = _date.getFullYear()\n const month = String(_date.getMonth() + 1).padStart(2, '0')\n const day = String(_date.getDate()).padStart(2, '0')\n const hours = String(_date.getHours()).padStart(2, '0')\n const minutes = String(_date.getMinutes()).padStart(2, '0')\n const seconds = String(_date.getSeconds()).padStart(2, '0')\n\n return `${year}.${month}.${day} ${hours}:${minutes}:${seconds}`\n }\n\n // 첨부 자료 변경 이벤트 디스패치\n _dispatchEvent() {\n this.dispatchEvent(new CustomEvent('change-attachment', { detail: { checklistItemId: this.checklistItemId } }))\n }\n\n private _onClickPreview(filepath: string) {\n openPopup(html` <file-preview-popup .filepath=${filepath}></file-preview-popup> `, {\n backdrop: true,\n size: 'large',\n title: '미리보기'\n })\n }\n}\n"]}
@@ -0,0 +1 @@
1
+ import '@material/web/icon/icon.js';