Commit 9663491d authored by 前端-钟卫鹏's avatar 前端-钟卫鹏
parents f20fc41f 7b3c13c3
import menu from './zh-CN/menu'
import home from './zh-CN/home'
export default {
'global.siteName': '瓴犀',
...menu,
...home,
}
export default {
'home.title' : '首页',
'home.guide' : '使用向导',
'home.anyQuestion.title' : '平台使用中遇到问题',
'home.anyQuestion.tips1' : '您的专属服务团队',
'home.anyQuestion.tips2' : '客户经理、项目经理、技术专家为你解答平台使用过程中遇到任何问题',
'home.anyQuestion.ask' : '我要提问',
'home.afterSoldCenter.repairApplyList' : '售后维修申请',
'home.afterSoldCenter.repairHandleList' : '售后维修处理',
'home.afterSoldCenter.replaceApplyList' : '售后换货申请',
'home.afterSoldCenter.replaceHandleList' : '售后换货处理',
'home.afterSoldCenter.returnApplyList' : '售后退货申请',
'home.afterSoldCenter.returnHandleList' : '售后退货处理',
'home.afterSoldCenter.layoutTitle' : '售后中心',
'home.afterSoldCenter.layoutTips' : '轻松完成订单售后在线换货、退货、维修环节',
'home.afterSoldCenter.authorize.url' : '进入售后中心',
'home.channelMallCenter.title1' : '创建渠道商城',
'home.channelMallCenter.title2' : '渠道商城模板',
'home.channelMallCenter.title3' : '渠道商城装修',
'home.channelMallCenter.title4' : '业务员绑定渠道',
'home.channelMallCenter.layoutTitle' : '渠道商城中心',
'home.channelMallCenter.layoutTips' : '轻松完成渠道商城的创建、渠道商城风格选择、个性化装修',
'home.channelMallCenter.authorize.url' : '进入渠道商城中心',
'home.channelMallCenter.alertTip' : '您还没有创建渠道商城,请先创建渠道商城',
'home.constract.contractManageList' : '合同管理',
'home.constract.contractCoordinationList' : '合同协同',
'home.constract.applyAmountOrderList' : '合同请款',
'home.constract.layoutTitle' : '合同中心',
'home.constract.layoutTips' : '提供在电子签章申请,合同管理、电子合同签订、合同请款、合同协同等功能',
'home.constract.authorize.url' : '进入合同中心',
'home.constract.alertTip' : '您还没有申请电子签章,请先申请电子签章',
'home.fundCenter.creditList' : '授信处理',
'home.fundCenter.accountList' : '资金账户管理',
'home.fundCenter.title1' : '资金账户',
'home.fundCenter.title2' : '授信账户',
'home.fundCenter.title3' : '资金账户管理',
'home.fundCenter.title4' : '授信管理',
'home.fundCenter.layoutTitle' : '资金账户管理',
'home.fundCenter.layoutTips' : '提供资金账户管理、授信额度管理等功能。',
'home.layout.isError' : '拉取数据时发生了错误,点击刷新',
'home.layout.extra' : '点击创建',
'home.logisticsCenter.title1' : '物流派单',
'home.logisticsCenter.title2' : '接单报价',
'home.logisticsCenter.title3' : '收货地址管理',
'home.logisticsCenter.title4' : '发货地址管理',
'home.logisticsCenter.title5' : '运费模板',
'home.logisticsCenter.layoutTitle' : '物流中心',
'home.logisticsCenter.layoutTips' : '快速完成物流派单、接单、报价、物流信息对接',
'home.logisticsCenter.authorize.url' : '进入物流中心',
'home.logisticsCenter.alertTip' : '您还没有创建物流公司门户,请先创建物流公司门户',
'home.memberCenter.importList' : '会员入库',
'home.memberCenter.changeList' : '会员变更',
'home.memberCenter.kpiList' : '会员考评',
'home.memberCenter.rectifyList' : '会员整改',
'home.memberCenter.rectifyNoticeList' : '整改通知',
'home.memberCenter.layoutTitle' : '会员中心',
'home.memberCenter.authorize.url' : '会员中心',
'home.orderCenter.saleOrderList' : '销售订单',
'home.orderCenter.purchaseOrderList' : '采购订单',
'home.orderCenter.layoutTitle' : '订单中心',
'home.orderCenter.layoutTips' : '提供订单管理、签订电子合同等功能',
'home.orderCenter.authorize.url' : '进入订单中心',
'home.processCenter.supplierList' : '指派生产通知单',
'home.processCenter.processList' : '生产通知单处理',
'home.processCenter.layoutTitle' : '加工中心',
'home.processCenter.layoutTips' : '提供外发生产、加工、装配全流程环节管控',
'home.processCenter.authorize.url' : '加工中心',
'home.processCenter.alertTip' : '您还没有创建加工企业门户,请先创建加工企业门户。',
'home.productCenter.title1' : '创建品牌',
'home.productCenter.title2' : '创建商品',
'home.productCenter.title3' : '设置库存',
'home.productCenter.layoutTitle' : '商品中心',
'home.productCenter.layoutTips' : '快速完成品牌、商品创建、发布、提供灵活的商品库存管理',
'home.productCenter.rowTitle' : '商品',
'home.purchaseCenter.purchaseInquiryList' : '采购询价',
'home.purchaseCenter.quotedPriceList' : '报价',
'home.purchaseCenter.confirmQuotedPriceList' : '确认报价',
'home.purchaseCenter.biddingList' : '采购竞价',
'home.purchaseCenter.onlineBiddingList' : '在线竞价',
'home.purchaseCenter.inviteTenderList' : '招标',
'home.purchaseCenter.tenderList' : '采购询价',
'home.purchaseCenter.needPlanList' : '采购询价',
'home.purchaseCenter.purchasePlanList' : '采购询价',
'home.purchaseCenter.layoutTitle' : '采购中心',
'home.purchaseCenter.layoutTips' : '提供在线采购询价、在线报价、在线招投标、在线竞价、制订采购计划、创建采购门户等功能',
'home.purchaseCenter.authorize.url' : '进入采购中心',
'home.purchaseCenter.dingTips' : '您还没有创建采购门户,请先创建采购门户',
'home.purchaseCenter.dingTips.button' : '点击创建',
'home.settlementCenter.payableList' : '应付账款结算',
'home.settlementCenter.platformList' : '平台代收账款结算',
'home.settlementCenter.platformScoreList' : '平台积分结算',
'home.settlementCenter.receivableList' : '应收账款结算',
'home.settlementCenter.title1' : '平台代收款结算',
'home.settlementCenter.title2' : '平台积分结算',
'home.settlementCenter.title3' : '应收账款结算',
'home.settlementCenter.title4' : '应付账款结算',
'home.settlementCenter.title5' : '开票管理',
'home.settlementCenter.layoutTitle' : '结算中心',
'home.settlementCenter.layoutTips' : '提供资资金结算、发票管理等功能',
'home.shopCenter.title1' : '创建店铺',
'home.shopCenter.title2' : '店铺模板',
'home.shopCenter.title3' : '店铺装修',
'home.shopCenter.layoutTitle' : '店铺中心',
'home.shopCenter.layoutTips' : '轻松完成店铺的创建、店铺风格选择、店铺个性化装修',
'home.shopCenter.alertTip' : '轻松完成店铺的创建、店铺风格选择、店铺个性化装修。',
'home.tradeCenter.commodityInquiryList' : '商品询价',
'home.tradeCenter.inquiryQuotationList' : '询价报价',
'home.tradeCenter.confirmInquiryQuotationList' : '确认询价报价',
'home.tradeCenter.demandPublishList' : '需求发布',
'home.tradeCenter.demandQuotationList' : '需求报价',
'home.tradeCenter.confirmDemandQuotationList' : '确认需求报价',
'home.tradeCenter.saleOrderList' : '销售订单',
'home.tradeCenter.purchaseOrderList' : '采购订单',
'home.tradeCenter.layoutTitle' : '交易中心',
'home.tradeCenter.layoutTips' : '提供在线发布需求,在线询价、在线报价、订单交易、签订电子合同等功能',
'home.tradeCenter.authorize.url' : '进入交易中心',
'home.customWorkBench.customWorkBench' : '自定义工作台',
'home.customWorkBench.title' : '产品模块自定义',
'home.customWorkBench.tips' : '在此你可根据业务形态自定义展示后期可在“自定义工作台”中随时调整',
'home.customWorkBench.sortTips' : '可拖动排序',
'home.latestAnnouces.title' : '最新公告',
'home.latestAnnouces.month' : '月',
'home.latestAnnouces.noticeFooter' : '我知道了',
'home.recentVisit.title' : '最近访问',
'home.useGuaid.title' : '定义产品功能',
'home.useGuaid.description' : '开发第一步,标准功能、自定义功能及云功能编辑',
'home.useGuaid.a' : '如何定义',
'home.useGuaid.firstp' : '使用向导',
'home.useGuaid.guideTitle' : '1.新建商品',
'home.useGuaid.guideDesc' : '三分钟智能化,完成商品创建',
'home.useGuaid.guideClose' : '关闭',
'home.userCenter.year' : '年',
'home.userCenter.month' : '月',
'home.userCenter.day' : '日',
'home.userCenter.day0' : '星期天',
'home.userCenter.day1' : '星期一',
'home.userCenter.day2' : '星期二',
'home.userCenter.day3' : '星期三',
'home.userCenter.day4' : '星期四',
'home.userCenter.day5' : '星期五',
'home.userCenter.day6' : '星期六',
'home.userCenter.wellcome' : '欢迎来到',
'home.userCenter.error' : '仅支持上传JPEG/JPG/PNG文件!',
'home.userCenter.upload' : '修改',
'home.userCenter.link' : '修改会员信息',
'home.userCenter.level' : '会员等级',
'home.userCenter.score' : '平台积分',
'home.userCenter.userAuth.link' : '进入会员中心',
}
......@@ -25,12 +25,13 @@ interface CouponsDrawerProps {
onClose: () => void,
onConfirm?: (record) => void,
selectId?: number,
disabledKeys?: number[],
// 1平台,2商家
belongType?: 1 | 2
}
const CouponsDrawer: React.FC<CouponsDrawerProps> = (props: CouponsDrawerProps) => {
const { visible, onClose, onConfirm, selectId } = props;
const { visible, onClose, onConfirm, disabledKeys, selectId } = props;
const { query: { shopId } }: any = history.location
const [type, setType] = useState(2);
const [selectedRowKeys, setSelectedRowKeys] = useState<any>(selectId ? [selectId] : []);
......@@ -135,7 +136,10 @@ const CouponsDrawer: React.FC<CouponsDrawerProps> = (props: CouponsDrawerProps)
setSelectedRows(selectedRows);
setSelectedRowKeys(selectedRowKeys)
},
type: 'radio'
type: 'radio',
getCheckboxProps: (record: any) => ({
disabled: disabledKeys?.includes(record.id), // Column configuration not to be checked
}),
}
const drawerStyle = { background: '#FAFBFC' };
......
......@@ -334,7 +334,7 @@ const MixDrawer: React.FC<MixDrawerProps> = (props: MixDrawerProps) => {
setSelectedRows(selectedRows);
setSelectedRowKeys(selectedRowKeys)
},
type: selectType
type: selectType,
}
useEffect(() => {
......
......@@ -5,9 +5,8 @@ import moment from 'moment';
import { postMarketingCouponActivityPageSelectDetail } from '@/services/MarketingV2Api';
import { formatTimeString } from '@/utils'
import { priceFormat } from '@/utils/numberFomat'
import useSamLevelProps from '../../../common/hooks/useSameLevelProps';
import CouponsDrawer from '@/pages/editor/components/drawer/couponsDrawer';
import styles from './index.less';
interface MarketingCardCouponProps {
......@@ -21,6 +20,7 @@ const MarketingCardCoupon: React.FC<MarketingCardCouponProps> = (props: Marketin
const { id, belongType, selectedKey } = props;
const [drawerVisible, setDrawerVisible] = useState(false);
const [record, setRecord] = useState<any>();
const sameLevelPropsList = useSamLevelProps({ key: selectedKey })
useEffect(() => {
changeStylesByKey({
......@@ -104,6 +104,7 @@ const MarketingCardCoupon: React.FC<MarketingCardCouponProps> = (props: Marketin
belongType={belongType}
onClose={_onClose}
onConfirm={_onChooseConfirm}
disabledKeys={sameLevelPropsList ? sameLevelPropsList.map((item) => item.id) : []}
selectId={id}
/>
</div>
......
import React, {useEffect} from 'react';
import React, { useEffect } from 'react';
import { useIntl } from 'umi';
import styles from './index.less';
import ask from '@/assets/imgs/ask.png';
import { getAuth } from '@/utils/auth';
import { configUsr, initQiyuImServer, toChatRoom } from '@/utils/im';
import { GlobalConfig } from '@/global/config'
interface Iprops {}
interface Iprops { }
const AnyQuestion: React.FC<Iprops> = () => {
const intl = useIntl();
const authInfo: any = getAuth() || {}
// 根据接口配置 跳转lx-IM或者七鱼IM,并传入初始秘钥 1 //自有 2 //第三方
const _self = GlobalConfig?.global?.imConfig ? GlobalConfig.global.imConfig.type : null
useEffect(() => {
if(_self === 2) {
if (_self === 2) {
// 第三方
const s = GlobalConfig.global.imConfig.paramConfigList[0]['value']
const _window: any = window
......@@ -23,21 +24,21 @@ const AnyQuestion: React.FC<Iprops> = () => {
}, [])
const openIMServer = () => {
if(_self === 2) {
if (_self === 2) {
configUsr(authInfo)
const _window: any = window
_window?.ysf && _window.ysf('open')
} else if(_self === 1) {
} else if (_self === 1) {
toChatRoom(authInfo.memberId)
}
}
return (
<div className={styles.anyQuestion}>
<div className={styles.title}>平台使用中遇到问题</div>
<div className={styles.title}>{intl.formatMessage({ id: 'home.anyQuestion.title' })}</div>
<div className={styles.body}>
<p className={styles.tips}>您的专属服务团队</p>
<p className={styles.tips}>客户经理、项目经理、技术专家为你解答平台使用过程中遇到任何问题</p>
<p className={styles.tips}>{intl.formatMessage({ id: 'home.anyQuestion.tips1' })}</p>
<p className={styles.tips}>{intl.formatMessage({ id: 'home.anyQuestion.tips2' })}</p>
</div>
{
_self === null ?
......
import React, { useCallback } from 'react';
import { Link } from 'umi'
import React, { useCallback } from 'react';
import { Link, useIntl, getIntl } from 'umi'
import Authorize from '../Authorize';
import useViewRequest from '../../hooks/useViewRequest';
import { getReportMemberHomeGetAfterSaleTally, GetReportMemberHomeGetAfterSaleTallyResponse } from '@/services/ReportV2Api';
import Layout from './layout';
import useGetAuth from '../../hooks/useGetAuth';
interface Iprops {};
interface Iprops { };
const KEY_TITLE = {
repairApplyList: '售后维修申请',
repairHandleList: '售后维修处理',
replaceApplyList: '售后换货申请',
replaceHandleList: '售后换货处理',
returnApplyList: '售后退货申请',
returnHandleList: '售后退货处理'
repairApplyList: getIntl().formatMessage({ id: 'home.afterSoldCenter.repairApplyList' }),
repairHandleList: getIntl().formatMessage({ id: 'home.afterSoldCenter.repairHandleList' }),
replaceApplyList: getIntl().formatMessage({ id: 'home.afterSoldCenter.replaceApplyList' }),
replaceHandleList: getIntl().formatMessage({ id: 'home.afterSoldCenter.replaceHandleList' }),
returnApplyList: getIntl().formatMessage({ id: 'home.afterSoldCenter.returnApplyList' }),
returnHandleList: getIntl().formatMessage({ id: 'home.afterSoldCenter.returnHandleList' })
}
const EXCHANGE_APPLICATION = `/memberCenter/afterService/exchangeApplication/exchangeQuery`
const EXCHANGE_HANDLE = '/memberCenter/afterService/exchangeManage/exchangeQuery';
......@@ -23,6 +23,7 @@ const EXCHANGE_HANDLE = '/memberCenter/afterService/exchangeManage/exchangeQuery
// 进入售后中心:当前会员角色类型为服务消费则点击进入售后能力-售后换货申请--换货申请单查询页,如果当前会员角色类型为服务提供则点击进入售后能力-售后换货处理--换货申请单查询页
const AfterSoldCenter: React.FC<Iprops> = () => {
const intl = useIntl();
const { loading, responseData, ref, filterEmptyList, isError } = useViewRequest<GetReportMemberHomeGetAfterSaleTallyResponse, any>(getReportMemberHomeGetAfterSaleTally, {})
const { hasAbilityFunc, isConsumer } = useGetAuth();
const hasAbility = hasAbilityFunc('afterService');
......@@ -32,14 +33,14 @@ const AfterSoldCenter: React.FC<Iprops> = () => {
<Layout
hasAuth={hasAbility}
viewRef={ref}
title="售后中心"
tips={"轻松完成订单售后在线换货、退货、维修环节"}
title={intl.formatMessage({ id: 'home.afterSoldCenter.layoutTitle' })}
tips={intl.formatMessage({ id: 'home.afterSoldCenter.layoutTips' })}
extra={
<Authorize
url={url}
>
<div>
<Link to={url}>进入售后中心</Link>
<Link to={url}>{intl.formatMessage({ id: 'home.afterSoldCenter.authorize.url' })}</Link>
</div>
</Authorize>
}
......
......@@ -3,7 +3,7 @@ import styles from './center.less'
import create_shop from '@/assets/imgs/create_shop.png';
import { BellOutlined, RightOutlined } from '@ant-design/icons'
import { Button } from 'antd';
import { Link } from 'umi';
import { Link, useIntl } from 'umi';
import Authorize from '../Authorize';
import { getAuth } from '@/utils/auth';
import useViewRequest from '../../hooks/useViewRequest';
......@@ -11,7 +11,7 @@ import { getTemplateWebMemberChannelWebFindCurrMemberChannel, GetTemplateWebMemb
import Layout from './layout';
import useGetAuth from '../../hooks/useGetAuth';
import { getMemberAbilitySalesPage } from '@/services/MemberV2Api';
interface Iprops {}
interface Iprops { }
const SHOP_CENTER = '/memberCenter/channelAbility/infoManage'
const CREATE_TEMPLATE = '/memberCenter/channelAbility/template';
......@@ -26,10 +26,11 @@ const BIND_MANAGER = '/memberCenter/channelAbility/memberList'
// 6、如果当前用户有创建渠道商城权限,但还未创建渠道商城,则显示:您还没有创建渠道商城,请先创建渠道商城,点击创建渠道商城,跳转能力中心-渠道能力-渠道商城管理-创建渠道商城铺页
const ChannelMallCenter: React.FC<Iprops> = () => {
const intl = useIntl();
const { userAuth, hasAbilityFunc } = useGetAuth();
const { loading, responseData, isError, ref, inViewPort } = useViewRequest<GetTemplateWebMemberChannelWebFindCurrMemberChannelResponse, any>(getTemplateWebMemberChannelWebFindCurrMemberChannel, {memberId: userAuth.memberId})
const { loading, responseData, isError, ref, inViewPort } = useViewRequest<GetTemplateWebMemberChannelWebFindCurrMemberChannelResponse, any>(getTemplateWebMemberChannelWebFindCurrMemberChannel, { memberId: userAuth.memberId })
const hasAbility = hasAbilityFunc('channelAbility');
const bindAuth = useMemo(() => userAuth.urls?.includes(BIND_MANAGER), [userAuth]);
const bindAuth = useMemo(() => userAuth.urls?.includes(BIND_MANAGER), [userAuth]);
const [salerNum, setSalerNum] = useState(0);
const [hasFetchData, setHasFetchData] = useState(false)
......@@ -38,7 +39,7 @@ const ChannelMallCenter: React.FC<Iprops> = () => {
return;
}
async function getManagerData() {
const { data, code } = await getMemberAbilitySalesPage({current: '1', pageSize: '1'} as any)
const { data, code } = await getMemberAbilitySalesPage({ current: '1', pageSize: '1' } as any)
setHasFetchData(true)
if (code === 1000) {
setSalerNum(data.totalCount)
......@@ -51,25 +52,25 @@ const ChannelMallCenter: React.FC<Iprops> = () => {
{
icon: create_shop,
url: SHOP_CENTER,
title: "创建渠道商城",
title: intl.formatMessage({ id: 'home.channelMallCenter.title1' }),
hasAuth: userAuth.urls.includes(SHOP_CENTER),
},
{
icon: create_shop,
url: CREATE_TEMPLATE,
title: "渠道商城模板",
title: intl.formatMessage({ id: 'home.channelMallCenter.title2' }),
hasAuth: userAuth.urls.includes(CREATE_TEMPLATE),
},
{
icon: create_shop,
url: CREATE_TEMPLATE,
title: "渠道商城装修",
title: intl.formatMessage({ id: 'home.channelMallCenter.title3' }),
hasAuth: userAuth.urls.includes(CREATE_TEMPLATE),
},
{
icon: create_shop,
url: BIND_MANAGER,
title: "业务员绑定渠道",
title: intl.formatMessage({ id: 'home.channelMallCenter.title4' }),
hasAuth: bindAuth,
count: salerNum,
}
......@@ -79,12 +80,12 @@ const ChannelMallCenter: React.FC<Iprops> = () => {
<Layout
hasAuth={hasAbility}
viewRef={ref}
title="渠道商城中心"
tips="轻松完成渠道商城的创建、渠道商城风格选择、个性化装修"
title={intl.formatMessage({ id: 'home.channelMallCenter.layoutTitle' })}
tips={intl.formatMessage({ id: 'home.channelMallCenter.layoutTips' })}
extra={
<Authorize url={CREATE_TEMPLATE}>
<div>
<Link to={CREATE_TEMPLATE}>进入渠道商城中心</Link>
<Link to={CREATE_TEMPLATE}>{intl.formatMessage({ id: 'home.channelMallCenter.authorize.url' })}</Link>
</div>
</Authorize>
}
......@@ -94,7 +95,7 @@ const ChannelMallCenter: React.FC<Iprops> = () => {
{
(responseData === null || !responseData?.id) && (
<Layout.AlertTip
content="您还没有创建渠道商城,请先创建渠道商城"
content={intl.formatMessage({ id: 'home.channelMallCenter.alertTip' })}
url={SHOP_CENTER}
/>
)
......
......@@ -2,18 +2,18 @@ import React, { Fragment, useEffect, useMemo, useState } from 'react';
import Layout, { IDataListProps } from './layout';
import useViewRequest from '../../hooks/useViewRequest';
import { getReportMemberHomeGetContractTally, GetReportMemberHomeGetContractTallyResponse } from '@/services/ReportV2Api';
import { Link } from 'umi';
import { Link, useIntl, getIntl } from 'umi';
import useGetAuth from '../../hooks/useGetAuth';
import Authorize from '../Authorize';
import { getContractSignatureAuthGet } from '@/services/ContractV2Api';
const { StaticsDataList, AlertTip } = Layout
interface Iprops {}
interface Iprops { }
const KEY_TITLE = {
"contractManageList": '合同管理',
"contractCoordinationList": '合同协同',
"applyAmountOrderList": '合同请款'
"contractManageList": getIntl().formatMessage({ id: 'home.constract.contractManageList' }),
"contractCoordinationList": getIntl().formatMessage({ id: 'home.constract.contractCoordinationList' }),
"applyAmountOrderList": getIntl().formatMessage({ id: 'home.constract.applyAmountOrderList' })
}
// 合同中心:根据当前用户+当前角色是否有合同能力菜单权限确定是否显示,再根据自定义布局确定显示及显示顺序
......@@ -22,6 +22,7 @@ const KEY_TITLE = {
const Constract: React.FC<Iprops> = (props: Iprops) => {
const { loading, isError, hasRequest, responseData, ref, inViewPort, filterEmptyList } = useViewRequest<GetReportMemberHomeGetContractTallyResponse, any>(getReportMemberHomeGetContractTally, {})
const intl = useIntl();
const [hasConstract, setHasConstract] = useState<boolean>(false);
const { userAuth, hasAbilityFunc, isConsumer } = useGetAuth();
const [hasFetchData, setHasFetchData] = useState(false)
......@@ -47,15 +48,15 @@ const Constract: React.FC<Iprops> = (props: Iprops) => {
<Layout
hasAuth={hasAbility}
viewRef={ref}
title="合同中心"
tips="提供在电子签章申请,合同管理、电子合同签订、合同请款、合同协同等功能"
title={intl.formatMessage({ id: 'home.constract.layoutTitle' })}
tips={intl.formatMessage({ id: 'home.constract.layoutTips' })}
loading={loading}
extra={
<Authorize
url={url}
>
<div>
<Link to={url}>进入合同中心</Link>
<Link to={url}>{intl.formatMessage({ id: 'home.constract.authorize.url' })}</Link>
</div>
</Authorize>
}
......@@ -65,7 +66,7 @@ const Constract: React.FC<Iprops> = (props: Iprops) => {
isConsumer && (!hasConstract) && (
<AlertTip
url="/memberCenter/contract/ElectronicSignature/apply"
content="您还没有申请电子签章,请先申请电子签章"
content={intl.formatMessage({ id: 'home.constract.alertTip' })}
/>
)
}
......
import React, { useCallback, useMemo} from 'react';
import React, { useCallback, useMemo } from 'react';
import styles from './center.less'
import settlement_platformCollection from '@/assets/imgs/settlement_platformCollection.png';
import settlement_integrate from '@/assets/imgs/settlement_integrate.png';
import settlement_accountReceive from '@/assets/imgs/settlement_accountReceive.png';
import settlement_accountPayable from '@/assets/imgs/settlement_accountPayable.png';
import settlement_invoice from '@/assets/imgs/settlement_invoice.png';
import { Link } from 'umi'
import { Link, useIntl, getIntl } from 'umi'
import { getAuth } from '@/utils/auth';
import useViewRequest from '../../hooks/useViewRequest';
import Layout, { IDataListProps } from './layout';
import { getReportMemberHomeGetAccountTally, GetReportMemberHomeGetAccountTallyResponse } from '@/services/ReportV2Api';
import useGetAuth from '../../hooks/useGetAuth';
interface Iprops {};
interface Iprops { };
const KEY_TO_TITLE = {
creditList: '授信处理',
accountList: '资金账户管理'
creditList: getIntl().formatMessage({ id: 'home.fundCenter.creditList' }),
accountList: getIntl().formatMessage({ id: 'home.fundCenter.accountList' })
}
// 资金账户管理中心:根据当前用户+当前角色是否有此支付能力菜单权限确定是否显示,再根据自定义布局确定显示及显示顺序
// 1、资金账户:判断当前用户是否有账户管理权限,有则显示资金账户按钮与图标,点击跳转能力中心-支付能力-资金账户-账户管理
......@@ -25,6 +25,7 @@ const KEY_TO_TITLE = {
const FundCenter: React.FC<Iprops> = () => {
const { loading, responseData, isError, ref } = useViewRequest<GetReportMemberHomeGetAccountTallyResponse, any>(getReportMemberHomeGetAccountTally, {})
const intl = useIntl();
const { hasAbilityFunc, userAuth } = useGetAuth();
const hasAbility = hasAbilityFunc('payandSettle');
// 在tagList 做修改过滤
......@@ -32,22 +33,22 @@ const FundCenter: React.FC<Iprops> = () => {
const list = [
{
icon: settlement_platformCollection,
title: '资金账户',
title: intl.formatMessage({ id: 'home.fundCenter.title1' }),
url: '/memberCenter/payandSettle/capitalAccounts/accountLists'
},
{
icon: settlement_integrate,
title: '授信账户',
title: intl.formatMessage({ id: 'home.fundCenter.title2' }),
url: '/memberCenter/payandSettle/creditApplication/quotaMenage'
},
{
icon: settlement_accountReceive,
title: '资金账户管理',
title: intl.formatMessage({ id: 'home.fundCenter.title3' }),
url: '/memberCenter/payandSettle/amountAccountManage/memberAccountManage'
},
{
icon: settlement_accountPayable,
title: '授信管理',
title: intl.formatMessage({ id: 'home.fundCenter.title4' }),
url: '/memberCenter/payandSettle/creditManage/quotaMenage'
},
].filter((_item) => userAuth.urls?.includes(_item.url))
......@@ -58,8 +59,8 @@ const FundCenter: React.FC<Iprops> = () => {
<Layout
hasAuth={hasAbility}
viewRef={ref}
title="资金账户管理"
tips="提供资金账户管理、授信额度管理等功能。"
title={intl.formatMessage({ id: 'home.fundCenter.layoutTitle' })}
tips={intl.formatMessage({ id: 'home.fundCenter.layoutTips' })}
loading={loading}
>
<>
......
import React, { useCallback, useEffect, useMemo, useState } from 'react';
import { Skeleton, Badge } from 'antd';
import { Link } from 'umi';
import { Skeleton, Badge } from 'antd';
import { Link, useIntl } from 'umi';
import styles from './center.less'
import logistics from '@/assets/imgs/logistics.png';
import logistics_form from '@/assets/imgs/logistics_form.png';
......@@ -14,7 +14,7 @@ import { getReportMemberHomeGetLogisticsTally, GetReportMemberHomeGetLogisticsTa
import useGetAuth from '../../hooks/useGetAuth';
import { getTemplateWebMemberLogisticsWebFindCurrMemberLogistics } from '@/services/TemplateV2Api';
interface Iprops {};
interface Iprops { };
const url = '/memberCenter/logisticsAbility/logisticsResult/orderResultSearchList';
const CREATE_INFO_MANAGE = "/memberCenter/logisticsAbility/infoManage";
......@@ -28,6 +28,7 @@ const CREATE_INFO_MANAGE = "/memberCenter/logisticsAbility/infoManage";
// 5、运费模板管理:判断当前用户是否有运费模板管理权限,有则显示运费模板管理按钮与图标,点击跳转物流能力-物流管理-运费模板管理
const LogisticsCenter: React.FC<Iprops> = (props: Iprops) => {
const { loading, responseData, ref, inViewPort } = useViewRequest<GetReportMemberHomeGetLogisticsTallyResponse, any>(getReportMemberHomeGetLogisticsTally, {})
const intl = useIntl();
const { hasAbilityFunc, userAuth } = useGetAuth();
const hasAbility = hasAbilityFunc('logisticsAbility');
const [isShow, setIsShow] = useState(false);
......@@ -40,7 +41,7 @@ const LogisticsCenter: React.FC<Iprops> = (props: Iprops) => {
}
async function getManagerData() {
setHasFetchData(true)
const { data, code } = await getTemplateWebMemberLogisticsWebFindCurrMemberLogistics({memberId: userAuth.memberId, roleId: userAuth.memberRoleId } as any)
const { data, code } = await getTemplateWebMemberLogisticsWebFindCurrMemberLogistics({ memberId: userAuth.memberId, roleId: userAuth.memberRoleId } as any)
if (code === 1000) {
setIsShow(data === null)
}
......@@ -52,29 +53,29 @@ const LogisticsCenter: React.FC<Iprops> = (props: Iprops) => {
const list = [
{
icon: logistics,
title: '物流派单',
title: intl.formatMessage({ id: 'home.logisticsCenter.title1' }),
url: '/memberCenter/logisticsAbility/logisticsBillSubmit/waitSbumitLogisticsBill',
count: responseData?.["toBeCommitCount"]
},
{
icon: logistics_form,
title: '接单报价',
title: intl.formatMessage({ id: 'home.logisticsCenter.title2' }),
url: '/memberCenter/logisticsAbility/logisticsBillManage/waitConfirmLogisticsBill',
count: responseData?.["toBeConfirmCount"]
},
{
icon: logistics_address,
title: '收货地址管理',
title: intl.formatMessage({ id: 'home.logisticsCenter.title3' }),
url: "/memberCenter/logisticsAbility/logisticsAdminister/receivingAddress"
},
{
icon: logistics_address,
title: '发货地址管理',
title: intl.formatMessage({ id: 'home.logisticsCenter.title4' }),
url: "/memberCenter/logisticsAbility/logisticsAdminister/shipmentsAddress",
},
{
icon: logistics_cost,
title: '运费模板',
title: intl.formatMessage({ id: 'home.logisticsCenter.title5' }),
url: "/memberCenter/logisticsAbility/logisticsAdminister/freightTemplate"
}
].filter((_item) => userAuth.urls?.includes(_item.url))
......@@ -85,14 +86,14 @@ const LogisticsCenter: React.FC<Iprops> = (props: Iprops) => {
<Layout
hasAuth={hasAbility}
viewRef={ref}
title="物流中心"
tips={"快速完成物流派单、接单、报价、物流信息对接"}
title={intl.formatMessage({ id: 'home.logisticsCenter.layoutTitle' })}
tips={intl.formatMessage({ id: 'home.logisticsCenter.layoutTips' })}
extra={
<Authorize
url={url}
>
<div>
<Link to={url}>进入物流中心</Link>
<Link to={url}>{intl.formatMessage({ id: 'home.logisticsCenter.authorize.url' })}</Link>
</div>
</Authorize>
}
......@@ -101,7 +102,7 @@ const LogisticsCenter: React.FC<Iprops> = (props: Iprops) => {
{
isShow && (
<Layout.AlertTip
content="您还没有创建物流公司门户,请先创建物流公司门户"
content={intl.formatMessage({ id: 'home.logisticsCenter.alertTip' })}
url={CREATE_INFO_MANAGE}
/>
)
......
import React, { Fragment, useMemo } from 'react';
import { Link } from 'umi'
import { Link, useIntl, getIntl } from 'umi'
import Layout, { IDataListProps } from './layout';
import Authorize from '../Authorize';
import useViewRequest from '../../hooks/useViewRequest';
import { getReportMemberHomeGetMemberTally, GetReportMemberHomeGetMemberTallyResponse, GetReportMemberHomeGetPurchaseTallyResponse } from '@/services/ReportV2Api';
import useGetAuth from '../../hooks/useGetAuth';
interface Iprops {};
interface Iprops { };
const { StaticsDataList } = Layout
const url = 'memberCenter/memberAbility';
const KEY_TITLE = {
importList: '会员入库',
changeList: '会员变更',
kpiList: '会员考评',
rectifyList: '会员整改',
rectifyNoticeList: '整改通知'
importList: getIntl().formatMessage({ id: 'home.memberCenter.importList' }),
changeList: getIntl().formatMessage({ id: 'home.memberCenter.changeList' }),
kpiList: getIntl().formatMessage({ id: 'home.memberCenter.kpiList' }),
rectifyList: getIntl().formatMessage({ id: 'home.memberCenter.rectifyList' }),
rectifyNoticeList: getIntl().formatMessage({ id: 'home.memberCenter.rectifyNoticeList' })
}
// 修改会员信息:判断当前用户是否有会员导入权限,有则显示修改会员信息按钮,点击跳转会员能力--会员管理--新增会员页
// 进入会员中心:判断当前用户是否有会员管理权限,有则显示进入会员中心按钮,点击跳转会员能力--会员管理
const MemberCenter: React.FC<Iprops> = () => {
const { loading, responseData, filterEmptyList, isError, ref, isEmpty } = useViewRequest<GetReportMemberHomeGetMemberTallyResponse, any>(getReportMemberHomeGetMemberTally, {})
const intl = useIntl();
const { hasAbilityFunc } = useGetAuth();
const hasAbility = hasAbilityFunc('memberAbility');
......@@ -29,14 +30,14 @@ const MemberCenter: React.FC<Iprops> = () => {
<Layout
hasAuth={hasAbility}
viewRef={ref}
title="会员中心"
title={intl.formatMessage({ id: 'home.memberCenter.layoutTitle' })}
tips=""
extra={
<Authorize
url={url}
>
<div>
<Link to={url}>会员中心</Link>
<Link to={url}>{intl.formatMessage({ id: 'home.memberCenter.authorize.url' })}</Link>
</div>
</Authorize>
}
......
import React, { Fragment, useMemo } from 'react';
import { Link } from 'umi'
import { Link, useIntl, getIntl } from 'umi'
import Layout from './layout';
import Authorize from '../Authorize';
import useViewRequest from '../../hooks/useViewRequest';
import { getReportMemberHomeGetOrderTally, GetReportMemberHomeGetOrderTallyResponse, GetReportMemberHomeGetPurchaseTallyResponse } from '@/services/ReportV2Api';
import useGetAuth from '../../hooks/useGetAuth';
interface Iprops {};
interface Iprops { };
const { StaticsDataList } = Layout
const purchaseOrderUrl = '/memberCenter/tranactionAbility/purchaseOrder/orderList';
const saleOrderUrl = '/memberCenter/tranactionAbility/saleOrder/orderList'
const KEY_TITLE = {
saleOrderList: '销售订单',
purchaseOrderList: '采购订单',
saleOrderList: getIntl().formatMessage({ id: 'home.orderCenter.saleOrderList' }),
purchaseOrderList: getIntl().formatMessage({ id: 'home.orderCenter.purchaseOrderList' }),
}
// 订单中心:根据当前用户+当前角色是否有订单能力菜单权限确定是否显示,再根据自定义布局确定显示及显示顺序
......@@ -21,6 +21,7 @@ const KEY_TITLE = {
const OrderCenter: React.FC<Iprops> = () => {
const { loading, responseData, filterEmptyList, isError, ref, isEmpty } = useViewRequest<GetReportMemberHomeGetOrderTallyResponse, any>(getReportMemberHomeGetOrderTally, {})
const intl = useIntl();
const { hasAbilityFunc, isConsumer } = useGetAuth();
const hasAbility = hasAbilityFunc('orderAbility');
const orderCenterUrl = isConsumer ? purchaseOrderUrl : saleOrderUrl;
......@@ -29,14 +30,14 @@ const OrderCenter: React.FC<Iprops> = () => {
<Layout
viewRef={ref}
hasAuth={hasAbility}
title="订单中心"
tips="提供订单管理、签订电子合同等功能"
title={intl.formatMessage({ id: 'home.orderCenter.layoutTitle' })}
tips={intl.formatMessage({ id: 'home.orderCenter.layoutTips' })}
extra={
<Authorize
url={orderCenterUrl}
>
<div>
<Link to={orderCenterUrl}>进入订单中心</Link>
<Link to={orderCenterUrl}>{intl.formatMessage({ id: 'home.orderCenter.authorize.url' })}</Link>
</div>
</Authorize>
}
......
import React, { useEffect, useState } from 'react';
import styles from './center.less';
import { Link } from 'umi'
import { Link, useIntl, getIntl } from 'umi'
import Layout from './layout';
import Authorize from '../Authorize';
import useViewRequest from '../../hooks/useViewRequest';
import useGetAuth from '../../hooks/useGetAuth';
import { getReportMemberHomeGetEnhanceTally, GetReportMemberHomeGetEnhanceTallyResponse } from '@/services/ReportV2Api';
import { getTemplateWebMemberProcessWebFindCurrMemberProcess } from '@/services/TemplateV2Api';
interface Iprops {};
interface Iprops { };
const url = '/memberCenter/handling/assign/query'
const CREATE_INFO_MANAGE = "/memberCenter/handling/infoManage";
const KEY_TITLE = {
supplierList: '指派生产通知单',
processList: '生产通知单处理'
supplierList: getIntl().formatMessage({ id: 'home.processCenter.supplierList' }),
processList: getIntl().formatMessage({ id: 'home.processCenter.processList' })
}
// 加工中心:根据当前用户+当前角色是否有此加工能力菜单权限确定是否显示,再根据自定义布局确定显示及显示顺序
// 如果当前用户有创建加工企业门户权限,但还未创建加工企业门户,则显示:您还没有创建加工企业门户,请先创建加工企业门户,点击创建加工企业门户按钮,跳转加工能力-加工企业门户管理-创建加工企业门户页
const ProcessCenter: React.FC<Iprops> = () => {
const { loading, responseData, isError,filterEmptyList, ref, inViewPort } = useViewRequest<GetReportMemberHomeGetEnhanceTallyResponse, any>(getReportMemberHomeGetEnhanceTally, {})
const { loading, responseData, isError, filterEmptyList, ref, inViewPort } = useViewRequest<GetReportMemberHomeGetEnhanceTallyResponse, any>(getReportMemberHomeGetEnhanceTally, {})
const intl = useIntl();
const { hasAbilityFunc, userAuth } = useGetAuth();
const hasAbility = hasAbilityFunc('handling');
const [isShow, setIsShow] = useState(false);
......@@ -46,14 +47,14 @@ const ProcessCenter: React.FC<Iprops> = () => {
<Layout
hasAuth={hasAbility}
viewRef={ref}
title="加工中心"
tips="提供外发生产、加工、装配全流程环节管控"
title={intl.formatMessage({ id: 'home.processCenter.layoutTitle' })}
tips={intl.formatMessage({ id: 'home.processCenter.layoutTips' })}
extra={
<Authorize
url={url}
>
<div>
<Link to={url}>加工中心</Link>
<Link to={url}>{intl.formatMessage({ id: 'home.processCenter.authorize.url' })}</Link>
</div>
</Authorize>
}
......@@ -63,7 +64,7 @@ const ProcessCenter: React.FC<Iprops> = () => {
{
isShow && (
<Layout.AlertTip
content="您还没有创建加工企业门户,请先创建加工企业门户。"
content={intl.formatMessage({ id: 'home.processCenter.alertTip' })}
url={CREATE_INFO_MANAGE}
/>
)
......
import React, { useCallback, useMemo } from 'react';
import { Space } from 'antd';
import styles from './center.less';
import { Link } from 'umi';
import { Link, useIntl } from 'umi';
import Authorize from '../Authorize';
import useViewRequest from '../../hooks/useViewRequest';
import Layout from './layout';
import useGetAuth from '../../hooks/useGetAuth';
import { getReportMemberHomeGetCommodityTally, GetReportMemberHomeGetCommodityTallyResponse } from '@/services/ReportV2Api';
interface Iprops {};
interface Iprops { };
const ADD_BRAND = "/memberCenter/commodityAbility/trademark/add";
const ADD_PRODUCT = '/memberCenter/commodityAbility/commodity/products/add';
......@@ -21,20 +21,21 @@ const ADD_REPOSITORIES = '/memberCenter/commodityAbility/repositories/add';
const ProductCenter: React.FC<Iprops> = () => {
const { loading, responseData, isError, ref, withQueryParams } = useViewRequest<GetReportMemberHomeGetCommodityTallyResponse, any>(getReportMemberHomeGetCommodityTally, {})
const intl = useIntl();
const { userAuth, hasAbilityFunc } = useGetAuth();
const hasAbility = hasAbilityFunc('commodityAbility');
const extraList = useMemo(() => [
{
title: '创建品牌',
title: intl.formatMessage({ id: 'home.productCenter.title1' }),
authUrl: ADD_BRAND,
},
{
title: '创建商品',
title: intl.formatMessage({ id: 'home.productCenter.title2' }),
authUrl: ADD_PRODUCT
},
{
title: '设置库存',
title: intl.formatMessage({ id: 'home.productCenter.title3' }),
authUrl: ADD_REPOSITORIES
},
], [])
......@@ -66,8 +67,8 @@ const ProductCenter: React.FC<Iprops> = () => {
<Layout
hasAuth={hasAbility}
viewRef={ref}
title="商品中心"
tips="快速完成品牌、商品创建、发布、提供灵活的商品库存管理"
title={intl.formatMessage({ id: 'home.productCenter.layoutTitle' })}
tips={intl.formatMessage({ id: 'home.productCenter.layoutTips' })}
loading={loading}
isError={isError}
extra={
......@@ -90,7 +91,7 @@ const ProductCenter: React.FC<Iprops> = () => {
}
>
<div className={styles.wrapRow}>
<span className={styles.rowTitle}>商品</span>
<span className={styles.rowTitle}>{intl.formatMessage({ id: 'home.productCenter.rowTitle' })}</span>
<div className={styles.rowValues}>
{
formatDataWithLink?.map((item: GetReportMemberHomeGetCommodityTallyResponse[0], key) => {
......@@ -99,8 +100,8 @@ const ProductCenter: React.FC<Iprops> = () => {
<div className={styles.colTitle}>{item.name}</div>
{
item.link
? <Link to={item.link} className={styles.colValue}>{item.count}</Link>
: <div className={styles.colValue}>{item.count}</div>
? <Link to={item.link} className={styles.colValue}>{item.count}</Link>
: <div className={styles.colValue}>{item.count}</div>
}
</div>
)
......
import React, { Fragment, useEffect, useMemo, useState } from 'react';
import styles from './center.less';
import { Link } from 'umi'
import { Link, useIntl, getIntl } from 'umi'
import Layout from './layout';
import Authorize from '../Authorize';
import useViewRequest from '../../hooks/useViewRequest';
import { getReportMemberHomeGetPurchaseTally, GetReportMemberHomeGetPurchaseTallyResponse } from '@/services/ReportV2Api';
import { BellOutlined } from '@ant-design/icons';
import {Button} from 'antd';
import { Button } from 'antd';
import useGetAuth from '../../hooks/useGetAuth';
import { getTemplateWebMemberPurchaseWebFindCurrMemberPurchase } from '@/services/TemplateV2Api';
interface Iprops {};
interface Iprops { };
const { StaticsDataList } = Layout
const consumerUrl = '/memberCenter/procurementAbility/purchaseInquiry/inquiry';
const providerUrl = '/memberCenter/procurementAbility/offter/offter'
const KEY_TITLE = {
purchaseInquiryList: '采购询价 ',
quotedPriceList: '报价',
confirmQuotedPriceList: '确认报价',
biddingList: '采购竞价',
onlineBiddingList: '在线竞价',
inviteTenderList: '招标',
tenderList: '投标',
needPlanList: '需求计划',
purchasePlanList: '采购计划'
purchaseInquiryList: getIntl().formatMessage({ id: 'home.purchaseCenter.purchaseInquiryList' }),
quotedPriceList: getIntl().formatMessage({ id: 'home.purchaseCenter.quotedPriceList' }),
confirmQuotedPriceList: getIntl().formatMessage({ id: 'home.purchaseCenter.confirmQuotedPriceList' }),
biddingList: getIntl().formatMessage({ id: 'home.purchaseCenter.biddingList' }),
onlineBiddingList: getIntl().formatMessage({ id: 'home.purchaseCenter.onlineBiddingList' }),
inviteTenderList: getIntl().formatMessage({ id: 'home.purchaseCenter.inviteTenderList' }),
tenderList: getIntl().formatMessage({ id: 'home.purchaseCenter.tenderList' }),
needPlanList: getIntl().formatMessage({ id: 'home.purchaseCenter.needPlanList' }),
purchasePlanList: getIntl().formatMessage({ id: 'home.purchaseCenter.purchasePlanList' })
}
/** memberType 是否是企业会员或是企业个人会员 */
const isBusiness = [1, 2];
......@@ -34,6 +34,7 @@ const isBusiness = [1, 2];
const PurchaseCenter: React.FC<Iprops> = () => {
const { loading, filterEmptyList, isError, ref, inViewPort, refresh } = useViewRequest<GetReportMemberHomeGetPurchaseTallyResponse, any>(getReportMemberHomeGetPurchaseTally, {})
const intl = useIntl();
const { userAuth, hasAbilityFunc, isConsumer } = useGetAuth();
const hasAbility = hasAbilityFunc('procurementAbility');
/** 是否是消费者即服务消费者 有权限 */
......@@ -57,20 +58,20 @@ const PurchaseCenter: React.FC<Iprops> = () => {
findCurrMemberPurchase()
}, [inViewPort, hasPurchaseAuth, hasFetchData])
const purchaseCenterUrl = useMemo(() => isConsumer ? consumerUrl : providerUrl ,[userAuth])
const purchaseCenterUrl = useMemo(() => isConsumer ? consumerUrl : providerUrl, [userAuth])
return (
<Layout
viewRef={ref}
hasAuth={hasAbility}
title="采购中心"
tips="提供在线采购询价、在线报价、在线招投标、在线竞价、制订采购计划、创建采购门户等功能"
title={intl.formatMessage({ id: 'home.purchaseCenter.layoutTitle' })}
tips={intl.formatMessage({ id: 'home.purchaseCenter.layoutTips' })}
extra={
<Authorize
url={purchaseCenterUrl}
>
<div>
<Link to={purchaseCenterUrl}>进入采购中心</Link>
<Link to={purchaseCenterUrl}>{intl.formatMessage({ id: 'home.purchaseCenter.authorize.url' })}</Link>
</div>
</Authorize>
}
......@@ -84,10 +85,10 @@ const PurchaseCenter: React.FC<Iprops> = () => {
<div className={styles.ding_tips}>
<div>
<BellOutlined />
<span style={{marginLeft: '12px'}}>您还没有创建采购门户,请先创建采购门户</span>
<span style={{ marginLeft: '12px' }}>{intl.formatMessage({ id: 'home.purchaseCenter.dingTips' })}</span>
</div>
<Link to={`/memberCenter/procurementAbility/purchasDoor/purchasInfo`}>
<Button size="small" type="primary">点击创建</Button>
<Button size="small" type="primary">{intl.formatMessage({ id: 'home.purchaseCenter.dingTips.button' })}</Button>
</Link>
</div>
)
......
import React, { useMemo } from 'react';
import { useIntl, getIntl } from 'umi';
import settlement_platformCollection from '@/assets/imgs/settlement_platformCollection.png';
import settlement_integrate from '@/assets/imgs/settlement_integrate.png';
import settlement_accountReceive from '@/assets/imgs/settlement_accountReceive.png';
......@@ -8,13 +9,14 @@ import useViewRequest from '../../hooks/useViewRequest';
import { getReportMemberHomeGetSettleAccountTally, GetReportMemberHomeGetSettleAccountTallyResponse } from '@/services/ReportV2Api';
import Layout from './layout';
import useGetAuth from '../../hooks/useGetAuth';
interface Iprops {};
interface Iprops { };
const KEY_TITLE = {
payableList: '应付账款结算',
platformList: '平台代收账款结算',
platformScoreList: '平台积分结算',
receivableList: '应收账款结算'
payableList: getIntl().formatMessage({ id: 'home.settlementCenter.payableList' }),
platformList: getIntl().formatMessage({ id: 'home.settlementCenter.platformList' }),
platformScoreList: getIntl().formatMessage({ id: 'home.settlementCenter.platformScoreList' }),
receivableList: getIntl().formatMessage({ id: 'home.settlementCenter.receivableList' })
}
// 结算中心:根据当前用户+当前角色是否有此结算能力菜单权限确定是否显示,再根据自定义布局确定显示及显示顺序
......@@ -26,6 +28,7 @@ const KEY_TITLE = {
const SettlementCenter: React.FC<Iprops> = () => {
const { loading, responseData, filterEmptyList, isError, ref, withQueryParams } = useViewRequest<GetReportMemberHomeGetSettleAccountTallyResponse, any>(getReportMemberHomeGetSettleAccountTally, {})
const intl = useIntl();
const { hasAbilityFunc, userAuth } = useGetAuth();
const hasAbility = hasAbilityFunc('balance');
......@@ -33,27 +36,27 @@ const SettlementCenter: React.FC<Iprops> = () => {
return [
{
icon: settlement_platformCollection,
title: '平台代收款结算',
title: intl.formatMessage({ id: 'home.settlementCenter.title1' }),
url: '/memberCenter/balance/platformSettlement/accountReceivable'
},
{
icon: settlement_integrate,
title: '平台积分结算',
title: intl.formatMessage({ id: 'home.settlementCenter.title2' }),
url: '/memberCenter/balance/platformSettlement/integral'
},
{
icon: settlement_accountReceive,
title: '应收账款结算',
title: intl.formatMessage({ id: 'home.settlementCenter.title3' }),
url: '/memberCenter/balance/accountsReceivable/settlementList'
},
{
icon: settlement_accountPayable,
title: '应付账款结算',
title: intl.formatMessage({ id: 'home.settlementCenter.title4' }),
url: '/memberCenter/balance/accountsPayable/settlementList'
},
{
icon: settlement_invoice,
title: '开票管理',
title: intl.formatMessage({ id: 'home.settlementCenter.title5' }),
url: '/memberCenter/balance/accountsReceivable/invoice'
}
].filter((_item) => userAuth.urls?.includes(_item.url))
......@@ -83,8 +86,8 @@ const SettlementCenter: React.FC<Iprops> = () => {
<Layout
hasAuth={hasAbility}
viewRef={ref}
title="结算中心"
tips="提供资资金结算、发票管理等功能"
title={intl.formatMessage({ id: 'home.settlementCenter.layoutTitle' })}
tips={intl.formatMessage({ id: 'home.settlementCenter.layoutTips' })}
loading={loading}
isError={isError}
>
......
......@@ -3,13 +3,13 @@ import styles from './center.less'
import create_shop from '@/assets/imgs/create_shop.png';
import { BellOutlined, RightOutlined } from '@ant-design/icons'
import { Button } from 'antd';
import { Link } from 'umi';
import { Link, useIntl } from 'umi';
import Authorize from '../Authorize';
import { getAuth } from '@/utils/auth';
import useViewRequest from '../../hooks/useViewRequest';
import { getTemplateWebMemberShopWebFindCurrMemberShop, GetTemplateWebMemberShopWebFindCurrMemberShopResponse } from '@/services/TemplateV2Api';
import Layout from './layout';
interface Iprops {}
interface Iprops { }
const SHOP_ABILITY = '/memberCenter/shopAbility';
const SHOP_CENTER = '/memberCenter/shopAbility/template'
......@@ -23,8 +23,9 @@ const CREATE_SHOP = '/memberCenter/shopAbility/infoManage';
const ShopCenter: React.FC<Iprops> = () => {
const { loading, responseData, isError, ref } = useViewRequest<GetTemplateWebMemberShopWebFindCurrMemberShopResponse, any>(getTemplateWebMemberShopWebFindCurrMemberShop, {})
const intl = useIntl();
const userAuth = getAuth();
const hasShopAbility = userAuth.urls?.some((_item) => _item.includes(SHOP_ABILITY));
const hasShopAbility = userAuth.urls?.some((_item) => _item.includes(SHOP_ABILITY));
const tagList = useMemo(() => {
const hasShopCenterAuth = userAuth.urls?.includes(SHOP_CENTER)
......@@ -33,19 +34,19 @@ const ShopCenter: React.FC<Iprops> = () => {
{
icon: create_shop,
url: CREATE_SHOP,
title: "创建店铺",
title: intl.formatMessage({ id: 'home.shopCenter.title1' }),
hasAuth: userAuth.urls?.includes(CREATE_SHOP)
},
{
icon: create_shop,
url: SHOP_CENTER,
title: "店铺模板",
title: intl.formatMessage({ id: 'home.shopCenter.title2' }),
hasAuth: hasShopCenterAuth,
},
{
icon: create_shop,
url: SHOP_CENTER,
title: "店铺装修",
title: intl.formatMessage({ id: 'home.shopCenter.title3' }),
hasAuth: hasShopCenterAuth,
}
]
......@@ -57,7 +58,7 @@ const ShopCenter: React.FC<Iprops> = () => {
}
return (
<Layout.AlertTip
content="轻松完成店铺的创建、店铺风格选择、店铺个性化装修。"
content={intl.formatMessage({ id: 'home.shopCenter.alertTip' })}
url={CREATE_SHOP}
/>
)
......@@ -67,8 +68,8 @@ const ShopCenter: React.FC<Iprops> = () => {
<Layout
viewRef={ref}
hasAuth={hasShopAbility}
title="店铺中心"
tips="轻松完成店铺的创建、店铺风格选择、店铺个性化装修"
title={intl.formatMessage({ id: 'home.shopCenter.layoutTitle' })}
tips={intl.formatMessage({ id: 'home.shopCenter.layoutTips' })}
extra={
<Authorize url={SHOP_CENTER}>
<div>
......
import React, {useCallback} from 'react';
import { Link } from 'umi'
import React, { useCallback } from 'react';
import { Link, useIntl, getIntl } from 'umi'
import Authorize from '../Authorize';
import useViewRequest from '../../hooks/useViewRequest';
import Layout from './layout';
import useGetAuth from '../../hooks/useGetAuth';
import { getReportMemberHomeGetTradeTally, GetReportMemberHomeGetTradeTallyResponse } from '@/services/ReportV2Api';
interface Iprops {};
interface Iprops { };
const KEY_TITLE = {
'commodityInquiryList': '商品询价',
'inquiryQuotationList': '询价报价',
'confirmInquiryQuotationList': '确认询价报价',
'demandPublishList': '需求发布',
'demandQuotationList': '需求报价',
'confirmDemandQuotationList': '确认需求报价',
'saleOrderList': '销售订单',
'purchaseOrderList': '采购订单'
'commodityInquiryList': getIntl().formatMessage({ id: 'home.tradeCenter.commodityInquiryList' }),
'inquiryQuotationList': getIntl().formatMessage({ id: 'home.tradeCenter.inquiryQuotationList' }),
'confirmInquiryQuotationList': getIntl().formatMessage({ id: 'home.tradeCenter.confirmInquiryQuotationList' }),
'demandPublishList': getIntl().formatMessage({ id: 'home.tradeCenter.demandPublishList' }),
'demandQuotationList': getIntl().formatMessage({ id: 'home.tradeCenter.demandQuotationList' }),
'confirmDemandQuotationList': getIntl().formatMessage({ id: 'home.tradeCenter.confirmDemandQuotationList' }),
'saleOrderList': getIntl().formatMessage({ id: 'home.tradeCenter.saleOrderList' }),
'purchaseOrderList': getIntl().formatMessage({ id: 'home.tradeCenter.purchaseOrderList' })
}
const productInquiry = '/memberCenter/tranactionAbility/productInquiry/inquirySearch';
......@@ -25,7 +25,8 @@ const inquiryOffer = '/memberCenter/tranactionAbility/inquiryOffer/inquirySearch
// 进入交易中心:当前会员角色类型为服务消费则点击进入交易能力-商品询价--询价单查询页,如果当前会员角色类型为服务提供则点击进入交易能力-询价报价--报价单查询页
const TradeCenter: React.FC<Iprops> = () => {
const { loading,filterEmptyList, ref, isEmpty } = useViewRequest<GetReportMemberHomeGetTradeTallyResponse, any>(getReportMemberHomeGetTradeTally, {})
const { loading, filterEmptyList, ref, isEmpty } = useViewRequest<GetReportMemberHomeGetTradeTallyResponse, any>(getReportMemberHomeGetTradeTally, {})
const intl = useIntl();
const { userAuth, hasAbilityFunc, isConsumer } = useGetAuth();
const hasAbility = hasAbilityFunc('tranactionAbility');
const url = isConsumer ? productInquiry : inquiryOffer;
......@@ -34,14 +35,14 @@ const TradeCenter: React.FC<Iprops> = () => {
<Layout
viewRef={ref}
hasAuth={hasAbility}
title="交易中心"
tips="提供在线发布需求,在线询价、在线报价、订单交易、签订电子合同等功能"
title={intl.formatMessage({ id: 'home.tradeCenter.layoutTitle' })}
tips={intl.formatMessage({ id: 'home.tradeCenter.layoutTips' })}
extra={
<Authorize
url={url}
>
<div>
<Link to={url}>进入交易中心</Link>
<Link to={url}>{intl.formatMessage({ id: 'home.tradeCenter.authorize.url' })}</Link>
</div>
</Authorize>
}
......
......@@ -2,7 +2,7 @@ import React, { ReactNode, useEffect, useMemo, useState } from 'react';
import { Button, Badge } from 'antd';
import styles from './Container.less';
import { Skeleton } from 'antd';
import { Link } from 'umi';
import { Link, useIntl } from 'umi';
import layoutStyles from './center.less';
import Authorize from '../Authorize';
import { BellOutlined, RightOutlined } from '@ant-design/icons';
......@@ -47,12 +47,13 @@ interface Iprops {
/**
* 出错是的render方法
*/
customizeErrorRender?: (() => React.ReactElement )| null
customizeErrorRender?: (() => React.ReactElement) | null
onRefresh?: (params: any) => void,
};
const Layout: LayoutType & React.FC<Iprops> = (props) => {
const intl = useIntl();
const { title, tips, extra, children, loading, isError, customizeErrorRender, viewRef, onRefresh, isEmpty = false, hasAuth = true } = props;
const handleRefresh = () => {
......@@ -67,7 +68,7 @@ const Layout: LayoutType & React.FC<Iprops> = (props) => {
return (
customizeErrorRender?.() || (
<div>
<Button onClick={handleRefresh}>拉取数据时发生了错误,点击刷新</Button>
<Button onClick={handleRefresh}>{intl.formatMessage({ id: 'home.layout.isError' })}</Button>
</div>
)
)
......@@ -119,31 +120,31 @@ const StaticsDataList = (props: IDataListProps) => {
const { dataSource, title } = props;
return (
<>
{
dataSource && Object.keys(dataSource).map((record) => {
return (
<div className={layoutStyles.wrapRow} key={record}>
<span className={layoutStyles.rowTitle}>{title?.[record]}</span>
<div className={layoutStyles.rowValues}>
{
dataSource[record]?.map((_item, key) => {
return (
<div className={layoutStyles.wrapCol} key={key}>
<div className={layoutStyles.colTitle}>{_item.name}</div>
{
_item.link
? <Link to={_item.link} className={layoutStyles.colValue}>{_item.count}</Link>
: <div className={layoutStyles.colValue}>{_item.count}</div>
}
</div>
)
})
}
{
dataSource && Object.keys(dataSource).map((record) => {
return (
<div className={layoutStyles.wrapRow} key={record}>
<span className={layoutStyles.rowTitle}>{title?.[record]}</span>
<div className={layoutStyles.rowValues}>
{
dataSource[record]?.map((_item, key) => {
return (
<div className={layoutStyles.wrapCol} key={key}>
<div className={layoutStyles.colTitle}>{_item.name}</div>
{
_item.link
? <Link to={_item.link} className={layoutStyles.colValue}>{_item.count}</Link>
: <div className={layoutStyles.colValue}>{_item.count}</div>
}
</div>
)
})
}
</div>
</div>
</div>
)
})
}
)
})
}
</>
)
}
......@@ -178,11 +179,11 @@ const Tags = (props: TagProps) => {
<Badge count={_item.count || 0}>
<Link to={_item.url} className={layoutStyles.tagsItem} >
<div className={layoutStyles.hoverLink}>
<img src={_item.icon} className={layoutStyles.icon}/>
<img src={_item.icon} className={layoutStyles.icon} />
<div className={layoutStyles.text}>{_item.title}</div>
<div className={layoutStyles.hoverIconConatiner}>
<div className={layoutStyles.hoverIcon}>
<RightOutlined style={{ color: '#fff', fontSize: '8px'}} />
<RightOutlined style={{ color: '#fff', fontSize: '8px' }} />
</div>
</div>
</div>
......@@ -203,17 +204,18 @@ interface AlterTipProps {
}
const AlertTip = (props: AlterTipProps) => {
const intl = useIntl();
const { content, extra = null, url = "" } = props;
return (
<div className={layoutStyles.ding_tips}>
<div>
<BellOutlined />
<span style={{marginLeft: '12px'}}>{content}</span>
<span style={{ marginLeft: '12px' }}>{content}</span>
</div>
{
extra || (
<Link to={url}>
<Button size="small" type="primary">点击创建</Button>
<Button size="small" type="primary">{intl.formatMessage({ id: 'home.layout.extra' })}</Button>
</Link>
)
}
......
import React, { useState, useEffect, useCallback, useReducer } from 'react';
import { useIntl } from 'umi';
import { Modal } from 'antd';
import styles from './index.less';
import { CloseOutlined } from '@ant-design/icons';
......@@ -23,8 +24,9 @@ interface Iprops {
}
const CustomWorkBench: React.FC<Iprops> = (props) => {
const intl = useIntl();
const { layouts, handleChangeOrder } = props;
const [ cards, setCards ] = useState([]);
const [cards, setCards] = useState([]);
const { state: visible, toggle: setVisible } = useToggle(false);
const handleVisible = () => {
setVisible(true)
......@@ -35,7 +37,7 @@ const CustomWorkBench: React.FC<Iprops> = (props) => {
}
useEffect(() => {
if(visible) {
if (visible) {
return;
}
setCards(layouts);
......@@ -79,21 +81,21 @@ const CustomWorkBench: React.FC<Iprops> = (props) => {
<span className={styles.icon}>
<img src={home_workBench} />
</span>
自定义工作台
{intl.formatMessage({ id: 'home.customWorkBench.customWorkBench' })}
</div>
<Modal
width={800}
visible={visible}
onCancel={handleCancel}
closable={false}
bodyStyle={{padding: 0}}
bodyStyle={{ padding: 0 }}
onOk={handleOk}
>
<div className={styles.modalContainer}>
<div className={styles.header}>
<div className={styles.left}>
<div className={styles.title}>产品模块自定义</div>
<div className={styles.tips}>在此你可根据业务形态自定义展示后期可在“自定义工作台”中随时调整</div>
<div className={styles.title}>{intl.formatMessage({ id: 'home.customWorkBench.title' })}</div>
<div className={styles.tips}>{intl.formatMessage({ id: 'home.customWorkBench.tips' })}</div>
</div>
<div className={styles.close} onClick={handleCancel}>
<CloseOutlined />
......@@ -106,7 +108,7 @@ const CustomWorkBench: React.FC<Iprops> = (props) => {
</div>
<div className={styles.footer}>
<div className={styles.sortTips}>
(可拖动排序)
({intl.formatMessage({ id: 'home.customWorkBench.sortTips' })})
</div>
</div>
</div>
......
import React, { useState, useEffect } from 'react';
import { useIntl } from 'umi';
import styles from './index.less';
import { LeftOutlined, RightOutlined, CloseOutlined } from '@ant-design/icons';
import { Button } from 'antd';
import moment from 'moment';
import { Modal } from 'antd';
import { getManageContentNoticeFindNewestNotice } from '@/services/ManageV2Api';
interface Iprops {}
interface Iprops { }
const LatestAnnouces: React.FC = () => {
const intl = useIntl();
const [data, setData] = useState([]);
const [totalCount, setTotalCount] = useState<number>(0)
const [loading, setLoading] = useState<boolean>(false);
......@@ -21,13 +23,13 @@ const LatestAnnouces: React.FC = () => {
const getList = (params) => {
setLoading(true);
getManageContentNoticeFindNewestNotice(params)
.then(({data, code}) => {
setLoading(false);
if(code === 1000) {
setTotalCount(data.totalCount)
setData(data.data);
}
})
.then(({ data, code }) => {
setLoading(false);
if (code === 1000) {
setTotalCount(data.totalCount)
setData(data.data);
}
})
}
useEffect(() => {
......@@ -60,16 +62,16 @@ const LatestAnnouces: React.FC = () => {
return (
<div className={styles.announces}>
<div className={styles.header}>
<div className={styles.title}>最新公告</div>
<div className={styles.title}>{intl.formatMessage({ id: 'home.latestAnnouces.title' })}</div>
{
length >= 6
? (
<div className={styles.nextOrPreview}>
<Button onClick={handlePrev} icon={<LeftOutlined/>} className={styles.prev} disabled={pagination.current <= 1}></Button>
<Button onClick={handleNext} icon={<RightOutlined/>} disabled={pagination.current * 5 >= totalCount}></Button>
</div>
)
: null
? (
<div className={styles.nextOrPreview}>
<Button onClick={handlePrev} icon={<LeftOutlined />} className={styles.prev} disabled={pagination.current <= 1}></Button>
<Button onClick={handleNext} icon={<RightOutlined />} disabled={pagination.current * 5 >= totalCount}></Button>
</div>
)
: null
}
</div>
......@@ -82,7 +84,7 @@ const LatestAnnouces: React.FC = () => {
return (
<div className={styles.item} key={item.id}>
<div className={styles.date}>
<div className={styles.month}>{(month + 1)}</div>
<div className={styles.month}>{(month + 1)}{intl.formatMessage({ id: 'home.latestAnnouces.month' })}</div>
<div className={styles.day}>{day}</div>
</div>
<div className={styles.content} onClick={() => handleViewDetail(item)}>
......@@ -99,18 +101,18 @@ const LatestAnnouces: React.FC = () => {
footer={false}
onCancel={() => setVisible(false)}
closable={false}
bodyStyle={{padding: 0}}
bodyStyle={{ padding: 0 }}
>
<div className={styles.notice}>
<div className={styles.noticeHeader}>
<div className={styles.title}>{currnetNotice.title}</div>
<div className={styles.icon}><CloseOutlined onClick={() => setVisible(false)}/></div>
<div className={styles.icon}><CloseOutlined onClick={() => setVisible(false)} /></div>
</div>
<div className={styles.noticeBody}>
<div dangerouslySetInnerHTML={{__html: currnetNotice.content}} ></div>
<div dangerouslySetInnerHTML={{ __html: currnetNotice.content }} ></div>
</div>
<div className={styles.noticeFooter}>
<Button onClick={() => setVisible(false)} type={"primary"}>我知道了</Button>
<Button onClick={() => setVisible(false)} type={"primary"}>{intl.formatMessage({ id: 'home.latestAnnouces.noticeFooter' })}</Button>
</div>
</div>
......
......@@ -2,15 +2,16 @@ import React from 'react';
import styles from './index.less';
import menu_zh from '@/locales/zh-CN/menu';
import { Tooltip } from 'antd';
import { Link } from 'umi';
interface Iprops {}
import { Link, useIntl } from 'umi';
interface Iprops { }
const RecentVisit: React.FC<Iprops> = () => {
const intl = useIntl();
const recentVisit = localStorage.getItem('recentVisit') && JSON.parse(localStorage.getItem('recentVisit')) || {};
return (
<div className={styles.recentVisit}>
<div className={styles.header}>
<div className={styles.title}>最近访问</div>
<div className={styles.title}>{intl.formatMessage({ id: 'home.recentVisit.title' })}</div>
</div>
<div className={styles.body}>
{
......@@ -18,10 +19,10 @@ const RecentVisit: React.FC<Iprops> = () => {
const menuName = item.split(".");
const length = menuName.length
return (
<Tooltip key={item} placement="top" title={ menuName[length - 1] }>
<div className={styles.item}>
<Tooltip key={item} placement="top" title={menuName[length - 1]}>
<div className={styles.item}>
<Link key={item} to={recentVisit[item]} >
{ menuName[length - 1] }
{menuName[length - 1]}
</Link>
</div>
</Tooltip>
......
import { render } from '@/app';
import React from 'react';
import { Button, Space, Row, Col, Dropdown, Steps} from 'antd';
import { useIntl } from 'umi';
import { Button, Space, Row, Col, Dropdown, Steps } from 'antd';
import { CompassOutlined, CompassFilled, UpOutlined } from '@ant-design/icons';
import styles from './index.less';
import cx from 'classnames';
......@@ -8,34 +9,35 @@ import cx from 'classnames';
const { Step } = Steps;
const UseGuaid: React.FC<{}> = () => {
const intl = useIntl();
const menu = (
<div className={styles.giudeMenuBox}>
<Steps progressDot current={1000} direction="vertical">
<Step title="定义产品功能" description={<><p>开发第一步,标准功能、自定义功能及云功能编辑</p><a href="">如何定义</a></>} />
<Step title="定义产品功能" description={<><p>开发第一步,标准功能、自定义功能及云功能编辑</p><a href="">如何定义</a></>} />
<Step title="定义产品功能" description={<><p>开发第一步,标准功能、自定义功能及云功能编辑</p><a href="">如何定义</a></>} />
<Step title="定义产品功能" description={<><p>开发第一步,标准功能、自定义功能及云功能编辑</p><a href="">如何定义</a></>} />
<Step title="定义产品功能" description={<><p>开发第一步,标准功能、自定义功能及云功能编辑</p><a href="">如何定义</a></>} />
</Steps>
<Steps progressDot current={1000} direction="vertical">
<Step title={intl.formatMessage({ id: 'home.useGuaid.title' })} description={<><p>{intl.formatMessage({ id: 'home.useGuaid.description' })}</p><a href="">{intl.formatMessage({ id: 'home.useGuaid.a' })}</a></>} />
<Step title={intl.formatMessage({ id: 'home.useGuaid.title' })} description={<><p>{intl.formatMessage({ id: 'home.useGuaid.description' })}</p><a href="">{intl.formatMessage({ id: 'home.useGuaid.a' })}</a></>} />
<Step title={intl.formatMessage({ id: 'home.useGuaid.title' })} description={<><p>{intl.formatMessage({ id: 'home.useGuaid.description' })}</p><a href="">{intl.formatMessage({ id: 'home.useGuaid.a' })}</a></>} />
<Step title={intl.formatMessage({ id: 'home.useGuaid.title' })} description={<><p>{intl.formatMessage({ id: 'home.useGuaid.description' })}</p><a href="">{intl.formatMessage({ id: 'home.useGuaid.a' })}</a></>} />
<Step title={intl.formatMessage({ id: 'home.useGuaid.title' })} description={<><p>{intl.formatMessage({ id: 'home.useGuaid.description' })}</p><a href="">{intl.formatMessage({ id: 'home.useGuaid.a' })}</a></>} />
</Steps>
</div>
);
return (
<div>
<Space direction="vertical" style={{width:'100%'}}>
<Space direction="vertical" style={{ width: '100%' }}>
<Row>
<Col span={24}>
<div className={styles.homeGuide}>
<div className={cx(styles.gridStyle, styles.gridStyleFirst)}>
<p className={styles.firstp}>
<CompassFilled className={styles.guideIconFirst} />
<span>&nbsp;使用向导</span>
<span>&nbsp;{intl.formatMessage({ id: 'home.useGuaid.firstp' })}</span>
</p>
</div>
<Dropdown overlay={menu}>
<div className={styles.gridStyle}>
<div>
<p className={styles.guideTitle}>1.新建商品</p>
<p className={styles.guideDesc}>三分钟智能化,完成商品创建</p>
<p className={styles.guideTitle}>{intl.formatMessage({ id: 'home.useGuaid.guideTitle' })}</p>
<p className={styles.guideDesc}>{intl.formatMessage({ id: 'home.useGuaid.guideDesc' })}</p>
</div>
<UpOutlined className={styles.guideIcon} />
</div>
......@@ -43,8 +45,8 @@ const UseGuaid: React.FC<{}> = () => {
<Dropdown overlay={menu}>
<div className={styles.gridStyle}>
<div>
<p className={styles.guideTitle}>1.新建商品</p>
<p className={styles.guideDesc}>三分钟智能化,完成商品创建</p>
<p className={styles.guideTitle}>{intl.formatMessage({ id: 'home.useGuaid.guideTitle' })}</p>
<p className={styles.guideDesc}>{intl.formatMessage({ id: 'home.useGuaid.guideDesc' })}</p>
</div>
<UpOutlined className={styles.guideIcon} />
</div>
......@@ -52,22 +54,22 @@ const UseGuaid: React.FC<{}> = () => {
<Dropdown overlay={menu}>
<div className={cx(styles.gridStyle, styles.gridStyleLast)}>
<div>
<p className={styles.guideTitle}>1.新建商品</p>
<p className={styles.guideDesc}>三分钟智能化,完成商品创建</p>
<p className={styles.guideTitle}>{intl.formatMessage({ id: 'home.useGuaid.guideTitle' })}</p>
<p className={styles.guideDesc}>{intl.formatMessage({ id: 'home.useGuaid.guideDesc' })}</p>
</div>
<UpOutlined className={styles.guideIcon} />
</div>
</Dropdown>
<div className={styles.guideClose}>
<p>关闭</p>
<p>{intl.formatMessage({ id: 'home.useGuaid.guideClose' })}</p>
</div>
</div>
</Col>
</Row>
</Space>
</div>
)
}
export default UseGuaid;
\ No newline at end of file
export default UseGuaid;
......@@ -2,11 +2,11 @@ import React, { useCallback, useMemo, useReducer } from 'react';
import styles from './index.less';
import moment from 'moment';
import { Badge, message, Spin, Tooltip } from 'antd';
import { Link } from 'umi';
import { Link, useIntl } from 'umi';
import { getAuth } from '@/utils/auth';
import StatusTag from '@/components/StatusTag';
import home_user from '@/assets/imgs/home_user.png';
import {observer, inject} from 'mobx-react';
import { observer, inject } from 'mobx-react';
import Icon, { QuestionCircleOutlined } from '@ant-design/icons';
import { ReactComponent as DefaultAvatar } from '@/assets/imgs/default_avatar.svg';
import UploadFiles from '@/components/UploadFiles/UploadFiles'
......@@ -14,9 +14,9 @@ import { UploadChangeParam } from 'antd/lib/upload/interface'
import { GlobalConfig } from '@/global/config';
import { postMemberMainpageLogoAdd } from '@/services/MemberV2Api';
interface Iprops {}
interface Iprops { }
const WEEKDAYS = ["天", "一","二", "三", "四", "五","六"];
const WEEKDAYS = ["天", "一", "二", "三", "四", "五", "六"];
// const LEVEL_IMAGE = [level1, level1, level2, level3, level4];
const EDIT_USER_URL = '/memberCenter/editMySelf';
const USER_CENTER_URL = '/memberCenter/memberAbility/profile/query';
......@@ -25,40 +25,41 @@ const STATUS_COLOR: ("default" | "processing" | "error" | "success")[] = ["defau
function reducer(state, action) {
switch (action.type) {
case 'uploading':
return {...state, loading: true};
return { ...state, loading: true };
case 'done':
return {...state, loading: false, logo: action.payload.url}
return { ...state, loading: false, logo: action.payload.url }
default:
throw new Error();
}
}
const UserCenter: React.FC<Iprops> = (props) => {
const intl = useIntl();
const today = moment();
const userAuth = getAuth();
const currentRole = userAuth?.roles?.filter((item) => item.memberRoleId === userAuth.memberRoleId)
const [state, dispatch] = useReducer(reducer, { loading: false, logo: userAuth?.logo})
if(!userAuth) {
const [state, dispatch] = useReducer(reducer, { loading: false, logo: userAuth?.logo })
if (!userAuth) {
return null
}
const beforeUpload = useCallback((file) => {
const isJpgOrPng = file.type === 'image/jpeg' || file.type === 'image/png' || file.type === 'image/jpg';
if (!isJpgOrPng) {
message.error('仅支持上传JPEG/JPG/PNG文件!');
message.error(intl.formatMessage({ id: 'home.userCenter.error' }));
}
return isJpgOrPng;
}, [])
const onFileChange = async (info: UploadChangeParam) => {
if (info.file.status === 'uploading') {
dispatch({type: 'uploading'})
dispatch({ type: 'uploading' })
return;
}
if(info.file.status === 'done') {
const logo = info.file.response.data
const { code } = await postMemberMainpageLogoAdd({logo: logo });
if (info.file.status === 'done') {
const logo = info.file.response.data
const { code } = await postMemberMainpageLogoAdd({ logo: logo });
if (code === 1000) {
dispatch({type: 'done', payload: {url: logo}});
dispatch({ type: 'done', payload: { url: logo } });
(props as any).UserStore.setUserAvatar(logo)
}
}
......@@ -71,10 +72,10 @@ const UserCenter: React.FC<Iprops> = (props) => {
<div className={styles.header}>
<div className={styles.infos}>
<div className={styles.hi}>
{`Hi, ${userAuth?.company}! 欢迎来到${GlobalConfig.global.siteInfo.name}`}
{`Hi, ${userAuth?.company}! ${intl.formatMessage({ id: 'home.userCenter.wellcome' })}${GlobalConfig.global.siteInfo.name}`}
</div>
<div className={styles.date}>
{today.format('YYYY年MM月DD日')} 星期{WEEKDAYS[today.day()]}
{today.format(`YYYY${intl.formatMessage({ id: 'home.userCenter.year' })}MM${intl.formatMessage({ id: 'home.userCenter.month' })}DD${intl.formatMessage({ id: 'home.userCenter.day' })}`)} {intl.formatMessage({ id: `home.userCenter.day${today.day()}` })}
</div>
</div>
<div className={styles.images}>
......@@ -89,10 +90,10 @@ const UserCenter: React.FC<Iprops> = (props) => {
<UploadFiles customizeItemRender={null} beforeUpload={beforeUpload} onChange={onFileChange} showFiles={false}>
{
state.logo
? <img src={state.logo || ''} className={styles.logo}/>
: <Icon component={() => <DefaultAvatar className={styles.logo} />} />
? <img src={state.logo || ''} className={styles.logo} />
: <Icon component={() => <DefaultAvatar className={styles.logo} />} />
}
<span className={styles.upload}>修改</span>
<span className={styles.upload}>{intl.formatMessage({ id: 'home.userCenter.upload' })}</span>
</UploadFiles>
</div>
</div>
......@@ -106,20 +107,20 @@ const UserCenter: React.FC<Iprops> = (props) => {
{
currentRole && currentRole.map((item, key) => {
return (
<div style={{marginRight: '16px'}} key={key}>
<StatusTag type={"success"} title={item.memberRoleName} />
<div style={{ marginRight: '16px' }} key={key}>
<StatusTag type={"success"} title={item.memberRoleName} />
</div>
)
})
}
</div>
<div style={{marginTop: '13px'}}>
<div style={{ marginTop: '13px' }}>
<Tooltip placement="top" title={userAuth.validateMsg || ''}>
<Badge status={STATUS_COLOR[userAuth.validateStatus]} text={userAuth.validateStatusDesc} />
{
isVerifyFail && (
<span style={{marginLeft: '4px'}}>
<QuestionCircleOutlined style={{color: '#ccc', fontSize: '12px'}} />
<span style={{ marginLeft: '4px' }}>
<QuestionCircleOutlined style={{ color: '#ccc', fontSize: '12px' }} />
</span>
)
}
......@@ -129,20 +130,20 @@ const UserCenter: React.FC<Iprops> = (props) => {
</div>
{
isVerifyFail &&
<Link to={EDIT_USER_URL} className={styles.link}>修改会员信息</Link>
<Link to={EDIT_USER_URL} className={styles.link}>{intl.formatMessage({ id: 'home.userCenter.link' })}</Link>
}
</div>
<div className={styles.otherValues}>
<div className={styles.divider}>
<div className={styles.level}>
会员等级<StatusTag type={'primary'} title={userAuth.levelTag} />
{intl.formatMessage({ id: 'home.userCenter.level' })}<StatusTag type={'primary'} title={userAuth.levelTag} />
</div>
<div className={styles.score}>
平台积分<strong>{userAuth.score}</strong>
{intl.formatMessage({ id: 'home.userCenter.score' })}<strong>{userAuth.score}</strong>
</div>
{
userAuth.urls.includes(USER_CENTER_URL) && (
<Link to={USER_CENTER_URL} className={styles.link}>进入会员中心</Link>
<Link to={USER_CENTER_URL} className={styles.link}>{intl.formatMessage({ id: 'home.userCenter.userAuth.link' })}</Link>
)
}
</div>
......
import React, { useState, useEffect, useCallback } from 'react'
import { useIntl } from 'umi';
import { PageHeaderWrapper } from '@ant-design/pro-layout'
import { Card } from 'antd';
import UseGuaid from './components/UseGuaid';
......@@ -8,12 +9,11 @@ import LatestAnnounce from './components/LatestAnnounces';
import RecentVisit from './components/RecentVisit';
import AnyQuestion from './components/AnyQuestion';
import AdvertisementContainer from './components/AdvertisementSpace';
import { TradeCenter, FundCenter, ShopCenter, ProductCenter, SettlementCenter, AfterSoldCenter, LogisticsCenter, ProcessCenter, Contract, PurchaseCenter, OrderCenter, ChannelMallCenter, MemberCenter } from './components/Centers';
import { TradeCenter, FundCenter, ShopCenter, ProductCenter, SettlementCenter, AfterSoldCenter, LogisticsCenter, ProcessCenter, Contract, PurchaseCenter, OrderCenter, ChannelMallCenter, MemberCenter } from './components/Centers';
import styles from './index.less'
import { CompassFilled } from '@ant-design/icons';
import useGetAuth from './hooks/useGetAuth';
import { getReportMemberHomeGetDataLayout, postReportMemberHomeUpdateDataLayout } from '@/services/ReportV2Api';
const ComponentSelect = {
"会员中心": MemberCenter,
"交易中心": TradeCenter,
......@@ -32,6 +32,7 @@ const ComponentSelect = {
"风控中心": ''
}
const Home: React.FC<{}> = () => {
const intl = useIntl();
const [visible, setVisible] = useState<boolean>(false);
const [loading, setLoading] = useState<boolean>(false);
const [layout, setLayout] = useState<LayoutType[]>([]);
......@@ -54,7 +55,7 @@ const Home: React.FC<{}> = () => {
getDataLayout();
}, [])
const handleChangeOrder = useCallback( async (list: LayoutType []) => {
const handleChangeOrder = useCallback(async (list: LayoutType[]) => {
/** 将原数据补充进去 */
const listKeys = list.filter((_item) => _item.isShow).map((_item) => {
const { code, isShow, ...rest } = _item;
......@@ -65,7 +66,7 @@ const Home: React.FC<{}> = () => {
});
const { code } = await postReportMemberHomeUpdateDataLayout(listKeys as Omit<LayoutType, "code">[]);
if(code === 1000) {
if (code === 1000) {
setLayout(list);
}
......@@ -83,7 +84,7 @@ const Home: React.FC<{}> = () => {
return (
<div
className={styles.ability}
style={{order: item.sort, display: (item.isShow ? 'block' : 'none')}}
style={{ order: item.sort, display: (item.isShow ? 'block' : 'none') }}
key={item.code}
>
{RenderComponent && <RenderComponent />}
......@@ -96,7 +97,7 @@ const Home: React.FC<{}> = () => {
}, [loading, layout])
return (
<PageHeaderWrapper title="首页">
<PageHeaderWrapper title={intl.formatMessage({ id: 'home.title' })}>
{/* <div className={styles.userGuaid} style={{display: visible ? 'block': 'none'}}>
<UseGuaid/>
</div> */}
......@@ -104,7 +105,7 @@ const Home: React.FC<{}> = () => {
<div className={styles.left}>
<UserCenter />
<div className={styles.otherCenters}>
{renderCenters()}
{renderCenters()}
</div>
</div>
<div className={styles.right}>
......@@ -117,7 +118,7 @@ const Home: React.FC<{}> = () => {
</div>
<a href="https://www.yuque.com/shushangyun-lingxi/xr7ol7/eh909i" target="__blank" className={styles.controller}>
<CompassFilled className={styles.icon} />
<span className={styles.text}>使用向导</span>
<span className={styles.text}>{intl.formatMessage({ id: 'home.guide' })}</span>
</a>
</div>
<div className={styles.commonMargin}>
......
......@@ -2,12 +2,12 @@
* @Author: XieZhiXiong
* @Date: 2021-06-04 15:37:19
* @LastEditors: XieZhiXiong
* @LastEditTime: 2021-11-17 18:23:20
* @LastEditTime: 2021-11-25 10:11:25
* @Description: 修改会员注册信息
*/
import React, { useState, useEffect } from 'react';
import { history, Prompt } from 'umi';
import { Button, Card, Spin, message } from 'antd';
import { Button, Card, Spin, Empty, message } from 'antd';
import { PageHeaderWrapper } from '@ant-design/pro-layout';
import { SaveOutlined } from '@ant-design/icons';
import { createFormActions, FormEffectHooks, FormPath } from '@formily/antd';
......@@ -88,35 +88,41 @@ const MemberUpdate: React.FC<any> = props => {
backIcon={<ReutrnEle description="返回" />}
title="编辑会员"
extra={[
<Button
key="1"
type="primary"
icon={<SaveOutlined />}
loading={submitLoading}
onClick={() => formActions.submit()}
>
保存
</Button>,
memberItems.length ? (
<Button
key="1"
type="primary"
icon={<SaveOutlined />}
loading={submitLoading}
onClick={() => formActions.submit()}
>
保存
</Button>
) : null,
]}
>
<Card>
<NiceForm
onSubmit={handleSubmit}
actions={formActions}
components={{
RadioGroup: Radio.Group,
CheckboxGroup: Checkbox.Group,
AreaSelect,
}}
effects={() => {
onFormInputChange$().subscribe(() => {
if (!unsaved) {
setUnsaved(true);
}
});
}}
schema={schema(memberItems, true)}
/>
{memberItems.length ? (
<NiceForm
onSubmit={handleSubmit}
actions={formActions}
components={{
RadioGroup: Radio.Group,
CheckboxGroup: Checkbox.Group,
AreaSelect,
}}
effects={() => {
onFormInputChange$().subscribe(() => {
if (!unsaved) {
setUnsaved(true);
}
});
}}
schema={schema(memberItems, true)}
/>
) : (
<Empty description='当前无可修改的资料' />
)}
</Card>
</PageHeaderWrapper>
......
......@@ -87,7 +87,7 @@ function useGetLayout() {
const childConfig = {
componentName: componentName,
title: _item.children[_child]?.title || `${configKey}-${_childKey + 1}`,
props: { ...rest, data: children },
props: { ...rest, status: rest?.status ?? true, data: children },
canEdit: true,
canDelete: false,
canDrag: false,
......@@ -98,6 +98,7 @@ function useGetLayout() {
type: `${_child}Item`,
}
},
hideAction: true,
addBtnText: '添加子节点',
type: _child,
otherProps: {
......
......@@ -5,11 +5,13 @@ import styles from './index.less';
import Container from '../Container';
interface Iprops {
children: React.ReactElement
children: React.ReactElement,
/** 显示隐藏 */
status: boolean
}
const CategoryList: React.FC<Iprops> & { Item: typeof CategoryItem } = (props: Iprops) => {
const { children } = props;
const { children, status } = props;
const cardProps = {
bodyStyle: {
padding: '12px 16px',
......@@ -33,7 +35,7 @@ const CategoryList: React.FC<Iprops> & { Item: typeof CategoryItem } = (props: I
};
return (
<Container cardProps={cardProps} listStyle={listStyle as any} itemStyle={itemStyle as any} {...divProps}>
<Container visible={status} cardProps={cardProps} listStyle={listStyle as any} itemStyle={itemStyle as any} {...divProps}>
{children}
</Container>
);
......
......@@ -2,7 +2,7 @@ import React from 'react';
import Container from '../Container';
const ProductContainer = (props) => {
const { children } = props;
const { children, status } = props;
const listStyle = {
marginRight: '-8px',
......@@ -20,7 +20,7 @@ const ProductContainer = (props) => {
};
return (
<Container card={false} listStyle={listStyle as any} itemStyle={itemStyle as any} {...divProps} tooltipTitle="精选商品">
<Container visible={status} card={false} listStyle={listStyle as any} itemStyle={itemStyle as any} {...divProps} tooltipTitle="精选商品">
{children}
</Container>
);
......
......@@ -9,6 +9,8 @@ import { useSelector, getIframe, getSelectedNode } from '@lingxi-disign/react';
interface Iprops {
children: React.ReactElement,
title: string,
/** 控制显示隐藏 */
status: boolean,
}
const scrollNode = (key: string) => {
......@@ -42,7 +44,7 @@ const scrollNode = (key: string) => {
const SimpleCommodityList: React.FC<Iprops> & { Item: typeof SimpleItem } = (props: Iprops) => {
// console.log(props);
const { children, title } = props;
const { children, title, status } = props;
const cardProps = {
title: title || '标题',
headStyle: {
......@@ -79,6 +81,7 @@ const SimpleCommodityList: React.FC<Iprops> & { Item: typeof SimpleItem } = (pro
listStyle={listStyle}
itemStyle={itemStyle}
{...divProps}
visible={status}
>
{
children
......
......@@ -5,4 +5,8 @@
margin-right: -12px;
}
.hidden {
display: none;
}
......@@ -14,15 +14,18 @@ interface Iprops {
listStyle?: CSSProperties,
itemStyle?: CSSProperties,
tooltipTitle?: string,
visible?: boolean,
}
const Container: React.FC<Iprops> = (props: Iprops) => {
const { children, card = true, cardProps = {}, listStyle = {}, itemStyle = {}, tooltipTitle } = props;
const { children, card = true, cardProps = {}, listStyle = {}, itemStyle = {}, tooltipTitle, visible = true } = props;
const { onClick, onDrag, onDragEnd, onDragEnter, onDragStart, onMouseOver, getOperateState, className, ...rest} = props as any;
const divProps = {
onClick, onDrag, onDragEnd, onDragEnter, onDragStart, onMouseOver
};
const wrapClass = cs(className, styles.wrap);
const wrapClass = cs(className, styles.wrap, {
[styles.hidden]: !visible
});
return (
<div className={wrapClass} {...divProps}>
......
......@@ -6,16 +6,21 @@ import styles from './index.less';
import CustomizeCard from '../Card';
interface Iprops {
children: React.ReactElement
children: React.ReactElement,
/** 控制显示隐藏 */
status: boolean,
}
const SecondaryNavigation: React.FC<Iprops> & { Item: typeof Item } = (props: Iprops) => {
const { children } = props;
const { children, status } = props;
const { onClick, onDrag, onDragEnd, onDragEnter, onDragStart, onMouseOver, getOperateState, className, ...rest} = props as any;
const divProps = {
onClick, onDrag, onDragEnd, onDragEnter, onDragStart, onMouseOver
};
const wrapClass = cs(className, styles.wrap);
const wrapClass = cs(className, styles.wrap, {
[styles.hidden]: !status
});
return (
<div className={wrapClass} {...divProps}>
......
......@@ -101,12 +101,14 @@ const CategoryNavigation = () => {
};
const tabItemData = {};
const tabItemChild = pageConfig[_nodeKey].childNodes;
tabItemChild.forEach(element => {
tabItemChild.forEach((element, _index) => {
const { otherProps: { type }, props, childNodes } = pageConfig[element];
const rest = type === 'suggestProduct' ? { type: props.type || 1, num: props.num || 50 } : {};
tabItemData[type] = {
title: props?.title || TITLE_MAP[type],
status: props?.status ?? true,
sort: _index + 1,
...rest,
children: childNodes.map((_son) => {
const sonData = pageConfig[_son];
......
......@@ -103,6 +103,8 @@ const BasicInfoLayout: React.FC<BasicInfoLayoutProps> = (props: any) => {
useEffect(() => {
if (!isEmpty(memb)) {
getShopListFn(memb.memberId, memb.roleId);
console.log(memb)
setMember(memb)
}
}, [memb])
......
......@@ -10,6 +10,7 @@ import AddressSelect from '@/components/AddressSelect';
import style from './index.less';
import { isEmpty } from 'lodash';
import { getMemberManageUsersPage } from '@/services/MemberV2Api';
import { getManageCountryAreaGetTelCode } from '@/services/ManageV2Api';
const disabledDate = (current) => {
return current && current < moment().startOf('day');
......@@ -286,8 +287,4 @@ const TradeTermsLayout: React.FC<TradeTermsLayoutProps> = (props: any) => {
)
}
export default TradeTermsLayout;
function getManageCountryAreaGetTelCode(): { data: any; code: any; } | PromiseLike<{ data: any; code: any; }> {
throw new Error('Function not implemented.');
}
export default TradeTermsLayout
......@@ -9,7 +9,7 @@
margin-bottom: 12px;
display: block;
line-height: 28px;
margin-bottom: 8px;
// margin-bottom: 8px;
}
.hide {
......
......@@ -4,7 +4,7 @@ import { history } from 'umi';
import { ColumnType } from 'antd/lib/table/interface';
import EyePreview from '@/components/EyePreview';
import moment from 'moment'
import { Row, Col, Space, Button, Tag, Badge, Popconfirm, Typography } from 'antd';
import { Row, Col, Space, Button, Tag, Badge, Popconfirm, Typography, message, Modal } from 'antd';
import { PlusOutlined } from '@ant-design/icons';
import {
INQUIRY_EXTERNALSTATE_COLOR,
......@@ -14,6 +14,7 @@ import {
BUTTONAUTHORITY
} from '../../constants';
import { getPurchasePurchaseInquiryAddList, postPurchasePurchaseInquiryDelete, postPurchasePurchaseInquiryDeleteBatch, postPurchasePurchaseInquirySubmit, postPurchasePurchaseInquirySubmitBatch } from '@/services/PurchaseV2Api';
import { getTemplateWebMemberPurchaseWebFindCurrMemberPurchase } from '@/services/TemplateV2Api';
const { Text } = Typography;
const AddInquiry = () => {
const ref = useRef<any>({});
......@@ -112,6 +113,25 @@ const AddInquiry = () => {
}
}
const addFn = async () => {
await getTemplateWebMemberPurchaseWebFindCurrMemberPurchase().then(res => {
if (res.code !== 1000) {
message.error(res.message);
return
}
if (!res.data) {
Modal.warning({
title: '当前还未创建采购门户',
content: '请先创建采购门户!',
okText: '确定',
onOk: () => history.push('/memberCenter/procurementAbility/purchasDoor/purchasInfo'),
})
return
}
history.push('/memberCenter/procurementAbility/purchaseInquiry/add')
})
}
return (
<Table
selectedRow
......@@ -126,7 +146,7 @@ const AddInquiry = () => {
<Col span={24}>
<Space direction="horizontal" size={16}>
<Button
onClick={() => history.push('/memberCenter/procurementAbility/purchaseInquiry/add')}
onClick={() => addFn()}
type="primary"
icon={<PlusOutlined />}
>
......
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