tsg-web/src/views/sz/szzf/clyj/content.js

68 lines
2.7 KiB
JavaScript
Raw Normal View History

2024-09-24 14:37:41 +08:00
import styles from './content.module.less'
import { Button } from 'antd'
import ModalForm from './form';
import BasicCrudModal from '../../../../components/crud/BasicCrudModal';
import React, { Fragment, useRef, useMemo, useEffect, useState } from 'react';
2024-09-26 17:59:26 +08:00
import { httpget } from '../../../../utils/request';
import apiurl from '../../../../service/apiurl';
const Page = ({ treeSelect }) => {
2024-09-24 14:37:41 +08:00
const refModal = useRef();
2024-09-26 17:59:26 +08:00
const [data,setData] = useState({})
2024-09-24 14:37:41 +08:00
/**
* @description 处理成功的回调
*/
const successCallback = () => {
2024-09-26 17:59:26 +08:00
getInfo()
2024-09-24 14:37:41 +08:00
// setIsFetch(!isFetch)
}
const dataPahe = {
title: '侵占、毁坏水工程及堤防、护岸等有关设施',
zhunag: '1'
}
const edit = () => {
2024-09-26 17:59:26 +08:00
refModal.current.showEdit({...data});
2024-09-24 14:37:41 +08:00
}
2024-09-26 17:59:26 +08:00
const getInfo=()=>{
httpget(apiurl.szzf.clyj.detail+treeSelect?.key).then(res=>{
setData({...res.data,name:treeSelect.name})
})
}
useEffect(()=>{
if(treeSelect){
getInfo()
}
},[treeSelect])
2024-09-24 14:37:41 +08:00
return (
<>
2024-09-26 17:59:26 +08:00
<div className={styles.list} style={{ padding: '0 10px', marginBottom: 5 }}>{treeSelect?.name}<Button type="primary" onClick={edit}>编辑</Button></div>
2024-09-24 14:37:41 +08:00
2024-09-26 17:59:26 +08:00
<div className={styles.listborder} style={{ padding: '0 10px', }}>状态</div>
<div className={styles.listborder} style={{ padding: '0 10px', marginBottom: 5 }}>{data?.status?'启用':'禁用'}</div>
2024-09-24 14:37:41 +08:00
<div className={styles.contentBor} style={{ padding: '0 10px', marginBottom: 5, height: '35%' }}>
2024-09-26 17:59:26 +08:00
<div className={styles.listborder} style={{ padding: '0 10px', height: '30%' }}>法律依据</div>
{data?.legalName ?? '无内容请添加'}
2024-09-24 14:37:41 +08:00
</div>
<div style={{ display: 'flex', height: '33%' }}>
<div className={styles.contentBor} style={{ flex: 1, marginRight: 5 }}>
2024-09-26 17:59:26 +08:00
<div className={styles.listborder} style={{ height: '30%', padding: '0 10px', }}>违法行为描述</div>
<div style={{ padding: '0 10px' }}>{data?.violationDesc ?? '无内容请添加'}</div>
2024-09-24 14:37:41 +08:00
</div>
<div className={styles.contentBor} style={{ flex: 1 }}>
2024-09-26 17:59:26 +08:00
<div className={styles.listborder} style={{ height: '30%', padding: '0 10px', }}>处罚措施</div>
<div style={{ padding: '0 10px' }}>{data?.penalties ?? '无内容请添加'}</div>
2024-09-24 14:37:41 +08:00
</div>
</div>
<BasicCrudModal
width={800}
ref={refModal}
title=""
component={ModalForm}
onCrudSuccess={successCallback}
/>
</>
)
}
export default Page