@dssp/supervision 1.0.0-alpha.3 → 1.0.0-alpha.5

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 (86) hide show
  1. package/dist-client/pages/building-inspection/building-inspection-detail-drawing.d.ts +0 -1
  2. package/dist-client/pages/building-inspection/building-inspection-detail-drawing.js +16 -11
  3. package/dist-client/pages/building-inspection/building-inspection-detail-drawing.js.map +1 -1
  4. package/dist-client/pages/building-inspection/component/inspection-event-provider.js +3 -3
  5. package/dist-client/pages/building-inspection/component/inspection-event-provider.js.map +1 -1
  6. package/dist-client/pages/building-inspection-grid/building-inspection-grid-detail.d.ts +40 -0
  7. package/dist-client/pages/building-inspection-grid/building-inspection-grid-detail.js +756 -0
  8. package/dist-client/pages/building-inspection-grid/building-inspection-grid-detail.js.map +1 -0
  9. package/dist-client/pages/building-inspection-grid/component/grid-inspection-create-popup.d.ts +2 -0
  10. package/dist-client/pages/building-inspection-grid/component/grid-inspection-create-popup.js +626 -0
  11. package/dist-client/pages/building-inspection-grid/component/grid-inspection-create-popup.js.map +1 -0
  12. package/dist-client/pages/building-inspection-grid/component/notice-comment-popup.d.ts +1 -0
  13. package/dist-client/pages/building-inspection-grid/component/notice-comment-popup.js +304 -0
  14. package/dist-client/pages/building-inspection-grid/component/notice-comment-popup.js.map +1 -0
  15. package/dist-client/pages/checklist/checklist-view.d.ts +2 -0
  16. package/dist-client/pages/checklist/checklist-view.js +282 -174
  17. package/dist-client/pages/checklist/checklist-view.js.map +1 -1
  18. package/dist-client/pages/checklist-template/checklist-template-item.js +8 -3
  19. package/dist-client/pages/checklist-template/checklist-template-item.js.map +1 -1
  20. package/dist-client/pages/checklist-template/checklist-template-list.js +1 -1
  21. package/dist-client/pages/checklist-template/checklist-template-list.js.map +1 -1
  22. package/dist-client/route.d.ts +1 -1
  23. package/dist-client/route.js +3 -0
  24. package/dist-client/route.js.map +1 -1
  25. package/dist-client/stt/speech-to-text.d.ts +36 -0
  26. package/dist-client/stt/speech-to-text.js +89 -0
  27. package/dist-client/stt/speech-to-text.js.map +1 -0
  28. package/dist-client/stt/stt-utils.d.ts +28 -0
  29. package/dist-client/stt/stt-utils.js +146 -0
  30. package/dist-client/stt/stt-utils.js.map +1 -0
  31. package/dist-client/tsconfig.tsbuildinfo +1 -1
  32. package/dist-server/service/action-plan/index.d.ts +0 -1
  33. package/dist-server/service/action-plan/index.js +1 -2
  34. package/dist-server/service/action-plan/index.js.map +1 -1
  35. package/dist-server/service/building-inspection/building-inspection-mutation.js +25 -10
  36. package/dist-server/service/building-inspection/building-inspection-mutation.js.map +1 -1
  37. package/dist-server/service/building-inspection/building-inspection-query.d.ts +2 -1
  38. package/dist-server/service/building-inspection/building-inspection-query.js +31 -2
  39. package/dist-server/service/building-inspection/building-inspection-query.js.map +1 -1
  40. package/dist-server/service/building-inspection/building-inspection-type.d.ts +5 -2
  41. package/dist-server/service/building-inspection/building-inspection-type.js +16 -4
  42. package/dist-server/service/building-inspection/building-inspection-type.js.map +1 -1
  43. package/dist-server/service/building-inspection/building-inspection.d.ts +9 -0
  44. package/dist-server/service/building-inspection/building-inspection.js +40 -2
  45. package/dist-server/service/building-inspection/building-inspection.js.map +1 -1
  46. package/dist-server/service/building-inspection/index.d.ts +2 -4
  47. package/dist-server/service/building-inspection/index.js +2 -4
  48. package/dist-server/service/building-inspection/index.js.map +1 -1
  49. package/dist-server/service/checklist/checklist-history.d.ts +8 -0
  50. package/dist-server/service/checklist/checklist-history.js +36 -0
  51. package/dist-server/service/checklist/checklist-history.js.map +1 -1
  52. package/dist-server/service/checklist/checklist.d.ts +10 -0
  53. package/dist-server/service/checklist/checklist.js +45 -3
  54. package/dist-server/service/checklist/checklist.js.map +1 -1
  55. package/dist-server/service/checklist/index.d.ts +0 -2
  56. package/dist-server/service/checklist/index.js +1 -3
  57. package/dist-server/service/checklist/index.js.map +1 -1
  58. package/dist-server/service/checklist-item-comment/index.d.ts +0 -2
  59. package/dist-server/service/checklist-item-comment/index.js +1 -3
  60. package/dist-server/service/checklist-item-comment/index.js.map +1 -1
  61. package/dist-server/service/checklist-template-item/checklist-template-item.js +2 -4
  62. package/dist-server/service/checklist-template-item/checklist-template-item.js.map +1 -1
  63. package/dist-server/service/index.d.ts +0 -1
  64. package/dist-server/service/index.js +1 -11
  65. package/dist-server/service/index.js.map +1 -1
  66. package/dist-server/service/issue/index.d.ts +0 -1
  67. package/dist-server/service/issue/index.js +1 -2
  68. package/dist-server/service/issue/index.js.map +1 -1
  69. package/dist-server/service/project-report/index.d.ts +0 -1
  70. package/dist-server/service/project-report/index.js +1 -2
  71. package/dist-server/service/project-report/index.js.map +1 -1
  72. package/dist-server/service/supervisor/index.d.ts +0 -1
  73. package/dist-server/service/supervisor/index.js +1 -2
  74. package/dist-server/service/supervisor/index.js.map +1 -1
  75. package/dist-server/tsconfig.tsbuildinfo +1 -1
  76. package/package.json +4 -4
  77. package/things-factory.config.js +3 -1
  78. package/dist-server/service/building-inspection/event-subscriber.d.ts +0 -7
  79. package/dist-server/service/building-inspection/event-subscriber.js +0 -21
  80. package/dist-server/service/building-inspection/event-subscriber.js.map +0 -1
  81. package/dist-server/service/checklist/event-subscriber.d.ts +0 -7
  82. package/dist-server/service/checklist/event-subscriber.js +0 -21
  83. package/dist-server/service/checklist/event-subscriber.js.map +0 -1
  84. package/dist-server/service/checklist-item-comment/event-subscriber.d.ts +0 -7
  85. package/dist-server/service/checklist-item-comment/event-subscriber.js +0 -21
  86. package/dist-server/service/checklist-item-comment/event-subscriber.js.map +0 -1
