Commit efdaf2b9 authored by 前端-钟卫鹏's avatar 前端-钟卫鹏
parents 1a5840df 1d4f6891
......@@ -3,7 +3,6 @@ import { Space } from 'antd';
import { getIntl } from 'umi';
const intl = getIntl();
const CustomStatus = props => {
console.log(props);
return (
<>
<Space>
......
......@@ -79,8 +79,8 @@ const BasicLayout: React.FC<BasicLayoutProps> = (props) => {
const isHome = location.pathname === '/memberCenter/home'
const handleMenuCollapse = (payload: boolean): void => {
if(DEFAULT_COLLAPSED_LIST.includes(location.pathname)) {
return ;
if (DEFAULT_COLLAPSED_LIST.includes(location.pathname)) {
return;
}
setCollapsed(payload)
if (payload) {
......@@ -139,7 +139,7 @@ const BasicLayout: React.FC<BasicLayoutProps> = (props) => {
}, [currentRouter, collapsed])
useLayoutEffect(() => {
if(DEFAULT_COLLAPSED_LIST.includes(location.pathname)) {
if (DEFAULT_COLLAPSED_LIST.includes(location.pathname)) {
setCollapsed(true)
} else {
setCollapsed(false);
......@@ -148,11 +148,11 @@ const BasicLayout: React.FC<BasicLayoutProps> = (props) => {
const prolayoutStyle = isHome
? {
minHeight: '100vh',
minWidth: '1280px',
}
minHeight: '100vh',
minWidth: '1280px',
}
: {}
console.log(currentRouter)
// console.log(currentRouter)
return currentRouter?.noLayout ? props.children : (
<ProLayout
pageTitleRender={() => currentRouter ? currentRouter.name : window.location.href}
......@@ -167,7 +167,7 @@ const BasicLayout: React.FC<BasicLayoutProps> = (props) => {
</Link>
)}
collapsed={collapsed}
collapsedButtonRender={(flag) => (DEFAULT_COLLAPSED_LIST.includes(location.pathname) ? null : flag ? <MenuUnfoldOutlined /> : <MenuFoldOutlined/>) }
collapsedButtonRender={(flag) => (DEFAULT_COLLAPSED_LIST.includes(location.pathname) ? null : flag ? <MenuUnfoldOutlined /> : <MenuFoldOutlined />)}
onCollapse={handleMenuCollapse}
disableContentMargin={currentRouter?.noMargin !== undefined}
breadcrumbRender={(routers = []) => [
......
......@@ -28,7 +28,7 @@ import TabTree, {
useTreeActions,
createTreeActions,
} from '@/components/TabTree';
import { getMemberRoleAuthTree, getMemberOrgTree, postMemberRoleAdd, postMemberRoleUpdate, getMemberRoleGet, getMemberRoleAuthButton, getMemberRoleAuthButtonCheck, } from '@/services/MemberV2Api';
import { getMemberRoleAuthTree, getMemberOrgTree, postMemberRoleAdd, postMemberRoleUpdate, getMemberRoleGet, getMemberRoleAuthButton, getMemberRoleAuthButtonCheck, } from '@/services/MemberV2Api';
import styled from './index.less';
import CheckboxTree from '@/components/CheckBoxTree';
import { useTreeData } from '@/hooks/useTreeData';
......@@ -42,8 +42,9 @@ import FieldHeader from '@/components/FieldHeader';
import OrgModal from './orgModal';
import { PlusOutlined } from '@ant-design/icons';
import { useTreeTabs } from '@/hooks/useTreeTabs';
import { concat } from 'lodash';
const intl = getIntl();
const pageTitles = [`${intl.formatMessage({ id: 'authConfig.add'})}`, `${intl.formatMessage({ id: 'authConfig.edit'})}`, `${intl.formatMessage({ id: 'authConfig.previewLook'})}`];
const pageTitles = [`${intl.formatMessage({ id: 'authConfig.add' })}`, `${intl.formatMessage({ id: 'authConfig.edit' })}`, `${intl.formatMessage({ id: 'authConfig.previewLook' })}`];
const TabFormErrors = props => {
return (
......@@ -125,6 +126,9 @@ const MemberDetail: React.FC<{}> = () => {
const [buttonInfos, setButtonInfos] = useState<any>([]);
// 储存的数据权限选项
const [authInfos, setAuthInfos] = useState<any>({});
// 存储默认勾选的id
const [checkIds, setcheckIds] = useState<any>({});
const modalRef = useRef<any>({})
const disabledCheckAuthConfig = useMemo(() => {
......@@ -171,12 +175,13 @@ const MemberDetail: React.FC<{}> = () => {
);
const [setEditForm, validateEditForm] = useLeavePage({
onSave: () => {},
onModalOk: () => {},
onModalCancel: () => {},
onSave: () => { },
onModalOk: () => { },
onModalCancel: () => { },
});
const handleNodeSelected = async (selectKey, selectNode) => {
// console.log(selectKey, 'selectKey', selectNode, 'selectNode')
try {
const { node } = await handleSelect(selectKey, selectNode);
if (nodeRecord) {
......@@ -199,7 +204,7 @@ const MemberDetail: React.FC<{}> = () => {
setNodeRecord(node);
fetchItemDetailData(node);
}
} catch (error) {}
} catch (error) { }
};
// 编辑和预览模式下需回显数据
......@@ -233,6 +238,8 @@ const MemberDetail: React.FC<{}> = () => {
}
}, [getButtonAuth, nodeRecord]);
// 提交
const handleSubmit = () => {
menuActions
.submit()
......@@ -241,19 +248,61 @@ const MemberDetail: React.FC<{}> = () => {
// 如果未点击过操作权限tab, 则无法获取到actionRef实例, 需补充手动补充回显的ids, 新增的时候如果未设置按钮,则返回空数组
const buttonCheckIds =
actionRef.current.selected || (formValue && formValue.ids) || [];
// 获取选中的树状 id
const treeCheckIds = treeActions.getSelectKeys();
// 把后台返回的数据处理成一个数组
const cheIds = [];
for (let i in checkIds) {
cheIds.push(checkIds[i]);
}
// 1 获取勾选中的id 和 后台返回勾选的id 进行对比
const publicarr = [];
// 判断选中的数组是否存在 后台返回的数据里面
for (let i = 0; i < treeCheckIds.length; i++) {
if (cheIds.indexOf(treeCheckIds[i]) === -1) {
publicarr.push({
menuId: treeCheckIds[i],
checked: true
})
}
}
// 根据后台返回的勾选中 进去匹配
const CheckIds = [];
for (let i in checkIds) {
if (treeCheckIds.indexOf(checkIds[i]))
CheckIds.push({
menuId: checkIds[i],
checked: treeCheckIds.includes(checkIds[i])
})
}
// 把两个数组合并成一个数组
let list = []
list = CheckIds.concat(publicarr)
const publicParams = {
...values,
imFlag: !!values.imFlag,
auth: treeCheckIds.map(v => ({
menuId: v,
checked: treeCheckIds,
auth: list.map(v => ({
menuId: v.menuId,
// @todo 暂时写死为空
buttonIds: [],
hasDataAuth: authInfos[v]?.hasDataAuth,
orgIds: authInfos[v]?.orgIds
})),
checked: v.checked,
hasDataAuth: authInfos[v.menuId]?.hasDataAuth,
orgIds: authInfos[v.menuId]?.orgIds
}))
// auth: treeCheckIds.map(v => ({
// menuId: v,
// // @todo 暂时写死为空
// buttonIds: [],
// checked: true,
// hasDataAuth: authInfos[v]?.hasDataAuth,
// orgIds: authInfos[v]?.orgIds
// })),
};
delete publicParams.checkIds
console.log(publicParams, '请求参数', treeCheckIds)
// return;
if (pageStatus === PageStatus.EDIT) {
await postMemberRoleUpdate({
memberRoleId: id,
......@@ -280,6 +329,7 @@ const MemberDetail: React.FC<{}> = () => {
const { data } = res;
// 获取菜单id选中的集合
const { checkIds, ...reset } = data;
setcheckIds({ ...checkIds })
treeActions.setSelectKeys(checkIds);
});
}
......@@ -424,8 +474,8 @@ const MemberDetail: React.FC<{}> = () => {
>
{intl.formatMessage({ id: 'authConfig.ifHasDataAccess' })}
</Checkbox>
<div style={{marginTop: 16}}>
<p style={{color: '#909399'}}>{intl.formatMessage({ id: 'authConfig.OrganizationAuthorization' })}</p>
<div style={{ marginTop: 16 }}>
<p style={{ color: '#909399' }}>{intl.formatMessage({ id: 'authConfig.OrganizationAuthorization' })}</p>
{disabledCheckAuthConfig.orgIds.map(v => {
const node = getTreeNode(plateformTreeData, v);
if (!node || !node.id) return null;
......
.upload {
flex: 1;
:global {
.ant-upload.ant-upload-select-picture-card {
width: 175px;
height: 120px;
width: 100%;
min-width: 175px;
height: auto;
padding-bottom: 55%;
position: relative;
> .ant-upload {
position: absolute;
top: 0;
right: 0;
bottom: 0;
left: 0;
}
}
}
......@@ -15,8 +28,8 @@
}
.img {
width: 175px;
height: 120px;
width: 100%;
height: 100%;
object-fit: cover;
}
}
\ No newline at end of file
......@@ -102,21 +102,24 @@ const QualitiesUploadFormItem = (props) => {
const span = colSpan ? {
span: colSpan,
} : {
sm: 12,
md: 8,
lg: 8,
xs: 24,
sm: 24,
md: 24,
lg: 24,
xl: 12,
xxl: 8,
};
return (
<div style={{ width: '100%' }}>
<ArrayList value={value}>
<Row
gutter={[66, 50]}
gutter={[25, 25]}
>
{toArr(value).map((item, index) => (
<Col key={index} {...span}>
<Row
gutter={50}
gutter={25}
align="middle"
>
<Col flex={1} className={styles['lineage-cell']}>
......
......@@ -84,6 +84,10 @@ type CouponCardDate = {
*/
url?: string
}[]
/**
* 券码
*/
code: string,
}
interface CouponCardProps {
......@@ -145,7 +149,8 @@ const CouponCard: React.FC<CouponCardProps> = (props: CouponCardProps) => {
{`${data.validTimeStart ? moment(data.validTimeStart).format('YYYY-MM-DD') : ''}-${data.validTimeEnd ? moment(data.validTimeEnd).format('YYYY-MM-DD') : ''}`}
</div>
<div className={styles['coupon-card-code']}>
券码:暂无
券码:
{data.code}
</div>
<div className={styles['coupon-card-webs']}>
适用商城:
......
......@@ -13,44 +13,44 @@ const Search = () => {
align: 'left',
},
{
title: `${intl.formatMessage({ id: 'marketingAbility.huodongmingcheng'})}`,
title: `${intl.formatMessage({ id: 'marketingAbility.huodongmingcheng' })}`,
dataIndex: 'activityName',
align: 'left',
render: (text) =>
<span style={{ color: '#00B37A' }}>{text}</span>
},
{
title: `${intl.formatMessage({ id: 'marketingAbility.huodongleixing'})}`,
title: `${intl.formatMessage({ id: 'marketingAbility.huodongleixing' })}`,
dataIndex: 'activityType',
align: 'left',
},
{
title: `${intl.formatMessage({ id: 'marketingAbility.huodongkaishishijian'})}`,
title: `${intl.formatMessage({ id: 'marketingAbility.huodongkaishishijian' })}`,
dataIndex: 'startTime',
align: 'left',
},
{
title: `${intl.formatMessage({ id: 'marketingAbility.huodongjieshushijian'})}`,
title: `${intl.formatMessage({ id: 'marketingAbility.huodongjieshushijian' })}`,
dataIndex: 'endTime',
align: 'left',
},
{
title: `${intl.formatMessage({ id: 'marketingAbility.baomingshijian'})}`,
title: `${intl.formatMessage({ id: 'marketingAbility.baomingshijian' })}`,
dataIndex: 'startTime',
align: 'left',
},
{
title: `${intl.formatMessage({ id: 'marketingAbility.canyukehushu'})}`,
title: `${intl.formatMessage({ id: 'marketingAbility.canyukehushu' })}`,
dataIndex: 'id',
align: 'left',
},
{
title: `${intl.formatMessage({ id: 'marketingAbility.yizhixingdingdanshu'})}`,
title: `${intl.formatMessage({ id: 'marketingAbility.yizhixingdingdanshu' })}`,
dataIndex: 'id',
align: 'left',
},
{
title: `${intl.formatMessage({ id: 'marketingAbility.waibuzhuangtai'})}`,
title: `${intl.formatMessage({ id: 'marketingAbility.waibuzhuangtai' })}`,
dataIndex: 'outerStatus',
align: 'left',
render: (text) => (
......@@ -58,7 +58,7 @@ const Search = () => {
)
},
{
title: `${intl.formatMessage({ id: 'marketingAbility.neibuzhuangtai'})}`,
title: `${intl.formatMessage({ id: 'marketingAbility.neibuzhuangtai' })}`,
dataIndex: 'innerStatus',
align: 'left',
}]
......@@ -66,29 +66,29 @@ const Search = () => {
{
id: '1',
activityName: 'tony',
activityType: `${intl.formatMessage({ id: 'marketingAbility.miaosha'})}`,
activityType: `${intl.formatMessage({ id: 'marketingAbility.miaosha' })}`,
startTime: '2020-05-12 08:08',
endTime: intl.formatMessage({ id: 'marketingAbility.haisheng59miao' }),
outerStatus: `${intl.formatMessage({ id: 'marketingAbility.daitijiaobaopingtaishenhe'})}`,
innerStatus: `${intl.formatMessage({ id: 'marketingAbility.daitijiaoshenhe'})}`,
outerStatus: `${intl.formatMessage({ id: 'marketingAbility.daitijiaobaopingtaishenhe' })}`,
innerStatus: `${intl.formatMessage({ id: 'marketingAbility.daitijiaoshenhe' })}`,
},
{
id: '2',
activityName: 'tony',
activityType: `${intl.formatMessage({ id: 'marketingAbility.miaosha'})}`,
activityType: `${intl.formatMessage({ id: 'marketingAbility.miaosha' })}`,
startTime: '2020-05-12 08:08',
endTime: intl.formatMessage({ id: 'marketingAbility.haisheng59miao' }),
outerStatus: `${intl.formatMessage({ id: 'marketingAbility.daitijiaobaopingtaishenhe'})}`,
innerStatus: `${intl.formatMessage({ id: 'marketingAbility.daitijiaoshenhe'})}`,
outerStatus: `${intl.formatMessage({ id: 'marketingAbility.daitijiaobaopingtaishenhe' })}`,
innerStatus: `${intl.formatMessage({ id: 'marketingAbility.daitijiaoshenhe' })}`,
},
{
id: '3',
activityName: 'tony',
activityType: `${intl.formatMessage({ id: 'marketingAbility.miaosha'})}`,
activityType: `${intl.formatMessage({ id: 'marketingAbility.miaosha' })}`,
startTime: '2020-05-12 08:08',
endTime: intl.formatMessage({ id: 'marketingAbility.haisheng59miao' }),
outerStatus: `${intl.formatMessage({ id: 'marketingAbility.daitijiaobaopingtaishenhe'})}`,
innerStatus: `${intl.formatMessage({ id: 'marketingAbility.daitijiaoshenhe'})}`,
outerStatus: `${intl.formatMessage({ id: 'marketingAbility.daitijiaobaopingtaishenhe' })}`,
innerStatus: `${intl.formatMessage({ id: 'marketingAbility.daitijiaoshenhe' })}`,
}
]
/* 多选返回的 */
......@@ -98,7 +98,7 @@ const Search = () => {
return (
<TableLayout
columns={columns}
effects="name"
effects="id"
fetch={mokiData}
selectedRow={true}
fetchRowkeys={fetchRowkeys}
......@@ -106,80 +106,89 @@ const Search = () => {
type: 'object',
properties: {
mageLayout: {
type: 'object',
'x-component': 'Mega-Layout',
type: "object",
"x-component": "flex-layout",
"x-component-props": {
rowStyle: {
justifyContent: 'space-between'
}
},
properties: {
topLayout: {
type: 'object',
'x-component': 'Mega-Layout',
id: {
type: 'string',
'x-component': 'Search',
'x-component-props': {
grid: true,
placeholder: '活动ID'
},
properties: {
name: {
type: 'string',
'x-component': 'Search',
'x-component-props': {
placeholder: `${intl.formatMessage({ id: 'marketingAbility.sousuo'})}`,
tip: intl.formatMessage({ id: 'marketingAbility.shuruhuiyuanming' }),
},
},
},
},
[FORM_FILTER_PATH]: {
type: 'object',
'x-component': 'Flex-Layout',
"x-component-props": {
rowStyle: {
justifyContent: "flex-start",
flexWrap: "nowrap"
},
colStyle: {//改变间隔
marginRight: 20
}
},
properties: {
activityName: {
type: 'string',
'x-component-props': {
placeholder: `活动名称`,
allowClear: true,
style: {
width: 160,
},
},
},
[FORM_FILTER_PATH]: {
type: 'object',
'x-component': 'Flex-Layout',
'[startTime,endTime]': {
type: 'daterange',
'x-component-props': {
colStyle: {
marginLeft: 20,
placeholder: [`${intl.formatMessage({ id: 'marketingAbility.kaopingkaishishijian' })}`, `${intl.formatMessage({ id: 'marketingAbility.kaopingwanchengshijian' })}`],
allowClear: true,
style: {
width: 240,
},
},
properties: {
subject: {
type: 'string',
'x-component-props': {
placeholder: `${intl.formatMessage({ id: 'marketingAbility.kaopingzhuti'})}`,
allowClear: true,
style: {
width: 160,
},
},
},
'[appraisalDayStart,appraisalDayEnd]': {
type: 'daterange',
'x-component-props': {
placeholder: [`${intl.formatMessage({ id: 'marketingAbility.kaopingkaishishijian'})}`, `${intl.formatMessage({ id: 'marketingAbility.kaopingwanchengshijian'})}`],
allowClear: true,
style: {
width: 240,
},
},
},
status: {
type: 'string',
default: undefined,
enum: [],
'x-component-props': {
placeholder: `${intl.formatMessage({ id: 'marketingAbility.neibuzhuangtai(quanbu)'})}`,
allowClear: true,
style: {
width: 160,
},
},
},
activityType: {
type: 'string',
default: undefined,
enum: [],
'x-component-props': {
placeholder: `活动类型`,
allowClear: true,
style: {
width: 160,
},
submit: {
'x-component': 'Submit',
'x-mega-props': {
span: 1,
},
'x-component-props': {
children: `${intl.formatMessage({ id: 'marketingAbility.chaxun'})}`,
},
},
},
outerStatus: {
type: 'string',
default: undefined,
enum: [],
'x-component-props': {
placeholder: `外部状态`,
allowClear: true,
style: {
width: 160,
},
},
},
submit: {
'x-component': 'Submit',
'x-mega-props': {
span: 1,
},
'x-component-props': {
children: `${intl.formatMessage({ id: 'marketingAbility.chaxun' })}`,
},
},
},
},
},
......
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