Browse Source

Merge branch 'dev' of https://gitea.anxinyun.cn/gao.zhiyuan/Highways4Good into dev

release_0.0.1
dengyinhuan 2 years ago
parent
commit
fd5ef2748c
  1. 2
      api/app/lib/controllers/overview/building.js
  2. 10
      api/app/lib/controllers/overview/management.js
  3. 20
      api/config.js
  4. 3
      api/log/development.log
  5. BIN
      scripts/0.0.1/data/3_init_report_pic_data/data/养护内容.xlsx
  6. BIN
      scripts/0.0.1/data/3_init_report_pic_data/data/图片/1-1.jpg
  7. BIN
      scripts/0.0.1/data/3_init_report_pic_data/data/图片/1-2.jpg
  8. BIN
      scripts/0.0.1/data/3_init_report_pic_data/data/图片/10-1.jpg
  9. BIN
      scripts/0.0.1/data/3_init_report_pic_data/data/图片/11-1.jpg
  10. BIN
      scripts/0.0.1/data/3_init_report_pic_data/data/图片/12-1.jpg
  11. BIN
      scripts/0.0.1/data/3_init_report_pic_data/data/图片/13-1.jpg
  12. BIN
      scripts/0.0.1/data/3_init_report_pic_data/data/图片/14-1.jpg
  13. BIN
      scripts/0.0.1/data/3_init_report_pic_data/data/图片/15-1.jpg
  14. BIN
      scripts/0.0.1/data/3_init_report_pic_data/data/图片/16-1.jpg
  15. BIN
      scripts/0.0.1/data/3_init_report_pic_data/data/图片/17-1.jpg
  16. BIN
      scripts/0.0.1/data/3_init_report_pic_data/data/图片/18-1.jpg
  17. BIN
      scripts/0.0.1/data/3_init_report_pic_data/data/图片/19-1.jpg
  18. BIN
      scripts/0.0.1/data/3_init_report_pic_data/data/图片/2-1.jpg
  19. BIN
      scripts/0.0.1/data/3_init_report_pic_data/data/图片/2-2.jpg
  20. BIN
      scripts/0.0.1/data/3_init_report_pic_data/data/图片/20-1.jpg
  21. BIN
      scripts/0.0.1/data/3_init_report_pic_data/data/图片/21-1.jpg
  22. BIN
      scripts/0.0.1/data/3_init_report_pic_data/data/图片/22-1.jpg
  23. BIN
      scripts/0.0.1/data/3_init_report_pic_data/data/图片/23-1.jpg
  24. BIN
      scripts/0.0.1/data/3_init_report_pic_data/data/图片/24-1.jpg
  25. BIN
      scripts/0.0.1/data/3_init_report_pic_data/data/图片/25-1.jpg
  26. BIN
      scripts/0.0.1/data/3_init_report_pic_data/data/图片/26-1.jpg
  27. BIN
      scripts/0.0.1/data/3_init_report_pic_data/data/图片/27-1.jpg
  28. BIN
      scripts/0.0.1/data/3_init_report_pic_data/data/图片/28-1.jpg
  29. BIN
      scripts/0.0.1/data/3_init_report_pic_data/data/图片/29-1.jpg
  30. BIN
      scripts/0.0.1/data/3_init_report_pic_data/data/图片/3-1.jpg
  31. BIN
      scripts/0.0.1/data/3_init_report_pic_data/data/图片/30-1.jpg
  32. BIN
      scripts/0.0.1/data/3_init_report_pic_data/data/图片/31-1.jpg
  33. BIN
      scripts/0.0.1/data/3_init_report_pic_data/data/图片/32-1.jpg
  34. BIN
      scripts/0.0.1/data/3_init_report_pic_data/data/图片/33-1.jpg
  35. BIN
      scripts/0.0.1/data/3_init_report_pic_data/data/图片/34-1.jpg
  36. BIN
      scripts/0.0.1/data/3_init_report_pic_data/data/图片/35-1.jpg
  37. BIN
      scripts/0.0.1/data/3_init_report_pic_data/data/图片/36-1.jpg
  38. BIN
      scripts/0.0.1/data/3_init_report_pic_data/data/图片/37-1.jpg
  39. BIN
      scripts/0.0.1/data/3_init_report_pic_data/data/图片/38-1.jpg
  40. BIN
      scripts/0.0.1/data/3_init_report_pic_data/data/图片/39-1.jpg
  41. BIN
      scripts/0.0.1/data/3_init_report_pic_data/data/图片/4-1.jpg
  42. BIN
      scripts/0.0.1/data/3_init_report_pic_data/data/图片/40-1.jpg
  43. BIN
      scripts/0.0.1/data/3_init_report_pic_data/data/图片/41-1.jpg
  44. BIN
      scripts/0.0.1/data/3_init_report_pic_data/data/图片/42-1.jpg
  45. BIN
      scripts/0.0.1/data/3_init_report_pic_data/data/图片/43-1.jpg
  46. BIN
      scripts/0.0.1/data/3_init_report_pic_data/data/图片/5-1.jpg
  47. BIN
      scripts/0.0.1/data/3_init_report_pic_data/data/图片/6-1.jpg
  48. BIN
      scripts/0.0.1/data/3_init_report_pic_data/data/图片/7-1.jpg
  49. BIN
      scripts/0.0.1/data/3_init_report_pic_data/data/图片/8-1.jpg
  50. BIN
      scripts/0.0.1/data/3_init_report_pic_data/data/图片/9-1.jpg
  51. 12
      scripts/0.0.1/data/3_init_report_pic_data/index.js
  52. 10
      weapp/src/packages/components/inputPicker/index.jsx
  53. 2
      weapp/src/packages/components/inputPicker/index.scss
  54. 310
      weapp/src/packages/patrol/index.jsx
  55. 10
      weapp/src/packages/patrol/index.scss
  56. 6
      weapp/src/packages/patrolView/index.jsx
  57. 2
      weapp/src/pages/home/index.jsx
  58. 11
      weapp/src/services/api.js
  59. 25
      web/client/assets/color.less
  60. 33
      web/client/src/sections/fillion/actions/infor.js
  61. 1841
      web/client/src/sections/fillion/components/bridgeTable.js
  62. 1470
      web/client/src/sections/fillion/components/highwaysTable.js
  63. 143
      web/client/src/sections/fillion/components/infor/details.js
  64. 222
      web/client/src/sections/fillion/components/project/project.js
  65. 1806
      web/client/src/sections/fillion/components/transportationTable.js
  66. 2
      web/client/src/utils/webapi.js
  67. 1341
      web/log/development.txt
  68. 2
      web/package-lock.json
  69. 3
      web/package.json

2
api/app/lib/controllers/overview/building.js

