Commit 205d6152 authored by TZW's avatar TZW

12091834

parent 12367ac7
import React, { useState, useEffect } from 'react'; import React, { useState, useEffect } from 'react';
import { ProDescriptions } from '@ant-design/pro-components'; import { ProDescriptions } from '@ant-design/pro-components';
import { Divider } from 'antd';
import { doFetch } from '@/utils/doFetch';
export default (props) => { export default (props) => {
const { detailpath, params } = props;
const request = async () => {
const res = await doFetch({ url: detailpath, params });
console.log(res);
return {
success: true,
data: { id: '这是一段文本', date: '20200730', money: '12121' },
};
};
return ( return (
<> <>
<div> <div>
<h3>单号</h3> <h3>单号</h3>
</div> </div>
<ProDescriptions /> <ProDescriptions request={request} />
<Divider />
</> </>
); );
}; };
...@@ -8,6 +8,25 @@ function getcolumns(setdrawer) { ...@@ -8,6 +8,25 @@ function getcolumns(setdrawer) {
title: '报修单号', title: '报修单号',
dataIndex: 'repairNo', dataIndex: 'repairNo',
key: 'repairNo', key: 'repairNo',
render: (text, row, _, action) => {
return (
<a
onClick={() => {
setdrawer((s) => ({
...s,
open: true,
title: '详情',
val: 'only',
type: 'detail',
title: '详细信息',
item: row,
}));
}}
>
{row?.repairNo}
</a>
);
},
}, },
{ {
title: '设备编号', title: '设备编号',
......
...@@ -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-07 18:15:23 * @Last Modified time: 2022-12-09 17:54:42
*/ */
import * as React from 'react'; import * as React from 'react';
...@@ -14,6 +14,7 @@ import getcolumns from './columns'; ...@@ -14,6 +14,7 @@ import getcolumns from './columns';
import { useRequest } from 'ahooks'; import { useRequest } from 'ahooks';
import { doFetch } from '@/utils/doFetch'; import { doFetch } from '@/utils/doFetch';
import Addform from '@/components/Addform'; import Addform from '@/components/Addform';
import Detail from '@/components/RepaireDetail/Detail';
function Failure(props) { function Failure(props) {
const actionRef = useRef(), const actionRef = useRef(),
...@@ -36,29 +37,6 @@ function Failure(props) { ...@@ -36,29 +37,6 @@ function Failure(props) {
}, },
}); });
const detail = (text, row, _, action) => {
return (
<PremButton
btn={{
size: 'small',
type: 'link',
onClick: () => {
setdrawer((s) => ({
...s,
open: true,
item: row,
title: '详情',
val: 'detail',
title: '详细信息',
}));
},
}}
>
详情
</PremButton>
);
};
const edit = (text, row, _, action) => { const edit = (text, row, _, action) => {
return ( return (
<PremButton <PremButton
...@@ -123,7 +101,6 @@ function Failure(props) { ...@@ -123,7 +101,6 @@ function Failure(props) {
valueType: 'option', valueType: 'option',
width: 150, width: 150,
render: (text, row, _, action) => [ render: (text, row, _, action) => [
defpath?.enabledetail && detail(text, row, _, action),
defpath?.enableedit && edit(text, row, _, action), defpath?.enableedit && edit(text, row, _, action),
defpath?.enabledelete && remove(text, row, _, action), defpath?.enabledelete && remove(text, row, _, action),
], ],
...@@ -141,6 +118,10 @@ function Failure(props) { ...@@ -141,6 +118,10 @@ function Failure(props) {
return ( return (
<Addform url="/repair/umFailureRepair/save" actionRef={actionRef} setdrawer={setdrawer} /> <Addform url="/repair/umFailureRepair/save" actionRef={actionRef} setdrawer={setdrawer} />
); );
case 'detail':
return (
<Detail detailpath="/repair/umFailureRepair/queryById" params={{ id: drawer?.item.id }} />
);
default: default:
break; break;
} }
......
...@@ -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-09 14:23:40 * @Last Modified time: 2022-12-09 17:39:38
*/ */
import * as React from 'react'; import * as React from 'react';
...@@ -10,12 +10,12 @@ import { useState, useMemo, useRef } from 'react'; ...@@ -10,12 +10,12 @@ import { useState, useMemo, useRef } from 'react';
import DrawerPro from '@/components/DrawerPro'; import DrawerPro from '@/components/DrawerPro';
import AutoTable from '@/components/AutoTable'; import AutoTable from '@/components/AutoTable';
import PremButton from '@/components/PremButton'; import PremButton from '@/components/PremButton';
import getcolumns from './columns';
import { useRequest } from 'ahooks'; import { useRequest } from 'ahooks';
import { doFetch } from '@/utils/doFetch'; import { doFetch } from '@/utils/doFetch';
import { Dropdown, Menu, Button, message } from 'antd'; import { Dropdown, Menu, Button, message } from 'antd';
import InitForm from '@/components/InitForm'; import InitForm from '@/components/InitForm';
import OrderHandle from '../platform/RepairOrderHandle'; import OrderHandle from '../platform/RepairOrderHandle';
import getcolumns from './columns';
function Failure(props) { function Failure(props) {
const actionRef = useRef(), const actionRef = useRef(),
......
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