nsgm-cli 2.1.12 → 2.1.14
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/README.md +369 -163
- package/client/components/Button.tsx +3 -5
- package/client/components/__tests__/Button.test.tsx +10 -10
- package/client/layout/index.tsx +149 -137
- package/client/redux/reducers.ts +1 -1
- package/client/redux/store.ts +2 -1
- package/client/redux/template/manage/actions.ts +77 -88
- package/client/redux/template/manage/reducers.ts +25 -37
- package/client/redux/template/manage/types.ts +1 -1
- package/client/service/template/manage.ts +20 -21
- package/client/styled/common.ts +12 -13
- package/client/styled/layout/index.ts +19 -19
- package/client/styled/template/manage.ts +14 -13
- package/client/utils/common.ts +23 -21
- package/client/utils/cookie.ts +18 -19
- package/client/utils/fetch.ts +64 -100
- package/client/utils/menu.tsx +16 -3
- package/client/utils/sso.ts +74 -84
- package/eslint.config.js +38 -1
- package/generation/README.md +25 -18
- package/generation/__tests__/example.test.js +41 -0
- package/generation/client/utils/menu.tsx +9 -2
- package/generation/env.example +3 -0
- package/generation/eslint.config.js +112 -0
- package/generation/gitignore +6 -1
- package/generation/jest.config.js +40 -0
- package/generation/package.json +25 -4
- package/jest.config.js +23 -6
- package/lib/args.js +9 -1
- package/lib/cli/app.d.ts +28 -0
- package/lib/cli/app.js +99 -0
- package/lib/cli/commands/build.d.ts +2 -0
- package/lib/cli/commands/build.js +29 -0
- package/lib/cli/commands/create.d.ts +2 -0
- package/lib/cli/commands/create.js +113 -0
- package/lib/cli/commands/delete.d.ts +3 -0
- package/lib/cli/commands/delete.js +151 -0
- package/lib/cli/commands/export.d.ts +2 -0
- package/lib/cli/commands/export.js +42 -0
- package/lib/cli/commands/help.d.ts +2 -0
- package/lib/cli/commands/help.js +42 -0
- package/lib/cli/commands/init.d.ts +2 -0
- package/lib/cli/commands/init.js +115 -0
- package/lib/cli/commands/server.d.ts +3 -0
- package/lib/cli/commands/server.js +26 -0
- package/lib/cli/commands/upgrade.d.ts +2 -0
- package/lib/cli/commands/upgrade.js +38 -0
- package/lib/cli/commands/version.d.ts +2 -0
- package/lib/cli/commands/version.js +24 -0
- package/lib/cli/index.d.ts +16 -0
- package/lib/cli/index.js +33 -0
- package/lib/cli/parser.d.ts +22 -0
- package/lib/cli/parser.js +115 -0
- package/lib/cli/registry.d.ts +33 -0
- package/lib/cli/registry.js +81 -0
- package/lib/cli/types/project.d.ts +10 -0
- package/lib/cli/types/project.js +2 -0
- package/lib/cli/types.d.ts +31 -0
- package/lib/cli/types.js +20 -0
- package/lib/cli/utils/console.d.ts +62 -0
- package/lib/cli/utils/console.js +148 -0
- package/lib/cli/utils/index.d.ts +2 -0
- package/lib/cli/utils/index.js +7 -0
- package/lib/cli/utils/prompt.d.ts +83 -0
- package/lib/cli/utils/prompt.js +368 -0
- package/lib/constants.d.ts +58 -0
- package/lib/constants.js +162 -0
- package/lib/generate.d.ts +25 -3
- package/lib/generate.js +97 -621
- package/lib/generate_create.d.ts +9 -0
- package/lib/generate_create.js +326 -0
- package/lib/generate_delete.d.ts +8 -0
- package/lib/generate_delete.js +156 -0
- package/lib/generate_init.d.ts +50 -0
- package/lib/generate_init.js +492 -0
- package/lib/generators/base-generator.d.ts +47 -0
- package/lib/generators/base-generator.js +92 -0
- package/lib/generators/generator-factory.d.ts +20 -0
- package/lib/generators/generator-factory.js +25 -0
- package/lib/generators/page-generator.d.ts +41 -0
- package/lib/generators/page-generator.js +552 -0
- package/lib/generators/resolver-generator.d.ts +12 -0
- package/lib/generators/resolver-generator.js +303 -0
- package/lib/generators/schema-generator.d.ts +7 -0
- package/lib/generators/schema-generator.js +57 -0
- package/lib/generators/service-generator.d.ts +7 -0
- package/lib/generators/service-generator.js +119 -0
- package/lib/generators/sql-generator.d.ts +8 -0
- package/lib/generators/sql-generator.js +52 -0
- package/lib/index.d.ts +1 -1
- package/lib/index.js +14 -193
- package/lib/server/csrf.js +9 -16
- package/lib/server/db.js +6 -7
- package/lib/server/graphql.js +5 -6
- package/lib/server/plugins/date.js +1 -1
- package/lib/server/utils/graphql-cache.js +3 -3
- package/lib/tsconfig.build.tsbuildinfo +1 -1
- package/lib/utils/project-config.d.ts +5 -0
- package/lib/utils/project-config.js +145 -0
- package/lib/utils.js +1 -1
- package/next.config.js +12 -8
- package/package.json +10 -7
- package/pages/_app.tsx +23 -28
- package/pages/_document.tsx +39 -19
- package/pages/index.tsx +84 -39
- package/pages/login.tsx +21 -21
- package/pages/template/manage.tsx +114 -89
- package/public/fonts/font-awesome.min.css +4 -0
- package/public/fonts/fontawesome-webfont.woff +0 -0
- package/public/fonts/fontawesome-webfont.woff2 +0 -0
- package/public/slbhealthcheck.html +1 -1
- package/server/apis/template.js +0 -2
- package/generation/eslintrc.js +0 -16
|
@@ -1,171 +1,160 @@
|
|
|
1
1
|
import * as types from './types'
|
|
2
|
-
import {
|
|
2
|
+
import {
|
|
3
|
+
getTemplateService,
|
|
4
|
+
addTemplateService,
|
|
5
|
+
updateTemplateService,
|
|
6
|
+
deleteTemplateService,
|
|
7
|
+
searchTemplateService,
|
|
8
|
+
batchDeleteTemplateService,
|
|
9
|
+
} from '@/service/template/manage'
|
|
3
10
|
import { AppDispatch } from '@/redux/store'
|
|
4
11
|
|
|
5
|
-
export const getTemplate =
|
|
6
|
-
|
|
7
|
-
) => {
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
12
|
+
export const getTemplate =
|
|
13
|
+
(page = 0, pageSize = 10) =>
|
|
14
|
+
(dispatch: AppDispatch) => {
|
|
15
|
+
dispatch({
|
|
16
|
+
type: types.GET_TEMPLATE,
|
|
17
|
+
})
|
|
11
18
|
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
}
|
|
19
|
+
getTemplateService(page, pageSize)
|
|
20
|
+
.then((res: any) => {
|
|
21
|
+
const { data } = res
|
|
22
|
+
dispatch({
|
|
23
|
+
type: types.GET_TEMPLATE_SUCCEEDED,
|
|
24
|
+
payload: {
|
|
25
|
+
template: data.template,
|
|
26
|
+
},
|
|
27
|
+
})
|
|
21
28
|
})
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
29
|
+
.catch(() => {
|
|
30
|
+
dispatch({
|
|
31
|
+
type: types.GET_TEMPLATE_FAILED,
|
|
32
|
+
})
|
|
26
33
|
})
|
|
27
|
-
|
|
28
|
-
}
|
|
34
|
+
}
|
|
29
35
|
|
|
30
|
-
export const searchTemplate =
|
|
31
|
-
|
|
32
|
-
) => {
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
+
export const searchTemplate =
|
|
37
|
+
(page = 0, pageSize = 10, data: any) =>
|
|
38
|
+
(dispatch: AppDispatch) => {
|
|
39
|
+
dispatch({
|
|
40
|
+
type: types.SEARCH_TEMPLATE,
|
|
41
|
+
})
|
|
36
42
|
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
}
|
|
43
|
+
searchTemplateService(page, pageSize, data)
|
|
44
|
+
.then((res: any) => {
|
|
45
|
+
const { data } = res
|
|
46
|
+
dispatch({
|
|
47
|
+
type: types.SEARCH_TEMPLATE_SUCCEEDED,
|
|
48
|
+
payload: {
|
|
49
|
+
template: data.templateSearch,
|
|
50
|
+
},
|
|
51
|
+
})
|
|
46
52
|
})
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
53
|
+
.catch(() => {
|
|
54
|
+
dispatch({
|
|
55
|
+
type: types.SEARCH_TEMPLATE_FAILED,
|
|
56
|
+
})
|
|
51
57
|
})
|
|
52
|
-
|
|
53
|
-
}
|
|
58
|
+
}
|
|
54
59
|
|
|
55
|
-
export const updateSSRTemplate = (template: any) => (
|
|
56
|
-
dispatch: AppDispatch
|
|
57
|
-
) => {
|
|
60
|
+
export const updateSSRTemplate = (template: any) => (dispatch: AppDispatch) => {
|
|
58
61
|
dispatch({
|
|
59
62
|
type: types.UPDATE_SSR_TEMPLATE,
|
|
60
63
|
payload: {
|
|
61
|
-
template: template
|
|
62
|
-
}
|
|
64
|
+
template: template,
|
|
65
|
+
},
|
|
63
66
|
})
|
|
64
67
|
}
|
|
65
68
|
|
|
66
|
-
export const addTemplate = (obj:any) => (
|
|
67
|
-
dispatch: AppDispatch
|
|
68
|
-
) => {
|
|
69
|
+
export const addTemplate = (obj: any) => (dispatch: AppDispatch) => {
|
|
69
70
|
dispatch({
|
|
70
|
-
type: types.ADD_TEMPLATE
|
|
71
|
+
type: types.ADD_TEMPLATE,
|
|
71
72
|
})
|
|
72
73
|
|
|
73
74
|
addTemplateService(obj)
|
|
74
75
|
.then((res: any) => {
|
|
75
|
-
//console.log('action_res', res)
|
|
76
76
|
const { data } = res
|
|
77
77
|
const template = {
|
|
78
78
|
id: data.templateAdd,
|
|
79
|
-
...obj
|
|
79
|
+
...obj,
|
|
80
80
|
}
|
|
81
81
|
dispatch({
|
|
82
82
|
type: types.ADD_TEMPLATE_SUCCEEDED,
|
|
83
83
|
payload: {
|
|
84
|
-
template
|
|
85
|
-
}
|
|
84
|
+
template,
|
|
85
|
+
},
|
|
86
86
|
})
|
|
87
87
|
})
|
|
88
88
|
.catch(() => {
|
|
89
89
|
dispatch({
|
|
90
|
-
type: types.ADD_TEMPLATE_FAILED
|
|
90
|
+
type: types.ADD_TEMPLATE_FAILED,
|
|
91
91
|
})
|
|
92
92
|
})
|
|
93
93
|
}
|
|
94
94
|
|
|
95
|
-
export const modTemplate = (id: number, obj: any) => (
|
|
96
|
-
dispatch: AppDispatch
|
|
97
|
-
) => {
|
|
95
|
+
export const modTemplate = (id: number, obj: any) => (dispatch: AppDispatch) => {
|
|
98
96
|
dispatch({
|
|
99
|
-
type: types.MOD_TEMPLATE
|
|
97
|
+
type: types.MOD_TEMPLATE,
|
|
100
98
|
})
|
|
101
99
|
|
|
102
100
|
updateTemplateService(id, obj)
|
|
103
|
-
.then((
|
|
104
|
-
console.log('action_res', res)
|
|
101
|
+
.then((_res: any) => {
|
|
105
102
|
const template = {
|
|
106
103
|
id,
|
|
107
|
-
...obj
|
|
104
|
+
...obj,
|
|
108
105
|
}
|
|
109
106
|
dispatch({
|
|
110
107
|
type: types.MOD_TEMPLATE_SUCCEEDED,
|
|
111
108
|
payload: {
|
|
112
|
-
template
|
|
113
|
-
}
|
|
109
|
+
template,
|
|
110
|
+
},
|
|
114
111
|
})
|
|
115
112
|
})
|
|
116
113
|
.catch(() => {
|
|
117
114
|
dispatch({
|
|
118
|
-
type: types.MOD_TEMPLATE_FAILED
|
|
115
|
+
type: types.MOD_TEMPLATE_FAILED,
|
|
119
116
|
})
|
|
120
117
|
})
|
|
121
118
|
}
|
|
122
119
|
|
|
123
|
-
export const delTemplate = (id: number) => (
|
|
124
|
-
dispatch: AppDispatch
|
|
125
|
-
) => {
|
|
120
|
+
export const delTemplate = (id: number) => (dispatch: AppDispatch) => {
|
|
126
121
|
dispatch({
|
|
127
|
-
type: types.DEL_TEMPLATE
|
|
122
|
+
type: types.DEL_TEMPLATE,
|
|
128
123
|
})
|
|
129
124
|
|
|
130
125
|
deleteTemplateService(id)
|
|
131
|
-
.then((
|
|
132
|
-
console.log('action_res', res)
|
|
133
|
-
|
|
126
|
+
.then((_res: any) => {
|
|
134
127
|
dispatch({
|
|
135
128
|
type: types.DEL_TEMPLATE_SUCCEEDED,
|
|
136
129
|
payload: {
|
|
137
|
-
id
|
|
138
|
-
}
|
|
130
|
+
id,
|
|
131
|
+
},
|
|
139
132
|
})
|
|
140
133
|
})
|
|
141
134
|
.catch(() => {
|
|
142
135
|
dispatch({
|
|
143
|
-
type: types.DEL_TEMPLATE_FAILED
|
|
136
|
+
type: types.DEL_TEMPLATE_FAILED,
|
|
144
137
|
})
|
|
145
138
|
})
|
|
146
139
|
}
|
|
147
140
|
|
|
148
|
-
export const batchDelTemplate = (ids:any) => (
|
|
149
|
-
dispatch: AppDispatch
|
|
150
|
-
) => {
|
|
141
|
+
export const batchDelTemplate = (ids: any) => (dispatch: AppDispatch) => {
|
|
151
142
|
dispatch({
|
|
152
|
-
type: types.BATCH_DEL_TEMPLATE
|
|
143
|
+
type: types.BATCH_DEL_TEMPLATE,
|
|
153
144
|
})
|
|
154
145
|
|
|
155
146
|
batchDeleteTemplateService(ids)
|
|
156
|
-
.then((
|
|
157
|
-
console.log('action_res', res)
|
|
158
|
-
|
|
147
|
+
.then((_res: any) => {
|
|
159
148
|
dispatch({
|
|
160
149
|
type: types.BATCH_DEL_TEMPLATE_SUCCEEDED,
|
|
161
150
|
payload: {
|
|
162
|
-
ids
|
|
163
|
-
}
|
|
151
|
+
ids,
|
|
152
|
+
},
|
|
164
153
|
})
|
|
165
154
|
})
|
|
166
155
|
.catch(() => {
|
|
167
156
|
dispatch({
|
|
168
|
-
type: types.BATCH_DEL_TEMPLATE_FAILED
|
|
157
|
+
type: types.BATCH_DEL_TEMPLATE_FAILED,
|
|
169
158
|
})
|
|
170
159
|
})
|
|
171
|
-
}
|
|
160
|
+
}
|
|
@@ -5,112 +5,100 @@ const initialState = {
|
|
|
5
5
|
firstLoadFlag: true,
|
|
6
6
|
template: {
|
|
7
7
|
totalCounts: 0,
|
|
8
|
-
items: []
|
|
9
|
-
}
|
|
8
|
+
items: [],
|
|
9
|
+
},
|
|
10
10
|
}
|
|
11
11
|
|
|
12
12
|
export const templateManageReducer = (state = initialState, { type, payload }) => {
|
|
13
13
|
const { template } = state
|
|
14
14
|
const { totalCounts, items } = template
|
|
15
|
-
let newItems:any = []
|
|
15
|
+
let newItems: any = []
|
|
16
16
|
|
|
17
17
|
switch (type) {
|
|
18
18
|
case types.UPDATE_SSR_TEMPLATE:
|
|
19
|
-
//console.log('reducer_payload_ssr', payload)
|
|
20
19
|
return {
|
|
21
20
|
...state,
|
|
22
21
|
firstLoadFlag: true,
|
|
23
|
-
template: payload.template
|
|
22
|
+
template: payload.template,
|
|
24
23
|
}
|
|
25
24
|
case types.GET_TEMPLATE_SUCCEEDED:
|
|
26
|
-
//console.log('reducer_payload_get', payload)
|
|
27
25
|
return {
|
|
28
26
|
...state,
|
|
29
27
|
firstLoadFlag: false,
|
|
30
|
-
template: payload.template
|
|
28
|
+
template: payload.template,
|
|
31
29
|
}
|
|
32
30
|
case types.SEARCH_TEMPLATE_SUCCEEDED:
|
|
33
|
-
console.log('reducer_payload_search', payload)
|
|
34
31
|
return {
|
|
35
32
|
...state,
|
|
36
33
|
firstLoadFlag: false,
|
|
37
|
-
template: payload.template
|
|
34
|
+
template: payload.template,
|
|
38
35
|
}
|
|
39
36
|
case types.ADD_TEMPLATE_SUCCEEDED:
|
|
40
|
-
//console.log('reducer_payload_add', payload)
|
|
41
37
|
newItems = [...items]
|
|
42
38
|
newItems.push(payload.template)
|
|
43
|
-
|
|
44
|
-
//console.log('newItems-add', newItems)
|
|
45
39
|
return {
|
|
46
40
|
...state,
|
|
47
41
|
firstLoadFlag: false,
|
|
48
42
|
template: {
|
|
49
43
|
totalCounts: totalCounts + 1,
|
|
50
|
-
items: newItems
|
|
51
|
-
}
|
|
44
|
+
items: newItems,
|
|
45
|
+
},
|
|
52
46
|
}
|
|
53
47
|
case types.MOD_TEMPLATE_SUCCEEDED:
|
|
54
|
-
//console.log('reducer_payload_mod', payload)
|
|
55
48
|
const modItem = payload.template
|
|
56
49
|
|
|
57
|
-
_.each(items, (item:any
|
|
50
|
+
_.each(items, (item: any) => {
|
|
58
51
|
if (item.id == modItem.id) {
|
|
59
52
|
newItems.push(modItem)
|
|
60
|
-
} else {
|
|
53
|
+
} else {
|
|
61
54
|
newItems.push(item)
|
|
62
55
|
}
|
|
63
56
|
})
|
|
64
|
-
|
|
65
|
-
//console.log('newItems-mod', newItems)
|
|
66
57
|
return {
|
|
67
58
|
...state,
|
|
68
59
|
firstLoadFlag: false,
|
|
69
60
|
template: {
|
|
70
61
|
totalCounts: totalCounts,
|
|
71
|
-
items: newItems
|
|
72
|
-
}
|
|
62
|
+
items: newItems,
|
|
63
|
+
},
|
|
73
64
|
}
|
|
74
65
|
case types.DEL_TEMPLATE_SUCCEEDED:
|
|
75
|
-
//console.log('reducer_payload_del', payload)
|
|
76
66
|
const delItemId = payload.id
|
|
77
67
|
|
|
78
|
-
_.each(items, (item:any
|
|
79
|
-
if (item.id != delItemId) {
|
|
68
|
+
_.each(items, (item: any) => {
|
|
69
|
+
if (item.id != delItemId) {
|
|
80
70
|
newItems.push(item)
|
|
81
71
|
}
|
|
82
72
|
})
|
|
83
73
|
|
|
84
|
-
//console.log('newItems-del', newItems)
|
|
85
74
|
return {
|
|
86
75
|
...state,
|
|
87
76
|
firstLoadFlag: false,
|
|
88
77
|
template: {
|
|
89
78
|
totalCounts: totalCounts - 1,
|
|
90
|
-
items: newItems
|
|
91
|
-
}
|
|
79
|
+
items: newItems,
|
|
80
|
+
},
|
|
92
81
|
}
|
|
93
82
|
case types.BATCH_DEL_TEMPLATE_SUCCEEDED:
|
|
94
83
|
const delItemIds = payload.ids
|
|
95
|
-
const allIds = _.map(
|
|
84
|
+
const allIds = _.map(
|
|
85
|
+
_.map(items, (item) => _.pick(item, ['id'])),
|
|
86
|
+
'id'
|
|
87
|
+
)
|
|
96
88
|
const diffIds = _.xor(allIds, delItemIds)
|
|
97
89
|
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
newItems = _.filter(items, (item:any) => _.includes(diffIds, item.id))
|
|
90
|
+
newItems = _.filter(items, (item: any) => _.includes(diffIds, item.id))
|
|
101
91
|
|
|
102
92
|
let newTotalCounts = totalCounts - delItemIds.length
|
|
103
|
-
if (newTotalCounts < 0)
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
console.log('newItems-batch-del', newItems, newTotalCounts)
|
|
93
|
+
if (newTotalCounts < 0) newTotalCounts = 0
|
|
94
|
+
|
|
107
95
|
return {
|
|
108
96
|
...state,
|
|
109
97
|
firstLoadFlag: false,
|
|
110
98
|
template: {
|
|
111
99
|
totalCounts: newTotalCounts,
|
|
112
|
-
items: newItems
|
|
113
|
-
}
|
|
100
|
+
items: newItems,
|
|
101
|
+
},
|
|
114
102
|
}
|
|
115
103
|
default:
|
|
116
104
|
return state
|
|
@@ -22,4 +22,4 @@ export const SEARCH_TEMPLATE_FAILED = 'SEARCH_TEMPLATE_FAILED'
|
|
|
22
22
|
|
|
23
23
|
export const BATCH_DEL_TEMPLATE = 'BATCH_DEL_TEMPLATE'
|
|
24
24
|
export const BATCH_DEL_TEMPLATE_SUCCEEDED = 'BATCH_DEL_TEMPLATE_SUCCEEDED'
|
|
25
|
-
export const BATCH_DEL_TEMPLATE_FAILED = 'BATCH_DEL_TEMPLATE_FAILED'
|
|
25
|
+
export const BATCH_DEL_TEMPLATE_FAILED = 'BATCH_DEL_TEMPLATE_FAILED'
|
|
@@ -11,20 +11,19 @@ export const getTemplateService = (page = 0, pageSize = 10) => {
|
|
|
11
11
|
|
|
12
12
|
return getLocalGraphql(getTemplateQuery, {
|
|
13
13
|
page,
|
|
14
|
-
pageSize
|
|
15
|
-
}
|
|
14
|
+
pageSize,
|
|
15
|
+
})
|
|
16
16
|
}
|
|
17
17
|
|
|
18
18
|
export const searchTemplateByIdService = (id: number) => {
|
|
19
|
-
|
|
20
19
|
const searchTemplateByIdQuery = `query ($id: Int) { templateGet(id: $id){
|
|
21
20
|
id name
|
|
22
21
|
}
|
|
23
22
|
}`
|
|
24
23
|
|
|
25
24
|
return getLocalGraphql(searchTemplateByIdQuery, {
|
|
26
|
-
id
|
|
27
|
-
}
|
|
25
|
+
id,
|
|
26
|
+
})
|
|
28
27
|
}
|
|
29
28
|
|
|
30
29
|
export const searchTemplateService = (page = 0, pageSize = 10, data: any) => {
|
|
@@ -42,9 +41,9 @@ export const searchTemplateService = (page = 0, pageSize = 10, data: any) => {
|
|
|
42
41
|
page,
|
|
43
42
|
pageSize,
|
|
44
43
|
data: {
|
|
45
|
-
name
|
|
46
|
-
}
|
|
47
|
-
}
|
|
44
|
+
name,
|
|
45
|
+
},
|
|
46
|
+
})
|
|
48
47
|
}
|
|
49
48
|
|
|
50
49
|
export const addTemplateService = (data: any) => {
|
|
@@ -54,9 +53,9 @@ export const addTemplateService = (data: any) => {
|
|
|
54
53
|
|
|
55
54
|
return getLocalGraphql(addTemplateQuery, {
|
|
56
55
|
data: {
|
|
57
|
-
name
|
|
58
|
-
}
|
|
59
|
-
}
|
|
56
|
+
name,
|
|
57
|
+
},
|
|
58
|
+
})
|
|
60
59
|
}
|
|
61
60
|
|
|
62
61
|
export const updateTemplateService = (id: number, data: any) => {
|
|
@@ -67,31 +66,31 @@ export const updateTemplateService = (id: number, data: any) => {
|
|
|
67
66
|
return getLocalGraphql(updateTemplateQuery, {
|
|
68
67
|
id,
|
|
69
68
|
data: {
|
|
70
|
-
name
|
|
71
|
-
}
|
|
72
|
-
}
|
|
69
|
+
name,
|
|
70
|
+
},
|
|
71
|
+
})
|
|
73
72
|
}
|
|
74
73
|
|
|
75
74
|
export const deleteTemplateService = (id: number) => {
|
|
76
75
|
const deleteTemplateQuery = `mutation ($id: Int) { templateDelete(id: $id) }`
|
|
77
76
|
|
|
78
77
|
return getLocalGraphql(deleteTemplateQuery, {
|
|
79
|
-
id
|
|
80
|
-
}
|
|
78
|
+
id,
|
|
79
|
+
})
|
|
81
80
|
}
|
|
82
81
|
|
|
83
82
|
export const batchAddTemplateService = (datas: any) => {
|
|
84
83
|
const batchAddTemplateQuery = `mutation ($datas: [TemplateAddInput]) { templateBatchAdd(datas: $datas) }`
|
|
85
84
|
|
|
86
85
|
return getLocalGraphql(batchAddTemplateQuery, {
|
|
87
|
-
datas
|
|
88
|
-
}
|
|
86
|
+
datas,
|
|
87
|
+
})
|
|
89
88
|
}
|
|
90
89
|
|
|
91
90
|
export const batchDeleteTemplateService = (ids: any) => {
|
|
92
91
|
const batchDeleteTemplateQuery = `mutation ($ids: [Int]) { templateBatchDelete(ids: $ids) }`
|
|
93
92
|
|
|
94
93
|
return getLocalGraphql(batchDeleteTemplateQuery, {
|
|
95
|
-
ids
|
|
96
|
-
}
|
|
97
|
-
}
|
|
94
|
+
ids,
|
|
95
|
+
})
|
|
96
|
+
}
|
package/client/styled/common.ts
CHANGED
|
@@ -18,18 +18,18 @@ export const Container = styled.div`
|
|
|
18
18
|
`
|
|
19
19
|
|
|
20
20
|
export const LoginContainer = styled.div`
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
21
|
+
margin: auto;
|
|
22
|
+
margin-top: 100px;
|
|
23
|
+
width: 350px;
|
|
24
|
+
display: flex;
|
|
25
|
+
flex-direction: column;
|
|
26
|
+
justify-content: center;
|
|
27
|
+
align-items: center;
|
|
28
|
+
border: 1px solid #e8e8e8;
|
|
29
|
+
border-radius: 8px;
|
|
30
|
+
padding: 30px;
|
|
31
|
+
box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
|
|
32
|
+
background-color: #fff;
|
|
33
33
|
|
|
34
34
|
.ant-form-item {
|
|
35
35
|
margin-bottom: 20px;
|
|
@@ -53,4 +53,3 @@ export const Loading = styled.div`
|
|
|
53
53
|
align-items: center;
|
|
54
54
|
margin-top: 100px;
|
|
55
55
|
`
|
|
56
|
-
|
|
@@ -32,13 +32,13 @@ export const Container = styled.div`
|
|
|
32
32
|
align-items: center;
|
|
33
33
|
margin-left: auto;
|
|
34
34
|
height: 100%;
|
|
35
|
-
|
|
35
|
+
|
|
36
36
|
.ant-space {
|
|
37
37
|
display: flex;
|
|
38
38
|
align-items: center;
|
|
39
39
|
height: 100%;
|
|
40
40
|
}
|
|
41
|
-
|
|
41
|
+
|
|
42
42
|
.action-icon {
|
|
43
43
|
color: rgba(255, 255, 255, 0.85);
|
|
44
44
|
font-size: 20px;
|
|
@@ -49,18 +49,18 @@ export const Container = styled.div`
|
|
|
49
49
|
justify-content: center;
|
|
50
50
|
height: 32px;
|
|
51
51
|
width: 32px;
|
|
52
|
-
|
|
52
|
+
|
|
53
53
|
&:hover {
|
|
54
54
|
color: #fff;
|
|
55
55
|
}
|
|
56
56
|
}
|
|
57
|
-
|
|
57
|
+
|
|
58
58
|
.user-dropdown {
|
|
59
59
|
cursor: pointer;
|
|
60
60
|
padding: 0 8px;
|
|
61
61
|
display: flex;
|
|
62
62
|
align-items: center;
|
|
63
|
-
|
|
63
|
+
|
|
64
64
|
.username {
|
|
65
65
|
color: rgba(255, 255, 255, 0.85);
|
|
66
66
|
margin-left: 8px;
|
|
@@ -68,56 +68,56 @@ export const Container = styled.div`
|
|
|
68
68
|
}
|
|
69
69
|
}
|
|
70
70
|
}
|
|
71
|
-
|
|
71
|
+
|
|
72
72
|
.sidebar {
|
|
73
73
|
box-shadow: 2px 0 8px 0 rgba(29, 35, 41, 0.05);
|
|
74
74
|
background: #f5f7fa;
|
|
75
75
|
border-right: 1px solid #ebeef5;
|
|
76
|
-
|
|
76
|
+
|
|
77
77
|
.side-menu {
|
|
78
78
|
border-right: none;
|
|
79
79
|
background: #f5f7fa;
|
|
80
|
-
|
|
80
|
+
|
|
81
81
|
.ant-menu-item {
|
|
82
82
|
margin: 0;
|
|
83
83
|
border-radius: 0;
|
|
84
|
-
|
|
84
|
+
|
|
85
85
|
&:hover {
|
|
86
86
|
background-color: #e6f7ff;
|
|
87
87
|
}
|
|
88
|
-
|
|
88
|
+
|
|
89
89
|
&.ant-menu-item-selected {
|
|
90
90
|
background-color: #e6f7ff;
|
|
91
91
|
border-right: 3px solid #1890ff;
|
|
92
92
|
font-weight: 500;
|
|
93
93
|
}
|
|
94
94
|
}
|
|
95
|
-
|
|
95
|
+
|
|
96
96
|
.ant-menu-submenu-title {
|
|
97
97
|
&:hover {
|
|
98
98
|
background-color: #e6f7ff;
|
|
99
99
|
}
|
|
100
100
|
}
|
|
101
|
-
|
|
101
|
+
|
|
102
102
|
.ant-menu-submenu-selected > .ant-menu-submenu-title {
|
|
103
103
|
color: #1890ff;
|
|
104
104
|
font-weight: 500;
|
|
105
105
|
}
|
|
106
106
|
}
|
|
107
107
|
}
|
|
108
|
-
|
|
108
|
+
|
|
109
109
|
.content-layout {
|
|
110
110
|
padding: 0 24px 24px;
|
|
111
111
|
display: flex;
|
|
112
112
|
flex-direction: column;
|
|
113
113
|
flex: 1;
|
|
114
114
|
height: 100%;
|
|
115
|
-
|
|
115
|
+
|
|
116
116
|
.breadcrumb-container {
|
|
117
117
|
margin: 16px 0;
|
|
118
118
|
font-size: 14px;
|
|
119
119
|
}
|
|
120
|
-
|
|
120
|
+
|
|
121
121
|
.content-container {
|
|
122
122
|
padding: 24px;
|
|
123
123
|
margin: 0;
|
|
@@ -130,19 +130,19 @@ export const Container = styled.div`
|
|
|
130
130
|
flex-direction: column;
|
|
131
131
|
}
|
|
132
132
|
}
|
|
133
|
-
|
|
133
|
+
|
|
134
134
|
.site-layout-background {
|
|
135
135
|
background: #fff;
|
|
136
136
|
}
|
|
137
|
-
|
|
137
|
+
|
|
138
138
|
.ant-layout-sider-trigger {
|
|
139
139
|
background: #e6f7ff;
|
|
140
140
|
color: #1890ff;
|
|
141
141
|
border-top: 1px solid #ebeef5;
|
|
142
142
|
border-right: 1px solid #ebeef5;
|
|
143
|
-
|
|
143
|
+
|
|
144
144
|
&:hover {
|
|
145
145
|
background: #bae7ff;
|
|
146
146
|
}
|
|
147
147
|
}
|
|
148
|
-
`
|
|
148
|
+
`
|