Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
A
ant-design-pro
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Service Desk
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Incidents
Environments
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
duanledexianxianxian
ant-design-pro
Commits
635e3620
Commit
635e3620
authored
Jun 29, 2018
by
ιεΈ
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add compilation script
parent
518094b1
Changes
4
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
9 additions
and
9 deletions
+9
-9
.gitignore
.gitignore
+1
-1
mock/api.js
mock/api.js
+3
-4
mock/rule.js
mock/rule.js
+4
-3
package.json
package.json
+1
-1
No files found.
.gitignore
View file @
635e3620
...
@@ -27,4 +27,4 @@ jsconfig.json
...
@@ -27,4 +27,4 @@ jsconfig.json
.history
.history
*.log
*.log
funtction/mock
functions/mock
\ No newline at end of file
\ No newline at end of file
mock/api.js
View file @
635e3620
...
@@ -127,8 +127,7 @@ export function getFakeList(req, res) {
...
@@ -127,8 +127,7 @@ export function getFakeList(req, res) {
export
function
postFakeList
(
req
,
res
)
{
export
function
postFakeList
(
req
,
res
)
{
const
{
/* url = '', */
body
}
=
req
;
const
{
/* url = '', */
body
}
=
req
;
// const params = getUrlParams(url);
// const params = getUrlParams(url);
const
{
method
,
id
,
...
restParams
}
=
body
;
const
{
method
,
id
}
=
body
;
// const count = (params.count * 1) || 20;
// const count = (params.count * 1) || 20;
let
result
=
sourceData
;
let
result
=
sourceData
;
...
@@ -139,13 +138,13 @@ export function postFakeList(req, res) {
...
@@ -139,13 +138,13 @@ export function postFakeList(req, res) {
case
'
update
'
:
case
'
update
'
:
result
.
forEach
((
item
,
i
)
=>
{
result
.
forEach
((
item
,
i
)
=>
{
if
(
item
.
id
===
id
)
{
if
(
item
.
id
===
id
)
{
result
[
i
]
=
Object
.
assign
(
item
,
restParams
);
result
[
i
]
=
Object
.
assign
(
item
,
body
);
}
}
});
});
break
;
break
;
case
'
post
'
:
case
'
post
'
:
result
.
unshift
({
result
.
unshift
({
...
restParams
,
body
,
id
:
`fake-list-
${
result
.
length
}
`
,
id
:
`fake-list-
${
result
.
length
}
`
,
createdAt
:
new
Date
().
getTime
(),
createdAt
:
new
Date
().
getTime
(),
});
});
...
...
mock/rule.js
View file @
635e3620
...
@@ -31,7 +31,7 @@ export function getRule(req, res, u) {
...
@@ -31,7 +31,7 @@ export function getRule(req, res, u) {
const
params
=
parse
(
url
,
true
).
query
;
const
params
=
parse
(
url
,
true
).
query
;
let
dataSource
=
[...
tableListDataSource
]
;
let
dataSource
=
tableListDataSource
;
if
(
params
.
sorter
)
{
if
(
params
.
sorter
)
{
const
s
=
params
.
sorter
.
split
(
'
_
'
);
const
s
=
params
.
sorter
.
split
(
'
_
'
);
...
@@ -48,7 +48,7 @@ export function getRule(req, res, u) {
...
@@ -48,7 +48,7 @@ export function getRule(req, res, u) {
let
filterDataSource
=
[];
let
filterDataSource
=
[];
status
.
forEach
(
s
=>
{
status
.
forEach
(
s
=>
{
filterDataSource
=
filterDataSource
.
concat
(
filterDataSource
=
filterDataSource
.
concat
(
[...
dataSource
]
.
filter
(
data
=>
parseInt
(
data
.
status
,
10
)
===
parseInt
(
s
[
0
],
10
))
dataSource
.
filter
(
data
=>
parseInt
(
data
.
status
,
10
)
===
parseInt
(
s
[
0
],
10
))
);
);
});
});
dataSource
=
filterDataSource
;
dataSource
=
filterDataSource
;
...
@@ -116,7 +116,8 @@ export function postRule(req, res, u, b) {
...
@@ -116,7 +116,8 @@ export function postRule(req, res, u, b) {
case
'
update
'
:
case
'
update
'
:
tableListDataSource
=
tableListDataSource
.
map
(
item
=>
{
tableListDataSource
=
tableListDataSource
.
map
(
item
=>
{
if
(
item
.
key
===
key
)
{
if
(
item
.
key
===
key
)
{
return
{
...
item
,
desc
,
name
};
Object
.
assign
(
item
,
{
desc
,
name
});
return
item
;
}
}
return
item
;
return
item
;
});
});
...
...
package.json
View file @
635e3620
...
@@ -9,7 +9,7 @@
...
@@ -9,7 +9,7 @@
"start"
:
"cross-env ESLINT=none roadhog dev"
,
"start"
:
"cross-env ESLINT=none roadhog dev"
,
"start:no-proxy"
:
"cross-env NO_PROXY=true ESLINT=none roadhog dev"
,
"start:no-proxy"
:
"cross-env NO_PROXY=true ESLINT=none roadhog dev"
,
"build"
:
"cross-env ESLINT=none roadhog build"
,
"build"
:
"cross-env ESLINT=none roadhog build"
,
"site"
:
"npm run build && firebase deploy"
,
"site"
:
"
rollup -c &&
npm run build && firebase deploy"
,
"analyze"
:
"cross-env ANALYZE=1 roadhog build"
,
"analyze"
:
"cross-env ANALYZE=1 roadhog build"
,
"lint:style"
:
"stylelint
\"
src/**/*.less
\"
--syntax less"
,
"lint:style"
:
"stylelint
\"
src/**/*.less
\"
--syntax less"
,
"lint"
:
"eslint --ext .js src mock tests && npm run lint:style"
,
"lint"
:
"eslint --ext .js src mock tests && npm run lint:style"
,
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment