Compare commits

...

10 Commits

Author SHA1 Message Date
李神峰 8303462fe0 Merge branch 'lsf-dev' 2024-09-30 10:25:05 +08:00
xielei 5db2dd767f Merge branch 'master' of http://10.0.41.100:3000/lishenfeng/tsg-web 2024-09-30 10:22:01 +08:00
xielei bde0f178ec 页面搭建 2024-09-30 10:21:57 +08:00
秦子超 ba5077dcb2 Merge branch 'qzc-dev' 2024-09-30 09:12:00 +08:00
秦子超 9c71538c22 Merge branch 'master' of http://10.0.41.100:3000/lishenfeng/tsg-web 2024-09-30 09:06:41 +08:00
秦子超 ab5c9de2e1 地图修改 2024-09-30 09:06:37 +08:00
xielei 3ddf3eb338 页面搭建 2024-09-29 18:05:53 +08:00
xielei e713b3c8b9 Merge branch 'master' of http://10.0.41.100:3000/lishenfeng/tsg-web 2024-09-29 17:56:13 +08:00
xielei 56042ad3db 页面搭建 2024-09-29 17:56:08 +08:00
秦子超 dd5b798392 提价o 2024-09-29 10:47:10 +08:00
17 changed files with 4047 additions and 821 deletions

File diff suppressed because it is too large Load Diff

View File

