@dssp/supervision 0.0.8 → 0.0.10
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/client/pages/building-inspection/building-inspection-detail-checklist.ts +186 -0
- package/client/pages/building-inspection/building-inspection-detail-drawing.ts +160 -0
- package/client/pages/building-inspection/building-inspection-list.ts +430 -0
- package/client/pages/building-inspection/component/building-inspection-detail-header.ts +94 -0
- package/client/pages/building-inspection/inspection-create-popup.ts +696 -0
- package/client/pages/checklist/checklist-view.ts +443 -0
- package/client/pages/checklist-template/checklist-template-item.ts +240 -0
- package/client/pages/checklist-template/checklist-template-list.ts +271 -0
- package/client/pages/checklist-template/checklist-type-management.ts +242 -0
- package/client/route.ts +14 -18
- package/dist-client/pages/building-inspection/building-inspection-detail-checklist.d.ts +21 -0
- package/dist-client/pages/building-inspection/building-inspection-detail-checklist.js +187 -0
- package/dist-client/pages/building-inspection/building-inspection-detail-checklist.js.map +1 -0
- package/dist-client/pages/building-inspection/building-inspection-detail-drawing.d.ts +21 -0
- package/dist-client/pages/building-inspection/building-inspection-detail-drawing.js +169 -0
- package/dist-client/pages/building-inspection/building-inspection-detail-drawing.js.map +1 -0
- package/dist-client/pages/building-inspection/building-inspection-list.d.ts +67 -0
- package/dist-client/pages/building-inspection/building-inspection-list.js +434 -0
- package/dist-client/pages/building-inspection/building-inspection-list.js.map +1 -0
- package/dist-client/pages/building-inspection/component/building-inspection-detail-header.d.ts +1 -0
- package/dist-client/pages/building-inspection/component/building-inspection-detail-header.js +118 -0
- package/dist-client/pages/building-inspection/component/building-inspection-detail-header.js.map +1 -0
- package/dist-client/pages/building-inspection/inspection-create-popup.d.ts +3 -0
- package/dist-client/pages/building-inspection/inspection-create-popup.js +735 -0
- package/dist-client/pages/building-inspection/inspection-create-popup.js.map +1 -0
- package/dist-client/pages/checklist/checklist-view.d.ts +6 -0
- package/dist-client/pages/checklist/checklist-view.js +434 -0
- package/dist-client/pages/checklist/checklist-view.js.map +1 -0
- package/dist-client/pages/checklist-template/checklist-template-item.d.ts +2 -0
- package/dist-client/pages/checklist-template/checklist-template-item.js +237 -0
- package/dist-client/pages/checklist-template/checklist-template-item.js.map +1 -0
- package/dist-client/pages/{check-item/check-item-list-page.d.ts → checklist-template/checklist-template-list.d.ts} +8 -27
- package/dist-client/pages/checklist-template/checklist-template-list.js +259 -0
- package/dist-client/pages/checklist-template/checklist-template-list.js.map +1 -0
- package/dist-client/pages/checklist-template/checklist-type-management.d.ts +48 -0
- package/dist-client/pages/checklist-template/checklist-type-management.js +229 -0
- package/dist-client/pages/checklist-template/checklist-type-management.js.map +1 -0
- package/dist-client/route.d.ts +1 -1
- package/dist-client/route.js +10 -13
- package/dist-client/route.js.map +1 -1
- package/dist-client/tsconfig.tsbuildinfo +1 -1
- package/dist-server/index.d.ts +1 -1
- package/dist-server/index.js +1 -1
- package/dist-server/index.js.map +1 -1
- package/dist-server/service/building-inspection/building-inspection-history.d.ts +17 -0
- package/dist-server/service/building-inspection/building-inspection-history.js +85 -0
- package/dist-server/service/building-inspection/building-inspection-history.js.map +1 -0
- package/dist-server/service/building-inspection/building-inspection-mutation.d.ts +8 -0
- package/dist-server/service/building-inspection/building-inspection-mutation.js +148 -0
- package/dist-server/service/building-inspection/building-inspection-mutation.js.map +1 -0
- package/dist-server/service/building-inspection/building-inspection-query.d.ts +20 -0
- package/dist-server/service/building-inspection/building-inspection-query.js +235 -0
- package/dist-server/service/building-inspection/building-inspection-query.js.map +1 -0
- package/dist-server/service/building-inspection/building-inspection-type.d.ts +43 -0
- package/dist-server/service/building-inspection/building-inspection-type.js +153 -0
- package/dist-server/service/building-inspection/building-inspection-type.js.map +1 -0
- package/dist-server/service/building-inspection/building-inspection.d.ts +26 -0
- package/dist-server/service/building-inspection/building-inspection.js +113 -0
- package/dist-server/service/building-inspection/building-inspection.js.map +1 -0
- package/dist-server/service/building-inspection/event-subscriber.d.ts +7 -0
- package/dist-server/service/building-inspection/event-subscriber.js +21 -0
- package/dist-server/service/building-inspection/event-subscriber.js.map +1 -0
- package/dist-server/service/building-inspection/index.d.ts +10 -0
- package/dist-server/service/building-inspection/index.js +14 -0
- package/dist-server/service/building-inspection/index.js.map +1 -0
- package/dist-server/service/checklist/checklist-history.d.ts +24 -0
- package/dist-server/service/checklist/checklist-history.js +120 -0
- package/dist-server/service/checklist/checklist-history.js.map +1 -0
- package/dist-server/service/checklist/checklist-mutation.d.ts +8 -0
- package/dist-server/service/checklist/checklist-mutation.js +96 -0
- package/dist-server/service/checklist/checklist-mutation.js.map +1 -0
- package/dist-server/service/checklist/checklist-query.d.ts +12 -0
- package/dist-server/service/checklist/checklist-query.js +83 -0
- package/dist-server/service/checklist/checklist-query.js.map +1 -0
- package/dist-server/service/checklist/checklist-type.d.ts +18 -0
- package/dist-server/service/checklist/checklist-type.js +69 -0
- package/dist-server/service/checklist/checklist-type.js.map +1 -0
- package/dist-server/service/checklist/checklist.d.ts +31 -0
- package/dist-server/service/checklist/checklist.js +143 -0
- package/dist-server/service/checklist/checklist.js.map +1 -0
- package/dist-server/service/checklist/event-subscriber.d.ts +7 -0
- package/dist-server/service/checklist/event-subscriber.js +21 -0
- package/dist-server/service/checklist/event-subscriber.js.map +1 -0
- package/dist-server/service/checklist/index.d.ts +8 -0
- package/dist-server/service/checklist/index.js +12 -0
- package/dist-server/service/checklist/index.js.map +1 -0
- package/dist-server/service/checklist-item/checklist-item-mutation.d.ts +2 -0
- package/dist-server/service/checklist-item/checklist-item-mutation.js +13 -0
- package/dist-server/service/checklist-item/checklist-item-mutation.js.map +1 -0
- package/dist-server/service/checklist-item/checklist-item-query.d.ts +10 -0
- package/dist-server/service/checklist-item/checklist-item-query.js +68 -0
- package/dist-server/service/checklist-item/checklist-item-query.js.map +1 -0
- package/dist-server/service/checklist-item/checklist-item-type.d.ts +5 -0
- package/dist-server/service/checklist-item/checklist-item-type.js +21 -0
- package/dist-server/service/checklist-item/checklist-item-type.js.map +1 -0
- package/dist-server/service/checklist-item/checklist-item.d.ts +26 -0
- package/dist-server/service/checklist-item/checklist-item.js +113 -0
- package/dist-server/service/checklist-item/checklist-item.js.map +1 -0
- package/dist-server/service/checklist-item/index.d.ts +5 -0
- package/dist-server/service/checklist-item/index.js +10 -0
- package/dist-server/service/checklist-item/index.js.map +1 -0
- package/dist-server/service/checklist-template/checklist-template-mutation.d.ts +6 -0
- package/dist-server/service/checklist-template/checklist-template-mutation.js +64 -0
- package/dist-server/service/checklist-template/checklist-template-mutation.js.map +1 -0
- package/dist-server/service/checklist-template/checklist-template-query.d.ts +10 -0
- package/dist-server/service/checklist-template/checklist-template-query.js +65 -0
- package/dist-server/service/checklist-template/checklist-template-query.js.map +1 -0
- package/dist-server/service/checklist-template/checklist-template-type.d.ts +10 -0
- package/dist-server/service/checklist-template/checklist-template-type.js +39 -0
- package/dist-server/service/checklist-template/checklist-template-type.js.map +1 -0
- package/dist-server/service/checklist-template/checklist-template.d.ts +17 -0
- package/dist-server/service/checklist-template/checklist-template.js +78 -0
- package/dist-server/service/checklist-template/checklist-template.js.map +1 -0
- package/dist-server/service/checklist-template/index.d.ts +5 -0
- package/dist-server/service/checklist-template/index.js +9 -0
- package/dist-server/service/checklist-template/index.js.map +1 -0
- package/dist-server/service/checklist-template-item/checklist-template-item-mutation.d.ts +7 -0
- package/dist-server/service/checklist-template-item/checklist-template-item-mutation.js +68 -0
- package/dist-server/service/checklist-template-item/checklist-template-item-mutation.js.map +1 -0
- package/dist-server/service/checklist-template-item/checklist-template-item-query.d.ts +10 -0
- package/dist-server/service/checklist-template-item/checklist-template-item-query.js +66 -0
- package/dist-server/service/checklist-template-item/checklist-template-item-query.js.map +1 -0
- package/dist-server/service/checklist-template-item/checklist-template-item-type.d.ts +16 -0
- package/dist-server/service/checklist-template-item/checklist-template-item-type.js +60 -0
- package/dist-server/service/checklist-template-item/checklist-template-item-type.js.map +1 -0
- package/dist-server/service/checklist-template-item/checklist-template-item.d.ts +19 -0
- package/dist-server/service/checklist-template-item/checklist-template-item.js +87 -0
- package/dist-server/service/checklist-template-item/checklist-template-item.js.map +1 -0
- package/dist-server/service/checklist-template-item/index.d.ts +5 -0
- package/dist-server/service/checklist-template-item/index.js +9 -0
- package/dist-server/service/checklist-template-item/index.js.map +1 -0
- package/dist-server/service/checklist-type/checklist-type-mutation.d.ts +6 -0
- package/dist-server/service/checklist-type/checklist-type-mutation.js +64 -0
- package/dist-server/service/checklist-type/checklist-type-mutation.js.map +1 -0
- package/dist-server/service/checklist-type/checklist-type-query.d.ts +10 -0
- package/dist-server/service/checklist-type/checklist-type-query.js +65 -0
- package/dist-server/service/checklist-type/checklist-type-query.js.map +1 -0
- package/dist-server/service/checklist-type/checklist-type-type.d.ts +11 -0
- package/dist-server/service/checklist-type/checklist-type-type.js +43 -0
- package/dist-server/service/checklist-type/checklist-type-type.js.map +1 -0
- package/dist-server/service/checklist-type/checklist-type.d.ts +19 -0
- package/dist-server/service/checklist-type/checklist-type.js +78 -0
- package/dist-server/service/checklist-type/checklist-type.js.map +1 -0
- package/dist-server/service/checklist-type/index.d.ts +5 -0
- package/dist-server/service/checklist-type/index.js +9 -0
- package/dist-server/service/checklist-type/index.js.map +1 -0
- package/dist-server/service/index.d.ts +8 -3
- package/dist-server/service/index.js +25 -5
- package/dist-server/service/index.js.map +1 -1
- package/dist-server/service/issue/issue.d.ts +1 -3
- package/dist-server/service/issue/issue.js +1 -7
- package/dist-server/service/issue/issue.js.map +1 -1
- package/dist-server/service/supervisor/supervisor.d.ts +1 -3
- package/dist-server/service/supervisor/supervisor.js +1 -7
- package/dist-server/service/supervisor/supervisor.js.map +1 -1
- package/dist-server/tsconfig.tsbuildinfo +1 -1
- package/helps/supervision/checklist-item.md +160 -0
- package/helps/supervision/checklist.md +160 -0
- package/package.json +11 -7
- package/server/index.ts +1 -1
- package/server/service/building-inspection/building-inspection-history.ts +70 -0
- package/server/service/building-inspection/building-inspection-mutation.ts +147 -0
- package/server/service/building-inspection/building-inspection-query.ts +202 -0
- package/server/service/building-inspection/building-inspection-type.ts +101 -0
- package/server/service/building-inspection/building-inspection.ts +106 -0
- package/server/service/building-inspection/event-subscriber.ts +20 -0
- package/server/service/building-inspection/index.ts +11 -0
- package/server/service/checklist/checklist-history.ts +96 -0
- package/server/service/checklist/checklist-mutation.ts +103 -0
- package/server/service/checklist/checklist-query.ts +52 -0
- package/server/service/{check-item/check-item-type.ts → checklist/checklist-type.ts} +6 -18
- package/server/service/checklist/checklist.ts +127 -0
- package/server/service/checklist/event-subscriber.ts +17 -0
- package/server/service/checklist/index.ts +9 -0
- package/server/service/checklist-item/checklist-item-mutation.ts +5 -0
- package/server/service/checklist-item/checklist-item-query.ts +43 -0
- package/server/service/checklist-item/checklist-item-type.ts +12 -0
- package/server/service/checklist-item/checklist-item.ts +100 -0
- package/server/service/checklist-item/index.ts +7 -0
- package/server/service/checklist-template/checklist-template-mutation.ts +66 -0
- package/server/service/checklist-template/checklist-template-query.ts +39 -0
- package/server/service/checklist-template/checklist-template-type.ts +23 -0
- package/server/service/checklist-template/checklist-template.ts +71 -0
- package/server/service/checklist-template/index.ts +6 -0
- package/server/service/checklist-template-item/checklist-template-item-mutation.ts +64 -0
- package/server/service/checklist-template-item/checklist-template-item-query.ts +39 -0
- package/server/service/checklist-template-item/checklist-template-item-type.ts +39 -0
- package/server/service/checklist-template-item/checklist-template-item.ts +67 -0
- package/server/service/checklist-template-item/index.ts +6 -0
- package/server/service/checklist-type/checklist-type-mutation.ts +66 -0
- package/server/service/checklist-type/checklist-type-query.ts +39 -0
- package/server/service/checklist-type/checklist-type-type.ts +26 -0
- package/server/service/checklist-type/checklist-type.ts +64 -0
- package/server/service/checklist-type/index.ts +6 -0
- package/server/service/index.ts +59 -23
- package/server/service/issue/issue.ts +1 -6
- package/server/service/supervisor/supervisor.ts +1 -6
- package/things-factory.config.js +11 -7
- package/client/pages/check-item/check-item-importer.ts +0 -94
- package/client/pages/check-item/check-item-list-page.ts +0 -340
- package/dist-client/pages/check-item/check-item-importer.d.ts +0 -10
- package/dist-client/pages/check-item/check-item-importer.js +0 -101
- package/dist-client/pages/check-item/check-item-importer.js.map +0 -1
- package/dist-client/pages/check-item/check-item-list-page.js +0 -323
- package/dist-client/pages/check-item/check-item-list-page.js.map +0 -1
- package/dist-server/service/check-item/check-item-mutation.d.ts +0 -10
- package/dist-server/service/check-item/check-item-mutation.js +0 -168
- package/dist-server/service/check-item/check-item-mutation.js.map +0 -1
- package/dist-server/service/check-item/check-item-query.d.ts +0 -12
- package/dist-server/service/check-item/check-item-query.js +0 -97
- package/dist-server/service/check-item/check-item-query.js.map +0 -1
- package/dist-server/service/check-item/check-item-type.d.ts +0 -23
- package/dist-server/service/check-item/check-item-type.js +0 -86
- package/dist-server/service/check-item/check-item-type.js.map +0 -1
- package/dist-server/service/check-item/check-item.d.ts +0 -28
- package/dist-server/service/check-item/check-item.js +0 -117
- package/dist-server/service/check-item/check-item.js.map +0 -1
- package/dist-server/service/check-item/index.d.ts +0 -6
- package/dist-server/service/check-item/index.js +0 -10
- package/dist-server/service/check-item/index.js.map +0 -1
- package/server/service/check-item/check-item-mutation.ts +0 -198
- package/server/service/check-item/check-item-query.ts +0 -62
- package/server/service/check-item/check-item.ts +0 -111
- package/server/service/check-item/index.ts +0 -7
|
@@ -0,0 +1,271 @@
|
|
|
1
|
+
import '@material/web/icon/icon.js'
|
|
2
|
+
import '@operato/data-grist'
|
|
3
|
+
import './checklist-template-item'
|
|
4
|
+
|
|
5
|
+
import { CommonGristStyles, CommonButtonStyles, ScrollbarStyles } from '@operato/styles'
|
|
6
|
+
import { PageView } from '@operato/shell'
|
|
7
|
+
import { css, html } from 'lit'
|
|
8
|
+
import { customElement, query, state } from 'lit/decorators.js'
|
|
9
|
+
import { ScopedElementsMixin } from '@open-wc/scoped-elements'
|
|
10
|
+
import { DataGrist, FetchOption } from '@operato/data-grist'
|
|
11
|
+
import { client } from '@operato/graphql'
|
|
12
|
+
import { notify, openPopup } from '@operato/layout'
|
|
13
|
+
|
|
14
|
+
import gql from 'graphql-tag'
|
|
15
|
+
|
|
16
|
+
@customElement('checklist-template-list')
|
|
17
|
+
export class ChecklistTemplateListPage extends ScopedElementsMixin(PageView) {
|
|
18
|
+
static styles = [
|
|
19
|
+
ScrollbarStyles,
|
|
20
|
+
CommonGristStyles,
|
|
21
|
+
css`
|
|
22
|
+
:host {
|
|
23
|
+
display: flex;
|
|
24
|
+
flex-direction: column;
|
|
25
|
+
|
|
26
|
+
width: 100%;
|
|
27
|
+
|
|
28
|
+
--grid-record-emphasized-background-color: red;
|
|
29
|
+
--grid-record-emphasized-color: yellow;
|
|
30
|
+
}
|
|
31
|
+
`
|
|
32
|
+
]
|
|
33
|
+
|
|
34
|
+
@state() private gristConfig: any
|
|
35
|
+
@state() private checklistDetailTypes
|
|
36
|
+
@query('ox-grist') private grist!: DataGrist
|
|
37
|
+
|
|
38
|
+
get context() {
|
|
39
|
+
return {
|
|
40
|
+
title: '체크리스트 템플릿 리스트',
|
|
41
|
+
search: {
|
|
42
|
+
handler: (search: string) => {
|
|
43
|
+
this.grist.searchText = search
|
|
44
|
+
},
|
|
45
|
+
value: this.grist.searchText
|
|
46
|
+
},
|
|
47
|
+
filter: {
|
|
48
|
+
handler: () => {
|
|
49
|
+
this.grist.toggleHeadroom()
|
|
50
|
+
}
|
|
51
|
+
},
|
|
52
|
+
actions: [
|
|
53
|
+
{
|
|
54
|
+
title: '저장',
|
|
55
|
+
action: this._updateChecklistTemplate.bind(this),
|
|
56
|
+
...CommonButtonStyles.submit
|
|
57
|
+
},
|
|
58
|
+
{
|
|
59
|
+
title: '삭제',
|
|
60
|
+
action: this.deleteChecklistTemplate.bind(this),
|
|
61
|
+
...CommonButtonStyles.delete
|
|
62
|
+
}
|
|
63
|
+
]
|
|
64
|
+
}
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
render() {
|
|
68
|
+
return html`
|
|
69
|
+
<ox-grist .mode=${'GRID'} .config=${this.gristConfig} .fetchHandler=${this.fetchHandler.bind(this)}>
|
|
70
|
+
<div slot="headroom">
|
|
71
|
+
<div id="filters">
|
|
72
|
+
<ox-filters-form autofocus></ox-filters-form>
|
|
73
|
+
</div>
|
|
74
|
+
</div>
|
|
75
|
+
</ox-grist>
|
|
76
|
+
`
|
|
77
|
+
}
|
|
78
|
+
|
|
79
|
+
async pageUpdated(changes: any, lifecycle) {
|
|
80
|
+
if (this.active) {
|
|
81
|
+
this.getchecklistTypes()
|
|
82
|
+
}
|
|
83
|
+
}
|
|
84
|
+
|
|
85
|
+
async pageInitialized(lifecycle: any) {
|
|
86
|
+
this.gristConfig = {
|
|
87
|
+
columns: [
|
|
88
|
+
{ type: 'gutter', gutterName: 'sequence' },
|
|
89
|
+
{ type: 'gutter', gutterName: 'row-selector', multiple: true },
|
|
90
|
+
{
|
|
91
|
+
type: 'gutter',
|
|
92
|
+
gutterName: 'button',
|
|
93
|
+
fixed: true,
|
|
94
|
+
icon: 'reorder',
|
|
95
|
+
handlers: {
|
|
96
|
+
click: (columns, data, column, record, rowIndex) => {
|
|
97
|
+
if (!record.id) return
|
|
98
|
+
openPopup(
|
|
99
|
+
html`
|
|
100
|
+
<checklist-template-item
|
|
101
|
+
.checklistTemplate=${record}
|
|
102
|
+
.checklistDetailTypes=${this.checklistDetailTypes}
|
|
103
|
+
@requestRefresh="${() => this.grist.fetch()}"
|
|
104
|
+
></checklist-template-item>
|
|
105
|
+
`,
|
|
106
|
+
{
|
|
107
|
+
backdrop: true,
|
|
108
|
+
size: 'large',
|
|
109
|
+
title: '체크 리스트 아이템 템플릿'
|
|
110
|
+
}
|
|
111
|
+
)
|
|
112
|
+
}
|
|
113
|
+
}
|
|
114
|
+
},
|
|
115
|
+
{
|
|
116
|
+
type: 'string',
|
|
117
|
+
name: 'name',
|
|
118
|
+
header: '이름',
|
|
119
|
+
record: {
|
|
120
|
+
editable: true
|
|
121
|
+
},
|
|
122
|
+
filter: 'search',
|
|
123
|
+
sortable: true,
|
|
124
|
+
width: 200
|
|
125
|
+
},
|
|
126
|
+
{
|
|
127
|
+
type: 'resource-object',
|
|
128
|
+
name: 'updater',
|
|
129
|
+
header: '수정자',
|
|
130
|
+
record: {
|
|
131
|
+
editable: false
|
|
132
|
+
},
|
|
133
|
+
width: 120
|
|
134
|
+
},
|
|
135
|
+
{
|
|
136
|
+
type: 'datetime',
|
|
137
|
+
name: 'updatedAt',
|
|
138
|
+
header: '수정일시',
|
|
139
|
+
record: {
|
|
140
|
+
editable: false
|
|
141
|
+
},
|
|
142
|
+
width: 180
|
|
143
|
+
}
|
|
144
|
+
],
|
|
145
|
+
rows: {
|
|
146
|
+
selectable: {
|
|
147
|
+
multiple: true
|
|
148
|
+
}
|
|
149
|
+
},
|
|
150
|
+
sorters: [
|
|
151
|
+
{
|
|
152
|
+
name: 'name'
|
|
153
|
+
}
|
|
154
|
+
]
|
|
155
|
+
}
|
|
156
|
+
}
|
|
157
|
+
|
|
158
|
+
async getchecklistTypes() {
|
|
159
|
+
const response = await client.query({
|
|
160
|
+
query: gql`
|
|
161
|
+
query ChecklistTypes {
|
|
162
|
+
checklistTypes {
|
|
163
|
+
items {
|
|
164
|
+
id
|
|
165
|
+
mainType
|
|
166
|
+
detailType
|
|
167
|
+
}
|
|
168
|
+
}
|
|
169
|
+
}
|
|
170
|
+
`
|
|
171
|
+
})
|
|
172
|
+
|
|
173
|
+
this.checklistDetailTypes = response.data.checklistTypes?.items?.map(v => {
|
|
174
|
+
return {
|
|
175
|
+
display: v.detailType,
|
|
176
|
+
value: v.id,
|
|
177
|
+
mainType: v.mainType
|
|
178
|
+
}
|
|
179
|
+
})
|
|
180
|
+
}
|
|
181
|
+
|
|
182
|
+
async fetchHandler({ page = 1, limit = 100, sortings = [], filters = [] }: FetchOption) {
|
|
183
|
+
const response = await client.query({
|
|
184
|
+
query: gql`
|
|
185
|
+
query ($filters: [Filter!], $pagination: Pagination, $sortings: [Sorting!]) {
|
|
186
|
+
responses: checklistTemplates(filters: $filters, pagination: $pagination, sortings: $sortings) {
|
|
187
|
+
items {
|
|
188
|
+
id
|
|
189
|
+
name
|
|
190
|
+
updater {
|
|
191
|
+
id
|
|
192
|
+
name
|
|
193
|
+
}
|
|
194
|
+
updatedAt
|
|
195
|
+
}
|
|
196
|
+
total
|
|
197
|
+
}
|
|
198
|
+
}
|
|
199
|
+
`,
|
|
200
|
+
variables: {
|
|
201
|
+
filters,
|
|
202
|
+
pagination: { page, limit },
|
|
203
|
+
sortings
|
|
204
|
+
}
|
|
205
|
+
})
|
|
206
|
+
|
|
207
|
+
return {
|
|
208
|
+
total: response.data.responses.total || 0,
|
|
209
|
+
records: response.data.responses.items || []
|
|
210
|
+
}
|
|
211
|
+
}
|
|
212
|
+
|
|
213
|
+
private async deleteChecklistTemplate() {
|
|
214
|
+
if (confirm('삭제하시겠습니까?')) {
|
|
215
|
+
const ids = this.grist.selected.map(record => record.id)
|
|
216
|
+
if (ids && ids.length > 0) {
|
|
217
|
+
const response = await client.mutate({
|
|
218
|
+
mutation: gql`
|
|
219
|
+
mutation ($ids: [String!]!) {
|
|
220
|
+
deleteChecklistTemplates(ids: $ids)
|
|
221
|
+
}
|
|
222
|
+
`,
|
|
223
|
+
variables: {
|
|
224
|
+
ids
|
|
225
|
+
}
|
|
226
|
+
})
|
|
227
|
+
|
|
228
|
+
if (!response.errors) {
|
|
229
|
+
this.grist.fetch()
|
|
230
|
+
notify({ message: '삭제되었습니다.' })
|
|
231
|
+
}
|
|
232
|
+
}
|
|
233
|
+
}
|
|
234
|
+
}
|
|
235
|
+
|
|
236
|
+
private async _updateChecklistTemplate() {
|
|
237
|
+
let patches = this.grist.dirtyRecords
|
|
238
|
+
if (patches && patches.length) {
|
|
239
|
+
patches = patches.map(patch => {
|
|
240
|
+
let patchField: any = patch.id ? { id: patch.id } : {}
|
|
241
|
+
const dirtyFields = patch.__dirtyfields__
|
|
242
|
+
for (let key in dirtyFields) {
|
|
243
|
+
patchField[key] = dirtyFields[key].after
|
|
244
|
+
}
|
|
245
|
+
patchField.cuFlag = patch.__dirty__
|
|
246
|
+
|
|
247
|
+
return patchField
|
|
248
|
+
})
|
|
249
|
+
|
|
250
|
+
const response = await client.mutate({
|
|
251
|
+
mutation: gql`
|
|
252
|
+
mutation ($patches: [ChecklistTemplatePatch!]!) {
|
|
253
|
+
updateMultipleChecklistTemplate(patches: $patches) {
|
|
254
|
+
name
|
|
255
|
+
}
|
|
256
|
+
}
|
|
257
|
+
`,
|
|
258
|
+
variables: {
|
|
259
|
+
patches
|
|
260
|
+
}
|
|
261
|
+
})
|
|
262
|
+
|
|
263
|
+
if (!response.errors) {
|
|
264
|
+
this.grist.fetch()
|
|
265
|
+
notify({ message: '저장되었습니다.' })
|
|
266
|
+
} else {
|
|
267
|
+
notify({ message: '저장에 실패하였습니다.', level: 'error' })
|
|
268
|
+
}
|
|
269
|
+
}
|
|
270
|
+
}
|
|
271
|
+
}
|
|
@@ -0,0 +1,242 @@
|
|
|
1
|
+
import '@material/web/icon/icon.js'
|
|
2
|
+
import '@operato/data-grist'
|
|
3
|
+
|
|
4
|
+
import { CommonGristStyles, CommonButtonStyles, ScrollbarStyles } from '@operato/styles'
|
|
5
|
+
import { PageView } from '@operato/shell'
|
|
6
|
+
import { css, html } from 'lit'
|
|
7
|
+
import { customElement, query, state } from 'lit/decorators.js'
|
|
8
|
+
import { ScopedElementsMixin } from '@open-wc/scoped-elements'
|
|
9
|
+
import { DataGrist, FetchOption } from '@operato/data-grist'
|
|
10
|
+
import { client } from '@operato/graphql'
|
|
11
|
+
import { notify } from '@operato/layout'
|
|
12
|
+
import gql from 'graphql-tag'
|
|
13
|
+
|
|
14
|
+
export enum ChecklistTypeMainType {
|
|
15
|
+
BASIC = '10',
|
|
16
|
+
NON_BASIC = '20'
|
|
17
|
+
}
|
|
18
|
+
export const CHECKLIST_MAIN_TYPE_LIST = {
|
|
19
|
+
[ChecklistTypeMainType.BASIC]: '기본 업무',
|
|
20
|
+
[ChecklistTypeMainType.NON_BASIC]: '기본 외 업무'
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
@customElement('checklist-type-management')
|
|
24
|
+
export class ChecklistTypeManagement extends ScopedElementsMixin(PageView) {
|
|
25
|
+
static styles = [
|
|
26
|
+
ScrollbarStyles,
|
|
27
|
+
CommonGristStyles,
|
|
28
|
+
css`
|
|
29
|
+
:host {
|
|
30
|
+
display: flex;
|
|
31
|
+
flex-direction: column;
|
|
32
|
+
|
|
33
|
+
width: 100%;
|
|
34
|
+
|
|
35
|
+
--grid-record-emphasized-background-color: red;
|
|
36
|
+
--grid-record-emphasized-color: yellow;
|
|
37
|
+
}
|
|
38
|
+
`
|
|
39
|
+
]
|
|
40
|
+
|
|
41
|
+
@state() private gristConfig: any
|
|
42
|
+
@query('ox-grist') private grist!: DataGrist
|
|
43
|
+
|
|
44
|
+
get context() {
|
|
45
|
+
return {
|
|
46
|
+
title: '체크리스트 구분 관리',
|
|
47
|
+
search: {
|
|
48
|
+
handler: (search: string) => {
|
|
49
|
+
this.grist.searchText = search
|
|
50
|
+
},
|
|
51
|
+
value: this.grist.searchText
|
|
52
|
+
},
|
|
53
|
+
filter: {
|
|
54
|
+
handler: () => {
|
|
55
|
+
this.grist.toggleHeadroom()
|
|
56
|
+
}
|
|
57
|
+
},
|
|
58
|
+
actions: [
|
|
59
|
+
{
|
|
60
|
+
title: '저장',
|
|
61
|
+
action: this._updateChecklistType.bind(this),
|
|
62
|
+
...CommonButtonStyles.submit
|
|
63
|
+
},
|
|
64
|
+
{
|
|
65
|
+
title: '삭제',
|
|
66
|
+
action: this._deleteChecklistType.bind(this),
|
|
67
|
+
...CommonButtonStyles.delete
|
|
68
|
+
}
|
|
69
|
+
]
|
|
70
|
+
}
|
|
71
|
+
}
|
|
72
|
+
|
|
73
|
+
render() {
|
|
74
|
+
return html`
|
|
75
|
+
<ox-grist .mode=${'GRID'} .config=${this.gristConfig} .fetchHandler=${this.fetchHandler.bind(this)}>
|
|
76
|
+
<div slot="headroom">
|
|
77
|
+
<div id="filters">
|
|
78
|
+
<ox-filters-form autofocus></ox-filters-form>
|
|
79
|
+
</div>
|
|
80
|
+
</div>
|
|
81
|
+
</ox-grist>
|
|
82
|
+
`
|
|
83
|
+
}
|
|
84
|
+
|
|
85
|
+
async pageInitialized(lifecycle: any) {
|
|
86
|
+
this.gristConfig = {
|
|
87
|
+
columns: [
|
|
88
|
+
{ type: 'gutter', gutterName: 'sequence' },
|
|
89
|
+
{ type: 'gutter', gutterName: 'row-selector', multiple: true },
|
|
90
|
+
{
|
|
91
|
+
type: 'select',
|
|
92
|
+
name: 'mainType',
|
|
93
|
+
header: '메인 구분',
|
|
94
|
+
record: {
|
|
95
|
+
editable: true,
|
|
96
|
+
options: [{ display: '', value: '' }].concat(
|
|
97
|
+
Object.keys(CHECKLIST_MAIN_TYPE_LIST).map(key => ({ display: CHECKLIST_MAIN_TYPE_LIST[key], value: key }))
|
|
98
|
+
)
|
|
99
|
+
},
|
|
100
|
+
filter: 'search',
|
|
101
|
+
sortable: true,
|
|
102
|
+
width: 150
|
|
103
|
+
},
|
|
104
|
+
{
|
|
105
|
+
type: 'string',
|
|
106
|
+
name: 'detailType',
|
|
107
|
+
header: '상세 구분',
|
|
108
|
+
record: {
|
|
109
|
+
editable: true
|
|
110
|
+
},
|
|
111
|
+
filter: 'search',
|
|
112
|
+
sortable: true,
|
|
113
|
+
width: 250
|
|
114
|
+
},
|
|
115
|
+
{
|
|
116
|
+
type: 'resource-object',
|
|
117
|
+
name: 'updater',
|
|
118
|
+
header: '수정자',
|
|
119
|
+
record: {
|
|
120
|
+
editable: false
|
|
121
|
+
},
|
|
122
|
+
width: 120
|
|
123
|
+
},
|
|
124
|
+
{
|
|
125
|
+
type: 'datetime',
|
|
126
|
+
name: 'updatedAt',
|
|
127
|
+
header: '수정일시',
|
|
128
|
+
record: {
|
|
129
|
+
editable: false
|
|
130
|
+
},
|
|
131
|
+
sortable: true,
|
|
132
|
+
width: 180
|
|
133
|
+
}
|
|
134
|
+
],
|
|
135
|
+
rows: {
|
|
136
|
+
selectable: {
|
|
137
|
+
multiple: true
|
|
138
|
+
},
|
|
139
|
+
classifier: (record, rowIndex) => {
|
|
140
|
+
return {
|
|
141
|
+
emphasized:
|
|
142
|
+
record.mainType == ChecklistTypeMainType.BASIC
|
|
143
|
+
? ['var(--grid-record-odd-background-color)', 'var(--grid-record-color)']
|
|
144
|
+
: ['var(--grid-record-background-color)', 'var(--grid-record-color)']
|
|
145
|
+
}
|
|
146
|
+
}
|
|
147
|
+
},
|
|
148
|
+
sorters: [{ name: 'mainType' }, { name: 'updatedAt', desc: true }, { name: 'detailType' }]
|
|
149
|
+
}
|
|
150
|
+
}
|
|
151
|
+
|
|
152
|
+
async fetchHandler({ page = 1, limit = 100, sortings = [], filters = [] }: FetchOption) {
|
|
153
|
+
const response = await client.query({
|
|
154
|
+
query: gql`
|
|
155
|
+
query ($filters: [Filter!], $pagination: Pagination, $sortings: [Sorting!]) {
|
|
156
|
+
responses: checklistTypes(filters: $filters, pagination: $pagination, sortings: $sortings) {
|
|
157
|
+
items {
|
|
158
|
+
id
|
|
159
|
+
mainType
|
|
160
|
+
detailType
|
|
161
|
+
updater {
|
|
162
|
+
id
|
|
163
|
+
name
|
|
164
|
+
}
|
|
165
|
+
updatedAt
|
|
166
|
+
}
|
|
167
|
+
total
|
|
168
|
+
}
|
|
169
|
+
}
|
|
170
|
+
`,
|
|
171
|
+
variables: {
|
|
172
|
+
filters,
|
|
173
|
+
pagination: { page, limit },
|
|
174
|
+
sortings
|
|
175
|
+
}
|
|
176
|
+
})
|
|
177
|
+
|
|
178
|
+
return {
|
|
179
|
+
total: response.data.responses.total || 0,
|
|
180
|
+
records: response.data.responses.items || []
|
|
181
|
+
}
|
|
182
|
+
}
|
|
183
|
+
|
|
184
|
+
private async _deleteChecklistType() {
|
|
185
|
+
if (confirm('삭제하시겠습니까?')) {
|
|
186
|
+
const ids = this.grist.selected.map(record => record.id)
|
|
187
|
+
if (ids && ids.length > 0) {
|
|
188
|
+
const response = await client.mutate({
|
|
189
|
+
mutation: gql`
|
|
190
|
+
mutation ($ids: [String!]!) {
|
|
191
|
+
deleteChecklistTypes(ids: $ids)
|
|
192
|
+
}
|
|
193
|
+
`,
|
|
194
|
+
variables: {
|
|
195
|
+
ids
|
|
196
|
+
}
|
|
197
|
+
})
|
|
198
|
+
|
|
199
|
+
if (!response.errors) {
|
|
200
|
+
this.grist.fetch()
|
|
201
|
+
notify({ message: '삭제되었습니다.' })
|
|
202
|
+
}
|
|
203
|
+
}
|
|
204
|
+
}
|
|
205
|
+
}
|
|
206
|
+
|
|
207
|
+
private async _updateChecklistType() {
|
|
208
|
+
let patches = this.grist.dirtyRecords
|
|
209
|
+
if (patches && patches.length) {
|
|
210
|
+
patches = patches.map(patch => {
|
|
211
|
+
let patchField: any = patch.id ? { id: patch.id } : {}
|
|
212
|
+
const dirtyFields = patch.__dirtyfields__
|
|
213
|
+
for (let key in dirtyFields) {
|
|
214
|
+
patchField[key] = dirtyFields[key].after
|
|
215
|
+
}
|
|
216
|
+
patchField.cuFlag = patch.__dirty__
|
|
217
|
+
|
|
218
|
+
return patchField
|
|
219
|
+
})
|
|
220
|
+
|
|
221
|
+
const response = await client.mutate({
|
|
222
|
+
mutation: gql`
|
|
223
|
+
mutation ($patches: [ChecklistTypePatch!]!) {
|
|
224
|
+
updateMultipleChecklistType(patches: $patches) {
|
|
225
|
+
id
|
|
226
|
+
}
|
|
227
|
+
}
|
|
228
|
+
`,
|
|
229
|
+
variables: {
|
|
230
|
+
patches
|
|
231
|
+
}
|
|
232
|
+
})
|
|
233
|
+
|
|
234
|
+
if (!response.errors) {
|
|
235
|
+
this.grist.fetch()
|
|
236
|
+
notify({ message: '저장되었습니다.' })
|
|
237
|
+
} else {
|
|
238
|
+
notify({ message: '저장에 실패하였습니다.', level: 'error' })
|
|
239
|
+
}
|
|
240
|
+
}
|
|
241
|
+
}
|
|
242
|
+
}
|
package/client/route.ts
CHANGED
|
@@ -1,27 +1,23 @@
|
|
|
1
1
|
export default function route(page: string) {
|
|
2
2
|
switch (page) {
|
|
3
|
-
case '
|
|
4
|
-
import('./pages/
|
|
3
|
+
case 'checklist-template-list':
|
|
4
|
+
import('./pages/checklist-template/checklist-template-list')
|
|
5
5
|
return page
|
|
6
|
-
|
|
7
|
-
case '
|
|
8
|
-
import('./pages/
|
|
6
|
+
|
|
7
|
+
case 'checklist-type-management':
|
|
8
|
+
import('./pages/checklist-template/checklist-type-management')
|
|
9
9
|
return page
|
|
10
|
-
|
|
11
|
-
case '
|
|
12
|
-
import('./pages/
|
|
10
|
+
|
|
11
|
+
case 'building-inspection-list':
|
|
12
|
+
import('./pages/building-inspection/building-inspection-list')
|
|
13
13
|
return page
|
|
14
|
-
|
|
15
|
-
case '
|
|
16
|
-
import('./pages/
|
|
14
|
+
|
|
15
|
+
case 'building-inspection-detail-drawing':
|
|
16
|
+
import('./pages/building-inspection/building-inspection-detail-drawing')
|
|
17
17
|
return page
|
|
18
|
-
|
|
19
|
-
case '
|
|
20
|
-
import('./pages/
|
|
21
|
-
return page
|
|
22
|
-
|
|
23
|
-
case 'action-plan-list':
|
|
24
|
-
import('./pages/action-plan/action-plan-list-page')
|
|
18
|
+
|
|
19
|
+
case 'building-inspection-detail-checklist':
|
|
20
|
+
import('./pages/building-inspection/building-inspection-detail-checklist')
|
|
25
21
|
return page
|
|
26
22
|
}
|
|
27
23
|
}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import '@material/web/icon/icon.js';
|
|
2
|
+
import '@operato/data-grist';
|
|
3
|
+
import { PageView } from '@operato/shell';
|
|
4
|
+
import { PageLifecycle } from '@operato/shell/dist/src/app/pages/page-view';
|
|
5
|
+
import './component/building-inspection-detail-header';
|
|
6
|
+
import '../checklist/checklist-view';
|
|
7
|
+
declare const BuildingInspectionDetailChecklist_base: typeof PageView & import("@open-wc/dedupe-mixin").Constructor<import("@open-wc/scoped-elements/types/src/types").ScopedElementsHost>;
|
|
8
|
+
export declare class BuildingInspectionDetailChecklist extends BuildingInspectionDetailChecklist_base {
|
|
9
|
+
static styles: import("lit").CSSResult[];
|
|
10
|
+
project: any;
|
|
11
|
+
buildingInspection: any;
|
|
12
|
+
get context(): {
|
|
13
|
+
title: string;
|
|
14
|
+
};
|
|
15
|
+
render(): import("lit-html").TemplateResult<1>;
|
|
16
|
+
pageUpdated(changes: any, lifecycle: PageLifecycle): Promise<void>;
|
|
17
|
+
initBuildingInspection(buildingInspectionId?: string): Promise<void>;
|
|
18
|
+
private _getProjectByBuildingComplexId;
|
|
19
|
+
private _onClickModifyChecklist;
|
|
20
|
+
}
|
|
21
|
+
export {};
|