tsg-web/src/views/Home/MapCtrl/components/sdz/gctp.js

53 lines
1.7 KiB
JavaScript

import React, { useEffect, useState } from 'react';
import { Descriptions, message, Table } from "antd";
import { plan } from "../../../../../service/sssq";
import { httpget2 } from "../../../../../utils/request"
import apiUrl from '../../../../../service/apiurl'
import { projDict } from "../../../../../utils/dictType"
import { DeleteOutlined } from '@ant-design/icons'
function SdzGctp({ data }) {
const [tableData, setData] = useState([])
const url = "http://223.75.53.141:9100/gs-tsg"
const getInfo = () => {
httpget2(apiUrl.sdz.gctp, { hystCode: data.hystCode }).then(res => {
if (res.code == 200) {
setData(res.data)
} else {
setData([])
}
})
}
const delGct = (id) => {
httpget2(apiUrl.sdz.delGctp, { id }).then(res => {
if (res.code == 200) {
message.success('删除成功')
getInfo()
}
})
}
useEffect(() => {
getInfo()
}, [])
return (
<>
<Descriptions bordered layout="vertical" column={3}>
{
tableData.length > 0 ? tableData.map(o => <Descriptions.Item label={projDict(o.projType)}>
<div className="no-data flex flexsbc">
<img src={url + o.filePath} style={{ width: "80%" }} alt="" />
<span>{o.fileId}</span>
<DeleteOutlined style={{ fontSize: 20 }} onClick={() => delGct(o.fileId)} />
</div>
</Descriptions.Item>
)
: ""
}
</Descriptions>
</>
)
}
export default SdzGctp;