Commit 694c827a authored by 前端-钟卫鹏's avatar 前端-钟卫鹏
parents 5bba9278 d9916ac5
/*
* @Author: XieZhiXiong
* @Date: 2020-09-23 09:55:40
* @LastEditors: XieZhiXiong
* @LastEditTime: 2020-09-23 11:12:37
* @Description:
*/
const commentRoutes = {
path: '/comment',
name: 'comment',
icon: 'SmileOutlined',
routes: [
{
path: '/comment/query',
name: 'query',
component: '@/pages/comment/query/index',
},
{
path: '/comment/query/detailed',
name: 'queryDetailed',
component: '@/pages/comment/query/detailed/index',
hideInMenu: true,
},
{
path: '/comment/manage',
name: 'manage',
component: '@/pages/comment/manage/index',
},
{
path: '/comment/manage/detailed',
name: 'manageDetailed',
component: '@/pages/comment/manage/detailed/index',
hideInMenu: true,
hidePageHeader: true,
},
],
};
export default commentRoutes;
\ No newline at end of file
......@@ -17,7 +17,21 @@ import memberAbility from './memberAbility'
import ruleSettingRoutes from './ruleSettingRoutes'
import authConfig from './authConfig'
import contentRoute from './contentRoute';
const routeList = [pageCustomized, calssPropertyRoute, trademarkRoute, commodity, logisticsRoutes, memberAbility, ruleSettingRoutes, authConfig, contentRoute]
import commentRoutes from './commentRoutes';
const routeList = [
pageCustomized,
calssPropertyRoute,
trademarkRoute,
commodity,
logisticsRoutes,
memberAbility,
ruleSettingRoutes,
authConfig,
contentRoute,
commentRoutes,
]
const router = [
{
path: '/login',
......
.head {
display: flex;
align-items: center;
font-size: 20px;
font-weight: 500;
&-prefix {
width: 48px;
height: 48px;
line-height: 48px;
border-radius: 4px;
border: 1px solid #DFE1E6;
color: #fff;
text-align: center;
background-color: #8777D9;
}
&-name {
color: #172B4D;
margin: 0 8px 0 12px;
}
}
/*
* @Author: XieZhiXiong
* @Date: 2020-09-22 11:48:53
* @LastEditors: XieZhiXiong
* @LastEditTime: 2020-09-22 11:53:03
* @Description: 详情页头像与名字结合组件
*/
import React from 'react';
import styles from './index.less';
export interface AvatarWrapProps {
info: {
aloneTxt?: string, // 单独显示在头像中间的文件,不传的话从 name 从截取第一个字符
name: string,
level?: number,
};
extra?: React.ReactNode;
};
const AvatarWrap: React.FC<AvatarWrapProps> = ({ info = {}, extra }) => (
<div className={styles.head}>
<div className={styles['head-prefix']}>
{
info.aloneTxt ?
info.aloneTxt :
info.name && info.name.length ?
info.name[0] :
''
}
</div>
<div className={styles['head-name']}>
{info.name || ''}
</div>
{extra}
</div>
);
export default AvatarWrap;
\ No newline at end of file
/*
* @Author: XieZhiXiong
* @Date: 2020-09-22 17:41:45
* @LastEditors: XieZhiXiong
* @LastEditTime: 2020-09-22 18:04:44
* @Description: 评价笑脸组件
*/
import React from 'react';
import {
SmileFilled,
MehFilled,
FrownFilled,
} from '@ant-design/icons';
interface MoodProps {
type: 'smile' | 'notBad' | 'sad';
};
const Mood: React.FC<MoodProps> = ({ type = 'smile' }) => {
let node = null;
switch (type) {
case 'smile':
node = <><SmileFilled style={{ color: '#41CC9E', marginRight: 4 }} /></>;
break;
case 'notBad':
node = <><MehFilled style={{ color: '#FFC400', marginRight: 4 }} /></>;
break;
case 'sad':
node = <><FrownFilled style={{ color: '#EF6260', marginRight: 4 }} /></>;
break;
default:
break;
}
return node;
};
export default Mood;
\ No newline at end of file
import React, { useState } from 'react';
import { Input, Space, Button } from 'antd';
import { Input, Space, Button, Tooltip } from 'antd';
import { CaretUpOutlined, CaretDownOutlined } from '@ant-design/icons';
import { useFieldState, FormPath, FormEffectHooks } from '@formily/antd';
import { FORM_FILTER_PATH } from '@/formSchema/const';
......@@ -15,7 +15,12 @@ const Search = props => {
const [state, setState] = useFieldState({
filterSearch: false,
});
const { align, advanced = true, ...rest } = props.props['x-component-props'];
const {
align,
advanced = true, // 是否展示高级筛选
tip, // 搜索框悬浮提示
...rest
} = props.props['x-component-props'];
const justifyAlign = align || 'flex-end';
const changeFilterVisible = () => {
......@@ -31,15 +36,17 @@ const Search = props => {
};
return (
<Space size={20} style={{ justifyContent: justifyAlign, width: '100%' }}>
<Input.Search
value={props.value || ''}
onChange={e => props.mutators.change(e.target.value)}
onSearch={(_, e) => {
e.preventDefault();
props.form.submit();
}}
{...rest}
/>
<Tooltip title={tip}>
<Input.Search
value={props.value || ''}
onChange={e => props.mutators.change(e.target.value)}
onSearch={(_, e) => {
e.preventDefault();
props.form.submit();
}}
{...rest}
/>
</Tooltip>
{advanced && (
<Button onClick={changeFilterVisible}>
高级筛选
......
import React from 'react';
import Mood from '@/components/Mood';
interface SmilingFaceProps {
value: number;
};
const SmilingFace: React.FC<SmilingFaceProps> = ({
value,
}) => {
let node = null;
switch (value) {
case 1:
case 2: {
node = (
<>
<Mood type="sad" />
<span>差评</span>
</>
);
break;
}
case 3: {
node = (
<>
<Mood type="notBad" />
<span>中评</span>
</>
);
break;
}
case 4:
case 5: {
node = (
<>
<Mood type="smile" />
<span>好评</span>
</>
);
break;
}
default:
break;
}
return node;
};
export default SmilingFace;
\ No newline at end of file
......@@ -21,9 +21,10 @@ import Phone from './components/Phone';
import CustomRadio from './components/CustomRadio';
import SearchSelect from './components/SearchSelect';
import TableTagList from './components/TableTagList';
import './index.less'
import { Checkbox } from '@formily/antd-components';
import DateSelect from './components/DateSelect';
import SmilingFace from './components/SmilingFace';
import './index.less'
export interface NiceFormProps extends IAntdSchemaFormProps {}
......@@ -89,7 +90,8 @@ export const componentExport = {
SearchSelect,
DateRangePicker: DatePicker.RangePicker,
TableTagList,
DateSelect
DateSelect,
SmilingFace,
}
const NiceForm: React.FC<NiceFormProps> = props => {
const { children, components, ...reset } = props;
......
.tag {
line-height: 22px;
padding: 0 8px;
font-size: 14px;
font-weight: 400;
color: #00B37A;
background: #EBF7F2;
border-radius: 4px;
&__success {
color: #00B37A;
background: #EBF7F2;
}
&__warnning {
color: #FF991F;
background: #FFFAE6;
}
&__default {
color: #42526E;
background: #F4F5F7;
}
&__danger {
color: #E63F3B;
background: #FFEBE6;
}
&__primary {
color: #3F7ED2;
background: #F0F8FF;
}
}
\ No newline at end of file
/*
* @Author: XieZhiXiong
* @Date: 2020-08-31 17:52:14
* @LastEditors: XieZhiXiong
* @LastEditTime: 2020-08-31 18:59:18
* @Description: 状态 tag
*/
import React from 'react';
import classNames from 'classnames';
import styles from './index.less';
interface StatusTagProps {
type: 'success' | 'warnning' | 'default' | 'danger' | 'primary';
title: string;
};
const StatusTag: React.FC<StatusTagProps> = ({ type, title }) => {
const cls = classNames(styles.tag, styles[`tag__${type}`]);
return (
<span className={cls}>{title}</span>
);
};
export default StatusTag;
\ No newline at end of file
......@@ -2,7 +2,7 @@
* @Author: LeeJiancong
* @Date: 2020-08-04 15:05:52
* @LastEditors: XieZhiXiong
* @LastEditTime: 2020-09-10 11:28:44
* @LastEditTime: 2020-09-23 10:38:53
*/
import utils from '@/utils'
import menu from '../en-US/menu'
......@@ -124,6 +124,13 @@ export default {
'menu.content.tagsManagement': '标签管理',
'menu.content.tagsInfo': '标签详情',
'menu.content.infomations': '资讯管理',
'menu.content.infomationInfo': '咨询详情'
'menu.content.infomationInfo': '咨询详情',
// 评论管理
'menu.comment': '评论管理',
'menu.comment.query': '会员评价查询',
'menu.comment.queryDetailed': '评价统计',
'menu.comment.manage': '评价管理',
'menu.comment.manageDetailed': '评价管理',
}
// export default utils.transformDataPre(data, 'menu')
import React from 'react';
import {
Row,
Col,
Button,
} from 'antd';
import styled from 'styled-components';
import {
SchemaForm,
SchemaField,
SchemaMarkupField as Field
} from '@formily/antd';
import { ArrayList } from '@formily/react-shared-components';
import { toArr, isFn, FormPath } from '@formily/shared';
import SmilingFace from '@/components/NiceForm/components/SmilingFace';
const ArrayComponents = {
CircleButton: props => <Button {...props} />,
TextButton: props => <Button text {...props} />,
AdditionIcon: () => <div>+Add</div>,
RemoveIcon: () => <div>Remove</div>,
MoveDownIcon: () => <div>Down</div>,
MoveUpIcon: () => <div>Up</div>
};
const RowStyleLayout = styled(props => <div {...props} />)`
padding: 24px 64px 24px 24px;
background: #ffffff;
.ant-btn {
margin-right: 16px;
}
.ant-form-item {
display: flex;
margin-right: 16px;
margin-bottom: 16px;
}
> .ant-form-item {
margin-bottom: 0;
margin-right: 0;
}
.goodInfo {
display: flex;
align-items: align;
&-left {
flex-shrink: 0;
margin-right: 16px;
width: 100px;
height: 100px;
> img {
width: 100%;
height: 100%;
object-fit: cover;
}
}
&-right {
flex: 1;
display: flex;
flex-direction: column;
justify-content: center;
}
&-title {
line-height: 14px;
margin-bottom: 18px;
font-size: 14px;
font-weight: 400;
color: #303133;
}
&-desc {
line-height: 12px;
margin-bottom: 16px;
font-size: 12px;
font-weight: 400;
color: #909399;
}
&-price {
line-height: 14px;
font-size: 14px;
font-weight: 500;
color: #303133;
}
}
.main {
position: relative;
padding-left: 24px;
> .ant-form-item {
margin-bottom: 0;
margin-right: 0;
}
::after {
content: ' ';
display: block;
position: absolute;
top: 6%;
left: 0;
bottom: 6%;
border-left: 1px dashed #EEF0F3;
}
}
`;
const EvaluationList = props => {
const { value, schema, className, editable, path, mutators } = props;
const {
renderAddition,
renderRemove,
renderMoveDown,
renderMoveUp,
renderEmpty,
renderExtraOperations,
...componentProps
} = schema.getExtendsComponentProps() || {};
return (
<ArrayList
value={value}
minItems={schema.minItems}
maxItems={schema.maxItems}
editable={editable}
components={ArrayComponents}
>
{toArr(value).map((item, index) => {
return (
<RowStyleLayout {...componentProps} key={index}>
<Row align="middle">
<Col span={10}>
<div className="goodInfo">
<div className="goodInfo-left">
<img src={item.good ? item.good.pic : ''} />
</div>
<div className="goodInfo-right">
<div className="goodInfo-title">进口头层黄牛皮荔枝纹/红色/XL</div>
<div className="goodInfo-desc">20 平方英尺</div>
<div className="goodInfo-price">¥ 400.00</div>
</div>
</div>
</Col>
<Col span={10}>
<div className="main">
<SchemaField path={FormPath.parse(path).concat(index)} />
</div>
</Col>
<Col span={4}>
<div style={{ textAlign: 'right' }}>
<SmilingFace value={2} />
</div>
</Col>
</Row>
</RowStyleLayout>
)
})}
</ArrayList>
)
}
EvaluationList.isFieldComponent = true;
export default EvaluationList;
\ No newline at end of file
import React from 'react';
import {
PageHeader,
Descriptions,
Card,
Spin,
Button,
} from 'antd';
import { FormOutlined } from '@ant-design/icons';
import { PageHeaderWrapper } from '@ant-design/pro-layout';
import { history } from 'umi';
import { createFormActions } from '@formily/antd';
import { Rating } from '@formily/antd-components';
import AvatarWrap from '@/components/AvatarWrap';
import NiceForm from '@/components/NiceForm';
import { evaluateSchema } from './schema';
import EvaluationList from './components/EvaluationList';
import styles from './evaluate.less';
const formActions = createFormActions();
const CommentManageDetailed: React.FC = () => {
return (
<PageHeaderWrapper
title={
<>
<PageHeader
style={{ padding: '0' }}
onBack={() => history.goBack()}
title={
<AvatarWrap
info={{
aloneTxt: '单',
name: '订单号:DPTY12'
}}
/>
}
>
<Descriptions
size="small"
column={3}
style={{
padding: '0 32px',
}}
>
<Descriptions.Item label="采购会员">BPTY12</Descriptions.Item>
<Descriptions.Item label="下单时间" span={2}>2020-08-25 08:49</Descriptions.Item>
</Descriptions>
</PageHeader>
</>
}
>
<NiceForm
actions={formActions}
onSubmit={() => {}}
components={{
EvaluationList,
Rating,
}}
effects={($, actions) => {
}}
schema={evaluateSchema}
editable={false}
/>
</PageHeaderWrapper>
);
};
export default CommentManageDetailed;
\ No newline at end of file
import { ISchema } from '@formily/antd';
export const evaluateSchema: ISchema = {
type: 'object',
properties: {
comments: {
type: 'array',
'x-component': 'EvaluationList',
default: [
{
name: '杰尼',
age: 24,
small: 1,
},
],
items: {
type: 'object',
properties: {
MEGA_LADYOUT: {
type: 'object',
'x-component': 'Mega-Layout',
'x-component-props': {
labelCol: 6,
labelAlign: 'left',
},
properties: {
star: {
title: '满意程度',
required: true,
'x-component': 'Rating',
'x-component-props': {
allowHalf: false,
},
},
comment: {
type: 'string',
title: '评价',
required: true,
'x-component': 'TextArea',
'x-component-props': {
rows: 4,
},
},
picture: {
type: 'string',
title: '图片',
required: true,
'x-component': 'CustomUpload',
'x-component-props': {
},
},
},
},
},
},
},
},
};
\ No newline at end of file
import React, { useState, useRef } from 'react';
import { Card, Rate, Button, Space } from 'antd';
import { StandardTable } from 'god';
import { ColumnType } from 'antd/lib/table/interface';
import { PageHeaderWrapper } from '@ant-design/pro-layout';
import { createFormActions } from '@formily/antd';
import { useStateFilterSearchLinkageEffect } from '@/formSchema/effects/useFilterSearch';
import { FORM_FILTER_PATH } from '@/formSchema/const';
import { useAsyncInitSelect } from '@/formSchema/effects/useAsyncInitSelect';
import { Link } from 'umi';
import EyePreview from '@/components/EyePreview';
import NiceForm from '@/components/NiceForm';
import { listSearchSchema } from './schema';
import styles from './index.less';
const formActions = createFormActions();
const mock = [
{
orderNo: 'DPTY12',
goodName: '进口头层黄牛皮荔枝纹/XLL/红色',
tradingTime: '2020-05-12 08:08',
passive: '广州白马皮具交易有限公司',
active: '温州隆昌皮具有限公司',
star: 4,
content: '质量好,非藏满意,长期订货!质量好,非藏满意,长期订货!',
created: '2020-05-12 08:58',
},
{
orderNo: 'DPTY13',
goodName: '进口头层黄牛皮荔枝纹/XLL/红色',
tradingTime: '2020-05-12 08:08',
passive: '广州白马皮具交易有限公司',
active: '温州隆昌皮具有限公司',
star: 2,
content: '质量好,非藏满意,长期订货!质量好,非藏满意,长期订货!',
created: '2020-05-12 08:58',
},
];
const CommentManage: React.FC = () => {
const ref = useRef<any>({});
const [selectedRowKeys, setSelectedRowKeys] = useState<Array<string>>([]);
const columns: ColumnType<any>[] = [
{
title: '订单号',
dataIndex: 'orderNo',
align: 'center',
render: (text, record) => (
<EyePreview
url={`/comment/manage/detailed`}
>
{text}
</EyePreview>
),
},
{
title: '交易商品/交易时间',
dataIndex: 'goodName',
align: 'center',
},
{
title: '被评价方',
dataIndex: 'passive',
align: 'center',
},
{
title: '评价方',
dataIndex: 'active',
align: 'center',
render: (text, record) => <>{text}</>,
},
{
title: '评价星级',
dataIndex: 'star',
align: 'center',
render: text => <Rate value={text} disabled />,
},
{
title: '评价内容',
dataIndex: 'content',
align: 'center',
ellipsis: true,
},
{
title: '评价时间',
dataIndex: 'created',
align: 'center',
},
{
title: '操作',
dataIndex: 'action',
align: 'center',
render: (_, record) => (
<>
<Button type="link">屏蔽</Button>
</>
),
},
];
const fetchListData = (params: any) => {
return Promise.resolve({
total: 2,
data: mock,
});
};
// 初始化高级筛选选项
const fetchSelectOptions = async () => {
return {};
};
const controllerBtns = (
<Space>
<Button>批量删除</Button>
</Space>
);
const rowSelection = {
onChange: (keys: any, rows: {}[]) => {
setSelectedRowKeys(keys);
},
selectedRowKeys: selectedRowKeys,
};
return (
<Card>
<StandardTable
tableProps={{
rowKey: 'orderNo',
}}
columns={columns}
currentRef={ref}
rowSelection={rowSelection}
fetchTableData={(params: any) => fetchListData(params)}
controlRender={
<NiceForm
actions={formActions}
onSubmit={values => ref.current.reload(values)}
expressionScope={{
controllerBtns,
}}
effects={($, actions) => {
useStateFilterSearchLinkageEffect(
$,
actions,
'name',
FORM_FILTER_PATH,
);
useAsyncInitSelect(
['innerStatus', 'outerStatus'],
fetchSelectOptions,
);
}}
schema={listSearchSchema}
/>
}
/>
</Card>
);
};
export default CommentManage;
\ No newline at end of file
import { ISchema } from '@formily/antd';
import { FORM_FILTER_PATH } from '@/formSchema/const';
export const listSearchSchema: ISchema = {
type: 'object',
properties: {
megaLayout: {
type: 'object',
'x-component': 'mega-layout',
properties: {
TOPLAYOUT: {
type: 'object',
'x-component': 'Mega-Layout',
'x-component-props': {
grid: true,
},
properties: {
ctl: {
type: 'object',
'x-component': 'Children',
'x-component-props': {
children: '{{controllerBtns}}',
},
},
name: {
type: 'string',
'x-component': 'Search',
'x-component-props': {
placeholder: '搜索',
tip: '输入 订单号、交易商品 进行搜索',
},
},
},
},
[FORM_FILTER_PATH]: {
type: 'object',
'x-component': 'Flex-Layout',
'x-component-props': {
colStyle: {
marginLeft: 20,
},
},
properties: {
memberTypeId: {
type: 'string',
default: undefined,
enum: [],
'x-component-props': {
placeholder: '被评价方(全部)',
allowClear: true,
},
},
orderType: {
type: 'string',
default: undefined,
enum: [],
'x-component-props': {
placeholder: '评价方(全部)',
allowClear: true,
},
},
outerStatus: {
type: 'string',
default: undefined,
enum: [],
'x-component-props': {
placeholder: '评价星级(全部)',
allowClear: true,
},
},
'[startDate, endDate]': {
type: 'string',
default: '',
'x-component': 'dateSelect',
'x-component-props': {
placeholder: '评价时间(全部)',
allowClear: true,
},
},
'[startDate2, endDate2]': {
type: 'string',
default: '',
'x-component': 'dateSelect',
'x-component-props': {
placeholder: '交易时间(全部)',
allowClear: true,
},
},
'content': {
type: 'string',
default: '',
'x-component-props': {
placeholder: '评价内容',
allowClear: true,
},
},
submit: {
'x-component': 'Submit',
'x-mega-props': {
span: 1,
},
'x-component-props': {
children: '查询',
},
},
},
},
},
},
},
};
\ No newline at end of file
import React from 'react';
import {
Row,
Col,
Button,
} from 'antd';
import styled from 'styled-components';
import {
SchemaForm,
SchemaField,
SchemaMarkupField as Field
} from '@formily/antd';
import { ArrayList } from '@formily/react-shared-components';
import { toArr, isFn, FormPath } from '@formily/shared';
import SmilingFace from '@/components/NiceForm/components/SmilingFace';
const ArrayComponents = {
CircleButton: props => <Button {...props} />,
TextButton: props => <Button text {...props} />,
AdditionIcon: () => <div>+Add</div>,
RemoveIcon: () => <div>Remove</div>,
MoveDownIcon: () => <div>Down</div>,
MoveUpIcon: () => <div>Up</div>
};
const RowStyleLayout = styled(props => <div {...props} />)`
padding: 24px 64px 24px 24px;
background: #ffffff;
.ant-btn {
margin-right: 16px;
}
.ant-form-item {
display: flex;
margin-right: 16px;
margin-bottom: 16px;
}
> .ant-form-item {
margin-bottom: 0;
margin-right: 0;
}
.goodInfo {
display: flex;
align-items: align;
&-left {
flex-shrink: 0;
margin-right: 16px;
width: 100px;
height: 100px;
> img {
width: 100%;
height: 100%;
object-fit: cover;
}
}
&-right {
flex: 1;
display: flex;
flex-direction: column;
justify-content: center;
}
&-title {
line-height: 14px;
margin-bottom: 18px;
font-size: 14px;
font-weight: 400;
color: #303133;
}
&-desc {
line-height: 12px;
margin-bottom: 16px;
font-size: 12px;
font-weight: 400;
color: #909399;
}
&-price {
line-height: 14px;
font-size: 14px;
font-weight: 500;
color: #303133;
}
}
.main {
position: relative;
padding-left: 24px;
> .ant-form-item {
margin-bottom: 0;
margin-right: 0;
}
::after {
content: ' ';
display: block;
position: absolute;
top: 6%;
left: 0;
bottom: 6%;
border-left: 1px dashed #EEF0F3;
}
}
`;
const EvaluationList = props => {
const { value, schema, className, editable, path, mutators } = props;
const {
renderAddition,
renderRemove,
renderMoveDown,
renderMoveUp,
renderEmpty,
renderExtraOperations,
...componentProps
} = schema.getExtendsComponentProps() || {};
return (
<ArrayList
value={value}
minItems={schema.minItems}
maxItems={schema.maxItems}
editable={editable}
components={ArrayComponents}
>
{toArr(value).map((item, index) => {
return (
<RowStyleLayout {...componentProps} key={index}>
<Row align="middle">
<Col span={10}>
<div className="goodInfo">
<div className="goodInfo-left">
<img src={item.good ? item.good.pic : ''} />
</div>
<div className="goodInfo-right">
<div className="goodInfo-title">进口头层黄牛皮荔枝纹/红色/XL</div>
<div className="goodInfo-desc">20 平方英尺</div>
<div className="goodInfo-price">¥ 400.00</div>
</div>
</div>
</Col>
<Col span={10}>
<div className="main">
<SchemaField path={FormPath.parse(path).concat(index)} />
</div>
</Col>
<Col span={4}>
<div style={{ textAlign: 'right' }}>
<SmilingFace value={2} />
</div>
</Col>
</Row>
</RowStyleLayout>
)
})}
</ArrayList>
)
}
EvaluationList.isFieldComponent = true;
export default EvaluationList;
\ No newline at end of file
@import '../../../../../../global/styles/utils.less';
.record {
padding: 0;
margin: 0;
&-item {
padding: 14px 16px;
line-height: 14px;
display: flex;
align-items: center;
background: #FAFBFC;
color: #303133;
&-good {
width: 25%;
&-name {
line-height: 14px;
margin-bottom: 13px;
font-size: 14px;
font-weight: 400;
}
&-price {
margin-right: 16px;
font-weight: 500;
}
&-desc {
line-height: 12px;
font-weight: 400;
color: #909399;
}
}
&-extra {
width: 20%;
&-item {
display: flex;
align-items: center;
&-label {
flex: 0 0 60px;
line-height: 12px;
font-size: 12px;
font-weight: 400;
color: #909399;
}
&-control {
flex: 1;
}
&:not(:last-child) {
margin-bottom: 13px;
}
}
}
&-comment {
width: 40%;
&-main {
margin-top: 6px;
line-height: 14px;
font-weight: 400;
color: #303133;
.textOverflow();
}
}
&-actions {
flex: 1;
text-align: center;
}
&:not(:last-child) {
margin-bottom: 16px;
}
}
}
\ No newline at end of file
import React from 'react';
import { Button, Rate } from 'antd';
import styles from './index.less';
interface RecordListProps {
list: [];
};
const RecordList: React.FC<RecordListProps> = () => {
return (
<ul className={styles.record}>
<li className={styles['record-item']}>
<div className={styles['record-item-good']}>
<div className={styles['record-item-good-name']}>
进口头层黄牛皮荔枝纹/红色/XL
</div>
<div>
<span className={styles['record-item-good-price']}>¥400.00</span>
<span className={styles['record-item-good-desc']}>20 平方英尺</span>
</div>
</div>
<div className={styles['record-item-extra']}>
<div className={styles['record-item-extra-item']}>
<div className={styles['record-item-extra-item-label']}>
交易时间:
</div>
<div className={styles['record-item-extra-item-control']}>
2020-05-20 17:09
</div>
</div>
<div className={styles['record-item-extra-item']}>
<div className={styles['record-item-extra-item-label']}>
评价方:
</div>
<div className={styles['record-item-extra-item-control']}>
温州龙昌手袋有限公司
</div>
</div>
</div>
<div className={styles['record-item-comment']}>
<Rate value={2} disabled />
<div className={styles['record-item-comment-main']}>
付款准时,合作愉快。付款准时,合作愉快。付款准时,合作愉快。付款准时,合作愉快。付款准时…
</div>
</div>
</li>
</ul>
);
};
export default RecordList;
\ No newline at end of file
@import '../../../../../../global/styles/index.less';
.shelves {
&-title {
line-height: 14px;
padding: 12px;
position: relative;
font-size: 14px;
font-weight: 400;
color: #606266;
border-bottom: 1px solid #EEF0F3;
&::after {
content: ' ';
display: block;
width: 2px;
position: absolute;
top: 30%;
left: 0;
bottom: 30%;
background: @primary-color;
}
}
&-content {
padding: 30px 0;
}
}
\ No newline at end of file
import React from 'react';
import styles from './index.less';
interface ShelvesProps {
title?: string;
children?: React.ReactNode;
};
const Shelves: React.FC<ShelvesProps> = ({
title = '标题',
children,
}) => {
return (
<div className={styles.shelves}>
<div className={styles['shelves-title']}>{title}</div>
<div className={styles['shelves-content']}>
{children}
</div>
</div>
);
};
export default Shelves;
\ No newline at end of file
import React from 'react';
import { Tabs, Row, Col, Button } from 'antd';
import { createFormActions } from '@formily/antd';
import MellowCard from '@/components/MellowCard';
import PolymericTable from '@/components/PolymericTable';
import { EditableColumns } from '@/components/PolymericTable/interface';
import { Pie } from '@/components/Charts';
import Mood from '@/components/Mood';
import NiceForm from '@/components/NiceForm';
import { searchSchema } from './schema';
import Shelves from './components/Shelves';
import RecordList from './components/RecordList';
import styles from './index.less';
const { TabPane } = Tabs;
const receivedFormActions = createFormActions();
const CommentDetailed: React.FC = () => {
const evaluateColumns: EditableColumns[] = [
{
title: ' ',
dataIndex: 'title',
align: 'center',
},
{
title: '最近7天',
dataIndex: 'last7days',
align: 'center',
},
{
title: '最近30天',
dataIndex: 'last30days',
align: 'center',
},
{
title: '最近180天',
dataIndex: 'last180days',
align: 'center',
},
{
title: '180天前',
dataIndex: 'before180days',
align: 'center',
},
];
const evaluatePie = [
{
x: `好评 30%`,
y: 100,
},
{
x: `中评 20%`,
y: 50,
},
{
x: `差评 10%`,
y: 10,
},
];
const evaluate = [
{
id: 1,
title: (<Mood type="smile" />),
last7days: 10,
last30days: 20,
last180days: 30,
before180days: 30,
},
{
id: 2,
title: (<Mood type="notBad" />),
last7days: 10,
last30days: 20,
last180days: 30,
before180days: 30,
},
{
id: 3,
title: (<Mood type="sad" />),
last7days: 10,
last30days: 20,
last180days: 30,
before180days: 30,
},
];
return (
<MellowCard
bodyStyle={{
padding: '0 24px 24px',
}}
>
<Tabs className={styles.tabs}>
<TabPane tab="概览" key="1">
<Shelves title="评价统计">
<Row gutter={24}>
<Col flex="399px">
<Pie
hasLegend
subTitle="累计评价"
total={() => evaluatePie.reduce((pre, now) => now.y + pre, 0)}
data={evaluatePie}
height={200}
colProps={{
span: 8,
}}
colors={['#41CC9E', '#FFC400', '#EF6260']}
/>
</Col>
<Col flex="auto">
<PolymericTable
dataSource={evaluate}
columns={evaluateColumns}
loading={false}
pagination={null}
rowClassName={() => styles['record-row']}
/>
</Col>
</Row>
</Shelves>
<Shelves title="评价记录">
<RecordList list={[]} />
<div
style={{
padding: '24px 0',
textAlign: 'center',
}}
>
<Button>查看更多评论</Button>
</div>
</Shelves>
</TabPane>
<TabPane tab="收到的评价" key="2">
<NiceForm
actions={receivedFormActions}
onSubmit={values => {}}
effects={($, actions) => {
}}
schema={searchSchema}
/>
<RecordList list={[]} />
</TabPane>
</Tabs>
</MellowCard>
);
};
export default CommentDetailed;
\ No newline at end of file
/*
* @Author: XieZhiXiong
* @Date: 2020-09-22 20:34:49
* @LastEditors: XieZhiXiong
* @LastEditTime: 2020-09-22 20:52:53
* @Description:
*/
import { ISchema } from '@formily/antd';
export const searchSchema: ISchema = {
type: 'object',
properties: {
megaLayout: {
type: 'object',
'x-component': 'Mega-Layout',
'x-component-props': {
inline: true,
},
properties: {
star: {
type: 'string',
enum: [],
'x-component-props': {
placeholder: '评论星级',
allowClear: true,
style: {
width: 206,
},
},
},
'[startDate, endDate]': {
type: 'string',
default: '',
'x-component': 'dateSelect',
'x-component-props': {
placeholder: '交易时间',
allowClear: true,
style: {
width: 206,
},
},
},
name: {
type: 'string',
'x-component': 'Search',
'x-component-props': {
placeholder: '搜索',
align: 'flex-left',
advanced: false,
},
},
},
},
},
};
\ No newline at end of file
import React, { useState, useRef } from 'react';
import { Card, Rate, Button } from 'antd';
import { StandardTable } from 'god';
import { ColumnType } from 'antd/lib/table/interface';
import { PageHeaderWrapper } from '@ant-design/pro-layout';
import { createFormActions } from '@formily/antd';
import { useStateFilterSearchLinkageEffect } from '@/formSchema/effects/useFilterSearch';
import { FORM_FILTER_PATH } from '@/formSchema/const';
import { useAsyncInitSelect } from '@/formSchema/effects/useAsyncInitSelect';
import { Link } from 'umi';
import EyePreview from '@/components/EyePreview';
import NiceForm from '@/components/NiceForm';
import { listSearchSchema } from './schema';
import styles from './index.less';
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 ref = useRef<any>({});
const columns: ColumnType<any>[] = [
{
title: 'ID',
dataIndex: 'id',
align: 'center',
},
{
title: '会员名称',
dataIndex: 'memberName',
align: 'center',
render: (text, record) => (
<EyePreview
url={`/comment/query/detailed`}
>
{text}
</EyePreview>
),
},
{
title: '会员类型',
dataIndex: 'memberType',
align: 'center',
},
{
title: '会员角色',
dataIndex: 'memberRole',
align: 'center',
render: (text, record) => <>{text}</>,
},
{
title: '会员等级',
dataIndex: 'memberLevel',
align: 'center',
render: (text, record) => <>{text}</>,
},
{
title: '交易满意度',
dataIndex: 'satisfaction',
align: 'center',
render: text => <Rate value={text} disabled />,
},
{
title: '收到评价总数',
dataIndex: 'count',
align: 'center',
},
{
title: '最近7天评价数',
dataIndex: 'day7',
align: 'center',
},
{
title: '最近180天评价数',
dataIndex: 'day180',
align: 'center',
},
];
const fetchListData = (params: any) => {
return Promise.resolve({
total: 2,
data: mock,
});
};
// 初始化高级筛选选项
const fetchSelectOptions = async () => {
return {};
};
return (
<Card>
<StandardTable
tableProps={{
rowKey: 'id',
}}
columns={columns}
currentRef={ref}
fetchTableData={(params: any) => fetchListData(params)}
controlRender={
<NiceForm
actions={formActions}
onSubmit={values => ref.current.reload(values)}
effects={($, actions) => {
useStateFilterSearchLinkageEffect(
$,
actions,
'name',
FORM_FILTER_PATH,
);
useAsyncInitSelect(
['innerStatus', 'outerStatus'],
fetchSelectOptions,
);
}}
schema={listSearchSchema}
/>
}
/>
</Card>
);
};
export default CommentQuery;
\ No newline at end of file
import { ISchema } from '@formily/antd';
import { FORM_FILTER_PATH } from '@/formSchema/const';
export const listSearchSchema: ISchema = {
type: 'object',
properties: {
megaLayout: {
type: 'object',
'x-component': 'mega-layout',
properties: {
name: {
type: 'string',
'x-component': 'Search',
'x-component-props': {
placeholder: '搜索',
align: 'flex-left',
},
},
[FORM_FILTER_PATH]: {
type: 'object',
'x-component': 'mega-layout',
'x-component-props': {
grid: true,
full: true,
autoRow: true,
columns: 6,
},
properties: {
memberTypeId: {
type: 'string',
default: undefined,
'x-component-props': {
placeholder: '会员类型(全部)',
allowClear: true,
},
},
orderType: {
type: 'string',
default: undefined,
enum: [],
'x-component-props': {
placeholder: '会员角色(全部)',
allowClear: true,
},
},
outerStatus: {
type: 'string',
default: undefined,
enum: [],
'x-component-props': {
placeholder: '会员等级(全部)',
allowClear: true,
},
},
innerStatus: {
type: 'string',
default: undefined,
enum: [],
'x-component-props': {
placeholder: '交易满意度(全部)',
allowClear: true,
},
},
submit: {
'x-component': 'Submit',
'x-mega-props': {
span: 1,
},
'x-component-props': {
children: '查询',
},
},
},
},
},
},
},
};
export const evaluateSchema: ISchema = {
type: 'object',
properties: {
comments: {
type: 'array',
'x-component': 'EvaluationList',
default: [
{
name: '杰尼',
age: 24,
small: 1,
},
],
items: {
type: 'object',
properties: {
MEGA_LADYOUT: {
type: 'object',
'x-component': 'Mega-Layout',
'x-component-props': {
labelCol: 6,
labelAlign: 'left',
},
properties: {
star: {
title: '满意程度',
required: true,
'x-component': 'Rating',
'x-component-props': {
allowHalf: false,
},
},
comment: {
type: 'string',
title: '评价',
required: true,
'x-component': 'TextArea',
'x-component-props': {
rows: 4,
},
},
picture: {
type: 'string',
title: '图片',
required: true,
'x-component': 'CustomUpload',
'x-component-props': {
},
},
},
},
},
},
},
},
};
\ No newline at end of file
......@@ -95,9 +95,7 @@ const ColumnInfo = () => {
const isEdit = id && !preview;
const isAdd = !id && !preview;
console.log(initialValues)
const handleSubmit = (value) => {
console.log(value)
const { id, name, sort} = value;
const serviceActions = isAdd
? PublicApi.postManageContentColumnAdd
......
import React, { useEffect, useState } from 'react';
import { FilterTable, FlexRowLayout } from '../components/FilterTable';
import { Card, Input, Button, Table, Space } from 'antd';
import { Card, Input, Button, Table, Space, Popconfirm } from 'antd';
import { createVirtualBox, createFormActions, FormEffectHooks, createEffectHook } from '@formily/antd';
import { history, Link } from 'umi';
import EyePreview from '@/components/EyePreview';
......@@ -217,7 +217,14 @@ const columnList: React.FC<{}> = () => {
? <Link to={`/content/columnInfo?id=${record.id}`}>编辑</Link>
: null
}
<a onClick={() => handleRemove(record.id)}>删除</a>
<Popconfirm
title="确定要执行这个操作?"
onConfirm={() => handleRemove(record.id)}
okText="是"
cancelText="否"
>
<a>删除</a>
</Popconfirm>
</Space>
)
},
......
.tagContainer {
.selection {
display: flex;
flex-direction: row;
justify-content: flex-start;
flex-wrap: nowrap;
.selectionItem {
height: 24px;
font-size: 14px;
padding: 0px 7px;
margin: 0 16px 16px 0;
display: flex;
flex-direction: row;
justify-content: center;
align-items: center;
background-color: #4279DF;
color: #fff;
border-radius: 4px;
.icon {
margin-left: 4px;
cursor: pointer;
}
}
}
.tips {
font-size: 12px;
font-family: PingFangSC-Regular, PingFang SC;
font-weight: 400;
color: #909399;
line-height: 12px;
}
.tags {
display: flex;
flex-direction: row;
flex-wrap: nowrap;
cursor: pointer;
.tagItem {
height: 28px;
padding: 0 6px;
background: #F4F5F7;
border-radius: 4px;
font-size: 14px;
color: #606266;
display: flex;
justify-content: center;
align-items: center;
margin-right: 16px;
}
}
}
\ No newline at end of file
import React, { useState } from 'react';
import styles from './Tags.less';
import { CloseCircleOutlined } from '@ant-design/icons';
const Tags = (props) => {
console.log(props);
const [value, setValue] = useState<number[]>([]);
const handleItemSelect = (params) => {
console.log(params);
const { id } = params;
if(value.includes(id)) {
return;
}
setValue((state) => {
const current = state;
const res = [...current, id];
props.mutators.change(res);
return res
})
}
const handleCancel = (params) => {
const { id } = params;
setValue((state) => {
const current = state;
const res = current.filter((item) => item !== id);
props.mutators.change(res);
return res;
})
}
const dataSource = [{label: '政策法规', value: '1'},{label: '政策法规2', value: '2'}]
return (
<div className={styles.tagContainer}>
<div className={styles.selection}>
<div className={styles.selectionItem}>
<span>政策法规</span>
<span className={styles.icon} onClick={() => handleCancel({id: 1})}><CloseCircleOutlined /></span>
</div>
</div>
<p className={styles.tips}>从下列标签中选择</p>
<div className={styles.tags}>
{
dataSource.map((item) => {
return (
<div className={styles.tagItem} onClick={() => handleItemSelect({id: 1})}>
政策法规
</div>
)
})
}
</div>
</div>
)
}
Tags.isFieldComponent = true
export default Tags;
import CustomTags from './Tags';
export {
CustomTags
}
\ No newline at end of file
......@@ -4,14 +4,13 @@ const customEvent$ = createEffectHook('requestAsyncDataSource');
const useAsyncDataSource = (name: string, service: any) => {
const { dispatch, setFieldState } = createFormActions()
console.log("service");
onFormInit$().subscribe(() => {
// 这里需要调用一下loading
service().then(res => {
//请求结束可以dispatch一个自定义事件收尾,方便后续针对该事件做联动
console.log(res);
setFieldState(name, state => {
state.props["x-component-props"]["dataSource"] = res
// @ts-ignore
state.props["x-component-props"]["dataSource"] = res
})
//@ts-ignore
......
......@@ -8,9 +8,9 @@ import { useAsyncDataSource } from '../hooks/useAsyncDataSource';
import { DownOutlined, DeleteOutlined, UpOutlined } from '@ant-design/icons';
import { timeRange } from '@/utils/index';
import { TimeList } from '@/pages/logistics/statusList';
import { action } from 'mobx';
const { onFormInit$ } = FormEffectHooks
import { PublicApi } from '@/services/API';
const { onFormInit$ } = FormEffectHooks
const { Search } = Input;
const SchemaButton = createVirtualBox('button', Button);
const SchemaTable = createVirtualBox('SchemaTable', Table);
......@@ -218,61 +218,68 @@ const schema = {
"rowKey": "id",
"pagination": {
showQuickJumper: true,
total: 50,
current: 1,
"onChange": "{{paginationChange}}"
}
size: "small",
"onChange": "{{paginationChange}}",
},
"rowSelection": "{{rowSelection}}"
}
},
}
}
const getData = async (params: any) => {
let temp: any[] = [];
for(let i = 0; i < 50; i++) {
const data = {
id: i,
name: `今日热点 - ${i}`,
sort: i,
status: `有效- ${i}`,
}
temp.push(data)
}
const data = {
data: temp
};
return new Promise((resolve) => {
setTimeout(() => {
resolve(data)
}, 1000)
})
const res = await PublicApi.getManageContentInformationPage(params);
return res.data
}
export const createEffects = () => () => {
useAsyncDataSource('table', async () => {
const {data} = await getData({});
return data;
})
}
const Infomation = () => {
const [paginationConfig, setPaginationConfig] = useState({ current: 1, pageSize: 10 })
useEffect(() => {
async function initData() {
const res = await getData({});
actions.setFieldState("table", state => {
//@ts-ignore
state.props["x-component-props"]["dataSource"] = res.data
})
const data = {
current: 1,
pageSize: 10
}
initData();
getTableDataSource(data)
}, [])
// 页码改变时
const paginationChange = (page: number, pageSize: number) => {
setPaginationConfig({current: page, pageSize: pageSize});
const name = actions.getFieldValue('search');
getTableDataSource({name: name, current: page, pageSize: pageSize})
}
// 设置Table 状态
const setTableStatus = (name: string, key: string, value: any) => {
actions.setFieldState(name, state => {
// @ts-ignore
state.props['x-component-props'][key] = value
})
}
// 设置table DataSource
const setTableDataSource = ({ dataSource }) => {
actions.setFieldState("table", state => {
//@ts-ignore
state.props["x-component-props"]["loading"] = false;
//@ts-ignore
state.props["x-component-props"]["dataSource"] = dataSource
})
}
// 获取 table DataSource,只是把loading 跟获取数据集合在一起
const getTableDataSource = async (params) => {
setTableStatus("table", "loading", true);
const res = await getData(params);
setTableDataSource({dataSource: res.data})
}
const handleMenuClick = () => {
console.log("批量删除")
}
const infomationEffects = () => () => {
onFormInit$().subscribe(() => {
actions.setFieldState('FILTERS', state => {
state.visible = false;
......@@ -302,9 +309,9 @@ const Infomation = () => {
renderOperation: (val, record) => {
return <Button>编辑</Button>
},
paginationChange: (page, pageSize) => {
console.log(page, pageSize);
},
paginationChange: (page: number, pageSize: number) => {
paginationChange(page, pageSize)
},
batchUpdate: () => {
console.log("batchUpdate")
},
......@@ -317,6 +324,17 @@ const Infomation = () => {
</Menu>
);
},
rowSelection: {
onChange: (selectedRowKeys, selectedRows) => {
console.log(`selectedRowKeys: ${selectedRowKeys}`, 'selectedRows: ', selectedRows);
},
onSelect: (record, selected, selectedRows) => {
console.log(record, selected, selectedRows);
},
onSelectAll: (selected, selectedRows, changeRows) => {
console.log(selected, selectedRows, changeRows);
},
},
toggleFilters: () => {
actions.setFieldState('FILTERS', state => {
const visible = !state.visible;
......
import React from 'react';
import { SchemaForm,Submit, FormButtonGroup, Reset, createVirtualBox } from '@formily/antd';
import { Card, Select, Input, Checkbox, Upload } from 'antd';
import { Card, Select, Input, Checkbox, Grid } from 'antd';
import { PageHeaderWrapper } from '@ant-design/pro-layout';
import ReutrnEle from '@/components/ReturnEle';
import { usePageStatus } from '@/hooks/usePageStatus';
import { history, Prompt } from 'umi';
import { FlexRowLayout } from '../components/FilterTable';
import CustomUpload from '@/components/NiceForm/components/CustomUpload';
import { CustomTags } from '../components/Tags';
const { TextArea } = Input;
......@@ -14,12 +16,12 @@ const schema = {
properties: {
layout: {
name: 'layout',
type: 'boject',
type: 'object',
'x-component': 'mega-layout',
'x-component-props': {
"labelCol": 3,
"wrapperCol": 10,
"labelAlign": "left"
"labelAlign": "left",
},
properties: {
name: {
......@@ -35,7 +37,7 @@ const schema = {
},
},
column: {
name: 'colum',
name: 'column',
title: '栏目',
'x-component': 'Select',
"x-component-props": {
......@@ -62,53 +64,45 @@ const schema = {
},
},
sort: {
name: 'sort',
type: 'object',
'x-component': 'mega-layout',
"x-component-props": {
"label": "推荐排序",
"wrapperCol": 24,
wrapperCol: 23,
layoutProps: {
"wrapperCol": 12,
},
style: {
marginBottom: '0px'
}
marginBottom: 0
},
addonAfter: "{{isTop}}"
},
properties: {
layout: {
type: 'object',
name: 'layout',
"x-component": 'FlexRowLayout',
"x-component-props": {
justify: 'start',
},
properties: {
sortNum: {
"x-flex-props": {
flex: 1,
style: {
margin: '0 10px 0 0 '
}
},
name: 'sortNum',
type: 'string',
'x-component': 'Select',
'x-component-props': {
options: [
{label: '推荐阅读', value: '1'}
],
defaultValue: '1',
}
},
isTop: {
name: 'isTop',
type: 'string',
"x-component": 'Checkbox',
"x-component-props": {
children: '置顶',
checked: true
}
sortNum: {
name: 'sortNum',
type: 'string',
'x-component': 'Select',
'x-component-props': {
style: {
width: '98%'
}
}
}
},
// isTop: {
// name: 'isTop',
// type: 'string',
// "x-component": 'Checkbox',
// 'x-mega-props': {
// style: {
// display: 'inline-block',
// width: 'calc(20% - 10px)'
// }
// },
// "x-component-props": {
// children: '置顶',
// checked: true
// }
// }
}
},
view: {
......@@ -117,21 +111,21 @@ const schema = {
type: 'string',
'x-component': 'Input',
},
infomationTags: {
name: 'infomationTags',
title: '咨询标签',
"x-component": 'Input'
"x-component": 'CustomTags'
},
imageUpload: {
type: "object",
title: "卡片上传文件",
name: "imageUpload",
"x-component": "CustomUpload",
"x-component-props": {
size: '无'
}
},
// imageUpload: {
// type: "array",
// title: "卡片上传文件",
// name: "imageUpload",
// "x-component-props": {
// "listType": "card",
// "fileList": []
// },
// "x-component": "upload"
// },
desc: {
type: 'string',
name: 'desc',
......@@ -176,11 +170,15 @@ const InfomationInfo = () => {
<SchemaForm
onSubmit={handleSubmit}
schema={schema}
components={{ Input, Select, Submit, TextArea, Checkbox, FlexRowLayout, }}
components={{ Input, Select, Submit, TextArea, Checkbox, FlexRowLayout, CustomUpload, CustomTags}}
expressionScope={{
isTop: (
<Checkbox>置顶</Checkbox>
),
uploadShowDesc: (
<div>123</div>
)
}}
>
<FormButtonGroup offset={3}>
......
import React, {useState, useEffect} from 'react';
import { Card, Input, Button, Table, Space } from 'antd';
import { Card, Input, Button, Table, Space, Popconfirm } from 'antd';
import { FilterTable, FlexRowLayout } from '../components/FilterTable';
import { createVirtualBox, createFormActions, FormEffectHooks, createEffectHook } from '@formily/antd';
import { history, Link } from 'umi';
......@@ -25,8 +25,8 @@ const columns = [
)
},
{title: '标签说明', dataIndex: 'explain'},
{title: '状态', dataIndex: 'status', render: "{{renderStatus}}"},
{title: '操作', render: "{{renderOperation}}"}
{title: '状态', dataIndex: 'status', render: "{{renderStatus}}", width: 120},
{title: '操作', render: "{{renderOperation}}", width: 150}
];
const schema = {
......@@ -96,7 +96,8 @@ const schema = {
"rowKey": "id",
"pagination": {
showQuickJumper: true,
"onChange": "{{paginationChange}}"
"onChange": "{{paginationChange}}",
size: "small"
}
}
},
......@@ -114,7 +115,6 @@ const Tags = () => {
useEffect(() => {
async function initData() {
const res = await getData({name: '', current: 1, pageSize: 10});
console.log(res);
actions.setFieldState("table", state => {
//@ts-ignore
state.props["x-component-props"]["dataSource"] = res.data
......@@ -125,7 +125,6 @@ const Tags = () => {
}, [])
const handleSearch = async (value) => {
console.log(value);
const res = await getData({
name: value,
current: paginationConfig.current,
......@@ -184,11 +183,9 @@ const Tags = () => {
actions={actions}
expressionScope={{
goToCreate: () => {
// console.log("goToCreate")
history.push(`/content/tagsInfo`)
},
search: (value) => {
console.log(value)
handleSearch(value)
},
renderOperation: (val, record) => {
......@@ -196,10 +193,17 @@ const Tags = () => {
<Space>
{
record.status === 0
? <Link to={`/content/columnInfo?id=${record.id}`}>编辑</Link>
? <Link to={`/content/tagsInfo?id=${record.id}`}>编辑</Link>
: null
}
<a onClick={() => handleRemove(record.id)}>删除</a>
<Popconfirm
title="确定要执行这个操作?"
onConfirm={() => handleRemove(record.id)}
okText="是"
cancelText="否"
>
<a>删除</a>
</Popconfirm>
</Space>
)
},
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment