Commit cdbaedf8 authored by TZW's avatar TZW

11111

parent acd13dfd
...@@ -4,8 +4,16 @@ import { useModel } from '@umijs/max'; ...@@ -4,8 +4,16 @@ import { useModel } from '@umijs/max';
function PremButton(props) { function PremButton(props) {
const { initialState, setInitialState } = useModel('@@initialState'); const { initialState, setInitialState } = useModel('@@initialState');
console.log(initialState.newMenu);
let buttonPerm = initialState.newMenu.buttonPerm;
const { children, btn, pop, access } = props; const { children, btn, pop, access } = props;
let accesses = access ? ['havePrem'].includes(access) : true; console.log(access);
let res =
buttonPerm && buttonPerm.length > 0
? buttonPerm.filter((it) => it.typeName == access && it.show == 1)
: [];
console.log(res);
let accesses = access ? res.map((it) => it.typeName).includes(access) : true;
//配置按钮权限接口 //配置按钮权限接口
return pop ? ( return pop ? (
......
...@@ -31,7 +31,6 @@ const loginOut = async () => { ...@@ -31,7 +31,6 @@ const loginOut = async () => {
const AvatarDropdown = ({ menu }) => { const AvatarDropdown = ({ menu }) => {
const { initialState, setInitialState } = useModel('@@initialState'); const { initialState, setInitialState } = useModel('@@initialState');
console.log('initialState,', initialState);
const [visible, cv] = useState(false), const [visible, cv] = useState(false),
[formRef] = Form.useForm(), [formRef] = Form.useForm(),
{ run, loading } = useRequest(doFetch, { { run, loading } = useRequest(doFetch, {
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
* @Author: Li Hanlin * @Author: Li Hanlin
* @Date: 2022-12-02 11:41:03 * @Date: 2022-12-02 11:41:03
* @Last Modified by: Li Hanlin * @Last Modified by: Li Hanlin
* @Last Modified time: 2022-12-30 17:32:29 * @Last Modified time: 2023-01-04 17:41:56
*/ */
import * as React from 'react'; import * as React from 'react';
...@@ -38,14 +38,7 @@ function Failure(props) { ...@@ -38,14 +38,7 @@ function Failure(props) {
} }
}, },
}); });
const perData = useRequest(async () => {
let res = await doFetch({
url: '/auth/sysPermission/queryButton',
params: { parentId: '400300' },
});
return res?.data?.dataList;
});
console.log(perData.data);
const detail = (text, row, _, action) => { const detail = (text, row, _, action) => {
return ( return (
<PremButton <PremButton
...@@ -113,15 +106,15 @@ function Failure(props) { ...@@ -113,15 +106,15 @@ function Failure(props) {
// 更多 // 更多
const More = (text, row, _, action) => { const More = (text, row, _, action) => {
console.log(perData.data);
const menu = ( const menu = (
<Menu <Menu
items={[ items={[
{ {
label: ( label: (
<a <PremButton
onClick={() => { access="umRepairOrder_dispatchById"
btn={{
onClick: () => {
setdrawer((s) => ({ setdrawer((s) => ({
...s, ...s,
open: true, open: true,
...@@ -130,17 +123,20 @@ function Failure(props) { ...@@ -130,17 +123,20 @@ function Failure(props) {
val: 'only', val: 'only',
title: row?.status == 8 ? '派单' : '接单', title: row?.status == 8 ? '派单' : '接单',
})); }));
},
}} }}
> >
{row?.status == 8 ? '派单' : '接单'} {row?.status == 8 ? '派单' : '接单'}
</a> </PremButton>
), ),
key: '0', key: '0',
}, },
{ {
label: ( label: (
<a <PremButton
onClick={() => { access="umRepairOrder_completeRepair"
btn={{
onClick: () => {
setdrawer((s) => ({ setdrawer((s) => ({
...s, ...s,
open: true, open: true,
...@@ -149,16 +145,18 @@ function Failure(props) { ...@@ -149,16 +145,18 @@ function Failure(props) {
val: 'only', val: 'only',
title: '完成维修', title: '完成维修',
})); }));
},
}} }}
> >
完成维修 完成维修
</a> </PremButton>
), ),
key: '1', key: '1',
}, },
{ {
label: ( label: (
<a <PremButton
access="umRepairOrder_transferTracking"
onClick={() => { onClick={() => {
setdrawer((s) => ({ setdrawer((s) => ({
...s, ...s,
...@@ -171,14 +169,16 @@ function Failure(props) { ...@@ -171,14 +169,16 @@ function Failure(props) {
}} }}
> >
转追踪 转追踪
</a> </PremButton>
), ),
key: '2', key: '2',
}, },
{ {
label: ( label: (
<a <PremButton
onClick={() => { access="umRepairOrder_transferOutsourcing"
btn={{
onClick: () => {
setdrawer((s) => ({ setdrawer((s) => ({
...s, ...s,
open: true, open: true,
...@@ -187,17 +187,20 @@ function Failure(props) { ...@@ -187,17 +187,20 @@ function Failure(props) {
val: 'only', val: 'only',
title: '转外协', title: '转外协',
})); }));
},
}} }}
> >
转外协 转外协
</a> </PremButton>
), ),
key: '3', key: '3',
}, },
{ {
label: ( label: (
<a <PremButton
onClick={() => { access="umRepairOrder_documentTransfer"
btn={{
onClick: () => {
setdrawer((s) => ({ setdrawer((s) => ({
...s, ...s,
open: true, open: true,
...@@ -206,17 +209,20 @@ function Failure(props) { ...@@ -206,17 +209,20 @@ function Failure(props) {
val: 'only', val: 'only',
title: '转单', title: '转单',
})); }));
},
}} }}
> >
转单 转单
</a> </PremButton>
), ),
key: '4', key: '4',
}, },
{ {
label: ( label: (
<a <PremButton
onClick={() => { access="umRepairOrder_chargeback"
btn={{
onClick: () => {
setdrawer((s) => ({ setdrawer((s) => ({
...s, ...s,
open: true, open: true,
...@@ -225,17 +231,20 @@ function Failure(props) { ...@@ -225,17 +231,20 @@ function Failure(props) {
val: 'only', val: 'only',
title: '退单', title: '退单',
})); }));
},
}} }}
> >
退单 退单
</a> </PremButton>
), ),
key: '5', key: '5',
}, },
{ {
label: ( label: (
<a <PremButton
onClick={() => { access="umRepairOrder_completeRepairValidate"
btn={{
onClick: () => {
setdrawer((s) => ({ setdrawer((s) => ({
...s, ...s,
open: true, open: true,
...@@ -244,17 +253,20 @@ function Failure(props) { ...@@ -244,17 +253,20 @@ function Failure(props) {
val: 'only', val: 'only',
title: '效果验证', title: '效果验证',
})); }));
},
}} }}
> >
效果验证 效果验证
</a> </PremButton>
), ),
key: '6', key: '6',
}, },
{ {
label: ( label: (
<a <PremButton
onClick={() => { access="umRepairOrder_transferTrackingAudit"
btn={{
onClick: () => {
setdrawer((s) => ({ setdrawer((s) => ({
...s, ...s,
open: true, open: true,
...@@ -263,17 +275,20 @@ function Failure(props) { ...@@ -263,17 +275,20 @@ function Failure(props) {
val: 'only', val: 'only',
title: '追踪审核', title: '追踪审核',
})); }));
},
}} }}
> >
追踪审核 追踪审核
</a> </PremButton>
), ),
key: '7', key: '7',
}, },
{ {
label: ( label: (
<a <PremButton
onClick={() => { access="umRepairOrder_transferAudit"
btn={{
onClick: () => {
setdrawer((s) => ({ setdrawer((s) => ({
...s, ...s,
open: true, open: true,
...@@ -282,17 +297,20 @@ function Failure(props) { ...@@ -282,17 +297,20 @@ function Failure(props) {
val: 'only', val: 'only',
title: '外协审核', title: '外协审核',
})); }));
},
}} }}
> >
外协审核 外协审核
</a> </PremButton>
), ),
key: '8', key: '8',
}, },
{ {
label: ( label: (
<a <PremButton
onClick={() => { access="umRepairOrder_chargebackAudit"
btn={{
onClick: () => {
setdrawer((s) => ({ setdrawer((s) => ({
...s, ...s,
open: true, open: true,
...@@ -301,10 +319,11 @@ function Failure(props) { ...@@ -301,10 +319,11 @@ function Failure(props) {
val: 'only', val: 'only',
title: '退单审核', title: '退单审核',
})); }));
},
}} }}
> >
退单审核 退单审核
</a> </PremButton>
), ),
key: '9', key: '9',
}, },
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
* @Author: Li Hanlin * @Author: Li Hanlin
* @Date: 2022-12-02 11:41:03 * @Date: 2022-12-02 11:41:03
* @Last Modified by: Li Hanlin * @Last Modified by: Li Hanlin
* @Last Modified time: 2023-01-04 10:31:19 * @Last Modified time: 2023-01-04 17:46:11
*/ */
import * as React from 'react'; import * as React from 'react';
...@@ -251,8 +251,9 @@ function Failure(props) { ...@@ -251,8 +251,9 @@ function Failure(props) {
{ {
label: label:
row?.status == 0 || row?.status == 1 ? ( row?.status == 0 || row?.status == 1 ? (
<a <PremButton
onClick={async () => { btn={{
onClick: async () => {
let params = { let params = {
id: row?.id, id: row?.id,
}; };
...@@ -268,13 +269,15 @@ function Failure(props) { ...@@ -268,13 +269,15 @@ function Failure(props) {
})); }));
actionRef.current.reload(); actionRef.current.reload();
} }
},
}} }}
> >
接单 接单
</a> </PremButton>
) : ( ) : (
<a <PremButton
onClick={async () => { btn={{
onClick: async () => {
setdrawer((s) => ({ setdrawer((s) => ({
...s, ...s,
open: true, open: true,
...@@ -283,18 +286,20 @@ function Failure(props) { ...@@ -283,18 +286,20 @@ function Failure(props) {
val: 'only', val: 'only',
title: '派单', title: '派单',
})); }));
},
}} }}
> >
派单 派单
</a> </PremButton>
), ),
key: '0', key: '0',
// disabled: true, // disabled: true,
}, },
{ {
label: ( label: (
<a <PremButton
onClick={() => { btn={{
onClick: () => {
setdrawer((s) => ({ setdrawer((s) => ({
...s, ...s,
open: true, open: true,
...@@ -305,10 +310,11 @@ function Failure(props) { ...@@ -305,10 +310,11 @@ function Failure(props) {
val: 'only', val: 'only',
title: '完成外协', title: '完成外协',
})); }));
},
}} }}
> >
完成外协 完成外协
</a> </PremButton>
), ),
key: '1', key: '1',
}, },
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
* @Author: Li Hanlin * @Author: Li Hanlin
* @Date: 2022-12-02 11:41:03 * @Date: 2022-12-02 11:41:03
* @Last Modified by: Li Hanlin * @Last Modified by: Li Hanlin
* @Last Modified time: 2023-01-04 10:30:44 * @Last Modified time: 2023-01-04 16:25:39
*/ */
import * as React from 'react'; import * as React from 'react';
...@@ -322,7 +322,7 @@ function Failure(props) { ...@@ -322,7 +322,7 @@ function Failure(props) {
{ {
label: label:
row?.status == 0 || row?.status == 1 ? ( row?.status == 0 || row?.status == 1 ? (
<a <PremButton
onClick={async () => { onClick={async () => {
let params = { let params = {
id: row?.id, id: row?.id,
...@@ -342,9 +342,9 @@ function Failure(props) { ...@@ -342,9 +342,9 @@ function Failure(props) {
}} }}
> >
接单 接单
</a> </PremButton>
) : ( ) : (
<a <PremButton
onClick={async () => { onClick={async () => {
let params = { let params = {
id: row?.id, id: row?.id,
...@@ -364,14 +364,14 @@ function Failure(props) { ...@@ -364,14 +364,14 @@ function Failure(props) {
}} }}
> >
派单 派单
</a> </PremButton>
), ),
key: '0', key: '0',
// disabled: true, // disabled: true,
}, },
{ {
label: ( label: (
<a <PremButton
onClick={() => { onClick={() => {
setdrawer((s) => ({ setdrawer((s) => ({
...s, ...s,
...@@ -386,13 +386,13 @@ function Failure(props) { ...@@ -386,13 +386,13 @@ function Failure(props) {
}} }}
> >
追踪 追踪
</a> </PremButton>
), ),
key: '1', key: '1',
}, },
{ {
label: ( label: (
<a <PremButton
onClick={() => { onClick={() => {
setdrawer((s) => ({ setdrawer((s) => ({
...s, ...s,
...@@ -407,7 +407,7 @@ function Failure(props) { ...@@ -407,7 +407,7 @@ function Failure(props) {
}} }}
> >
验证 验证
</a> </PremButton>
), ),
key: '2', key: '2',
}, },
......
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