@dssp/project 0.0.19 → 0.0.21

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@dssp/project",
3
- "version": "0.0.19",
3
+ "version": "0.0.21",
4
4
  "main": "dist-server/index.js",
5
5
  "browser": "dist-client/index.js",
6
6
  "things-factory": true,
@@ -27,7 +27,7 @@
27
27
  "migration:create": "node ../../node_modules/typeorm/cli.js migration:create -d ./server/migrations"
28
28
  },
29
29
  "dependencies": {
30
- "@dssp/building-complex": "^0.0.19",
30
+ "@dssp/building-complex": "^0.0.21",
31
31
  "@operato/graphql": "^8.0.0-alpha",
32
32
  "@operato/shell": "^8.0.0-alpha",
33
33
  "@things-factory/auth-base": "^8.0.0-alpha",
@@ -38,5 +38,5 @@
38
38
  "@things-factory/shell": "^8.0.0-alpha",
39
39
  "exceljs": "^4.4.0"
40
40
  },
41
- "gitHead": "a7d5da01e7a8920b9eb9c4f9340a4eb5ebdb12f9"
41
+ "gitHead": "2f7869190c368d6c5dfa5f8c64845e9e64de7dc9"
42
42
  }
@@ -11,7 +11,6 @@ export default {
11
11
  'project-setting-list', // 셋팅 리스트
12
12
  'project-update', // 프로젝트 정보 관리
13
13
  'project-plan-management', // 프로젝트 도면 관리
14
- 'manager-management', // 담당자 관리
15
14
  'worker-type-management', // 인력 관리
16
15
  'construction-type-management', // 공종 관리
17
16
  'inspection-drawing-type-management', // 도면 타입 및 검측 부위 관리
@@ -1,175 +0,0 @@
1
- import '@operato/data-grist'
2
-
3
- import { CommonButtonStyles, CommonGristStyles, ScrollbarStyles } from '@operato/styles'
4
- import { PageView } from '@operato/shell'
5
- import { css, html } from 'lit'
6
- import { customElement, property, query } from 'lit/decorators.js'
7
- import { DataGrist } from '@operato/data-grist'
8
- import { client } from '@operato/graphql'
9
- import { notify } from '@operato/layout'
10
- import gql from 'graphql-tag'
11
-
12
- @customElement('manager-management')
13
- export class ManagerManagement extends PageView {
14
- static styles = [
15
- ScrollbarStyles,
16
- CommonGristStyles,
17
- css`
18
- :host {
19
- display: flex;
20
- flex-direction: column;
21
-
22
- width: 100%;
23
-
24
- --grid-record-emphasized-background-color: red;
25
- --grid-record-emphasized-color: yellow;
26
- }
27
- `
28
- ]
29
-
30
- @property({ type: Object }) gristConfig: any
31
- @query('ox-grist') private grist!: DataGrist
32
-
33
- get context() {
34
- return {
35
- title: '담당자 관리',
36
- actions: [
37
- {
38
- title: '저장',
39
- action: this._updateManagers.bind(this),
40
- ...CommonButtonStyles.save
41
- }
42
- ]
43
- }
44
- }
45
-
46
- render() {
47
- return html`
48
- <ox-grist .mode=${'GRID'} .config=${this.gristConfig} .fetchHandler=${this.fetchHandler.bind(this)}> </ox-grist>
49
- `
50
- }
51
-
52
- async pageInitialized(lifecycle: any) {
53
- this.gristConfig = {
54
- columns: [
55
- { type: 'gutter', gutterName: 'sequence' },
56
- {
57
- type: 'string',
58
- name: 'name',
59
- header: '이름',
60
- record: {
61
- editable: true
62
- },
63
- width: 150
64
- },
65
- {
66
- type: 'string',
67
- name: 'phone',
68
- header: '휴대폰 번호',
69
- record: {
70
- editable: true
71
- },
72
- width: 150
73
- },
74
- {
75
- type: 'string',
76
- name: 'position',
77
- header: '직위',
78
- record: {
79
- editable: true
80
- },
81
- width: 150
82
- },
83
- {
84
- type: 'datetime',
85
- name: 'updatedAt',
86
- header: '수정 시간',
87
- record: {
88
- renderer: value => {
89
- const date = new Date(value + ' UTC')
90
-
91
- return new Intl.DateTimeFormat('ko-KR', {
92
- timeZone: 'Asia/Seoul',
93
- year: 'numeric',
94
- month: '2-digit',
95
- day: '2-digit',
96
- hour: '2-digit',
97
- minute: '2-digit',
98
- second: '2-digit'
99
- }).format(date)
100
- }
101
- },
102
- width: 200
103
- }
104
- ],
105
- rows: {
106
- appendable: false
107
- },
108
- sorters: [{ name: 'name' }],
109
- pagination: { infinite: true }
110
- }
111
- }
112
-
113
- async fetchHandler() {
114
- const response = await client.query({
115
- query: gql`
116
- query Managers {
117
- managers {
118
- id
119
- phone
120
- position
121
- userId
122
- name
123
- updatedAt
124
- }
125
- }
126
- `
127
- })
128
-
129
- console.log('response.data.managers :', response.data.managers)
130
-
131
- if (response.errors) return {}
132
-
133
- return {
134
- total: response.data.managers.length || 0,
135
- records: response.data.managers || []
136
- }
137
- }
138
-
139
- async _updateManagers() {
140
- let patches = this.grist.dirtyRecords
141
- if (patches && patches.length) {
142
- patches = patches.map(patch => {
143
- let patchField: any = patch.userId ? { userId: patch.userId } : {}
144
- if (patch.id) patchField['id'] = patch.id
145
-
146
- const dirtyFields = patch.__dirtyfields__
147
- for (let key in dirtyFields) {
148
- patchField[key] = dirtyFields[key].after
149
- }
150
-
151
- return patchField
152
- })
153
-
154
- const response = await client.mutate({
155
- mutation: gql`
156
- mutation UpdateMultipleManager($patches: [ManagerPatch!]!) {
157
- updateMultipleManager(patches: $patches) {
158
- id
159
- }
160
- }
161
- `,
162
- variables: {
163
- patches
164
- }
165
- })
166
-
167
- if (!response.errors) {
168
- this.grist.fetch()
169
- notify({ message: '저장되었습니다.' })
170
- } else {
171
- notify({ message: '저장에 실패하였습니다.', level: 'error' })
172
- }
173
- }
174
- }
175
- }
@@ -1,31 +0,0 @@
1
- import '@operato/data-grist';
2
- import { PageView } from '@operato/shell';
3
- export declare class ManagerManagement extends PageView {
4
- static styles: import("lit").CSSResult[];
5
- gristConfig: any;
6
- private grist;
7
- get context(): {
8
- title: string;
9
- actions: {
10
- icon: string;
11
- emphasis: {
12
- raised: boolean;
13
- outlined: boolean;
14
- dense: boolean;
15
- danger: boolean;
16
- };
17
- title: string;
18
- action: () => Promise<void>;
19
- }[];
20
- };
21
- render(): import("lit-html").TemplateResult<1>;
22
- pageInitialized(lifecycle: any): Promise<void>;
23
- fetchHandler(): Promise<{
24
- total?: undefined;
25
- records?: undefined;
26
- } | {
27
- total: any;
28
- records: any;
29
- }>;
30
- _updateManagers(): Promise<void>;
31
- }
@@ -1,169 +0,0 @@
1
- import { __decorate, __metadata } from "tslib";
2
- import '@operato/data-grist';
3
- import { CommonButtonStyles, CommonGristStyles, ScrollbarStyles } from '@operato/styles';
4
- import { PageView } from '@operato/shell';
5
- import { css, html } from 'lit';
6
- import { customElement, property, query } from 'lit/decorators.js';
7
- import { DataGrist } from '@operato/data-grist';
8
- import { client } from '@operato/graphql';
9
- import { notify } from '@operato/layout';
10
- import gql from 'graphql-tag';
11
- let ManagerManagement = class ManagerManagement extends PageView {
12
- get context() {
13
- return {
14
- title: '담당자 관리',
15
- actions: [
16
- Object.assign({ title: '저장', action: this._updateManagers.bind(this) }, CommonButtonStyles.save)
17
- ]
18
- };
19
- }
20
- render() {
21
- return html `
22
- <ox-grist .mode=${'GRID'} .config=${this.gristConfig} .fetchHandler=${this.fetchHandler.bind(this)}> </ox-grist>
23
- `;
24
- }
25
- async pageInitialized(lifecycle) {
26
- this.gristConfig = {
27
- columns: [
28
- { type: 'gutter', gutterName: 'sequence' },
29
- {
30
- type: 'string',
31
- name: 'name',
32
- header: '이름',
33
- record: {
34
- editable: true
35
- },
36
- width: 150
37
- },
38
- {
39
- type: 'string',
40
- name: 'phone',
41
- header: '휴대폰 번호',
42
- record: {
43
- editable: true
44
- },
45
- width: 150
46
- },
47
- {
48
- type: 'string',
49
- name: 'position',
50
- header: '직위',
51
- record: {
52
- editable: true
53
- },
54
- width: 150
55
- },
56
- {
57
- type: 'datetime',
58
- name: 'updatedAt',
59
- header: '수정 시간',
60
- record: {
61
- renderer: value => {
62
- const date = new Date(value + ' UTC');
63
- return new Intl.DateTimeFormat('ko-KR', {
64
- timeZone: 'Asia/Seoul',
65
- year: 'numeric',
66
- month: '2-digit',
67
- day: '2-digit',
68
- hour: '2-digit',
69
- minute: '2-digit',
70
- second: '2-digit'
71
- }).format(date);
72
- }
73
- },
74
- width: 200
75
- }
76
- ],
77
- rows: {
78
- appendable: false
79
- },
80
- sorters: [{ name: 'name' }],
81
- pagination: { infinite: true }
82
- };
83
- }
84
- async fetchHandler() {
85
- const response = await client.query({
86
- query: gql `
87
- query Managers {
88
- managers {
89
- id
90
- phone
91
- position
92
- userId
93
- name
94
- updatedAt
95
- }
96
- }
97
- `
98
- });
99
- console.log('response.data.managers :', response.data.managers);
100
- if (response.errors)
101
- return {};
102
- return {
103
- total: response.data.managers.length || 0,
104
- records: response.data.managers || []
105
- };
106
- }
107
- async _updateManagers() {
108
- let patches = this.grist.dirtyRecords;
109
- if (patches && patches.length) {
110
- patches = patches.map(patch => {
111
- let patchField = patch.userId ? { userId: patch.userId } : {};
112
- if (patch.id)
113
- patchField['id'] = patch.id;
114
- const dirtyFields = patch.__dirtyfields__;
115
- for (let key in dirtyFields) {
116
- patchField[key] = dirtyFields[key].after;
117
- }
118
- return patchField;
119
- });
120
- const response = await client.mutate({
121
- mutation: gql `
122
- mutation UpdateMultipleManager($patches: [ManagerPatch!]!) {
123
- updateMultipleManager(patches: $patches) {
124
- id
125
- }
126
- }
127
- `,
128
- variables: {
129
- patches
130
- }
131
- });
132
- if (!response.errors) {
133
- this.grist.fetch();
134
- notify({ message: '저장되었습니다.' });
135
- }
136
- else {
137
- notify({ message: '저장에 실패하였습니다.', level: 'error' });
138
- }
139
- }
140
- }
141
- };
142
- ManagerManagement.styles = [
143
- ScrollbarStyles,
144
- CommonGristStyles,
145
- css `
146
- :host {
147
- display: flex;
148
- flex-direction: column;
149
-
150
- width: 100%;
151
-
152
- --grid-record-emphasized-background-color: red;
153
- --grid-record-emphasized-color: yellow;
154
- }
155
- `
156
- ];
157
- __decorate([
158
- property({ type: Object }),
159
- __metadata("design:type", Object)
160
- ], ManagerManagement.prototype, "gristConfig", void 0);
161
- __decorate([
162
- query('ox-grist'),
163
- __metadata("design:type", DataGrist)
164
- ], ManagerManagement.prototype, "grist", void 0);
165
- ManagerManagement = __decorate([
166
- customElement('manager-management')
167
- ], ManagerManagement);
168
- export { ManagerManagement };
169
- //# sourceMappingURL=manager-management.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"manager-management.js","sourceRoot":"","sources":["../../../client/pages/resource/manager-management.ts"],"names":[],"mappings":";AAAA,OAAO,qBAAqB,CAAA;AAE5B,OAAO,EAAE,kBAAkB,EAAE,iBAAiB,EAAE,eAAe,EAAE,MAAM,iBAAiB,CAAA;AACxF,OAAO,EAAE,QAAQ,EAAE,MAAM,gBAAgB,CAAA;AACzC,OAAO,EAAE,GAAG,EAAE,IAAI,EAAE,MAAM,KAAK,CAAA;AAC/B,OAAO,EAAE,aAAa,EAAE,QAAQ,EAAE,KAAK,EAAE,MAAM,mBAAmB,CAAA;AAClE,OAAO,EAAE,SAAS,EAAE,MAAM,qBAAqB,CAAA;AAC/C,OAAO,EAAE,MAAM,EAAE,MAAM,kBAAkB,CAAA;AACzC,OAAO,EAAE,MAAM,EAAE,MAAM,iBAAiB,CAAA;AACxC,OAAO,GAAG,MAAM,aAAa,CAAA;AAGtB,IAAM,iBAAiB,GAAvB,MAAM,iBAAkB,SAAQ,QAAQ;IAoB7C,IAAI,OAAO;QACT,OAAO;YACL,KAAK,EAAE,QAAQ;YACf,OAAO,EAAE;gCAEL,KAAK,EAAE,IAAI,EACX,MAAM,EAAE,IAAI,CAAC,eAAe,CAAC,IAAI,CAAC,IAAI,CAAC,IACpC,kBAAkB,CAAC,IAAI;aAE7B;SACF,CAAA;IACH,CAAC;IAED,MAAM;QACJ,OAAO,IAAI,CAAA;wBACS,MAAM,YAAY,IAAI,CAAC,WAAW,kBAAkB,IAAI,CAAC,YAAY,CAAC,IAAI,CAAC,IAAI,CAAC;KACnG,CAAA;IACH,CAAC;IAED,KAAK,CAAC,eAAe,CAAC,SAAc;QAClC,IAAI,CAAC,WAAW,GAAG;YACjB,OAAO,EAAE;gBACP,EAAE,IAAI,EAAE,QAAQ,EAAE,UAAU,EAAE,UAAU,EAAE;gBAC1C;oBACE,IAAI,EAAE,QAAQ;oBACd,IAAI,EAAE,MAAM;oBACZ,MAAM,EAAE,IAAI;oBACZ,MAAM,EAAE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AA;gBAClB,MAAM,CAAC,EAAE,OAAO,EAAE,UAAU,EAAE,CAAC,CAAA;aAChC;iBAAM;gBACL,MAAM,CAAC,EAAE,OAAO,EAAE,cAAc,EAAE,KAAK,EAAE,OAAO,EAAE,CAAC,CAAA;aACpD;SACF;IACH,CAAC;;AAhKM,wBAAM,GAAG;IACd,eAAe;IACf,iBAAiB;IACjB,GAAG,CAAA;;;;;;;;;;KAUF;CACF,CAAA;AAED;IAAC,QAAQ,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC;;sDAAiB;AAC5C;IAAC,KAAK,CAAC,UAAU,CAAC;8BAAiB,SAAS;gDAAA;AAlBjC,iBAAiB;IAD7B,aAAa,CAAC,oBAAoB,CAAC;GACvB,iBAAiB,CAkK7B;SAlKY,iBAAiB","sourcesContent":["import '@operato/data-grist'\n\nimport { CommonButtonStyles, CommonGristStyles, ScrollbarStyles } from '@operato/styles'\nimport { PageView } from '@operato/shell'\nimport { css, html } from 'lit'\nimport { customElement, property, query } from 'lit/decorators.js'\nimport { DataGrist } from '@operato/data-grist'\nimport { client } from '@operato/graphql'\nimport { notify } from '@operato/layout'\nimport gql from 'graphql-tag'\n\n@customElement('manager-management')\nexport class ManagerManagement extends PageView {\n static styles = [\n ScrollbarStyles,\n CommonGristStyles,\n css`\n :host {\n display: flex;\n flex-direction: column;\n\n width: 100%;\n\n --grid-record-emphasized-background-color: red;\n --grid-record-emphasized-color: yellow;\n }\n `\n ]\n\n @property({ type: Object }) gristConfig: any\n @query('ox-grist') private grist!: DataGrist\n\n get context() {\n return {\n title: '담당자 관리',\n actions: [\n {\n title: '저장',\n action: this._updateManagers.bind(this),\n ...CommonButtonStyles.save\n }\n ]\n }\n }\n\n render() {\n return html`\n <ox-grist .mode=${'GRID'} .config=${this.gristConfig} .fetchHandler=${this.fetchHandler.bind(this)}> </ox-grist>\n `\n }\n\n async pageInitialized(lifecycle: any) {\n this.gristConfig = {\n columns: [\n { type: 'gutter', gutterName: 'sequence' },\n {\n type: 'string',\n name: 'name',\n header: '이름',\n record: {\n editable: true\n },\n width: 150\n },\n {\n type: 'string',\n name: 'phone',\n header: '휴대폰 번호',\n record: {\n editable: true\n },\n width: 150\n },\n {\n type: 'string',\n name: 'position',\n header: '직위',\n record: {\n editable: true\n },\n width: 150\n },\n {\n type: 'datetime',\n name: 'updatedAt',\n header: '수정 시간',\n record: {\n renderer: value => {\n const date = new Date(value + ' UTC')\n\n return new Intl.DateTimeFormat('ko-KR', {\n timeZone: 'Asia/Seoul',\n year: 'numeric',\n month: '2-digit',\n day: '2-digit',\n hour: '2-digit',\n minute: '2-digit',\n second: '2-digit'\n }).format(date)\n }\n },\n width: 200\n }\n ],\n rows: {\n appendable: false\n },\n sorters: [{ name: 'name' }],\n pagination: { infinite: true }\n }\n }\n\n async fetchHandler() {\n const response = await client.query({\n query: gql`\n query Managers {\n managers {\n id\n phone\n position\n userId\n name\n updatedAt\n }\n }\n `\n })\n\n console.log('response.data.managers :', response.data.managers)\n\n if (response.errors) return {}\n\n return {\n total: response.data.managers.length || 0,\n records: response.data.managers || []\n }\n }\n\n async _updateManagers() {\n let patches = this.grist.dirtyRecords\n if (patches && patches.length) {\n patches = patches.map(patch => {\n let patchField: any = patch.userId ? { userId: patch.userId } : {}\n if (patch.id) patchField['id'] = patch.id\n\n const dirtyFields = patch.__dirtyfields__\n for (let key in dirtyFields) {\n patchField[key] = dirtyFields[key].after\n }\n\n return patchField\n })\n\n const response = await client.mutate({\n mutation: gql`\n mutation UpdateMultipleManager($patches: [ManagerPatch!]!) {\n updateMultipleManager(patches: $patches) {\n id\n }\n }\n `,\n variables: {\n patches\n }\n })\n\n if (!response.errors) {\n this.grist.fetch()\n notify({ message: '저장되었습니다.' })\n } else {\n notify({ message: '저장에 실패하였습니다.', level: 'error' })\n }\n }\n }\n}\n"]}