Commit 9d62b917 authored by 前端-许佳敏's avatar 前端-许佳敏
parents 222b8962 accea56d
// 这里是处理比较特殊的url 跳转的 // 这里是处理比较特殊的url 跳转的
import userBtn from "../../../config/router.config.json"
export const AuthUrl = (btnCode: string, menuCode: string) => { export const AuthUrl = (btnCode: string, menuCode: string) => {
const userBtn = require('../../../config/router.config.json') // const userBtn = require('../../../config/router.config.json')
const AuthRoutes = userBtn.find((item: any) => item?.relationParentCode === menuCode); const AuthRoutes = userBtn.find((item: any) => item?.relationParentCode === menuCode);
let AuthCode: any = []; let AuthCode: any = [];
if (AuthRoutes) { if (AuthRoutes) {
......
...@@ -9,13 +9,15 @@ export interface AuthButtonProps { ...@@ -9,13 +9,15 @@ export interface AuthButtonProps {
* @param {String} menuCode 页面标识 * @param {String} menuCode 页面标识
* @param {String} btnCode 按钮标识 * @param {String} btnCode 按钮标识
*/ */
import userBtn from "../../../config/router.config.json"
const AuthButton = (props: AuthButtonProps) => { const AuthButton = (props: AuthButtonProps) => {
const { const {
children, children,
btnCode, // 按钮标识 btnCode, // 按钮标识
menuCode, // 按钮页面标识 menuCode, // 按钮页面标识
} = props } = props
const userBtn = require('../../../config/router.config.json') // const userBtn = require('../../../config/router.config.json')
const AuthRoutes = userBtn.find((item: any) => item?.relationParentCode === menuCode); const AuthRoutes = userBtn.find((item: any) => item?.relationParentCode === menuCode);
let AuthCode: any = []; let AuthCode: any = [];
if (AuthRoutes) { if (AuthRoutes) {
......
btnCode 是pass 平台配置唯一表示 btnCode 是pass 平台配置唯一表示
...@@ -74,6 +74,23 @@ repositories.batchedit:仓位批量修改按钮 ...@@ -74,6 +74,23 @@ repositories.batchedit:仓位批量修改按钮
repositories.edit:仓位库存调拨按钮 repositories.edit:仓位库存调拨按钮
营销能力-marketingAbility
营销能力-商家优惠劵管理
merchantCouponUnsubmitted.batchSubmit 待提交审核商家优惠劵-批量提交 待提交审核商家优惠劵-批量提交-按钮 删除
merchantCouponUnsubmitted.batchdel 待提交审核商家优惠劵-批量删除 待提交审核商家优惠劵-批量删除-按钮 删除
merchantCouponUnsubmitted.add 待提交审核商家优惠劵-新曾 待提交审核商家优惠劵-新曾-按钮 删除
merchantCouponUnsubmitted.del 待提交审核商家优惠劵-删除 待提交审核商家优惠劵-删除-按钮 删除
merchantCouponUnsubmitted.edit 待提交审核商家优惠劵-修改 待提交审核商家优惠劵-修改-按钮 删除
merchantCouponUnsubmitted.Submit 待提交审核商家优惠劵-提交 待提交审核商家优惠劵-提交-按钮 删除
待审核商家优惠劵(一级)-批量
merchantCouponNotVerify1.examine 待审核商家优惠劵(一级)-提交 待审核商家优惠劵(一级)-提交-按钮
merchantCouponNotVerify1.batch 待审核商家优惠劵(二级)-批量 待审核商家优惠劵(二级)-批量
待审核商家优惠劵(二级)-批量
merchantCouponNotVerify2.examine 待审核商家优惠劵(二级)-提交 待审核商家优惠劵(二级)-提交-按钮
merchantCouponNotVerify2.batch 待审核商家优惠劵(二级)-批量 待审核商家优惠劵(二级)-批量
toConfirm.Submit 待提交商家优惠劵提交 待提交商家优惠劵提交按钮
// 内容管理-contentAbility // 内容管理-contentAbility
// 内容管理-栏目管理 // 内容管理-栏目管理
......
...@@ -60,7 +60,6 @@ const CheckBrand: React.FC<{}> = () => { ...@@ -60,7 +60,6 @@ const CheckBrand: React.FC<{}> = () => {
}) })
}) })
} }
const columns: ColumnType<any>[] = [ const columns: ColumnType<any>[] = [
{ {
title: 'ID', title: 'ID',
......
...@@ -11,7 +11,6 @@ import moment from 'moment'; ...@@ -11,7 +11,6 @@ import moment from 'moment';
import EyePreview from '@/components/EyePreview'; import EyePreview from '@/components/EyePreview';
import { getIntl } from 'umi' import { getIntl } from 'umi'
import { AuthUrl } from '@/components/AuthButton/AuthUrl'
/** /**
* *
* @param target string 会员详情路径前缀 * @param target string 会员详情路径前缀
...@@ -30,7 +29,6 @@ const columns = (target = '/memberCenter/marketingAbility/merchantCoupon/unsubmi ...@@ -30,7 +29,6 @@ const columns = (target = '/memberCenter/marketingAbility/merchantCoupon/unsubmi
align: 'center', align: 'center',
render: (text, record) => ( render: (text, record) => (
<EyePreview <EyePreview
type={AuthUrl('deliver.see', 'marketingAbility') ? 'link' : 'button'}
url={`${target}?id=${record.id}`} url={`${target}?id=${record.id}`}
> >
{text} {text}
......
...@@ -24,6 +24,8 @@ import BacisInfo from '../../components/BacisInfo'; ...@@ -24,6 +24,8 @@ import BacisInfo from '../../components/BacisInfo';
import CouponRules from '../../components/CouponRules'; import CouponRules from '../../components/CouponRules';
import DeliverCoupon, { ChangeValueItem } from '../../components/DeliverCoupon'; import DeliverCoupon, { ChangeValueItem } from '../../components/DeliverCoupon';
import { useIntl} from 'umi' import { useIntl} from 'umi'
import AuthButton from '@/components/AuthButton'
import { AuthUrl } from '@/components/AuthButton/AuthUrl'
const MerchantCouponAnalysisDeliver: React.FC<{}> = () => { const MerchantCouponAnalysisDeliver: React.FC<{}> = () => {
const intl = useIntl(); const intl = useIntl();
......
...@@ -28,7 +28,8 @@ import useSpliceArray from '@/hooks/useSpliceArray'; ...@@ -28,7 +28,8 @@ import useSpliceArray from '@/hooks/useSpliceArray';
import verifySchema from '../common/schemas/verify'; import verifySchema from '../common/schemas/verify';
import commonColumn from '../common/columns/coupon'; import commonColumn from '../common/columns/coupon';
import { getMarketingCouponTypeList, getMarketingCouponWaitAuditOnePage, postMarketingCouponWaitAuditOneAuditBatch } from '@/services/MarketingV2Api'; import { getMarketingCouponTypeList, getMarketingCouponWaitAuditOnePage, postMarketingCouponWaitAuditOneAuditBatch } from '@/services/MarketingV2Api';
import { useIntl} from 'umi' import { useIntl } from 'umi'
import AuthButton from '@/components/AuthButton'
const { confirm } = Modal; const { confirm } = Modal;
...@@ -63,15 +64,18 @@ const MerchantCouponNotVerify1: React.FC = () => { ...@@ -63,15 +64,18 @@ const MerchantCouponNotVerify1: React.FC = () => {
const defaultColumns = commonColumn('/memberCenter/marketingAbility/merchantCoupon/notVerify1/detail').concat([ const defaultColumns = commonColumn('/memberCenter/marketingAbility/merchantCoupon/notVerify1/detail').concat([
{ {
title: `${intl.formatMessage({ id: 'merchantCoupon.operation'})}`, title: `${intl.formatMessage({ id: 'merchantCoupon.operation' })}`,
dataIndex: 'option', dataIndex: 'option',
align: 'center', align: 'center',
render: (_, record) => ( render: (_, record) => (
<> <>
<AuthButton btnCode='merchantCouponNotVerify1.examine' menuCode='marketingAbility'>
<Button <Button
type="link" type="link"
onClick={() => history.push(`/memberCenter/marketingAbility/merchantCoupon/notVerify1/verify?id=${record.id}`)} onClick={() => history.push(`/memberCenter/marketingAbility/merchantCoupon/notVerify1/verify?id=${record.id}`)}
>{ intl.formatMessage({ id: 'merchantCoupon.Review'}) }</Button> >{intl.formatMessage({ id: 'merchantCoupon.Review' })}</Button>
</AuthButton>
</> </>
), ),
}, },
...@@ -102,11 +106,11 @@ const MerchantCouponNotVerify1: React.FC = () => { ...@@ -102,11 +106,11 @@ const MerchantCouponNotVerify1: React.FC = () => {
const handleBatchVerify = () => { const handleBatchVerify = () => {
if (!selectedRowKeys.length) { if (!selectedRowKeys.length) {
message.warning(`${intl.formatMessage({ id: 'merchantCoupon.Nocouponsareselected'})}`); message.warning(`${intl.formatMessage({ id: 'merchantCoupon.Nocouponsareselected' })}`);
return; return;
} }
confirm({ confirm({
title: `${intl.formatMessage({ id: 'merchantCoupon.tip'})}`, title: `${intl.formatMessage({ id: 'merchantCoupon.tip' })}`,
icon: <QuestionCircleOutlined />, icon: <QuestionCircleOutlined />,
content: `${intl.formatMessage({ id: 'merchantCoupon.DeterminepassCoupon' })}`, content: `${intl.formatMessage({ id: 'merchantCoupon.DeterminepassCoupon' })}`,
onOk() { onOk() {
...@@ -132,9 +136,12 @@ const MerchantCouponNotVerify1: React.FC = () => { ...@@ -132,9 +136,12 @@ const MerchantCouponNotVerify1: React.FC = () => {
const ControllerBtns = () => ( const ControllerBtns = () => (
<Space size={16}> <Space size={16}>
<AuthButton btnCode='merchantCouponNotVerify1.batch' menuCode='marketingAbility'>
<Button <Button
onClick={handleBatchVerify} onClick={handleBatchVerify}
>{ intl.formatMessage({ id: 'merchantCoupon.Batchauditpassed'}) }</Button> >{intl.formatMessage({ id: 'merchantCoupon.Batchauditpassed' })}</Button>
</AuthButton>
</Space> </Space>
); );
......
...@@ -6,7 +6,7 @@ ...@@ -6,7 +6,7 @@
* @Description: 待审核商家优惠劵(二级) * @Description: 待审核商家优惠劵(二级)
*/ */
import React, { useState, useRef } from 'react'; import React, { useState, useRef } from 'react';
import { history,useIntl} from 'umi'; import { history, useIntl } from 'umi';
import { import {
Card, Card,
Space, Space,
...@@ -28,7 +28,7 @@ import useSpliceArray from '@/hooks/useSpliceArray'; ...@@ -28,7 +28,7 @@ import useSpliceArray from '@/hooks/useSpliceArray';
import verifySchema from '../common/schemas/verify'; import verifySchema from '../common/schemas/verify';
import commonColumn from '../common/columns/coupon'; import commonColumn from '../common/columns/coupon';
import { getMarketingCouponTypeList, getMarketingCouponWaitAuditTwoPage, postMarketingCouponWaitAuditTwoAuditBatch } from '@/services/MarketingV2Api'; import { getMarketingCouponTypeList, getMarketingCouponWaitAuditTwoPage, postMarketingCouponWaitAuditTwoAuditBatch } from '@/services/MarketingV2Api';
import AuthButton from '@/components/AuthButton'
const { confirm } = Modal; const { confirm } = Modal;
const formActions = createFormActions(); const formActions = createFormActions();
...@@ -62,15 +62,18 @@ const MerchantCouponNotVerify1: React.FC = () => { ...@@ -62,15 +62,18 @@ const MerchantCouponNotVerify1: React.FC = () => {
const defaultColumns = commonColumn('/memberCenter/marketingAbility/merchantCoupon/notVerify2/detail').concat([ const defaultColumns = commonColumn('/memberCenter/marketingAbility/merchantCoupon/notVerify2/detail').concat([
{ {
title: `${intl.formatMessage({ id: 'merchantCoupon.operation'})}`, title: `${intl.formatMessage({ id: 'merchantCoupon.operation' })}`,
dataIndex: 'option', dataIndex: 'option',
align: 'center', align: 'center',
render: (_, record) => ( render: (_, record) => (
<> <>
<AuthButton btnCode='merchantCouponNotVerify2.examine' menuCode='marketingAbility'>
<Button <Button
type="link" type="link"
onClick={() => history.push(`/memberCenter/marketingAbility/merchantCoupon/notVerify2/verify?id=${record.id}`)} onClick={() => history.push(`/memberCenter/marketingAbility/merchantCoupon/notVerify2/verify?id=${record.id}`)}
>{ intl.formatMessage({ id: 'merchantCoupon.Review'}) }</Button> >{intl.formatMessage({ id: 'merchantCoupon.Review' })}</Button>
</AuthButton>
</> </>
), ),
}, },
...@@ -101,11 +104,11 @@ const MerchantCouponNotVerify1: React.FC = () => { ...@@ -101,11 +104,11 @@ const MerchantCouponNotVerify1: React.FC = () => {
const handleBatchVerify = () => { const handleBatchVerify = () => {
if (!selectedRowKeys.length) { if (!selectedRowKeys.length) {
message.warning(`${intl.formatMessage({ id: 'merchantCoupon.Nocouponsareselected'})}`); message.warning(`${intl.formatMessage({ id: 'merchantCoupon.Nocouponsareselected' })}`);
return; return;
} }
confirm({ confirm({
title: `${intl.formatMessage({ id: 'merchantCoupon.tip'})}`, title: `${intl.formatMessage({ id: 'merchantCoupon.tip' })}`,
icon: <QuestionCircleOutlined />, icon: <QuestionCircleOutlined />,
content: intl.formatMessage({ id: 'merchantCoupon.DeterminepassCoupon' }), content: intl.formatMessage({ id: 'merchantCoupon.DeterminepassCoupon' }),
onOk() { onOk() {
...@@ -131,9 +134,12 @@ const MerchantCouponNotVerify1: React.FC = () => { ...@@ -131,9 +134,12 @@ const MerchantCouponNotVerify1: React.FC = () => {
const ControllerBtns = () => ( const ControllerBtns = () => (
<Space size={16}> <Space size={16}>
<AuthButton btnCode='merchantCouponNotVerify2.batch' menuCode='marketingAbility'>
<Button <Button
onClick={handleBatchVerify} onClick={handleBatchVerify}
>{ intl.formatMessage({ id: 'merchantCoupon.Batchauditpassed'}) }</Button> >{intl.formatMessage({ id: 'merchantCoupon.Batchauditpassed' })}</Button>
</AuthButton>
</Space> </Space>
); );
......
...@@ -28,7 +28,8 @@ import useSpliceArray from '@/hooks/useSpliceArray'; ...@@ -28,7 +28,8 @@ import useSpliceArray from '@/hooks/useSpliceArray';
import verifySchema from '../common/schemas/verify'; import verifySchema from '../common/schemas/verify';
import commonColumn from '../common/columns/coupon'; import commonColumn from '../common/columns/coupon';
import { getMarketingCouponTypeList, getMarketingCouponWaitSubmitPage, postMarketingCouponWaitSubmitSubmitBatch } from '@/services/MarketingV2Api'; import { getMarketingCouponTypeList, getMarketingCouponWaitSubmitPage, postMarketingCouponWaitSubmitSubmitBatch } from '@/services/MarketingV2Api';
import { useIntl} from 'umi' import { useIntl } from 'umi'
import AuthButton from '@/components/AuthButton'
const { confirm } = Modal; const { confirm } = Modal;
...@@ -63,15 +64,18 @@ const MerchantCouponToConfirm: React.FC = () => { ...@@ -63,15 +64,18 @@ const MerchantCouponToConfirm: React.FC = () => {
const defaultColumns = commonColumn('/memberCenter/marketingAbility/merchantCoupon/toConfirm/detail').concat([ const defaultColumns = commonColumn('/memberCenter/marketingAbility/merchantCoupon/toConfirm/detail').concat([
{ {
title: `${intl.formatMessage({ id: 'merchantCoupon.operation'})}`, title: `${intl.formatMessage({ id: 'merchantCoupon.operation' })}`,
dataIndex: 'option', dataIndex: 'option',
align: 'center', align: 'center',
render: (_, record) => ( render: (_, record) => (
<> <>
<AuthButton btnCode="toConfirm.Submit" menuCode='marketingAbility'>
<Button <Button
type="link" type="link"
onClick={() => history.push(`/memberCenter/marketingAbility/merchantCoupon/toConfirm/verify?id=${record.id}`)} onClick={() => history.push(`/memberCenter/marketingAbility/merchantCoupon/toConfirm/verify?id=${record.id}`)}
>{ intl.formatMessage({ id: 'merchantCoupon.submit'}) }</Button> >{intl.formatMessage({ id: 'merchantCoupon.submit' })}</Button>
</AuthButton>
</> </>
), ),
}, },
...@@ -102,11 +106,11 @@ const MerchantCouponToConfirm: React.FC = () => { ...@@ -102,11 +106,11 @@ const MerchantCouponToConfirm: React.FC = () => {
const handleBatchVerify = () => { const handleBatchVerify = () => {
if (!selectedRowKeys.length) { if (!selectedRowKeys.length) {
message.warning(`${intl.formatMessage({ id: 'merchantCoupon.Nocouponsareselected'})}`); message.warning(`${intl.formatMessage({ id: 'merchantCoupon.Nocouponsareselected' })}`);
return; return;
} }
confirm({ confirm({
title: `${intl.formatMessage({ id: 'merchantCoupon.tip'})}`, title: `${intl.formatMessage({ id: 'merchantCoupon.tip' })}`,
icon: <QuestionCircleOutlined />, icon: <QuestionCircleOutlined />,
content: intl.formatMessage({ id: 'merchantCoupon.DeterminepassCoupon' }), content: intl.formatMessage({ id: 'merchantCoupon.DeterminepassCoupon' }),
onOk() { onOk() {
...@@ -134,7 +138,7 @@ const MerchantCouponToConfirm: React.FC = () => { ...@@ -134,7 +138,7 @@ const MerchantCouponToConfirm: React.FC = () => {
<Space size={16}> <Space size={16}>
<Button <Button
onClick={handleBatchVerify} onClick={handleBatchVerify}
>{ intl.formatMessage({ id: 'merchantCoupon.Batchauditpassed'}) }</Button> >{intl.formatMessage({ id: 'merchantCoupon.Batchauditpassed' })}</Button>
</Space> </Space>
); );
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment