秦子超 2024-09-30 09:06:41 +08:00
commit 9c71538c22
26 changed files with 280 additions and 116 deletions

9
package-lock.json generated
View File

@ -50,6 +50,7 @@
"react-cookies": "^0.1.1",
"react-dom": "^18.2.0",
"react-konva": "^18.2.3",
"react-org-tree": "^1.0.1",
"react-pdf": "^7.3.3",
"react-redux": "^8.0.2",
"react-rnd": "^10.4.11",
@ -18883,6 +18884,14 @@
"resolved": "https://registry.npmjs.org/react-lifecycles-compat/-/react-lifecycles-compat-3.0.4.tgz",
"integrity": "sha512-fBASbA6LnOU9dOU2eW7aQ8xmYBSXUIWr+UmF9b1efZBazGNO+rcXT/icdKnYm2pTwcRylVUYwW7H1PHfLekVzA=="
},
"node_modules/react-org-tree": {
"version": "1.0.1",
"resolved": "https://registry.npmmirror.com/react-org-tree/-/react-org-tree-1.0.1.tgz",
"integrity": "sha512-NK1d8VIAzxJyMC/Rx9MupAusoFnokYr81Hw3oEpqxqBLQmpBVAexjvPSAJmhCmsom9Zymu+BMNrjRw5D54n7aw==",
"dependencies": {
"classnames": "^2.2.6"
}
},
"node_modules/react-pdf": {
"version": "7.3.3",
"resolved": "https://registry.npmjs.org/react-pdf/-/react-pdf-7.3.3.tgz",

View File

@ -45,6 +45,7 @@
"react-cookies": "^0.1.1",
"react-dom": "^18.2.0",
"react-konva": "^18.2.3",
"react-org-tree": "^1.0.1",
"react-pdf": "^7.3.3",
"react-redux": "^8.0.2",
"react-rnd": "^10.4.11",

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.1 KiB

After

Width:  |  Height:  |  Size: 3.0 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.5 KiB

After

Width:  |  Height:  |  Size: 2.4 KiB

View File

@ -156,6 +156,11 @@ export function createCrudService(urlSet) {
const resData = await httppost2(urlSet, params) || {};
return resData;
}
const edit1 = async (params) => {
const resData = await httppost2(urlSet, params) || {};
return resData;
}
const insert = async (params) => {
const resData = await httppost2(urlSet + `/${params}`) || {};
return resData;
@ -241,6 +246,7 @@ export function createCrudService(urlSet) {
todo: todo,
save: save,
edit: edit,
edit1: edit1,
del: del,
insert:insert,
delGet:delGet,

View File

@ -289,8 +289,9 @@ export async function loadMenu(): Promise<MenuItem[]> {
}
]
},
{ id: id(), title: '法律法规', path: '/mgr/sz/flfg' },
{ id: id(), title: '制度管理', path: '/mgr/sz/zdgl' },
{ id: id(), title: '法律法规', path: '/mgr/sz/flfg' },
]
},

View File

@ -914,7 +914,7 @@ const apiurl = {
reservoirsummaryInfo: service_fxdd + '/reservoir/water/summaryInfo', //实时水情-水库水情汇总
//河道弹框详情
monitor: service_fxdd + '/river/water/monitor/data', //监测数据
detail: service_fxdd + '/river/water/detail', //监测数据-下方表格
detail: service_fxdd + '/reservoir/water/detail', //监测数据-下方表格
zqrl: service_fxdd + '/river/water/zqrl', //水位流量关系
channel: service_fxdd + '/reservoir/water/image/channel', //图像监测-视角
imageinfo: service_fxdd + '/reservoir/water/image/info', //图像监测-列表

View File

@ -23,9 +23,9 @@ export async function reservoirlist(params) {
if (code !== 200) {
message.error(msg || '请求失败');
}
const list = data?.filter(o => o.lgtd && o.lttd)
// const list = data?.filter(o => o.lgtd && o.lttd)
return list;
return data;
}

View File

@ -29,7 +29,7 @@
top: 30px;
border-radius: 5px;
border: 1px solid #eee;
transition: all 0.2s ease 0s;
.ant-tabs-nav{
margin-bottom: 5px;

View File

@ -90,8 +90,8 @@ export default function Xmzlmb() {
...obj,
}
})
let res1 = result.map(item => ({...item,rz:(item.rz - 100).toFixed(2)})) //为了测试 最后需要删除
setDateSources(res1)
// let res1 = result.map(item => ({...item,rz:(item.rz - 100).toFixed(2)})) //为了测试 最后需要删除
setDateSources(result)
} catch (error) {
console.log(error);
}

View File

@ -35,12 +35,12 @@ const textColor = '#666'
[];
const gz3 = data[alltype[2]] ?
type == "1" ? [[73, 161], [73, data[alltype[2]]]] :
type == "1" ? [[72.5, 161], [72.5, data[alltype[2]]]] :
type == "2" ? [[66.5, 162], [66.5, data[alltype[2]]]] :
[[73, 161], [73, data[alltype[2]]]] : [];
const gz4 = data[alltype[3]] ?
type == "1" ? [[85, 166], [85, data[alltype[3]]]] :
type == "1" ? [[84.5, 166], [84.5, data[alltype[3]]]] :
type == "2" ? [[77, 161], [77, data[alltype[3]]]] :
[[85, 166], [85, data[alltype[3]]]] : [];
@ -50,8 +50,8 @@ const textColor = '#666'
[xValue, data?.rz],
[51.6, data[alltype[0]]],
[53.6, data[alltype[1]]],
[73, data[alltype[2]]],
[85, data[alltype[3]]]
[72.5, data[alltype[2]]],
[84.5, data[alltype[3]]]
] :
type == "2" ?
[

View File

@ -110,7 +110,7 @@ const EditableRow = ({ index, ...props }) => {
title: '标准分数',
key: 'standardScore',
dataIndex: 'standardScore',
width: 60,
width: 70,
align: "center",
},
{
@ -380,12 +380,20 @@ const EditableRow = ({ index, ...props }) => {
setClickItem(record)
}
const handleRadioChange = (e) => {
if (e.target.value == 1) {
setTableData(tableDataRef.current)
if (e.target.value == 1) {
if (tabs == 2) {
getQdViewData(Item?.id)
} else {
const newData = tableData.filter(item => item.standardScore > item.assessScore)
setTableData(newData);
getZbTableData(Item?.id,2)
}
} else {
const newData = tableData.filter(item => item.standardScore > item.assessScore)
newData.forEach(item => {
if (item.rowSpan) delete item.rowSpan;
})
const res = handleData(newData, "name")
setTableData(res);
}
}
// 整改

View File

@ -1,5 +1,5 @@
import React,{useEffect,useState,useMemo,useRef} from 'react';
import { Form, Button, Input, Row,Table, Col, Popconfirm, InputNumber,Image,Modal,Typography, message} from 'antd';
import { Form, Button, Input, Row,Table, Col, Tooltip, InputNumber,Image,Modal,Typography, message} from 'antd';
import { DeleteOutlined,FileWordOutlined,FilePdfOutlined,FileZipOutlined,FileExcelOutlined } from '@ant-design/icons';
import { formItemLayout, btnItemLayout } from '../../../../components/crud/FormLayoutProps';
import { httpget2, httppost2,xyt_httpget2 } from '../../../../utils/request';
@ -27,6 +27,16 @@ const ModalForm = ({ mode, record, onEdit, onSave, onSimilarSave }) => {
dataIndex: 'indicatorName',
width: 250,
align: "center",
render: (v, r) => {
const titleDom = r.indicatorRatings ?
r.indicatorRatings.map((item,i) => <div key={i}>{item?.ratingDesc}&nbsp;({item?.standardScore})</div>)
: ''
return (
<Tooltip title={titleDom}>
<span>{v}</span>
</Tooltip>
)
}
},
{
title: '标准分数',

View File

@ -11,8 +11,13 @@ const Page = () => {
<Image src={title} />保护对象
</div>
<div className={styles.content}>
水库防洪标准按50年一遇设计1000年一遇校核设计洪水位111.51校核洪水位 112.75 ,水库担负着红安县城七里坪杏花城关等城镇以及京九铁路汉麻连络线省道S234国道G230,京九铁路汉麻联络线等交通设施安全的防洪重任防洪保护人口32万
保护耕地 15 万亩
水库防洪标准按
<span className={styles.color}>50</span>
年一遇设计<span className={styles.color}>1000</span><span className={styles.color}>111.51</span>
校核洪水位 <span className={styles.color}>112.75</span> ,
水库担负着红安县城七里坪杏花城关等城镇
以及京九铁路汉麻连络线省道S234国道G230,京九铁路汉麻联络线等交通设施安全的防洪重任防洪保护人口<span className={styles.color}>32</span>
保护耕地 <span className={styles.color}>15</span>
</div>
</div>

View File

@ -7,4 +7,7 @@
.content{
font-size: 17px;
padding: 0 20px;
}
.color{
color: #409eff;
}

View File

@ -95,22 +95,22 @@ const ModalForm = ({ mode, record, onEdit, onSave, onSimilarSave }) => {
* @param {string} id 删除的id
*/
const deleteFile = (fileId) => {
console.log(fileId);
let filterFile = fileList.filter(item => item.response?.data?.fileId !== fileId);
console.log(fileId,fileList);
let filterFile = fileList.filter(item => item.fileId !== fileId);
setFileList(filterFile)
}
useEffect(() => {
if (mode != 'save') {
// const imgFile = record?.files?.map(o => ({
// name: o.name,
// response: {
// data: {
// filePath: o.filePath,
// fileId: o.fileId
// }
// },
// }))
setFileList(record?.files)
const imgFile = record?.files?.map(o => ({
name: o.fileName,
response: {
data: {
filePath: o.filePath,
fileId: o.fileId
}
},
}))
setFileList(imgFile)
}
}, [record, mode])
@ -223,6 +223,7 @@ const ModalForm = ({ mode, record, onEdit, onSave, onSimilarSave }) => {
onDrop={(info) => { console.log(info.dataTransfer.files); }}
fileList={fileList}
disabled={loading}
maxCount={1}
// onSuccess={handleSuccess}
>
<p className="ant-upload-text">点击或拖拽文件到此区域上传</p>
@ -231,6 +232,7 @@ const ModalForm = ({ mode, record, onEdit, onSave, onSimilarSave }) => {
</p>
</Dragger>
}
{JSON.stringify(fileList)}
<Row gutter={[16]}>
{
fileList.length > 0 && fileList.map(file => {
@ -238,9 +240,9 @@ const ModalForm = ({ mode, record, onEdit, onSave, onSimilarSave }) => {
<Col span={12}>
<div className="file-item" style={{ width: "75%",marginTop:5 }}>
<div className='file-description'>
{file?.fileName?.indexOf('.docx') > -1 ?
{file.name?.indexOf('.docx') > -1 ?
<div
onClick={() => { download(file.fileId) }}
onClick={() => { download(file.response?.data?.fileId) }}
style={{ cursor: 'pointer' }}
>
<FileWordOutlined
@ -248,35 +250,35 @@ const ModalForm = ({ mode, record, onEdit, onSave, onSimilarSave }) => {
/>
</div>
:
file?.fileName?.indexOf('.pdf') > -1 ?
file.name?.indexOf('.pdf') > -1 ?
<div
onClick={() => { viewPdf(file.fileId) }}
onClick={() => { viewPdf(file.response?.data?.fileId) }}
style={{ cursor: 'pointer' }}
>
<FilePdfOutlined style={{ fontSize: 40 }} />
</div>
:
file?.fileName?.indexOf('.zip') > -1 ?
file.name?.indexOf('.zip') > -1 ?
<div
onClick={() => { download(file.fileId) }}
onClick={() => { download(file.response?.data?.fileId) }}
style={{ cursor: 'pointer' }}
>
<FileZipOutlined style={{ fontSize: 40 }} />
</div>
:
file?.fileName?.indexOf('.xlsx') > -1 ?
file.name?.indexOf('.xlsx') > -1 ?
<div
onClick={() => { download(file.fileId) }}
onClick={() => { download(file.response?.data?.fileId) }}
style={{ cursor: 'pointer' }}
>
<FileExcelOutlined style={{ fontSize: 40 }} />
</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 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 />
</div>
</div>

View File

@ -48,7 +48,7 @@ const Page = () => {
title: '施行日期', key: 'implementationDate', dataIndex: 'implementationDate'
},
{
title: '上传时间', key: 'eventsDesc', dataIndex: 'eventsDesc'
title: '上传时间', key: 'uploadDate', dataIndex: 'uploadDate'
},
{
title: '附件', key: 'files', dataIndex: 'files',render:(v,r)=><a onClick={()=>download(v[0].fileId,v[0]?.fileName)}><PaperClipOutlined />{v[0]?.fileName}</a>

View File

@ -37,10 +37,11 @@ const Page = ({ uploadUrl, downloadUrl, type, getFormInfo, formJsonData }) => {
const [fileListHj, setFileHj] = useState({'files3': [],'files4': [],'files5': [],'files6': [],'files7': []})
const [url, setUrl] = useState('')
const [isModal, setIsModal] = useState(false)
const [loading, setLoading] = useState(false)
const getInfo = () => {
form.validateFields().then((values) => {
getFormInfo({ ...values, ...fileListHj })
form.resetFields()
getFormInfo({ ...fileListHj,...values, })
setFileList([])
}).catch((errorInfo) => {
console.log(errorInfo, 'error');
@ -73,8 +74,9 @@ const Page = ({ uploadUrl, downloadUrl, type, getFormInfo, formJsonData }) => {
// }
},
customRequest(e) {
setLoading(true);
httppostAddfile(uploadUrl, e).then(res => {
if(fileListHj[keys]){
fileListHj[keys].push(res.data)
}else{
@ -83,6 +85,8 @@ const Page = ({ uploadUrl, downloadUrl, type, getFormInfo, formJsonData }) => {
}
setFileHj({ ...fileListHj })
setLoading(false);
})
}
}
@ -131,7 +135,9 @@ const Page = ({ uploadUrl, downloadUrl, type, getFormInfo, formJsonData }) => {
}
useEffect(() => {
setFileHj(formJsonData)
form.setFieldsValue(formJsonData)
}, [])
return (
<Form form={form} onFinish={onFinish} >
@ -146,7 +152,7 @@ const Page = ({ uploadUrl, downloadUrl, type, getFormInfo, formJsonData }) => {
label='保管人员'
name='custodian'
>
<Input />
<Input disabled={type == 'view'}/>
</Form.Item>
</Col>
<Col span={10}>
@ -154,7 +160,7 @@ const Page = ({ uploadUrl, downloadUrl, type, getFormInfo, formJsonData }) => {
label='保管地点'
name='storageLocation'
>
<Input />
<Input disabled={type == 'view'}/>
</Form.Item>
</Col>
</Row>
@ -170,12 +176,12 @@ const Page = ({ uploadUrl, downloadUrl, type, getFormInfo, formJsonData }) => {
label='附件'
name='files'
>
<Dragger {...props(item1.key)}>
{type !== 'view' &&<Dragger {...props(item1.key)} disabled={type == 'view'}>
<p className="ant-upload-drag-icon">
<InboxOutlined />
</p>
<p className="ant-upload-text">点击或将文件拖拽到这里上传 支持扩展名jpegpng</p>
</Dragger>
</Dragger>}
<div className='flex'>
{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" }}>
@ -201,7 +207,7 @@ const Page = ({ uploadUrl, downloadUrl, type, getFormInfo, formJsonData }) => {
</Row>))}
<div className="flex flex-end" style={{ marginTop: 10, justifyContent: "flex-end" }}>
<Button type="" style={{ marginRight: 10 }} onClick={cancel}>取消</Button>
<Button type="primary" onClick={getInfo}>确定</Button>
<Button type="primary" onClick={getInfo} loading={loading}>确定</Button>
</div>
</Form >

View File

@ -1,4 +1,85 @@
const treeData = [
{
value: '行政处理',
title: '行政处理',
children: [
{
value: '责令停止违法行为',
title: '责令停止违法行为',
},
{
value: '责令补办许可手续',
title: '责令补办许可手续',
},
{
value: '责令限期拆除',
title: '责令限期拆除',
},
{
value: '责令采取补救措施',
title: '责令采取补救措施',
},
{
value: '责令停止施工',
title: '责令停止施工',
},
{
value: '责令赔偿损失',
title: '责令赔偿损失',
},
],
},
{
value: '行政处罚',
title: '行政处罚',
children: [
{
value: '警告',
title: '警告',
},
{
value: '罚款',
title: '罚款',
},
{
value: '没收违法所得、非法财产',
title: '没收违法所得、非法财产',
},
{
value: '责令停产停业',
title: '责令停产停业',
},
{
value: '暂扣许可证、执照',
title: '暂扣许可证、执照',
},
{
value: '吊销许可证、执照',
title: '吊销许可证、执照',
},
],
},
{
value: '行政强制措施',
title: '行政强制措施',
children: [
{
value: '查封或扣押设施',
title: '查封或扣押设施',
},
{
value: '查封或扣罚财务',
title: '查封或扣罚财务',
},
{
value: '其他',
title: '其他',
},
],
},
];
const basicData = [
{
label: '填报人',
@ -76,7 +157,7 @@ const basicData = [
},
{
label: '违法时间',
key: 'IllegalDate',
key: 'illegalDate',
type: 'DatePicker',
span: 12
},
@ -144,14 +225,17 @@ const clqkData = [
{
label: '处理依据',
key: 'treatmentBasis',
type: 'input',
type: 'TreeSelect',
span: 12,
treeData:[],
fieldNames:{label: 'legalName', value: 'legalName', children: 'children'}
},
{
label: '处理措施',
key: 'treatmentMeasure',
type: 'Select',
span: 12
type: 'TreeSelect',
span: 12,
treeData:treeData
},
{
label: '移送处理情况',
@ -188,6 +272,7 @@ const clqkData = [
{
label: '直接损失金额(万元)',
key: 'directLossAmount',
labelCol:{span:7},
type: 'input',
span: 12
},

View File

@ -33,11 +33,25 @@ const items = [
const Page = ({ mode, onCrudSuccess,record,submit }) => {
const [formData,setFormData] =useState({})
const [clqkDataConfig,setConfig] =useState([])
const [recordData,setRecord] =useState({})
// debugger;
const [key, setKeys] = useState('1')
const onChange = (key) => {
const onChange = async(key) => {
console.log(key);
setKeys(key)
if(key == 2){
const res = await httpget(apiurl.szzf.clyj.tree)
const arr = clqkData.map(item=>{
if(item.key == 'treatmentBasis'){
item.treeData = res.data
}
return item
})
setConfig(arr)
}
};
const getFormInfo = (e) => {
if(!e){
@ -48,7 +62,7 @@ const Page = ({ mode, onCrudSuccess,record,submit }) => {
...formData,
...e,
caseDate: dayjs(e.caseDate).format("YYYY-MM-DD HH:mm:ss"),
IllegalDate: e.IllegalDate ? dayjs(e.IllegalDate).format("YYYY-MM-DD HH:mm:ss") : e.IllegalDate,
illegalDate: e.illegalDate ? dayjs(e.v).format("YYYY-MM-DD HH:mm:ss") : e.illegalDate,
}
if (mode == 'save') {
@ -80,7 +94,8 @@ const Page = ({ mode, onCrudSuccess,record,submit }) => {
}
useEffect(()=>{
if(mode == 'edit' || mode =='view'){
httpget(apiurl.szzf.ajdj.detail + record.id).then(res=>{
httpget(apiurl.szzf.ajdj.detail + record.id).then(async res=>{
let obj = {
createName: localStorage.getItem('userName'),
createTime: dayjs().format('YYYY-MM-DD HH:mm:ss'),
@ -89,12 +104,12 @@ const Page = ({ mode, onCrudSuccess,record,submit }) => {
if(res.data?.caseDate){
obj.caseDate=dayjs(res.data.caseDate)
}
// if(res.data?.illegalDate){
// obj.illegalDate=dayjs(res.data.illegalDate)
// }
if(res.data.IllegalDate){
obj.IllegalDate = dayjs(res.data.IllegalDate)
if(res.data?.illegalDate){
obj.illegalDate=dayjs(res.data.illegalDate)
}
// if(res.data.IllegalDate){
// obj.IllegalDate = dayjs(res.data.IllegalDate)
// }
setFormData({...res.data,...obj})
})
@ -113,7 +128,7 @@ const Page = ({ mode, onCrudSuccess,record,submit }) => {
<Tabs defaultActiveKey="1" items={items} onChange={onChange} />
<>
{key == 1 && <BascForm formJson={basicData} formJsonData={formData} fileKey='files1'type={mode} getFormInfo={getFormInfo} uploadUrl={apiurl.szzf.ajdj.upload} downloadUrl={apiurl.szzf.ajdj.download}></BascForm>}
{key == 2 && <BascForm formJson={clqkData} fileKey='files2' formJsonData={formData} type={mode} getFormInfo={getFormInfo} uploadUrl={apiurl.szzf.ajdj.upload} downloadUrl={apiurl.szzf.ajdj.download}></BascForm>}
{key == 2 && <BascForm formJson={clqkDataConfig} fileKey='files2' formJsonData={formData} type={mode} getFormInfo={getFormInfo} uploadUrl={apiurl.szzf.ajdj.upload} downloadUrl={apiurl.szzf.ajdj.download}></BascForm>}
{key == 3 && <BascForm formJson={xzfy} formJsonData={formData} type={mode} getFormInfo={getFormInfo} uploadUrl={apiurl.szzf.ajdj.upload} downloadUrl={apiurl.szzf.ajdj.download}></BascForm>}
{key == 4 && <Bajz formJson={xzfy} formJsonData={formData} type={mode} getFormInfo={getFormInfo} uploadUrl={apiurl.szzf.ajdj.upload} downloadUrl={apiurl.szzf.ajdj.download}></Bajz>}
{key == 5 && <Lsyx formJson={xzfy} formJsonData={formData} type={mode} getFormInfo={getFormInfo} uploadUrl={apiurl.szzf.ajdj.upload} downloadUrl={apiurl.szzf.ajdj.download}></Lsyx>}

View File

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

View File

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

View File

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

View File

@ -103,7 +103,7 @@ const ModalForm = ({ mode, record, onEdit, onSave, onSimilarSave }) => {
}
useEffect(() => {
if (mode != 'save') {
const imgFile = record?.files?.map(o => ({
const imgFile = record?.files?.map(o => ({
name: o.fileName,
response: {
data: {
@ -178,6 +178,7 @@ const ModalForm = ({ mode, record, onEdit, onSave, onSimilarSave }) => {
onDrop={(info) => { console.log(info.dataTransfer.files); }}
fileList={fileList}
disabled={loading}
maxCount={1}
// onSuccess={handleSuccess}
>
<p className="ant-upload-text">点击或拖拽文件到此区域上传</p>
@ -272,7 +273,7 @@ const ModalForm = ({ mode, record, onEdit, onSave, onSimilarSave }) => {
border: 0,
marginTop: 20,
}}
src={`${process.env.PUBLIC_URL}/static/pdf/web/viewer.html?file=${encodeURIComponent(`/gunshiApp/xyt/projectEvents/file/download/${iframeSrc}`)}`}
src={`${process.env.PUBLIC_URL}/static/pdf/web/viewer.html?file=${encodeURIComponent(`/gunshiApp/tsg/projectEvents/file/download/${iframeSrc}`)}`}
/>
</Modal>
</>

View File

@ -21,4 +21,4 @@
color: '#000';
padding: 10px;
background: url(../../../../public/assets/images/four.png) 0 0 no-repeat;
}
}

View File

@ -1,6 +1,6 @@
export default function jgOption(data1) {
console.log("123",data1);
console.log("123", data1);
const one = `${process.env.PUBLIC_URL}/assets/images/one.png`;
const two = `${process.env.PUBLIC_URL}/assets/images/two.png`;
const three = `${process.env.PUBLIC_URL}/assets/images/three.png`;
@ -8,13 +8,12 @@ export default function jgOption(data1) {
return {
series: [{
type: 'tree',
id: 0,
name: 'tree1',
data: data1,
top: '10%',
left: '0%',
left: '10%',
bottom: '20%',
right: '25%',
right: '30%',
avoidLabelOverlap: true,//防止标签重叠
roam: true, //移动+缩放 'scale' 或 'zoom':只能够缩放。 'move' 或 'pan':只能够平移。
scaleLimit:{ //缩放比例
@ -22,7 +21,7 @@ export default function jgOption(data1) {
max:4,//最大的缩放值
},
layout: 'orthogonal',//树图布局orthogonal水平垂直方向radial径向布局 是指以根节点为圆心,每一层节点为环,一层层向外
orient: 'TB', //树形方向 TB为上下结构 LR为左右结构
orient: 'LR', //树形方向 TB为上下结构 LR为左右结构
// nodePadding: 100,//结点间距 (发现没用)
//layerPadding: 30,//连接线长度 (发现没用)
symbol: 'circle', //图形形状 rect方形 roundRect圆角 emptyCircle圆形 circle实心圆
@ -39,37 +38,39 @@ export default function jgOption(data1) {
// 每个节点对应的文本标签样式
show: true, // 是否显示标签
// rotate:90,
distance: 8, // 文本距离图形元素的距离
distance: 1, // 文本距离图形元素的距离
position: ['50%', '50%'], // 标签位置
verticalAlign: 'middle', // 文字垂直对齐方式默认自动topmiddlebottom
align: 'center', // 文字水平对齐方式默认自动leftrightcenter
fontSize: 16, // 字体大小
color: '#000', // 字体颜色
overflow: 'breakAll',
formatter: (params) => {
let newName = ''
let len = params.data.title.length
let strLen = (params.data.parentId === 0 || params.data.parentId === 100 ) ? 100 : 1 //一行显示几个字
let rowNum = Math.ceil(len / strLen)
if (len > strLen) {
// let newName = ''
// let len = params.data.title.length
// let strLen = (params.data.parentId === 0 || params.data.parentId === 100 ) ? 100 : 1 //一行显示几个字
// let rowNum = Math.ceil(len / strLen)
// if (len > strLen) {
for (let p = 0; p < rowNum; p++) {
let tempStr = ''
let start = p * strLen
let end = start + strLen
if (p == rowNum - 1) {
tempStr = params.data.title.substring(start, len)
} else {
tempStr = params.data.title.substring(start, end) + '\n'
}
newName += tempStr
}
} else {
newName = params.data.title
}
let n = newName
if (n.length > 16) {
n = n.slice(0, 16) + '...'
}
// for (let p = 0; p < rowNum; p++) {
// let tempStr = ''
// let start = p * strLen
// let end = start + strLen
// if (p == rowNum - 1) {
// tempStr = params.data.title.substring(start, len)
// } else {
// tempStr = params.data.title.substring(start, end) + '\n'
// }
// newName += tempStr
// }
// } else {
// newName = params.data.title
// }
// let n = newName
// if (n.length > 16) {
// n = n.slice(0, 16) + '...'
// }
let n = params.data.title;
let parentId = params.data.parentId
let userId = params.data.userId;
let str = parentId === 0 ? `{parent|${n}}` :
@ -78,22 +79,21 @@ export default function jgOption(data1) {
// parentId === 100 ? `<div class='org-parent1'>${n}</div>` : userId != undefined ? `<div class='org-parent3'>${n}</div>` : `<div class='org-parent2'>${n}</div>`
return str;
},
rich: {
parent: {
color: '#000',
padding: [20, 20],
padding: [15, 15],
backgroundColor: {
image:one
image: one
},
fontSize: 20
},
parent1: {
color: '#000',
padding: [10, 10],
backgroundColor: {
image:two
image: two
},
fontSize: 18
},
@ -101,20 +101,22 @@ export default function jgOption(data1) {
fontSize: 18,
color: '#000',
align: 'center',
padding: [10, 10],
padding: [10, 10],
backgroundColor: {
image: three,
repeat: "no-repeat",
repeat: "norepeat",
},
},
parent3: {
width:200,
color: '#000',
padding: [10, 10],
overflow:'break',
backgroundColor: {
image: four,
repeat: "no-repeat",
},
fontSize: 18
align: 'center',
fontSize: 18,
},
}
},
@ -128,7 +130,8 @@ export default function jgOption(data1) {
position: 'bottom',
rotate: 0,//标签旋转。
verticalAlign: 'middle',
align: 'center',
align: 'center',
position: ['50%', '50%'], // 标签位置
//文本框内文字超过6个字折行
// formatter: function(val) {
// let strs = val.name.split(''); //字符串数组
@ -146,7 +149,7 @@ export default function jgOption(data1) {
},
expandAndCollapse: true, //默认展开树形结构
animationDuration: 550,
animationDurationUpdate: 750
animationDurationUpdate: 750,
}]
};
}