Commit a1655884 authored by LeeJiancong's avatar LeeJiancong

'冲突处理'

parents 7de33b63 2bfa621e
This diff is collapsed.
......@@ -3,11 +3,10 @@
"scripts": {
"api": "god-ytt",
"scripts:build": "node scripts/run",
"start:dev":"umi dev",
"start:dev": "umi dev",
"start:analyze": "ANALYZE=1 umi dev",
"clean": "rimraf node_modules",
"start": "yarn scripts:build && umi dev",
"start:dev": "umi dev",
"build": "umi build",
"build:analyze": "ANALYZE=1 umi build",
"postinstall": "umi generate tmp",
......@@ -32,7 +31,7 @@
"@umijs/preset-react": "1.x",
"@umijs/test": "^3.2.0",
"bizcharts": "^4.0.7",
"god": "^0.1.13",
"god": "0.1.15",
"lint-staged": "^10.0.7",
"mobx": "^5.15.4",
"mobx-react": "^6.2.2",
......
......@@ -420,6 +420,7 @@ const auditDetail: React.FC<ItemProps> = props => {
<StandardTable
tableProps={{
pagination: false,
rowKey: 'id',
}}
columns={columns}
currentRef={ref}
......@@ -432,6 +433,7 @@ const auditDetail: React.FC<ItemProps> = props => {
<StandardTable
tableProps={{
pagination: false,
rowKey: 'id',
}}
columns={columns}
currentRef={ref}
......
......@@ -221,7 +221,10 @@ const auditList: React.FC<PageProps> = props => {
dataIndex: 'status',
align: 'center',
key: 'status',
sorter: true,
filters: [
{ text: '123', value: '123' },
{ text: '456', value: '456' },
],
render: (text: any, record: any) => {
let component: ReactNode = null;
component = (
......@@ -241,7 +244,10 @@ const auditList: React.FC<PageProps> = props => {
dataIndex: 'outSideStatus',
align: 'center',
key: 'outSideStatus',
sorter: true,
filters: [
{ text: '123', value: '123' },
{ text: '456', value: '456' },
],
render: (text: any, record: any) => {
let component: ReactNode = null;
component = (
......@@ -269,7 +275,10 @@ const auditList: React.FC<PageProps> = props => {
dataIndex: 'inSideStatus',
align: 'center',
key: 'inSideStatus',
sorter: true,
filters: [
{ text: '123', value: '123' },
{ text: '456', value: '456' },
],
render: (text: any, record: any) => {
let component: ReactNode = null;
component = (
......@@ -328,6 +337,7 @@ const auditList: React.FC<PageProps> = props => {
const rowSelection = {
selectedRowKeys: selectedRowKeys,
onChange: (selectedRowKeys: any, selectedRows: any) => {
setSelectedRowKeys(selectedRowKeys);
console.log(
`selectedRowKeys: ${selectedRowKeys}`,
'selectedRows: ',
......
......@@ -17,14 +17,6 @@ const actions = createFormActions();
const addMember: React.FC<any> = props => {
const ref = useRef({});
const [actived, setActived] = useState('-1');
const [tabCount, setTabCount] = useState({
'1': 0,
'2': 2,
'3': 3,
'4': 4,
'5': 5,
'6': 6,
});
const [editable, setEditable] = useState(
props.location.query.type != 'check',
);
......@@ -167,7 +159,13 @@ const addMember: React.FC<any> = props => {
<>
<div className={style.headerTop}>
<span>返回</span>
<span>新建会员</span>
<span>
{props.location.query.type === 'add'
? '新建会员'
: props.location.query.type === 'change'
? '编辑会员'
: '查看会员'}
</span>
</div>
</>
}
......
......@@ -80,36 +80,6 @@ const memberImport: React.FC<{}> = () => {
const [selectedRowKeys, setSelectedRowKeys] = useState<Array<string>>([]);
const onClick = ({ key }) => {
if (key === '1') {
console.log('删除');
} else {
console.log('查看');
}
};
const moreMenu = (
<Menu onClick={onClick}>
<Menu.Item key="1">
<Popconfirm title="确定要删除吗?" okText="是" cancelText="否">
<Button type="link">删除</Button>
</Popconfirm>
</Menu.Item>
<Menu.Item key="2">
<Button
type="link"
onClick={() =>
history.push(
'/memberCenter/memberAbility/manage/addMember?type=check',
)
}
>
查看
</Button>
</Menu.Item>
</Menu>
);
const columns: ColumnType<any>[] = [
{
title: 'ID',
......@@ -127,7 +97,9 @@ const memberImport: React.FC<{}> = () => {
<div className={style.nameCell}>
<div
className={style.nameCellTitle}
onClick={() => handleSee(record)}
onClick={() =>
history.push('/memberCenter/memberAbility/manage/addMember?type=check')
}
>
{text}&nbsp;
<EyeOutlined />
......@@ -160,12 +132,20 @@ const memberImport: React.FC<{}> = () => {
title: '会员状态',
dataIndex: 'status',
align: 'center',
filters: [
{ text: 'Male', value: 'male' },
{ text: 'Female', value: 'female' },
],
key: 'status',
},
{
title: '外部状态',
dataIndex: 'externalStatus',
align: 'center',
filters: [
{ text: 'Male', value: 'male' },
{ text: 'Female', value: 'female' },
],
key: 'externalStatus',
},
{
......@@ -179,19 +159,14 @@ const memberImport: React.FC<{}> = () => {
<Button
type="link"
onClick={() =>
history.push(
'/memberCenter/memberAbility/manage/addMember?type=change',
)
history.push('/memberCenter/memberAbility/manage/addMember?type=change')
}
>
编辑
</Button>
<Dropdown overlay={moreMenu} trigger={['click']}>
<Button type="link" onClick={e => e.preventDefault()}>
更多
<DownOutlined />
</Button>
</Dropdown>
<Popconfirm title="确定要删除吗?" okText="是" cancelText="否">
<Button type="link">删除</Button>
</Popconfirm>
</>
);
},
......@@ -225,6 +200,10 @@ const memberImport: React.FC<{}> = () => {
});
};
const handleTableChange = (filters: any) => {
console.log(filters);
};
const handleSee = (record: any) => {};
const handleSearch = () => {
......@@ -251,15 +230,14 @@ const memberImport: React.FC<{}> = () => {
currentRef={ref}
rowSelection={rowSelection}
fetchTableData={(params: any) => fetchData(params)}
onChange={handleTableChange}
controlRender={
<Row>
<Col className={style.col} span={8}>
<Button
type="primary"
onClick={() =>
history.push(
'/memberCenter/memberAbility/manage/addMember?type=add',
)
history.push('/memberCenter/memberAbility/manage/addMember?type=add')
}
>
<PlusOutlined />
......
This diff is collapsed.
......@@ -32,21 +32,30 @@
}
.col {
margin : 0 16px 16px 0;
margin-bottom: 16px;
&-open {
color : #fff;
background-color: #6B778C;
}
&-close {
color : #595959;
background-color: #fff;
&:nth-last-of-type(1) {
text-align: right;
}
}
.selectBtn {
margin: 0 16px;
.subRow {
width: 100%;
.subCol {
width : 100%;
text-align: right;
.select {
width : 160px;
margin : 0 0 16px 16px;
text-align: left;
&:nth-of-type(1) {
margin-left: 0;
}
}
}
}
.select {
......@@ -56,4 +65,35 @@
&:nth-last-of-type(1) {
margin-right: 0;
}
}
.headerTop {
display : flex;
align-items: center;
span {
font-size : 14px;
font-weight: 400;
&:nth-last-of-type(1) {
font-size : 20px;
font-weight: 500;
color : #172B4D;
margin-left: 16px;
}
}
}
.saveBtn {
color : #fff;
background: @main-color
}
.required {
display : inline-block;
margin-right: 4px;
color : #ff4d4f;
font-size : 14px;
font-family : SimSun, sans-serif;
line-height : 1;
}
\ No newline at end of file
This diff is collapsed.
This source diff could not be displayed because it is too large. You can view the blob instead.
import moment from 'moment';
function isArray(arr: any) {
return Array.isArray(arr)
......@@ -7,8 +8,75 @@ function isObject(obj: any) {
return Object.prototype.toString.call(obj) === '[object Object]'
}
export function timeRange(val: number) {
let st = '', et = '';
switch (val) {
case 0:
st = et = ''
break
case 1:
st = et = moment()
.startOf('days')
.format('YYYY-MM-DD');
break
case 2:
st = moment()
.subtract(6, 'days')
.format('YYYY-MM-DD');
et = moment()
.startOf('days')
.format('YYYY-MM-DD');
break
case 3:
st = moment()
.startOf('month')
.format('YYYY-MM-DD');
et = moment()
.startOf('days')
.format('YYYY-MM-DD');
break
case 4:
st =
moment()
.subtract(2, 'month')
.format('YYYY-MM') + '-01';
et = moment()
.startOf('days')
.format('YYYY-MM-DD');
break
case 5:
st =
moment()
.subtract(5, 'month')
.format('YYYY-MM') + '-01';
et = moment()
.startOf('days')
.format('YYYY-MM-DD');
break
case 6:
st = moment()
.startOf('year')
.format('YYYY-MM-DD');
et = moment()
.startOf('days')
.format('YYYY-MM-DD');
break
case 7:
st = moment()
.years(moment().years() - 1)
.startOf('year')
.format('YYYY-MM-DD');
et = moment()
.years(moment().years() - 1)
.endOf('year')
.format('YYYY-MM-DD');
break
}
return { st, et }
}
export function omit(obj: any, arr: string[]) {
const tempObj = {...obj}
const tempObj = { ...obj }
for (let i = 0; i < arr.length; i++) {
delete tempObj[arr[i]]
}
......
......@@ -34,7 +34,7 @@ const errorMessage: httpStatus = {
504: "网关超时。",
};
const errorHandler = (error: ResponseError):IRequestError => {
const errorHandler = (error: ResponseError): IRequestError => {
const { response } = error
// http状态码非200的错误处理
const messageText = errorMessage[response.status]
......@@ -63,7 +63,7 @@ const baseRequest = extend({
});
// 请求拦截器
baseRequest.interceptors.request.use((url: string, options: RequestOptionsInit):{ url: string, options: RequestOptionsInit } => {
baseRequest.interceptors.request.use((url: string, options: RequestOptionsInit): { url: string, options: RequestOptionsInit } => {
return {
// 前缀如果已经带上api, 跳过自动补前缀
url: url.startsWith('/api') ? url : basePrefix + url,
......@@ -86,7 +86,7 @@ baseRequest.use(async (ctx: Context, next: () => void) => {
*/
class ApiRequest {
createRequest <T>(url: string, options: IApiRequest = { ctlType: 'none' }): Promise<IRequestSuccess<T>> {
createRequest<T>(url: string, options: IApiRequest = { ctlType: 'none' }): Promise<IRequestSuccess<T>> {
return new Promise((resolve, reject) => {
baseRequest<IRequestSuccess<T>>(url, options).then(res => {
if (res.code === 1000) {
......
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