Compare commits

..

No commits in common. "c68b14203183c16f1bfe61cfb286b58b02adc36a" and "6f136fc17e44eb0028b3628bde5759064aa63bcb" have entirely different histories.

62 changed files with 158 additions and 1179 deletions

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.5 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 5.1 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 5.4 KiB

View File

@ -301,121 +301,3 @@ background-color: #ecf2f9 !important;
.nonebox .ant-card-body {
padding: 5px 20px !important;
}
.ant-radio-button-wrapper{
height:28px;
line-height:26px;
border: 1px solid #0893FF !important;
color:#0893FF;
&.ant-radio-button-wrapper-checked{
color: #fff !important;
}
.ant-radio-button-checked{
background:#0893FF;
border-color:#0893FF !important;
}
}
.normalModalStyle{
width: 100%;
// min-height: 600px;
background-color: #fff;
.ant-card-body{
.ant-table-thead{
.ant-table-cell{
background-color: #e2edfd !important;
}
}
}
.normalModalStyle_title{
height: 40px;
background-color: #f7f7f7;
border-radius: 10px 10px 0 0 ;
display: flex;
align-items: center;
color: #007afd;
font-size: 16px;
font-weight: 500;
margin-bottom: 10px;
.normalModalStyle_title_icon{
margin: 0 10px 0 15px;
width: 5px;
height: 16px;
background: #3477f5;
}
.normalModalStyle_title_cancel{
margin-right: 15px;
flex: 1;
display: flex;
flex-direction: row-reverse;
}
}
}
.home_modal{
.ant-modal-content{
border-radius: 10px;
}
}
.homeModal1{
// .ant-radio-button-wrapper:not(:first-child)::before{
// background-color: red;
// }
display: flex;
flex-direction: column;
.homeModal1_content{
height: 504px;
display: flex;
padding: 5px 20px 20px 20px;
.homeModal1_content_lf{
width: 40%;
height: 100%;
}
.homeModal1_content_rf{
width: 60%;
height: 100%;
}
}
}
.homeModal2{
display: flex;
flex-direction: column;
.homeModal2_content{
height: 504px;
display: flex;
padding: 5px 20px 20px 20px;
}
}
.colorTable{
.ant-table-thead{
th{
height: 40px !important;
background-color: #e2edfd !important;
}
}
.ant-table-tbody{
.ant-table-measure-row{
td{
padding: 0 !important;
}
}
tr:nth-child(odd) {
td{
background-color: #f5f8fe !important;
}
}
}
}

View File

@ -424,9 +424,6 @@ export async function loadMenu(): Promise<MenuItem[]> {
{
id: id(), title: '供水能力分析', path: '/mgr/szydd/gsnlfx',
},
{
id: id(), title: '调度记录', path: '/mgr/szydd/diaodu',
},
{
id: id(), title: '供水统计分析', path: '/mgr/szydd/gstjfx',
},

View File

@ -1140,14 +1140,6 @@ const apiurl = {
upload:service_fxdd + '/SzRegulatoryFramework/file/upload/singleSimple',
download:service_fxdd + '/SzRegulatoryFramework/file/download/',
list:service_fxdd + '/SzRegulatoryFramework/page'
},
ddjl:{
page: service_fxdd + '/dispatchRecord/page',
save: service_fxdd + '/dispatchRecord/insert',
edit: service_fxdd + '/dispatchRecord/update',
del: service_fxdd + '/dispatchRecord/del',
export: service_fxdd + '/dispatchRecord/export',
}
}

View File

