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