@things-factory/organization 7.0.52 → 7.0.56
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/component/approval-line-brief.ts +2 -2
- package/client/component/approval-line-items-editor-popup.ts +6 -4
- package/client/component/approval-line-items-editor.ts +5 -6
- package/client/component/approval-line-selector.ts +4 -4
- package/client/component/approval-line-templates-manager.ts +8 -6
- package/client/component/approval-line-view.ts +10 -6
- package/client/component/assignees-editor-popup.ts +4 -4
- package/client/component/assignees-editor.ts +3 -3
- package/client/component/department-selector.ts +20 -17
- package/client/component/recipients-editor-popup.ts +4 -4
- package/client/component/recipients-editor.ts +2 -2
- package/client/grist-editor/grist-editor-department-object.ts +1 -0
- package/client/pages/department/department-importer.ts +5 -4
- package/client/pages/department/department-list-page.ts +11 -11
- package/client/pages/department/department-tree-page.ts +15 -15
- package/client/pages/employee/employee-importer.ts +5 -4
- package/client/pages/employee/employee-list-page.ts +122 -98
- package/client/pages/employee/employees-by-department.ts +10 -10
- package/dist-client/component/approval-line-brief.js +2 -2
- package/dist-client/component/approval-line-brief.js.map +1 -1
- package/dist-client/component/approval-line-items-editor-popup.d.ts +1 -1
- package/dist-client/component/approval-line-items-editor-popup.js +6 -4
- package/dist-client/component/approval-line-items-editor-popup.js.map +1 -1
- package/dist-client/component/approval-line-items-editor.d.ts +4 -9
- package/dist-client/component/approval-line-items-editor.js +4 -5
- package/dist-client/component/approval-line-items-editor.js.map +1 -1
- package/dist-client/component/approval-line-selector.d.ts +1 -1
- package/dist-client/component/approval-line-selector.js +4 -4
- package/dist-client/component/approval-line-selector.js.map +1 -1
- package/dist-client/component/approval-line-templates-manager.d.ts +3 -7
- package/dist-client/component/approval-line-templates-manager.js +6 -4
- package/dist-client/component/approval-line-templates-manager.js.map +1 -1
- package/dist-client/component/approval-line-view.js +10 -6
- package/dist-client/component/approval-line-view.js.map +1 -1
- package/dist-client/component/assignees-editor-popup.d.ts +1 -1
- package/dist-client/component/assignees-editor-popup.js +4 -4
- package/dist-client/component/assignees-editor-popup.js.map +1 -1
- package/dist-client/component/assignees-editor.d.ts +3 -8
- package/dist-client/component/assignees-editor.js +1 -1
- package/dist-client/component/assignees-editor.js.map +1 -1
- package/dist-client/component/department-selector.d.ts +1 -1
- package/dist-client/component/department-selector.js +19 -17
- package/dist-client/component/department-selector.js.map +1 -1
- package/dist-client/component/department-view.d.ts +1 -1
- package/dist-client/component/recipients-editor-popup.d.ts +1 -1
- package/dist-client/component/recipients-editor-popup.js +4 -4
- package/dist-client/component/recipients-editor-popup.js.map +1 -1
- package/dist-client/component/recipients-editor.d.ts +3 -8
- package/dist-client/component/recipients-editor.js.map +1 -1
- package/dist-client/grist-editor/grist-editor-department-object.js +1 -0
- package/dist-client/grist-editor/grist-editor-department-object.js.map +1 -1
- package/dist-client/pages/approval-line/common-approval-line-templates-page.d.ts +1 -1
- package/dist-client/pages/approval-line/my-approval-line-templates-page.d.ts +1 -1
- package/dist-client/pages/department/department-importer.d.ts +1 -1
- package/dist-client/pages/department/department-importer.js +5 -4
- package/dist-client/pages/department/department-importer.js.map +1 -1
- package/dist-client/pages/department/department-list-page.d.ts +1 -1
- package/dist-client/pages/department/department-list-page.js +11 -11
- package/dist-client/pages/department/department-list-page.js.map +1 -1
- package/dist-client/pages/department/department-tree-page.d.ts +1 -1
- package/dist-client/pages/department/department-tree-page.js +15 -15
- package/dist-client/pages/department/department-tree-page.js.map +1 -1
- package/dist-client/pages/employee/employee-importer.d.ts +1 -1
- package/dist-client/pages/employee/employee-importer.js +5 -4
- package/dist-client/pages/employee/employee-importer.js.map +1 -1
- package/dist-client/pages/employee/employee-list-page.d.ts +8 -3
- package/dist-client/pages/employee/employee-list-page.js +122 -95
- package/dist-client/pages/employee/employee-list-page.js.map +1 -1
- package/dist-client/pages/employee/employees-by-department.d.ts +1 -1
- package/dist-client/pages/employee/employees-by-department.js +10 -10
- 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-type.d.ts +12 -2
- package/dist-server/service/employee/employee-type.js +41 -5
- package/dist-server/service/employee/employee-type.js.map +1 -1
- package/dist-server/tsconfig.tsbuildinfo +1 -1
- package/package.json +8 -6
- package/server/service/employee/employee-type.ts +28 -4
- package/translations/en.json +2 -0
- package/translations/ja.json +6 -4
- package/translations/ko.json +2 -0
- package/translations/ms.json +5 -3
- package/translations/zh.json +6 -4
|
@@ -14,15 +14,18 @@ import { client } from '@operato/graphql'
|
|
|
14
14
|
import { i18next, localize } from '@operato/i18n'
|
|
15
15
|
import { notify, openPopup } from '@operato/layout'
|
|
16
16
|
import { PageView, store } from '@operato/shell'
|
|
17
|
-
import { CommonHeaderStyles, ScrollbarStyles } from '@operato/styles'
|
|
17
|
+
import { CommonHeaderStyles, CommonGristStyles, ScrollbarStyles } from '@operato/styles'
|
|
18
18
|
import { isMobileDevice } from '@operato/utils'
|
|
19
|
+
import { p13n } from '@operato/p13n'
|
|
19
20
|
|
|
20
21
|
import { EmployeeImporter } from './employee-importer'
|
|
22
|
+
import { ApprovalLineTemplatesManager } from 'component/approval-line-templates-manager'
|
|
21
23
|
|
|
22
24
|
@customElement('employee-list-page')
|
|
23
|
-
export class EmployeeListPage extends connect(store)(localize(i18next)(ScopedElementsMixin(PageView))) {
|
|
25
|
+
export class EmployeeListPage extends connect(store)(p13n(localize(i18next)(ScopedElementsMixin(PageView)))) {
|
|
24
26
|
static styles = [
|
|
25
27
|
ScrollbarStyles,
|
|
28
|
+
CommonGristStyles,
|
|
26
29
|
CommonHeaderStyles,
|
|
27
30
|
css`
|
|
28
31
|
:host {
|
|
@@ -75,12 +78,12 @@ export class EmployeeListPage extends connect(store)(localize(i18next)(ScopedEle
|
|
|
75
78
|
{
|
|
76
79
|
icon: 'save',
|
|
77
80
|
title: i18next.t('button.save'),
|
|
78
|
-
action: this.
|
|
81
|
+
action: this.onUpdateEmployee.bind(this)
|
|
79
82
|
},
|
|
80
83
|
{
|
|
81
84
|
icon: 'delete',
|
|
82
85
|
title: i18next.t('button.delete'),
|
|
83
|
-
action: this.
|
|
86
|
+
action: this.onDeleteEmployee.bind(this),
|
|
84
87
|
emphasis: {
|
|
85
88
|
danger: true
|
|
86
89
|
}
|
|
@@ -101,13 +104,21 @@ export class EmployeeListPage extends connect(store)(localize(i18next)(ScopedEle
|
|
|
101
104
|
const mode = this.mode || (isMobileDevice() ? 'CARD' : 'GRID')
|
|
102
105
|
|
|
103
106
|
return html`
|
|
104
|
-
<ox-grist
|
|
107
|
+
<ox-grist
|
|
108
|
+
.mode=${mode}
|
|
109
|
+
.config=${this.gristConfig}
|
|
110
|
+
.fetchHandler=${this.fetchHandler.bind(this)}
|
|
111
|
+
.personalConfigProvider=${this.getPagePreferenceProvider('ox-grist')!}
|
|
112
|
+
>
|
|
105
113
|
<div slot="headroom" class="header">
|
|
106
114
|
<div class="filters">
|
|
107
115
|
<ox-filters-form class="filter" autofocus without-search></ox-filters-form>
|
|
108
116
|
</div>
|
|
117
|
+
|
|
109
118
|
<ox-context-page-toolbar class="actions" .context=${this.context}></ox-context-page-toolbar>
|
|
110
119
|
</div>
|
|
120
|
+
|
|
121
|
+
<ox-grist-personalizer slot="setting"></ox-grist-personalizer>
|
|
111
122
|
</ox-grist>
|
|
112
123
|
`
|
|
113
124
|
}
|
|
@@ -123,21 +134,45 @@ export class EmployeeListPage extends connect(store)(localize(i18next)(ScopedEle
|
|
|
123
134
|
columns: [
|
|
124
135
|
{ type: 'gutter', gutterName: 'sequence', fixed: true },
|
|
125
136
|
{ type: 'gutter', gutterName: 'row-selector', multiple: true, fixed: true },
|
|
137
|
+
// {
|
|
138
|
+
// type: 'gutter',
|
|
139
|
+
// gutterName: 'button',
|
|
140
|
+
// fixed: true,
|
|
141
|
+
// forList: true,
|
|
142
|
+
// icon: 'contact_page',
|
|
143
|
+
// iconOnly: false,
|
|
144
|
+
// title: i18next.t('button.edit-contact'),
|
|
145
|
+
// width: 110,
|
|
146
|
+
// handlers: {
|
|
147
|
+
// click: async (columns, data, column, record, rowIndex) => {
|
|
148
|
+
// if (record && record.contact) {
|
|
149
|
+
// this.openContactPopup(record)
|
|
150
|
+
// } else {
|
|
151
|
+
// this.openContactSelector(record)
|
|
152
|
+
// }
|
|
153
|
+
// }
|
|
154
|
+
// }
|
|
155
|
+
// },
|
|
126
156
|
{
|
|
127
|
-
type: '
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
157
|
+
type: 'image',
|
|
158
|
+
name: 'profile',
|
|
159
|
+
header: i18next.t('button.edit-contact'),
|
|
160
|
+
width: 80,
|
|
161
|
+
record: {
|
|
162
|
+
align: 'center',
|
|
163
|
+
renderer: function (value, column, record, rowIndex, field) {
|
|
164
|
+
return html`<ox-pfp-view
|
|
165
|
+
style="min-height: 36px; width: unset; aspect-ratio: 1 / 1;"
|
|
166
|
+
.profile=${record.profile}
|
|
167
|
+
.name=${record.name}
|
|
168
|
+
></ox-pfp-view>`
|
|
169
|
+
}
|
|
170
|
+
},
|
|
136
171
|
handlers: {
|
|
137
172
|
click: async (columns, data, column, record, rowIndex) => {
|
|
138
|
-
if (record.contact) {
|
|
173
|
+
if (record && record.contact) {
|
|
139
174
|
this.openContactPopup(record)
|
|
140
|
-
} else
|
|
175
|
+
} else {
|
|
141
176
|
this.openContactSelector(record)
|
|
142
177
|
}
|
|
143
178
|
}
|
|
@@ -149,7 +184,8 @@ export class EmployeeListPage extends connect(store)(localize(i18next)(ScopedEle
|
|
|
149
184
|
fixed: true,
|
|
150
185
|
header: i18next.t('field.control-no'),
|
|
151
186
|
record: {
|
|
152
|
-
editable: true
|
|
187
|
+
editable: true,
|
|
188
|
+
mandatory: true
|
|
153
189
|
},
|
|
154
190
|
filter: 'search',
|
|
155
191
|
sortable: true,
|
|
@@ -161,7 +197,8 @@ export class EmployeeListPage extends connect(store)(localize(i18next)(ScopedEle
|
|
|
161
197
|
fixed: true,
|
|
162
198
|
header: i18next.t('field.name'),
|
|
163
199
|
record: {
|
|
164
|
-
editable: true
|
|
200
|
+
editable: true,
|
|
201
|
+
mandatory: true
|
|
165
202
|
},
|
|
166
203
|
filter: 'search',
|
|
167
204
|
sortable: true,
|
|
@@ -210,7 +247,8 @@ export class EmployeeListPage extends connect(store)(localize(i18next)(ScopedEle
|
|
|
210
247
|
filter: false,
|
|
211
248
|
record: {
|
|
212
249
|
editable: true,
|
|
213
|
-
codeName: 'EMPLOYEE_TYPE'
|
|
250
|
+
codeName: 'EMPLOYEE_TYPE',
|
|
251
|
+
selectDispOpt: 'name'
|
|
214
252
|
}
|
|
215
253
|
},
|
|
216
254
|
{
|
|
@@ -274,7 +312,8 @@ export class EmployeeListPage extends connect(store)(localize(i18next)(ScopedEle
|
|
|
274
312
|
header: { renderer: () => i18next.t('label.type') },
|
|
275
313
|
record: {
|
|
276
314
|
editable: false,
|
|
277
|
-
codeName: 'EMPLOYEE_TYPE'
|
|
315
|
+
codeName: 'EMPLOYEE_TYPE',
|
|
316
|
+
selectDispOpt: 'name'
|
|
278
317
|
}
|
|
279
318
|
},
|
|
280
319
|
{
|
|
@@ -284,7 +323,8 @@ export class EmployeeListPage extends connect(store)(localize(i18next)(ScopedEle
|
|
|
284
323
|
header: { renderer: () => i18next.t('label.job-position') },
|
|
285
324
|
record: {
|
|
286
325
|
editable: false,
|
|
287
|
-
codeName: 'JOB_POSITION'
|
|
326
|
+
codeName: 'JOB_POSITION',
|
|
327
|
+
selectDispOpt: 'name'
|
|
288
328
|
}
|
|
289
329
|
},
|
|
290
330
|
{
|
|
@@ -294,14 +334,15 @@ export class EmployeeListPage extends connect(store)(localize(i18next)(ScopedEle
|
|
|
294
334
|
header: { renderer: () => i18next.t('label.job-responsibility') },
|
|
295
335
|
record: {
|
|
296
336
|
editable: false,
|
|
297
|
-
codeName: 'JOB_RESPONSIBILITY'
|
|
337
|
+
codeName: 'JOB_RESPONSIBILITY',
|
|
338
|
+
selectDispOpt: 'name'
|
|
298
339
|
}
|
|
299
340
|
},
|
|
300
341
|
{
|
|
301
342
|
type: 'date',
|
|
302
343
|
name: 'hiredOn',
|
|
303
344
|
header: { renderer: () => i18next.t('field.hired-on') },
|
|
304
|
-
width:
|
|
345
|
+
width: 120
|
|
305
346
|
}
|
|
306
347
|
],
|
|
307
348
|
valueField: 'id',
|
|
@@ -329,7 +370,7 @@ export class EmployeeListPage extends connect(store)(localize(i18next)(ScopedEle
|
|
|
329
370
|
type: 'string',
|
|
330
371
|
name: 'phone',
|
|
331
372
|
header: i18next.t('field.phone'),
|
|
332
|
-
width:
|
|
373
|
+
width: 130,
|
|
333
374
|
record: {
|
|
334
375
|
editable: false,
|
|
335
376
|
renderer: function (value, column, record, rowIndex, field) {
|
|
@@ -345,7 +386,8 @@ export class EmployeeListPage extends connect(store)(localize(i18next)(ScopedEle
|
|
|
345
386
|
width: 175,
|
|
346
387
|
record: {
|
|
347
388
|
editable: true,
|
|
348
|
-
codeName: 'JOB_RESPONSIBILITY'
|
|
389
|
+
codeName: 'JOB_RESPONSIBILITY',
|
|
390
|
+
selectDispOpt: 'name'
|
|
349
391
|
}
|
|
350
392
|
},
|
|
351
393
|
{
|
|
@@ -355,14 +397,15 @@ export class EmployeeListPage extends connect(store)(localize(i18next)(ScopedEle
|
|
|
355
397
|
width: 100,
|
|
356
398
|
record: {
|
|
357
399
|
editable: true,
|
|
358
|
-
codeName: 'JOB_POSITION'
|
|
400
|
+
codeName: 'JOB_POSITION',
|
|
401
|
+
selectDispOpt: 'name'
|
|
359
402
|
}
|
|
360
403
|
},
|
|
361
404
|
{
|
|
362
405
|
type: 'date',
|
|
363
406
|
name: 'hiredOn',
|
|
364
407
|
header: i18next.t('field.hired-on'),
|
|
365
|
-
width:
|
|
408
|
+
width: 120,
|
|
366
409
|
record: {
|
|
367
410
|
editable: true
|
|
368
411
|
},
|
|
@@ -372,7 +415,7 @@ export class EmployeeListPage extends connect(store)(localize(i18next)(ScopedEle
|
|
|
372
415
|
type: 'date',
|
|
373
416
|
name: 'retiredAt',
|
|
374
417
|
header: i18next.t('label.retired-at'),
|
|
375
|
-
width:
|
|
418
|
+
width: 120,
|
|
376
419
|
record: {
|
|
377
420
|
editable: true
|
|
378
421
|
}
|
|
@@ -415,17 +458,8 @@ export class EmployeeListPage extends connect(store)(localize(i18next)(ScopedEle
|
|
|
415
458
|
sortable: true
|
|
416
459
|
},
|
|
417
460
|
{
|
|
418
|
-
type: '
|
|
419
|
-
name: '
|
|
420
|
-
record: {
|
|
421
|
-
renderer: function (value, column, record, rowIndex, field) {
|
|
422
|
-
return html`<ox-pfp-view
|
|
423
|
-
style="height:90%; width: unset; aspect-ratio: 1 / 1;"
|
|
424
|
-
.profile=${record.profile}
|
|
425
|
-
.name=${record.name}
|
|
426
|
-
></ox-pfp-view>`
|
|
427
|
-
}
|
|
428
|
-
},
|
|
461
|
+
type: 'resource-object',
|
|
462
|
+
name: 'contact',
|
|
429
463
|
hidden: true
|
|
430
464
|
}
|
|
431
465
|
],
|
|
@@ -470,6 +504,7 @@ export class EmployeeListPage extends connect(store)(localize(i18next)(ScopedEle
|
|
|
470
504
|
}
|
|
471
505
|
department {
|
|
472
506
|
id
|
|
507
|
+
controlNo
|
|
473
508
|
name
|
|
474
509
|
description
|
|
475
510
|
}
|
|
@@ -518,7 +553,7 @@ export class EmployeeListPage extends connect(store)(localize(i18next)(ScopedEle
|
|
|
518
553
|
}
|
|
519
554
|
}
|
|
520
555
|
|
|
521
|
-
async
|
|
556
|
+
async onDeleteEmployee() {
|
|
522
557
|
if (confirm(i18next.t('text.sure_to_x', { x: i18next.t('text.delete') }))) {
|
|
523
558
|
const ids = this.grist.selected.map(record => record.id)
|
|
524
559
|
if (ids && ids.length > 0) {
|
|
@@ -543,7 +578,7 @@ export class EmployeeListPage extends connect(store)(localize(i18next)(ScopedEle
|
|
|
543
578
|
}
|
|
544
579
|
}
|
|
545
580
|
|
|
546
|
-
async
|
|
581
|
+
async onUpdateEmployee() {
|
|
547
582
|
let patches = this.grist.dirtyRecords
|
|
548
583
|
if (patches && patches.length) {
|
|
549
584
|
patches = patches.map(patch => {
|
|
@@ -628,43 +663,10 @@ export class EmployeeListPage extends connect(store)(localize(i18next)(ScopedEle
|
|
|
628
663
|
return
|
|
629
664
|
}
|
|
630
665
|
|
|
631
|
-
const response = await client.query({
|
|
632
|
-
query: gql`
|
|
633
|
-
query ($id: String!) {
|
|
634
|
-
contact(id: $id) {
|
|
635
|
-
id
|
|
636
|
-
name
|
|
637
|
-
company
|
|
638
|
-
department
|
|
639
|
-
email
|
|
640
|
-
phone
|
|
641
|
-
address
|
|
642
|
-
note
|
|
643
|
-
items {
|
|
644
|
-
type
|
|
645
|
-
label
|
|
646
|
-
value
|
|
647
|
-
}
|
|
648
|
-
profile {
|
|
649
|
-
left
|
|
650
|
-
top
|
|
651
|
-
zoom
|
|
652
|
-
picture
|
|
653
|
-
}
|
|
654
|
-
}
|
|
655
|
-
}
|
|
656
|
-
`,
|
|
657
|
-
variables: {
|
|
658
|
-
id: record.contact.id
|
|
659
|
-
}
|
|
660
|
-
})
|
|
661
|
-
|
|
662
|
-
const { contact } = response.data
|
|
663
|
-
|
|
664
666
|
const popup = openPopup(
|
|
665
667
|
html`
|
|
666
668
|
<contact-popup
|
|
667
|
-
.
|
|
669
|
+
.contactId=${record.contact.id}
|
|
668
670
|
@change=${() => {
|
|
669
671
|
this.grist.fetch()
|
|
670
672
|
}}
|
|
@@ -696,37 +698,59 @@ export class EmployeeListPage extends connect(store)(localize(i18next)(ScopedEle
|
|
|
696
698
|
}
|
|
697
699
|
|
|
698
700
|
async attachContact(record: GristRecord, contact: Contact) {
|
|
699
|
-
|
|
700
|
-
|
|
701
|
-
mutation
|
|
702
|
-
|
|
703
|
-
id
|
|
701
|
+
if (record.id) {
|
|
702
|
+
const response = await client.mutate({
|
|
703
|
+
mutation: gql`
|
|
704
|
+
mutation ($id: String!, $contactId: String!) {
|
|
705
|
+
attachContact(id: $id, contactId: $contactId) {
|
|
706
|
+
id
|
|
707
|
+
}
|
|
704
708
|
}
|
|
709
|
+
`,
|
|
710
|
+
variables: {
|
|
711
|
+
id: record.id,
|
|
712
|
+
contactId: contact.id
|
|
705
713
|
}
|
|
706
|
-
|
|
707
|
-
|
|
708
|
-
|
|
709
|
-
|
|
710
|
-
|
|
711
|
-
|
|
714
|
+
})
|
|
715
|
+
|
|
716
|
+
this.grist.fetch()
|
|
717
|
+
} else if (contact?.id) {
|
|
718
|
+
this.grist.addRecord({
|
|
719
|
+
name: contact.name,
|
|
720
|
+
contact: {
|
|
721
|
+
id: contact.id,
|
|
722
|
+
name: contact.name,
|
|
723
|
+
email: (contact as any).email,
|
|
724
|
+
phone: (contact as any).phone,
|
|
725
|
+
address: (contact as any).address
|
|
726
|
+
}
|
|
727
|
+
})
|
|
728
|
+
this.grist.refresh()
|
|
729
|
+
await this.grist.requestUpdate()
|
|
712
730
|
|
|
713
|
-
|
|
731
|
+
this.grist.checkDirties()
|
|
732
|
+
}
|
|
714
733
|
}
|
|
715
734
|
|
|
716
735
|
async detachContact(record) {
|
|
717
|
-
|
|
718
|
-
|
|
719
|
-
mutation
|
|
720
|
-
|
|
721
|
-
id
|
|
736
|
+
if (record.id) {
|
|
737
|
+
const response = await client.mutate({
|
|
738
|
+
mutation: gql`
|
|
739
|
+
mutation ($id: String!) {
|
|
740
|
+
detachContact(id: $id) {
|
|
741
|
+
id
|
|
742
|
+
}
|
|
722
743
|
}
|
|
744
|
+
`,
|
|
745
|
+
variables: {
|
|
746
|
+
id: record.id
|
|
723
747
|
}
|
|
724
|
-
|
|
725
|
-
variables: {
|
|
726
|
-
id: record.id
|
|
727
|
-
}
|
|
728
|
-
})
|
|
748
|
+
})
|
|
729
749
|
|
|
730
|
-
|
|
750
|
+
this.grist.fetch()
|
|
751
|
+
} else {
|
|
752
|
+
record.contact = null
|
|
753
|
+
this.grist.refresh()
|
|
754
|
+
}
|
|
731
755
|
}
|
|
732
756
|
}
|
|
@@ -18,7 +18,7 @@ import { Department } from '../../types/department'
|
|
|
18
18
|
import { EmployeeListPage } from './employee-list-page'
|
|
19
19
|
|
|
20
20
|
const departmentFragment = gql`
|
|
21
|
-
fragment
|
|
21
|
+
fragment SubDepartmentFragment on Department {
|
|
22
22
|
id
|
|
23
23
|
controlNo
|
|
24
24
|
name
|
|
@@ -484,22 +484,22 @@ export class EmployeesByDepartment extends connect(store)(localize(i18next)(Scop
|
|
|
484
484
|
const response = await client.query({
|
|
485
485
|
query: gql`
|
|
486
486
|
query {
|
|
487
|
-
responses:
|
|
488
|
-
...
|
|
487
|
+
responses: departmentRoots {
|
|
488
|
+
...SubDepartmentFragment
|
|
489
489
|
children {
|
|
490
|
-
...
|
|
490
|
+
...SubDepartmentFragment
|
|
491
491
|
children {
|
|
492
|
-
...
|
|
492
|
+
...SubDepartmentFragment
|
|
493
493
|
children {
|
|
494
|
-
...
|
|
494
|
+
...SubDepartmentFragment
|
|
495
495
|
children {
|
|
496
|
-
...
|
|
496
|
+
...SubDepartmentFragment
|
|
497
497
|
children {
|
|
498
|
-
...
|
|
498
|
+
...SubDepartmentFragment
|
|
499
499
|
children {
|
|
500
|
-
...
|
|
500
|
+
...SubDepartmentFragment
|
|
501
501
|
children {
|
|
502
|
-
...
|
|
502
|
+
...SubDepartmentFragment
|
|
503
503
|
}
|
|
504
504
|
}
|
|
505
505
|
}
|
|
@@ -86,8 +86,8 @@ ApprovalLineBrief.styles = [
|
|
|
86
86
|
}
|
|
87
87
|
|
|
88
88
|
[past] span {
|
|
89
|
-
background-color:
|
|
90
|
-
color: var(--
|
|
89
|
+
background-color: var(--md-sys-color-surface);
|
|
90
|
+
color: var(--md-sys-color-on-surface);
|
|
91
91
|
}
|
|
92
92
|
|
|
93
93
|
[current] span {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"approval-line-brief.js","sourceRoot":"","sources":["../../client/component/approval-line-brief.ts"],"names":[],"mappings":";AAAA,OAAO,EAAE,GAAG,EAAE,IAAI,EAAE,UAAU,EAAkB,MAAM,KAAK,CAAA;AAC3D,OAAO,EAAE,aAAa,EAAE,QAAQ,EAAS,MAAM,mBAAmB,CAAA;AAElE,OAAO,EAAE,OAAO,EAAE,QAAQ,EAAE,MAAM,eAAe,CAAA;AAEjD,OAAO,EAAE,mBAAmB,EAAE,MAAM,qBAAqB,CAAA;AAGlD,IAAM,iBAAiB,GAAvB,MAAM,iBAAkB,SAAQ,QAAQ,CAAC,OAAO,CAAC,CAAC,UAAU,CAAC;IAA7D;;QA4EsB,UAAK,GAAuB,EAAE,CAAA;QAC7B,YAAO,GAAW,CAAC,CAAC,CAAA;IAiClD,CAAC;IA/BC,MAAM;QACJ,MAAM,KAAK,GAAG,IAAI,CAAC,KAAK,IAAI,EAAE,CAAA;QAC9B,MAAM,OAAO,GAAG,IAAI,CAAC,OAAO,CAAA;QAE5B,OAAO,IAAI,CAAA;;UAEL,IAAI,CAAC,KAAK;YACV,CAAC,CAAC,IAAI,CAAA,0BAA0B,IAAI,CAAC,OAAO,IAAI,CAAC,UAAU,IAAI,CAAC,OAAO,GAAG,CAAC,yBAAyB;YACpG,CAAC,CAAC,IAAI,CAAA,EAAE;UACR,KAAK,CAAC,GAAG,CAAC,CAAC,IAAI,EAAE,KAAK,EAAE,EAAE,CAAC,IAAI,CAAC,UAAU,CAAC,IAAI,EAAE,KAAK,GAAG,CAAC,CAAC,CAAC;;KAEjE,CAAA;IACH,CAAC;IAED,UAAU,CAAC,IAAsB,EAAE,KAAa;QAC9C,MAAM,EAAE,IAAI,EAAE,QAAQ,EAAE,GAAG,IAAI,CAAA;QAC/B,MAAM,EAAE,IAAI,EAAE,GAAG,QAAQ,IAAI;YAC3B,IAAI,EAAE,CAAC,mBAAmB,CAAC,MAAM,EAAE,mBAAmB,CAAC,YAAY,EAAE,mBAAmB,CAAC,YAAY,CAAC,CAAC,QAAQ,CAC7G,IAAK,CACN;gBACC,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,SAAS,IAAI,EAAE,CAAC;gBAC5B,CAAC,CAAC,EAAE;SACP,CAAA;QAED,OAAO,IAAI,CAAA;8BACe,IAAI,CAAC,OAAO,IAAI,KAAK,UAAU,IAAI,CAAC,OAAO,GAAG,KAAK,UAAU,IAAI,IAAI,EAAE;gBACrF,KAAK,GAAG,CAAC;eACV,IAAI;;KAEd,CAAA;IACH,CAAC;;AA5GM,wBAAM,GAAG;IACd,GAAG,CAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;KAuEF;CACF,AAzEY,CAyEZ;AAE0B;IAA1B,QAAQ,CAAC,EAAE,IAAI,EAAE,KAAK,EAAE,CAAC;;gDAA+B;AAC7B;IAA3B,QAAQ,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC;;kDAAqB;AA7ErC,iBAAiB;IAD7B,aAAa,CAAC,qBAAqB,CAAC;GACxB,iBAAiB,CA8G7B","sourcesContent":["import { css, html, LitElement, TemplateResult } from 'lit'\nimport { customElement, property, query } from 'lit/decorators.js'\n\nimport { i18next, localize } from '@operato/i18n'\nimport { ApprovalLineItem } from '../types/approval-line'\nimport { OrgMemberTargetType } from '../types/org-member'\n\n@customElement('approval-line-brief')\nexport class ApprovalLineBrief extends localize(i18next)(LitElement) {\n static styles = [\n css`\n :host {\n display: block;\n }\n\n ol {\n list-style: none;\n margin: 0;\n padding: 0;\n display: flex;\n }\n\n li {\n position: relative;\n width: 85px;\n text-align: center;\n color: rgba(255, 255, 255, 0.7);\n }\n\n li div {\n text-align: center;\n white-space: nowrap;\n overflow: hidden;\n text-overflow: ellipsis;\n }\n\n span:before {\n content: '';\n height: 2px;\n width: 70px;\n display: block;\n position: absolute;\n margin-left: -70px;\n margin-top: 6px;\n background-color: rgba(0, 0, 0, 0.4);\n }\n\n span {\n display: block;\n width: 15px;\n height: 15px;\n margin: auto;\n background-color: rgba(0, 0, 0, 0.4);\n border-radius: 50%;\n color: var(--md-sys-color-on-primary);\n line-height: 1.2;\n }\n\n [past] span {\n background-color:
|
|
1
|
+
{"version":3,"file":"approval-line-brief.js","sourceRoot":"","sources":["../../client/component/approval-line-brief.ts"],"names":[],"mappings":";AAAA,OAAO,EAAE,GAAG,EAAE,IAAI,EAAE,UAAU,EAAkB,MAAM,KAAK,CAAA;AAC3D,OAAO,EAAE,aAAa,EAAE,QAAQ,EAAS,MAAM,mBAAmB,CAAA;AAElE,OAAO,EAAE,OAAO,EAAE,QAAQ,EAAE,MAAM,eAAe,CAAA;AAEjD,OAAO,EAAE,mBAAmB,EAAE,MAAM,qBAAqB,CAAA;AAGlD,IAAM,iBAAiB,GAAvB,MAAM,iBAAkB,SAAQ,QAAQ,CAAC,OAAO,CAAC,CAAC,UAAU,CAAC;IAA7D;;QA4EsB,UAAK,GAAuB,EAAE,CAAA;QAC7B,YAAO,GAAW,CAAC,CAAC,CAAA;IAiClD,CAAC;IA/BC,MAAM;QACJ,MAAM,KAAK,GAAG,IAAI,CAAC,KAAK,IAAI,EAAE,CAAA;QAC9B,MAAM,OAAO,GAAG,IAAI,CAAC,OAAO,CAAA;QAE5B,OAAO,IAAI,CAAA;;UAEL,IAAI,CAAC,KAAK;YACV,CAAC,CAAC,IAAI,CAAA,0BAA0B,IAAI,CAAC,OAAO,IAAI,CAAC,UAAU,IAAI,CAAC,OAAO,GAAG,CAAC,yBAAyB;YACpG,CAAC,CAAC,IAAI,CAAA,EAAE;UACR,KAAK,CAAC,GAAG,CAAC,CAAC,IAAI,EAAE,KAAK,EAAE,EAAE,CAAC,IAAI,CAAC,UAAU,CAAC,IAAI,EAAE,KAAK,GAAG,CAAC,CAAC,CAAC;;KAEjE,CAAA;IACH,CAAC;IAED,UAAU,CAAC,IAAsB,EAAE,KAAa;QAC9C,MAAM,EAAE,IAAI,EAAE,QAAQ,EAAE,GAAG,IAAI,CAAA;QAC/B,MAAM,EAAE,IAAI,EAAE,GAAG,QAAQ,IAAI;YAC3B,IAAI,EAAE,CAAC,mBAAmB,CAAC,MAAM,EAAE,mBAAmB,CAAC,YAAY,EAAE,mBAAmB,CAAC,YAAY,CAAC,CAAC,QAAQ,CAC7G,IAAK,CACN;gBACC,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,SAAS,IAAI,EAAE,CAAC;gBAC5B,CAAC,CAAC,EAAE;SACP,CAAA;QAED,OAAO,IAAI,CAAA;8BACe,IAAI,CAAC,OAAO,IAAI,KAAK,UAAU,IAAI,CAAC,OAAO,GAAG,KAAK,UAAU,IAAI,IAAI,EAAE;gBACrF,KAAK,GAAG,CAAC;eACV,IAAI;;KAEd,CAAA;IACH,CAAC;;AA5GM,wBAAM,GAAG;IACd,GAAG,CAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;KAuEF;CACF,AAzEY,CAyEZ;AAE0B;IAA1B,QAAQ,CAAC,EAAE,IAAI,EAAE,KAAK,EAAE,CAAC;;gDAA+B;AAC7B;IAA3B,QAAQ,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC;;kDAAqB;AA7ErC,iBAAiB;IAD7B,aAAa,CAAC,qBAAqB,CAAC;GACxB,iBAAiB,CA8G7B","sourcesContent":["import { css, html, LitElement, TemplateResult } from 'lit'\nimport { customElement, property, query } from 'lit/decorators.js'\n\nimport { i18next, localize } from '@operato/i18n'\nimport { ApprovalLineItem } from '../types/approval-line'\nimport { OrgMemberTargetType } from '../types/org-member'\n\n@customElement('approval-line-brief')\nexport class ApprovalLineBrief extends localize(i18next)(LitElement) {\n static styles = [\n css`\n :host {\n display: block;\n }\n\n ol {\n list-style: none;\n margin: 0;\n padding: 0;\n display: flex;\n }\n\n li {\n position: relative;\n width: 85px;\n text-align: center;\n color: rgba(255, 255, 255, 0.7);\n }\n\n li div {\n text-align: center;\n white-space: nowrap;\n overflow: hidden;\n text-overflow: ellipsis;\n }\n\n span:before {\n content: '';\n height: 2px;\n width: 70px;\n display: block;\n position: absolute;\n margin-left: -70px;\n margin-top: 6px;\n background-color: rgba(0, 0, 0, 0.4);\n }\n\n span {\n display: block;\n width: 15px;\n height: 15px;\n margin: auto;\n background-color: rgba(0, 0, 0, 0.4);\n border-radius: 50%;\n color: var(--md-sys-color-on-primary);\n line-height: 1.2;\n }\n\n [past] span {\n background-color: var(--md-sys-color-surface);\n color: var(--md-sys-color-on-surface);\n }\n\n [current] span {\n background-color: #84d600;\n color: var(--md-sys-color-on-primary);\n }\n\n [current] {\n font-weight: bold;\n color: var(--md-sys-color-on-primary);\n }\n\n [past] span:before,\n [current] span:before {\n background-color: rgba(255, 255, 255, 0.9);\n }\n\n li:first-child span:before {\n display: none;\n }\n `\n ]\n\n @property({ type: Array }) model: ApprovalLineItem[] = []\n @property({ type: Number }) current: number = -1\n\n render() {\n const items = this.model || []\n const current = this.current\n\n return html`\n <ol>\n ${this.model\n ? html` <li approver ?current=${this.current <= 0} ?past=${this.current > 0}><span>1</span>ME</li> `\n : html``}\n ${items.map((item, order) => this.renderItem(item, order + 1))}\n </ol>\n `\n }\n\n renderItem(item: ApprovalLineItem, order: number): TemplateResult {\n const { type, approver } = item\n const { name } = approver || {\n name: [OrgMemberTargetType.Myself, OrgMemberTargetType.MySupervisor, OrgMemberTargetType.MyDepartment].includes(\n type!\n )\n ? i18next.t(`label.${type}`)\n : ''\n }\n\n return html`\n <li approver ?current=${this.current == order} ?past=${this.current > order} title=${name || ''}>\n <span>${order + 1}</span>\n <div>${name}</div>\n </li>\n `\n }\n}\n"]}
|
|
@@ -12,7 +12,7 @@ export declare class ApprovalLineItemsEditorPopup extends ApprovalLineItemsEdito
|
|
|
12
12
|
confirmCallback?: (value?: ApprovalLineItem[] | null) => void;
|
|
13
13
|
editor: ApprovalLineItemsEditor;
|
|
14
14
|
private changedValue?;
|
|
15
|
-
render(): import("lit").TemplateResult<1>;
|
|
15
|
+
render(): import("lit-html").TemplateResult<1>;
|
|
16
16
|
firstUpdated(): void;
|
|
17
17
|
onEmpty(): Promise<void>;
|
|
18
18
|
onCancel(): void;
|
|
@@ -3,7 +3,7 @@ import '@material/web/icon/icon.js';
|
|
|
3
3
|
import { css, html, LitElement } from 'lit';
|
|
4
4
|
import { customElement, property, query } from 'lit/decorators.js';
|
|
5
5
|
import { i18next, localize } from '@operato/i18n';
|
|
6
|
-
import {
|
|
6
|
+
import { CommonHeaderStyles } from '@operato/styles';
|
|
7
7
|
import { closePopup } from '@operato/popup';
|
|
8
8
|
import { OxPrompt } from '@operato/popup/ox-prompt.js';
|
|
9
9
|
import { ApprovalLineItemsEditor } from './approval-line-items-editor';
|
|
@@ -25,13 +25,15 @@ let ApprovalLineItemsEditorPopup = class ApprovalLineItemsEditorPopup extends lo
|
|
|
25
25
|
}}
|
|
26
26
|
></approval-line-items-editor>
|
|
27
27
|
|
|
28
|
-
<div class="
|
|
28
|
+
<div class="footer">
|
|
29
29
|
<button @click=${this.onEmpty.bind(this)}>
|
|
30
30
|
<md-icon>check_box_outline_blank</md-icon>${i18next.t('button.empty')}
|
|
31
31
|
</button>
|
|
32
|
+
|
|
32
33
|
<div filler></div>
|
|
34
|
+
|
|
33
35
|
<button @click=${this.onCancel.bind(this)}><md-icon>cancel</md-icon>${i18next.t('button.cancel')}</button>
|
|
34
|
-
<button @click=${this.onConfirm.bind(this)}><md-icon>done</md-icon>${i18next.t('button.confirm')}</button>
|
|
36
|
+
<button @click=${this.onConfirm.bind(this)} done><md-icon>done</md-icon>${i18next.t('button.confirm')}</button>
|
|
35
37
|
</div>
|
|
36
38
|
`;
|
|
37
39
|
}
|
|
@@ -59,7 +61,7 @@ let ApprovalLineItemsEditorPopup = class ApprovalLineItemsEditorPopup extends lo
|
|
|
59
61
|
}
|
|
60
62
|
};
|
|
61
63
|
ApprovalLineItemsEditorPopup.styles = [
|
|
62
|
-
|
|
64
|
+
CommonHeaderStyles,
|
|
63
65
|
css `
|
|
64
66
|
:host {
|
|
65
67
|
display: flex;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"approval-line-items-editor-popup.js","sourceRoot":"","sources":["../../client/component/approval-line-items-editor-popup.ts"],"names":[],"mappings":";AAAA,OAAO,4BAA4B,CAAA;AACnC,OAAO,EAAE,GAAG,EAAE,IAAI,EAAE,UAAU,EAAE,MAAM,KAAK,CAAA;AAC3C,OAAO,EAAE,aAAa,EAAE,QAAQ,EAAE,KAAK,EAAS,MAAM,mBAAmB,CAAA;AAEzE,OAAO,EAAE,OAAO,EAAE,QAAQ,EAAE,MAAM,eAAe,CAAA;AACjD,OAAO,EAAE,
|
|
1
|
+
{"version":3,"file":"approval-line-items-editor-popup.js","sourceRoot":"","sources":["../../client/component/approval-line-items-editor-popup.ts"],"names":[],"mappings":";AAAA,OAAO,4BAA4B,CAAA;AACnC,OAAO,EAAE,GAAG,EAAE,IAAI,EAAE,UAAU,EAAE,MAAM,KAAK,CAAA;AAC3C,OAAO,EAAE,aAAa,EAAE,QAAQ,EAAE,KAAK,EAAS,MAAM,mBAAmB,CAAA;AAEzE,OAAO,EAAE,OAAO,EAAE,QAAQ,EAAE,MAAM,eAAe,CAAA;AACjD,OAAO,EAAE,kBAAkB,EAAE,MAAM,iBAAiB,CAAA;AACpD,OAAO,EAAE,UAAU,EAAE,MAAM,gBAAgB,CAAA;AAC3C,OAAO,EAAE,QAAQ,EAAE,MAAM,6BAA6B,CAAA;AAEtD,OAAO,EAAE,uBAAuB,EAAE,MAAM,8BAA8B,CAAA;AAGtE;;GAEG;AAEI,IAAM,4BAA4B,GAAlC,MAAM,4BAA6B,SAAQ,QAAQ,CAAC,OAAO,CAAC,CAAC,UAAU,CAAC;IAAxE;;QAsBL,wEAAwE;QAChE,iBAAY,GAAwB,IAAI,CAAC,KAAK,CAAA;IAmDxD,CAAC;IAjDC,MAAM;QACJ,OAAO,IAAI,CAAA;;iBAEE,IAAI,CAAC,KAAK;kBACT,CAAC,CAAc,EAAE,EAAE;YAC3B,IAAI,CAAC,YAAY,GAAG,CAAC,GAAG,CAAC,CAAC,MAAM,CAAC,CAAA;QACnC,CAAC;;;;yBAIgB,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,IAAI,CAAC;sDACM,OAAO,CAAC,CAAC,CAAC,cAAc,CAAC;;;;;yBAKtD,IAAI,CAAC,QAAQ,CAAC,IAAI,CAAC,IAAI,CAAC,6BAA6B,OAAO,CAAC,CAAC,CAAC,eAAe,CAAC;yBAC/E,IAAI,CAAC,SAAS,CAAC,IAAI,CAAC,IAAI,CAAC,gCAAgC,OAAO,CAAC,CAAC,CAAC,gBAAgB,CAAC;;KAExG,CAAA;IACH,CAAC;IAED,YAAY;QACV,IAAI,CAAC,YAAY,GAAG,IAAI,CAAC,KAAK,CAAA;IAChC,CAAC;IAED,KAAK,CAAC,OAAO;QACX,MAAM,QAAQ,GAAG,MAAM,QAAQ,CAAC,IAAI,CAAC;YACnC,KAAK,EAAE,OAAO,CAAC,CAAC,CAAC,mBAAmB,CAAC;YACrC,IAAI,EAAE,OAAO,CAAC,CAAC,CAAC,sCAAsC,CAAC;YACvD,aAAa,EAAE,EAAE,IAAI,EAAE,OAAO,CAAC,CAAC,CAAC,gBAAgB,CAAC,EAAE;YACpD,YAAY,EAAE,EAAE,IAAI,EAAE,OAAO,CAAC,CAAC,CAAC,eAAe,CAAC,EAAE;SACnD,CAAC,CAAA;QAEF,IAAI,QAAQ,EAAE,CAAC;YACb,IAAI,CAAC,eAAe,IAAI,IAAI,CAAC,eAAe,CAAC,IAAI,CAAC,CAAA;YAClD,UAAU,CAAC,IAAI,CAAC,CAAA;QAClB,CAAC;IACH,CAAC;IAED,QAAQ;QACN,UAAU,CAAC,IAAI,CAAC,CAAA;IAClB,CAAC;IAED,SAAS;QACP,IAAI,CAAC,eAAe,IAAI,IAAI,CAAC,eAAe,CAAC,IAAI,CAAC,YAAY,CAAC,CAAA;QAE/D,UAAU,CAAC,IAAI,CAAC,CAAA;IAClB,CAAC;;AAxEM,mCAAM,GAAG;IACd,kBAAkB;IAClB,GAAG,CAAA;;;;;;;;;;;KAWF;CACF,AAdY,CAcZ;AAE0B;IAA1B,QAAQ,CAAC,EAAE,IAAI,EAAE,KAAK,EAAE,CAAC;;2DAA2B;AAEzB;IAA3B,QAAQ,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC;;qEAA8D;AACpD;IAApC,KAAK,CAAC,4BAA4B,CAAC;8BAAU,uBAAuB;IAErE,wEAAwE;;4DAFH;AApB1D,4BAA4B;IADxC,aAAa,CAAC,kCAAkC,CAAC;GACrC,4BAA4B,CA0ExC","sourcesContent":["import '@material/web/icon/icon.js'\nimport { css, html, LitElement } from 'lit'\nimport { customElement, property, query, state } from 'lit/decorators.js'\n\nimport { i18next, localize } from '@operato/i18n'\nimport { CommonHeaderStyles } from '@operato/styles'\nimport { closePopup } from '@operato/popup'\nimport { OxPrompt } from '@operato/popup/ox-prompt.js'\n\nimport { ApprovalLineItemsEditor } from './approval-line-items-editor'\nimport { ApprovalLineItem } from '../types/approval-line'\n\n/**\n * 결재선의 각 결재자 리스트를 편집한다.\n */\n@customElement('approval-line-items-editor-popup')\nexport class ApprovalLineItemsEditorPopup extends localize(i18next)(LitElement) {\n static styles = [\n CommonHeaderStyles,\n css`\n :host {\n display: flex;\n flex-direction: column;\n\n background-color: var(--md-sys-color-surface);\n }\n\n approval-line-items-editor {\n flex: 1;\n }\n `\n ]\n\n @property({ type: Array }) value?: ApprovalLineItem[]\n\n @property({ type: Object }) confirmCallback?: (value?: ApprovalLineItem[] | null) => void\n @query('approval-line-items-editor') editor!: ApprovalLineItemsEditor\n\n /* this.value는 (원인불명으로) 값이 Reset되므로, 변화값을 유지하도록 별도로 changedValue를 사용함 */\n private changedValue?: ApprovalLineItem[] = this.value\n\n render() {\n return html`\n <approval-line-items-editor\n .value=${this.value}\n @change=${(e: CustomEvent) => {\n this.changedValue = [...e.detail]\n }}\n ></approval-line-items-editor>\n\n <div class=\"footer\">\n <button @click=${this.onEmpty.bind(this)}>\n <md-icon>check_box_outline_blank</md-icon>${i18next.t('button.empty')}\n </button>\n\n <div filler></div>\n\n <button @click=${this.onCancel.bind(this)}><md-icon>cancel</md-icon>${i18next.t('button.cancel')}</button>\n <button @click=${this.onConfirm.bind(this)} done><md-icon>done</md-icon>${i18next.t('button.confirm')}</button>\n </div>\n `\n }\n\n firstUpdated() {\n this.changedValue = this.value\n }\n\n async onEmpty() {\n const reaction = await OxPrompt.open({\n title: i18next.t('text.are_you_sure'),\n text: i18next.t('prompt.sure to empty approval line ?'),\n confirmButton: { text: i18next.t('button.confirm') },\n cancelButton: { text: i18next.t('button.cancel') }\n })\n\n if (reaction) {\n this.confirmCallback && this.confirmCallback(null)\n closePopup(this)\n }\n }\n\n onCancel() {\n closePopup(this)\n }\n\n onConfirm() {\n this.confirmCallback && this.confirmCallback(this.changedValue)\n\n closePopup(this)\n }\n}\n"]}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import './approval-line-view';
|
|
2
2
|
import './approval-line-selector';
|
|
3
3
|
import { LitElement } from 'lit';
|
|
4
|
-
import { DataGrist } from '@operato/data-grist';
|
|
4
|
+
import { DataGrist, FetchOption } from '@operato/data-grist';
|
|
5
5
|
import { ApprovalLineView } from './approval-line-view';
|
|
6
6
|
import { ApprovalLineItem } from '../types/approval-line';
|
|
7
7
|
declare const ApprovalLineItemsEditor_base: (new (...args: any[]) => LitElement) & typeof LitElement;
|
|
@@ -15,17 +15,12 @@ export declare class ApprovalLineItemsEditor extends ApprovalLineItemsEditor_bas
|
|
|
15
15
|
grist?: DataGrist;
|
|
16
16
|
view?: ApprovalLineView;
|
|
17
17
|
private popup?;
|
|
18
|
-
render(): import("lit").TemplateResult<1>;
|
|
18
|
+
render(): import("lit-html").TemplateResult<1>;
|
|
19
19
|
firstUpdated(): Promise<void>;
|
|
20
|
-
fetchHandler({ filters, page, limit, sortings }: {
|
|
21
|
-
filters: any;
|
|
22
|
-
page: any;
|
|
23
|
-
limit: any;
|
|
24
|
-
sortings?: never[] | undefined;
|
|
25
|
-
}): Promise<{
|
|
20
|
+
fetchHandler({ filters, page, limit, sortings }: FetchOption): {
|
|
26
21
|
total: number;
|
|
27
22
|
records: ApprovalLineItem[];
|
|
28
|
-
}
|
|
23
|
+
};
|
|
29
24
|
deleteDataItems(): Promise<void>;
|
|
30
25
|
openSelector(): void;
|
|
31
26
|
}
|
|
@@ -39,6 +39,7 @@ let ApprovalLineItemsEditor = class ApprovalLineItemsEditor extends localize(i18
|
|
|
39
39
|
<button @click=${this.openSelector.bind(this)}>
|
|
40
40
|
<md-icon>content_copy</md-icon>${i18next.t('button.copy from')}
|
|
41
41
|
</button>
|
|
42
|
+
|
|
42
43
|
<button danger @click=${() => this.deleteDataItems()}>
|
|
43
44
|
<md-icon>delete</md-icon>${i18next.t('button.delete')}
|
|
44
45
|
</button>
|
|
@@ -226,7 +227,7 @@ let ApprovalLineItemsEditor = class ApprovalLineItemsEditor extends localize(i18
|
|
|
226
227
|
sorters: []
|
|
227
228
|
};
|
|
228
229
|
}
|
|
229
|
-
|
|
230
|
+
fetchHandler({ filters, page, limit, sortings = [] }) {
|
|
230
231
|
const value = [...(this.value || [])];
|
|
231
232
|
this.value = value;
|
|
232
233
|
return {
|
|
@@ -283,10 +284,8 @@ ApprovalLineItemsEditor.styles = [
|
|
|
283
284
|
flex: 1;
|
|
284
285
|
}
|
|
285
286
|
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
justify-content: end;
|
|
289
|
-
padding: 10px;
|
|
287
|
+
.header {
|
|
288
|
+
grid-template-areas: 'filters actions';
|
|
290
289
|
}
|
|
291
290
|
`
|
|
292
291
|
];
|