@ -40,12 +40,12 @@ async function send(url, options) {
}
const { code } = res.data;
// if (code === 401) {
// // debugger;
// //window.location.href = '/mgr/home';// /mgr/home /login
// window.location.href = '/tsg/#/login';
// // window.location.hash = '#/login';
// }
if (code === 401) {
//debugger;
//window.location.href = '/mgr/home';// /mgr/home /login
window.location.href = '/xfflood/#/login';
// window.location.hash = '#/login';
}
return res.data;
} catch (e) {
//message.error(e);

View File

@ -111,8 +111,6 @@ import Clyj from './sz/szzf/clyj'
import Krgl from './KrLine'
import Gsnlfx from './gxsl/gsnlfx'
import Ddjl from './szydd/ddjl'
const HomePage = lazy(() => import('./Home'))
@ -225,7 +223,6 @@ const AppRouters: React.FC = () => {
{ path: 'gsxl/zfzl', element: <Zfzl /> },
{ path: 'gsxl/zfjk', element: <Zfjk /> },
{ path: 'szydd/diaodu', element: <Ddjl/> },
{ path: 'szydd/gsnlfx', element: <Gsnlfx /> },
{ path: 'szydd/gstjfx', element: <Gstjfx /> },
{ path: 'szydd/dxnjyzl', element: <Dxnjyzl /> },

View File

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

View File

@ -18,7 +18,7 @@ const ToolBar = ({search, setTabVal, setTms}) => {
<Form className='toolbarBox' layout="inline" onFinish={onFinish}>
<Form.Item label="时间段" name="imgName">
<RangePicker
allowClear={false}
allowClear
defaultValue={[moment().add(-1,'months'),moment()]}
onChange={onFinish}
style={{ width: "300px" }}

View File

@ -1,26 +1,10 @@
export default function drpOption(data,yjData) {
export default function drpOption(data) {
console.log("data",data);
const maxVal = 0//Math.max(...data.map(obj => obj.drp))
const max1 = Math.max(...[...data.map(obj => obj.value),...yjData.map(obj => obj.value)])
const min1 = Math.min(...[...data.map(obj => obj.value),...yjData.map(obj => obj.value)])
const max1 = Math.max(...data.map(obj => obj.value))
const min1 = Math.min(...data.map(obj => obj.value))
const max2 = Math.max(...data.map(obj => obj.rz))
const min2 = Math.min(...data.map(obj => obj.rz))
const yj = yjData?.map((item,index)=>{
return {
yAxisIndex: 0,
name: item.yjName,
type: 'line',
color: item.color,
lineStyle: {
type: "dashed",
width: 1,
},
data: data.map(o => item.value),
symbol: 'none', // 设置标记点为'none',即去掉圆点
smooth: 0.5
}
})
return {
tooltip: {
@ -101,8 +85,8 @@ export default function drpOption(data,yjData) {
axisTick: {
show: false,
},
min: Math.floor(min1*0.8),
max: Math.ceil(max1*1.2),
min: Math.floor(max1*0.8),
max: Math.floor(min1*1.2),
},
// {
// // gridIndex: 1,
@ -136,8 +120,8 @@ export default function drpOption(data,yjData) {
// axisTick: {
// show: false,
// },
// min: Math.floor(min2*0.8),
// max: Math.ceil(max2*1.2),
// min: Math.floor(max2*0.8),
// max: Math.floor(min2*1.2),
// }
],
series: [
@ -154,7 +138,6 @@ export default function drpOption(data,yjData) {
symbol: 'none', // 设置标记点为'none',即去掉圆点
smooth: 0.5
},
...yj
// {
// // xAxisIndex: 1,
// yAxisIndex: 1,

View File

@ -12,8 +12,7 @@ import drpOption from './drpOption';
function ShenLiu({ id, data, dispatch, onCancel }) {
console.log(data);
const [ tableData, setTableData ] = useState([])
const [ yjData, setYjData ] = useState([])
const option = useMemo(() => drpOption(tableData,yjData), [tableData,yjData])
const option = useMemo(() => drpOption(tableData), [tableData])
const width = 780;
const closePop = () => {
@ -39,44 +38,7 @@ function ShenLiu({ id, data, dispatch, onCancel }) {
setTableData(data)
}
const getYjData = async(stationCode)=>{
const params = {
"pageSo": {
"pageSize": 10,
"pageNumber": 1
},
"stationCode": stationCode
}
const { code, data:{records}} = await httppost2(apiurl.gcaqjc.gcaqyj.yjgzpz.page,params)
if(code!==200){
return
}
const linshi = []
records?.map((item)=>{
if(item.status===0){
return
}
if(item.valueOne||0){
linshi.push({
yjName:item.level ===1?'黄色预警':'红色预警',
value:item.valueOne,
color:item.level ===1?'#f1bf42':'red'
})
}
if(item.valueTwo||0){
linshi.push({
yjName:item.level ===1?'黄色预警':'红色预警',
value:item.valueTwo,
color:item.level ===1?'#f1bf42':'red'
})
}
})
setYjData(linshi)
}
useEffect(()=>{
getYjData(data.stationCode)
getData([moment().add(-1,'months'),moment()],data.stationCode)
},[])

View File

@ -23,7 +23,7 @@ const ToolBar = ({search, defaultParams}) => {
<Form form={form} className='toolbarBox' layout="inline" onFinish={onFinish}>
<Form.Item label="时间段" name="tms">
<RangePicker
allowClear={false}
allowClear
defaultValue={[moment().add(-1,'months'),moment()]}
onChange={(e)=>{
form.setFieldValue('cysd',null)

View File

@ -1,26 +1,10 @@
export default function drpOption(data,yjData) {
export default function drpOption(data) {
console.log("data",data);
const maxVal = 0//Math.max(...data.map(obj => obj.drp))
const max1 = Math.max(...[...data.map(obj => obj.value),...yjData.map(obj => obj.value)])
const min1 = Math.min(...[...data.map(obj => obj.value),...yjData.map(obj => obj.value)])
const max1 = Math.max(...data.map(obj => obj.value))
const min1 = Math.min(...data.map(obj => obj.value))
const max2 = Math.max(...data.map(obj => obj.rz))
const min2 = Math.min(...data.map(obj => obj.rz))
const yj = yjData?.map((item,index)=>{
return {
yAxisIndex: 0,
name: item.yjName,
type: 'line',
color: item.color,
lineStyle: {
type: "dashed",
width: 1,
},
data: data.map(o => item.value),
symbol: 'none', // 设置标记点为'none',即去掉圆点
smooth: 0.5
}
})
return {
tooltip: {
@ -101,8 +85,8 @@ export default function drpOption(data,yjData) {
axisTick: {
show: false,
},
min: Math.floor(min1*0.8),
max: Math.ceil(max1*1.2),
min: Math.floor(max1*0.8),
max: Math.floor(min1*1.2),
},
{
// gridIndex: 1,
@ -136,8 +120,8 @@ export default function drpOption(data,yjData) {
axisTick: {
show: false,
},
min: Math.floor(min2*0.8),
max: Math.ceil(max2*1.2),
min: Math.floor(max2*0.8),
max: Math.floor(min2*1.2),
}
],
series: [
@ -167,7 +151,6 @@ export default function drpOption(data,yjData) {
symbol: 'none', // 设置标记点为'none',即去掉圆点
smooth: 0.5
},
...yj
]
};
}

View File

@ -10,11 +10,10 @@ import TableData from './TableData'
import drpOption from './drpOption';
function ShenYa({ id, data, dispatch, onCancel }) {
console.log('SY',data);
console.log(data);
const [ tableData, setTableData ] = useState([])
const [ yjData, setYjData ] = useState([])
const [ tabVal, setTabVal ] = useState('1')
const option = useMemo(() => drpOption(tableData,yjData), [tableData,yjData])
const option = useMemo(() => drpOption(tableData), [tableData])
const width = 780;
const closePop = () => {
@ -41,44 +40,7 @@ function ShenYa({ id, data, dispatch, onCancel }) {
setTableData(data)
}
const getYjData = async(stationCode)=>{
const params = {
"pageSo": {
"pageSize": 10,
"pageNumber": 1
},
"stationCode": stationCode
}
const { code, data:{records}} = await httppost2(apiurl.gcaqjc.gcaqyj.yjgzpz.page,params)
if(code!==200){
return
}
const linshi = []
records?.map((item)=>{
if(item.status===0){
return
}
if(item.valueOne||0){
linshi.push({
yjName:item.level ===1?'黄色预警':'红色预警',
value:item.valueOne,
color:item.level ===1?'#f1bf42':'red'
})
}
if(item.valueTwo||0){
linshi.push({
yjName:item.level ===1?'黄色预警':'红色预警',
value:item.valueTwo,
color:item.level ===1?'#f1bf42':'red'
})
}
})
setYjData(linshi)
}
useEffect(()=>{
getYjData(data.stationCode)
getData([moment().add(-1,'months'),moment()],data.stationCode)
},[])

View File

@ -17,7 +17,7 @@ const ToolBar = ({search, setTabVal}) => {
<Form className='toolbarBox' layout="inline" onFinish={onFinish}>
<Form.Item label="时间段" name="imgName">
<RangePicker
allowClear={false}
allowClear
defaultValue={[moment().add(-1,'months'),moment()]}
onChange={onFinish}
style={{ width: "300px" }}

View File

@ -1,28 +1,10 @@
export default function drpOption(data,yjData) {
export default function drpOption(data) {
console.log("data",data);
const max1 = Math.max(...[...data.map(obj => obj.x),...data.map(obj => obj.y),...data.map(obj => obj.h),...yjData.map(obj => obj.value)])
const min1 = Math.min(...[...data.map(obj => obj.x),...data.map(obj => obj.y),...data.map(obj => obj.h),...yjData.map(obj => obj.value)])
const maxVal = 0//Math.max(...data.map(obj => obj.drp))
const max1 = Math.max(...data.map(obj => obj.x))
const min1 = Math.min(...data.map(obj => obj.x))
const max2 = Math.max(...data.map(obj => obj.rz))
const min2 = Math.min(...data.map(obj => obj.rz))
const yj = yjData?.map((item,index)=>{
return {
yAxisIndex: 0,
name: item.yjName,
type: 'line',
color: item.color,
lineStyle: {
type: "dashed",
width: 1,
},
data: data.map(o => item.value),
symbol: 'none', // 设置标记点为'none',即去掉圆点
smooth: 0.5
}
})
return {
tooltip: {
@ -49,7 +31,7 @@ export default function drpOption(data,yjData) {
{
type: 'category',
data: data.map(o => o.tm),
inverse: false,
inverse: true,
splitLine: {
show: false
},
@ -103,8 +85,8 @@ export default function drpOption(data,yjData) {
axisTick: {
show: false,
},
max: Math.floor(max1*1.2)||100,
min: Math.floor(min1*0.8)||0,
max: Math.ceil(max1*1.2)||100,
},
{
// gridIndex: 1,
@ -138,8 +120,8 @@ export default function drpOption(data,yjData) {
axisTick: {
show: false,
},
max: Math.floor(max2*1.2),
min: Math.floor(min2*0.8),
max: Math.ceil(max2*1.2),
}
],
series: [
@ -195,7 +177,6 @@ export default function drpOption(data,yjData) {
symbol: 'none', // 设置标记点为'none',即去掉圆点
smooth: 0.5
},
...yj
]
};
}

View File

@ -12,10 +12,8 @@ import drpOption from './drpOption';
function ShenYa({ id, data, dispatch, onCancel }) {
console.log(data);
const [ tableData, setTableData ] = useState([])
const [ yjData, setYjData ] = useState([])
const [ tabVal, setTabVal ] = useState('1')
// const option = useMemo(() => drpOption(tableData), [tableData])
const option = useMemo(() => drpOption(tableData,yjData), [tableData,yjData])
const option = useMemo(() => drpOption(tableData), [tableData])
const width = 780;
const closePop = () => {
@ -42,44 +40,7 @@ function ShenYa({ id, data, dispatch, onCancel }) {
setTableData(data)
}
const getYjData = async(stationCode)=>{
const params = {
"pageSo": {
"pageSize": 10,
"pageNumber": 1
},
"stationCode": stationCode
}
const { code, data:{records}} = await httppost2(apiurl.gcaqjc.gcaqyj.yjgzpz.page,params)
if(code!==200){
return
}
const linshi = []
records?.map((item)=>{
if(item.status===0){
return
}
if(item.valueOne||0){
linshi.push({
yjName:item.level ===1?'黄色预警':'红色预警',
value:item.valueOne,
color:item.level ===1?'#f1bf42':'red'
})
}
if(item.valueTwo||0){
linshi.push({
yjName:item.level ===1?'黄色预警':'红色预警',
value:item.valueTwo,
color:item.level ===1?'#f1bf42':'red'
})
}
})
setYjData(linshi)
}
useEffect(()=>{
getYjData(data.stationCode)
getData([moment().add(-1,'months'),moment()],data.stationCode)
},[])

View File

@ -17,7 +17,7 @@ const ToolBar = ({search, setTabVal}) => {
<Form className='toolbarBox' layout="inline" onFinish={onFinish}>
<Form.Item label="时间段" name="imgName">
<RangePicker
allowClear={false}
allowClear
defaultValue={[moment().add(-1,'months'),moment()]}
onChange={onFinish}
style={{ width: "300px" }}

View File

@ -29,17 +29,12 @@ function DrpSearch({record}) {
}, [echartData])
const searchTm = (e) => {
if (!e) {
setParams({...params, tm: "" })
} else {
setParams({
...params,
stm: e[0].format("YYYY-MM-DD HH:mm"),
etm: e[1].format("YYYY-MM-DD HH:mm"),
tm:e,
})
}
setParams({
...params,
startTime: e[0].format("YYYY-MM-DD HH:mm"),
endTime: e[1].format("YYYY-MM-DD HH:mm"),
tm:e,
})
};
const doSearch = () => {
getData(params)

View File

@ -23,17 +23,12 @@ function DrpSearch({ record }) {
// 设置早上八点的时间
const eightAM = moment().set({hour: 8, minute: 0, second: 0, millisecond: 0});
const searchTm = (e) => {
if (!e) {
setParams({...params, tm: "" })
} else {
setParams({
...params,
stm: e[0].format("YYYY-MM-DD HH:mm"),
etm: e[1].format("YYYY-MM-DD HH:mm"),
tm:e,
})
}
setParams({
...params,
stm: e[0].format("YYYY-MM-DD HH:mm"),
etm: e[1].format("YYYY-MM-DD HH:mm"),
tm:e,
})
};
const doSearch = () => {
getData(params)

View File

@ -28,17 +28,12 @@ function DrpSearch({record}) {
// 设置早上八点的时间
const eightAM = moment().set({hour: 8, minute: 0, second: 0, millisecond: 0});
const searchTm = (e) => {
if (!e) {
setParams({...params, tm: "" })
} else {
setParams({
...params,
stm: e[0].format("YYYY-MM-DD HH:mm"),
etm: e[1].format("YYYY-MM-DD HH:mm"),
tm:e,
})
}
setParams({
...params,
stm: e[0].format("YYYY-MM-DD HH:mm"),
etm: e[1].format("YYYY-MM-DD HH:mm"),
tm:e,
})
};
const doSearch = () => {
console.log(params);

View File

@ -51,8 +51,8 @@ const Page = () => {
<div className="rf2">{data1.q}</div>
</div>
<div style={{marginBottom:'10px', display:'flex'}}>
<div className="lf2" style={{color:'#70B603'}}>{data1?.resMonthEcoFlow?.month||'-'}月核定流量: </div>
<div className="rf2" style={{color:'#70B603'}}>{data1?.resMonthEcoFlow?.value}</div>
<div className="lf2" style={{color:'#70B603'}}>7月核定流量: </div>
<div className="rf2" style={{color:'#70B603'}}>{data1.value}</div>
</div>
</div>
<div className="home_gongshui_item_text">

View File

@ -116,7 +116,7 @@ const Page = () => {
</div>
</div>
<div style={{padding:'10px 60px 60px 60px'}}>
<h4>标准文件<a href='http://local.gunshiiot.com:18083/tsg/GB3838-2002地表水环境质量标准.pdf' target="_blank">GB3838-2002地表水环境质量标准.pdf</a></h4>
<h4>标准文件<a>GB3838-2002地表水环境质量标准.pdf</a></h4>
<h4>本系统根据以下水质检测项目进行判断</h4>
<img width={'100%'} src={`${process.env.PUBLIC_URL}/assets/xyt/homeImg/shuizhi2.png`} alt="" />
</div>

View File

@ -37,7 +37,7 @@ const Page = ({mySetTms}) => {
const columns2 = [
{ title: '上报时间', key: 'finishTime', dataIndex: 'finishTime',align: "center", ellipsis: true },
{ title: '巡检问题描述', key: 'problemDesc', dataIndex: 'problemDesc',align: "center" },
{ title: '巡检问题描述', key: 'itemDesc', dataIndex: 'itemDesc',align: "center" },
];
useEffect(()=>{

View File

@ -12,13 +12,12 @@ const { Panel } = Collapse;
const Page = ({showPanels}) => {
const dispatch = useDispatch();
const [myKey, setMyKey] = useState('1')
const [badgeType, setBadgeType] = useState('')
const [badgeType, setBadgeType] = useState('雷达回波')
const [tmObj,setTmObj] = useState({
tm:moment(),
hours:'08'
})
useEffect(()=>{
setBadgeType('雷达回波')
dispatch.runtime.setCameraTarget({
center: [115.2, 31.18],
zoom: 9,
@ -67,7 +66,8 @@ const Page = ({showPanels}) => {
</div>
{
(badgeType === '雷达回波'&&myKey==='1') ? (
(badgeType === '雷达回波'&&myKey==='1')
? (
<div className='radarPageBox'>
<RadarPage
activeKey={'0'}

View File

@ -37,7 +37,7 @@ export default function Page({isHome}) {
const columnsSl = [
{ title: '监测点', key: 'stationCode', dataIndex: 'stationCode',align: "center", ellipsis: true },
{ title: '监测时间', key: 'tm', dataIndex: 'tm',align: "center",width: 150, ellipsis: true, render:(v,row)=><div style={{color:row.flag===1?'red':'#3B4859'}}>{v?.slice(5,16)}</div> },
{ title: '渗流量(L/s)', key: 'value', dataIndex: 'value',align: "center", ellipsis: true, render:(v,row)=><div style={{color:row.status===1?'red':'#3B4859'}}>{v}</div> },
{ title: '渗流量(L/s)', key: 'q', dataIndex: 'q',align: "center", ellipsis: true, render:(v,row)=><div style={{color:row.status===1?'red':'#3B4859'}}>{v}</div> },
]
const columnsWy = [
@ -57,7 +57,7 @@ export default function Page({isHome}) {
console.log(1111)
// 大于0:滚轮向上滚动 小于0:滚轮向下滚动
if (e.wheelDelta > 0) {
scale += 0.02;
scale += 0.05;
img.style.transform = `scale(${scale})`;
} else {
if (scale == 1) {
@ -66,7 +66,7 @@ export default function Page({isHome}) {
}
// 缩放值大于1时,可以缩小,反之亦然
if (scale > 1) {
scale -= 0.02;
scale -= 0.05;
img.style.transform = `scale(${scale})`;
}
}
@ -138,7 +138,7 @@ export default function Page({isHome}) {
setModalData(item)
}}>
{item.stationCode}
<img width={20} src={`${process.env.PUBLIC_URL}/assets/xyt/fxdd/${item.status===1?'sy2.png':'sy.png'}`} alt="" id="img" draggable="false" />
<img width={20} src={`${process.env.PUBLIC_URL}/assets/xyt/fxdd/sy.png`} alt="" id="img" draggable="false" />
</div>
)
}
@ -149,7 +149,7 @@ export default function Page({isHome}) {
setModalData(item)
}}>
{item.stationCode}
<img width={20} src={`${process.env.PUBLIC_URL}/assets/xyt/fxdd/${item.status===1?'sl2.png':'sl.png'}`} alt="" id="img" draggable="false" />
<img width={20} src={`${process.env.PUBLIC_URL}/assets/xyt/fxdd/sl.png`} alt="" id="img" draggable="false" />
</div>
)
}
@ -160,7 +160,7 @@ export default function Page({isHome}) {
setModalData(item)
}}>
{item.stationCode}
<img width={20} src={`${process.env.PUBLIC_URL}/assets/xyt/fxdd/${(item.xstatus===1||item.ystatus===1||item.hstatus===1)?'wy2.png':'wy.png'}`} alt="" id="img" draggable="false" />
<img width={20} src={`${process.env.PUBLIC_URL}/assets/xyt/fxdd/wy.png`} alt="" id="img" draggable="false" />
</div>
)
}

View File

@ -185,11 +185,6 @@
top: 594px;
}
.gcaqjc_bzt_sl_SL02{
left: 679px;
top: 594px;
}
.gcaqjc_bzt_wy_WY-G100{
left: 394px;
top: 376px;

View File

@ -1,5 +1,5 @@
import React,{useEffect,useMemo,useState} from 'react'
import { Button, DatePicker, Table,message } from 'antd';
import { Button, DatePicker, Table } from 'antd';
import { createCrudService } from '../../../components/crud/_';
import usePageTable from '../../../components/crud/usePageTable2';
import moment from 'moment';
@ -32,33 +32,17 @@ export default function KrLine({ record }) {
return drpOption({data});
}, [data])
const searchTm = (e) => {
if (!e) {
setParams({...params, tm: "" })
} else {
setParams({
...params,
stm: e[0].format("YYYY-MM-DD HH:mm:ss"),
etm: e[1].format("YYYY-MM-DD HH:mm:ss"),
tm:e,
})
}
};
const doSearch = () => {
if (!params?.tm) {
message.warning('请选择查询时间段')
return;
}
const exportParams={
...params,
stm: params.tm[0].format("YYYY-MM-DD HH:mm:ss"),
etm: params.tm[1].format("YYYY-MM-DD HH:mm:ss"),
tm:params.tm,
}
search({ search: exportParams })
// debugger;
getData(exportParams)
const doSearch = () => {
search({ search: params })
getData(params)
}
@ -69,8 +53,7 @@ export default function KrLine({ record }) {
const params = {
search: {
stm,
etm,
stcd:record.stcd
etm
}
}
if (record?.stcd) {

View File

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

View File

@ -18,7 +18,7 @@ const Page = () => {
{ title: '序号', key: 'inx', dataIndex: 'inx', width: 60, align:"center" },
{ title: '时间', key: 'tm', dataIndex: 'tm', width: 200, ellipsis: true, align:"center" },
{
title: '发电灌溉',
title: '生态供水',
align: "center",
children: [
{
@ -36,7 +36,7 @@ const Page = () => {
]
},
{
title: '水厂取水',
title: '生活供水',
align: "center",
children: [
{
@ -62,7 +62,7 @@ const Page = () => {
{ title: '序号', key: 'inx', dataIndex: 'inx', width: 60, align:"center" },
{ title: '时间', key: 'tm', dataIndex: 'tm', width: 100, ellipsis: true, align:"center" },
{
title: '发电灌溉',
title: '生态供水',
align: "center",
children: [
{
@ -104,7 +104,7 @@ const Page = () => {
]
},
{
title: '水厂取水',
title: '生活供水',
align: "center",
children: [
{
@ -225,13 +225,11 @@ const Page = () => {
const params = {
search: {
...searchVal,
searchType: mode,
isAsc: false,
orderField:"tm"
searchType:mode
}
};
search(params)
getGsChartData({...params?.search, isAsc: true, })
getGsChartData(params?.search)
}, [searchVal, mode])
useEffect(() => {
@ -266,8 +264,8 @@ const Page = () => {
<div style={{flex:1}}>
<div style={{color:"#ffa87c",display:"flex",columnGap:20}}>
<div className='des-title'>
<div>发电灌溉总合计(万m³)</div>
<div style={{margin:"10px 0"}}>水厂取水总合计(万m³)</div>
<div>生态供水总合计(万m³)</div>
<div style={{margin:"10px 0"}}>生活供水总合计(万m³)</div>
<div>供水总合计(万m³)</div>
</div>
<div className='des-title'>

View File

@ -3,12 +3,12 @@ let title = "总计";
let color = ["#73a0fa", "#52c1f5"];
let echartData = [
{
name: "发电灌溉",
value: parseFloat(obj?.shgs?.toFixed(2))
name: "生活供水",
value: obj?.shgs
},
{
name: "水厂取水",
value: parseFloat(obj?.stgs?.toFixed(2)),
name: "生态供水",
value: obj?.stgs,
},
];

View File

@ -7,8 +7,7 @@ const ToolBar = ({ setSearchVal, exportFile, role }) => {
const exportBtn = role?.rule?.find(item => item.menuName == "导出");
const [form] = Form.useForm();
const onFinish = (values) => {
// setSearchVal({...values,year: String(values.year)});
setSearchVal({...values,year: moment(values.year).format("YYYY")});
setSearchVal({...values,year: String(values.year)});
}
useEffect(() => {

View File

@ -13,7 +13,7 @@ const ToolBar = ({ setSearchVal, onSave, storeData, role }) => {
if (values.tm) {
dateSo = {
start: moment(values.tm[0]).format('YYYY-MM-DD 00:00:00'),
end: moment(values.tm[1]).format('YYYY-MM-DD 23:59:59')
end: moment(values.tm[1]).format('YYYY-MM-DD 00:00:00')
}
}
delete values.tm
@ -23,7 +23,7 @@ const ToolBar = ({ setSearchVal, onSave, storeData, role }) => {
useEffect(() => {
let dateSo = {
start: moment().subtract(1,"years").format('YYYY-MM-DD 00:00:00'),
end: moment().format('YYYY-MM-DD 23:59:59')
end: moment().format('YYYY-MM-DD 00:00:00')
}
form.setFieldValue("tm", [moment(dateSo.start), moment(dateSo.end)])
setSearchVal({ dateSo })

View File

@ -13,7 +13,7 @@ const ToolBar = ({ setSearchVal, onSave, storeData,role }) => {
if (values.tm) {
dateSo = {
start: moment(values.tm[0]).format('YYYY-MM-DD 00:00:00'),
end: moment(values.tm[1]).format('YYYY-MM-DD 23:59:59')
end: moment(values.tm[1]).format('YYYY-MM-DD 00:00:00')
}
}
delete values.tm
@ -23,7 +23,7 @@ const ToolBar = ({ setSearchVal, onSave, storeData,role }) => {
useEffect(() => {
let dateSo = {
start: moment().subtract(1,"years").format('YYYY-MM-DD 00:00:00'),
end: moment().format('YYYY-MM-DD 23:59:59')
end: moment().format('YYYY-MM-DD 00:00:00')
}
form.setFieldValue("tm", [moment(dateSo.start), moment(dateSo.end)])
setSearchVal({ dateSo })

View File

@ -13,7 +13,7 @@ const ToolBar = ({ setSearchVal, onSave, storeData, role }) => {
if (values.tm) {
dateSo = {
start: moment(values.tm[0]).format('YYYY-MM-DD 00:00:00'),
end: moment(values.tm[1]).format('YYYY-MM-DD 23:59:59')
end: moment(values.tm[1]).format('YYYY-MM-DD 00:00:00')
}
}
delete values.tm
@ -23,7 +23,7 @@ const ToolBar = ({ setSearchVal, onSave, storeData, role }) => {
useEffect(() => {
let dateSo = {
start: moment().subtract(1,"years").format('YYYY-MM-DD 00:00:00'),
end: moment().format('YYYY-MM-DD 23:59:59')
end: moment().format('YYYY-MM-DD 00:00:00')
}
form.setFieldValue("tm", [moment(dateSo.start), moment(dateSo.end)])
setSearchVal({ dateSo })

View File

@ -115,9 +115,8 @@ const getResultList = async() => {
const onfinish = (values) => {
debugger
let oldFiles = fileList.map(item => ({ fileId: item.response?.data?.fileId }))
const dicId = values?.result?.map(item=> ({sysDictId:item}))
const dicId = values.result.map(item=> ({sysDictId:item}))
values.menuId = record.code;
values.result = dicId;
if (mode === 'edit') {

View File

@ -241,23 +241,6 @@ const EditableRow = ({ index, ...props }) => {
})
return arr
}
const handleTableData2 = (obj) => {
const names = Object.values(obj)?.[0]?.map(o=>o.teamUserName)
const obj2 = {}
for(let key in obj){
const arr = []
names?.map((name)=>{
obj?.[key]?.map((item)=>{
if(name===item.teamUserName){
arr.push(item)
}
})
})
obj2[key] = arr
}
return obj2
}
// 获取清单查看数据
const [qdColumns, setQdColumns] = useState(newcolumns)
const [qdWidth, setQdWidth] = useState()
@ -265,8 +248,7 @@ const EditableRow = ({ index, ...props }) => {
try {
const res = await httpget2(apiurl.rcgl.jdkh.khrwgl.qdView + `/${id}`)
if (res.code == 200) {
const linshi = handleTableData2(res.data)//将接口里用户的顺序统一
const result = handleTableData(linshi);
const result = handleTableData(res.data);
const insertCols = [];
result.forEach((item, index, arr) => {
const total = arr?.reduce((total, cur) => total + (cur["assessScore" + index] || 0), 0)
@ -373,18 +355,6 @@ const EditableRow = ({ index, ...props }) => {
rectifyStatus:0
}))
}
if(tableData.length>0){
let flag = true //fasle有位评分的
params.ratings?.map((item)=>{
if(item.assessScore==null){
flag = false
}
})
if(!flag){
message.error('请输入全部考核评分')
return
}
}
try {
const res = await httppost2(apiurl.rcgl.jdkh.khrwgl.confirmpf, params)
if (res.code == 200) {

View File

@ -1,6 +1,6 @@
export default function jgOptions(personData) {
let personObj = {};
const Xdata = personData.map(item => item.taskName )
const Xdata = personData.map(item => item.taskName + '考核')
// 查找所有人员并去重
const allPerson= personData.map(item => {
return item.assessObjects.map(o => o.objectUserName )
@ -10,7 +10,7 @@ export default function jgOptions(personData) {
// 所有人员数据
const allData = personData.map(item => {
return item.assessObjects.map(o => {
return [item.taskName ,o.objectUserName,o.assessScore||0,o.assessLevel]
return [item.taskName + '考核',o.objectUserName,o.assessScore||0,o.assessLevel]
})
}).flat()
@ -27,7 +27,7 @@ export default function jgOptions(personData) {
xAxis: {
type: 'category',
axisLabel: {
interval: Xdata.length > 5 ? 0 : 0, // 强制显示所有标签
interval: Xdata.length > 5 ? 0 : 1, // 强制显示所有标签
rotate: Xdata.length > 5 ? 20 : 0 // 旋转角度
},
data: Xdata

View File

@ -206,7 +206,6 @@ const ModalForm = ({ mode, record, onEdit, onSave, onSimilarSave }) => {
values.standardScore = standardScore1;
if (mode === 'edit') {
values.id = record.id;
values.status = record.status;
onEdit(apiurl.rcgl.jdkh.khzbgl.edit,values)
}
if (mode === 'save') {

View File

@ -28,7 +28,7 @@ const ToolBar = ({ setSearchVal, onSave, storeData, role }) => {
<div style={{display:'flex',justifyContent:'space-between'}}>
<Form form={form} className='toolbarBox' layout="inline" onFinish={onFinish}>
{
(onSave) ?
(onSave && addBtn) ?
<Form.Item>
<Button onClick={onSave} type='primary'>新增</Button>
</Form.Item>

View File

@ -70,7 +70,7 @@ console.log(record);
<img style={{width:value ? 20: 17,height:value ? 20: 17}} src={`${process.env.PUBLIC_URL}/assets/xyt/rcgl/${xjStatus[value]}.png`}
alt='' /></div>
},
{ title: '巡查问题描述', key: 'problemDesc', dataIndex: 'problemDesc', width: 300,ellipsis:true },
{ title: '巡查问题描述', key: 'itemProblemDesc', dataIndex: 'itemProblemDesc', width: 300,ellipsis:true },
{ title: '巡查图片', key: 'inspectPics', dataIndex: 'inspectPics', width: 100,align: "center",
render: (value) => <div>{value ? <a onClick={()=>reviewPic(value)}> { value.length} </a>: ''}</div>
@ -219,7 +219,8 @@ console.log(record);
</Col>
</Row>
<Row>
{
record?.status != 0 ?
<Col span={12}>
<Form.Item
label="开始日期"
@ -230,7 +231,8 @@ console.log(record);
>
<DatePicker disabled={mode==='view'} format={'YYYY-MM-DD'} style={{width:'100%'}} allowClear />
</Form.Item>
</Col>
</Col> : null
}
<Col span={12}>
<Form.Item
label="结束日期"
@ -252,9 +254,10 @@ console.log(record);
getValueProps={(value) => ({ value: value ? moment(value) : undefined })}
placeholder=""
>
<DatePicker disabled={mode==='view'} format={'YYYY-MM-DD HH:mm'} style={{width:'100%'}} allowClear />
<DatePicker disabled={mode==='view'} format={'YYYY-MM-DD'} style={{width:'100%'}} allowClear />
</Form.Item>
</Col>
{record?.status == 2 ?
<Col span={12}>
<Form.Item
label="完成时间"
@ -264,9 +267,10 @@ console.log(record);
placeholder=""
>
<DatePicker disabled={mode==='view'} format={'YYYY-MM-DD HH:mm'} style={{width:'100%'}} allowClear />
<DatePicker disabled={mode==='view'} format={'YYYY-MM-DD'} style={{width:'100%'}} allowClear />
</Form.Item>
</Col>
</Col> : null
}
</Row>
<Row>
<Col span={12}>

View File

@ -65,7 +65,7 @@ const Page = () => {
{title: '开始日期', key: 'startDate', dataIndex: 'startDate', width: 200},
{title: '结束日期', key: 'endDate', dataIndex: 'endDate', width: 200},
{title: '问题数量', key: 'problemNum', dataIndex: 'problemNum', width: 100,align: 'center'},
{ title: '待处理', key: 'handleNum', dataIndex: 'handleNum', width: 100,align: 'center'},
{ title: '待处理', key: 'handleNum ', dataIndex: 'handleNum ', width: 100,align: 'center'},
{ title: '创建时间', key: 'createTime', dataIndex: 'createTime', width: 200 },
{ title: '创建人', key: 'createUserName', dataIndex: 'createUserName', width: 150 },

View File

@ -222,7 +222,7 @@ console.log(record);
</Form.Item>
</Col>
{
(record?.isHandle || record?.isHandle == 0) ?
record?.isHandle ?
<Col span={12}>
<Form.Item
label="处理人"

View File

@ -5,7 +5,7 @@ import moment from 'moment';
import NormalSelect from '../../../../components/Form/NormalSelect';
const { RangePicker } = DatePicker;
const ToolBar = ({ setSearchVal, onSave, storeData, role }) => {
const searchBtn = role?.rule?.find(item => item.menuName == "查询")||true;
const searchBtn = role?.rule?.find(item => item.menuName == "查询");
const [form] = Form.useForm();
const onFinish = (values) => {
@ -13,7 +13,7 @@ const ToolBar = ({ setSearchVal, onSave, storeData, role }) => {
if (values.tm) {
dateTimeRangeSo = {
start: moment(values.tm[0]).format('YYYY-MM-DD 00:00:00'),
end: moment(values.tm[1]).format('YYYY-MM-DD 23:59:59')
end: moment(values.tm[1]).format('YYYY-MM-DD 00:00:00')
}
}
delete values.tm
@ -23,7 +23,7 @@ const ToolBar = ({ setSearchVal, onSave, storeData, role }) => {
useEffect(() => {
let dateTimeRangeSo = {
start: moment().subtract(1,"years").format('YYYY-MM-DD 00:00:00'),
end: moment().format('YYYY-MM-DD 23:59:59')
end: moment().format('YYYY-MM-DD 00:00:00')
}
form.setFieldValue("tm", [moment(dateTimeRangeSo.start), moment(dateTimeRangeSo.end)])
setSearchVal({ dateTimeRangeSo })

View File

@ -18,7 +18,6 @@ const ModalForm = ({ mode, record, onEdit, onSave, onSimilarSave }) => {
values.pointId = record.code;
if (mode === 'edit') {
values.id = record.id;
values.status = record.status;
onEdit(apiurl.rcgl.xcxj.xjxpz.edit,values)
}
if (mode === 'save') {

View File

@ -28,7 +28,7 @@ const ToolBar = ({ setSearchVal, onSave, storeData, role }) => {
<div style={{display:'flex',justifyContent:'space-between'}}>
<Form form={form} className='toolbarBox' layout="inline" onFinish={onFinish}>
{
(onSave) ?
(onSave && addBtn) ?
<Form.Item>
<Button onClick={onSave} type='primary'>新增</Button>
</Form.Item>

View File

@ -14,7 +14,7 @@ import apiurl from '../../../service/apiurl';
const url = "http://223.75.53.141:9102/test.by-lyf.tmp"
const CanvasW = 1080
const CanvasH = 640
// const waterRatio = 0
const waterRatio = 0
const zmobj ={
"hpCode": "HP0074208040002120",
"stcd": "4265630075",
@ -177,7 +177,6 @@ const myType = {
const Page = () => {
const [itemIndex,setItemIndex] = useState(null)
const [waterRatio,setWaterRatio] = useState(0)
const [data,setData] = useState({})
const [list, setList ] = useState([])
const [damList, setDamList ] = useState([])
@ -212,11 +211,6 @@ const Page = () => {
if(code!==200){
return
}
data.map((item)=>{
if(item.type===2){
setWaterRatio(item.value/5||0)
}
})
setList(data)
}
@ -229,6 +223,7 @@ const Page = () => {
data.map((item)=>{
list.push({
...item
// ,realAperture:item.realAperture*1000
})
})
setDamList(list)
@ -251,12 +246,6 @@ const Page = () => {
}
}
const getNum = (a,b)=>{
const aa = Number(a||0)
const bb = Number(b||0)
const num = Number(aa-bb).toFixed(3)
return num
}
return (
<>
@ -341,31 +330,13 @@ const Page = () => {
<div style={{height:'144px',overflowY:'auto',padding:'20px'}}>
{
list?.map((item)=>{
if(item.type===1){
return (
<div className='sg_zmjk_right_information_content'>
<div>{myType[item.type]}</div>
<div>{item.value||'-'} / {getNum(item.value,data.inEle)}</div>
<div>{item.tm?.slice(5,19)}</div>
</div>
)
}else if(item.type===2){
return (
<div className='sg_zmjk_right_information_content'>
<div>{myType[item.type]}</div>
<div>{item.value||'-'} / {getNum(item.value,data.inEle)}</div>
<div>{item.tm?.slice(5,19)}</div>
</div>
)
}else{
return (
<div className='sg_zmjk_right_information_content'>
<div>{myType[item.type]}</div>
<div>{item.value}</div>
<div>{item.tm?.slice(5,19)}</div>
</div>
)
}
return (
<div className='sg_zmjk_right_information_content'>
<div>{myType[item.type]}</div>
<div>112.079 / 1.279</div>
<div>07-10 12:09:00</div>
</div>
)
})
}
</div>

View File

@ -317,7 +317,7 @@ const ModalForm = ({ mode, record, onEdit, onSave, onSimilarSave }) => {
label="填报人"
name="applicant"
>
<Input disabled={true} style={{width:'100%'}} allowClear />
<Input disabled={mode==='view'} style={{width:'100%'}} allowClear />
</Form.Item>
</Col>
</Row>

View File

@ -20,8 +20,8 @@ const ToolBar = ({ setSearchVal, onSave, storeData, role = [],callback,exportFil
let dateSo;
if (values.tm) {
dateSo = {
stm: moment(values.tm[0]).format('YYYY-01-01'),
etm: moment(values.tm[1]).format('YYYY-12-31')
stm: moment(values.tm[0]).format('YYYY'),
etm: moment(values.tm[1]).format('YYYY')
}
}
delete values.tm

View File

@ -7,11 +7,11 @@ const ToolBar = ({ setSearchVal }) => {
const [form] = Form.useForm();
const types = [
{
label: '培训人次',
label: '培训期数',
value: 1
},
{
label: '培训期数',
label: '培训人次',
value: 2
},
]

View File

@ -372,7 +372,7 @@ const ModalForm = ({ mode, record, onEdit, onSave, onSimilarSave }) => {
label="参训人员"
name="trainees"
>
<Input disabled={mode==='view'} style={{width:'100%'}} allowClear />
<InputNumber min={0} disabled={mode==='view'} style={{width:'100%'}} allowClear />
</Form.Item>
</Col>
<Col span={12}>

View File

@ -77,9 +77,9 @@ const Page = () => {
const [staData, setStaData] = useState()
const pxOptions = useMemo(() => {
if (staData) {
return options(staData,searchChartVal.teamName)
return options(staData)
} else {
return options({},searchChartVal.teamName)
return options({})
}
}, [staData])
const getStaData = async (params) => {
@ -91,9 +91,6 @@ const Page = () => {
} else {
setStaData({...res.data,list:res.data.list2})
}
}else{
message.error(res.description)
setStaData([])
}
} catch (error) {
console.log(error);
@ -128,18 +125,18 @@ const Page = () => {
<div className='children-itm'>
<span>本年培训期数</span>
<span>计划/实际</span>
<span><span style={{ fontSize: 22, fontWeight: "bold" }}>{ staData?.numberOfPeriods2 ?? "--"}</span>&nbsp;期/
<span style={{fontSize:22,fontWeight:"bold"}}>{ staData?.numberOfPeriods1 ?? "--"}</span>&nbsp;</span>
<span><span style={{ fontSize: 22, fontWeight: "bold" }}>{ staData?.numberOfPeriods2 ?? 1}</span>&nbsp;期/
<span style={{fontSize:22,fontWeight:"bold"}}>{ staData?.numberOfPeriods1 ?? 1}</span>&nbsp;</span>
</div>
</div>
<div className='second-item'>
<img src={`${process.env.PUBLIC_URL}/assets/images/renchi.jpg`} alt='' />
<div className='children-itm'>
<span>本年培训人次</span>
<span>本年培训期数</span>
<span>计划/实际</span>
<span><span style={{fontSize:22,fontWeight:"bold"}}>{ staData?.personNum2 ?? "--"}</span>&nbsp;人次/
<span style={{fontSize:22,fontWeight:"bold"}}>{ staData?.personNum1 ?? "--"}</span>&nbsp;</span>
<span><span style={{fontSize:22,fontWeight:"bold"}}>{ staData?.personNum2 ?? 1}</span>&nbsp;人次/
<span style={{fontSize:22,fontWeight:"bold"}}>{ staData?.personNum1 ?? 1}</span>&nbsp;</span>
</div>
</div>
</div>

View File

@ -1,4 +1,4 @@
export default function options(data={},teamName) {
export default function options(data={}) {
const xAxisData = data?.list?.map(item => item.month + "月")
const maxCount = data?.list ? Math.ceil(Math.max(...data?.list?.map(obj => [obj.num1,obj.num2]).flat())) : 0
const minCount = data?.list ? Math.floor(Math.min(...data?.list?.map(obj => [obj.num1, obj.num2]).flat())) : 100
@ -36,18 +36,18 @@ export default function options(data={},teamName) {
},
xAxis: {
data:xAxisData,
// axisLine: {
// show: false // 隐藏X轴轴线
// },
// axisTick: {
// show: false // 隐藏X轴轴线
// },
axisLine: {
show: true // 隐藏X轴轴线
},
axisTick: {
show: true // 隐藏X轴轴线
},
// axisLabel: {
// show: true,
// margin: 14,
// // formatter: '{value}月'
// }
axisLabel: {
show: true,
margin: 14,
// formatter: '{value}月'
}
},
yAxis: [
{
@ -55,7 +55,6 @@ export default function options(data={},teamName) {
offset: 10,
min: minCount,
max: maxCount,
// splitLine:false,
axisTick: {
show: false
},
@ -72,7 +71,6 @@ export default function options(data={},teamName) {
{
type: 'value',
name: '(%)',
splitLine:false,
min: minRate,
max: maxRate,
@ -96,7 +94,7 @@ export default function options(data={},teamName) {
],
series: [
{
name: teamName===1?'计划人次':'计划期数',
name: '计划期数',
type: 'bar',
barWidth: 25,
data: data?.list?.map(item =>item.num2),
@ -105,7 +103,7 @@ export default function options(data={},teamName) {
}
},
{
name: teamName===1?'实际人次':'实际期数',
name: '实际期数',
type: 'bar',
barWidth: 25,
data: data?.list?.map(item =>item.num1),

View File

@ -36,8 +36,8 @@ const ToolBar = ({ setSearchVal, onSave, storeData, role = [],callback,exportFil
let dateSo;
if (values.tm) {
dateSo = {
stm: moment(values.tm[0]),
etm: moment(values.tm[1])
stm: moment(values.tm[0]).format('YYYY'),
etm: moment(values.tm[1]).format('YYYY')
}
}
delete values.tm

View File

@ -290,7 +290,7 @@ const clqkData = [
{
label: '结案时间',
key: 'closeDate',
type: 'DatePicker',
type: 'input',
span: 12
},
{

View File

@ -62,9 +62,9 @@ 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") : null,
closeDate:e.closeDate ? dayjs(e.closeDate).format("YYYY-MM-DD HH:mm:ss") :null,
illegalDate: e.illegalDate ? dayjs(e.v).format("YYYY-MM-DD HH:mm:ss") : e.illegalDate,
}
if (mode == 'save') {
addBasic(params)
} else if (mode == 'edit') {
@ -105,10 +105,7 @@ const Page = ({ mode, onCrudSuccess,record,submit }) => {
}
if(res.data?.illegalDate){
obj.illegalDate=dayjs(res.data.illegalDate)
}
if(res.data?.closeDate){
obj.closeDate=dayjs(res.data.closeDate)
}
}
setFormData({...res.data,...obj})
})
}else if(mode == 'save'){

View File

@ -1,315 +0,0 @@
import React,{useEffect,useState,useMemo,useRef} from 'react';
import { Form, Button, Input, Row,Upload, Col, Table, DatePicker, InputNumber,message,Image,Modal,Typography ,Popconfirm } from 'antd';
import { DeleteOutlined,FileWordOutlined,FilePdfOutlined,FileZipOutlined,FileExcelOutlined } from '@ant-design/icons';
import { formItemLayout, btnItemLayout } from '../../../components/crud/FormLayoutProps';
import apiurl from '../../../service/apiurl';
import NormalSelect from '../../../components/Form/NormalSelect';
import "./index.less"
import moment from 'moment';
const { RangePicker } = DatePicker
const { Dragger } = Upload;
const url = "http://223.75.53.141:9102/test.by-lyf.tmp"
const ModalForm = ({ mode, record, onEdit, onSave, onSimilarSave }) => {
const [form] = Form.useForm();
const [fileList, setFileList] = useState([]) //上传文件列表
const [fileIds, setFileIds] = useState([])
const [iframeSrc, setIframeSrc] = useState('')
const [pdfViewOPen, setPdfViewOPen] = useState(false)
const [flag,setFlag] = useState(false)
const [loading, setLoading] = useState(false)
/**
* @description 文件下载
* @param {String} params 文件fileId
*/
const download = (params) => {
let downloadLink = document.createElement("a");
downloadLink.href = `http://local.gunshiiot.com:18083/gunshiApp/tsg/dispatchRecord/file/download/${params.fileId}`;
downloadLink.download = `${params.fileName}`;
downloadLink.style.display = "none";
// 将链接添加到页面中
document.body.appendChild(downloadLink);
// 模拟点击事件,开始下载
downloadLink.click();
}
/**
* @description 上传图片
* @param {string} file 上传的文件
*/
const fileChange = (info) => {
if (info.file.status === "done") {
setLoading(false);
}
if (info.file.status === "uploading") {
setLoading(true);
}
if (info.file.status === "error") {
message.error("文件上传失败")
setLoading(false);
}
let fileIds = info.fileList?.map(file => {
return file.response?.data?.fileId
})
setFileIds(fileIds)
setFileList(info.fileList)
}
/**
* @description pdf文件预览
* @param {String} params 文件预览url
*/
const viewPdf = (params) => {
setIframeSrc(params)
setPdfViewOPen(true)
}
const onfinish = (values) => {
let oldFiles = fileList?.map(item => ({fileId:item.response?.data?.fileId}) )
if (mode === 'edit') {
values.files = oldFiles;
values.id = record.id;
// values.opUserId = record.opUserId;
onEdit(apiurl.ddjl.edit,values)
}
if (mode === 'save') {
values.files = oldFiles
onSave(apiurl.ddjl.save,values)
}
}
/**
* @description 删除上传的图片
* @param {string} id 删除的id
*/
const deleteFile = (fileId) => {
console.log(fileId);
let filterFile = fileList.filter(item => item.response?.data?.fileId !== fileId);
setFileList(filterFile)
}
useEffect(() => {
if (mode != 'save') {
const imgFile = record?.files?.map(o => ({
name: o.fileName,
response: {
data: {
filePath: o.filePath,
fileId:o.fileId
}
},
}))
setFileList(imgFile)
}
}, [record, mode])
return (
<>
<Form
form={form}
{...formItemLayout}
onFinish={onfinish}
initialValues={record}
onValuesChange={(v,b)=>{
setFlag(b.status===0?false:true)
}}
>
<Row>
<Col span={12}>
<Form.Item
label="调度开始时间"
name="startTime"
getValueFromEvent={(e,dateString) => dateString}
getValueProps={(value) => ({ value: value ? moment(value) : undefined })}
rules={[{required: true}]}
>
<DatePicker disabled={mode==='view'} format={'YYYY-MM-DD HH:mm:ss'} style={{width:'100%'}} showTime allowClear />
</Form.Item>
</Col>
<Col span={12}>
<Form.Item
label="调度结束时间"
name="endTime"
getValueFromEvent={(e,dateString) => dateString}
getValueProps={(value) => ({ value: value ? moment(value) : undefined })}
rules={[{required: flag}]}
>
<DatePicker disabled={mode==='view'||!flag} format={'YYYY-MM-DD HH:mm:ss'} style={{width:'100%'}} showTime allowClear />
</Form.Item>
</Col>
</Row>
<Row>
<Col span={12}>
<Form.Item
label="操作人"
name="opUserName"
rules={[{required: true}]}
>
<Input disabled={mode==='view'} style={{width:'100%'}} allowClear />
</Form.Item>
</Col>
<Col span={12}>
<Form.Item
label="调度状态"
name="status"
rules={[{required: true}]}
>
<NormalSelect disabled={mode==='view'} options={[{label:"执行中",value:0},{label:"完成",value:1}]}/>
</Form.Item>
</Col>
</Row>
<Row>
<Col span={24}>
<Form.Item
label="调度原因"
name="dispatchReason"
labelCol={{ span: 3 }}
wrapperCol={{ span: 19 }}
>
<Input.TextArea disabled={mode==='view'} style={{width:'100%',minHeight:'100px'}} allowClear />
</Form.Item>
</Col>
</Row>
<Row>
<Col span={24}>
<Form.Item
label="调度详情"
name="dispatchDetail"
labelCol={{ span: 3 }}
wrapperCol={{ span: 19 }}
>
<Input.TextArea disabled={mode==='view'} style={{width:'100%',minHeight:'100px'}} allowClear />
</Form.Item>
</Col>
</Row>
<Row>
<Col span={24}>
<Form.Item
label="附件"
name="fieldId"
labelCol={{ span: 3 }}
wrapperCol={{ span: 19 }}
>
{mode !== "view" &&
<Dragger
name='file'
// multiple
action="/gunshiApp/tsg/dispatchRecord/file/upload/singleSimple"
onChange={fileChange}
onDrop={(info) => { console.log(info.dataTransfer.files); }}
fileList={fileList}
disabled={loading}
// onSuccess={handleSuccess}
>
<p className="ant-upload-text">点击或拖拽文件到此区域上传</p>
<p className="ant-upload-hint">
支持扩展名.doc .docx .pdf .jpg .png .xlsx .xls
</p>
</Dragger>
}
<Row gutter={[16]} style={{marginTop:"30px"}}>
{
fileList?.length > 0 && fileList?.map(file => {
return (
<Col span={12}>
<div className="file-item" style={{width:"75%"}}>
<div className='file-description'>
{file.name.indexOf('.docx') > -1 ?
<div
onClick={() => { download(file.response?.data?.fileId) }}
style={{ cursor: 'pointer' }}
>
<FileWordOutlined
style={{ fontSize: 40 }}
/>
</div>
:
file.name.indexOf('.pdf') > -1 ?
<div
onClick={() => { viewPdf(file.response?.data?.fileId) }}
style={{ cursor: 'pointer' }}
>
<FilePdfOutlined style={{ fontSize: 40 }} />
</div>
:
file.name.indexOf('.zip') > -1 ?
<div
onClick={() => { download(file.response?.data?.fileId) }}
style={{ cursor: 'pointer' }}
>
<FileZipOutlined style={{ fontSize: 40 }} />
</div>
:
file.name.indexOf('.xlsx') > -1 ?
<div
onClick={() => { download(file.response?.data?.fileId) }}
style={{ cursor: 'pointer' }}
>
<FileExcelOutlined style={{ fontSize: 40 }} />
</div>
:
<Image width={60} src={url +file.response?.data?.filePath} alt='' />
}
<span>{file.name}</span>
</div>
<div className={mode == "view" ? 'delete-icon disable-icon' : 'delete-icon'} onClick={() => deleteFile(file.response?.data?.fileId)}>
<DeleteOutlined />
</div>
</div>
</Col>
)
})
}
</Row>
</Form.Item>
</Col>
</Row>
{
mode==='view'?null:(
<>
<Form.Item {...btnItemLayout}>
<Button type="primary" htmlType="submit">
{mode === 'save' ? '提交' : '修改'}
</Button>
</Form.Item>
</>
)
}
</Form>
<Modal
open={pdfViewOPen}
width={1000}
title=""
footer={null}
style={{marginTop:"-5%"}}
onCancel={() => {
setPdfViewOPen(false)
}}
>
<iframe
style={{
height: '80vh',
width: '100%',
border: 0,
marginTop: 20,
}}
src={`${process.env.PUBLIC_URL}/static/pdf/web/viewer.html?file=${encodeURIComponent(`/gunshiApp/tsg/dispatchRecord/file/download/${iframeSrc}`)}`}
/>
</Modal>
</>
);
}
export default ModalForm;

View File

@ -1,184 +0,0 @@
import React, { Fragment, useRef, useMemo,useEffect,useState } from 'react';
import BasicCrudModal from '../../../components/crud/BasicCrudModal';
import { Table, Card, Alert } from 'antd';
import { useSelector } from 'react-redux';
import ToolBar from './toolbar';
import ModalForm from './form';
import apiurl from '../../../service/apiurl';
import usePageTable from '../../../components/crud/usePageTable2';
import { createCrudService } from '../../../components/crud/_';
import {CrudOpRender_text} from '../../../components/crud/CrudOpRender';
import { exportFile } from '../../../utils/tools.js';
import { httppost2, httppost5 } from '../../../utils/request';
import moment from 'moment';
const statusVal = {'0':'执行中','1':'完成'}
const url = "http://223.75.53.141:9102/test.by-lyf.tmp"
const Page = () => {
const role = useSelector(state => state.auth.role);
const editBtn = role?.rule?.find(item => item.menuName == "编辑")||true;
const viewBtn = role?.rule?.find(item => item.menuName == "查看")||true;
const delBtn = role?.rule?.find(item => item.menuName == "删除")||true;
const refModal = useRef();
const [searchVal, setSearchVal] = useState(false)
const [isChecked, setIsChecked] = useState(false)
const [delVal, setDelVal] = useState([])
const [num,setNum] = useState(0)
const columns = [
{ title: '序号', key: 'inx', dataIndex: 'inx', width: 60, align: "center" },
{title: '调度开始时间', key: 'startTime', dataIndex: 'startTime', width: 140,},
{title: '调度结束时间', key: 'endTime', dataIndex: 'endTime', width: 140,},
{title: '调度原因', key: 'dispatchReason', dataIndex: 'dispatchReason', width: 140,},
{title: '调度详情', key: 'dispatchDetail', dataIndex: 'dispatchDetail', width: 140,},
{title: '操作人', key: 'opUserName', dataIndex: 'opUserName', width: 140,},
{title: '调度状态', key: 'status', dataIndex: 'status', width: 140, render:(v)=>statusVal[v]},
{
title: '操作', key: 'operation', width: 200, fixed: 'right',align: 'center',
render: (value, row, index) => (
<CrudOpRender_text
edit={editBtn ? true : false}
del={delBtn ? true : false}
view={viewBtn ? true : false}
command={(cmd) => () => command(cmd)(row)} />)
},
];
const width = useMemo(() => columns.reduce((total, cur) => total + (cur.width), 0), [columns]);
const command = (type) => (params) => {
if (type === 'save') {
refModal.current.showSave({status:0});
} else if (type === 'edit') {
refModal.current.showEdit({ ...params });
} else if (type === 'view') {
refModal.current.showView(params);
} else if (type === 'del') {
let myParams
if(params.id){
myParams = [params.id]
}else{
myParams = params
}
refModal.current.onDelete(apiurl.ddjl.del,myParams);
setIsChecked(false)
}
}
const exportExcel = () => {
let params = {
...searchVal,
"pageSo": {
"pageSize": tableProps.pagination.current,
"pageNumber": tableProps.pagination.pageSize
},
}
httppost5(apiurl.ddjl.export, params).then(res => {
exportFile(`调度记录.xlsx`,res.data)
})
}
const { tableProps, search, refresh } = usePageTable(createCrudService(apiurl.ddjl.page).find_noCode);
console.log(tableProps);
/**
* @description 处理成功的回调
*/
useEffect(() => {
if (searchVal) {
const params = {
search: {
...searchVal,
}
};
search(params)
}
}, [searchVal])
useEffect(()=>{
(async()=>{
const { code, data } = await httppost2(apiurl.ddjl.page,{
"pageSo": {
"pageSize": 10,
"pageNumber": 1
},
"dateSo": {
"start": moment().format('YYYY-01-01 00:00:00'),
"end": moment().format('YYYY-MM-DD HH:mm:ss')
}
})
if(code===200){
setNum(data.total)
}
})()
})
return (
<>
<div className='content-root clearFloat xybm' style={{paddingRight:"0",paddingBottom:"0"}}>
<div className='lf CrudAdcdTreeTableBox' style={{width:"100%",overflowY:"auto"}}>
<Card className='nonebox'>
<ToolBar
setSearchVal={setSearchVal}
onSave={command('save')}
setIsChecked={(v)=>setIsChecked(v)}
setDelVal={(v)=>setDelVal(v)}
isChecked={isChecked}
exportFile={exportExcel}
role={role}
/>
</Card>
<div className="ant-card-body" style={{ padding: "20px 0 0 0" }}>
<Alert
message={moment().format('YYYY')+'年共接收调度令'+num+'个。'}
style={{marginBottom:'10px'}}
type="info"
/>
{
isChecked?
<Alert
message={'已选择'+delVal.length+'项'}
style={{marginBottom:'10px'}}
type="error"
action={delVal.length>0?<CrudOpRender_text del={true} command={(type) => () => command(type)(delVal)} />:null}
/>:null
}
<Table
columns={columns}
rowKey="inx"
{...tableProps}
scroll={{ x: width , y: "calc( 100vh - 400px )"}}
rowSelection={
isChecked?
{
type: 'checkbox',
onChange: (v,e)=>setDelVal(e.map((i)=>i.id))
}:null
}
/>
</div>
</div>
<BasicCrudModal
width={1000}
ref={refModal}
title=""
component={ModalForm}
onCrudSuccess={refresh}
/>
</div>
</>
);
}
export default Page;

View File

@ -1,30 +0,0 @@
.basic-info{
position: relative;
font-size: 16px;
margin-bottom: 20px;
padding:5px 25px;
border-bottom: 1px solid #eee;
&::before{
position: absolute;
top:8px;
left:0;
content: "";
display: block;
width: 5px;
height: 20px;
background-color: #0079fe;
}
}
.time-line{
width: 50%;
margin-left: 6%;
margin-top: 1%;
.time-line-item{
display: flex;
// align-items: center;
column-gap: 20px;
.item-right{
flex:1
}
}
}

View File

@ -1,87 +0,0 @@
import React, { useEffect,useState } from 'react';
import { Form, Input, Button, DatePicker } from 'antd';
import NormalSelect from '../../../components/Form/NormalSelect';
import moment from 'moment';
const { RangePicker } = DatePicker;
const ToolBar = ({ setSearchVal, onSave, storeData, role, setIsChecked, setDelVal, isChecked, exportFile }) => {
const addBtn = role?.rule?.find(item => item.menuName == "新增")||true;
const searchBtn = role?.rule?.find(item => item.menuName == "查询")||true;
const [form] = Form.useForm();
const delChange = ()=>{
if(isChecked){
setIsChecked(false)
setIsChecked(false)
}else{
setIsChecked(true)
setIsChecked(true)
setDelVal([])
}
}
const onFinish = (values) => {
let dateSo;
if (values.tm) {
dateSo = {
start: moment(values.tm[0]).format('YYYY-MM-DD 00:00:00'),
end: moment(values.tm[1]).format('YYYY-MM-DD 00:00:00')
}
}
delete values.tm
setSearchVal({...values, dateSo});
}
useEffect(() => {
let dateSo = {
start: moment().format('YYYY-01-01 00:00:00'),
end: moment().format('YYYY-MM-DD 00:00:00')
}
form.setFieldValue("tm", [moment(dateSo.start), moment(dateSo.end)])
setSearchVal({ dateSo })
}, [])
return (
<>
<div style={{display:'flex',justifyContent:'space-between'}}>
<Form form={form} className='toolbarBox' layout="inline" onFinish={onFinish}>
<Form.Item label="时间段" name="tm">
<RangePicker
allowClear
style={{ width: "300px" }}
format="YYYY-MM-DD"
/>
</Form.Item>
<Form.Item label="操作人" name="opUserName">
<Input allowClear style={{width:'150px'}}/>
</Form.Item>
<Form.Item label="调度状态" name="status">
<NormalSelect options={[{label:"执行中",value:"0"},{label:"完成",value:"1"}]} style={{width:'150px'}}/>
</Form.Item>
{searchBtn ? <Form.Item>
<Button type="primary" htmlType="submit">查询</Button>
</Form.Item> : null }
<Form.Item>
<Button onClick={() => form.resetFields()}>重置</Button>
</Form.Item>
<Form.Item>
<Button size='Default' onClick={delChange} type={isChecked?"primary":""}>删除</Button>
</Form.Item>
{
(onSave && addBtn) ?
<Form.Item>
<Button onClick={onSave}>新增</Button>
</Form.Item>
:null
}
<Form.Item>
<Button size='Default' onClick={exportFile}>导出</Button>
</Form.Item>
</Form>
</div>
</>
);
}
export default ToolBar;

View File

@ -20,7 +20,7 @@ const ToolBar = ({ setSearchVal, onSave, exportFile,role }) => {
}
}
delete values.tm
setSearchVal({...values, dateSo});
setSearchVal({...values, startTime:dateSo?.start,endTime:dateSo?.end});
}
@ -31,7 +31,7 @@ const ToolBar = ({ setSearchVal, onSave, exportFile,role }) => {
end:moment(time[1]).format('YYYY-MM-DD 23:59:59'),
}
form.setFieldValue("tm",time)
setSearchVal({dateSo})
setSearchVal(dateSo)
}, [])
return (
<>