Compare commits

..

7 Commits

Author SHA1 Message Date
李神峰 c4ba002e9c Merge branch 'lsf-dev' 2024-09-27 17:51:21 +08:00
xielei 12125356f0 页面搭建 2024-09-27 15:06:28 +08:00
xielei 03d107be65 页面搭建 2024-09-27 14:50:26 +08:00
xielei be3e002cda 页面搭建 2024-09-27 14:38:23 +08:00
xielei 6d0a3017f6 页面搭建 2024-09-27 10:17:59 +08:00
xielei 2c86feeebb Merge branch 'master' of http://10.0.41.100:3000/lishenfeng/tsg-web 2024-09-27 10:16:02 +08:00
xielei b15ec4556a 页面搭建 2024-09-27 10:15:58 +08:00
26 changed files with 250 additions and 156 deletions

View File

@ -74,6 +74,8 @@ const DashboardLayout: React.FC = () => {
const location = useLocation();
const navigate = useNavigate();
// debugger;
console.log(location.pathname);
const pathname = location.pathname;
const dispatch = useDispatch<Dispatch>();

View File

@ -209,7 +209,9 @@ code {
.flex-end{
justify-content: flex-end;
}
.align-center{
align-items: center;
}
.ellipsis1 {
overflow:hidden;/*内容超出后隐藏*/
text-overflow:ellipsis;/*超出内容显示为省略号*/

View File

@ -1,8 +1,6 @@
import { MenuItem } from "../_";
export function findMenu(menus: MenuItem[], pathname: string) {
//document.title = TITLE;
if (!menus) {
return [];
}

View File

@ -87,7 +87,7 @@ const ModalForm = ({ mode, record,onEdit,onSave,onSimilarSave }) => {
}
if (mode === 'save') {
values.fileIds = fileIds
debugger
// debugger
onSave(apiurl.fxzb.qswl.zq.save,values)
}
if (mode === "similarSave") {

View File

@ -112,7 +112,7 @@ export default function Xmzlmb() {
stationCodes: code,
...searchVal
}
debugger
// debugger
getTableData(params)
getTable2Data(params)
}

View File

@ -76,7 +76,7 @@ console.log("record",record);
let oldFiles = fileList.map(item => ({fileId:item.response?.data?.fileId}) )
if (mode === 'zg') {
values.rectifyFiles = oldFiles;
debugger
// debugger
onUpdate(apiurl.rcgl.jdkh.khwtzg.finish,{...record,...values})
}

View File

@ -36,7 +36,7 @@ export default function Zrtx({dataInfo}) {
}
const command = (type) => (params) => {
debugger;
// debugger;
if (type === 'save') {
refModal.current.showSave(dataInfo);
} else if (type === 'edit') {

View File

@ -20,7 +20,7 @@ const Page = () => {
<div className={styles.title}>
<Image src={title} />转移路线示意图
</div>
<div style={{display:'flex',justifyContent:'center'}}>
<div style={{display:'flex',justifyContent:'center',height: 'calc(100% - 40px)',alignItems:'center'}}>
<Image src={zd} width='80%' preview={false} />
</div>

View File

@ -1,7 +1,7 @@
.title{
font-size: 16px;
color: #000000;
width: 112px;
// width: 112px;
height: 32px
}
.content{

View File

@ -30,7 +30,7 @@ const ModalForm = ({ mode, record, onEdit, onSave, onSimilarSave }) => {
*/
const download = (params) => {
let downloadLink = document.createElement("a");
downloadLink.href = `http://local.gunshiiot.com:18083/gunshiApp/xyt/projectEvents/file/download/${params}`;
downloadLink.href = `http://local.gunshiiot.com:18083/gunshiApp/tsg/projectEvents/file/download/${params}`;
downloadLink.download = `${params.fileName}`;
downloadLink.style.display = "none";
// 将链接添加到页面中
@ -187,7 +187,7 @@ const ModalForm = ({ mode, record, onEdit, onSave, onSimilarSave }) => {
<Dragger
name='file'
// multiple
action="/gunshiApp/xyt/projectEvents/file/upload/singleSimple"
action="/gunshiApp/tsg/projectEvents/file/upload/singleSimple"
onChange={fileChange}
onDrop={(info) => { console.log(info.dataTransfer.files); }}
fileList={fileList}
@ -286,7 +286,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

@ -61,7 +61,7 @@ const Page = () => {
const download = (params) => {
let downloadLink = document.createElement("a");
downloadLink.href = `http://local.gunshiiot.com:18083/gunshiApp/xyt/projectEvents/file/download/${params}`;
downloadLink.href = `http://local.gunshiiot.com:18083/gunshiApp/tsg/projectEvents/file/download/${params}`;
downloadLink.download = `${params.fileName}`;
downloadLink.style.display = "none";
// 将链接添加到页面中
@ -87,6 +87,7 @@ const viewPdf = (params) => {
setPdfViewOPen(true)
}
useEffect(()=>{
const params = {
search: {
...searchVal,
@ -213,7 +214,7 @@ const viewPdf = (params) => {
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

@ -36,9 +36,9 @@ const ToolBar = ({ setSearchVal, onSave, storeData,role }) => {
format="YYYY-MM-DD HH:mm:ss"
/>
</Form.Item>
{searchBtn ? <Form.Item>
<Form.Item>
<Button type="primary" htmlType="submit">查询</Button>
</Form.Item> : null }
</Form.Item>
<Form.Item>
<Button onClick={() => form.resetFields()}>重置</Button>

View File

@ -38,7 +38,7 @@ const Page = () => {
const download = (params) => {
let downloadLink = document.createElement("a");
downloadLink.href = `http://local.gunshiiot.com:18083/gunshiApp/xyt/projectEvents/file/download/${params}`;
downloadLink.href = `http://local.gunshiiot.com:18083/gunshiApp/tsg/projectEvents/file/download/${params}`;
downloadLink.download = `${params.fileName}`;
downloadLink.style.display = "none";
// 将链接添加到页面中
@ -177,7 +177,7 @@ const onExport = () => {
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

@ -78,7 +78,7 @@ const ModalForm = ({ mode, record, onEdit, onSave, onSimilarSave }) => {
const onfinish = (values) => {
values.files = fileList.map(item => item.response?.data);
values.files = fileList.map(item => item.response?.data??item);
// values.eventsDate = values.eventsDate ? moment(values.eventsDate).format("YYYY-MM-DD 00:00:00") : ''
if (mode === 'edit') {
@ -144,7 +144,7 @@ const ModalForm = ({ mode, record, onEdit, onSave, onSimilarSave }) => {
</Col>
<Col span={12}>
<Form.Item label="法律性质" name="type" rules={[{ required: true }]}>
<Select allowClear style={{ width: '150px' }} options={[
<Select allowClear style={{ width: '100%' }} options={[
{ label: '宪法', value: 0 },
{ label: '法律', value: 1 },
{ label: '行政法规', value: 2 },
@ -171,7 +171,7 @@ const ModalForm = ({ mode, record, onEdit, onSave, onSimilarSave }) => {
]}
>
<Select allowClear style={{ width: '150px' }} options={[
<Select allowClear style={{ width: '100%' }} options={[
{ label: '尚未生效', value: 0 },
{ label: '有效', value: 1 },
{ label: '已修改', value: 2 },
@ -236,7 +236,7 @@ const ModalForm = ({ mode, record, onEdit, onSave, onSimilarSave }) => {
fileList.length > 0 && fileList.map(file => {
return (
<Col span={12}>
<div className="file-item" style={{ width: "75%" }}>
<div className="file-item" style={{ width: "75%",marginTop:5 }}>
<div className='file-description'>
{file?.fileName?.indexOf('.docx') > -1 ?
<div

View File

@ -1,7 +1,7 @@
import React, { Fragment, useRef, useMemo, useEffect, useState } from 'react';
import BasicCrudModal from '../../../components/crud/BasicCrudModal';
import { Table, Card, Modal, Form, Input, Button, Row, Col, Timeline, message, Tabs, Image } from 'antd';
import { FileWordOutlined, FilePdfOutlined, FileZipOutlined, FileExcelOutlined } from '@ant-design/icons';
import { FileWordOutlined, FilePdfOutlined, FileZipOutlined, PaperClipOutlined } from '@ant-design/icons';
import { useSelector } from 'react-redux';
import ToolBar from './toolbar';
import ModalForm from './form';
@ -10,6 +10,8 @@ import usePageTable from '../../../components/crud/usePageTable2';
import { createCrudService } from '../../../components/crud/_';
import { CrudOpRender_text } from '../../../components/crud/CrudOpRender';
import { render } from 'react-dom';
import { httpgetExport } from '../../../utils/request';
import { exportFile } from '../../../utils/tools';
const url = "http://223.75.53.141:9102/test.by-lyf.tmp"
const typeOb={0:'宪法',1:'法律',2:'行政法规',3:'督察法规',4:'司法解释',5:'地方性法规'}
@ -26,33 +28,33 @@ const Page = () => {
const [isFetch, setIsFetch] = useState(false)
const columns = [
{ title: '序号', key: 'inx', dataIndex: 'inx', width: 60, align: "center" },
{ title: '标题', key: 'name', dataIndex: 'name', width: 250, ellipsis: true },
{ title: '标题', key: 'name', dataIndex: 'name', ellipsis: true },
{
title: '制定机关', key: 'fillUnit', dataIndex: 'fillUnit', width: 140,
title: '制定机关', key: 'fillUnit', dataIndex: 'fillUnit',
},
{
title: '法律性质', key: 'type', dataIndex: 'type', width: 140,
title: '法律性质', key: 'type', dataIndex: 'type',
render: (value) => <span>{typeOb[value]}</span>,
},
{
title: '时效性', key: 'timeliness', dataIndex: 'timeliness', width: 300,render:(v)=><>
title: '时效性', key: 'timeliness', dataIndex: 'timeliness', render:(v)=><>
{timelinessOb[v]}
</>
},
{
title: '公布日期', key: 'announcementDate', dataIndex: 'announcementDate', width: 300
title: '公布日期', key: 'announcementDate', dataIndex: 'announcementDate'
},
{
title: '施行日期', key: 'implementationDate', dataIndex: 'implementationDate', width: 300
title: '施行日期', key: 'implementationDate', dataIndex: 'implementationDate'
},
{
title: '上传时间', key: 'eventsDesc', dataIndex: 'eventsDesc', width: 300
title: '上传时间', key: 'eventsDesc', dataIndex: 'eventsDesc'
},
{
title: '附件', key: 'files', dataIndex: 'files', width: 300,render:(v,r)=><a onClick={()=>viewPdf(v[0].fileId)}>{v[0]?.fileName}</a>
title: '附件', key: 'files', dataIndex: 'files',render:(v,r)=><a onClick={()=>download(v[0].fileId,v[0]?.fileName)}><PaperClipOutlined />{v[0]?.fileName}</a>
},
{
title: '操作', key: 'operation', width: 240, fixed: 'right', align: 'center',
title: '操作', key: 'operation',
render: (value, row, index) => (
<CrudOpRender_text
edit={true}
@ -87,7 +89,16 @@ const Page = () => {
refresh()
setIsFetch(!isFetch)
}
/**
* @description 文件下载
* @param {String} params 文件fileId
*/
const download = async(id, name) => {
var extension = name?.split('.').pop().toLowerCase();
httpgetExport(apiurl.zdgl.download+id).then(res => {
exportFile(name,res.data)
})
}
const viewPdf = (params) => {
setIframeSrc(params)
setPdfViewOPen(true)
@ -114,7 +125,7 @@ const Page = () => {
/>
</Card>
<div className="ant-card-body" style={{ padding: "20px 0 0 0" }}>
<Table columns={columns} rowKey="inx" {...tableProps} scroll={{ x: width, y: "calc( 100vh - 400px )" }} />
<Table columns={columns} rowKey="inx" {...tableProps} />
</div>
</div>

View File

@ -1,41 +1,53 @@
import React, { useEffect,useState } from 'react';
import React, { useEffect, useState } from 'react';
import { Form, Input, Button, DatePicker, Select } from 'antd';
import { DownOutlined, UpOutlined } from '@ant-design/icons'
import moment from 'moment';
const { RangePicker } = DatePicker;
const ToolBar = ({ setSearchVal, onSave, storeData,role }) => {
const ToolBar = ({ setSearchVal, onSave, storeData, role }) => {
const addBtn = role?.rule?.find(item => item.menuName == "新增");
const searchBtn = role?.rule?.find(item => item.menuName == "查询");
const [form] = Form.useForm();
const [showGj , setShowGj] =useState(false)
const [showGj, setShowGj] = useState(false)
const onFinish = (values) => {
let dateSo;
if (values.tm) {
dateSo = {
start: moment(values.tm[0]).format('YYYY-MM-DD HH:mm:ss'),
end: moment(values.tm[1]).format('YYYY-MM-DD HH:mm:ss')
if (values.announcementDate) {
// 公布时间
values.stmAd= values.announcementDate[0].format('YYYY-MM-DD HH:mm:ss')
values.etmAd= values.announcementDate[1].format('YYYY-MM-DD HH:mm:ss')
}
if (values.implementationDate) {
// 施行日期
values.stmIm= values.implementationDate[0].format('YYYY-MM-DD HH:mm:ss')
values.etmIm= values.implementationDate[0].format('YYYY-MM-DD HH:mm:ss')
}
delete values.tm
setSearchVal({...values});
if (values.uploadTime) {
// 上传日期
values.stmUd= values.uploadTime[0].format('YYYY-MM-DD HH:mm:ss')
values.etmUd= values.uploadTime[0].format('YYYY-MM-DD HH:mm:ss')
}
const opntios=[
{label:'宪法',value:0},
{label:'法律',value:1},
{label:'行政法规',value:2},
{label:'督察法规',value:3},
{label:'司法解释',value:4},
{label:'地方性法规',value:5},
delete values.announcementDate
delete values.implementationDate
delete values.uploadTime
setSearchVal({ ...values });
}
const opntios = [
{ label: '宪法', value: 0 },
{ label: '法律', value: 1 },
{ label: '行政法规', value: 2 },
{ label: '督察法规', value: 3 },
{ label: '司法解释', value: 4 },
{ label: '地方性法规', value: 5 },
]
const opntios1=[
{label:'尚未生效',value:0},
{label:'有效',value:1},
{label:'已修改',value:2},
{label:'已废止',value:3},
const opntios1 = [
{ label: '尚未生效', value: 0 },
{ label: '有效', value: 1 },
{ label: '已修改', value: 2 },
{ label: '已废止', value: 3 },
]
const styles={
const styles = {
fontFamily: '微软雅黑 Bold", "微软雅黑 Regular", 微软雅黑, sans-serif',
fontWeight: '700',
fontStyle: 'normal',
@ -43,17 +55,17 @@ const ToolBar = ({ setSearchVal, onSave, storeData,role }) => {
}
return (
<>
<div style={{display:'flex',justifyContent:'space-between'}}>
<div style={{ display: 'flex', justifyContent: 'space-between' }}>
<Form form={form} className='toolbarBox' layout="inline" onFinish={onFinish}>
<div style={{display:'flex'}}>
<div style={{ display: 'flex' }}>
<Form.Item label="标题" name="name">
<Input allowClear style={{width:'150px'}}/>
<Input allowClear style={{ width: '150px' }} />
</Form.Item>
<Form.Item label="制定机关" name="fillUnit">
<Input allowClear style={{width:'150px'}}/>
<Input allowClear style={{ width: '150px' }} />
</Form.Item>
<Form.Item label="法律性质" name="type">
<Select allowClear style={{width:'150px'}} options={opntios}/>
<Select allowClear style={{ width: '150px' }} options={opntios} />
</Form.Item>
<Form.Item>
<Button type="primary" htmlType="submit">查询</Button>
@ -68,15 +80,15 @@ const ToolBar = ({ setSearchVal, onSave, storeData,role }) => {
<Form.Item>
<Button onClick={onSave}>新增</Button>
</Form.Item>
:null
: null
}
<Form.Item>
<div style={styles} onClick={()=>setShowGj(!showGj)}>高级搜索 {!showGj&&<DownOutlined />} {showGj&&<UpOutlined />}</div>
<div style={styles} onClick={() => setShowGj(!showGj)}>高级搜索 {!showGj && <DownOutlined />} {showGj && <UpOutlined />}</div>
</Form.Item>
</div>
{showGj&&<div style={{display:'flex'}}>
{showGj && <div style={{ display: 'flex' }}>
<Form.Item label="时效性" name="timeliness">
<Select allowClear style={{width:'150px'}} options={opntios1}/>
<Select allowClear style={{ width: '150px' }} options={opntios1} />
</Form.Item>
<Form.Item label="公布日期" name="announcementDate">
<RangePicker allowClear />
@ -84,7 +96,7 @@ const ToolBar = ({ setSearchVal, onSave, storeData,role }) => {
<Form.Item label="施行日期" name="implementationDate">
<RangePicker allowClear />
</Form.Item>
<Form.Item label="上传时间" name="name">
<Form.Item label="上传时间" name="uploadTime">
<RangePicker allowClear />
</Form.Item>
</div>}

View File

@ -176,9 +176,9 @@ const Page = ({ uploadUrl, downloadUrl, type, getFormInfo, formJsonData }) => {
</p>
<p className="ant-upload-text">点击或将文件拖拽到这里上传 支持扩展名jpegpng</p>
</Dragger>
<div>
<div className='flex'>
{fileListHj?.[item1.key]?.map((item) => {
return <div className='flex align-center' style={{ 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" }}>
<div style={{ width: 40, height: 40, display: "flex", alignItems: 'center' }}>
{checkMediaType(item.fileName) == 'image' && <Image
height={40}

View File

@ -56,7 +56,8 @@ const basicData = [
key: 'caseAddress',
type: 'input',
span: 12,
required: true
required: true,
addonAfter:'选择地点'
},
{
label: '案件来源',

View File

@ -31,7 +31,7 @@ const items = [
];
const Page = ({ mode, onCrudSuccess,record }) => {
const Page = ({ mode, onCrudSuccess,record,submit }) => {
const [formData,setFormData] =useState({})
// debugger;
const [key, setKeys] = useState('1')
@ -40,6 +40,10 @@ const Page = ({ mode, onCrudSuccess,record }) => {
setKeys(key)
};
const getFormInfo = (e) => {
if(!e){
submit()
return;
}
let params = {
...formData,
...e,
@ -57,7 +61,7 @@ const Page = ({ mode, onCrudSuccess,record }) => {
httppost(apiurl.szzf.ajdj.add, params).then(res => {
if (res.code == 200) {
message.success('新增成功')
onCrudSuccess()
submit()
} else {
message.error(res.description)
}
@ -68,24 +72,41 @@ const Page = ({ mode, onCrudSuccess,record }) => {
httppost(apiurl.szzf.ajdj.edit, params).then(res => {
if (res.code == 200) {
message.success('编辑成功')
onCrudSuccess()
submit()
} else {
message.error(res.description)
}
})
}
useEffect(()=>{
if(mode == 'edit' || mode =='view'){
httpget(apiurl.szzf.ajdj.detail + record.id).then(res=>{
let obj = {
createName: localStorage.getItem('userName'),
createTime: dayjs().format('YYYY-MM-DD HH:mm:ss'),
createBy:localStorage.getItem('userId')
}
if(res.data.caseDate){
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)
}
setFormData({...res.data,...obj})
})
}else if(mode == 'save'){
let obj = {
createName: localStorage.getItem('userName'),
createTime: dayjs().format('YYYY-MM-DD HH:mm:ss'),
createBy:localStorage.getItem('userId'),
}
setFormData({...obj})
}
},[])
return (
<>

View File

@ -30,28 +30,28 @@ const Page = () => {
const [isFetch, setIsFetch] = useState(false)
const columns = [
{ title: '序号', key: 'inx', dataIndex: 'inx', width: 60, align: "center" },
{ title: '填报时间', key: 'createTime', dataIndex: 'createTime', width: 250, ellipsis: true },
{ title: '填报时间', key: 'createTime', dataIndex: 'createTime', ellipsis: true },
{
title: '案件名称', key: 'caseName', dataIndex: 'caseName', width: 140,
title: '案件名称', key: 'caseName', dataIndex: 'caseName',
},
{
title: '案件编号', key: 'caseId', dataIndex: 'caseId', width: 140,
title: '案件编号', key: 'caseId', dataIndex: 'caseId',
},
{
title: '发现时间', key: 'caseDate', dataIndex: 'caseDate', width: 300,
title: '发现时间', key: 'caseDate', dataIndex: 'caseDate',
},
{
title: '案件类型', key: 'caseType', dataIndex: 'caseType', width: 300,
title: '案件类型', key: 'caseType', dataIndex: 'caseType',
render: (value) => <span>{caseTypeOb[value]}</span>,
},
{
title: '案件来源', key: 'caseSource', dataIndex: 'caseSource', width: 300,
title: '案件来源', key: 'caseSource', dataIndex: 'caseSource',
render: (value) => <span>{caseSourceOb[value]}</span>,
},
{
title: '操作', key: 'operation', width: 240, fixed: 'right', align: 'center',
title: '操作', key: 'operation', width: 240,
render: (value, row, index) => (
<CrudOpRender_text
edit={true}
@ -121,7 +121,7 @@ const Page = () => {
/>
</Card>
<div className="ant-card-body" style={{ padding: "20px 0 0 0" }}>
<Table columns={columns} rowKey="inx" {...tableProps} scroll={{ x: width, y: "calc( 100vh - 400px )" }} />
<Table columns={columns} rowKey="inx" {...tableProps} />
</div>
</div>

View File

@ -142,9 +142,9 @@ const Page = ({ uploadUrl, downloadUrl, type, getFormInfo, formJsonData }) => {
</p>
<p className="ant-upload-text">点击或将文件拖拽到这里上传 支持扩展名jpegpng</p>
</Dragger>
<div>
<div className='flex'>
{fileListHj?.[item1.key]?.map((item) => {
return <div className='flex align-center' style={{ 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" }}>
<div style={{ width: 40, height: 40, display: "flex", alignItems: 'center' }}>
{checkMediaType(item.fileName) == 'image' && <Image
height={40}

View File

@ -67,7 +67,7 @@ const Page = ({ setTreeSelect }) => {
};
const onSearch = (value) => {
debugger;
// debugger;
setSearchValue(value);
setAutoExpandParent(true);
@ -112,18 +112,49 @@ const Page = ({ setTreeSelect }) => {
return loop(data);
}, [searchValue, data]);
const getFirstChild=(val)=> {
let res = {};
if (JSON.stringify(res) != "{}") {
return;//如果res不再是空对象退出递归
} else {
//遍历数组
for (let i = 0; i < val.length; i++) {
//如果当前的isleaf是true,说明是叶子节点把当前对象赋值给res,并return终止循环
if (!val[i].children) {
res = val[i];
break;
}else {//否则的话递归当前节点的children
getFirstChild(val[i].children);
}
}
return res
}
}
useEffect(() => {
httpget(apiurl.szzf.clyj.tree).then(res => {
setData(res.data)
// setTreeSelect(
// [{
// key: res.data[0].id,
// name: res.data[0].legalName,
// }]
// )
// setSelect([res.data[0].id])
// getFirstChild(res.data)
setSelect([getFirstChild(res.data).id]);
setTreeSelect(
[{
key: res.data[0].id,
name: res.data[0].legalName,
key: getFirstChild(res.data).id,
name: getFirstChild(res.data).legalName,
}]
)
setSelect([res.data[0].id])
})
}, [])

View File

@ -32,8 +32,9 @@ const FormZdy = ({ fileKey,typeName = "ddForm", formJson, getFormInfo, type, for
}
const getInfo = () => {
form.validateFields().then((values) => {
// debugger;
getFormInfo({ ...values, [fileKey]: fileList, fileIds: fileList.map(item => item.fileId) })
form.resetFields()
setFileList([])
}).catch((errorInfo) => {
console.log(errorInfo, 'error');
@ -51,7 +52,7 @@ const FormZdy = ({ fileKey,typeName = "ddForm", formJson, getFormInfo, type, for
// window.open('http://local.gunshiiot.com:18083/xintankou/api/file/preview/104')
// }
const deleteFile = (e) => {
debugger;
// debugger;
let arr = fileList.filter(item => item.fileId !== e)
setFileList(arr)
}
@ -71,7 +72,6 @@ const FormZdy = ({ fileKey,typeName = "ddForm", formJson, getFormInfo, type, for
},
customRequest(e) {
setFileLisUp([...fileListUp, e.file])
debugger
httppostAddfile(uploadUrl, e).then(res => {
setFileList([...fileList, res.data])
})
@ -120,8 +120,11 @@ const FormZdy = ({ fileKey,typeName = "ddForm", formJson, getFormInfo, type, for
exportFile(name,res.data)
})
}
useEffect(()=>{
form.resetFields()
},[])
useEffect(() => {
// form.resetFields()
let formType = type
if (type = 'edit') {
formType = 2
@ -130,6 +133,7 @@ const FormZdy = ({ fileKey,typeName = "ddForm", formJson, getFormInfo, type, for
formType = 1
}
if (type == 'save') {
form.setFieldsValue(formJsonData)
formType = 0
}
if (formType == 1 || formType == 2 || formType == 3) {
@ -164,7 +168,7 @@ const FormZdy = ({ fileKey,typeName = "ddForm", formJson, getFormInfo, type, for
name={item.key}
rules={[{ required: item.required, message: '请输入' + item.label }]}
>
<Input disabled={type == 'view' || item.disabled} placeholder={item.placeholder} />
<Input disabled={type == 'view' || item.disabled} placeholder={item.placeholder} addonAfter={item.addonAfter}/>
</Form.Item>}
{item.type == "title" &&
<Form.Item
@ -271,7 +275,7 @@ const FormZdy = ({ fileKey,typeName = "ddForm", formJson, getFormInfo, type, for
</Dragger>}
<div className='flex' >
{fileList?.map((item) => {
return <div className='flex align-center file-item' style={{ 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" }}>
<div style={{ width: 40, height: 40, display: "flex", alignItems: 'center' }}>
{checkMediaType(item.fileName) == 'image' && <Image
height={40}

View File

@ -79,8 +79,8 @@ const ModalForm = ({ mode, record, onEdit, onSave, onSimilarSave }) => {
const onfinish = (values) => {
let oldFiles = fileList.map(item => (item.response?.data))
debugger
let oldFiles = fileList.map(item => (item.response?.data??item))
// debugger
if (mode === 'edit') {
values.files = oldFiles;
values.id = record.id;
@ -138,7 +138,7 @@ const ModalForm = ({ mode, record, onEdit, onSave, onSimilarSave }) => {
</Col>
<Col span={12}>
<Form.Item label="制度类型" name="type" rules={[{ required: true }]}>
<Select allowClear style={{ width: '150px' }} options={opntios} />
<Select allowClear style={{ width: '100%' }} options={opntios} />
</Form.Item>
</Col>
<Col span={12}>
@ -191,7 +191,7 @@ const ModalForm = ({ mode, record, onEdit, onSave, onSimilarSave }) => {
fileList.length > 0 && fileList.map(file => {
return (
<Col span={12}>
<div className="file-item" style={{ width: "75%" }}>
<div className="file-item" style={{ width: "75%",marginTop:5 }}>
<div className='file-description'>
{file.name.indexOf('.docx') > -1 ?
<div

View File

@ -1,7 +1,7 @@
import React, { Fragment, useRef, useMemo, useEffect, useState } from 'react';
import BasicCrudModal from '../../../components/crud/BasicCrudModal';
import { Table, Card, Modal, Form, Input, Button, Row, Col, Timeline, message, Tabs, Image } from 'antd';
import { FileWordOutlined, FilePdfOutlined, FileZipOutlined, FileExcelOutlined } from '@ant-design/icons';
import { FileWordOutlined, FilePdfOutlined, FileZipOutlined, PaperClipOutlined } from '@ant-design/icons';
import { useSelector } from 'react-redux';
import ToolBar from './toolbar';
import ModalForm from './form';
@ -9,6 +9,8 @@ import apiurl from '../../../service/apiurl';
import usePageTable from '../../../components/crud/usePageTable2';
import { createCrudService } from '../../../components/crud/_';
import { CrudOpRender_text } from '../../../components/crud/CrudOpRender';
import { httpgetExport } from '../../../utils/request';
import { exportFile } from '../../../utils/tools';
const url = "http://223.75.53.141:9102/test.by-lyf.tmp"
const obj={0:"党支部工作制度",1:"行政工作制度",2:"部门工作制度",3:"安全管理制度",4:"工程管理制度",5:"技术规程",6:"岗位责任制"}
@ -24,24 +26,24 @@ const Page = () => {
const [isFetch, setIsFetch] = useState(false)
const columns = [
{ title: '序号', key: 'inx', dataIndex: 'inx', width: 60, align: "center" },
{ title: '标题', key: 'name', dataIndex: 'name', width: 250, ellipsis: true },
{ title: '标题', key: 'name', dataIndex: 'name', ellipsis: true },
{
title: '制度类型', key: 'type', dataIndex: 'type', width: 140,render:(v)=><>{obj[v]}</>
title: '制度类型', key: 'type', dataIndex: 'type',render:(v)=><>{obj[v]}</>
},
{
title: '发布日期', key: 'releaseDate', dataIndex: 'releaseDate', width: 300
title: '发布日期', key: 'releaseDate', dataIndex: 'releaseDate'
},
{
title: '发布单位', key: 'fillUnit', dataIndex: 'fillUnit', width: 300
title: '发布单位', key: 'fillUnit', dataIndex: 'fillUnit'
},
{
title: '上传时间', key: 'uploadDate', dataIndex: 'uploadDate', width: 300
title: '上传时间', key: 'uploadDate', dataIndex: 'uploadDate'
},
{
title: '附件', key: 'files', dataIndex: 'files', width: 300,render:(v,r)=><a onClick={()=>viewPdf(v[0].fileId)}>{v[0]?.fileName}</a>
title: '附件', key: 'files', dataIndex: 'files', render:(v,r)=><a onClick={()=>download(v[0].fileId,v[0]?.fileName)}><PaperClipOutlined />{v[0]?.fileName}</a>
},
{
title: '操作', key: 'operation', width: 240, fixed: 'right', align: 'center',
title: '操作', key: 'operation', fixed: 'right', align: 'center',
render: (value, row, index) => (
<CrudOpRender_text
edit={true}
@ -76,7 +78,16 @@ const Page = () => {
refresh()
setIsFetch(!isFetch)
}
/**
* @description 文件下载
* @param {String} params 文件fileId
*/
const download = async(id, name) => {
var extension = name?.split('.').pop().toLowerCase();
httpgetExport(apiurl.zdgl.download+id).then(res => {
exportFile(name,res.data)
})
}
const viewPdf = (params) => {
setIframeSrc(params)
setPdfViewOPen(true)
@ -103,7 +114,7 @@ const Page = () => {
/>
</Card>
<div className="ant-card-body" style={{ padding: "20px 0 0 0" }}>
<Table columns={columns} rowKey="inx" {...tableProps} scroll={{ x: width, y: "calc( 100vh - 400px )" }} />
<Table columns={columns} rowKey="inx" {...tableProps} />
</div>
</div>

View File

@ -10,15 +10,15 @@ const ToolBar = ({ setSearchVal, onSave, storeData, role }) => {
const [form] = Form.useForm();
const [showGj, setShowGj] = useState(false)
const onFinish = (values) => {
let dateSo;
if (values.tm) {
dateSo = {
start: moment(values.tm[0]).format('YYYY-MM-DD HH:mm:ss'),
end: moment(values.tm[1]).format('YYYY-MM-DD HH:mm:ss')
let dataSo;
if (values.releaseDate) {
dataSo = {
stm: moment(values.releaseDate[0]).format('YYYY-MM-DD HH:mm:ss'),
etm: moment(values.releaseDate[1]).format('YYYY-MM-DD HH:mm:ss')
}
}
delete values.tm
setSearchVal({ ...values, dateSo });
delete values.releaseDate
setSearchVal({ ...values, ...dataSo });
}
const opntios = [