Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
J
jinfa-admin
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
shenshaokai
jinfa-admin
Commits
26ca46f9
Commit
26ca46f9
authored
Oct 23, 2020
by
XieZhiXiong
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'dev' into test
parents
4fe5bee9
b215bcda
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
87 additions
and
36 deletions
+87
-36
constants.ts
src/pages/comment/constants.ts
+4
-0
index.tsx
src/pages/comment/manage/index.tsx
+61
-6
index.tsx
src/pages/comment/query/index.tsx
+19
-28
index.tsx
src/pages/comment/query/schema/index.tsx
+3
-2
No files found.
src/pages/comment/constants.ts
0 → 100644
View file @
26ca46f9
// 评论状态
export
const
COMMENT_STATUS_VISIBLE
=
1
;
// 可见的
export
const
COMMENT_STATUS_INVISIBLE
=
2
;
// 被屏蔽的
\ No newline at end of file
src/pages/comment/manage/index.tsx
View file @
26ca46f9
import
React
,
{
useState
,
useRef
}
from
'react'
;
import
React
,
{
useState
,
useRef
}
from
'react'
;
import
{
Card
,
Rate
,
Button
,
Space
}
from
'antd'
;
import
{
Card
,
Rate
,
Button
,
Space
,
Modal
,
message
}
from
'antd'
;
import
{
ClockCircleOutlined
}
from
'@ant-design/icons'
;
import
{
ClockCircleOutlined
,
QuestionCircleOutlined
}
from
'@ant-design/icons'
;
import
{
Link
}
from
'umi'
;
import
{
Link
}
from
'umi'
;
import
{
StandardTable
}
from
'god'
;
import
{
StandardTable
}
from
'god'
;
import
{
ColumnType
}
from
'antd/lib/table/interface'
;
import
{
ColumnType
}
from
'antd/lib/table/interface'
;
...
@@ -14,14 +14,34 @@ import { isJSONStr } from '@/utils';
...
@@ -14,14 +14,34 @@ import { isJSONStr } from '@/utils';
import
EyePreview
from
'@/components/EyePreview'
;
import
EyePreview
from
'@/components/EyePreview'
;
import
NiceForm
from
'@/components/NiceForm'
;
import
NiceForm
from
'@/components/NiceForm'
;
import
{
listSearchSchema
}
from
'./schema'
;
import
{
listSearchSchema
}
from
'./schema'
;
import
{
COMMENT_STATUS_VISIBLE
,
COMMENT_STATUS_INVISIBLE
}
from
'../constants'
;
import
styles
from
'./index.less'
;
import
styles
from
'./index.less'
;
const
{
confirm
}
=
Modal
;
const
formActions
=
createFormActions
();
const
formActions
=
createFormActions
();
const
CommentManage
:
React
.
FC
=
()
=>
{
const
CommentManage
:
React
.
FC
=
()
=>
{
const
ref
=
useRef
<
any
>
({});
const
ref
=
useRef
<
any
>
({});
const
[
selectedRowKeys
,
setSelectedRowKeys
]
=
useState
<
Array
<
string
>>
([]);
const
[
selectedRowKeys
,
setSelectedRowKeys
]
=
useState
<
Array
<
number
>>
([]);
const
handleVisibleComment
=
(
status
,
id
)
=>
{
const
msg
=
message
.
loading
({
content
:
'正在操作,请稍候...'
,
duration
:
0
,
});
PublicApi
.
postMemberPlatformCommentOrderTradeHistoryUpdateStatus
({
id
,
status
,
}).
then
(
res
=>
{
if
(
res
.
code
===
1000
)
{
ref
.
current
.
reload
();
}
}).
finally
(()
=>
{
msg
();
});
};
const
columns
:
ColumnType
<
any
>
[]
=
[
const
columns
:
ColumnType
<
any
>
[]
=
[
{
{
...
@@ -82,7 +102,7 @@ const CommentManage: React.FC = () => {
...
@@ -82,7 +102,7 @@ const CommentManage: React.FC = () => {
},
},
{
{
title
:
'评价时间'
,
title
:
'评价时间'
,
dataIndex
:
'create
d
'
,
dataIndex
:
'create
Time
'
,
align
:
'center'
,
align
:
'center'
,
},
},
{
{
...
@@ -91,7 +111,12 @@ const CommentManage: React.FC = () => {
...
@@ -91,7 +111,12 @@ const CommentManage: React.FC = () => {
align
:
'center'
,
align
:
'center'
,
render
:
(
_
,
record
)
=>
(
render
:
(
_
,
record
)
=>
(
<>
<>
<
Button
type=
"link"
>
屏蔽
</
Button
>
<
Button
type=
"link"
onClick=
{
()
=>
handleVisibleComment
((
record
.
status
===
COMMENT_STATUS_VISIBLE
||
!
record
.
status
)
?
COMMENT_STATUS_INVISIBLE
:
COMMENT_STATUS_VISIBLE
,
record
.
id
)
}
>
{
(
record
.
status
===
COMMENT_STATUS_VISIBLE
||
!
record
.
status
)
?
'屏蔽'
:
'已屏蔽'
}
</
Button
>
</>
</>
),
),
},
},
...
@@ -124,9 +149,39 @@ const CommentManage: React.FC = () => {
...
@@ -124,9 +149,39 @@ const CommentManage: React.FC = () => {
return
{};
return
{};
};
};
const
handleBatchDelete
=
()
=>
{
if
(
!
selectedRowKeys
.
length
)
{
message
.
warning
(
'未选择任何评论'
);
return
;
}
confirm
({
title
:
'提示'
,
icon
:
<
QuestionCircleOutlined
/>,
content
:
'确定要删除选中的评论吗?'
,
onOk
()
{
return
new
Promise
((
resolve
,
reject
)
=>
{
PublicApi
.
postMemberPlatformCommentOrderTradeHistoryDelete
({
ids
:
selectedRowKeys
,
})
.
then
(
res
=>
{
if
(
res
.
code
===
1000
)
{
ref
.
current
.
reload
();
setSelectedRowKeys
([]);
resolve
();
}
reject
();
})
.
catch
(()
=>
{
reject
();
});
});
},
});
};
const
controllerBtns
=
(
const
controllerBtns
=
(
<
Space
>
<
Space
>
<
Button
>
批量删除
</
Button
>
<
Button
onClick=
{
handleBatchDelete
}
>
批量删除
</
Button
>
</
Space
>
</
Space
>
);
);
...
...
src/pages/comment/query/index.tsx
View file @
26ca46f9
...
@@ -16,31 +16,6 @@ import styles from './index.less';
...
@@ -16,31 +16,6 @@ import styles from './index.less';
const
formActions
=
createFormActions
();
const
formActions
=
createFormActions
();
const
mock
=
[
{
id
:
'1'
,
memberName
:
'JUJUONTHEBEAT'
,
memberType
:
'企业会员'
,
memberRole
:
'采购商'
,
memberLevel
:
'白金会员'
,
satisfaction
:
4
,
count
:
180
,
day7
:
10
,
day180
:
20
,
},
{
id
:
'2'
,
memberName
:
'JUJUONTHEBEAT'
,
memberType
:
'企业会员'
,
memberRole
:
'采购商'
,
memberLevel
:
'白金会员'
,
satisfaction
:
3
,
count
:
180
,
day7
:
10
,
day180
:
20
,
},
];
const
CommentQuery
=
()
=>
{
const
CommentQuery
=
()
=>
{
const
ref
=
useRef
<
any
>
({});
const
ref
=
useRef
<
any
>
({});
...
@@ -116,7 +91,23 @@ const CommentQuery = () => {
...
@@ -116,7 +91,23 @@ const CommentQuery = () => {
};
};
// 初始化高级筛选选项
// 初始化高级筛选选项
const
fetchSelectOptions
=
async
()
=>
{
const
fetchSearchItems
=
async
()
=>
{
const
res
=
await
PublicApi
.
getMemberManagePageitems
();
if
(
res
.
code
===
1000
)
{
const
{
data
=
{}
}:
any
=
res
;
const
{
memberTypes
=
[],
roles
=
[],
levels
=
[],
}
=
data
;
return
{
memberTypeId
:
memberTypes
.
map
(
item
=>
({
label
:
item
.
memberTypeName
,
value
:
item
.
memberTypeId
})),
roleId
:
roles
.
map
(
item
=>
({
label
:
item
.
roleName
,
value
:
item
.
roleId
})),
level
:
levels
.
map
(
item
=>
({
label
:
item
.
levelTag
,
value
:
item
.
level
})),
};
}
return
{};
return
{};
};
};
...
@@ -141,8 +132,8 @@ const CommentQuery = () => {
...
@@ -141,8 +132,8 @@ const CommentQuery = () => {
FORM_FILTER_PATH
,
FORM_FILTER_PATH
,
);
);
useAsyncInitSelect
(
useAsyncInitSelect
(
[
'
innerStatus'
,
'outerStatus
'
],
[
'
memberTypeId'
,
'roleId'
,
'level
'
],
fetchSe
lectOption
s
,
fetchSe
archItem
s
,
);
);
}
}
}
}
schema=
{
listSearchSchema
}
schema=
{
listSearchSchema
}
...
...
src/pages/comment/query/schema/index.tsx
View file @
26ca46f9
...
@@ -26,9 +26,10 @@ export const listSearchSchema: ISchema = {
...
@@ -26,9 +26,10 @@ export const listSearchSchema: ISchema = {
columns
:
6
,
columns
:
6
,
},
},
properties
:
{
properties
:
{
memberType
:
{
memberType
Id
:
{
type
:
'string'
,
type
:
'string'
,
default
:
undefined
,
default
:
undefined
,
enum
:
[],
'x-component-props'
:
{
'x-component-props'
:
{
placeholder
:
'会员类型(全部)'
,
placeholder
:
'会员类型(全部)'
,
allowClear
:
true
,
allowClear
:
true
,
...
@@ -43,7 +44,7 @@ export const listSearchSchema: ISchema = {
...
@@ -43,7 +44,7 @@ export const listSearchSchema: ISchema = {
allowClear
:
true
,
allowClear
:
true
,
},
},
},
},
memberL
evel
:
{
l
evel
:
{
type
:
'string'
,
type
:
'string'
,
default
:
undefined
,
default
:
undefined
,
enum
:
[],
enum
:
[],
...
...
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