Commit d441a906 authored by 前端-钟卫鹏's avatar 前端-钟卫鹏

fix

parents bc62d533 0bfe3fb1
{"userRegister":{"useType":{"memberType":[{"id":1,"typeName":"企业会员"},{"id":3,"typeName":"渠道企业会员"},{"id":4,"typeName":"渠道个人会员"},{"id":2,"typeName":"个人会员"}],"businessType":[{"id":1,"typeName":"采购"},{"id":24,"typeName":"供应"},{"id":33,"typeName":"hcx供应商"},{"id":34,"typeName":"test3"},{"id":35,"typeName":"test4"},{"id":36,"typeName":"test5"},{"id":37,"typeName":"test6"}]}},"web":{"shopInfo":[{"id":3,"name":"Web商城","type":1,"environment":1,"logoUrl":"https://shushangyun01.oss-cn-shenzhen.aliyuncs.com/1392a859053a4118b381626480934e0a1595418166828.png","describe":"Web商城-企业商城","state":1,"url":"https://www.baidu.com/"},{"id":4,"name":"test","type":1,"environment":2,"logoUrl":"https://shushangyun01.oss-cn-shenzhen.aliyuncs.com/c40368db31c847d4a0b2c231c670f05e1595418342974.jpg","describe":"111","state":1,"url":"https://www.baidu.com/"},{"id":52,"name":"ee","type":1,"environment":1,"logoUrl":"https://shushangyun01.oss-cn-shenzhen.aliyuncs.com/c7ad98f7b0b2442b9a0fb634a93ce1bb1595991020345.jpg","describe":"eee","state":1,"url":"https://www.baidu.com/"},{"id":102,"name":"t333","type":1,"environment":1,"logoUrl":"https://shushangyun01.oss-cn-shenzhen.aliyuncs.com/95bc05411cc441e0a6cddf35d77432ba1596022338044.jpg","describe":"3333333333","state":1,"url":"https://www.baidu.com/"},{"id":103,"name":"t3334","type":2,"environment":2,"logoUrl":"https://shushangyun01.oss-cn-shenzhen.aliyuncs.com/40732d6029224a1a9cf98b63a95c0b461596022360889.jpg","describe":"rrr","state":1,"url":"https://www.baidu.com/"},{"id":104,"name":"t5555","type":3,"environment":3,"logoUrl":"https://shushangyun01.oss-cn-shenzhen.aliyuncs.com/0d5aeb851f0f449cab3c33f36c94dba31596022402153.jpg","describe":"tttttt","state":1,"url":"https://www.baidu.com/"},{"id":105,"name":"ttt","type":4,"environment":3,"logoUrl":"https://shushangyun01.oss-cn-shenzhen.aliyuncs.com/8d2c67f4325b4528a8166e5f985cbc101596022427244.jpg","describe":"yyyyyyyyyy","state":1,"url":"https://www.baidu.com/"},{"id":106,"name":"yyyyyyyyyyrrrrrrrr","type":5,"environment":2,"logoUrl":"https://shushangyun01.oss-cn-shenzhen.aliyuncs.com/16ee5e88950a4573b91b7a7257335f4a1596022450608.jpg","describe":"hhhhhhhhhh","state":1,"url":"https://www.baidu.com/"},{"id":107,"name":"加载设置的国家、语言、币制、商城","type":4,"environment":4,"logoUrl":"https://shushangyun01.oss-cn-shenzhen.aliyuncs.com/19bebe952ed0493e826e0ce0b51ea1fd1596022498567.jpg","describe":"fffffff","state":1,"url":"https://www.baidu.com/"},{"id":108,"name":"加载设置","type":3,"environment":4,"logoUrl":"https://shushangyun01.oss-cn-shenzhen.aliyuncs.com/420c2647e9b34a0a9869e3c38671c6b01596022528519.jpg","describe":"iiiiiiiiiiiiiiii","state":1,"url":"https://www.baidu.com/"},{"id":109,"name":"加载设置的国家、语言、币制、商城1","type":1,"environment":2,"logoUrl":"https://shushangyun01.oss-cn-shenzhen.aliyuncs.com/00b9764f83074becb2217716fcb6714d1596022566857.jpg","describe":"jjjjjjjjjjj","state":1,"url":"https://www.baidu.com/"},{"id":110,"name":"加载设置的国家、语言、币制、商城2","type":2,"environment":1,"logoUrl":"https://shushangyun01.oss-cn-shenzhen.aliyuncs.com/6285d1bccac14eccae8c2c0c06e9d30f1596022585847.jpg","describe":"jjjjjjjjjjjjjjjj","state":1,"url":"https://www.baidu.com/"},{"id":111,"name":"111111111111加载设置的国家、语言、币制、商城","type":1,"environment":1,"logoUrl":"https://shushangyun01.oss-cn-shenzhen.aliyuncs.com/8c81a999a38c43ccb7fcc9ca3d4cdf3c1596022729328.jpg","describe":"333333333","state":1,"url":"https://www.baidu.com/"},{"id":112,"name":"rrrrrrrrrrrrrrrrrrrrrrrrrrrrrr","type":1,"environment":1,"logoUrl":"https://shushangyun01.oss-cn-shenzhen.aliyuncs.com/08258984461e46cc870c9fe2a50e9d6f1596023343823.jpg","describe":"666666666666666","state":1,"url":"https://www.baidu.com/"},{"id":202,"name":"测试商城","type":1,"environment":1,"logoUrl":"xxx","describe":"xxx","state":1,"url":"https://www.baidu.com/"},{"id":252,"name":"hcxtest","type":1,"environment":1,"logoUrl":"https://shushangyun01.oss-cn-shenzhen.aliyuncs.com/d5c6a1adeefb4d02a2c80983dbd5167d1596794178473.jpg","describe":"tteeeww","state":1,"url":"https://www.baidu.com/"}]},"global":{"siteId":502,"siteUrl":"http://localhost:4396","logo":"https://shushangyun01.oss-cn-shenzhen.aliyuncs.com/4db4e7c5424c471c968ab540bce027f31597319423082.png","countryList":[{"name":"简体中文-ZH","key":"zh-CN","icon":"http://lingxi-frontend-test.oss-cn-hangzhou.aliyuncs.com/images/china.png"},{"name":"English-EN","key":"en-US","icon":"http://lingxi-frontend-test.oss-cn-hangzhou.aliyuncs.com/images/us.png"},{"name":"日本語-JP","key":"jp","icon":"http://lingxi-frontend-test.oss-cn-hangzhou.aliyuncs.com/images/japen.png"},{"name":"한국어-KO","key":"ko","icon":"http://lingxi-frontend-test.oss-cn-hangzhou.aliyuncs.com/images/koren.png"}]}}
{"userRegister":{"useType":{"memberType":[{"id":1,"typeName":"企业会员"},{"id":3,"typeName":"渠道企业会员"},{"id":4,"typeName":"渠道个人会员"},{"id":2,"typeName":"个人会员"}],"businessType":[{"id":1,"typeName":"采购"},{"id":24,"typeName":"供应"},{"id":33,"typeName":"hcx供应商"},{"id":34,"typeName":"test3"},{"id":35,"typeName":"test4"},{"id":36,"typeName":"test5"},{"id":37,"typeName":"test6"}]}},"global":{"logo":"http://lingxi-frontend-test.oss-cn-hangzhou.aliyuncs.com/images/logo.png","countryList":[{"name":"简体中文-ZH","key":"zh-CN","icon":"http://lingxi-frontend-test.oss-cn-hangzhou.aliyuncs.com/images/china.png"},{"name":"English-EN","key":"en-US","icon":"http://lingxi-frontend-test.oss-cn-hangzhou.aliyuncs.com/images/us.png"},{"name":"日本語-JP","key":"jp","icon":"http://lingxi-frontend-test.oss-cn-hangzhou.aliyuncs.com/images/japen.png"},{"name":"한국어-KO","key":"ko","icon":"http://lingxi-frontend-test.oss-cn-hangzhou.aliyuncs.com/images/koren.png"}],"menuList":[{"code":"/memberCenter/commodityAbility","children":[{"code":"/mem"}]},{"code":"/memberCenter/commodityAbility/classAndProperty/class"}]}}
......@@ -24,6 +24,13 @@ const MemberRoute = {
component: '@/pages/member/memberImport/index',
},
{
path: '/memberCenter/memberAbility/manage/importDetail',
name: 'importDetail',
key: 'importDetail',
hideInMenu: true,
component: '@/pages/member/components/memberDetail/index',
},
{
path: '/memberCenter/memberAbility/manage/addMember',
name: 'addMember',
key: 'addMember',
......@@ -37,6 +44,13 @@ const MemberRoute = {
component: '@/pages/member/memberMaintain/index',
},
{
path: '/memberCenter/memberAbility/manage/maintianDetail',
name: 'maintianDetail',
key: 'maintianDetail',
hideInMenu: true,
component: '@/pages/member/components/memberDetail/index',
},
{
path: '/memberCenter/memberAbility/manage/memberPrSubmit',
name: 'memberPrSubmit',
key: 'memberPrSubmit',
......
......@@ -9,6 +9,7 @@
"start": "yarn api && yarn scripts:build && umi dev",
"build": "yarn api && yarn scripts:build && umi build",
"build:analyze": "ANALYZE=1 umi build",
"build:dev": "pm2 start scripts/devServer.js",
"postinstall": "umi generate tmp",
"prettier": "prettier --write '**/*.{js,jsx,tsx,ts,less,md,json}'",
"test": "umi-test",
......@@ -56,9 +57,12 @@
"axios": "^0.19.2",
"chalk": "^4.1.0",
"clone": "^2.1.2",
"connect-history-api-fallback": "^1.6.0",
"express": "^4.17.1",
"fs-extra": "^9.0.1",
"god-yapi2ts": "^1.6.0",
"gulp": "^4.0.2",
"http-proxy-middleware": "^1.0.5",
"json2ts": "^0.0.7",
"ora": "^4.0.4"
}
......
/**
* 用于build后在10.0.0.25环境下,作为本地调试
*
*/
//express模块
var express =require("express");
var app =express();
const path = require('path')
const { createProxyMiddleware } = require('http-proxy-middleware')
const port = 4396
// 用于解决刷新后404问题
var history = require('connect-history-api-fallback');
app.use('/api',createProxyMiddleware(
{
target: 'http://10.0.0.25:8100',
changeOrigin: true,
pathRewrite: { '^/api' : '' }
}
))
app.use(history());
app.use(express.static('dist'))
app.get('/',(req,res)=>{
res.sendFile(path.resolve(__dirname, "../dist/", "index.html")) //设置/ 下访问文件位置
});
var server =app.listen(port,()=>{
var port =server.address().port
console.log("【】访问地址http://localhost:%s",port)
})
\ No newline at end of file
.flex-bet {
display : flex;
justify-content: space-between;
align-items : center;
}
.checkbox-tree-list {
display : flex;
flex-direction: column;
padding : 0;
li {
align-items: center;
height : 48px;
}
}
\ No newline at end of file
import React, { RefObject, useRef } from 'react';
import { Button, Checkbox } from 'antd';
import { useSelections } from '@umijs/hooks';
import { findTreeKeys } from '@/utils';
import './index.less';
export interface CheckboxTreeProps {
title?: React.ReactNode;
checkedNodes?: any[];
handleChange?(e?);
handleSubmit?();
showSave?;
disabled?: boolean;
actions?: RefObject<any>;
}
const CheckboxTree: React.FC<CheckboxTreeProps> = props => {
const {
title,
checkedNodes = [],
actions,
handleChange,
disabled,
showSave,
handleSubmit,
} = props;
const checkedKeys = findTreeKeys(checkedNodes, 'id');
const {
selected,
setSelected,
toggleAll,
toggle,
isSelected,
allSelected,
unSelectAll,
selectAll,
} = useSelections(checkedKeys, []);
if (actions) {
actions.current.selected = selected;
actions.current.setSelected = setSelected;
actions.current.getSelected = () => selected;
}
const toggleSelectAll = () => {
checkChange();
if (allSelected) {
unSelectAll();
} else {
selectAll();
}
};
const checkChange = (e?) => {
handleChange && handleChange(e);
};
return (
<div>
{title && (
<div className="flex-bet">
<div>{props.title}</div>
<div>
<Button onClick={toggleSelectAll} type="link" disabled={disabled}>
{allSelected ? '取消全选' : '全选'}
</Button>
{showSave && (
<Button onClick={handleSubmit} type="link" disabled={disabled}>
保存
</Button>
)}
</div>
</div>
)}
<ul className="checkbox-tree-list">
{checkedNodes &&
checkedNodes.map((v, i) => {
return (
<li key={v.id}>
<Checkbox
onChange={checkChange}
disabled={disabled}
onClick={() => toggle(v.id)}
checked={isSelected(v.id)}
>
{v.buttonName}
</Checkbox>
</li>
);
})}
</ul>
</div>
);
};
CheckboxTree.defaultProps = {
checkedNodes: [],
};
export default CheckboxTree;
This diff is collapsed.
......@@ -57,7 +57,9 @@ export default {
'menu.memberAbility.memberManage': '会员管理',
'menu.memberAbility.memberManage.memberImport': '会员导入',
'menu.memberAbility.memberManage.addMember': '新增会员',
'menu.memberAbility.memberManage.importDetail': '会员导入详情',
'menu.memberAbility.memberManage.memberMaintain': '会员维护',
'menu.memberAbility.memberManage.maintianDetail': '会员详情',
'menu.memberAbility.memberManage.memberPrSubmit': '待提交审核',
'menu.memberAbility.memberManage.auditPrSubmit': '待提交审核详情',
'menu.memberAbility.memberManage.memberPr1': '待审核(一级)',
......
This diff is collapsed.
This diff is collapsed.
import React, { useState, useRef, useEffect } from 'react';
import { usePageStatus, PageStatus } from '@/hooks/usePageStatus';
import { Row, Col, Tabs, Steps, Badge } from 'antd';
import TabTree, {
useTreeActions,
createTreeActions,
} from '@/components/TabTree';
import CheckboxTree from '@/components/CheckBoxTree';
import { useTreeTabs } from '@/hooks/useTreeTabs';
import styles from './index.less';
interface PageProps {
detailData: any;
}
const { TabPane } = Tabs;
const { Step } = Steps;
const treeActions = createTreeActions();
const AuthDetail: React.FC<PageProps> = (props: any) => {
const { detailData } = props;
const { pageStatus, id } = usePageStatus();
const {
treeData,
handleSelect,
nodeRecord,
getTreeMaps,
setIsEditForm,
isEditForm,
setTreeData,
} = useTreeTabs({
// fetchItemDetailData: Promise.resolve({data: detailData})
});
useEffect(() => {
setTreeData(detailData?.auths);
}, []);
const actionRef = useRef({});
const formInitValue = nodeRecord ? getTreeMaps(nodeRecord.key) : null;
const [formValue, setFormValue] = useState<any>(null);
// 编辑和预览模式下需回显数据
const fetchRoleDetail = id => {
// 10秒缓存
// const res = await PublicApi.getRoleDetails(
// { id },
// { useCache: true, ttl: 10 * 1000 },
// );
// return res;
};
// 储存的按钮数据
const [buttonInfos, setButtonInfos] = useState<any>([]);
useEffect(() => {
if (!id) return;
// fetchRoleDetail(id).then(res => {
// const { data } = res;
// setFormValue(data);
// });
}, []);
useEffect(() => {
if (formInitValue) {
// 显示右侧checkbox
setButtonInfos(formInitValue.buttons || []);
// 回显右侧checkbox的值
// if (actionRef.current.setSelected) {
// PublicApi.getMenuRoleButtonList({
// memberId: id,
// menuId: formInitValue.id,
// }).then(res => {
// const { data } = res;
// actionRef.current.setSelected(data.ids);
// });
// }
}
}, [getTreeMaps]);
return (
<Row>
<Col className={styles['authCol']} span={15}>
<TabTree
title="菜单列表"
customKey="id"
checkable
actions={treeActions}
treeData={treeData}
handleSelect={handleSelect}
disabled={pageStatus === PageStatus.PREVIEW}
/>
</Col>
<Col className={styles['authCol']} span={8} offset={1}>
<CheckboxTree
actions={actionRef}
disabled={pageStatus === PageStatus.PREVIEW}
handleChange={e => setIsEditForm(true)}
checkedNodes={buttonInfos}
title="菜单按钮访问权限"
/>
</Col>
</Row>
);
};
export default AuthDetail;
import React, { useState } from 'react';
import { Row, Col, Tabs, Steps, Badge } from 'antd';
import { StandardTable } from 'god';
import { ColumnType } from 'antd/lib/table/interface';
import styles from './index.less';
interface PageProps {
detailData: any;
}
const { TabPane } = Tabs;
const { Step } = Steps;
const BaseDetail: React.FC<PageProps> = props => {
const { detailData } = props;
const [fActived, setfActived] = useState('1');
const [lActived, setlActived] = useState('1');
const columns: ColumnType<any>[] = [
{
title: '序号',
dataIndex: 'id',
align: 'center',
key: 'id',
},
{
title: '操作角色',
dataIndex: 'roleName',
align: 'center',
key: 'roleName',
},
{
title: '状态',
dataIndex: 'statusName',
align: 'center',
key: 'statusName',
render: (text: any, record: any) => <Badge color="#FFC400" text={text} />,
},
{
title: '操作',
dataIndex: 'operation',
align: 'center',
key: 'operation',
},
{
title: '操作时间',
dataIndex: 'operateTime',
align: 'center',
key: 'operateTime',
},
{
title: '审核意见',
dataIndex: 'reason',
align: 'center',
key: 'reason',
},
];
const innerColumns: ColumnType<any>[] = [
{
title: '序号',
dataIndex: 'id',
align: 'center',
key: 'id',
},
{
title: '操作人',
dataIndex: 'operator',
align: 'center',
key: 'operator',
},
{
title: '部门',
dataIndex: 'org',
align: 'center',
key: 'org',
},
{
title: '职位',
dataIndex: 'jobTitle',
align: 'center',
key: 'jobTitle',
},
{
title: '状态',
dataIndex: 'innerStatusName',
align: 'center',
key: 'innerStatusName',
render: (text: any, record: any) => <Badge color="#FFC400" text={text} />,
},
{
title: '操作',
dataIndex: 'operation',
align: 'center',
key: 'operation',
},
{
title: '操作时间',
dataIndex: 'operateTime',
align: 'center',
key: 'operateTime',
},
{
title: '审核意见',
dataIndex: 'reason',
align: 'center',
key: 'reason',
},
];
const renderInfoTemplate = (params: any) => {
const { type, item } = params;
return (
<>
<div className={styles['mainCol-title']}>{item.groupName}</div>
<div className={styles['mainCol-row']}>
{item.elements.map((items: any, indexs: string) => {
return (
<div className={styles['mainCol-row-col']} key={indexs}>
<div className={styles['mainCol-row-col-option']}>
{items.fieldCNName}
</div>
<div className={styles['mainCol-row-col-option']}>
{items.fieldValue}
</div>
</div>
);
})}
</div>
</>
);
};
return (
<Row>
<Col className={styles['mainCol']} span={24}>
<Tabs activeKey={fActived} onChange={val => setfActived(val)}>
<TabPane tab="外部审核流程" key="1">
<Steps
style={{ padding: '34px 0' }}
progressDot
current={detailData?.currentOuterStep - 1}
>
{detailData?.outerVerifySteps?.map((item, index) => {
return (
<Step
key={index}
title={item.roleName}
description={item.stepName}
/>
);
})}
</Steps>
</TabPane>
<TabPane tab="内部审核流程" key="2">
<Steps
style={{ padding: '34px 0' }}
progressDot
current={detailData?.currentInnerStep - 1}
>
{detailData?.innerVerifySteps?.map((item, index) => {
return (
<Step
key={index}
title={item.roleName}
description={item.stepName}
/>
);
})}
</Steps>
</TabPane>
</Tabs>
</Col>
{detailData?.groups?.map((item, index) => {
return (
<Col className={styles['mainCol']} span={24} key={index}>
{renderInfoTemplate({ type: '1', item })}
</Col>
);
})}
<Col className={styles['mainCol']} span={24}>
<Tabs activeKey={lActived} onChange={val => setlActived(val)}>
<TabPane tab="流转记录" key="1">
<div style={{ marginBottom: '40px' }}>
<StandardTable
tableProps={{
pagination: false,
rowKey: 'id',
}}
columns={columns}
fetchTableData={(params: any) =>
Promise.resolve({ data: detailData?.history })
}
/>
</div>
</TabPane>
<TabPane tab="内部单据流转记录" key="2">
<div style={{ marginBottom: '40px' }}>
<StandardTable
tableProps={{
pagination: false,
rowKey: 'id',
}}
columns={innerColumns}
fetchTableData={(params: any) =>
Promise.resolve({ data: detailData?.innerHistory })
}
/>
</div>
</TabPane>
</Tabs>
</Col>
</Row>
);
};
export default BaseDetail;
import React, { useState } from 'react';
import { Row, Col, Tabs, Steps, Badge } from 'antd';
import { StandardTable } from 'god';
import { ColumnType } from 'antd/lib/table/interface';
import styles from './index.less';
interface PageProps {
detailData: any;
}
const EquitiesDetail: React.FC<PageProps> = props => {
return <>123</>;
};
export default EquitiesDetail;
.nameCell {
text-align: left;
.nameCellTitle {
color : @main-color;
cursor: pointer;
}
.levelIcon1 {
width : 100%;
height : 16px;
background : url("/static/imgs/level1@2x.png") no-repeat;
background-size: 54px 16px;
margin-top : 8px;
}
.levelIcon2 {
width : 100%;
height : 16px;
background : url("/static/imgs/level2@2x.png") no-repeat;
background-size: 54px 16px;
margin-top : 8px;
}
.levelIcon3 {
width : 100%;
height : 16px;
background : url("/static/imgs/level3@2x.png") no-repeat;
background-size: 54px 16px;
margin-top : 8px;
}
}
.col {
margin-bottom: 16px;
&:nth-last-of-type(1) {
text-align: right;
}
}
.headerTop {
display : flex;
align-items: center;
font-size : 20px;
font-family: PingFangSC-Medium, PingFang SC;
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;
}
}
.mainCol {
background-color: #fff;
margin-bottom : 24px;
padding : 0 24px;
box-sizing : border-box;
&-title {
font-size : 16px;
font-family: PingFangSC-Medium, PingFang SC;
font-weight: 500;
color : #172B4D;
padding : 20px 0;
}
&:nth-last-of-type(1) {
margin: 0;
}
&-row {
display : flex;
flex-wrap : wrap;
padding-bottom: 16px;
&-col {
display: flex;
width : calc(100% / 2);
padding: 16px 0;
&-option {
flex : 1;
font-size : 14px;
font-family: PingFangSC-Regular, PingFang SC;
font-weight: 400;
color : #6B778C;
&:nth-last-of-type(1) {
flex : 3;
padding-right: 20px;
box-sizing : border-box;
color : #172B4D;
}
}
}
}
&-rows {
display : flex;
padding-bottom: 16px;
&-cols {
flex: 1;
.cols-main {
display: flex;
padding: 16px 0;
&:nth-last-of-type(1) {
padding-bottom: 0;
}
&-options {
flex : 1;
font-size : 14px;
font-family: PingFangSC-Regular, PingFang SC;
font-weight: 400;
color : #6B778C;
&:nth-last-of-type(1) {
flex : 3;
padding-right: 20px;
box-sizing : border-box;
color : #172B4D;
}
}
}
}
}
&-chart {
display : flex;
padding-bottom: 28px;
&-main {
width: 30%;
&:nth-last-of-type(1) {
width : 70%;
background-color: greenyellow
}
&-card1 {
width : 338px;
height : 190px;
box-shadow : 0px 1px 2px 0px rgba(23, 43, 77, 0.12);
border-radius: 8px;
box-sizing : border-box;
padding : 32px 24px 16px;
background : url("/static/imgs/card1@2x.png") center center no-repeat;
h2 {
color : #A47268;
letter-spacing: 2px;
margin-bottom : 38px;
}
.progress {
width: 218px;
&-score {
display : flex;
justify-content: space-between;
}
}
}
&-card2 {
width : 338px;
height : 190px;
box-shadow : 0px 1px 2px 0px rgba(23, 43, 77, 0.12);
border-radius: 8px;
box-sizing : border-box;
padding : 32px 24px 16px;
background : url("/static/imgs/card2@2x.png") center center no-repeat;
h2 {
color : #5B6F92;
letter-spacing: 2px;
margin-bottom : 38px;
}
.progress {
width: 218px;
&-score {
display : flex;
justify-content: space-between;
}
}
}
&-card3 {
width : 338px;
height : 190px;
box-shadow : 0px 1px 2px 0px rgba(23, 43, 77, 0.12);
border-radius: 8px;
box-sizing : border-box;
padding : 32px 24px 16px;
background : url("/static/imgs/card3@2x.png") center center no-repeat;
h2 {
color : #987326;
letter-spacing: 2px;
margin-bottom : 38px;
}
.progress {
width: 218px;
&-score {
display : flex;
justify-content: space-between;
}
}
}
&-card4 {
width : 338px;
height : 190px;
box-shadow : 0px 1px 2px 0px rgba(23, 43, 77, 0.12);
border-radius: 8px;
box-sizing : border-box;
padding : 32px 24px 16px;
background : url("/static/imgs/card4@2x.png") center center no-repeat;
h2 {
color : #595B71;
letter-spacing: 2px;
margin-bottom : 38px;
}
.progress {
width: 218px;
&-score {
display : flex;
justify-content: space-between;
}
}
}
&-line {}
}
}
}
.authCol {
padding : 24px;
background-color: #fff;
}
.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 {
width : 160px;
margin: 0 16px 16px 0;
&: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
import React, { useState, useEffect, useRef, ReactNode } from 'react';
import { history } from 'umi';
import { PageHeaderWrapper } from '@ant-design/pro-layout';
import { PageHeader, Tag, Badge, Tabs, Steps, Descriptions } from 'antd';
import { StandardTable } from 'god';
import { ColumnType } from 'antd/lib/table/interface';
import { usePageStatus, PageStatus } from '@/hooks/usePageStatus';
import { PublicApi } from '@/services/api';
import styles from './index.less';
import BaseDetail from './baseDetail';
import AuthDetail from './authDetail';
import LevelDetail from './levelDetail';
import EquitiesDetail from './equitiesDetail';
import IntegrityDetail from './integrityDetail';
const { TabPane } = Tabs;
const { Step } = Steps;
const MemberDetail: React.FC<{}> = () => {
const { pageStatus, id } = usePageStatus();
const [hActived, setHActived] = useState('3');
const [detailData, setDetailData] = useState<any>({});
useEffect(() => {
const fetchDetailData = async () => {
const { data } = await PublicApi.getMemberValidateCommitDetail({
memberId: '2',
validateId: '63',
});
setDetailData(data);
};
fetchDetailData();
}, []);
return (
<PageHeaderWrapper
title={
<>
<PageHeader
style={{ padding: '0' }}
onBack={() => window.history.back()}
title={
<>
<div className={styles['headerTop']}>
<div className={styles['headerTop-prefix']}>广</div>
<div className={styles['headerTop-name']}>
广州市极致皮具有限公司
</div>
<div className={styles[`levelIcon${'1'}`]}></div>
</div>
</>
}
footer={
<Tabs activeKey={hActived} onChange={val => setHActived(val)}>
<TabPane tab="基本信息" key="1" />
<TabPane tab="权限信息" key="2" />
<TabPane tab="等级信息" key="3" />
<TabPane tab="权益信息" key="4" />
<TabPane tab="诚信信息" key="5" />
</Tabs>
}
>
<Descriptions size="small" column={3} style={{ padding: '0 32px' }}>
<Descriptions.Item label="会员类型">{123}</Descriptions.Item>
<Descriptions.Item label="会员角色">{123}</Descriptions.Item>
<Descriptions.Item label="会员状态">
<Tag color="green"></Tag>
</Descriptions.Item>
<Descriptions.Item label="外部状态">
<Tag color="gold"></Tag>
</Descriptions.Item>
<Descriptions.Item label="内部状态">
<Badge color="#669EDE" text={123} />
</Descriptions.Item>
</Descriptions>
</PageHeader>
</>
}
>
{hActived === '1' ? (
<BaseDetail detailData={detailData} />
) : hActived === '2' ? (
<AuthDetail detailData={detailData} />
) : hActived === '3' ? (
<LevelDetail detailData={detailData} />
) : hActived === '4' ? (
<EquitiesDetail detailData={detailData} />
) : (
<IntegrityDetail detailData={detailData} />
)}
</PageHeaderWrapper>
);
};
export default MemberDetail;
import React, { useState } from 'react';
import { Row, Col, Tabs, Steps, Badge } from 'antd';
import { StandardTable } from 'god';
import { ColumnType } from 'antd/lib/table/interface';
import styles from './index.less';
interface PageProps {
detailData: any;
}
const IntegrityDetail: React.FC<PageProps> = props => {
return <>123</>;
};
export default IntegrityDetail;
import React, { useState } from 'react';
import { Row, Col, Progress, Form, Input } from 'antd';
import { StandardTable } from 'god';
import { ColumnType } from 'antd/lib/table/interface';
import styles from './index.less';
interface PageProps {
detailData: any;
}
const LevelDetail: React.FC<PageProps> = props => {
const { detailData } = props;
return (
<Row>
<Col className={styles['mainCol']} span={24}>
<div className={styles['mainCol-title']}>会员等级</div>
<div className={styles['mainCol-chart']}>
<div className={styles['mainCol-chart-main']}>
<div
className={
styles[`mainCol-chart-main-card${detailData.level || '4'}`]
}
>
<h2>青铜会员</h2>
<div className={styles['progress']}>
<Progress
style={{ height: '4px' }}
strokeLinecap="square"
strokeColor={
detailData.level === '1'
? '#A47268'
: detailData.level === '2'
? '#576C8F'
: detailData.level === '3'
? '#B28525'
: '#595B71'
}
trailColor={
detailData.level === '1'
? '#E9BFA9'
: detailData.level === '2'
? '#ABC0DC'
: detailData.level === '3'
? '#D6C39D'
: '#A7AAC6'
}
showInfo={false}
percent={75}
/>
<div className={styles['progress-score']}>
<span>5000/15000</span>
<span>白银会员</span>
</div>
<div>当前活跃分</div>
</div>
</div>
</div>
<div className={styles['mainCol-chart-main']}>
<div className={styles['mainCol-chart-main-line']}>line</div>
</div>
</div>
</Col>
<Col className={styles['mainCol']} span={24}>
<div className={styles['mainCol-title']}>活跃分获取记录</div>
</Col>
</Row>
);
};
export default LevelDetail;
......@@ -4,7 +4,7 @@ import { FORM_FILTER_PATH } from '@/formSchema/const';
export const auditSchema: ISchema = {
type: 'object',
properties: {
megaLayout: {
MEGA_LAYOUT: {
type: 'object',
'x-component': 'mega-layout',
properties: {
......@@ -25,7 +25,6 @@ export const auditSchema: ISchema = {
name: {
type: 'string',
'x-component': 'Search',
'x-mega-props': {},
'x-component-props': {
placeholder: '搜索',
},
......@@ -46,42 +45,31 @@ export const auditSchema: ISchema = {
properties: {
memberType: {
type: 'string',
'x-component-props': {
placeholder: '请选择',
defaultValue: 0,
},
default: 0,
enum: [],
'x-component-props': {},
},
roleId: {
type: 'string',
'x-component-props': {
placeholder: '请选择',
defaultValue: 0,
},
default: 0,
enum: [],
'x-component-props': {},
},
level: {
type: 'string',
'x-component-props': {
placeholder: '请选择',
defaultValue: 0,
},
default: 0,
enum: [],
'x-component-props': {},
},
source: {
type: 'string',
'x-component-props': {
placeholder: '请选择',
defaultValue: 0,
},
default: 0,
enum: [],
'x-component-props': {},
},
timeRange: {
type: 'string',
'x-component-props': {
placeholder: '请选择',
defaultValue: 0,
},
default: 0,
enum: [
{ label: '时间范围(全部)', value: 0 },
{ label: '今天', value: 1 },
......@@ -92,6 +80,7 @@ export const auditSchema: ISchema = {
{ label: '一年内', value: 6 },
{ label: '一年前', value: 7 },
],
'x-component-props': {},
},
submit: {
'x-component': 'Submit',
......@@ -108,3 +97,38 @@ export const auditSchema: ISchema = {
},
},
};
export const auditModalSchema: ISchema = {
type: 'object',
properties: {
MEGA_LAYOUT: {
type: 'object',
'x-component': 'mega-layout',
'x-component-props': {
labelAlign: 'top',
},
properties: {
agree: {
type: 'string',
default: 1,
enum: [
{ label: '审核通过', value: 1 },
{ label: '审核不通过', value: 0 },
],
'x-component': 'radio',
'x-component-props': {},
},
reason: {
type: 'string',
title: '审核不通过原因',
'x-component': 'textarea',
'x-component-props': {
placeholder: '在此输入你的内容,最长120个字符,60个汉字',
maxLength: 60,
},
'x-rules': [{ required: true, message: '请填写审核不通过原因' }],
},
},
},
},
};
import React from 'react';
import MemberDetail from '../components/memberDetail';
const ImportDetail = () => {
return <MemberDetail />;
};
export default ImportDetail;
This diff is collapsed.
import React from 'react';
import { ISchema } from '@formily/antd';
import { FORM_FILTER_PATH } from '@/formSchema/const';
export const importSchema: ISchema = {
type: 'object',
properties: {
megaLayout: {
mageLayout: {
type: 'object',
'x-component': 'mega-layout',
properties: {
......@@ -23,10 +22,9 @@ export const importSchema: ISchema = {
children: '{{controllerBtns}}',
},
},
name: {
cond: {
type: 'string',
'x-component': 'Search',
'x-mega-props': {},
'x-component-props': {
placeholder: '搜索',
},
......@@ -47,42 +45,31 @@ export const importSchema: ISchema = {
properties: {
memberType: {
type: 'string',
'x-component-props': {
placeholder: '请选择',
defaultValue: 0,
},
default: 0,
enum: [],
'x-component-props': {},
},
roleId: {
type: 'string',
'x-component-props': {
placeholder: '请选择',
defaultValue: 0,
},
default: 0,
enum: [],
'x-component-props': {},
},
level: {
type: 'string',
'x-component-props': {
placeholder: '请选择',
defaultValue: 0,
},
default: 0,
enum: [],
'x-component-props': {},
},
source: {
type: 'string',
'x-component-props': {
placeholder: '请选择',
defaultValue: 0,
},
default: 0,
enum: [],
'x-component-props': {},
},
timeRange: {
type: 'string',
'x-component-props': {
placeholder: '请选择',
defaultValue: 0,
},
default: 0,
enum: [
{ label: '时间范围(全部)', value: 0 },
{ label: '今天', value: 1 },
......@@ -93,6 +80,7 @@ export const importSchema: ISchema = {
{ label: '一年内', value: 6 },
{ label: '一年前', value: 7 },
],
'x-component-props': {},
},
submit: {
'x-component': 'Submit',
......@@ -110,6 +98,34 @@ export const importSchema: ISchema = {
},
};
export const auditModalSchema = props => {
let modalSchema: ISchema = {
type: 'object',
properties: {
MEGA_LAYOUT: {
type: 'object',
'x-component': 'mega-layout',
'x-component-props': {
labelAlign: 'top',
},
properties: {
remark: {
type: 'string',
title: `会员${props.status === 1 ? '解冻' : '冻结'}原因`,
'x-component': 'textarea',
'x-component-props': {
placeholder: '在此输入你的内容,最长120个字符,60个汉字',
maxLength: 60,
},
'x-rules': [{ required: true, message: '请填写审核不通过原因' }],
},
},
},
},
};
return modalSchema;
};
const getCompnentValue = (elements: any) => {
let components = {};
for (let item of elements) {
......
import React, { ReactNode, useState, useRef, useEffect } from 'react';
import { history } from 'umi';
import { Row, Col, Tooltip, Button, Popconfirm, Card, Input } from 'antd';
import {
PlayCircleOutlined,
PauseCircleOutlined,
EyeOutlined,
} from '@ant-design/icons';
import { StandardTable } from 'god';
import { ColumnType } from 'antd/lib/table/interface';
import style from './index.less';
import { PublicApi } from '@/services/api';
const data = [
{
key: '1',
id: '1',
level: '1',
levelTab: '钻石会员',
levelType: '商户会员',
scoreTab: '交易分',
name: '采购商',
type: '服务消费',
roleType: '企业会员',
thresvalue: '100000',
status: 1,
},
{
key: '2',
id: '2',
level: '2',
levelTab: '钻石会员',
levelType: '商户会员',
scoreTab: '交易分',
name: '采购商',
type: '服务消费',
roleType: '企业会员',
thresvalue: '100000',
status: 2,
},
{
key: '3',
id: '3',
level: '3',
levelTab: '钻石会员',
levelType: '商户会员',
scoreTab: '交易分',
name: '采购商',
type: '服务消费',
roleType: '企业会员',
thresvalue: '100000',
status: 1,
},
{
key: '4',
id: '4',
level: '4',
levelTab: '钻石会员',
levelType: '商户会员',
scoreTab: '交易分',
name: '采购商',
type: '服务消费',
roleType: '企业会员',
thresvalue: '100000',
status: 2,
},
];
const memberLevel: React.FC<[]> = () => {
const ref = useRef({});
const [keywords, setKeywords] = useState('');
const columns: ColumnType<any>[] = [
{
title: 'ID',
dataIndex: 'id',
align: 'center',
key: 'id',
},
{
title: '会员等级',
dataIndex: 'level',
align: 'center',
key: 'level',
render: (text: any, record: any) => (
<div className={style[`levelIcon${record.level}`]}></div>
),
},
{
title: '会员等级标签',
dataIndex: 'levelTab',
align: 'center',
key: 'levelTab',
render: (text: any, record: any) => (
<span className={style.nameCellTitle} onClick={() => handleSee(record)}>
{text}&nbsp;
<EyeOutlined />
</span>
),
},
{
title: '会员等级类型',
dataIndex: 'levelType',
align: 'center',
key: 'levelType',
},
{
title: '升级分值标签',
dataIndex: 'scoreTab',
align: 'center',
key: 'scoreTab',
},
{
title: '会员角色名称',
dataIndex: 'name',
align: 'center',
key: 'name',
},
{
title: '角色类型',
dataIndex: 'type',
align: 'center',
key: 'type',
},
{
title: '会员类型',
dataIndex: 'roleType',
align: 'center',
key: 'roleType',
},
{
title: '升级阈值',
dataIndex: 'thresvalue',
align: 'center',
key: 'thresvalue',
},
{
title: '状态',
dataIndex: 'status',
align: 'center',
key: 'status',
render: (text: any, record: any) => {
let component: ReactNode = null;
component = (
<Popconfirm
title="确定要执行这个操作?"
onConfirm={confirm}
onCancel={cancel}
okText="是"
cancelText="否"
>
<Button
type="link"
onClick={() => handleModify(record)}
style={
record.status === 1 ? { color: '#00B37A' } : { color: 'red' }
}
>
{record.status === 1 ? (
<>
<span>有效</span>
<PlayCircleOutlined />
</>
) : (
<>
<span>无效</span>
<PauseCircleOutlined />
</>
)}
</Button>
</Popconfirm>
);
return component;
},
},
{
title: '操作',
dataIndex: 'option',
align: 'center',
render: (record: any) => (
<Button type="link" onClick={record => handleSet(record)}>
设置
</Button>
),
},
];
// 模拟请求
const fetchData = (params: any) => {
return new Promise((resolve, reject) => {
PublicApi.getMemberManageLevelPage({
cond: '',
current: params.current,
pageSize: params.pageSize,
}).then(res => {
resolve(res.data);
});
});
};
useEffect(() => {
console.log(keywords);
});
const handleSee = (record: any) => {};
const confirm = () => {
console.log('confirm');
};
const cancel = () => {
console.log('cancel');
};
const handleModify = (record: object) => {
// 通过传入的params字符串判断是修改那种类型的数据
console.log('执行状态修改', record);
};
const handleSearch = () => {};
const handleReset = () => {};
const handleSet = (record: any) => {
history.push('/memberAbility/manage/level/addEquity');
};
return (
<Card>
<StandardTable
tableProps={{ rowKey: 'id' }}
columns={columns}
currentRef={ref}
fetchTableData={(params: any) => fetchData(params)}
controlRender={
<Row>
<Col className={style.col} span={12} offset={12}>
<Tooltip
trigger={['focus']}
placement="top"
title={
<span>
输入ID、会员等级、会员角色名称&nbsp;&nbsp;进行搜索
</span>
}
>
<Input.Search
style={{ width: '232px' }}
value={keywords}
placeholder="搜索"
onChange={e => setKeywords(e.target.value)}
onSearch={() => handleSearch}
/>
</Tooltip>
<Button className={style.resetBtn} onClick={() => handleReset()}>
重置
</Button>
</Col>
</Row>
}
/>
</Card>
);
};
export default memberLevel;
import React, { ReactNode, useState, useRef, useEffect } from 'react';
import React, { useRef } from 'react';
import { history } from 'umi';
import { Row, Col, Tooltip, Button, Popconfirm, Card, Input } from 'antd';
import {
PlayCircleOutlined,
PauseCircleOutlined,
EyeOutlined,
} from '@ant-design/icons';
import { Button, Card } from 'antd';
import { StandardTable } from 'god';
import { ColumnType } from 'antd/lib/table/interface';
import style from './index.less';
import { createFormActions } from '@formily/antd';
import EyePreview from '@/components/EyePreview';
import StatusSwitch from '@/components/StatusSwitch';
import NiceForm from '@/components/NiceForm';
import { useStateFilterSearchLinkageEffect } from '@/formSchema/effects/useFilterSearch';
import { FORM_FILTER_PATH } from '@/formSchema/const';
import { levelSchema } from './schema';
import { PublicApi } from '@/services/api';
import styles from './index.less';
const data = [
{
key: '1',
id: '1',
level: '1',
levelTab: '钻石会员',
levelType: '商户会员',
scoreTab: '交易分',
name: '采购商',
type: '服务消费',
roleType: '企业会员',
thresvalue: '100000',
status: 1,
},
{
key: '2',
id: '2',
level: '2',
levelTab: '钻石会员',
levelType: '商户会员',
scoreTab: '交易分',
name: '采购商',
type: '服务消费',
roleType: '企业会员',
thresvalue: '100000',
status: 2,
},
{
key: '3',
id: '3',
level: '3',
levelTab: '钻石会员',
levelType: '商户会员',
scoreTab: '交易分',
name: '采购商',
type: '服务消费',
roleType: '企业会员',
thresvalue: '100000',
status: 1,
},
{
key: '4',
id: '4',
level: '4',
levelTab: '钻石会员',
levelType: '商户会员',
scoreTab: '交易分',
name: '采购商',
type: '服务消费',
roleType: '企业会员',
thresvalue: '100000',
status: 2,
},
];
const formActions = createFormActions();
const memberLevel: React.FC<[]> = () => {
const ref = useRef({});
const [keywords, setKeywords] = useState('');
const fetchData = async (params: any) => {
const res = await PublicApi.getMemberManageLevelPage(params);
return res.data;
};
const MemberLevel: React.FC<[]> = () => {
const ref = useRef<any>({});
const columns: ColumnType<any>[] = [
{
......@@ -83,148 +36,97 @@ const memberLevel: React.FC<[]> = () => {
align: 'center',
key: 'level',
render: (text: any, record: any) => (
<div className={style[`levelIcon${record.level}`]}></div>
<div className={styles[`levelIcon${record.level}`]}></div>
),
},
{
title: '会员等级标签',
dataIndex: 'levelTab',
dataIndex: 'levelTag',
align: 'center',
key: 'levelTab',
key: 'levelTag',
render: (text: any, record: any) => (
<span className={style.nameCellTitle} onClick={() => handleSee(record)}>
{text}&nbsp;
<EyeOutlined />
</span>
<EyePreview
url={`/memberCenter/memberAbility/manage/addEquity?id=${record.id}&preview=1`}
>
{text}
</EyePreview>
),
},
{
title: '会员等级类型',
dataIndex: 'levelType',
dataIndex: 'memberLevelType',
align: 'center',
key: 'levelType',
key: 'memberLevelType',
},
{
title: '升级分值标签',
dataIndex: 'scoreTab',
dataIndex: 'scoreTag',
align: 'center',
key: 'scoreTab',
key: 'scoreTag',
},
{
title: '会员角色名称',
dataIndex: 'name',
dataIndex: 'roleName',
align: 'center',
key: 'name',
key: 'roleName',
},
{
title: '角色类型',
dataIndex: 'type',
dataIndex: 'roleTypeName',
align: 'center',
key: 'type',
key: 'roleTypeName',
},
{
title: '会员类型',
dataIndex: 'roleType',
dataIndex: 'memberTypeName',
align: 'center',
key: 'roleType',
key: 'memberTypeName',
},
{
title: '升级阈值',
dataIndex: 'thresvalue',
dataIndex: 'levelUpPoint',
align: 'center',
key: 'thresvalue',
key: 'levelUpPoint',
},
{
title: '状态',
dataIndex: 'status',
align: 'center',
key: 'status',
render: (text: any, record: any) => {
let component: ReactNode = null;
component = (
<Popconfirm
title="确定要执行这个操作?"
onConfirm={confirm}
onCancel={cancel}
okText="是"
cancelText="否"
>
<Button
type="link"
onClick={() => handleModify(record)}
style={
record.status === 1 ? { color: '#00B37A' } : { color: 'red' }
}
>
{record.status === 1 ? (
<>
<span>有效</span>
<PlayCircleOutlined />
</>
) : (
<>
<span>无效</span>
<PauseCircleOutlined />
</>
)}
</Button>
</Popconfirm>
);
return component;
},
render: (text: any, record: any) => (
<StatusSwitch
handleConfirm={() => handleModify(record)}
record={record}
fieldNames="status"
/>
),
},
{
title: '操作',
dataIndex: 'option',
align: 'center',
render: (record: any) => (
<Button type="link" onClick={record => handleSet(record)}>
render: (text: any, record: any) => (
<Button
type="link"
onClick={() =>
history.push(`/memberCenter/memberAbility/manage/addEquity?id=${record.id}`)
}
>
设置
</Button>
),
},
];
// 模拟请求
const fetchData = (params: any) => {
return new Promise((resolve, reject) => {
PublicApi.getMemberManageLevelPage({
cond: '',
current: params.current,
pageSize: params.pageSize,
}).then(res => {
resolve(res.data);
});
const handleModify = record => {
PublicApi.postMemberManageLevelStatus({
id: record.id,
status: record.status === 1 ? 0 : 1,
}).then(res => {
if (res.code === 1000) return ref.current.reload();
});
};
useEffect(() => {
console.log(keywords);
});
const handleSee = (record: any) => {};
const confirm = () => {
console.log('confirm');
};
const cancel = () => {
console.log('cancel');
};
const handleModify = (record: object) => {
// 通过传入的params字符串判断是修改那种类型的数据
console.log('执行状态修改', record);
};
const handleSearch = () => {};
const handleReset = () => {};
const handleSet = (record: any) => {
history.push('/memberAbility/manage/level/addEquity');
};
return (
<Card>
<StandardTable
......@@ -233,34 +135,26 @@ const memberLevel: React.FC<[]> = () => {
currentRef={ref}
fetchTableData={(params: any) => fetchData(params)}
controlRender={
<Row>
<Col className={style.col} span={12} offset={12}>
<Tooltip
trigger={['focus']}
placement="top"
title={
<span>
输入ID、会员等级、会员角色名称&nbsp;&nbsp;进行搜索
</span>
}
>
<Input.Search
style={{ width: '232px' }}
value={keywords}
placeholder="搜索"
onChange={e => setKeywords(e.target.value)}
onSearch={() => handleSearch}
/>
</Tooltip>
<Button className={style.resetBtn} onClick={() => handleReset()}>
重置
</Button>
</Col>
</Row>
<NiceForm
actions={formActions}
onSubmit={values => ref.current.reload(values)}
effects={($, actions) => {
$('onFormInputChange').subscribe(state => {
ref.current.reload(state.values);
});
useStateFilterSearchLinkageEffect(
$,
actions,
'cond',
FORM_FILTER_PATH,
);
}}
schema={levelSchema}
/>
}
/>
</Card>
);
};
export default memberLevel;
export default MemberLevel;
import { ISchema } from '@formily/antd';
import { FORM_FILTER_PATH } from '@/formSchema/const';
export const levelSchema: ISchema = {
type: 'object',
properties: {
MEGA_LAYOUI: {
type: 'object',
'x-component': 'mega-layout',
properties: {
topLayout: {
type: 'object',
'x-component': 'mega-layout',
'x-component-props': {
grid: true,
},
properties: {
name: {
type: 'string',
'x-component': 'Search',
'x-component-props': {
placeholder: '搜索',
},
},
},
},
},
},
},
};
This diff is collapsed.
import React from 'react';
import MemberDetail from '../components/memberDetail';
const MaintainDetail = () => {
return <MemberDetail />;
};
export default MaintainDetail;
......@@ -90,3 +90,191 @@ export const maintianSchema: ISchema = {
},
},
};
export const auditModalSchema = props => {
let modalSchema: ISchema = {
type: 'object',
properties: {
MEGA_LAYOUT: {
type: 'object',
'x-component': 'mega-layout',
'x-component-props': {
labelAlign: 'top',
},
properties: {
remark: {
type: 'string',
title: `会员${props.status === 1 ? '解冻' : '冻结'}原因`,
'x-component': 'textarea',
'x-component-props': {
placeholder: '在此输入你的内容,最长120个字符,60个汉字',
maxLength: 60,
},
'x-rules': [{ required: true, message: '请填写审核不通过原因' }],
},
},
},
},
};
return modalSchema;
};
const getCompnentValue = (elements: any) => {
let components = {};
for (let item of elements) {
let xComponentProps =
item.fieldType === 'string'
? {
placeholder: item.fieldRemark,
}
: {
listType: 'card',
action: '/api/file/file/upload',
data: { fileType: 2 },
fileList: [],
onChange: file => console.log(file),
};
components[item.fieldName] = {
type: item.fieldType,
required: item.fieldEmpty === 0,
title: item.fieldCNName,
'x-component-props': xComponentProps,
};
}
return components;
};
export const initDetailSchema = (props: any) => {
let tabSchema = {
properties: {
'tab-1': {
type: 'object',
'x-component': 'tabpane',
'x-component-props': {
tab: '基本信息',
},
properties: {
MEGA_LAYOUT1: {
type: 'object',
'x-component': 'mega-layout',
'x-component-props': {
labelCol: 4,
wrapperCol: 8,
labelAlign: 'left',
},
properties: {
memberTypeId: {
type: 'string',
required: true,
title: '会员类型',
enum: [],
'x-component-props': {
placeholder: '请选择',
},
},
roleId: {
type: 'string',
required: true,
title: '会员角色',
enum: [],
'x-component-props': {
placeholder: '请选择',
},
},
level: {
type: 'string',
required: true,
title: '会员等级',
enum: [],
'x-component-props': {
placeholder: '请选择',
},
},
MEGA_LAYOUT1_1: {
type: 'object',
'x-component': 'mega-layout',
'x-component-props': {
label: '注册手机',
wrapperCol: 24,
required: true,
},
properties: {
MEGA_LAYOUT1_1_1: {
type: 'object',
'x-component': 'mega-layout',
'x-component-props': {
grid: true,
full: true,
},
properties: {
telCode: {
type: 'string',
enum: [],
'x-component-props': {
placeholder: '请选择',
},
required: true,
},
tel: {
type: 'string',
'x-mega-props': { span: 2 },
'x-component-props': {
placeholder: '请输入你的手机号码',
maxLength: 11,
},
required: true,
},
},
},
},
},
memberEmail: {
type: 'string',
title: '邮箱',
'x-component-props': {},
},
},
},
},
},
},
};
if (Object.keys(props).length > 0) {
for (let [index, item] of props.groups.entries()) {
tabSchema.properties[`tab-${index + 2}`] = {
type: 'object',
'x-component': 'tabpane',
'x-component-props': {
tab: item.groupName,
},
properties: {
[`MEGA_LAYOUT${index + 2}`]: {
type: 'object',
'x-component': 'mega-layout',
'x-component-props': {
labelCol: 4,
wrapperCol: 8,
labelAlign: 'left',
},
properties: getCompnentValue(item.elements),
},
},
};
}
}
let detailSchema = {
type: 'object',
properties: {
REPOSIT_TABS: {
type: 'object',
'x-component': 'tab',
'x-component-props': {},
...tabSchema,
},
},
};
const maintianDetailSchema: ISchema = detailSchema;
return maintianDetailSchema;
};
......@@ -2,7 +2,7 @@ import React from 'react';
import AuditDetail from '../components/auditDetail';
const auditPr = (props: any) => {
return <AuditDetail auditType="2" routeParams={props.location.query} />;
return <AuditDetail auditType="3" routeParams={props.location.query} />;
};
export default auditPr;
......@@ -2,7 +2,7 @@ import React from 'react';
import AuditDetail from '../components/auditDetail';
const auditPrConfirm = props => {
return <AuditDetail auditType="3" routeParams={props.location.query} />;
return <AuditDetail auditType="4" routeParams={props.location.query} />;
};
export default auditPrConfirm;
import React, { useState, useRef, ReactNode } from 'react';
import { history } from 'umi';
import { PageHeaderWrapper } from '@ant-design/pro-layout';
import { Card, Input, Button } from 'antd';
import { ContainerOutlined } from '@ant-design/icons';
import { StandardTable } from 'god';
import { ColumnType } from 'antd/lib/table/interface';
import {
IFormFilter,
IButtonFilter,
} from 'god/dist/src/standard-table/TableController';
import './index.less';
import { PublicApi } from '@/services/api';
const data = [
{
key: '1',
id: '1',
rule: 1,
explain: '完成交易订单后,按照交易订单金额的百分比记入获取的升级分值',
type: '商户会员',
score: '',
},
{
key: '2',
id: '2',
rule: 1,
explain: '完成交易订单后,按照交易订单金额的百分比记入获取的升级分值',
type: '渠道会员',
score: '',
},
{
key: '3',
id: '3',
rule: 2,
explain: '完成交易订单后,按照交易订单金额的百分比记入获取的升级分值',
type: '商户会员',
score: '',
},
{
key: '4',
id: '4',
rule: 3,
explain: '完成交易订单后,按照交易订单金额的百分比记入获取的升级分值',
type: '商户会员',
score: '',
},
];
const fetchData = async (params: any) => {
const res = await PublicApi.getMemberManageLevelRulePage(params);
return res.data;
};
const memberUpgradeRule: React.FC<[]> = () => {
const MemberUpgradeRule: React.FC<[]> = () => {
const ref = useRef({});
const columns: ColumnType<any>[] = [
......@@ -57,69 +23,67 @@ const memberUpgradeRule: React.FC<[]> = () => {
key: 'id',
},
{
title: '升级规则',
dataIndex: 'rule',
align: 'center',
key: 'rule',
render: (text: any, record: any) => (
<span>
{record.rule === 1 ? '交易' : record.rule === 2 ? '评价' : '登录'}
</span>
),
},
{
title: '升级规则说明',
dataIndex: 'explain',
title: '项目',
dataIndex: 'ruleName',
align: 'center',
key: 'explain',
key: 'ruleName',
render: (text: any, record: any) => <span>{text}</span>,
},
{
title: '适用会员等级类型',
dataIndex: 'type',
title: '项目说明',
dataIndex: 'remark',
align: 'center',
key: 'type',
key: 'remark',
},
{
title: '可获取的分值',
dataIndex: 'score',
dataIndex: 'point',
align: 'center',
key: 'score',
key: 'point',
render: (text: any, record: any) => {
let component: ReactNode = null;
component =
record.rule === 1 ? (
<Input addonAfter="%" defaultValue={record.score} />
record.id === 1 ? (
<Input
addonAfter="%"
value={record.point}
onChange={e => {
e.preventDefault();
record.point = e.target.value;
}}
/>
) : (
<Input defaultValue={record.score} />
<Input value={record.point} />
);
return component;
},
},
];
// 模拟请求
const fetchData = (params: any) => {
console.log(params);
return new Promise((resolve, reject) => {
PublicApi.getMemberManageLevelRulePage({
current: params.current,
pageSize: params.pageSize,
}).then(res => {
resolve(res.data);
});
});
};
const handleSubmit = () => {};
return (
<Card>
<StandardTable
tableProps={{ rowKey: 'id' }}
columns={columns}
currentRef={ref}
fetchTableData={(params: any) => fetchData(params)}
/>
</Card>
<PageHeaderWrapper
extra={
<Button
type="primary"
icon={<ContainerOutlined />}
onClick={handleSubmit}
>
保存
</Button>
}
>
<Card>
<StandardTable
tableProps={{ rowKey: 'id' }}
columns={columns}
currentRef={ref}
fetchTableData={(params: any) => fetchData(params)}
/>
</Card>
</PageHeaderWrapper>
);
};
export default memberUpgradeRule;
export default MemberUpgradeRule;
......@@ -13,10 +13,10 @@ import { StandardTable } from 'god'
import ReutrnEle from '@/components/ReturnEle';
import './index.less'
import NiceForm, {FlexBox} from '@/components/NiceForm'
import { repositDetailSchema, repositMoreSchema, repositSchema, repositTabOneSchema, repositInSchema } from './schema'
import { repositDetailSchema, repositMoreSchema, repositSchema, repositTabOneSchema, repositInSchema, repositOutSchema } from './schema'
import { createFormActions, ISchema, FormButtonGroup, Submit, FormEffectHooks, FormProvider, FormSpy, createAsyncFormActions } from '@formily/antd'
import EyePreview from '@/components/EyePreview'
import { findItemAndDelete, omit } from '@/utils'
import { findItemAndDelete, omit, getStepNumber } from '@/utils'
import { PublicApi } from '@/services/api'
import { useRowSelectionTable } from '@/hooks/useRowSelectionTable'
import { useAsyncSelect } from '@/formSchema/effects/useAsyncSelect'
......@@ -49,7 +49,8 @@ const fetchDepositAllList = async () => {
}
const addSchemaAction = createFormActions()
const repositSchemaAction = createAsyncFormActions()
const repositInAction = createAsyncFormActions()
const repositOutAction = createAsyncFormActions()
const AddRepository:React.FC<{}> = (props) => {
const ref = useRef<any>({})
......@@ -132,9 +133,8 @@ const AddRepository:React.FC<{}> = (props) => {
key: 'unitName',
},
]
useEffect(() => {
PublicApi.getWarehouseWarehouseAll().then(({data}) => {
PublicApi.getWarehouseFreightSpaceAll().then(({data}) => {
setReposits(data)
})
}, [])
......@@ -242,6 +242,9 @@ const AddRepository:React.FC<{}> = (props) => {
}
}
}
const reloadRepot = () => {
}
// 商品选择
......@@ -270,13 +273,27 @@ const AddRepository:React.FC<{}> = (props) => {
await PublicApi.postWarehouseFreightSpaceAllotFold(params)
}
// 库存调出表单提交
const handleRespotOut = async (values) => {
const params = {}
Object.entries(values).forEach(([key, value]) => {
if (!key.includes('NO_SUBMIT')) {
params[key] = value
}
})
await PublicApi.postWarehouseFreightSpaceAllotFold(params)
}
const transforInBtn = <Row justify='center'>
<Button type='primary' htmlType='submit'>调入</Button>
</Row>
const transforOutBtn = <Row justify='center'>
<Button type='primary' htmlType='submit'>调出</Button>
</Row>
const topTableChange = (tabs) => {
if (tabs === 'tab2') {
repositSchemaAction.getFieldValue('NO_SUBMIT1').then(data => {
repositInAction.getFieldValue('NO_SUBMIT1').then(data => {
console.log(data)
}) // 调入的数值
......@@ -325,21 +342,24 @@ const AddRepository:React.FC<{}> = (props) => {
return (
<NiceForm
schema={repositInSchema}
actions={repositSchemaAction}
actions={repositInAction}
onSubmit={handleRespotIn}
effects={async ($, {setFieldState}) => {
const utils = useLinkageUtils()
FormEffectHooks.onFormMount$().subscribe(() => {
const name = spyForm.getFieldValue('name')
console.log(reposits)
const asyncEnums = reposits.map(v => ({
label: v.name,
value: v.id
}))
utils.enum('freightSpaceId', asyncEnums)
$('onFieldInputChange', 'freightSpaceId').subscribe(state => {
const numberValue = reposits.find(v => v.id === state.value).principal || 0
const numberValue = reposits.find(v => v.id === state.value).inventory || 0
utils.value('NO_SUBMIT1', numberValue)
setFieldState('foldInventory', state => {
state.props["x-component-props"].max = numberValue
state.props["x-component-props"].marks = getStepNumber(numberValue)
})
})
// 调入仓位信息
utils.enum('foldFreightSpaceId', [
......@@ -359,7 +379,49 @@ const AddRepository:React.FC<{}> = (props) => {
</FormSpy>
</Tabs.TabPane>
<Tabs.TabPane tab='库存调出' key="tab2-2" forceRender>2</Tabs.TabPane>
<Tabs.TabPane tab='库存调出' key="tab2-2" forceRender>
<FormSpy>
{({ form: spyForm }) => {
return (
<NiceForm
schema={repositOutSchema}
actions={repositOutAction}
onSubmit={handleRespotOut}
effects={async ($, {setFieldState}) => {
const utils = useLinkageUtils()
FormEffectHooks.onFormMount$().subscribe(() => {
const name = spyForm.getFieldValue('name')
const asyncEnums = reposits.map(v => ({
label: v.name,
value: v.id
}))
utils.enum('foldFreightSpaceId', asyncEnums)
$('onFieldInputChange', 'foldFreightSpaceId').subscribe(state => {
const numberValue = reposits.find(v => v.id === state.value).inventory || 0
utils.value('NO_SUBMIT2', numberValue)
setFieldState('foldInventory', state => {
state.props["x-component-props"].max = numberValue
state.props["x-component-props"].marks = getStepNumber(numberValue)
})
})
// 调入仓位信息
utils.enum('freightSpaceId', [
{label: name, value: id}
])
utils.value('freightSpaceId', id)
utils.value('NO_SUBMIT1', spyForm.getFieldValue('inventory'))
})
}}
expressionScope={{
transforOutBtn
}}
>
</NiceForm>
)
}}
</FormSpy>
</Tabs.TabPane>
<Tabs.TabPane tab='调拨记录' key="tab2-3">3</Tabs.TabPane>
</Tabs>
</Tabs.TabPane>
......
......@@ -731,3 +731,83 @@ export const repositInSchema: ISchema = {
}
}
}
// 库存调出
export const repositOutSchema: ISchema = {
type: 'object',
properties: {
repos_layout: {
type: 'object',
"x-component": 'mega-layout',
"x-component-props": {
grid: true,
autoRow: true,
labelCol: 8,
labelAlign: 'left',
columns: 2
},
properties: {
'freightSpaceId': {
type: 'string',
title: '调出仓位名称',
enum: [],
required: true,
"x-component-props": {
disabled: true
},
"x-mega-props": {
span: 1
}
},
'foldFreightSpaceId': {
type: 'string',
title: '调入仓位名称',
enum: [],
"x-mega-props": {
span: 1
},
required: true
},
'NO_SUBMIT1': {
type: 'object',
readOnly: true,
title: '当前仓位库存(尺)',
"x-component": 'CircleBox',
default: 0
},
'NO_SUBMIT2': {
type: 'object',
title: '当前仓位库存(尺)',
"x-component": 'CircleBox',
default: 0
},
"foldInventory": {
type: 'number',
"x-component": "CustomSlider",
"x-component-props": {
width: '80%',
isNumber: true,
max: 0,
min: 0,
layout: {
display: 'flex',
flexDirection: 'column',
alignItems: 'center',
justifyContent: 'center'
}
},
"x-mega-props": {
span: 2
}
},
}
},
submit: {
type: 'object',
"x-component": 'Children',
"x-component-props": {
children: "{{transforOutBtn}}"
}
}
}
}
......@@ -20,7 +20,6 @@ export const inventorySchema: ISchema = {
[FORM_FILTER_PATH]: {
type: 'object',
'x-component': 'mega-layout',
visible: false,
'x-component-props': {
inline: true,
},
......
......@@ -274,7 +274,7 @@ const UserRegistry = () => {
v.elements.map(field => {
// 字段类型暂时为null, 所以固定为input
switch(field.fieldType) {
case 'file': return (
case 'upload': return (
<Field
x-mega-props={{span: 1}}
name={field.fieldName}
......
This source diff could not be displayed because it is too large. You can view the blob instead.
......@@ -13,6 +13,6 @@ export const useLinkageUtils = () => {
enum: linkage('props.enum', []),
loading: linkage('loading', true),
loaded: linkage('loading', false),
value: linkage('value')
value: linkage('value'),
}
}
......@@ -106,6 +106,50 @@ export function timeRange(val: number) {
return { st, et }
}
// 判断是否是素数
export function isPrimeNum(num){
if (!isNum(num)){
return false;
}
if (!isInteger(num)){
return false;
}
if (num==2||num==3||num==5) {
return true;
}
if (!isDual(num)){
return false;
}
if (!isThree(num)){
return false;
}
for (var i = 2; i < num/5+1; i++) {
if (num%i==0){
return false;
}
};
return true;
}
function isInteger(num){
return num == ~~num ? true : false;
}
function isNum(num){
return num == +num ? true : false;
}
function isDual(num){
var num = num.toString();
var lastNum = num.substring(num.length-1,num.length);
return lastNum%2 == 0 || lastNum%5 == 0 ? false : true;
}
function isThree(num){
var str = num.toString();
var sum = 0;
for (var i = 0; i < str.length; i++) {
sum += +str.substring(i,i+1);
};
return sum%3 == 0 ? false : true;
}
export function omit(obj: any, arr: string[]) {
const tempObj = { ...obj }
for (let i = 0; i < arr.length; i++) {
......@@ -150,6 +194,34 @@ export const dupliArr = (arr: any[]) => {
return Array.from(new Set(arr))
}
// 获取最小的差距值
export const getDistanceNumber = (target, step, min) => {
const value = target / step
if (value >= min) {
let num = 0
const result = {}
while (num < target) {
result[num] = num
num += Math.ceil(value)
}
result[target] = target
return result
} else {
return getDistanceNumber(target, step--, min)
}
}
// 将数字拆分成指定区间
export const getStepNumber = (target: number, step?: number) => {
// 最小相差10
const minDistance = 10
step = step || 4
const marks = getDistanceNumber(target, step, minDistance)
return marks
}
// 遍历树拿到所有key的集合
export const findTreeKeys = (arr: any[], keyword?: ReactText) => {
const copyArr: any[] = deepClone(arr)
......
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