@ -6,7 +6,7 @@ import { parseGeoJSONFeature } from "../../utils/tools";
function initState() { function initState() {
return { return {
layerVisible: { layerVisible: {
AdcdLayer: false,//行政区划 AdcdLayer: true,//行政区划
AdcdBorderInLayer: true,//乡镇边界 AdcdBorderInLayer: true,//乡镇边界
AdcdAllLayer: false,//县行政区划图层 AdcdAllLayer: false,//县行政区划图层
HeLiuZhuJiLayer:false,//12条河流注记 HeLiuZhuJiLayer:false,//12条河流注记

View File

@ -17,10 +17,10 @@ export default class AdcdLayer extends BaseLayer {
async onAdd() { async onAdd() {
const agnp = await AgnpPromise.get(); const agnp = await AgnpPromise.get();
const xzLabel = agnp.filter(o => o.Level === 5 || o.Level === 6).map(o => ({ const xzLabel = agnp.filter(o => o.LEVEL === 4 || o.LEVEL === 5 || o.LEVEL === 6).map(o => ({
...o, ...o,
stcd: o.OBJECTID, stcd: o.OBJECTID,
level: o.Level, level: o.LEVEL,
id: o.OBJECTID, id: o.OBJECTID,
type: 'label' type: 'label'
})) }))

View File

@ -26,6 +26,15 @@ function renderMarker({ level }, { width, highlight }) {
alt="" className="panel-icon" /> alt="" className="panel-icon" />
</div> </div>
`; `;
}else if(level === 4){
return `
<div style="position:relative">
<svg t="1616148185046" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="4230" width="${width}">
</svg>
<img width="16" style="position:absolute;top:0;left:2px" src="data:image/png;base64,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"
alt="" className="panel-icon" />
</div>
`;
}else{ }else{
return ` return `
<div style="position:relative"> <div style="position:relative">
@ -151,7 +160,7 @@ function AdcdMarker({ data, dispatch, setting, zoom, distSq, layerVisible }) {
return ( return (
<> <>
{ {
( (zoom > 8 || distSq < dist2 || highlight) && data.level === 5 && ( (zoom > 8 || distSq < dist2 || highlight) && (data.level === 5 || data.level === 4) &&
// isShow // isShow
true true
) && ( ) && (
@ -165,9 +174,9 @@ function AdcdMarker({ data, dispatch, setting, zoom, distSq, layerVisible }) {
transformOrigin: 'bottom center', transformOrigin: 'bottom center',
transform: `translateX(-50%)${markerZoom > 1 ? ' scale(' + markerZoom + ')' : ''}`, transform: `translateX(-50%)${markerZoom > 1 ? ' scale(' + markerZoom + ')' : ''}`,
lineHeight: 1, lineHeight: 1,
zIndex: 4,//zindexmarker.tuxiang + zindexOffset + (highlight ? zindexmarker.hilightPlus : 0) zIndex: data.level === 4?6:4,//zindexmarker.tuxiang + zindexOffset + (highlight ? zindexmarker.hilightPlus : 0)
}} }}
onClick={showPop} // onClick={showPop}
></div> ></div>
<div <div
className="markerLabel" className="markerLabel"
@ -181,7 +190,7 @@ function AdcdMarker({ data, dispatch, setting, zoom, distSq, layerVisible }) {
left: 0, left: 0,
transform: 'translateX(-50%)', transform: 'translateX(-50%)',
zIndex: 3,//zindexmarker.tuxiangLabel + zindexOffset + (highlight ? zindexmarker.hilightPlus : 0), zIndex: 3,//zindexmarker.tuxiangLabel + zindexOffset + (highlight ? zindexmarker.hilightPlus : 0),
color: !layerVisible.SatelliteImage?'#0008':'#fff' color: data.level === 4? 'red':'#0008'
}}> }}>
{data?.NAME} {data?.NAME}
</div> </div>
@ -206,7 +215,7 @@ function AdcdMarker({ data, dispatch, setting, zoom, distSq, layerVisible }) {
lineHeight: 1, lineHeight: 1,
zIndex: 2,//zindexmarker.tuxiang + zindexOffset + (highlight ? zindexmarker.hilightPlus : 0) zIndex: 2,//zindexmarker.tuxiang + zindexOffset + (highlight ? zindexmarker.hilightPlus : 0)
}} }}
onClick={showPop} // onClick={showPop}
></div> ></div>
<div <div
className="markerLabel" className="markerLabel"

View File

@ -31,7 +31,7 @@ export default function drpOption(data) {
{ {
type: 'category', type: 'category',
data: data.map(o => o.tm), data: data.map(o => o.tm),
inverse: true, inverse: false,
splitLine: { splitLine: {
show: false show: false
}, },

View File

@ -4,14 +4,11 @@ import moment from "moment"
const { RangePicker } = DatePicker; const { RangePicker } = DatePicker;
const cysd = [ const cysd = [
{ label:'昨天08:00~当前时间',value:'昨天08:00~当前时间',tms:[moment().add(-1,'days').format('YYYY-MM-DD 08:00:00'),moment().format('YYYY-MM-DD HH:mm:ss')]}, { label:'今日',value:'今日',tms:[moment().format('YYYY-MM-DD 00:00:00'),moment().format('YYYY-MM-DD HH:mm:ss')]},
{ label:'今天08:00~当前时间',value:'今天08:00~当前时间',tms:[moment().format('YYYY-MM-DD 08:00:00'),moment().format('YYYY-MM-DD HH:mm:ss')]}, { label:'近一周',value:'近一周',tms:[moment().add(-7,'days').format('YYYY-MM-DD HH:mm:ss'),moment().format('YYYY-MM-DD HH:mm:ss')]},
{ label:'昨天08:00~今天08:00',value:'昨天08:00~今天08:00',tms:[moment().add(-1,'days').format('YYYY-MM-DD 08:00:00'),moment().format('YYYY-MM-DD 08:00:00')]}, { label:'近一月',value:'近一月',tms:[moment().add(-1,'months').format('YYYY-MM-DD HH:mm:ss'),moment().format('YYYY-MM-DD HH:mm:ss')]},
{ label:'最近1小时',value:'最近1小时',tms:[moment().add(-1,'hours').format('YYYY-MM-DD HH:mm:ss'),moment().format('YYYY-MM-DD HH:mm:ss')]}, { label:'近三月',value:'近三月',tms:[moment().add(-3,'months').format('YYYY-MM-DD HH:mm:ss'),moment().format('YYYY-MM-DD HH:mm:ss')]},
{ label:'最近3小时',value:'最近3小时',tms:[moment().add(-3,'hours').format('YYYY-MM-DD HH:mm:ss'),moment().format('YYYY-MM-DD HH:mm:ss')]}, { label:'近一年',value:'近一年',tms:[moment().add(-1,'years').format('YYYY-MM-DD HH:mm:ss'),moment().format('YYYY-MM-DD HH:mm:ss')]},
{ label:'最近6小时',value:'最近6小时',tms:[moment().add(-6,'hours').format('YYYY-MM-DD HH:mm:ss'),moment().format('YYYY-MM-DD HH:mm:ss')]},
{ label:'最近12小时',value:'最近12小时',tms:[moment().add(-12,'hours').format('YYYY-MM-DD HH:mm:ss'),moment().format('YYYY-MM-DD HH:mm:ss')]},
{ label:'最近24小时',value:'最近24小时',tms:[moment().add(-24,'hours').format('YYYY-MM-DD HH:mm:ss'),moment().format('YYYY-MM-DD HH:mm:ss')]},
] ]
const ToolBar = ({search, defaultParams}) => { const ToolBar = ({search, defaultParams}) => {

View File

@ -31,7 +31,7 @@ export default function drpOption(data) {
{ {
type: 'category', type: 'category',
data: data.map(o => o.tm), data: data.map(o => o.tm),
inverse: true, inverse: false,
splitLine: { splitLine: {
show: false show: false
}, },

View File

@ -39,26 +39,30 @@ const Page = ({mySetTms}) => {
]; ];
useEffect(()=>{ useEffect(()=>{
( getDcl()
async()=>{ getBy()
getBn()
},[])
const getDcl = async()=>{
const { code, data } = await httppost2(apiurl.home.xcxj_dcl) const { code, data } = await httppost2(apiurl.home.xcxj_dcl)
if(code!==200){ if(code!==200){
message.error('请求失败') message.error('请求失败')
return return
} }
setData(data) setData(data)
}, }
async()=>{ const getBy = async()=>{
const { code, data } = await httppost2(apiurl.home.xcxj_by) const { code, data } = await httppost2(apiurl.home.xcxj_by)
if(code!==200){ if(code!==200){
message.error('请求失败') message.error('请求失败')
return return
} }
setData2(data) setData2(data)
}, }
async()=>{ const getBn = async()=>{
const { code, data } = await httppost2(apiurl.home.xcxj_bn) const { code, data } = await httppost2(apiurl.home.xcxj_bn)
if(code!==200){ if(code!==200){
message.error('请求失败') message.error('请求失败')
@ -66,8 +70,6 @@ const Page = ({mySetTms}) => {
} }
setData3(data) setData3(data)
} }
)()
},[])
const addHlLayer = (geojsonrv,name,color,item)=>{ const addHlLayer = (geojsonrv,name,color,item)=>{

View File

@ -94,7 +94,11 @@ const onExport = () => {
{tableProps.dataSource?.map((item, index) => ( {tableProps.dataSource?.map((item, index) => (
<Timeline.Item key={index}> <Timeline.Item key={index}>
<div className='time-line-item'> <div className='time-line-item'>
<span style={{width:100}}>{item.eventsDate}</span> <div style={{width:100}}>
<span>{item.eventsDate}</span>
<div className='dsj'>大事记</div>
</div>
<div className='item-right'> <div className='item-right'>
<span>{item.eventsDesc}</span> <span>{item.eventsDesc}</span>
<div style={{ display: "flex"}}> <div style={{ display: "flex"}}>

View File

@ -1,13 +1,14 @@
.basic-info{ .basic-info {
position: relative; position: relative;
font-size: 16px; font-size: 16px;
margin-bottom: 20px; margin-bottom: 20px;
padding:5px 25px; padding: 5px 25px;
border-bottom: 1px solid #eee; border-bottom: 1px solid #eee;
&::before{
&::before {
position: absolute; position: absolute;
top:8px; top: 8px;
left:0; left: 0;
content: ""; content: "";
display: block; display: block;
width: 5px; width: 5px;
@ -15,16 +16,35 @@
background-color: #0079fe; background-color: #0079fe;
} }
} }
.time-line{
.time-line {
width: 50%; width: 50%;
margin-left: 6%; margin-left: 6%;
margin-top: 1%; margin-top: 1%;
.time-line-item{
.time-line-item {
display: flex; display: flex;
// align-items: center; // align-items: center;
column-gap: 20px; column-gap: 20px;
.item-right{
flex:1; .dsj {
border-width: 0px;
width: 82px;
height: 30px;
background: inherit;
background-color: rgba(128, 255, 255, 1);
border: none;
border-radius: 4px;
-moz-box-shadow: none;
-webkit-box-shadow: none;
box-shadow: none;
line-height: 30px;
text-align: center;
margin-top: 10px;
}
.item-right {
flex: 1;
display: flex; display: flex;
flex-direction: column; flex-direction: column;
justify-content: space-between; justify-content: space-between;

View File

@ -95,22 +95,22 @@ const ModalForm = ({ mode, record, onEdit, onSave, onSimilarSave }) => {
* @param {string} id 删除的id * @param {string} id 删除的id
*/ */
const deleteFile = (fileId) => { const deleteFile = (fileId) => {
console.log(fileId); console.log(fileId,fileList);
let filterFile = fileList.filter(item => item.response?.data?.fileId !== fileId); let filterFile = fileList.filter(item => item.fileId !== fileId);
setFileList(filterFile) setFileList(filterFile)
} }
useEffect(() => { useEffect(() => {
if (mode != 'save') { if (mode != 'save') {
// const imgFile = record?.files?.map(o => ({ const imgFile = record?.files?.map(o => ({
// name: o.name, name: o.fileName,
// response: { response: {
// data: { data: {
// filePath: o.filePath, filePath: o.filePath,
// fileId: o.fileId fileId: o.fileId
// } }
// }, },
// })) }))
setFileList(record?.files) setFileList(imgFile)
} }
}, [record, mode]) }, [record, mode])
@ -232,6 +232,7 @@ const ModalForm = ({ mode, record, onEdit, onSave, onSimilarSave }) => {
</p> </p>
</Dragger> </Dragger>
} }
{JSON.stringify(fileList)}
<Row gutter={[16]}> <Row gutter={[16]}>
{ {
fileList.length > 0 && fileList.map(file => { fileList.length > 0 && fileList.map(file => {
@ -239,9 +240,9 @@ const ModalForm = ({ mode, record, onEdit, onSave, onSimilarSave }) => {
<Col span={12}> <Col span={12}>
<div className="file-item" style={{ width: "75%",marginTop:5 }}> <div className="file-item" style={{ width: "75%",marginTop:5 }}>
<div className='file-description'> <div className='file-description'>
{file?.fileName?.indexOf('.docx') > -1 ? {file.name?.indexOf('.docx') > -1 ?
<div <div
onClick={() => { download(file.fileId) }} onClick={() => { download(file.response?.data?.fileId) }}
style={{ cursor: 'pointer' }} style={{ cursor: 'pointer' }}
> >
<FileWordOutlined <FileWordOutlined
@ -249,35 +250,35 @@ const ModalForm = ({ mode, record, onEdit, onSave, onSimilarSave }) => {
/> />
</div> </div>
: :
file?.fileName?.indexOf('.pdf') > -1 ? file.name?.indexOf('.pdf') > -1 ?
<div <div
onClick={() => { viewPdf(file.fileId) }} onClick={() => { viewPdf(file.response?.data?.fileId) }}
style={{ cursor: 'pointer' }} style={{ cursor: 'pointer' }}
> >
<FilePdfOutlined style={{ fontSize: 40 }} /> <FilePdfOutlined style={{ fontSize: 40 }} />
</div> </div>
: :
file?.fileName?.indexOf('.zip') > -1 ? file.name?.indexOf('.zip') > -1 ?
<div <div
onClick={() => { download(file.fileId) }} onClick={() => { download(file.response?.data?.fileId) }}
style={{ cursor: 'pointer' }} style={{ cursor: 'pointer' }}
> >
<FileZipOutlined style={{ fontSize: 40 }} /> <FileZipOutlined style={{ fontSize: 40 }} />
</div> </div>
: :
file?.fileName?.indexOf('.xlsx') > -1 ? file.name?.indexOf('.xlsx') > -1 ?
<div <div
onClick={() => { download(file.fileId) }} onClick={() => { download(file.response?.data?.fileId) }}
style={{ cursor: 'pointer' }} style={{ cursor: 'pointer' }}
> >
<FileExcelOutlined style={{ fontSize: 40 }} /> <FileExcelOutlined style={{ fontSize: 40 }} />
</div> </div>
: :
<Image width={60} src={url + file.filePath} alt='' /> <Image width={60} src={url + file.response?.data?.filePath} alt='' />
} }
<span>{file?.fileName}</span> <span>{file.name}</span>
</div> </div>
<div className={mode == "view" ? 'delete-icon disable-icon' : 'delete-icon'} onClick={() => deleteFile(file.fileId)}> <div className={mode == "view" ? 'delete-icon disable-icon' : 'delete-icon'} onClick={() => deleteFile(file.response?.data?.fileId)}>
<DeleteOutlined /> <DeleteOutlined />
</div> </div>
</div> </div>

View File

@ -37,6 +37,8 @@ const Page = ({ uploadUrl, downloadUrl, type, getFormInfo, formJsonData }) => {
const [fileListHj, setFileHj] = useState({'files3': [],'files4': [],'files5': [],'files6': [],'files7': []}) const [fileListHj, setFileHj] = useState({'files3': [],'files4': [],'files5': [],'files6': [],'files7': []})
const [url, setUrl] = useState('') const [url, setUrl] = useState('')
const [isModal, setIsModal] = useState(false) const [isModal, setIsModal] = useState(false)
const [loading, setLoading] = useState(false)
const getInfo = () => { const getInfo = () => {
form.validateFields().then((values) => { form.validateFields().then((values) => {
getFormInfo({ ...fileListHj,...values, }) getFormInfo({ ...fileListHj,...values, })
@ -72,8 +74,9 @@ const Page = ({ uploadUrl, downloadUrl, type, getFormInfo, formJsonData }) => {
// } // }
}, },
customRequest(e) { customRequest(e) {
setLoading(true);
httppostAddfile(uploadUrl, e).then(res => { httppostAddfile(uploadUrl, e).then(res => {
if(fileListHj[keys]){ if(fileListHj[keys]){
fileListHj[keys].push(res.data) fileListHj[keys].push(res.data)
}else{ }else{
@ -82,6 +85,8 @@ const Page = ({ uploadUrl, downloadUrl, type, getFormInfo, formJsonData }) => {
} }
setFileHj({ ...fileListHj }) setFileHj({ ...fileListHj })
setLoading(false);
}) })
} }
} }
@ -147,7 +152,7 @@ const Page = ({ uploadUrl, downloadUrl, type, getFormInfo, formJsonData }) => {
label='保管人员' label='保管人员'
name='custodian' name='custodian'
> >
<Input /> <Input disabled={type == 'view'}/>
</Form.Item> </Form.Item>
</Col> </Col>
<Col span={10}> <Col span={10}>
@ -155,7 +160,7 @@ const Page = ({ uploadUrl, downloadUrl, type, getFormInfo, formJsonData }) => {
label='保管地点' label='保管地点'
name='storageLocation' name='storageLocation'
> >
<Input /> <Input disabled={type == 'view'}/>
</Form.Item> </Form.Item>
</Col> </Col>
</Row> </Row>
@ -171,12 +176,12 @@ const Page = ({ uploadUrl, downloadUrl, type, getFormInfo, formJsonData }) => {
label='附件' label='附件'
name='files' name='files'
> >
<Dragger {...props(item1.key)}> {type !== 'view' &&<Dragger {...props(item1.key)} disabled={type == 'view'}>
<p className="ant-upload-drag-icon"> <p className="ant-upload-drag-icon">
<InboxOutlined /> <InboxOutlined />
</p> </p>
<p className="ant-upload-text">点击或将文件拖拽到这里上传 支持扩展名jpegpng</p> <p className="ant-upload-text">点击或将文件拖拽到这里上传 支持扩展名jpegpng</p>
</Dragger> </Dragger>}
<div className='flex'> <div className='flex'>
{fileListHj?.[item1.key]?.map((item) => { {fileListHj?.[item1.key]?.map((item) => {
return <div className='flex align-center file-item' style={{marginTop:5,marginRight:'3%',width:'30%', minHeight: "50px", fontSize: 14, columnGap: 10, cursor: checkMediaType(item.fileName) == 'image' || checkMediaType(item.fileName) == 'pdf' ? 'pointer' : "not-allowed" }}> return <div className='flex align-center file-item' style={{marginTop:5,marginRight:'3%',width:'30%', minHeight: "50px", fontSize: 14, columnGap: 10, cursor: checkMediaType(item.fileName) == 'image' || checkMediaType(item.fileName) == 'pdf' ? 'pointer' : "not-allowed" }}>
@ -202,7 +207,7 @@ const Page = ({ uploadUrl, downloadUrl, type, getFormInfo, formJsonData }) => {
</Row>))} </Row>))}
<div className="flex flex-end" style={{ marginTop: 10, justifyContent: "flex-end" }}> <div className="flex flex-end" style={{ marginTop: 10, justifyContent: "flex-end" }}>
<Button type="" style={{ marginRight: 10 }} onClick={cancel}>取消</Button> <Button type="" style={{ marginRight: 10 }} onClick={cancel}>取消</Button>
<Button type="primary" onClick={getInfo}>确定</Button> <Button type="primary" onClick={getInfo} loading={loading}>确定</Button>
</div> </div>
</Form > </Form >

View File

@ -34,6 +34,8 @@ const items = [
const Page = ({ mode, onCrudSuccess,record,submit }) => { const Page = ({ mode, onCrudSuccess,record,submit }) => {
const [formData,setFormData] =useState({}) const [formData,setFormData] =useState({})
const [clqkDataConfig,setConfig] =useState([]) const [clqkDataConfig,setConfig] =useState([])
const [recordData,setRecord] =useState({})
// debugger; // debugger;
const [key, setKeys] = useState('1') const [key, setKeys] = useState('1')

View File

@ -26,6 +26,8 @@ const Page = ({ uploadUrl, downloadUrl, type, getFormInfo, formJsonData }) => {
const [fileListHj, setFileHj] = useState({'files3': [],'files4': [],'files5': [],'files6': [],'files7': []}) const [fileListHj, setFileHj] = useState({'files3': [],'files4': [],'files5': [],'files6': [],'files7': []})
const [url, setUrl] = useState('') const [url, setUrl] = useState('')
const [isModal, setIsModal] = useState(false) const [isModal, setIsModal] = useState(false)
const [loading, setLoading] = useState(false)
const getInfo = () => { const getInfo = () => {
form.validateFields().then((values) => { form.validateFields().then((values) => {
getFormInfo({ ...values, ...fileListHj }) getFormInfo({ ...values, ...fileListHj })
@ -62,6 +64,7 @@ const Page = ({ uploadUrl, downloadUrl, type, getFormInfo, formJsonData }) => {
// } // }
}, },
customRequest(e) { customRequest(e) {
setLoading(true);
httppostAddfile(uploadUrl, e).then(res => { httppostAddfile(uploadUrl, e).then(res => {
if(fileListHj[keys]){ if(fileListHj[keys]){
@ -72,6 +75,7 @@ const Page = ({ uploadUrl, downloadUrl, type, getFormInfo, formJsonData }) => {
} }
setFileHj({ ...fileListHj }) setFileHj({ ...fileListHj })
setLoading(false);
}) })
} }
} }
@ -136,12 +140,12 @@ const Page = ({ uploadUrl, downloadUrl, type, getFormInfo, formJsonData }) => {
label='附件' label='附件'
name='files' name='files'
> >
<Dragger {...props(item1.key)}> {type !== 'view'&&<Dragger {...props(item1.key)}>
<p className="ant-upload-drag-icon"> <p className="ant-upload-drag-icon">
<InboxOutlined /> <InboxOutlined />
</p> </p>
<p className="ant-upload-text">点击或将文件拖拽到这里上传 支持扩展名jpegpng</p> <p className="ant-upload-text">点击或将文件拖拽到这里上传 支持扩展名jpegpng</p>
</Dragger> </Dragger>}
<div className='flex'> <div className='flex'>
{fileListHj?.[item1.key]?.map((item) => { {fileListHj?.[item1.key]?.map((item) => {
return <div className='flex align-center file-item' style={{marginTop:5,marginRight:'3%',width:'30%', minHeight: "50px", fontSize: 14, columnGap: 10, cursor: checkMediaType(item.fileName) == 'image' || checkMediaType(item.fileName) == 'pdf' ? 'pointer' : "not-allowed" }}> return <div className='flex align-center file-item' style={{marginTop:5,marginRight:'3%',width:'30%', minHeight: "50px", fontSize: 14, columnGap: 10, cursor: checkMediaType(item.fileName) == 'image' || checkMediaType(item.fileName) == 'pdf' ? 'pointer' : "not-allowed" }}>
@ -167,7 +171,7 @@ const Page = ({ uploadUrl, downloadUrl, type, getFormInfo, formJsonData }) => {
</Row>))} </Row>))}
<div className="flex flex-end" style={{ marginTop: 10, justifyContent: "flex-end" }}> <div className="flex flex-end" style={{ marginTop: 10, justifyContent: "flex-end" }}>
<Button type="" style={{ marginRight: 10 }} onClick={cancel}>取消</Button> <Button type="" style={{ marginRight: 10 }} onClick={cancel}>取消</Button>
<Button type="primary" onClick={getInfo}>确定</Button> <Button type="primary" onClick={getInfo} loading={loading}>确定</Button>
</div> </div>
</Form > </Form >

View File

@ -20,6 +20,8 @@ const FormZdy = ({ fileKey,typeName = "ddForm", formJson, getFormInfo, type, for
const [fileListUp, setFileLisUp] = useState([]) const [fileListUp, setFileLisUp] = useState([])
const [url, setUrl] = useState('') const [url, setUrl] = useState('')
const [isModal, setIsModal] = useState(false) const [isModal, setIsModal] = useState(false)
const [loading, setLoading] = useState(false)
// //
@ -71,8 +73,9 @@ const FormZdy = ({ fileKey,typeName = "ddForm", formJson, getFormInfo, type, for
} }
}, },
customRequest(e) { customRequest(e) {
setFileLisUp([...fileListUp, e.file]) setLoading(true);
httppostAddfile(uploadUrl, e).then(res => { httppostAddfile(uploadUrl, e).then(res => {
setLoading(false);
setFileList([...fileList, res.data]) setFileList([...fileList, res.data])
}) })
} }
@ -102,9 +105,9 @@ const FormZdy = ({ fileKey,typeName = "ddForm", formJson, getFormInfo, type, for
return null; return null;
} }
const preView = (item) => { const preView = (item) => {
if (checkMediaType(item.name) == 'pdf') { if (checkMediaType(item.fileName) == 'pdf') {
// window.open(baseUrl + item.previewUrl) // window.open(baseUrl + item.previewUrl)
setUrl(item.previewUrl) setUrl(item.fileId)
setIsModal(true) setIsModal(true)
} }
@ -248,11 +251,11 @@ const FormZdy = ({ fileKey,typeName = "ddForm", formJson, getFormInfo, type, for
showSearch showSearch
style={{ width: '100%' }} style={{ width: '100%' }}
dropdownStyle={{ maxHeight: 400, overflow: 'auto' }} dropdownStyle={{ maxHeight: 400, overflow: 'auto' }}
placeholder="Please select"
allowClear allowClear
fieldNames={item.fieldNames} fieldNames={item.fieldNames}
treeData={item.treeData} treeData={item.treeData}
treeCheckable={item.multiple} treeCheckable={item.multiple}
disabled={type == 'view'}
/> />
</Form.Item>} </Form.Item>}
@ -305,7 +308,7 @@ const FormZdy = ({ fileKey,typeName = "ddForm", formJson, getFormInfo, type, for
{ {
type !== 'view' && <div className="flex flex-end" style={{ marginTop: 10, justifyContent: "flex-end" }}> type !== 'view' && <div className="flex flex-end" style={{ marginTop: 10, justifyContent: "flex-end" }}>
<Button type="" style={{ marginRight: 10 }} onClick={cancel}>取消</Button> <Button type="" style={{ marginRight: 10 }} onClick={cancel}>取消</Button>
<Button type="primary" onClick={getInfo}>确定</Button> <Button type="primary" onClick={getInfo} loading={loading}>确定</Button>
</div> </div>
} }
<PdfView url={`${process.env.PUBLIC_URL}/static/pdf/web/viewer.html?file=${encodeURIComponent(`/gunshiApp/tsg/rescue/goods/file/download/${url}`)}`} isModal={isModal} setModalN={(e)=>setIsModal(e)}/> <PdfView url={`${process.env.PUBLIC_URL}/static/pdf/web/viewer.html?file=${encodeURIComponent(`/gunshiApp/tsg/rescue/goods/file/download/${url}`)}`} isModal={isModal} setModalN={(e)=>setIsModal(e)}/>

View File

@ -26,6 +26,7 @@ const Pdf = ({ url,isModal,setModalN }) => {
onOk={handleOk} onOk={handleOk}
footer={false} footer={false}
onCancel={handleCancel} onCancel={handleCancel}
style={{ marginTop: "-5%" }}
destroyOnClose> destroyOnClose>
<div style={{ padding: "0 10px" }}> <div style={{ padding: "0 10px" }}>
<iframe <iframe