nsgm-cli 2.1.13 → 2.1.15
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 +394 -156
- package/client/components/Button.tsx +3 -5
- package/client/components/ClientProviders.tsx +29 -0
- package/client/components/LanguageSwitcher.tsx +59 -0
- package/client/components/SSRSafeAntdProvider.tsx +24 -0
- package/client/components/SuppressHydrationWarnings.tsx +55 -0
- package/client/components/__tests__/Button.test.tsx +10 -10
- package/client/layout/index.tsx +153 -185
- 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 -14
- package/client/styled/layout/index.ts +234 -120
- package/client/styled/template/manage.ts +102 -14
- package/client/utils/common.ts +23 -21
- package/client/utils/cookie.ts +18 -19
- package/client/utils/fetch.ts +64 -100
- package/client/utils/i18n.ts +68 -0
- package/client/utils/menu.tsx +42 -23
- package/client/utils/navigation.ts +58 -0
- package/client/utils/sso.ts +74 -84
- package/client/utils/suppressWarnings.ts +32 -0
- package/eslint.config.js +53 -19
- package/generation/README.md +25 -6
- package/generation/__tests__/example.test.js +41 -0
- package/generation/client/redux/reducers.ts +1 -1
- package/generation/client/utils/menu.tsx +36 -23
- package/generation/env +3 -0
- 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/next.config.js +7 -3
- package/generation/package.json +28 -4
- package/generation/tsconfig.json +6 -19
- 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 +327 -0
- package/lib/constants.d.ts +65 -0
- package/lib/constants.js +177 -0
- package/lib/generate.d.ts +25 -3
- package/lib/generate.js +98 -621
- package/lib/generate_create.d.ts +9 -0
- package/lib/generate_create.js +329 -0
- package/lib/generate_delete.d.ts +8 -0
- package/lib/generate_delete.js +233 -0
- package/lib/generate_init.d.ts +56 -0
- package/lib/generate_init.js +612 -0
- package/lib/generators/base-generator.d.ts +47 -0
- package/lib/generators/base-generator.js +92 -0
- package/lib/generators/file-generator.d.ts +48 -0
- package/lib/generators/file-generator.js +455 -0
- package/lib/generators/generator-factory.d.ts +20 -0
- package/lib/generators/generator-factory.js +25 -0
- package/lib/generators/i18n-generator.d.ts +51 -0
- package/lib/generators/i18n-generator.js +320 -0
- package/lib/generators/page-generator.d.ts +45 -0
- package/lib/generators/page-generator.js +578 -0
- package/lib/generators/resolver-generator.d.ts +14 -0
- package/lib/generators/resolver-generator.js +342 -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 +11 -0
- package/lib/generators/service-generator.js +233 -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 -173
- 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-i18next.config.js +18 -0
- package/next.config.js +61 -18
- package/package.json +16 -8
- package/pages/_app.tsx +77 -33
- package/pages/_document.tsx +78 -21
- package/pages/_error.tsx +66 -0
- package/pages/index.tsx +109 -47
- package/pages/login.tsx +66 -41
- package/pages/template/manage.tsx +162 -151
- 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/locales/en-US/common.json +48 -0
- package/public/locales/en-US/home.json +57 -0
- package/public/locales/en-US/layout.json +22 -0
- package/public/locales/en-US/login.json +13 -0
- package/public/locales/en-US/template.json +42 -0
- package/public/locales/ja-JP/common.json +48 -0
- package/public/locales/ja-JP/home.json +57 -0
- package/public/locales/ja-JP/layout.json +22 -0
- package/public/locales/ja-JP/login.json +13 -0
- package/public/locales/ja-JP/template.json +42 -0
- package/public/locales/zh-CN/common.json +48 -0
- package/public/locales/zh-CN/home.json +57 -0
- package/public/locales/zh-CN/layout.json +22 -0
- package/public/locales/zh-CN/login.json +13 -0
- package/public/locales/zh-CN/template.json +42 -0
- package/public/slbhealthcheck.html +1 -1
- package/server/apis/template.js +0 -2
- package/server/utils/validation.js +163 -0
- package/types/i18next.d.ts +10 -0
- 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
|
@@ -3,7 +3,6 @@ import styled, { createGlobalStyle } from 'styled-components'
|
|
|
3
3
|
export const GlobalStyle = createGlobalStyle`
|
|
4
4
|
html,body,#__next {
|
|
5
5
|
height: 100%;
|
|
6
|
-
border: 1px solid white;
|
|
7
6
|
}
|
|
8
7
|
|
|
9
8
|
body {
|
|
@@ -18,18 +17,18 @@ export const Container = styled.div`
|
|
|
18
17
|
`
|
|
19
18
|
|
|
20
19
|
export const LoginContainer = styled.div`
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
20
|
+
margin: auto;
|
|
21
|
+
margin-top: 100px;
|
|
22
|
+
width: 350px;
|
|
23
|
+
display: flex;
|
|
24
|
+
flex-direction: column;
|
|
25
|
+
justify-content: center;
|
|
26
|
+
align-items: center;
|
|
27
|
+
border: 1px solid #e8e8e8;
|
|
28
|
+
border-radius: 8px;
|
|
29
|
+
padding: 30px;
|
|
30
|
+
box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
|
|
31
|
+
background-color: #fff;
|
|
33
32
|
|
|
34
33
|
.ant-form-item {
|
|
35
34
|
margin-bottom: 20px;
|
|
@@ -53,4 +52,3 @@ export const Loading = styled.div`
|
|
|
53
52
|
align-items: center;
|
|
54
53
|
margin-top: 100px;
|
|
55
54
|
`
|
|
56
|
-
|