@ -170,6 +170,7 @@ async function roadState (ctx) {
}
}
if (p.buildUnit) {
let townName = p.buildUnit.replace('人民政府', '').replace('南昌县', '').replace('管委会', '')
if (roadState.townProject[townName]) {
roadState.townProject[townName] += 1
@ -177,6 +178,7 @@ async function roadState (ctx) {
roadState.townProject[townName] = 1
}
}
}
roadState.buildedRoad += roadCode.size
for (let t of Object.keys(roadState.townRoad)) {

10
api/app/lib/controllers/overview/management.js

@ -4,15 +4,23 @@ async function overSpeedList (ctx) {
try {
const models = ctx.fs.dc.models;
const { userId } = ctx.fs.api;
const { limit } = ctx.query;
const overSpeedRes = await models.Overspeed.findAll({
attributes: ['id', 'licensePlate', 'overrunRate', 'deductPoints', 'fine', 'processingTime'],
order: [['testTime', 'DESC']],
limit: limit || 120,
})
const overSpeedProcessedCount = await models.Overspeed.count({
where: {
processingTime: { $ne: null }
}
})
ctx.status = 200
ctx.body = {
processed: overSpeedRes.filter(s => s.processingTime).length,
processed: overSpeedProcessedCount,
overSpeedList: overSpeedRes,
}
} catch (error) {

20
api/config.js

@ -21,12 +21,12 @@ args.option('qndmn', 'qiniuDomain');
const flags = args.parse(process.argv);
const FS_UNIAPP_DB = process.env.FS_UNIAPP_DB || flags.pg;
const LOCAL_SVR_ORIGIN = process.env.LOCAL_SVR_ORIGIN || flags.fileHost;
// const LOCAL_SVR_ORIGIN = process.env.LOCAL_SVR_ORIGIN || flags.fileHost;
const QINIU_DOMAIN_QNDMN_RESOURCE = process.env.QINIU_DOMAIN_QNDMN_RESOURCE || flags.qndmn;
const QINIU_BUCKET_RESOURCE = process.env.QINIU_BUCKET_RESOURCE || flags.qnbkt;
const QINIU_AK = process.env.QINIU_AK || flags.qnak;
const QINIU_SK = process.env.QINIU_SK || flags.qnsk;
const QINIU_DOMAIN_QNDMN_RESOURCE = process.env.ANXINCLOUD_QINIU_DOMAIN_QNDMN_RESOURC || flags.qndmn;
const QINIU_BUCKET_RESOURCE = process.env.ANXINCLOUD_QINIU_BUCKET_RESOURCE || flags.qnbkt;
const QINIU_AK = process.env.ANXINCLOUD_QINIU_ACCESSKEY || flags.qnak;
const QINIU_SK = process.env.ANXINCLOUD_QINIU_SECRETKEY || flags.qnsk;
if (!FS_UNIAPP_DB) {
console.log('缺少启动参数,异常退出');
@ -41,11 +41,11 @@ const product = {
{
entry: require('@fs/attachment').entry,
opts: {
local: {
origin: LOCAL_SVR_ORIGIN || `http://localhost:${flags.port || 8080}`,
rootPath: 'static',
childPath: 'upload',
},
// local: {
// origin: LOCAL_SVR_ORIGIN || `http://localhost:${flags.port || 8080}`,
// rootPath: 'static',
// childPath: 'upload',
// },
qiniu: {
domain: QINIU_DOMAIN_QNDMN_RESOURCE,
bucket: QINIU_BUCKET_RESOURCE,

3
api/log/development.log

@ -8534,3 +8534,6 @@
original: { '$ref': '$["parent"]' },
__stackCleaned__: true
}
2022-07-26 09:52:19.623 - debug: [FS-LOGGER] Init.
2022-07-26 09:52:19.753 - info: [FS-ATTACHMENT] Inject attachment mw into router.
2022-07-26 09:52:19.753 - info: [FS-AUTH] Inject auth and api mv into router.

BIN
scripts/0.0.1/data/3_init_report_pic_data/data/养护内容.xlsx

Binary file not shown.

BIN
scripts/0.0.1/data/3_init_report_pic_data/data/图片/1-1.jpg

Binary file not shown.

After

Width:  |  Height:  |  Size: 205 KiB

BIN
scripts/0.0.1/data/3_init_report_pic_data/data/图片/1-2.jpg

Binary file not shown.

After

Width:  |  Height:  |  Size: 183 KiB

BIN
scripts/0.0.1/data/3_init_report_pic_data/data/图片/10-1.jpg

Binary file not shown.

After

Width:  |  Height:  |  Size: 242 KiB

BIN
scripts/0.0.1/data/3_init_report_pic_data/data/图片/11-1.jpg

Binary file not shown.

After

Width:  |  Height:  |  Size: 858 KiB

BIN
scripts/0.0.1/data/3_init_report_pic_data/data/图片/12-1.jpg

Binary file not shown.

After

Width:  |  Height:  |  Size: 808 KiB

BIN
scripts/0.0.1/data/3_init_report_pic_data/data/图片/13-1.jpg

Binary file not shown.

After

Width:  |  Height:  |  Size: 234 KiB

BIN
scripts/0.0.1/data/3_init_report_pic_data/data/图片/14-1.jpg

Binary file not shown.

After

Width:  |  Height:  |  Size: 895 KiB

BIN
scripts/0.0.1/data/3_init_report_pic_data/data/图片/15-1.jpg

Binary file not shown.

After

Width:  |  Height:  |  Size: 220 KiB

BIN
scripts/0.0.1/data/3_init_report_pic_data/data/图片/16-1.jpg

Binary file not shown.

After

Width:  |  Height:  |  Size: 987 KiB

BIN
scripts/0.0.1/data/3_init_report_pic_data/data/图片/17-1.jpg

Binary file not shown.

After

Width:  |  Height:  |  Size: 260 KiB

BIN
scripts/0.0.1/data/3_init_report_pic_data/data/图片/18-1.jpg

Binary file not shown.

After

Width:  |  Height:  |  Size: 970 KiB

BIN
scripts/0.0.1/data/3_init_report_pic_data/data/图片/19-1.jpg

Binary file not shown.

After

Width:  |  Height:  |  Size: 759 KiB

BIN
scripts/0.0.1/data/3_init_report_pic_data/data/图片/2-1.jpg

Binary file not shown.

After

Width:  |  Height:  |  Size: 166 KiB

BIN
scripts/0.0.1/data/3_init_report_pic_data/data/图片/2-2.jpg

Binary file not shown.

After

Width:  |  Height:  |  Size: 108 KiB

BIN
scripts/0.0.1/data/3_init_report_pic_data/data/图片/20-1.jpg

Binary file not shown.

After

Width:  |  Height:  |  Size: 216 KiB

BIN
scripts/0.0.1/data/3_init_report_pic_data/data/图片/21-1.jpg

Binary file not shown.

After

Width:  |  Height:  |  Size: 762 KiB

BIN
scripts/0.0.1/data/3_init_report_pic_data/data/图片/22-1.jpg

Binary file not shown.

After

Width:  |  Height:  |  Size: 206 KiB

BIN
scripts/0.0.1/data/3_init_report_pic_data/data/图片/23-1.jpg

Binary file not shown.

After

Width:  |  Height:  |  Size: 710 KiB

BIN
scripts/0.0.1/data/3_init_report_pic_data/data/图片/24-1.jpg

Binary file not shown.

After

Width:  |  Height:  |  Size: 264 KiB

BIN
scripts/0.0.1/data/3_init_report_pic_data/data/图片/25-1.jpg

Binary file not shown.

After

Width:  |  Height:  |  Size: 557 KiB

BIN
scripts/0.0.1/data/3_init_report_pic_data/data/图片/26-1.jpg

Binary file not shown.

After

Width:  |  Height:  |  Size: 252 KiB

BIN
scripts/0.0.1/data/3_init_report_pic_data/data/图片/27-1.jpg

Binary file not shown.

After

Width:  |  Height:  |  Size: 622 KiB

BIN
scripts/0.0.1/data/3_init_report_pic_data/data/图片/28-1.jpg

Binary file not shown.

After

Width:  |  Height:  |  Size: 744 KiB

BIN
scripts/0.0.1/data/3_init_report_pic_data/data/图片/29-1.jpg

Binary file not shown.

After

Width:  |  Height:  |  Size: 232 KiB

BIN
scripts/0.0.1/data/3_init_report_pic_data/data/图片/3-1.jpg

Binary file not shown.

After

Width:  |  Height:  |  Size: 408 KiB

BIN
scripts/0.0.1/data/3_init_report_pic_data/data/图片/30-1.jpg

Binary file not shown.

After

Width:  |  Height:  |  Size: 416 KiB

BIN
scripts/0.0.1/data/3_init_report_pic_data/data/图片/31-1.jpg

Binary file not shown.

After

Width:  |  Height:  |  Size: 248 KiB

BIN
scripts/0.0.1/data/3_init_report_pic_data/data/图片/32-1.jpg

Binary file not shown.

After

Width:  |  Height:  |  Size: 893 KiB

BIN
scripts/0.0.1/data/3_init_report_pic_data/data/图片/33-1.jpg

Binary file not shown.

After

Width:  |  Height:  |  Size: 214 KiB

BIN
scripts/0.0.1/data/3_init_report_pic_data/data/图片/34-1.jpg

Binary file not shown.

After

Width:  |  Height:  |  Size: 924 KiB

BIN
scripts/0.0.1/data/3_init_report_pic_data/data/图片/35-1.jpg

Binary file not shown.

After

Width:  |  Height:  |  Size: 211 KiB

BIN
scripts/0.0.1/data/3_init_report_pic_data/data/图片/36-1.jpg

Binary file not shown.

After

Width:  |  Height:  |  Size: 932 KiB

BIN
scripts/0.0.1/data/3_init_report_pic_data/data/图片/37-1.jpg

Binary file not shown.

After

Width:  |  Height:  |  Size: 255 KiB

BIN
scripts/0.0.1/data/3_init_report_pic_data/data/图片/38-1.jpg

Binary file not shown.

After

Width:  |  Height:  |  Size: 932 KiB

BIN
scripts/0.0.1/data/3_init_report_pic_data/data/图片/39-1.jpg

Binary file not shown.

After

Width:  |  Height:  |  Size: 269 KiB

BIN
scripts/0.0.1/data/3_init_report_pic_data/data/图片/4-1.jpg

Binary file not shown.

After

Width:  |  Height:  |  Size: 211 KiB

BIN
scripts/0.0.1/data/3_init_report_pic_data/data/图片/40-1.jpg

Binary file not shown.

After

Width:  |  Height:  |  Size: 899 KiB

BIN
scripts/0.0.1/data/3_init_report_pic_data/data/图片/41-1.jpg

Binary file not shown.

After

Width:  |  Height:  |  Size: 251 KiB

BIN
scripts/0.0.1/data/3_init_report_pic_data/data/图片/42-1.jpg

Binary file not shown.

After

Width:  |  Height:  |  Size: 219 KiB

BIN
scripts/0.0.1/data/3_init_report_pic_data/data/图片/43-1.jpg

Binary file not shown.

After

Width:  |  Height:  |  Size: 227 KiB

BIN
scripts/0.0.1/data/3_init_report_pic_data/data/图片/5-1.jpg

Binary file not shown.

After

Width:  |  Height:  |  Size: 797 KiB

BIN
scripts/0.0.1/data/3_init_report_pic_data/data/图片/6-1.jpg

Binary file not shown.

After

Width:  |  Height:  |  Size: 258 KiB

BIN
scripts/0.0.1/data/3_init_report_pic_data/data/图片/7-1.jpg

Binary file not shown.

After

Width:  |  Height:  |  Size: 874 KiB

BIN
scripts/0.0.1/data/3_init_report_pic_data/data/图片/8-1.jpg

Binary file not shown.

After

Width:  |  Height:  |  Size: 227 KiB

BIN
scripts/0.0.1/data/3_init_report_pic_data/data/图片/9-1.jpg

Binary file not shown.

After

Width:  |  Height:  |  Size: 1008 KiB

12
scripts/0.0.1/data/3_init_report_pic_data/index.js

@ -59,7 +59,7 @@ try {
if (respInfo.statusCode == 200) {
console.log(respBody);
let qnkey = respBody.key;
resolve({ key: qnkey, url: `/${qnkey}` });
resolve({ key: qnkey, url: `${qnkey}` });
} else {
console.log(respInfo.statusCode);
console.log(respBody);
@ -102,10 +102,16 @@ try {
})
console.log(picList);
// 将图片上传至 7niu
let upPicUrl = [];
for (let p of picList) {
await upload7niu(path.join(__dirname, p.path), p.name)
const upRes = await upload7niu(path.join(__dirname, p.path), p.name)
console.log(upRes);
upPicUrl.push(upRes.url)
}
break
const roadSectionArr = r['路段'] ? r['路段'].split('至') : null
const roadSection = roadSectionArr && roadSectionArr.length > 1 ? roadSectionArr : [null, null]
await client.query(`INSERT INTO report (report_type, project_type, road, road_section_start, road_section_end,time,content,conserve_underway_pic) VALUES($1, $2, $3, $4, $5, $6, $7, $8) `, ['conserve', 'road', r['道路'], roadSection[0], roadSection[1], r['时间'], r['内容'], upPicUrl])
// break
}
// await client.query('ROLLBACK')

10
weapp/src/packages/components/inputPicker/index.jsx

@ -2,12 +2,12 @@
* 输入框筛选选择器
*/
import React, { useState, useEffect } from 'react'
import { View, Picker, Image, Input } from '@tarojs/components'
import { View, Picker, Image, Input, Text } from '@tarojs/components'
import arrowIcon from '../../../static/img/patrol/arrow-down.svg'
import './index.scss'
export default function InputPicker(props) {
const { title, placeholder, selector, value, onInput } = props
const { title, placeholder, selector, value, onInput, isView } = props
const [curSelector, setCurSelector] = useState([])
useEffect(() => {
@ -30,7 +30,7 @@ export default function InputPicker(props) {
return (
<View className='input-picker'>
<View className='input-box'>
<View className='title'>{title}</View>
<View className='title'><Text style={{ color: 'red' }}>*&nbsp;</Text>{title}</View>
<Input
className='input'
type='text'
@ -38,11 +38,15 @@ export default function InputPicker(props) {
border={false}
value={value}
onInput={handleInput}
disabled={isView}
/>
</View>
{
!isView &&
<Picker mode='selector' range={curSelector} onChange={handlePickerChange}>
<Image src={arrowIcon} className='img' />
</Picker>
}
</View>
)
}

2
weapp/src/packages/components/inputPicker/index.scss

@ -13,7 +13,7 @@
align-items: center;
.title {
margin-left: 30px;
margin-left: 12px;
}
.input {

310
weapp/src/packages/patrol/index.jsx

@ -1,5 +1,5 @@
import React, { useState, useEffect } from 'react';
import Taro from '@tarojs/taro';
import Taro, { useRouter } from '@tarojs/taro';
import {
View,
RadioGroup,
@ -9,14 +9,19 @@ import {
Input,
Picker
} from '@tarojs/components';
import { AtButton, AtTextarea, AtImagePicker } from 'taro-ui';
import { AtButton, AtTextarea, AtImagePicker, AtAvatar } from 'taro-ui';
import InputPicker from '../components/inputPicker';
import request from '@/services/request';
import { postReport } from '@/services/api';
import { postReport, getReportDetail } from '@/services/api';
import './index.scss';
import arrowIcon from '../../static/img/patrol/arrow-down.svg';
const Index = () => {
const router = useRouter()
const { params: { type } } = router
const isView = type === 'view' ? true : false
const [reportType, setReportType] = useState('patrol') //
const [projectType, setProjectType] = useState('') //
const [road, setRoad] = useState('') //
@ -32,6 +37,21 @@ const Index = () => {
const [roadStartSelector, setRoadStartSelector] = useState([])
const [roadEndSelector, setRoadEndSelector] = useState([])
const [canReport, setCanReport] = useState(true)
const [typeList, setTypeList] = useState([
{
value: 'patrol',
text: '巡查',
checked: true
},
{
value: 'conserve',
text: '养护',
checked: false
}
])
const rPrjTypeSelector = ['道路', '桥梁', '涵洞', '其他']
const rRoadSelector = ['富山一路', '金沙大道', '玉湖路']
@ -39,11 +59,61 @@ const Index = () => {
const rRoadEndSelector = ['一段', '二段', '三段']
useEffect(() => {
if (isView) {
Taro.showLoading({
title: '加载中'
})
request.get(getReportDetail(router.params.id)).then(res => {
Taro.hideLoading()
if (res.statusCode == 200 || res.statusCode == 204) {
const { data } = res
setReportType(data.reportType)
setProjectType(data.projectType)
setRoad(data.road)
setRoadSectionStart(data.roadSectionStart)
setRoadSectionEnd(data.roadSectionEnd)
setAddress(data.address)
setContent(data.content)
setScenePic(data.scenePic ? data.scenePic.map(item => ({ url: item })) : [])
setConserveBeforePic(data.conserveBeforePic ? data.conserveBeforePic.map(item => ({ url: item })) : [])
setConserveUnderwayPic(data.conserveUnderwayPic ? data.conserveUnderwayPic.map(item => ({ url: item })) : [])
setConserveAfterPic(data.conserveAfterPic ? data.conserveAfterPic.map(item => ({ url: item })) : [])
} else {
Taro.showToast({ title: res.data.message || '请求出错', icon: 'none' })
}
}, err => {
Taro.showToast({ title: err.message || '请求出错', icon: 'none' })
})
}
setRoadStartSelector(rRoadStartSelector)
setRoadEndSelector(rRoadEndSelector)
}, [])
useEffect(() => {
setTypeList([
{
value: 'patrol',
text: '巡查',
checked: reportType === 'patrol' ? true : false
},
{
value: 'conserve',
text: '养护',
checked: reportType === 'conserve' ? true : false
}
])
}, [reportType])
function report() {
if (!canReport) { return }
if (!projectType || !road) {
Taro.showToast({ title: '请完善必填信息', icon: 'none' })
return
}
if (rPrjTypeSelector.indexOf(projectType) === -1) {
Taro.showToast({ title: '工程类型错误', icon: 'none' })
return
}
let data = {
reportType,
projectType,
@ -52,29 +122,38 @@ const Index = () => {
roadSectionEnd,
address,
content,
longitude: 37.000000000000,
latitude: 69.000000000000
// longitude: 37.000000000000,
// latitude: 69.000000000000
}
if (reportType === 'patrol') {
data['scenePic'] = scenePic.length > 0 && scenePic.map(item => item.url)
data['scenePic'] = scenePic.length > 0 ? scenePic.map(item => item.url) : null
} else {
data['conserveBeforePic'] = conserveBeforePic.length > 0 && conserveBeforePic.map(item => item.url)
data['conserveUnderwayPic'] = conserveUnderwayPic.length > 0 && conserveUnderwayPic.map(item => item.url)
data['conserveAfterPic'] = conserveAfterPic.length > 0 && conserveAfterPic.map(item => item.url)
}
for (var key in data) {
if (!data[key]) {
Taro.showToast({ title: '请完善信息', icon: 'none' })
return
}
}
if (rPrjTypeSelector.indexOf(data.projectType) === -1) {
Taro.showToast({ title: '工程类型错误', icon: 'none' })
return
data['conserveBeforePic'] = conserveBeforePic.length > 0 ? conserveBeforePic.map(item => item.url) : null
data['conserveUnderwayPic'] = conserveUnderwayPic.length > 0 ? conserveUnderwayPic.map(item => item.url) : null
data['conserveAfterPic'] = conserveAfterPic.length > 0 ? conserveAfterPic.map(item => item.url) : null
}
Taro.showModal({
title: '提示',
content: '您要进行信息上报么?',
success: function (res) {
if (res.confirm) {
setCanReport(false)
setTimeout(() => {
setCanReport(true)
}, 3000) // 3
Taro.showLoading({
title: '上报中'
})
request.post(postReport(), data).then(res => {
Taro.hideLoading()
if (res.statusCode == 200 || res.statusCode == 204) {
Taro.showToast({ title: '上报成功', icon: 'none' })
Taro.showToast({ title: '上报成功', icon: 'none', duration: 1500 })
setTimeout(() => {
Taro.reLaunch({
url: '/pages/home/index'
});
}, 1500)
} else {
Taro.showToast({ title: res.data.message || '请求出错', icon: 'none' })
}
@ -82,6 +161,9 @@ const Index = () => {
Taro.showToast({ title: err.message || '请求出错', icon: 'none' })
})
}
}
})
}
function handleInput({ detail: { value } }, type) {
switch (type) {
@ -139,18 +221,105 @@ const Index = () => {
})
}
const typeList = [
{
value: 'patrol',
text: '巡查',
checked: true
},
{
value: 'conserve',
text: '养护',
checked: false
function renderAddImg() {
return (
reportType === 'patrol' ?
<View className='patrol-img'>
现场图片
<AtImagePicker
className='img-picker'
count={3 - scenePic.length}
showAddBtn={scenePic.length >= 3 ? false : true}
files={scenePic}
onChange={files => handleImgChange(files, 'scenePic')}
onImageClick={handleImgClick}
/>
</View> :
<View className='conserve-img'>
养护图片:
<View className='horizontal-line hl-one'>
<View className='circle c-one'></View>
<View className='text t-one'>养护前</View>
</View>
<AtImagePicker
className='img-picker'
count={3 - conserveBeforePic.length}
showAddBtn={conserveBeforePic.length >= 3 ? false : true}
files={conserveBeforePic}
onChange={files => handleImgChange(files, 'conserveBeforePic')}
onImageClick={handleImgClick}
/>
<View className='horizontal-line hl-two'>
<View className='circle c-two'></View>
<View className='text t-two'>养护中</View>
</View>
<AtImagePicker
className='img-picker'
count={3 - conserveUnderwayPic.length}
showAddBtn={conserveUnderwayPic.length >= 3 ? false : true}
files={conserveUnderwayPic}
onChange={files => handleImgChange(files, 'conserveUnderwayPic')}
onImageClick={handleImgClick}
/>
<View className='horizontal-line hl-three'>
<View className='circle c-three'></View>
<View className='text t-three'>养护后</View>
</View>
<AtImagePicker
className='img-picker'
count={3 - conserveAfterPic.length}
showAddBtn={conserveAfterPic.length >= 3 ? false : true}
files={conserveAfterPic}
onChange={files => handleImgChange(files, 'conserveAfterPic')}
onImageClick={handleImgClick}
/>
</View>
)
}
function renderViewImg() {
return (
reportType === 'patrol' ?
<View className='patrol-img'>
现场图片
<View className='img-box'>
{scenePic.map(item => (
<Image className='img' src={item.url} onClick={() => handleImgClick(undefined, item)} />
))}
</View>
</View> :
<View className='conserve-img'>
养护图片:
<View className='horizontal-line hl-one'>
<View className='circle c-one'></View>
<View className='text t-one'>养护前</View>
</View>
<View className='img-box'>
{conserveBeforePic.map(item => (
<Image className='img' src={item.url} onClick={() => handleImgClick(undefined, item)} />
))}
</View>
<View className='horizontal-line hl-two'>
<View className='circle c-two'></View>
<View className='text t-two'>养护中</View>
</View>
<View className='img-box'>
{conserveUnderwayPic.map(item => (
<Image className='img' src={item.url} onClick={() => handleImgClick(undefined, item)} />
))}
</View>
<View className='horizontal-line hl-three'>
<View className='circle c-three'></View>
<View className='text t-three'>养护后</View>
</View>
<View className='img-box'>
{conserveAfterPic.map(item => (
<Image className='img' src={item.url} onClick={() => handleImgClick(undefined, item)} />
))}
</View>
</View>
)
}
]
return (
<View className='patrol'>
@ -166,6 +335,7 @@ const Index = () => {
checked={item.checked}
className='radio'
color='#346FC2'
disabled={isView}
>
{item.text}
</Radio>
@ -181,6 +351,7 @@ const Index = () => {
value={projectType}
onInput={setProjectType}
selector={rPrjTypeSelector}
isView={isView}
/>
<InputPicker
title='所在道路:'
@ -188,6 +359,7 @@ const Index = () => {
value={road}
onInput={setRoad}
selector={rRoadSelector}
isView={isView}
/>
<View className='road-section'>
@ -195,11 +367,14 @@ const Index = () => {
<Input
className='input'
type='text'
placeholder='路段名称'
placeholder={isView ? '' : '路段名称'}
border={false}
value={roadSectionStart}
onInput={e => handleInput(e, 'roadSectionStart')}
disabled={isView}
/>
{
isView &&
<Picker
mode='selector'
range={roadStartSelector}
@ -207,15 +382,19 @@ const Index = () => {
>
<Image src={arrowIcon} className='img-l' />
</Picker>
}
<View>&nbsp;</View>
<Input
className='input'
type='text'
placeholder='路段名称'
placeholder={isView ? '' : '路段名称'}
border={false}
value={roadSectionEnd}
onInput={e => handleInput(e, 'roadSectionEnd')}
disabled={isView}
/>
{
isView &&
<Picker
mode='selector'
range={roadEndSelector}
@ -223,6 +402,7 @@ const Index = () => {
>
<Image src={arrowIcon} className='img-r' />
</Picker>
}
</View>
<View className='address'>
@ -230,73 +410,29 @@ const Index = () => {
<Input
className='input'
type='text'
placeholder='根据定位自动获取,可手动修改'
placeholder={isView ? '' : '根据定位自动获取,可手动修改'}
value={address}
onInput={e => handleInput(e, 'address')}
disabled={isView}
/>
</View>
<AtTextarea
count={false}
title='巡查内容:'
placeholder='请输入巡查内容'
placeholder={isView ? '' : '请输入巡查内容'}
value={content}
onChange={(v, e) => handleInput(e, 'content')}
disabled={isView}
/>
{
reportType === 'patrol' ?
<View className='patrol-img'>
现场图片
<AtImagePicker
className='img-picker'
count={3 - scenePic.length}
showAddBtn={scenePic.length >= 3 ? false : true}
files={scenePic}
onChange={files => handleImgChange(files, 'scenePic')}
onImageClick={handleImgClick}
/>
</View> :
<View className='conserve-img'>
养护图片:
<View className='horizontal-line hl-one'>
<View className='circle c-one'></View>
<View className='text t-one'>养护前</View>
</View>
<AtImagePicker
className='img-picker'
count={3 - conserveBeforePic.length}
showAddBtn={conserveBeforePic.length >= 3 ? false : true}
files={conserveBeforePic}
onChange={files => handleImgChange(files, 'conserveBeforePic')}
onImageClick={handleImgClick}
/>
<View className='horizontal-line hl-two'>
<View className='circle c-two'></View>
<View className='text t-two'>养护中</View>
</View>
<AtImagePicker
className='img-picker'
count={3 - conserveUnderwayPic.length}
showAddBtn={conserveUnderwayPic.length >= 3 ? false : true}
files={conserveUnderwayPic}
onChange={files => handleImgChange(files, 'conserveUnderwayPic')}
onImageClick={handleImgClick}
/>
<View className='horizontal-line hl-three'>
<View className='circle c-three'></View>
<View className='text t-three'>养护后</View>
</View>
<AtImagePicker
className='img-picker'
count={3 - conserveAfterPic.length}
showAddBtn={conserveAfterPic.length >= 3 ? false : true}
files={conserveAfterPic}
onChange={files => handleImgChange(files, 'conserveAfterPic')}
onImageClick={handleImgClick}
/>
</View>
isView ?
renderViewImg() :
renderAddImg()
}
{
!isView && <AtButton type='primary' className='sub-btn' onClick={report}>上报</AtButton>
}
<AtButton type='primary' className='sub-btn' onClick={report}>上报</AtButton>
</View>
)
}

10
weapp/src/packages/patrol/index.scss

@ -73,6 +73,16 @@ page {
background-color: #fff;
padding: 20px;
.img-box {
display: flex;
flex-wrap: wrap;
.img {
width: 170px;
height: 170px;
margin: 10px 0 0 10px;
}
}
}
.conserve-img {

6
weapp/src/packages/patrolView/index.jsx

@ -89,6 +89,10 @@ function Index() {
}
}
const handleDetail = index => {
Taro.navigateTo({ url: `/packages/patrol/index?type=view&id=${listData[index].id}` })
}
return (
<View>
<View className='type-box'>
@ -127,7 +131,7 @@ function Index() {
<View className='card-title'>{e.road}</View>
<View style={{ float: 'left', width: '100%', fontSize: '28rpx', marginTop: '16rpx' }}>
<View style={{ float: 'left' }}>填报人</View>
<View style={{ float: 'left' }}>{e.user.name}</View>
<View style={{ float: 'left' }}>{e.user && e.user.name}</View>
</View>
<View className='card-date'>{moment(e.time).format('YYYY-MM-DD HH:mm:ss')}</View>
</View>

2
weapp/src/pages/home/index.jsx

@ -10,7 +10,7 @@ const Index = () => {
function toPatrol() {
Taro.navigateTo({
url: '/packages/patrol/index'
url: '/packages/patrol/index?type=edit'
})
}
function toPatrolView() {

11
weapp/src/services/api.js

@ -7,12 +7,19 @@ export const getLogoutUrl = () => {
return `/logout`;
};
// 巡查上报
export const postReport = () => {
return `/report`;
};
// 获取上报列表
export const getReportList = () => {
return `/report/list`;
};
export const postReport = () => {
return `/report`;
// 获取上报详情
export const getReportDetail = id => {
return `/report/${id}/detail`;
};
//行业查询

25
web/client/assets/color.less

@ -1128,10 +1128,17 @@ tr > .ant-picker-cell-in-view.ant-picker-cell-range-hover-start:last-child::afte
.ant-mentions-dropdown-menu-item-active {background-color: @item-hover-bg;}
.ant-menu-item-danger.ant-menu-item {color: #ff4d4f;}
.ant-menu-item-danger.ant-menu-item:hover, .ant-menu-item-danger.ant-menu-item-active {color: #ff4d4f;}
<<<<<<< Updated upstream
.ant-menu-item-danger.ant-menu-item:active {background: #fff1f0;}
.ant-menu-item-danger.ant-menu-item-selected {color: #ff4d4f;}
.ant-menu-item-danger.ant-menu-item-selected > a, .ant-menu-item-danger.ant-menu-item-selected > a:hover {color: #ff4d4f;}
.ant-menu:not(.ant-menu-horizontal) .ant-menu-item-danger.ant-menu-item-selected {background-color: #fff1f0;}
=======
.ant-menu-item-danger.ant-menu-item:active {background: color(~`colorPalette("@{modal-header-border-color-split}", 1)`);}
.ant-menu-item-danger.ant-menu-item-selected {color: #ff4d4f;}
.ant-menu-item-danger.ant-menu-item-selected > a, .ant-menu-item-danger.ant-menu-item-selected > a:hover {color: #ff4d4f;}
.ant-menu:not(.ant-menu-horizontal) .ant-menu-item-danger.ant-menu-item-selected {background-color: color(~`colorPalette("@{modal-header-border-color-split}", 1)`);}
>>>>>>> Stashed changes
.ant-menu-inline .ant-menu-item-danger.ant-menu-item::after {border-right-color: #ff4d4f;}
.ant-menu-dark .ant-menu-item-danger.ant-menu-item, .ant-menu-dark .ant-menu-item-danger.ant-menu-item:hover, .ant-menu-dark .ant-menu-item-danger.ant-menu-item > a {color: #ff4d4f;}
.ant-menu-dark.ant-menu-dark:not(.ant-menu-horizontal) .ant-menu-item-danger.ant-menu-item-selected {color: #fff;background-color: #ff4d4f;}
@ -1702,11 +1709,19 @@ tr.ant-table-expanded-row:hover > td {background: @table-expanded-row-bg;}
.ant-tag-checkable:active, .ant-tag-checkable-checked {color: #fff;}
.ant-tag-checkable-checked {background-color: @primary-color;}
.ant-tag-checkable:active {background-color: color(~`colorPalette("@{primary-color}", 7)`);}
<<<<<<< Updated upstream
.ant-tag-pink {color: #c41d7f;background: #fff0f6;border-color: #ffadd2;}
.ant-tag-pink-inverse {color: #fff;background: #eb2f96;border-color: #eb2f96;}
.ant-tag-magenta {color: #c41d7f;background: #fff0f6;border-color: #ffadd2;}
.ant-tag-magenta-inverse {color: #fff;background: #eb2f96;border-color: #eb2f96;}
.ant-tag-red {color: #cf1322;background: #fff1f0;border-color: #ffa39e;}
=======
.ant-tag-pink {color: #c41d7f;background: color(~`colorPalette("@{success-color-deprecated-bg}", 1)`);border-color: #ffadd2;}
.ant-tag-pink-inverse {color: #fff;background: #eb2f96;border-color: #eb2f96;}
.ant-tag-magenta {color: #c41d7f;background: color(~`colorPalette("@{success-color-deprecated-bg}", 1)`);border-color: #ffadd2;}
.ant-tag-magenta-inverse {color: #fff;background: #eb2f96;border-color: #eb2f96;}
.ant-tag-red {color: #cf1322;background: color(~`colorPalette("@{modal-header-border-color-split}", 1)`);border-color: #ffa39e;}
>>>>>>> Stashed changes
.ant-tag-red-inverse {color: #fff;background: #f5222d;border-color: #f5222d;}
.ant-tag-volcano {color: #d4380d;background: #fff2e8;border-color: #ffbb96;}
.ant-tag-volcano-inverse {color: #fff;background: #fa541c;border-color: #fa541c;}
@ -1722,9 +1737,15 @@ tr.ant-table-expanded-row:hover > td {background: @table-expanded-row-bg;}
.ant-tag-lime-inverse {color: #fff;background: #a0d911;border-color: #a0d911;}
.ant-tag-green {color: #389e0d;background: #f6ffed;border-color: #b7eb8f;}
.ant-tag-green-inverse {color: #fff;background: #52c41a;border-color: #52c41a;}
<<<<<<< Updated upstream
.ant-tag-blue {color: #096dd9;background: color(~`colorPalette("@{pagination-item-input-bg}", 1)`);border-color: #91d5ff;}
.ant-tag-blue-inverse {color: #fff;background: #1890ff;border-color: #1890ff;}
.ant-tag-geekblue {color: #1d39c4;background: color(~`colorPalette("@{avatar-bg}", 4)`);border-color: #adc6ff;}
=======
.ant-tag-blue {color: #096dd9;background: #e6f7ff;border-color: color(~`colorPalette("@{alert-info-border-color}", 5)`);}
.ant-tag-blue-inverse {color: #fff;background: #1890ff;border-color: #1890ff;}
.ant-tag-geekblue {color: #1d39c4;background: color(~`colorPalette("@{tree-bg}", 1)`);border-color: #adc6ff;}
>>>>>>> Stashed changes
.ant-tag-geekblue-inverse {color: #fff;background: #2f54eb;border-color: #2f54eb;}
.ant-tag-purple {color: #531dab;background: color(~`colorPalette("@{calendar-bg}", 1)`);border-color: #d3adf7;}
.ant-tag-purple-inverse {color: #fff;background: #722ed1;border-color: #722ed1;}
@ -1963,7 +1984,11 @@ a.ant-typography.ant-typography-disabled:hover, .ant-typography a.ant-typography
.ant-upload-list-picture .ant-upload-list-item-error, .ant-upload-list-picture-card .ant-upload-list-item-error {border-color: #ff4d4f;}
.ant-upload-list-picture .ant-upload-list-item:hover .ant-upload-list-item-info, .ant-upload-list-picture-card .ant-upload-list-item:hover .ant-upload-list-item-info {background: transparent;}
.ant-upload-list-picture .ant-upload-list-item-uploading, .ant-upload-list-picture-card .ant-upload-list-item-uploading {border-style: dashed;}
<<<<<<< Updated upstream
.ant-upload-list-picture .ant-upload-list-item-error .ant-upload-list-item-thumbnail .anticon svg path[fill='color(~`colorPalette("@{pagination-item-input-bg}", 1)`)'], .ant-upload-list-picture-card .ant-upload-list-item-error .ant-upload-list-item-thumbnail .anticon svg path[fill='color(~`colorPalette("@{pagination-item-input-bg}", 1)`)'] {fill: @error-color-deprecated-bg;}
=======
.ant-upload-list-picture .ant-upload-list-item-error .ant-upload-list-item-thumbnail .anticon svg path[fill='#e6f7ff'], .ant-upload-list-picture-card .ant-upload-list-item-error .ant-upload-list-item-thumbnail .anticon svg path[fill='#e6f7ff'] {fill: @error-color-deprecated-bg;}
>>>>>>> Stashed changes
.ant-upload-list-picture .ant-upload-list-item-error .ant-upload-list-item-thumbnail .anticon svg path[fill='#1890ff'], .ant-upload-list-picture-card .ant-upload-list-item-error .ant-upload-list-item-thumbnail .anticon svg path[fill='#1890ff'] {fill: #ff4d4f;}
.ant-upload-list-picture-card .ant-upload-list-item-info::before {background-color: rgba(0, 0, 0, 0.5);}
.ant-upload-list-picture-card .ant-upload-list-item-actions .anticon-eye, .ant-upload-list-picture-card .ant-upload-list-item-actions .anticon-download, .ant-upload-list-picture-card .ant-upload-list-item-actions .anticon-delete {color: rgba(255, 255, 255, 0.85);}

33
web/client/src/sections/fillion/actions/infor.js

@ -67,6 +67,17 @@ export function getRoadway(query) {
// reducer: { name: 'reportstatistic' }
});
}
export function putRoadway(query) {
return dispatch => basicAction({
type: 'put',
dispatch: dispatch,
data: query,
actionType: 'PUT_ROADWAY',
url: ApiTable.putRoadway,
msg: { error: '编辑道路信息失败' },
// reducer: { name: 'reportstatistic' }
});
}
export function getBridge(query) {
return dispatch => basicAction({
type: 'get',
@ -78,6 +89,17 @@ export function getBridge(query) {
// reducer: { name: 'reportstatistic' }
});
}
export function putBridge(query) {
return dispatch => basicAction({
type: 'put',
dispatch: dispatch,
data: query,
actionType: 'PUT_BRIDGE',
url: ApiTable.putBridge,
msg: { error: '编辑桥梁信息失败' },
// reducer: { name: 'reportstatistic' }
});
}
export function getProject(query) {
return dispatch => basicAction({
type: 'get',
@ -89,3 +111,14 @@ export function getProject(query) {
// reducer: { name: 'reportstatistic' }
});
}
export function putProject(query) {
return dispatch => basicAction({
type: 'put',
dispatch: dispatch,
data: query,
actionType: 'GET_PROJECT',
url: ApiTable.putProject,
msg: { error: '编辑工程信息失败' },
// reducer: { name: 'reportstatistic' }
});
}

1841
web/client/src/sections/fillion/components/bridgeTable.js

File diff suppressed because it is too large

1470
web/client/src/sections/fillion/components/highwaysTable.js

File diff suppressed because it is too large

143
web/client/src/sections/fillion/components/infor/details.js

@ -1,44 +1,159 @@
import React from 'react';
import React, { useEffect, useState } from 'react';
import { connect } from 'react-redux';
import { Spin, Table } from 'antd';
import { Form, Spin, Table } from 'antd';
import { DrawerForm, ProForm, ProFormText } from '@ant-design/pro-form';
import moment from 'moment';
import { putRoadway } from "../../actions/infor"
import { putBridge } from "../../actions/infor"
const UserModal = (props) => {
const { visible, onVisibleChange,typecard } = props
console.log(typecard)
const { visible, onVisibleChange, typecard, rewkeys, data, recortd, sitename, dispatch, date, setRecortd,engineering } = props
const [newlys, setNewlys] = useState() //必填数据
const [newlysay, setNewlysay] = useState() //处理hou
const [records, setRecords] = useState()//处理
const [recordsay, setRecordsay] = useState()//必填数据
const [success, setSuccess] = useState() //状态
useEffect(() => {
const array = []
if (rewkeys === 'transportation') {
const xindata=[...data]
setNewlys(xindata?.splice(0, 2))
setNewlysay(xindata)
} if (rewkeys === 'bridge') {
_.forIn(data, function (value, key) {
array.push({ name: value, type: key })
});
setNewlys(array?.splice(0, 2))
setNewlysay(array)
console.log(array)
}
}, [])
useEffect(() => {
const arr = []
if (rewkeys === 'transportation') {
_.forIn(recortd, function (value, key) {
arr.push({ value: value, type: key })
});
setRecordsay(arr.splice(1, 2))
setRecords(arr)
}
if (rewkeys === 'bridge') {
_.forIn(recortd, function (value, key) {
arr.push({ value: value, type: key })
});
setRecordsay(arr.splice(1, 2))
setRecords(arr)
}
}, [recortd])
useEffect(() => {
return () => {
setRecortd()
}
}, [])
// console.log(recortd)
return (
<Spin spinning={false}>
{/* {
newlysay ? */}
<DrawerForm
width={'90rem'}
visible={visible}
onVisibleChange={onVisibleChange}
// submitter={false}
onFinish={(values) => {
if (rewkeys === 'transportation') {
if (typecard == '111') {
console.log(values)
const query = { ...values, level: sitename, roadId: records?.[0]?.value || '' }
dispatch(putRoadway(query)).then((res) => {
setSuccess(res.success)
})
return success
} else {
const query = { ...values, level: sitename }
dispatch(putRoadway(query)).then((res) => {
setSuccess(res.success)
})
return success
}
}
if (rewkeys === 'bridge') {
if (typecard == '111') {
console.log(values)
const query = { ...values, roadId: records?.[0]?.value || '' }
dispatch(putBridge(query)).then((res) => {
setSuccess(res.success)
})
return success
} else {
const query = { ...values }
dispatch(putBridge(query)).then((res) => {
setSuccess(res.success)
})
return success
}
}
}}
initialValues={recortd}
>
{typecard == '111' ?
<ProForm.Group
>
{typecard==111?<ProForm.Group>
<ProFormText
name="name"
name={newlys?.[0]?.type}
width="md"
label="签约客户名称"
label={newlys?.[0]?.name}
tooltip="最长为 24 位"
placeholder="请输入名称"
value="wowowo"
value={recordsay?.[0]?.value}
rules={[{ required: true, message: "必填" }]}
/><ProFormText
name={newlys?.[1]?.type}
width="md"
label={newlys?.[1]?.name}
tooltip="最长为 24 位"
placeholder="请输入名称"
value={recordsay?.[1]?.value}
rules={[{ required: true, message: "必填" }]}
/>
<ProFormText width="md" name="company" label="我方公司名称" placeholder="请输入名称" />
{newlysay?.map((item, index) => {
return <ProFormText width="md"
name={item?.type} label={newlysay[index]?.name} placeholder="请输入名称"
key={index}
/>
})}
</ProForm.Group>
: <ProForm.Group>
<ProFormText
name="name"
name={newlys?.[0]?.type}
width="md"
label={newlys?.[0]?.name}
tooltip="最长为 24 位"
placeholder="请输入名称"
// value={recordssy?.[0]?.value}
rules={[{ required: true, message: "必填" }]}
/><ProFormText
name={newlys?.[1]?.type}
width="md"
label="签约客户名称"
label={newlys?.[1]?.name}
tooltip="最长为 24 位"
placeholder="请输入名称"
// value={recordssy?.[1]?.value}
rules={[{ required: true, message: "必填" }]}
/>
<ProFormText width="md" name="company" label="我方公司名称" placeholder="请输入名称" />
{newlysay?.map((item, index) => {
return <ProFormText width="md"
name={item?.type} label={newlysay[index]?.name} placeholder="请输入名称" key={index}
tooltip="最长为 24 位"
/>
})}
</ProForm.Group>}
</DrawerForm>
{/* : ''
} */}
</Spin>
)
}

222
web/client/src/sections/fillion/components/project/project.js

@ -0,0 +1,222 @@
import React, { useEffect, useState } from 'react';
import { connect } from 'react-redux';
import { Form, Spin, Table } from 'antd';
import { DrawerForm, ProForm, ProFormText,ProFormSelect } from '@ant-design/pro-form';
import { putProject } from "../../actions/infor"
const data = {
"entryName": "项目名称",
"projectMileage": "工程里程",
"investment": "投资",
"buildUnit": "建设单位",
"constructionControlUnit": "监理单位",
"designUnit": "设计单位",
"constructionUnit": "施工单位",
"supervisorAndSupervisor": "监督负责人及监督人员",
"projectProgress": "项目进展情况"
}
const ProjectModal = (props) => {
const { visible, onVisibleChange, typecard, rewkeys, recortd, sitename, dispatch, setRecortd, engineering } = props
const [newlys, setNewlys] = useState() //必填数据
const [newlysay, setNewlysay] = useState() //处理hou
const [records, setRecords] = useState()//处理
const [recordsay, setRecordsay] = useState()//必填数据
const [success, setSuccess] = useState() //状态
const [flage, setFlage] = useState() //xiangmujinzhan
useEffect(() => {
const array = []
if (rewkeys === 'road') {
_.forIn(data, function (value, key) {
array.push({ name: value, type: key })
});
setNewlys(array?.splice(0, 2))
setNewlysay(array)
// console.log()
}
if (rewkeys === 'bridge') {
_.forIn(data, function (value, key) {
array.push({ name: value, type: key })
});
setNewlys(array?.splice(0, 2))
setNewlysay(array)
// console.log()
}
}, [])
useEffect(() => {
const arr = []
if (rewkeys === 'road') {
_.forIn(recortd, function (value, key) {
arr.push({ value: value, type: key })
});
setRecordsay(arr.splice(1, 2))
setRecords(arr)
}
if (rewkeys === 'bridge') {
_.forIn(recortd, function (value, key) {
arr.push({ value: value, type: key })
});
setRecordsay(arr.splice(1, 2))
setRecords(arr)
}
}, [recortd])
useEffect(() => {
return () => {
setRecortd()
}
}, [])
// console.log(recortd)
return (
<Spin spinning={false}>
{/* {
newlysay ? */}
<DrawerForm
width={'90rem'}
visible={visible}
onVisibleChange={onVisibleChange}
onFinish={(values) => {
if (rewkeys === 'road') {
if (typecard == '111') {
console.log(values)
const query = { ...values, type:rewkeys }
dispatch(putProject(query)).then((res) => {
setSuccess(res.success)
})
return success
} else {
const query = { ...values, type:rewkeys }
dispatch(putProject(query)).then((res) => {
setSuccess(res.success)
})
return success
}
}
if (rewkeys === 'bridge') {
if (typecard == '111') {
console.log(values)
const query = { ...values, type:rewkeys }
dispatch(putProject(query)).then((res) => {
setSuccess(res.success)
})
return success
} else {
const query = { ...values, type:rewkeys }
dispatch(putProject(query)).then((res) => {
setSuccess(res.success)
})
return success
}
}
}}
initialValues={recortd}
>
{typecard == '111' ?
<ProForm.Group
>
<ProFormText
name={newlys?.[0]?.type}
width="md"
label={newlys?.[0]?.name}
tooltip="最长为 24 位"
placeholder="请输入名称"
value={recordsay?.[0]?.value}
rules={[{ required: true, message: "必填" }]}
/><ProFormText
name={newlys?.[1]?.type}
width="md"
label={newlys?.[1]?.name}
tooltip="最长为 24 位"
placeholder="请输入名称"
value={recordsay?.[1]?.value}
rules={[{ required: true, message: "必填" }]}
/>
<ProFormSelect
options={[
{
value: 'true',
label: '是',
},{
value: 'false',
label: '否',
},
]}
width="xs"
name='done'
label='是否已完成'
/>
{newlysay?.map((item, index) => {
return <ProFormText width="md"
name={item?.type} label={newlysay[index]?.name} placeholder="请输入名称"
key={index}
/>
})}
</ProForm.Group>
: <ProForm.Group>
<ProFormText
name={newlys?.[0]?.type}
width="md"
label={newlys?.[0]?.name}
tooltip="最长为 24 位"
placeholder="请输入名称"
// value={recordssy?.[0]?.value}
rules={[{ required: true, message: "必填" }]}
/><ProFormText
name={newlys?.[1]?.type}
width="md"
label={newlys?.[1]?.name}
tooltip="最长为 24 位"
placeholder="请输入名称"
// value={recordssy?.[1]?.value}
rules={[{ required: true, message: "必填" }]}
/>
<ProFormSelect
options={[
{
value: 'true',
label: '是',
},{
value: 'false',
label: '否',
},
]}
width="xs"
name='done'
label='是否已完成'
/>
{newlysay?.map((item, index) => {
return <ProFormText width="md"
name={item?.type} label={newlysay[index]?.name} placeholder="请输入名称" key={index}
tooltip="最长为 24 位"
/>
})}
</ProForm.Group>}
</DrawerForm>
{/* : ''
} */}
</Spin>
)
}
function mapStateToProps(state) {
const { depMessage } = state;
const pakData = (dep) => {
return dep.map((d) => {
return {
title: d.name,
value: d.id,
children: pakData(d.subordinate)
}
})
}
let depData = pakData(depMessage.data || [])
return {
loading: depMessage.isRequesting,
depData,
};
}
export default connect(mapStateToProps)(ProjectModal);

1806
web/client/src/sections/fillion/components/transportationTable.js

File diff suppressed because it is too large

2
web/client/src/utils/webapi.js

@ -47,8 +47,10 @@ export const ApiTable = {
getRoadway: 'road',
//桥梁管理
getBridge:'bridge',
putBridge:'bridge',
//工程数据
getProject:'project',
putProject:'project',
//道路统计
getBgroadstatistics: "build/road_state",

1341
web/log/development.txt

File diff suppressed because it is too large

2
web/package-lock.json

@ -7585,7 +7585,7 @@
"lodash": {
"version": "4.17.21",
"resolved": "http://npm.anxinyun.cn/lodash/-/lodash-4.17.21.tgz",
"integrity": "sha1-Z5WRxWTDv/quhFTPCz3zcMPWkRw="
"integrity": "sha512-v2kDEe57lecTulaDIuNTPy3Ry4gLGJ6Z1O3vE1krgXZNrsQ+LFTGHVxVjcXPs17LhbZVGedAJv8XZ1tvj5FvSg=="
},
"lodash-es": {
"version": "4.17.21",

3
web/package.json

@ -6,7 +6,7 @@
"scripts": {
"test": "mocha",
"start": "cross-env NODE_ENV=development npm run start-params",
"start-params": "npm run color && node server -p 5000 -u https://3024-117-90-36-177.jp.ngrok.io",
"start-params": "npm run color && node server -p 5000 -u http://10.8.30.7:14000",
"deploy": "export NODE_ENV=production&&npm run color && npm run build && node server",
"build-dev": "export NODE_ENV=development&&webpack --config webpack.config.js",
"build": "export NODE_ENV=production&&webpack --config webpack.config.prod.js",
@ -82,6 +82,7 @@
"koa-convert": "^2.0.0",
"koa-proxy": "^1.0.0-alpha.3",
"koa-view": "^2.1.4",
"lodash": "^4.17.21",
"mini-dynamic-antd-theme": "^0.5.3",
"moment": "^2.22.0",
"react-color": "^2.19.3",

Loading…
Cancel
Save