Compare commits

..

No commits in common. "8303462fe094c99328f0206f26e7f83a768d0ad3" and "65608d998587e10301ad85e1dc3c51d95cde16db" have entirely different histories.

17 changed files with 821 additions and 4047 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: true,//行政区划 AdcdLayer: false,//行政区划
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 === 4 || o.LEVEL === 5 || o.LEVEL === 6).map(o => ({ const xzLabel = agnp.filter(o => 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,15 +26,6 @@ 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,iVBORw0KGgoAAAANSUhEUgAAAGUAAABkCAYAAACfIP5qAAAACXBIWXMAAAsSAAALEgHS3X78AAAH30lEQVR4nO2d33HiSBDGR04AP/DCk8nA3gggg/VFYG8ESwbHRnBsBIsjWBzBQgQHGcCTXniwIuBqdN9gARJS/xlpROlXRa1ry5aEvpme7p6ZnuhwOJiQ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1AnWVVaes+5JkdO2BzUuNsoBNgRDht0CQyjU2u6M6Sgj6qA7zmUX+xnqs/+mhLOCCO8dfJ4hBtkJBNtRp4e74pxxad/yTozsorZR6D0pzdEcKFtLMkYKO7vDNC5o9fNPRHVN7JIxjah3dgc6BHejs6I4+10F1y3ZmAUSb96FQSBQXXBxR7SlZMBczveFes0I+T/1UV2+imE8PZ97yinjnJIirvG3p8CqKA9nVWctK3+bxpnEsSRm1iOJosUnzZqryqFUUB9znNhSNfkN+rtYaAI2I4oBZe8V8SyjsMA7OmzqavVFRHJmUhxWoibKGboGe19ROVYIQJUtmW5pLh/gycSsEuou6zVMZwYlyDkSymQKXLnFTylXcbGuKrAlyaRn72YYmwgnGmP8AWSkBGMJyUL0AAAAASUVORK5CYII="
alt="" className="panel-icon" />
</div>
`;
}else{ }else{
return ` return `
<div style="position:relative"> <div style="position:relative">
@ -160,7 +151,7 @@ function AdcdMarker({ data, dispatch, setting, zoom, distSq, layerVisible }) {
return ( return (
<> <>
{ {
( (zoom > 8 || distSq < dist2 || highlight) && (data.level === 5 || data.level === 4) && ( (zoom > 8 || distSq < dist2 || highlight) && data.level === 5 &&
// isShow // isShow
true true
) && ( ) && (
@ -174,9 +165,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: data.level === 4?6:4,//zindexmarker.tuxiang + zindexOffset + (highlight ? zindexmarker.hilightPlus : 0) zIndex: 4,//zindexmarker.tuxiang + zindexOffset + (highlight ? zindexmarker.hilightPlus : 0)
}} }}
// onClick={showPop} onClick={showPop}
></div> ></div>
<div <div
className="markerLabel" className="markerLabel"
@ -190,7 +181,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: data.level === 4? 'red':'#0008' color: !layerVisible.SatelliteImage?'#0008':'#fff'
}}> }}>
{data?.NAME} {data?.NAME}
</div> </div>
@ -215,7 +206,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: false, inverse: true,
splitLine: { splitLine: {
show: false show: false
}, },

View File

@ -4,11 +4,14 @@ import moment from "moment"
const { RangePicker } = DatePicker; const { RangePicker } = DatePicker;
const cysd = [ const cysd = [
{ 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().add(-1,'days').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~当前时间',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(-1,'months').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(-3,'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(-1,'years').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:'最近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: false, inverse: true,
splitLine: { splitLine: {
show: false show: false
}, },

View File

@ -39,30 +39,26 @@ const Page = ({mySetTms}) => {
]; ];
useEffect(()=>{ useEffect(()=>{
getDcl() (
getBy() async()=>{
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)
} },
const getBy = async()=>{ 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)
} },
const getBn = async()=>{ 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('请求失败')
@ -70,6 +66,8 @@ const Page = ({mySetTms}) => {
} }
setData3(data) setData3(data)
} }
)()
},[])
const addHlLayer = (geojsonrv,name,color,item)=>{ const addHlLayer = (geojsonrv,name,color,item)=>{

View File

@ -94,11 +94,7 @@ 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'>
<div style={{width:100}}> <span style={{width:100}}>{item.eventsDate}</span>
<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,14 +1,13 @@
.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;
@ -16,35 +15,16 @@
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{
.dsj { flex:1;
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,fileList); console.log(fileId);
let filterFile = fileList.filter(item => item.fileId !== fileId); let filterFile = fileList.filter(item => item.response?.data?.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.fileName, // name: o.name,
response: { // response: {
data: { // data: {
filePath: o.filePath, // filePath: o.filePath,
fileId: o.fileId // fileId: o.fileId
} // }
}, // },
})) // }))
setFileList(imgFile) setFileList(record?.files)
} }
}, [record, mode]) }, [record, mode])
@ -232,7 +232,6 @@ 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 => {
@ -240,9 +239,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.name?.indexOf('.docx') > -1 ? {file?.fileName?.indexOf('.docx') > -1 ?
<div <div
onClick={() => { download(file.response?.data?.fileId) }} onClick={() => { download(file.fileId) }}
style={{ cursor: 'pointer' }} style={{ cursor: 'pointer' }}
> >
<FileWordOutlined <FileWordOutlined
@ -250,35 +249,35 @@ const ModalForm = ({ mode, record, onEdit, onSave, onSimilarSave }) => {
/> />
</div> </div>
: :
file.name?.indexOf('.pdf') > -1 ? file?.fileName?.indexOf('.pdf') > -1 ?
<div <div
onClick={() => { viewPdf(file.response?.data?.fileId) }} onClick={() => { viewPdf(file.fileId) }}
style={{ cursor: 'pointer' }} style={{ cursor: 'pointer' }}
> >
<FilePdfOutlined style={{ fontSize: 40 }} /> <FilePdfOutlined style={{ fontSize: 40 }} />
</div> </div>
: :
file.name?.indexOf('.zip') > -1 ? file?.fileName?.indexOf('.zip') > -1 ?
<div <div
onClick={() => { download(file.response?.data?.fileId) }} onClick={() => { download(file.fileId) }}
style={{ cursor: 'pointer' }} style={{ cursor: 'pointer' }}
> >
<FileZipOutlined style={{ fontSize: 40 }} /> <FileZipOutlined style={{ fontSize: 40 }} />
</div> </div>
: :
file.name?.indexOf('.xlsx') > -1 ? file?.fileName?.indexOf('.xlsx') > -1 ?
<div <div
onClick={() => { download(file.response?.data?.fileId) }} onClick={() => { download(file.fileId) }}
style={{ cursor: 'pointer' }} style={{ cursor: 'pointer' }}
> >
<FileExcelOutlined style={{ fontSize: 40 }} /> <FileExcelOutlined style={{ fontSize: 40 }} />
</div> </div>
: :
<Image width={60} src={url + file.response?.data?.filePath} alt='' /> <Image width={60} src={url + file.filePath} alt='' />
} }
<span>{file.name}</span> <span>{file?.fileName}</span>
</div> </div>
<div className={mode == "view" ? 'delete-icon disable-icon' : 'delete-icon'} onClick={() => deleteFile(file.response?.data?.fileId)}> <div className={mode == "view" ? 'delete-icon disable-icon' : 'delete-icon'} onClick={() => deleteFile(file.fileId)}>
<DeleteOutlined /> <DeleteOutlined />
</div> </div>
</div> </div>

View File

@ -37,8 +37,6 @@ 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, })
@ -74,9 +72,8 @@ 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{
@ -85,8 +82,6 @@ const Page = ({ uploadUrl, downloadUrl, type, getFormInfo, formJsonData }) => {
} }
setFileHj({ ...fileListHj }) setFileHj({ ...fileListHj })
setLoading(false);
}) })
} }
} }
@ -152,7 +147,7 @@ const Page = ({ uploadUrl, downloadUrl, type, getFormInfo, formJsonData }) => {
label='保管人员' label='保管人员'
name='custodian' name='custodian'
> >
<Input disabled={type == 'view'}/> <Input />
</Form.Item> </Form.Item>
</Col> </Col>
<Col span={10}> <Col span={10}>
@ -160,7 +155,7 @@ const Page = ({ uploadUrl, downloadUrl, type, getFormInfo, formJsonData }) => {
label='保管地点' label='保管地点'
name='storageLocation' name='storageLocation'
> >
<Input disabled={type == 'view'}/> <Input />
</Form.Item> </Form.Item>
</Col> </Col>
</Row> </Row>
@ -176,12 +171,12 @@ const Page = ({ uploadUrl, downloadUrl, type, getFormInfo, formJsonData }) => {
label='附件' label='附件'
name='files' name='files'
> >
{type !== 'view' &&<Dragger {...props(item1.key)} disabled={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" }}>
@ -207,7 +202,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} loading={loading}>确定</Button> <Button type="primary" onClick={getInfo}>确定</Button>
</div> </div>
</Form > </Form >

View File

@ -34,8 +34,6 @@ 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,8 +26,6 @@ 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 })
@ -64,7 +62,6 @@ 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]){
@ -75,7 +72,6 @@ const Page = ({ uploadUrl, downloadUrl, type, getFormInfo, formJsonData }) => {
} }
setFileHj({ ...fileListHj }) setFileHj({ ...fileListHj })
setLoading(false);
}) })
} }
} }
@ -140,12 +136,12 @@ const Page = ({ uploadUrl, downloadUrl, type, getFormInfo, formJsonData }) => {
label='附件' label='附件'
name='files' name='files'
> >
{type !== 'view'&&<Dragger {...props(item1.key)}> <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" }}>
@ -171,7 +167,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} loading={loading}>确定</Button> <Button type="primary" onClick={getInfo}>确定</Button>
</div> </div>
</Form > </Form >

View File

@ -20,8 +20,6 @@ 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)
// //
@ -73,9 +71,8 @@ const FormZdy = ({ fileKey,typeName = "ddForm", formJson, getFormInfo, type, for
} }
}, },
customRequest(e) { customRequest(e) {
setLoading(true); setFileLisUp([...fileListUp, e.file])
httppostAddfile(uploadUrl, e).then(res => { httppostAddfile(uploadUrl, e).then(res => {
setLoading(false);
setFileList([...fileList, res.data]) setFileList([...fileList, res.data])
}) })
} }
@ -105,9 +102,9 @@ const FormZdy = ({ fileKey,typeName = "ddForm", formJson, getFormInfo, type, for
return null; return null;
} }
const preView = (item) => { const preView = (item) => {
if (checkMediaType(item.fileName) == 'pdf') { if (checkMediaType(item.name) == 'pdf') {
// window.open(baseUrl + item.previewUrl) // window.open(baseUrl + item.previewUrl)
setUrl(item.fileId) setUrl(item.previewUrl)
setIsModal(true) setIsModal(true)
} }
@ -251,11 +248,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>}
@ -308,7 +305,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} loading={loading}>确定</Button> <Button type="primary" onClick={getInfo}>确定</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,7 +26,6 @@ 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