Commit cdbaedf8 authored by TZW's avatar TZW

11111

parent acd13dfd
......@@ -4,8 +4,16 @@ import { useModel } from '@umijs/max';
function PremButton(props) {
const { initialState, setInitialState } = useModel('@@initialState');
console.log(initialState.newMenu);
let buttonPerm = initialState.newMenu.buttonPerm;
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 ? (
......
......@@ -31,7 +31,6 @@ const loginOut = async () => {
const AvatarDropdown = ({ menu }) => {
const { initialState, setInitialState } = useModel('@@initialState');
console.log('initialState,', initialState);
const [visible, cv] = useState(false),
[formRef] = Form.useForm(),
{ run, loading } = useRequest(doFetch, {
......
......@@ -2,7 +2,7 @@
* @Author: Li Hanlin
* @Date: 2022-12-02 11:41:03
* @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';
......@@ -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) => {
return (
<PremButton
......@@ -113,15 +106,15 @@ function Failure(props) {
// 更多
const More = (text, row, _, action) => {
console.log(perData.data);
const menu = (
<Menu
items={[
{
label: (
<a
onClick={() => {
<PremButton
access="umRepairOrder_dispatchById"
btn={{
onClick: () => {
setdrawer((s) => ({
...s,
open: true,
......@@ -130,17 +123,20 @@ function Failure(props) {
val: 'only',
title: row?.status == 8 ? '派单' : '接单',
}));
},
}}
>
{row?.status == 8 ? '派单' : '接单'}
</a>
</PremButton>
),
key: '0',
},
{
label: (
<a
onClick={() => {
<PremButton
access="umRepairOrder_completeRepair"
btn={{
onClick: () => {
setdrawer((s) => ({
...s,
open: true,
......@@ -149,16 +145,18 @@ function Failure(props) {
val: 'only',
title: '完成维修',
}));
},
}}
>
完成维修
</a>
</PremButton>
),
key: '1',
},
{
label: (
<a
<PremButton
access="umRepairOrder_transferTracking"
onClick={() => {
setdrawer((s) => ({
...s,
......@@ -171,14 +169,16 @@ function Failure(props) {
}}
>
转追踪
</a>
</PremButton>
),
key: '2',
},
{
label: (
<a
onClick={() => {
<PremButton
access="umRepairOrder_transferOutsourcing"
btn={{
onClick: () => {
setdrawer((s) => ({
...s,
open: true,
......@@ -187,17 +187,20 @@ function Failure(props) {
val: 'only',
title: '转外协',
}));
},
}}
>
转外协
</a>
</PremButton>
),
key: '3',
},
{
label: (
<a
onClick={() => {
<PremButton
access="umRepairOrder_documentTransfer"
btn={{
onClick: () => {
setdrawer((s) => ({
...s,
open: true,
......@@ -206,17 +209,20 @@ function Failure(props) {
val: 'only',
title: '转单',
}));
},
}}
>
转单
</a>
</PremButton>
),
key: '4',
},
{
label: (
<a
onClick={() => {
<PremButton
access="umRepairOrder_chargeback"
btn={{
onClick: () => {
setdrawer((s) => ({
...s,
open: true,
......@@ -225,17 +231,20 @@ function Failure(props) {
val: 'only',
title: '退单',
}));
},
}}
>
退单
</a>
</PremButton>
),
key: '5',
},
{
label: (
<a
onClick={() => {
<PremButton
access="umRepairOrder_completeRepairValidate"
btn={{
onClick: () => {
setdrawer((s) => ({
...s,
open: true,
......@@ -244,17 +253,20 @@ function Failure(props) {
val: 'only',
title: '效果验证',
}));
},
}}
>
效果验证
</a>
</PremButton>
),
key: '6',
},
{
label: (
<a
onClick={() => {
<PremButton
access="umRepairOrder_transferTrackingAudit"
btn={{
onClick: () => {
setdrawer((s) => ({
...s,
open: true,
......@@ -263,17 +275,20 @@ function Failure(props) {
val: 'only',
title: '追踪审核',
}));
},
}}
>
追踪审核
</a>
</PremButton>
),
key: '7',
},
{
label: (
<a
onClick={() => {
<PremButton
access="umRepairOrder_transferAudit"
btn={{
onClick: () => {
setdrawer((s) => ({
...s,
open: true,
......@@ -282,17 +297,20 @@ function Failure(props) {
val: 'only',
title: '外协审核',
}));
},
}}
>
外协审核
</a>
</PremButton>
),
key: '8',
},
{
label: (
<a
onClick={() => {
<PremButton
access="umRepairOrder_chargebackAudit"
btn={{
onClick: () => {
setdrawer((s) => ({
...s,
open: true,
......@@ -301,10 +319,11 @@ function Failure(props) {
val: 'only',
title: '退单审核',
}));
},
}}
>
退单审核
</a>
</PremButton>
),
key: '9',
},
......
......@@ -2,7 +2,7 @@
* @Author: Li Hanlin
* @Date: 2022-12-02 11:41:03
* @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';
......@@ -251,8 +251,9 @@ function Failure(props) {
{
label:
row?.status == 0 || row?.status == 1 ? (
<a
onClick={async () => {
<PremButton
btn={{
onClick: async () => {
let params = {
id: row?.id,
};
......@@ -268,13 +269,15 @@ function Failure(props) {
}));
actionRef.current.reload();
}
},
}}
>
接单
</a>
</PremButton>
) : (
<a
onClick={async () => {
<PremButton
btn={{
onClick: async () => {
setdrawer((s) => ({
...s,
open: true,
......@@ -283,18 +286,20 @@ function Failure(props) {
val: 'only',
title: '派单',
}));
},
}}
>
派单
</a>
</PremButton>
),
key: '0',
// disabled: true,
},
{
label: (
<a
onClick={() => {
<PremButton
btn={{
onClick: () => {
setdrawer((s) => ({
...s,
open: true,
......@@ -305,10 +310,11 @@ function Failure(props) {
val: 'only',
title: '完成外协',
}));
},
}}
>
完成外协
</a>
</PremButton>
),
key: '1',
},
......
......@@ -2,7 +2,7 @@
* @Author: Li Hanlin
* @Date: 2022-12-02 11:41:03
* @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';
......@@ -322,7 +322,7 @@ function Failure(props) {
{
label:
row?.status == 0 || row?.status == 1 ? (
<a
<PremButton
onClick={async () => {
let params = {
id: row?.id,
......@@ -342,9 +342,9 @@ function Failure(props) {
}}
>
接单
</a>
</PremButton>
) : (
<a
<PremButton
onClick={async () => {
let params = {
id: row?.id,
......@@ -364,14 +364,14 @@ function Failure(props) {
}}
>
派单
</a>
</PremButton>
),
key: '0',
// disabled: true,
},
{
label: (
<a
<PremButton
onClick={() => {
setdrawer((s) => ({
...s,
......@@ -386,13 +386,13 @@ function Failure(props) {
}}
>
追踪
</a>
</PremButton>
),
key: '1',
},
{
label: (
<a
<PremButton
onClick={() => {
setdrawer((s) => ({
...s,
......@@ -407,7 +407,7 @@ function Failure(props) {
}}
>
验证
</a>
</PremButton>
),
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