fix():修复bug

lsf-dev
李神峰 2024-10-17 17:42:32 +08:00
parent f2aed12182
commit c68b142031
18 changed files with 79 additions and 57 deletions

View File

@ -29,12 +29,17 @@ function DrpSearch({record}) {
}, [echartData])
const searchTm = (e) => {
setParams({
...params,
startTime: e[0].format("YYYY-MM-DD HH:mm"),
endTime: e[1].format("YYYY-MM-DD HH:mm"),
tm: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,
})
}
};
const doSearch = () => {
getData(params)

View File

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

View File

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

View File

@ -1,5 +1,5 @@
import React,{useEffect,useMemo,useState} from 'react'
import { Button, DatePicker, Table } from 'antd';
import { Button, DatePicker, Table,message } from 'antd';
import { createCrudService } from '../../../components/crud/_';
import usePageTable from '../../../components/crud/usePageTable2';
import moment from 'moment';
@ -32,15 +32,24 @@ 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 = () => {
const doSearch = () => {
if (!params?.tm) {
message.warning('请选择查询时间段')
return;
}
const exportParams={
...params,
stm: params.tm[0].format("YYYY-MM-DD HH:mm:ss"),

View File

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

View File

@ -225,11 +225,13 @@ const Page = () => {
const params = {
search: {
...searchVal,
searchType:mode
searchType: mode,
isAsc: false,
orderField:"tm"
}
};
search(params)
getGsChartData(params?.search)
getGsChartData({...params?.search, isAsc: true, })
}, [searchVal, mode])
useEffect(() => {
@ -264,8 +266,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,11 +3,11 @@ let title = "总计";
let color = ["#73a0fa", "#52c1f5"];
let echartData = [
{
name: "生活供水",
name: "发电灌溉",
value: parseFloat(obj?.shgs?.toFixed(2))
},
{
name: "生态供水",
name: "水厂取水",
value: parseFloat(obj?.stgs?.toFixed(2)),
},
];

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 00:00:00')
end: moment(values.tm[1]).format('YYYY-MM-DD 23:59:59')
}
}
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 00:00:00')
end: moment().format('YYYY-MM-DD 23:59:59')
}
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 00:00:00')
end: moment(values.tm[1]).format('YYYY-MM-DD 23:59:59')
}
}
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 00:00:00')
end: moment().format('YYYY-MM-DD 23:59:59')
}
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 00:00:00')
end: moment(values.tm[1]).format('YYYY-MM-DD 23:59:59')
}
}
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 00:00:00')
end: moment().format('YYYY-MM-DD 23:59:59')
}
form.setFieldValue("tm", [moment(dateSo.start), moment(dateSo.end)])
setSearchVal({ dateSo })

View File

@ -115,8 +115,9 @@ 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

@ -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 : 1, // 强制显示所有标签
interval: Xdata.length > 5 ? 0 : 0, // 强制显示所有标签
rotate: Xdata.length > 5 ? 20 : 0 // 旋转角度
},
data: Xdata

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: 'itemProblemDesc', dataIndex: 'itemProblemDesc', width: 300,ellipsis:true },
{ title: '巡查问题描述', key: 'problemDesc', dataIndex: 'problemDesc', 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,8 +219,7 @@ console.log(record);
</Col>
</Row>
<Row>
{
record?.status != 0 ?
<Col span={12}>
<Form.Item
label="开始日期"
@ -231,8 +230,7 @@ console.log(record);
>
<DatePicker disabled={mode==='view'} format={'YYYY-MM-DD'} style={{width:'100%'}} allowClear />
</Form.Item>
</Col> : null
}
</Col>
<Col span={12}>
<Form.Item
label="结束日期"
@ -254,10 +252,9 @@ console.log(record);
getValueProps={(value) => ({ value: value ? moment(value) : undefined })}
placeholder=""
>
<DatePicker disabled={mode==='view'} format={'YYYY-MM-DD'} style={{width:'100%'}} allowClear />
<DatePicker disabled={mode==='view'} format={'YYYY-MM-DD HH:mm'} style={{width:'100%'}} allowClear />
</Form.Item>
</Col>
{record?.status == 2 ?
<Col span={12}>
<Form.Item
label="完成时间"
@ -267,10 +264,9 @@ console.log(record);
placeholder=""
>
<DatePicker disabled={mode==='view'} format={'YYYY-MM-DD'} style={{width:'100%'}} allowClear />
<DatePicker disabled={mode==='view'} format={'YYYY-MM-DD HH:mm'} style={{width:'100%'}} allowClear />
</Form.Item>
</Col> : null
}
</Col>
</Row>
<Row>
<Col span={12}>

View File

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

View File

@ -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 00:00:00')
end: moment(values.tm[1]).format('YYYY-MM-DD 23:59:59')
}
}
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 00:00:00')
end: moment().format('YYYY-MM-DD 23:59:59')
}
form.setFieldValue("tm", [moment(dateTimeRangeSo.start), moment(dateTimeRangeSo.end)])
setSearchVal({ dateTimeRangeSo })

View File

@ -317,7 +317,7 @@ const ModalForm = ({ mode, record, onEdit, onSave, onSimilarSave }) => {
label="填报人"
name="applicant"
>
<Input disabled={mode==='view'} style={{width:'100%'}} allowClear />
<Input disabled={true} 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'),
etm: moment(values.tm[1]).format('YYYY')
stm: moment(values.tm[0]).format('YYYY-01-01'),
etm: moment(values.tm[1]).format('YYYY-12-31')
}
}
delete values.tm

View File

@ -128,8 +128,8 @@ const Page = () => {
<div className='children-itm'>
<span>本年培训期数</span>
<span>计划/实际</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>
<span><span style={{ fontSize: 22, fontWeight: "bold" }}>{ staData?.numberOfPeriods2 ?? "--"}</span>&nbsp;期/
<span style={{fontSize:22,fontWeight:"bold"}}>{ staData?.numberOfPeriods1 ?? "--"}</span>&nbsp;</span>
</div>
</div>
@ -138,8 +138,8 @@ const Page = () => {
<div className='children-itm'>
<span>本年培训人次</span>
<span>计划/实际</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>
<span><span style={{fontSize:22,fontWeight:"bold"}}>{ staData?.personNum2 ?? "--"}</span>&nbsp;人次/
<span style={{fontSize:22,fontWeight:"bold"}}>{ staData?.personNum1 ?? "--"}</span>&nbsp;</span>
</div>
</div>
</div>