@@ -0,0 +1 @@
1
+ import '@material/web/icon/icon.js';
@@ -0,0 +1,304 @@
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 } from '@operato/shell';
10
+ import { OxPrompt } from '@operato/popup/ox-prompt.js';
11
+ let NoticeCommentPopup = class NoticeCommentPopup extends LitElement {
12
+ constructor() {
13
+ super(...arguments);
14
+ this.buildingLevelId = '';
15
+ this.title = '';
16
+ this.item = { count: 0 };
17
+ this.noticeComments = [];
18
+ this.comment = '';
19
+ this.user = {};
20
+ }
21
+ render() {
22
+ return html `
23
+ <div body>
24
+ <h3>${this.title}</h3>
25
+
26
+ <div comments-container>
27
+ ${this.noticeComments.map(comment => {
28
+ return html `
29
+ <div comment-row>
30
+ <div creator-container>
31
+ <span creator><md-icon slot="icon">account_circle</md-icon> ${comment.creator.name}</span>
32
+ <span createdAt>
33
+ <md-icon slot="icon">schedule</md-icon> ${this._formatDate(comment.createdAt)}
34
+ ${comment.creator.email === this.user.email
35
+ ? html ` <md-icon delete slot="icon" @click=${() => this._deleteComment(comment.id)}>delete</md-icon>`
36
+ : ''}
37
+ </span>
38
+ </div>
39
+ <div comment>${comment.comment}</div>
40
+ </div>
41
+ `;
42
+ })}
43
+ </div>
44
+
45
+ <textarea .value=${this.comment || ''} @input=${this._onInputChange}></textarea>
46
+
47
+ <div button-container>
48
+ <md-elevated-button blue @click=${this._createComment}> <md-icon slot="icon">task</md-icon>저장 </md-elevated-button>
49
+ <md-elevated-button @click=${this._close}> <md-icon slot="icon">cancel</md-icon>취소 </md-elevated-button>
50
+ </div>
51
+ </div>
52
+ `;
53
+ }
54
+ async firstUpdated() {
55
+ var _a;
56
+ this.user = (_a = store.getState().auth) === null || _a === void 0 ? void 0 : _a.user;
57
+ this.comment = '';
58
+ await this._loadComments();
59
+ this._scrollBottom();
60
+ }
61
+ async _loadComments() {
62
+ const response = await client.query({
63
+ query: gql `
64
+ query NoticeComments($buildingLevelId: String!) {
65
+ noticeComments(buildingLevelId: $buildingLevelId) {
66
+ id
67
+ comment
68
+ creator {
69
+ id
70
+ email
71
+ name
72
+ }
73
+ createdAt
74
+ }
75
+ }
76
+ `,
77
+ variables: {
78
+ buildingLevelId: this.buildingLevelId
79
+ }
80
+ });
81
+ if (response.errors)
82
+ return;
83
+ const items = response.data.noticeComments;
84
+ this.noticeComments = [...items.reverse(), ...this.noticeComments];
85
+ }
86
+ async _createComment() {
87
+ var _a, _b;
88
+ if (!this.comment) {
89
+ notify({ message: '코멘트를 입력해주세요.', level: 'warn' });
90
+ return;
91
+ }
92
+ const response = await client.mutate({
93
+ mutation: gql `
94
+ mutation CreateNoticeComment($noticeComment: NewNoticeComment!) {
95
+ createNoticeComment(noticeComment: $noticeComment) {
96
+ id
97
+ comment
98
+ creator {
99
+ id
100
+ email
101
+ name
102
+ }
103
+ createdAt
104
+ }
105
+ }
106
+ `,
107
+ variables: {
108
+ noticeComment: {
109
+ comment: this.comment,
110
+ buildingLevelId: this.buildingLevelId
111
+ }
112
+ }
113
+ });
114
+ if (!response.errors) {
115
+ this.comment = '';
116
+ this.noticeComments = [...this.noticeComments, Object.assign({}, response.data.createNoticeComment)];
117
+ this._scrollBottom();
118
+ }
119
+ else {
120
+ notify({ message: ((_b = (_a = response.errors) === null || _a === void 0 ? void 0 : _a[0]) === null || _b === void 0 ? void 0 : _b.message) || '코멘트 등록에 실패하였습니다.', level: 'error' });
121
+ }
122
+ this._dispatchEvent('create');
123
+ }
124
+ async _deleteComment(commentId) {
125
+ var _a, _b;
126
+ if (await OxPrompt.open({
127
+ title: '코멘트를 삭제',
128
+ text: '코멘트를 삭제 하시겠습니까?',
129
+ confirmButton: { text: '삭제' },
130
+ cancelButton: { text: '취소' }
131
+ })) {
132
+ const response = await client.mutate({
133
+ mutation: gql `
134
+ mutation DeleteNoticeComment($id: String!) {
135
+ deleteNoticeComment(id: $id)
136
+ }
137
+ `,
138
+ variables: {
139
+ id: commentId
140
+ }
141
+ });
142
+ if (!response.errors) {
143
+ this.noticeComments = [...this.noticeComments.filter(comment => comment.id != commentId)];
144
+ notify({ message: '코멘트를 삭제하였습니다.', level: 'info' });
145
+ }
146
+ else {
147
+ notify({ message: ((_b = (_a = response.errors) === null || _a === void 0 ? void 0 : _a[0]) === null || _b === void 0 ? void 0 : _b.message) || '코멘트 삭제에 실패하였습니다.', level: 'error' });
148
+ }
149
+ this._dispatchEvent('delete');
150
+ }
151
+ }
152
+ _close() {
153
+ history.back();
154
+ }
155
+ // Input 요소의 값이 변경될 때 호출되는 콜백 함수
156
+ _onInputChange(event) {
157
+ const target = event.target;
158
+ this.comment = target.value;
159
+ }
160
+ _formatDate(date) {
161
+ const _date = new Date(date.toLocaleString('en-US', { timeZone: 'Asia/Seoul' }));
162
+ const year = _date.getFullYear();
163
+ const month = String(_date.getMonth() + 1).padStart(2, '0');
164
+ const day = String(_date.getDate()).padStart(2, '0');
165
+ const hours = String(_date.getHours()).padStart(2, '0');
166
+ const minutes = String(_date.getMinutes()).padStart(2, '0');
167
+ const seconds = String(_date.getSeconds()).padStart(2, '0');
168
+ return `${year}.${month}.${day} ${hours}:${minutes}:${seconds}`;
169
+ }
170
+ // 댓글 스크롤 맨 밑으로
171
+ async _scrollBottom() {
172
+ setTimeout(() => {
173
+ this.commentsContainer.scrollTop = this.commentsContainer.scrollHeight;
174
+ }, 100);
175
+ }
176
+ // 조치사항 변경 이벤트 디스패치
177
+ _dispatchEvent(type = 'create') {
178
+ this.dispatchEvent(new CustomEvent('change-comment', { detail: { buildingLevelId: this.buildingLevelId, type } }));
179
+ }
180
+ };
181
+ NoticeCommentPopup.styles = [
182
+ ButtonContainerStyles,
183
+ ScrollbarStyles,
184
+ css `
185
+ :host {
186
+ display: flex;
187
+ flex-direction: column;
188
+ padding: 15px 20px;
189
+ background-color: var(--md-sys-color-surface);
190
+ }
191
+
192
+ div[body] {
193
+ height: 100%;
194
+ display: flex;
195
+ flex-direction: column;
196
+ gap: 12px;
197
+ }
198
+
199
+ div[comments-container] {
200
+ overflow-y: auto;
201
+ gap: 10px;
202
+ display: flex;
203
+ flex-direction: column;
204
+ flex: 1;
205
+
206
+ div[comment-row] {
207
+ display: flex;
208
+ flex-direction: column;
209
+ padding-right: 10px;
210
+
211
+ div[creator-container] {
212
+ display: flex;
213
+ justify-content: space-between;
214
+
215
+ span[creator] {
216
+ font-weight: 600;
217
+ display: flex;
218
+ align-items: center;
219
+ gap: 3px;
220
+ }
221
+ span[createdAt] {
222
+ display: flex;
223
+ align-items: center;
224
+ gap: 3px;
225
+
226
+ md-icon[delete] {
227
+ cursor: pointer;
228
+ }
229
+ }
230
+ }
231
+
232
+ div[comment] {
233
+ margin-left: 20px;
234
+ }
235
+ }
236
+ }
237
+
238
+ h3 {
239
+ position: relative;
240
+ color: rgb(5, 149, 229);
241
+ font-size: 17px;
242
+ font-weight: 700;
243
+ background-color: var(--md-sys-color-surface);
244
+ margin-top: 0px;
245
+ margin-bottom: 5px;
246
+ }
247
+
248
+ textarea {
249
+ height: 75px;
250
+ border: 1px solid #ccc;
251
+ }
252
+
253
+ div[button-container] {
254
+ display: flex;
255
+ justify-content: flex-end;
256
+ gap: 10px;
257
+
258
+ md-elevated-button[blue] {
259
+ --md-elevated-button-container-color: #0595e5;
260
+
261
+ --md-elevated-button-label-text-color: #fff;
262
+ --md-elevated-button-hover-label-text-color: #fff;
263
+ --md-elevated-button-pressed-label-text-color: #fff;
264
+ --md-elevated-button-focus-label-text-color: #fff;
265
+ --md-elevated-button-icon-color: #fff;
266
+ --md-elevated-button-hover-icon-color: #fff;
267
+ --md-elevated-button-pressed-icon-color: #fff;
268
+ --md-elevated-button-focus-icon-color: #fff;
269
+ }
270
+ }
271
+ `
272
+ ];
273
+ __decorate([
274
+ property({ type: String }),
275
+ __metadata("design:type", String)
276
+ ], NoticeCommentPopup.prototype, "buildingLevelId", void 0);
277
+ __decorate([
278
+ property({ type: String }),
279
+ __metadata("design:type", String)
280
+ ], NoticeCommentPopup.prototype, "title", void 0);
281
+ __decorate([
282
+ state(),
283
+ __metadata("design:type", Object)
284
+ ], NoticeCommentPopup.prototype, "item", void 0);
285
+ __decorate([
286
+ state(),
287
+ __metadata("design:type", Object)
288
+ ], NoticeCommentPopup.prototype, "noticeComments", void 0);
289
+ __decorate([
290
+ state(),
291
+ __metadata("design:type", String)
292
+ ], NoticeCommentPopup.prototype, "comment", void 0);
293
+ __decorate([
294
+ state(),
295
+ __metadata("design:type", User)
296
+ ], NoticeCommentPopup.prototype, "user", void 0);
297
+ __decorate([
298
+ query('div[comments-container]'),
299
+ __metadata("design:type", HTMLDivElement)
300
+ ], NoticeCommentPopup.prototype, "commentsContainer", void 0);
301
+ NoticeCommentPopup = __decorate([
302
+ customElement('notice-comment-popup')
303
+ ], NoticeCommentPopup);
304
+ //# sourceMappingURL=notice-comment-popup.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"notice-comment-popup.js","sourceRoot":"","sources":["../../../../client/pages/building-inspection-grid/component/notice-comment-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,EAAE,MAAM,EAAE,MAAM,iBAAiB,CAAA;AACxC,OAAO,EAAE,KAAK,EAAE,IAAI,EAAE,MAAM,gBAAgB,CAAA;AAC5C,OAAO,EAAE,QAAQ,EAAE,MAAM,6BAA6B,CAAA;AAGtD,IAAM,kBAAkB,GAAxB,MAAM,kBAAmB,SAAQ,UAAU;IAA3C;;QA8F8B,oBAAe,GAAW,EAAE,CAAA;QAC5B,UAAK,GAAW,EAAE,CAAA;QAErC,SAAI,GAAQ,EAAE,KAAK,EAAE,CAAC,EAAE,CAAA;QACxB,mBAAc,GAAQ,EA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CAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;KAuFF;CACF,AA3FY,CA2FZ;AAE2B;IAA3B,QAAQ,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC;;2DAA6B;AAC5B;IAA3B,QAAQ,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC;;iDAAmB;AAErC;IAAR,KAAK,EAAE;;gDAAyB;AACxB;IAAR,KAAK,EAAE;;0DAAyB;AACxB;IAAR,KAAK,EAAE;;mDAAqB;AACpB;IAAR,KAAK,EAAE;8BAAO,IAAI;gDAAK;AAEU;IAAjC,KAAK,CAAC,yBAAyB,CAAC;8BAAqB,cAAc;6DAAA;AAtGhE,kBAAkB;IADvB,aAAa,CAAC,sBAAsB,CAAC;GAChC,kBAAkB,CAqRvB","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 } from '@operato/shell'\nimport { OxPrompt } from '@operato/popup/ox-prompt.js'\n\n@customElement('notice-comment-popup')\nclass NoticeCommentPopup extends LitElement {\n static styles = [\n ButtonContainerStyles,\n ScrollbarStyles,\n css`\n :host {\n display: flex;\n flex-direction: column;\n padding: 15px 20px;\n 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[comments-container] {\n overflow-y: auto;\n gap: 10px;\n display: flex;\n flex-direction: column;\n flex: 1;\n\n div[comment-row] {\n display: flex;\n flex-direction: column;\n padding-right: 10px;\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 }\n\n div[comment] {\n margin-left: 20px;\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 textarea {\n height: 75px;\n border: 1px solid #ccc;\n }\n\n div[button-container] {\n display: flex;\n justify-content: flex-end;\n gap: 10px;\n\n md-elevated-button[blue] {\n --md-elevated-button-container-color: #0595e5;\n\n --md-elevated-button-label-text-color: #fff;\n --md-elevated-button-hover-label-text-color: #fff;\n --md-elevated-button-pressed-label-text-color: #fff;\n --md-elevated-button-focus-label-text-color: #fff;\n --md-elevated-button-icon-color: #fff;\n --md-elevated-button-hover-icon-color: #fff;\n --md-elevated-button-pressed-icon-color: #fff;\n --md-elevated-button-focus-icon-color: #fff;\n }\n }\n `\n ]\n\n @property({ type: String }) buildingLevelId: string = ''\n @property({ type: String }) title: string = ''\n\n @state() item: any = { count: 0 }\n @state() noticeComments: any = []\n @state() comment: string = ''\n @state() user: User = {}\n\n @query('div[comments-container]') commentsContainer!: HTMLDivElement\n\n render() {\n return html`\n <div body>\n <h3>${this.title}</h3>\n\n <div comments-container>\n ${this.noticeComments.map(comment => {\n return html`\n <div comment-row>\n <div creator-container>\n <span creator><md-icon slot=\"icon\">account_circle</md-icon> ${comment.creator.name}</span>\n <span createdAt>\n <md-icon slot=\"icon\">schedule</md-icon> ${this._formatDate(comment.createdAt)}\n ${comment.creator.email === this.user.email\n ? html` <md-icon delete slot=\"icon\" @click=${() => this._deleteComment(comment.id)}>delete</md-icon>`\n : ''}\n </span>\n </div>\n <div comment>${comment.comment}</div>\n </div>\n `\n })}\n </div>\n\n <textarea .value=${this.comment || ''} @input=${this._onInputChange}></textarea>\n\n <div button-container>\n <md-elevated-button blue @click=${this._createComment}> <md-icon slot=\"icon\">task</md-icon>저장 </md-elevated-button>\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 this.comment = ''\n await this._loadComments()\n this._scrollBottom()\n }\n\n private async _loadComments() {\n const response = await client.query({\n query: gql`\n query NoticeComments($buildingLevelId: String!) {\n noticeComments(buildingLevelId: $buildingLevelId) {\n id\n comment\n creator {\n id\n email\n name\n }\n createdAt\n }\n }\n `,\n variables: {\n buildingLevelId: this.buildingLevelId\n }\n })\n\n if (response.errors) return\n\n const items = response.data.noticeComments\n this.noticeComments = [...items.reverse(), ...this.noticeComments]\n }\n\n private async _createComment() {\n if (!this.comment) {\n notify({ message: '코멘트를 입력해주세요.', level: 'warn' })\n return\n }\n\n const response = await client.mutate({\n mutation: gql`\n mutation CreateNoticeComment($noticeComment: NewNoticeComment!) {\n createNoticeComment(noticeComment: $noticeComment) {\n id\n comment\n creator {\n id\n email\n name\n }\n createdAt\n }\n }\n `,\n variables: {\n noticeComment: {\n comment: this.comment,\n buildingLevelId: this.buildingLevelId\n }\n }\n })\n\n if (!response.errors) {\n this.comment = ''\n this.noticeComments = [...this.noticeComments, { ...response.data.createNoticeComment }]\n this._scrollBottom()\n } else {\n notify({ message: response.errors?.[0]?.message || '코멘트 등록에 실패하였습니다.', level: 'error' })\n }\n\n this._dispatchEvent('create')\n }\n\n private async _deleteComment(commentId: string) {\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 DeleteNoticeComment($id: String!) {\n deleteNoticeComment(id: $id)\n }\n `,\n variables: {\n id: commentId\n }\n })\n\n if (!response.errors) {\n this.noticeComments = [...this.noticeComments.filter(comment => comment.id != commentId)]\n notify({ message: '코멘트를 삭제하였습니다.', level: 'info' })\n } else {\n notify({ message: response.errors?.[0]?.message || '코멘트 삭제에 실패하였습니다.', level: 'error' })\n }\n\n this._dispatchEvent('delete')\n }\n }\n\n private _close() {\n history.back()\n }\n\n // Input 요소의 값이 변경될 때 호출되는 콜백 함수\n private _onInputChange(event: InputEvent) {\n const target = event.target as HTMLInputElement\n this.comment = target.value\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 private async _scrollBottom() {\n setTimeout(() => {\n this.commentsContainer.scrollTop = this.commentsContainer.scrollHeight\n }, 100)\n }\n\n // 조치사항 변경 이벤트 디스패치\n _dispatchEvent(type: string = 'create') {\n this.dispatchEvent(new CustomEvent('change-comment', { detail: { buildingLevelId: this.buildingLevelId, type } }))\n }\n}\n"]}
@@ -1,7 +1,9 @@
1
+ import '@material/web/fab/fab.js';
1
2
  import '@material/web/icon/icon.js';
2
3
  import '@operato/input/ox-input-signature.js';
3
4
  import './comment-list-popup';
4
5
  import './attachment-list-popup';
6
+ import '../../stt/speech-to-text';
5
7
  export declare const enum ChecklistMode {
6
8
  VIEWER = "VIEWER",
7
9
  EDITOR = "EDITOR"