@things-factory/organization 8.0.0 → 9.0.0-beta.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist-client/bootstrap.js +8 -1
- package/dist-client/bootstrap.js.map +1 -1
- package/dist-client/filters-form/filter-department-object.d.ts +3 -0
- package/dist-client/filters-form/filter-department-object.js +8 -0
- package/dist-client/filters-form/filter-department-object.js.map +1 -0
- package/dist-client/filters-form/ox-filter-department-object.d.ts +15 -0
- package/dist-client/filters-form/ox-filter-department-object.js +130 -0
- package/dist-client/filters-form/ox-filter-department-object.js.map +1 -0
- package/dist-client/pages/employee/employee-list-page.js +3 -3
- package/dist-client/pages/employee/employee-list-page.js.map +1 -1
- package/dist-client/pages/employee/employees-by-department.js +2 -2
- package/dist-client/pages/employee/employees-by-department.js.map +1 -1
- package/dist-client/tsconfig.tsbuildinfo +1 -1
- package/dist-server/service/employee/employee-history.d.ts +6 -2
- package/dist-server/service/employee/employee-history.js +23 -3
- package/dist-server/service/employee/employee-history.js.map +1 -1
- package/dist-server/service/employee/employee-query.js +1 -1
- package/dist-server/service/employee/employee-query.js.map +1 -1
- package/dist-server/service/employee/employee-type.d.ts +13 -5
- package/dist-server/service/employee/employee-type.js +39 -7
- package/dist-server/service/employee/employee-type.js.map +1 -1
- package/dist-server/service/employee/employee.d.ts +6 -2
- package/dist-server/service/employee/employee.js +23 -3
- package/dist-server/service/employee/employee.js.map +1 -1
- package/dist-server/tsconfig.tsbuildinfo +1 -1
- package/package.json +12 -12
- package/client/bootstrap.ts +0 -23
- package/client/component/approval-line-brief.ts +0 -119
- package/client/component/approval-line-items-editor-popup.ts +0 -91
- package/client/component/approval-line-items-editor.ts +0 -325
- package/client/component/approval-line-selector.ts +0 -235
- package/client/component/approval-line-templates-manager.ts +0 -229
- package/client/component/approval-line-view.ts +0 -122
- package/client/component/assignees-editor-popup.ts +0 -79
- package/client/component/assignees-editor.ts +0 -217
- package/client/component/assignees-view.ts +0 -55
- package/client/component/department-selector.ts +0 -151
- package/client/component/department-view.ts +0 -107
- package/client/component/index.ts +0 -16
- package/client/component/recipients-editor-popup.ts +0 -79
- package/client/component/recipients-editor.ts +0 -212
- package/client/component/recipients-view.ts +0 -55
- package/client/grist-editor/grist-editor-approval-line.ts +0 -70
- package/client/grist-editor/grist-editor-assignees.ts +0 -69
- package/client/grist-editor/grist-editor-department-object.ts +0 -78
- package/client/grist-editor/grist-editor-recipients.ts +0 -69
- package/client/grist-editor/grist-renderer-approval-line.ts +0 -13
- package/client/grist-editor/grist-renderer-assignees.ts +0 -13
- package/client/grist-editor/grist-renderer-department-object.ts +0 -13
- package/client/grist-editor/grist-renderer-recipients.ts +0 -13
- package/client/index.ts +0 -2
- package/client/pages/approval-line/common-approval-line-templates-page.ts +0 -382
- package/client/pages/approval-line/my-approval-line-templates-page.ts +0 -385
- package/client/pages/department/department-importer.ts +0 -87
- package/client/pages/department/department-list-page.ts +0 -450
- package/client/pages/department/department-tree-page.ts +0 -379
- package/client/pages/employee/employee-importer.ts +0 -87
- package/client/pages/employee/employee-list-page.ts +0 -772
- package/client/pages/employee/employees-by-department.ts +0 -519
- package/client/route.ts +0 -27
- package/client/tsconfig.json +0 -13
- package/client/types/approval-line.ts +0 -52
- package/client/types/contact.ts +0 -51
- package/client/types/department.ts +0 -29
- package/client/types/employee.ts +0 -50
- package/client/types/index.ts +0 -5
- package/client/types/org-member.ts +0 -27
- package/server/controllers/register-employee-as-system-user.ts +0 -136
- package/server/index.ts +0 -3
- package/server/migrations/1723861013111-seed-organization-codes.ts +0 -127
- package/server/migrations/index.ts +0 -9
- package/server/routes.ts +0 -26
- package/server/service/approval-line/approval-line-item.ts +0 -42
- package/server/service/approval-line/approval-line-mutation.ts +0 -394
- package/server/service/approval-line/approval-line-query.ts +0 -208
- package/server/service/approval-line/approval-line-type.ts +0 -63
- package/server/service/approval-line/approval-line.ts +0 -123
- package/server/service/approval-line/index.ts +0 -7
- package/server/service/department/department-history.ts +0 -141
- package/server/service/department/department-mutation.ts +0 -231
- package/server/service/department/department-query.ts +0 -131
- package/server/service/department/department-type.ts +0 -74
- package/server/service/department/department.ts +0 -116
- package/server/service/department/event-subscriber.ts +0 -17
- package/server/service/department/index.ts +0 -9
- package/server/service/employee/employee-history.ts +0 -173
- package/server/service/employee/employee-mutation.ts +0 -386
- package/server/service/employee/employee-query.ts +0 -172
- package/server/service/employee/employee-type.ts +0 -176
- package/server/service/employee/employee.ts +0 -177
- package/server/service/employee/event-subscriber.ts +0 -17
- package/server/service/employee/index.ts +0 -9
- package/server/service/index.ts +0 -39
- package/server/tsconfig.json +0 -10
|
@@ -1,217 +0,0 @@
|
|
|
1
|
-
import '@material/web/icon/icon.js'
|
|
2
|
-
import './assignees-view'
|
|
3
|
-
|
|
4
|
-
import { css, html, LitElement } from 'lit'
|
|
5
|
-
import { customElement, property, query, state } from 'lit/decorators.js'
|
|
6
|
-
|
|
7
|
-
import { i18next, localize } from '@operato/i18n'
|
|
8
|
-
import { DataGrist, FetchOption, getEditor, getRenderer } from '@operato/data-grist'
|
|
9
|
-
import { isMobileDevice } from '@operato/utils'
|
|
10
|
-
import { ButtonContainerStyles } from '@operato/styles'
|
|
11
|
-
|
|
12
|
-
import { AssigneeItem } from '../types/org-member'
|
|
13
|
-
|
|
14
|
-
/**
|
|
15
|
-
* Assignee 리스트를 편집한다.
|
|
16
|
-
*/
|
|
17
|
-
@customElement('assignees-editor')
|
|
18
|
-
export class AssigneesEditor extends localize(i18next)(LitElement) {
|
|
19
|
-
static styles = [
|
|
20
|
-
ButtonContainerStyles,
|
|
21
|
-
css`
|
|
22
|
-
:host {
|
|
23
|
-
display: flex;
|
|
24
|
-
flex-direction: column;
|
|
25
|
-
|
|
26
|
-
background-color: var(--md-sys-color-surface);
|
|
27
|
-
}
|
|
28
|
-
|
|
29
|
-
assignees-view {
|
|
30
|
-
min-height: 100px;
|
|
31
|
-
}
|
|
32
|
-
|
|
33
|
-
ox-grist {
|
|
34
|
-
flex: 1;
|
|
35
|
-
}
|
|
36
|
-
|
|
37
|
-
#select {
|
|
38
|
-
display: flex;
|
|
39
|
-
justify-content: end;
|
|
40
|
-
padding: 10px;
|
|
41
|
-
}
|
|
42
|
-
`
|
|
43
|
-
]
|
|
44
|
-
|
|
45
|
-
@property({ type: Array }) value?: AssigneeItem[]
|
|
46
|
-
|
|
47
|
-
@state() gristConfig?: any
|
|
48
|
-
|
|
49
|
-
@query('ox-grist') grist?: DataGrist
|
|
50
|
-
|
|
51
|
-
render() {
|
|
52
|
-
return html`
|
|
53
|
-
<assignees-view .value=${this.value}></assignees-view>
|
|
54
|
-
|
|
55
|
-
<ox-grist
|
|
56
|
-
.mode=${isMobileDevice() ? 'CARD' : 'GRID'}
|
|
57
|
-
.config=${this.gristConfig}
|
|
58
|
-
.fetchHandler=${this.fetchHandler.bind(this)}
|
|
59
|
-
@record-change=${e => {
|
|
60
|
-
this.value = ((this.grist as any)?._data.records || [])
|
|
61
|
-
.map(v => {
|
|
62
|
-
return { type: v.type, assignee: v.assignee }
|
|
63
|
-
})
|
|
64
|
-
.filter(v => v.type)
|
|
65
|
-
|
|
66
|
-
this.dispatchEvent(
|
|
67
|
-
new CustomEvent('change', {
|
|
68
|
-
bubbles: true,
|
|
69
|
-
composed: true,
|
|
70
|
-
detail: this.value
|
|
71
|
-
})
|
|
72
|
-
)
|
|
73
|
-
}}
|
|
74
|
-
>
|
|
75
|
-
<div slot="headroom">
|
|
76
|
-
<div id="select">
|
|
77
|
-
<button danger @click=${() => this.deleteDataItems()}>
|
|
78
|
-
<md-icon>delete</md-icon>${i18next.t('button.delete')}
|
|
79
|
-
</button>
|
|
80
|
-
</div>
|
|
81
|
-
</div>
|
|
82
|
-
</ox-grist>
|
|
83
|
-
`
|
|
84
|
-
}
|
|
85
|
-
|
|
86
|
-
async firstUpdated() {
|
|
87
|
-
this.gristConfig = {
|
|
88
|
-
list: {
|
|
89
|
-
fields: ['type', 'assignee']
|
|
90
|
-
},
|
|
91
|
-
columns: [
|
|
92
|
-
{ type: 'gutter', gutterName: 'row-selector', multiple: true },
|
|
93
|
-
{ type: 'gutter', gutterName: 'sequence' },
|
|
94
|
-
{
|
|
95
|
-
type: 'gutter',
|
|
96
|
-
gutterName: 'button',
|
|
97
|
-
icon: 'arrow_upward',
|
|
98
|
-
handlers: {
|
|
99
|
-
click: 'move-up'
|
|
100
|
-
}
|
|
101
|
-
},
|
|
102
|
-
{
|
|
103
|
-
type: 'gutter',
|
|
104
|
-
gutterName: 'button',
|
|
105
|
-
icon: 'arrow_downward',
|
|
106
|
-
handlers: {
|
|
107
|
-
click: 'move-down'
|
|
108
|
-
}
|
|
109
|
-
},
|
|
110
|
-
{
|
|
111
|
-
type: 'select',
|
|
112
|
-
name: 'type',
|
|
113
|
-
header: i18next.t('field.type'),
|
|
114
|
-
record: {
|
|
115
|
-
editable: true,
|
|
116
|
-
options: ['', 'Employee', 'Department', 'Role', 'MyDepartment', 'MySupervisor', 'Myself']
|
|
117
|
-
},
|
|
118
|
-
width: 140
|
|
119
|
-
},
|
|
120
|
-
{
|
|
121
|
-
type: 'resource-object',
|
|
122
|
-
name: 'assignee',
|
|
123
|
-
header: i18next.t('field.assignee'),
|
|
124
|
-
record: {
|
|
125
|
-
editable: true,
|
|
126
|
-
editor: function (value, column, record, rowIndex, field) {
|
|
127
|
-
var options = {}
|
|
128
|
-
switch (record.type) {
|
|
129
|
-
case 'Employee':
|
|
130
|
-
options = {
|
|
131
|
-
title: i18next.t('title.employee list'),
|
|
132
|
-
queryName: 'employees',
|
|
133
|
-
columns: [
|
|
134
|
-
{ name: 'id', hidden: true },
|
|
135
|
-
{
|
|
136
|
-
name: 'controlNo',
|
|
137
|
-
header: { renderer: () => i18next.t('field.control-no') },
|
|
138
|
-
filter: 'search'
|
|
139
|
-
},
|
|
140
|
-
{ name: 'name', header: { renderer: () => i18next.t('field.name') }, filter: 'search' }
|
|
141
|
-
],
|
|
142
|
-
list: { fields: ['name', 'control-no'] },
|
|
143
|
-
valueField: 'id',
|
|
144
|
-
nameField: 'name',
|
|
145
|
-
descriptionField: 'controlNo'
|
|
146
|
-
}
|
|
147
|
-
break
|
|
148
|
-
case 'Department':
|
|
149
|
-
options = {
|
|
150
|
-
title: i18next.t('title.department list'),
|
|
151
|
-
queryName: 'departments'
|
|
152
|
-
}
|
|
153
|
-
break
|
|
154
|
-
case 'Role':
|
|
155
|
-
options = {
|
|
156
|
-
title: i18next.t('title.lookup role'),
|
|
157
|
-
queryName: 'roles'
|
|
158
|
-
}
|
|
159
|
-
break
|
|
160
|
-
default:
|
|
161
|
-
options = {}
|
|
162
|
-
}
|
|
163
|
-
|
|
164
|
-
var dynamicRecord = { ...column.record, options }
|
|
165
|
-
|
|
166
|
-
return getEditor(column.type)(value, { ...column, record: dynamicRecord }, record, rowIndex, field)
|
|
167
|
-
},
|
|
168
|
-
renderer: function (value, column, record, rowIndex, field) {
|
|
169
|
-
var options = {}
|
|
170
|
-
switch (record.type) {
|
|
171
|
-
case 'Employee':
|
|
172
|
-
options = {
|
|
173
|
-
valueField: 'id',
|
|
174
|
-
nameField: 'name',
|
|
175
|
-
descriptionField: 'controlNo'
|
|
176
|
-
}
|
|
177
|
-
break
|
|
178
|
-
case 'Department':
|
|
179
|
-
case 'Role':
|
|
180
|
-
default:
|
|
181
|
-
break
|
|
182
|
-
}
|
|
183
|
-
|
|
184
|
-
var dynamicRecord = { ...column.record, options }
|
|
185
|
-
|
|
186
|
-
return getRenderer(column.type)(value, { ...column, record: dynamicRecord }, record, rowIndex, field)
|
|
187
|
-
}
|
|
188
|
-
},
|
|
189
|
-
width: 180
|
|
190
|
-
}
|
|
191
|
-
],
|
|
192
|
-
rows: {
|
|
193
|
-
selectable: {
|
|
194
|
-
multiple: true
|
|
195
|
-
}
|
|
196
|
-
},
|
|
197
|
-
pagination: {
|
|
198
|
-
infinite: true
|
|
199
|
-
},
|
|
200
|
-
sorters: []
|
|
201
|
-
}
|
|
202
|
-
}
|
|
203
|
-
|
|
204
|
-
async fetchHandler({ filters, page, limit, sortings = [] }: FetchOption) {
|
|
205
|
-
const value = [...(this.value || [])]
|
|
206
|
-
this.value = value
|
|
207
|
-
|
|
208
|
-
return {
|
|
209
|
-
total: value.length,
|
|
210
|
-
records: value
|
|
211
|
-
}
|
|
212
|
-
}
|
|
213
|
-
|
|
214
|
-
async deleteDataItems() {
|
|
215
|
-
this.grist?.deleteSelectedRecords(false)
|
|
216
|
-
}
|
|
217
|
-
}
|
|
@@ -1,55 +0,0 @@
|
|
|
1
|
-
import { css, html, LitElement, TemplateResult } from 'lit'
|
|
2
|
-
import { customElement, property, query } from 'lit/decorators.js'
|
|
3
|
-
|
|
4
|
-
import { i18next, localize } from '@operato/i18n'
|
|
5
|
-
import { AssigneeItem } from '../types/org-member'
|
|
6
|
-
|
|
7
|
-
@customElement('assignees-view')
|
|
8
|
-
export class AssigneesView extends localize(i18next)(LitElement) {
|
|
9
|
-
static styles = [
|
|
10
|
-
css`
|
|
11
|
-
:host {
|
|
12
|
-
display: flex;
|
|
13
|
-
flex-direction: row;
|
|
14
|
-
flex-wrap: wrap;
|
|
15
|
-
|
|
16
|
-
gap: 10px;
|
|
17
|
-
padding: 10px;
|
|
18
|
-
|
|
19
|
-
align-items: center;
|
|
20
|
-
|
|
21
|
-
background-color: var(--md-sys-color-surface);
|
|
22
|
-
|
|
23
|
-
--md-icon-size: 3em;
|
|
24
|
-
color: var(--secondary-color, black);
|
|
25
|
-
}
|
|
26
|
-
|
|
27
|
-
div[assignee] {
|
|
28
|
-
padding: 5px;
|
|
29
|
-
border-radius: 5px;
|
|
30
|
-
border: 2px solid var(--primary-color, black);
|
|
31
|
-
}
|
|
32
|
-
`
|
|
33
|
-
]
|
|
34
|
-
|
|
35
|
-
@property({ type: Object }) value?: AssigneeItem[]
|
|
36
|
-
|
|
37
|
-
render() {
|
|
38
|
-
const items = this.value || []
|
|
39
|
-
|
|
40
|
-
return html` ${items.map((item, order) => this.renderItem(item, order + 1))} `
|
|
41
|
-
}
|
|
42
|
-
|
|
43
|
-
renderItem(item: AssigneeItem, order: number): TemplateResult {
|
|
44
|
-
const { type, assignee } = item
|
|
45
|
-
const { name, description, controlNo } = assignee || {}
|
|
46
|
-
const subname = (description || controlNo) && `(${description || controlNo})`
|
|
47
|
-
|
|
48
|
-
return html`
|
|
49
|
-
<div assignee>
|
|
50
|
-
<div>${type}</div>
|
|
51
|
-
<div><span name>${name}</span>${subname}</div>
|
|
52
|
-
</div>
|
|
53
|
-
`
|
|
54
|
-
}
|
|
55
|
-
}
|
|
@@ -1,151 +0,0 @@
|
|
|
1
|
-
import '@material/web/icon/icon.js'
|
|
2
|
-
import '@operato/data-tree'
|
|
3
|
-
|
|
4
|
-
import gql from 'graphql-tag'
|
|
5
|
-
import { css, html, LitElement } from 'lit'
|
|
6
|
-
import { customElement, property, query, state } from 'lit/decorators.js'
|
|
7
|
-
|
|
8
|
-
import { client } from '@operato/graphql'
|
|
9
|
-
import { i18next } from '@operato/i18n'
|
|
10
|
-
import { closePopup } from '@operato/popup'
|
|
11
|
-
import { CommonHeaderStyles } from '@operato/styles'
|
|
12
|
-
|
|
13
|
-
import { Department } from '../types/department'
|
|
14
|
-
|
|
15
|
-
const departmentFragment = gql`
|
|
16
|
-
fragment SubDepartment on Department {
|
|
17
|
-
id
|
|
18
|
-
controlNo
|
|
19
|
-
name
|
|
20
|
-
description
|
|
21
|
-
|
|
22
|
-
manager {
|
|
23
|
-
id
|
|
24
|
-
name
|
|
25
|
-
controlNo
|
|
26
|
-
photo
|
|
27
|
-
email
|
|
28
|
-
}
|
|
29
|
-
active
|
|
30
|
-
picture
|
|
31
|
-
|
|
32
|
-
updater {
|
|
33
|
-
id
|
|
34
|
-
name
|
|
35
|
-
}
|
|
36
|
-
updatedAt
|
|
37
|
-
}
|
|
38
|
-
`
|
|
39
|
-
|
|
40
|
-
@customElement('department-selector')
|
|
41
|
-
export class DepartmentSelector extends LitElement {
|
|
42
|
-
static styles = [
|
|
43
|
-
CommonHeaderStyles,
|
|
44
|
-
css`
|
|
45
|
-
:host {
|
|
46
|
-
display: flex;
|
|
47
|
-
flex-direction: column;
|
|
48
|
-
|
|
49
|
-
background-color: var(--md-sys-color-surface);
|
|
50
|
-
|
|
51
|
-
width: var(--overlay-center-normal-width, 50%);
|
|
52
|
-
height: var(--overlay-center-normal-height, 50%);
|
|
53
|
-
|
|
54
|
-
overflow: auto;
|
|
55
|
-
}
|
|
56
|
-
|
|
57
|
-
ox-tree-vertical {
|
|
58
|
-
flex: 1;
|
|
59
|
-
}
|
|
60
|
-
`
|
|
61
|
-
]
|
|
62
|
-
|
|
63
|
-
@property({ type: Object }) confirmCallback?: (selected?: any) => void
|
|
64
|
-
@property({ type: Object }) value?: Department
|
|
65
|
-
|
|
66
|
-
@state() root?: Department
|
|
67
|
-
|
|
68
|
-
render() {
|
|
69
|
-
return html`
|
|
70
|
-
<ox-tree-vertical
|
|
71
|
-
.data=${this.root}
|
|
72
|
-
.selected=${this.value}
|
|
73
|
-
@select=${e => this.onSelect(e, false)}
|
|
74
|
-
@select-confirm=${e => this.onSelect(e, true)}
|
|
75
|
-
id-property="controlNo"
|
|
76
|
-
label-property="name"
|
|
77
|
-
description-property="description"
|
|
78
|
-
></ox-tree-vertical>
|
|
79
|
-
|
|
80
|
-
<div class="footer" style="margin-left:unset;">
|
|
81
|
-
<button @click=${this.onEmpty.bind(this)}>
|
|
82
|
-
<md-icon>check_box_outline_blank</md-icon>${i18next.t('button.empty')}
|
|
83
|
-
</button>
|
|
84
|
-
<div filler></div>
|
|
85
|
-
<button @click=${this.onCancel.bind(this)}><md-icon>cancel</md-icon>${i18next.t('button.cancel')}</button>
|
|
86
|
-
<button @click=${this.onConfirm.bind(this)} done><md-icon>done</md-icon>${i18next.t('button.confirm')}</button>
|
|
87
|
-
</div>
|
|
88
|
-
`
|
|
89
|
-
}
|
|
90
|
-
|
|
91
|
-
onSelect(e: CustomEvent, confirm?: boolean) {
|
|
92
|
-
this.value = e.detail as Department
|
|
93
|
-
|
|
94
|
-
if (confirm) {
|
|
95
|
-
this.onConfirm()
|
|
96
|
-
}
|
|
97
|
-
}
|
|
98
|
-
|
|
99
|
-
onEmpty() {
|
|
100
|
-
this.confirmCallback && this.confirmCallback(null)
|
|
101
|
-
closePopup(this)
|
|
102
|
-
}
|
|
103
|
-
|
|
104
|
-
onCancel() {
|
|
105
|
-
closePopup(this)
|
|
106
|
-
}
|
|
107
|
-
|
|
108
|
-
onConfirm() {
|
|
109
|
-
this.confirmCallback && this.confirmCallback(this.value)
|
|
110
|
-
closePopup(this)
|
|
111
|
-
}
|
|
112
|
-
|
|
113
|
-
async firstUpdated() {
|
|
114
|
-
const response = await client.query({
|
|
115
|
-
query: gql`
|
|
116
|
-
query {
|
|
117
|
-
responses: departmentRoots {
|
|
118
|
-
total
|
|
119
|
-
items {
|
|
120
|
-
...SubDepartment
|
|
121
|
-
children {
|
|
122
|
-
...SubDepartment
|
|
123
|
-
children {
|
|
124
|
-
...SubDepartment
|
|
125
|
-
children {
|
|
126
|
-
...SubDepartment
|
|
127
|
-
children {
|
|
128
|
-
...SubDepartment
|
|
129
|
-
children {
|
|
130
|
-
...SubDepartment
|
|
131
|
-
children {
|
|
132
|
-
...SubDepartment
|
|
133
|
-
}
|
|
134
|
-
}
|
|
135
|
-
}
|
|
136
|
-
}
|
|
137
|
-
}
|
|
138
|
-
}
|
|
139
|
-
}
|
|
140
|
-
}
|
|
141
|
-
}
|
|
142
|
-
|
|
143
|
-
${departmentFragment}
|
|
144
|
-
`
|
|
145
|
-
})
|
|
146
|
-
|
|
147
|
-
const { items: records, total } = response.data.responses
|
|
148
|
-
|
|
149
|
-
this.root = records[0]
|
|
150
|
-
}
|
|
151
|
-
}
|
|
@@ -1,107 +0,0 @@
|
|
|
1
|
-
import '@operato/property-editor'
|
|
2
|
-
import '@operato/property-editor/ox-properties-dynamic-view.js'
|
|
3
|
-
|
|
4
|
-
import { LitElement, css, html, PropertyValueMap } from 'lit'
|
|
5
|
-
import { customElement, property, query, state } from 'lit/decorators.js'
|
|
6
|
-
import { ScopedElementsMixin } from '@open-wc/scoped-elements'
|
|
7
|
-
import { i18next, localize } from '@operato/i18n'
|
|
8
|
-
import { ScrollbarStyles } from '@operato/styles'
|
|
9
|
-
|
|
10
|
-
@customElement('department-view')
|
|
11
|
-
export class DepartmentView extends localize(i18next)(ScopedElementsMixin(LitElement)) {
|
|
12
|
-
static styles = [
|
|
13
|
-
ScrollbarStyles,
|
|
14
|
-
css`
|
|
15
|
-
:host {
|
|
16
|
-
display: flex;
|
|
17
|
-
flex-direction: column;
|
|
18
|
-
|
|
19
|
-
overflow: auto;
|
|
20
|
-
}
|
|
21
|
-
|
|
22
|
-
ox-properties-dynamic-view {
|
|
23
|
-
flex: 1;
|
|
24
|
-
|
|
25
|
-
display: flex;
|
|
26
|
-
flex-direction: column;
|
|
27
|
-
}
|
|
28
|
-
`
|
|
29
|
-
]
|
|
30
|
-
|
|
31
|
-
@property({ type: Object }) department: any
|
|
32
|
-
|
|
33
|
-
@query('ox-properties-dynamic-view') dynamicView!: any
|
|
34
|
-
|
|
35
|
-
@state() private properties: any
|
|
36
|
-
|
|
37
|
-
protected firstUpdated(_changedProperties: PropertyValueMap<any> | Map<PropertyKey, unknown>): void {
|
|
38
|
-
this.properties = [
|
|
39
|
-
{
|
|
40
|
-
type: 'string',
|
|
41
|
-
name: 'controlNo',
|
|
42
|
-
label: 'control-no'
|
|
43
|
-
},
|
|
44
|
-
{
|
|
45
|
-
type: 'string',
|
|
46
|
-
name: 'name',
|
|
47
|
-
label: 'name'
|
|
48
|
-
},
|
|
49
|
-
{
|
|
50
|
-
type: 'string',
|
|
51
|
-
name: 'description',
|
|
52
|
-
label: 'description'
|
|
53
|
-
},
|
|
54
|
-
{
|
|
55
|
-
type: 'resource-object',
|
|
56
|
-
name: 'manager',
|
|
57
|
-
label: 'manager',
|
|
58
|
-
property: {
|
|
59
|
-
title: i18next.t('title.employee list'),
|
|
60
|
-
queryName: 'employees',
|
|
61
|
-
columns: [
|
|
62
|
-
{ name: 'id', hidden: true },
|
|
63
|
-
{ name: 'controlNo', header: { renderer: () => i18next.t('field.control-no') }, filter: 'search' },
|
|
64
|
-
{ name: 'name', header: { renderer: () => i18next.t('field.name') }, filter: 'search' },
|
|
65
|
-
{ name: 'email', header: { renderer: () => i18next.t('field.email') } }
|
|
66
|
-
],
|
|
67
|
-
list: { fields: ['controlNo', 'name', 'email'] },
|
|
68
|
-
valueField: 'id',
|
|
69
|
-
nameField: 'name',
|
|
70
|
-
descriptionField: 'controlNo'
|
|
71
|
-
}
|
|
72
|
-
},
|
|
73
|
-
{
|
|
74
|
-
type: 'boolean',
|
|
75
|
-
name: 'active',
|
|
76
|
-
label: 'active'
|
|
77
|
-
},
|
|
78
|
-
/*{
|
|
79
|
-
type: 'select',
|
|
80
|
-
name: 'state',
|
|
81
|
-
label: 'state',
|
|
82
|
-
property: {
|
|
83
|
-
options: ['', 'STATUS_A', 'STATUS_B']
|
|
84
|
-
}
|
|
85
|
-
},*/
|
|
86
|
-
{
|
|
87
|
-
type: 'image',
|
|
88
|
-
name: 'picture',
|
|
89
|
-
label: 'picture'
|
|
90
|
-
}
|
|
91
|
-
]
|
|
92
|
-
}
|
|
93
|
-
|
|
94
|
-
render() {
|
|
95
|
-
return html`
|
|
96
|
-
<ox-properties-dynamic-view
|
|
97
|
-
.props=${this.properties}
|
|
98
|
-
.value=${this.department}
|
|
99
|
-
@property-change=${this.onPropertyChange.bind(this)}
|
|
100
|
-
></ox-properties-dynamic-view>
|
|
101
|
-
`
|
|
102
|
-
}
|
|
103
|
-
|
|
104
|
-
onPropertyChange(e: CustomEvent) {
|
|
105
|
-
this.department = e.detail
|
|
106
|
-
}
|
|
107
|
-
}
|
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
export * from './department-selector'
|
|
2
|
-
export * from './approval-line-selector'
|
|
3
|
-
|
|
4
|
-
export * from './department-view'
|
|
5
|
-
|
|
6
|
-
export * from './approval-line-view'
|
|
7
|
-
export * from './approval-line-items-editor'
|
|
8
|
-
export * from './approval-line-items-editor-popup'
|
|
9
|
-
|
|
10
|
-
export * from './assignees-view'
|
|
11
|
-
export * from './assignees-editor'
|
|
12
|
-
export * from './assignees-editor-popup'
|
|
13
|
-
|
|
14
|
-
export * from './recipients-view'
|
|
15
|
-
export * from './recipients-editor'
|
|
16
|
-
export * from './recipients-editor-popup'
|
|
@@ -1,79 +0,0 @@
|
|
|
1
|
-
import '@material/web/icon/icon.js'
|
|
2
|
-
import { css, html, LitElement } from 'lit'
|
|
3
|
-
import { customElement, property, query, state } from 'lit/decorators.js'
|
|
4
|
-
|
|
5
|
-
import { i18next, localize } from '@operato/i18n'
|
|
6
|
-
import { CommonHeaderStyles } from '@operato/styles'
|
|
7
|
-
import { closePopup } from '@operato/popup'
|
|
8
|
-
|
|
9
|
-
import { RecipientsEditor } from './recipients-editor'
|
|
10
|
-
import { AssigneeItem } from '../types/org-member'
|
|
11
|
-
|
|
12
|
-
/**
|
|
13
|
-
* 결재선의 각 결재자 리스트를 편집한다.
|
|
14
|
-
*/
|
|
15
|
-
@customElement('recipients-editor-popup')
|
|
16
|
-
export class RecipientsEditorPopup extends localize(i18next)(LitElement) {
|
|
17
|
-
static styles = [
|
|
18
|
-
CommonHeaderStyles,
|
|
19
|
-
css`
|
|
20
|
-
:host {
|
|
21
|
-
display: flex;
|
|
22
|
-
flex-direction: column;
|
|
23
|
-
|
|
24
|
-
background-color: var(--md-sys-color-surface);
|
|
25
|
-
}
|
|
26
|
-
|
|
27
|
-
recipients-editor {
|
|
28
|
-
flex: 1;
|
|
29
|
-
}
|
|
30
|
-
`
|
|
31
|
-
]
|
|
32
|
-
|
|
33
|
-
@property({ type: Array }) value?: AssigneeItem[]
|
|
34
|
-
|
|
35
|
-
@property({ type: Object }) confirmCallback?: (value?: AssigneeItem[] | null) => void
|
|
36
|
-
@query('recipients-editor') editor!: RecipientsEditor
|
|
37
|
-
|
|
38
|
-
/* this.value는 (원인불명으로) 값이 Reset되므로, 변화값을 유지하도록 별도로 changedValue를 사용함 */
|
|
39
|
-
private changedValue?: AssigneeItem[] = this.value
|
|
40
|
-
|
|
41
|
-
render() {
|
|
42
|
-
return html`
|
|
43
|
-
<recipients-editor
|
|
44
|
-
.value=${this.value}
|
|
45
|
-
@change=${(e: CustomEvent) => {
|
|
46
|
-
this.changedValue = [...e.detail]
|
|
47
|
-
}}
|
|
48
|
-
></recipients-editor>
|
|
49
|
-
|
|
50
|
-
<div class="footer">
|
|
51
|
-
<button @click=${this.onEmpty.bind(this)}>
|
|
52
|
-
<md-icon>check_box_outline_blank</md-icon>${i18next.t('button.empty')}
|
|
53
|
-
</button>
|
|
54
|
-
<div filler></div>
|
|
55
|
-
<button @click=${this.onCancel.bind(this)}><md-icon>cancel</md-icon>${i18next.t('button.cancel')}</button>
|
|
56
|
-
<button @click=${this.onConfirm.bind(this)} done><md-icon>done</md-icon>${i18next.t('button.confirm')}</button>
|
|
57
|
-
</div>
|
|
58
|
-
`
|
|
59
|
-
}
|
|
60
|
-
|
|
61
|
-
firstUpdated() {
|
|
62
|
-
this.changedValue = this.value
|
|
63
|
-
}
|
|
64
|
-
|
|
65
|
-
onEmpty() {
|
|
66
|
-
this.confirmCallback && this.confirmCallback(null)
|
|
67
|
-
closePopup(this)
|
|
68
|
-
}
|
|
69
|
-
|
|
70
|
-
onCancel() {
|
|
71
|
-
closePopup(this)
|
|
72
|
-
}
|
|
73
|
-
|
|
74
|
-
onConfirm() {
|
|
75
|
-
this.confirmCallback && this.confirmCallback(this.changedValue)
|
|
76
|
-
|
|
77
|
-
closePopup(this)
|
|
78
|
-
}
|
|
79
|
-
}
|