feat(): 新添测试数据

lsf-dev
李神峰 2024-10-21 11:13:02 +08:00
parent 829de474a9
commit 68ef68f867
25 changed files with 154 additions and 90 deletions

View File

@ -52,6 +52,7 @@
"react-router": "^6.3.0",
"react-router-dom": "^6.3.0",
"react-scripts": "5.0.1",
"react-window": "^1.8.10",
"redux": "^4.2.0",
"typescript": "^4.7.4"
},

Binary file not shown.

Before

Width:  |  Height:  |  Size: 110 KiB

After

Width:  |  Height:  |  Size: 111 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 180 KiB

After

Width:  |  Height:  |  Size: 179 KiB

View File

@ -412,7 +412,8 @@ const apiurl = {
page: service_fxdd + "/rota/log/page",
save: service_fxdd + "/rota/log/insert",
edit: service_fxdd + "/rota/log/update",
delete: service_fxdd + "/rota/log/del"
delete: service_fxdd + "/rota/log/del",
rotaUser: service_fxdd + "/rota/date/list"
}
},
gcdsj: {

View File

@ -9,6 +9,18 @@ const { toString } = class2type;
'Boolean Number String Function Array Date RegExp Object Error'.split(' ').forEach((name) => {
class2type[`[object ${name}]`] = name.toLowerCase();
});
export const fileDownload = (url,params) => {
let downloadLink = document.createElement("a");
downloadLink.href = `http://local.gunshiiot.com:18083/gunshiApp/${url}/${params?.fileId}`;
downloadLink.download = `${params.fileName}`;
downloadLink.style.display = "none";
// 将链接添加到页面中
document.body.appendChild(downloadLink);
// 模拟点击事件,开始下载
downloadLink.click();
}
/**
* 对象类型
* @param {object} obj

View File

@ -71,7 +71,7 @@ function RealDrpTip({ id, data, dispatch }) {
border: "1px solid #74a7ff",
borderRadius: "5px"
}
}> {{MM: '气象站',PP: '雨量站',RR: '水库水文站',ZZ: '河道水位站',ZQ:"河道水文站"}?.[data?.sttp]}{{'SH':'山洪','SW':'水文','QX':'气象','SK':'水库'}?.[data.source]}</span>}
}> {{MM: '气象站',PP: '雨量站',RR: '水库水文站',ZZ: '河道水位站',ZQ:"河道水文站"}?.[data?.sttp]}</span>}
<div className="normalModalStyle_title_cancel">
<CloseOutlined onClick={closePop} style={{color:"#333"}}/>
</div>

View File

@ -1,7 +1,7 @@
.file-item{
display: flex;
width: 100%;
margin-top: -10px;
margin-top: 10px !important;
align-items: center;
border: 1px solid #dedede;
justify-content: space-between;

View File

@ -317,7 +317,7 @@ export default function Xmzlmb() {
columns={columns1}
key="inx"
dataSource={dataSources}
pagination={{pageSize:5}}
pagination={false}
scroll={{ x: width, y: 250, scrollToFirstRowOnChange: true }}
onRow={record => {
return {

View File

@ -18,4 +18,4 @@
height: 20px;
background-color: #0079fe;
}
}
}

View File

@ -1,7 +1,9 @@
export default function jrxOptions(data = {}, type = "1") {
const yMin = type == "1" ? 147 : type == "2" ? 146 : 146;
const yMax = type == "1" ? 209 : type == "2" ? 210 : 210;
// const yMin = type == "1" ? 147 : type == "2" ? 146 : 146;
// const yMax = type == "1" ? 209 : type == "2" ? 210 : 210;
const yMin = type == "1" ? 70 : type == "2" ? 70 : 70;
const yMax = type == "1" ? 154 : type == "2" ? 150 : 150;
const type1 = ["SY05", "SY06", "SY07", "SY08"]
const type2 = ["SY09","SY10","SY11","SY12"]
const alltype = type == "1" ? type1 : type == "2" ? type2 : type2;
@ -13,35 +15,48 @@ const textColor = '#666'
const imageUrl = type == "1" ? imageUrl060 :
type == "2" ? imageUrl090 : imageUrl090;
const rule = `${process.env.PUBLIC_URL}/assets/images/ruler.png `
// const xValue = (( (data?.rz - 169 ) + 0.85 * 14) / 0.85)
const xValue = type == "1" ? (((data?.rz - 169) + 0.75 * 14) / 0.75):
type == "2" ?(((data?.rz - 169) + 0.85 * 14) / 0.85) :(((data?.rz - 169) + 0.85 * 14) / 0.85)
// const xValue = type == "1" ? (((data?.rz - 169) + 0.75 * 14) / 0.75):
// type == "2" ? (((data?.rz - 169) + 0.85 * 14) / 0.85) : (((data?.rz - 169) + 0.85 * 14) / 0.85)
const xValue = type == "1" ? (((data?.rz - 99) + 1.1 * 13) / 1.1):
type == "2" ? (((data?.rz - 99) + 1 * 14) / 1) : (((data?.rz - 99) + 1 * 14) / 1)
const rz = data?.rz ?
[[xValue, data?.rz], [0, data?.rz], ] :
[]
const rz1 = data?.rz ?
[[0,169],[14, 169], [xValue, data?.rz]] :
const rz1 = data?.rz ?
type == "1" ?
[[0, 99], [13, 99], [xValue, data?.rz]]:
type == "2" ?
[[0, 99], [14, 99], [xValue, data?.rz]]
: [[0, 99], [14, 99], [xValue, data?.rz]]
:
[]
const gz1 = data[alltype[0]] ?
type == "1" ? [[51.6, 158], [51.6, data[alltype[0]]]] :
type == "2" ? [[47.5, 158], [47.5, data[alltype[0]]]] :
[[47.5, 158], [47.5, data[alltype[0]]]]
const gz1 = data[alltype[0]] ?
type == "1" ? [[51.6, 85], [51.6, data[alltype[0]]]] :
type == "2" ? [[47.5, 85], [47.5, data[alltype[0]]]] :
[[47.5, 158], [85, data[alltype[0]]]]
: [];
// const gz1 = [[51.6, 85],[51.6, 91]];
// const gz2 = [[53.6, 85], [53.6, 94]];
// const gz3 = [[72.5, 90], [72.5, 95]];
// const gz4 = [[84.5, 96], [84.5, 99]];
const gz2 = data[alltype[1]] ?
type == "1" ? [[53.6, 158], [53.6, data[alltype[1]]]] :
type == "2" ? [[49.5, 158], [49.5, data[alltype[1]]]] :
type == "1" ? [[53.6, 85], [53.6, data[alltype[1]]]] :
type == "2" ? [[49.5, 85], [49.5, data[alltype[1]]]] :
[[53.6, 158], [53.6, data[alltype[1]]]] :
[];
const gz3 = data[alltype[2]] ?
type == "1" ? [[72.5, 161], [72.5, data[alltype[2]]]] :
type == "2" ? [[66.5, 162], [66.5, data[alltype[2]]]] :
type == "1" ? [[72.5, 90], [72.5, data[alltype[2]]]] :
type == "2" ? [[66.5, 90], [66.5, data[alltype[2]]]] :
[[73, 161], [73, data[alltype[2]]]] : [];
const gz4 = data[alltype[3]] ?
type == "1" ? [[84.5, 166], [84.5, data[alltype[3]]]] :
type == "2" ? [[77, 161], [77, data[alltype[3]]]] :
type == "1" ? [[84.5, 96], [84.5, data[alltype[3]]]] :
type == "2" ? [[77, 96], [77, data[alltype[3]]]] :
[[85, 166], [85, data[alltype[3]]]] : [];
const line = data?.rz ?

View File

@ -21,15 +21,15 @@ const ToolBar = ({ setSearchVal, onSave,setSwiper,exportFile,role }) => {
setSearchVal({...values, dateTimeRangeSo:dateSo});
}
// useEffect(() => {
// let time = [moment().subtract(1,"months"),moment()]
// let dateSo = {
// start:moment(time[0]).format('YYYY-MM-DD 00:00:00'),
// end:moment(time[1]).format('YYYY-MM-DD 00:00:00'),
// }
// form.setFieldValue("tm",time)
// setSearchVal({dateTimeRangeSo:dateSo})
// }, [])
useEffect(() => {
let time = [moment().subtract(1,"days"),moment()]
let dateSo = {
start:moment(time[0]).format('YYYY-MM-DD 00:00:00'),
end:moment(time[1]).format('YYYY-MM-DD 23:59:59'),
}
form.setFieldValue("tm",time)
setSearchVal({dateTimeRangeSo:dateSo})
}, [])
useEffect(() => {
form.setFieldValue("swiper",false)

View File

@ -18,7 +18,7 @@ const EditableCell = ({
}) => {
const inputNode = inputType === 'select' ?
<NormalSelect allowClear options={optionsType} style={{ textAlign: "center",width:150 }} /> :
<Input style={{ textAlign: "center",width:150 }} />;
<InputNumber style={{ textAlign: "center",width:150 }} min={0} />;
return (
<td {...restProps}>
{editing ? (
@ -132,7 +132,7 @@ const ModalForm = ({ mode, record, onEdit, onSave}) => {
year:form.getFieldValue("year")
});
let total = newData.reduce((total,cur) => total + Number(cur.drp),0)
form.setFieldValue("drp",total)
form.setFieldValue("drp",total?.toFixed(1))
setDetails(newData);
detailsRef.current = newData
setEditingKey('');
@ -181,7 +181,7 @@ const ModalForm = ({ mode, record, onEdit, onSave}) => {
setDetails(newData);
detailsRef.current = newData
let total = newData.reduce((total,cur) => total + Number(cur.drp),0)
form.setFieldValue("drp",total)
form.setFieldValue("drp",total?.toFixed(1))
};
const types = [
@ -222,7 +222,7 @@ const ModalForm = ({ mode, record, onEdit, onSave}) => {
useEffect(() => {
if (mode !== "save") {
let total = record.list.reduce((total, cur) => total + cur.drp, 0)
form.setFieldsValue({ ...record, drp: total, year: record.year + '' })
form.setFieldsValue({ ...record, drp: total?.toFixed(1), year: record.year + '' })
setDetails(record.list)
detailsRef.current = record.list
}

View File

@ -125,7 +125,7 @@ export default function drpOption (data) {
],
series: [
{
name: '生态供水',
name: '发电灌溉',
type: 'line',
symbol: 'none',
smooth: true,
@ -136,7 +136,7 @@ export default function drpOption (data) {
data: data.map(o => o.ecologyV)
},
{
name: '生活供水',
name: '水厂取水',
type: 'line',
smooth: true,
color: '#36e9e9',

View File

@ -146,6 +146,11 @@ const ModalForm = ({ mode, record, onEdit, onSave, onSimilarSave }) => {
<Form.Item
label="工程状态"
name="projectStatus"
rules={[
{
required: true,
},
]}
// labelCol={{style:{marginLeft:-10}}}
>
<NormalSelect disabled={mode === 'view'} style={{ width: '100%' }} allowClear options={statusOptions} />
@ -153,6 +158,16 @@ const ModalForm = ({ mode, record, onEdit, onSave, onSimilarSave }) => {
</Col>
</Row>
<Row>
<Col span={12}>
<Form.Item
label="开工日期"
name="startDate"
getValueFromEvent={(e,dateString) => dateString}
getValueProps={(value) => ({ value: value ? moment(value) : undefined })}
>
<DatePicker disabled={mode==='view'} format={'YYYY-MM-DD'} style={{width:'100%'}} allowClear />
</Form.Item>
</Col>
<Col span={12}>
<Form.Item
label="竣工日期"
@ -164,21 +179,7 @@ const ModalForm = ({ mode, record, onEdit, onSave, onSimilarSave }) => {
<DatePicker disabled={mode==='view'} format={'YYYY-MM-DD'} style={{width:'100%'}} allowClear />
</Form.Item>
</Col>
<Col span={12}>
<Form.Item
label="开工日期"
name="startDate"
getValueFromEvent={(e,dateString) => dateString}
getValueProps={(value) => ({ value: value ? moment(value) : undefined })}
rules={[
{
required: true,
},
]}
>
<DatePicker disabled={mode==='view'} format={'YYYY-MM-DD'} style={{width:'100%'}} allowClear />
</Form.Item>
</Col>
</Row>
<Row>
<Col span={12}>
@ -187,11 +188,6 @@ const ModalForm = ({ mode, record, onEdit, onSave, onSimilarSave }) => {
name="operationDate"
getValueFromEvent={(e,dateString) => dateString}
getValueProps={(value) => ({ value: value ? moment(value) : undefined })}
rules={[
{
required: true,
},
]}
>
<DatePicker disabled={mode==='view'} format={'YYYY-MM-DD'} style={{width:'100%'}} allowClear />
</Form.Item>

View File

@ -176,7 +176,8 @@ const AdcdTreeSelector: React.FC<IProps> = ({ onSelectFun, setAdcd, showCheckbox
}
const onOk = async () => {
const name = form.getFieldValue('name');
const name = form.getFieldValue('name').replace(/\s/g,"");
if(!name) return
const url = mode == "save" ? apiurl.rcgl.aqgl.fxgkqd.saveTree : apiurl.rcgl.aqgl.fxgkqd.editTree;
let saveParams = {
name,

View File

@ -115,7 +115,6 @@ 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}))
values.menuId = record.code;

View File

@ -177,7 +177,6 @@ const ModalForm = ({ mode, record, onEdit, onSave, onSimilarSave }) => {
setData([details,...data])
}
}
console.log(details);
}, [details])
return (

View File

@ -85,7 +85,7 @@ const getResultList = async() => {
return window.performance.now().toString().replace('.', '');
}
const onfinish = (values) => {
const dicId = values.actSign.map(item=> ({sysDictId:item}))
const dicId = values.actSign.map(item=> ({sysDictId:item,dictNm:resultOptions.find(o => o.value == item)?.label}))
let imgFiles = imgfileList.map(item => ({
fileId: item.response?.data?.fileId,
fileName: item.response?.data?.fileName,

View File

@ -1,13 +1,14 @@
import React, { Fragment, useRef, useMemo,useEffect,useState } from 'react';
import BasicCrudModal from '../../../../components/crud/BasicCrudModal';
import { Upload, message,Image,Button } from 'antd';
import {PaperClipOutlined,DownloadOutlined,DeleteOutlined } from '@ant-design/icons';
import { Upload, message,Image,Button,Popconfirm,Modal } from 'antd';
import {PaperClipOutlined,DownloadOutlined,DeleteOutlined,ExclamationCircleOutlined } from '@ant-design/icons';
import { useSelector } from 'react-redux';
import ToolBar from './toolbar';
import ModalForm from './form';
import apiurl from '../../../../service/apiurl';
import { httpget2,httppost2 } from '../../../../utils/request';
import "./index.less"
const { confirm } = Modal;
const url = "http://223.75.53.141:9102/test.by-lyf.tmp"
const Page = () => {
const role = useSelector(state => state.auth.role);
@ -93,26 +94,41 @@ const Page = () => {
const deleteFile = async (id, type) => {
const urlRequest = type == "file" ? apiurl.rcgl.byfz.fzxc.delete : apiurl.rcgl.byfz.fzxc.picDelete
try {
const res = await httpget2(urlRequest + `/${id}`)
if (res.code == 200) {
message.success('删除成功');
if (type == "file") {
getFileList()
confirm({
title: '删除',
icon: <ExclamationCircleOutlined />,
content: '确认删除此数据',
okText: '确定',
okType: 'primary',
cancelText: '取消',
onOk: async() => {
try {
const res = await httpget2(urlRequest + `/${id}`)
if (res.code == 200) {
message.success('删除成功');
if (type == "file") {
getFileList()
}
if (type == "pic") {
getPicList()
}
}
} catch (error) {
console.log(error);
}
if (type == "pic") {
getPicList()
}
}
} catch (error) {
console.log(error);
}
},
onCancel() {
console.log('Cancel');
},
});
}
const bytesToKB = (bytes) => {
return (bytes / 1024).toFixed(2);
}
useEffect(() => {
getFileList();
getPicList();
@ -157,11 +173,11 @@ const Page = () => {
title="下载"
onClick={() => download(item.fileId)}
/>
<DeleteOutlined
style={{ fontSize: 15, cursor: "pointer" }}
title="删除"
onClick={() => deleteFile(item.fileId,"file")}
/>
<DeleteOutlined
style={{ fontSize: 15, cursor: "pointer" }}
title="删除"
onClick={() => deleteFile(item.fileId,"file")}
/>
</div>
</div>
)):null

View File

@ -417,7 +417,9 @@ const EditableRow = ({ index, ...props }) => {
getZbTableData(Item?.id,2)
}
} else {
const newData = tableData.filter(item => item.standardScore > item.assessScore)
// debugger
const newData = tabs == 2 ? tableData.filter(item => item.standardScore > item.indicatorScore) :
tableData.filter(item => item.standardScore > item.assessScore)
newData.forEach(item => {
if (item.rowSpan) delete item.rowSpan;
})

View File

@ -160,7 +160,6 @@ export default function PersonForm({treeList,deptList,callback,onCancel,selectPe
setTargetKeys(keys);
};
useEffect(() => {
debugger
setTargetKeys(selectPerson)
}, [selectPerson])

View File

@ -176,7 +176,8 @@ const AdcdTreeSelector: React.FC<IProps> = ({ onSelectFun, setAdcd, showCheckbox
}
const onOk = async () => {
const name = form.getFieldValue('name');
const name = form.getFieldValue('name').replace(/\s/g,"");
if(!name) return
const url = mode == "save" ? apiurl.rcgl.jdkh.khzbgl.saveTree : apiurl.rcgl.jdkh.khzbgl.editTree;
let saveParams = {
name,

View File

@ -216,7 +216,7 @@ const ModalForm = ({ mode, record, onEdit, onSave, onSimilarSave }) => {
useEffect(() => {
if (mode !== "save") {
let total = record.indicatorRatings.reduce((total, cur) => total + cur.standardScore, 0)
let total = record?.indicatorRatings?.reduce((total, cur) => total + cur.standardScore, 0)
setStandardScore(total)
setDetails(record.indicatorRatings)
detailsRef.current = record.indicatorRatings

View File

@ -11,7 +11,7 @@ import { createCrudService } from '../../../components/crud/_';
import { CrudOpRender_text } from '../../../components/crud/CrudOpRender';
import { exportFile } from '../../../utils/tools.js';
import { httppost5,httpget2 } from '../../../utils/request';
import {fileDownload} from "../../../utils/tools"
const Page = () => {
const url = "http://223.75.53.141:9102/test.by-lyf.tmp"
const role = useSelector(state => state.auth.role);
@ -83,9 +83,15 @@ const Page = () => {
const reviewPic = (arrPic) => {
const url = "tsg/personnelPlan/file/download";
if (arrPic.length > 0) {
setImgVisible(true)
setImgList(arrPic)
const filename = arrPic[0]?.fileName
if (filename.indexOf('.jpg') > -1 || filename.indexOf('.png')> -1 || filename.indexOf('.jpeg') > -1) {
setImgVisible(true)
setImgList(arrPic)
} else {
fileDownload(url,arrPic[0])
}
}
}
const command = (type) => (params) => {

View File

@ -91,6 +91,22 @@ const ModalForm = ({ mode, record,onEdit,onSave,onCrudSuccess }) => {
onSave(apiurl.rcgl.zbgl.zbrz.save,values)
}
}
// 根据年月日查询人员
const getRotaUser = async (date) => {
try {
const result = await httpget2(apiurl.rcgl.zbgl.zbrz.rotaUser, {rotaDate: moment(date).format('YYYY-MM-DD')});
if (result.code == 200 && mode == "save") {
const dept = result.data.find(item => item.rotaType == 2).userId;
const lead = result.data.find(item => item.rotaType == 1).userId;
form.setFieldValue("dutyUserId",dept)
form.setFieldValue("leaderUserId",lead)
}
} catch (error) {
console.log(error);
}
}
useEffect(() => {
getDeptList()
// getDeptUser()
@ -115,7 +131,7 @@ const ModalForm = ({ mode, record,onEdit,onSave,onCrudSuccess }) => {
value: value ? moment(value) : undefined
})}
>
<DatePicker allowClear style={{ width: '100%' }} disabled={mode==='view'} />
<DatePicker allowClear style={{ width: '100%' }} disabled={mode==='view'} onChange={e => getRotaUser(e)} />
</Form.Item>
</Col>
<Col span={12}>