yangsen 2 years ago
parent
commit
39b8e12b30
  1. 11
      api/app/lib/controllers/report/index.js
  2. 10
      scripts/0.0.1/data/4_file_type_data.sql
  3. 4
      weapp/src/packages/patrol/index.jsx
  4. 8
      web/client/src/sections/fillion/components/bridgeTable.js
  5. 4
      web/client/src/sections/fillion/components/highwaysTable.js
  6. 4
      web/client/src/sections/fillion/components/inforTable.js
  7. 15
      web/client/src/sections/fillion/components/maintenanceTable.js
  8. 25
      web/client/src/sections/fillion/components/operationalTable.js
  9. 15
      web/client/src/sections/fillion/components/patrolTable.js
  10. 3
      web/client/src/sections/fillion/components/protable.less
  11. 10
      web/client/src/sections/fillion/components/publicTable.js
  12. 16
      web/client/src/sections/fillion/components/transportationTable.js
  13. 22
      web/client/src/sections/fillion/containers/public.js
  14. 17
      web/client/src/sections/quanju/containers/footer/leadership/left/left-top.js

11
api/app/lib/controllers/report/index.js

@ -1,7 +1,7 @@
'use strict';
const { QueryTypes } = require('sequelize');
async function reportList(ctx) {
async function reportList (ctx) {
try {
const models = ctx.fs.dc.models;
const { limit, page, startTime, endTime, keyword, userId, reportType, isTop } = ctx.query
@ -14,6 +14,7 @@ async function reportList(ctx) {
model: models.User,
attributes: ['name']
}],
order: [['time', 'DESC']],
}
if (limit) {
findOption.limit = limit
@ -60,7 +61,7 @@ async function reportList(ctx) {
}
}
async function reportPosition(ctx) {
async function reportPosition (ctx) {
try {
const models = ctx.fs.dc.models;
const { startTime, endTime, userId, reportType } = ctx.query
@ -110,7 +111,7 @@ async function reportPosition(ctx) {
}
}
async function reportDetail(ctx) {
async function reportDetail (ctx) {
try {
const models = ctx.fs.dc.models;
const { reportId } = ctx.params
@ -132,7 +133,7 @@ async function reportDetail(ctx) {
}
}
async function createReport(ctx) {
async function createReport (ctx) {
try {
const { userId } = ctx.fs.api
const models = ctx.fs.dc.models;
@ -154,7 +155,7 @@ async function createReport(ctx) {
}
}
async function deleteReport(ctx) {
async function deleteReport (ctx) {
try {
const models = ctx.fs.dc.models;
const { reportId } = ctx.params;

10
scripts/0.0.1/data/4_file_type_data.sql

@ -0,0 +1,10 @@
-- ----------------------------
-- Records of file_type
-- ----------------------------
BEGIN;
INSERT INTO "public"."file_type" VALUES (1, '前期资料', NULL);
INSERT INTO "public"."file_type" VALUES (3, '竣工资料', NULL);
INSERT INTO "public"."file_type" VALUES (4, '维修资料', NULL);
INSERT INTO "public"."file_type" VALUES (5, '道路图片', NULL);
INSERT INTO "public"."file_type" VALUES (2, '施工资料', NULL);
COMMIT;

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

@ -171,6 +171,10 @@ const Index = () => {
Taro.showToast({ title: '工程类型错误', icon: 'none' })
return
}
if (content.length > 50) {
Taro.showToast({ title: '内容字数不能超过50', icon: 'none' })
return
}
const reportProjectType = prjType[prjTypeSelector.indexOf(projectType)].value
let data = {

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

@ -1534,13 +1534,13 @@ const BrideTable = (props) => {
>
新增
</Button>
<Button
{/* <Button
type="primary"
style={{ width: "100px", marginLeft: 20 }}
>
导入
</Button>
</Button> */}
</div>
@ -1717,13 +1717,13 @@ const BrideTable = (props) => {
>
新增
</Button>
<Button
{/* <Button
type="primary"
style={{ width: "100px", marginLeft: 20 }}
>
导入
</Button>
</Button> */}
</div>

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

@ -37,6 +37,7 @@ const hightModal = (type, record) => {
dataIndex: 'placeName',
fixed: 'left',
width: 120,
search: false,
options: 1,
backgroundColor: "#ffffff",
fieldProps: {
@ -91,6 +92,9 @@ const hightModal = (type, record) => {
actionRef={ref}
scroll={{ x: 800 }}
options={false}
form={{
submitter:false
}}
// ref={c => { finishedProductTable = c; }}
style={{ width: "100% ", overflow: "auto", height: '760px' }}
rowKey='id'

4
web/client/src/sections/fillion/components/inforTable.js

@ -381,13 +381,13 @@ const InForTable = (props) => {
>
新增
</Button>
<Button
{/* <Button
type="primary"
style={{ width: "100px", marginLeft: 20 }}
>
导入
</Button>
</Button> */}
</div>

15
web/client/src/sections/fillion/components/maintenanceTable.js

@ -119,7 +119,7 @@ const DetailList = (props) => {
}
},
{
title: '缺陷名称',
title: '具体内容',
key: 'content',
dataIndex: 'content',
align: 'center'
@ -191,7 +191,14 @@ const DetailList = (props) => {
const PatrolNameList = (props) => {
const [users, setUsers] = useState([]);
const { onChange, record, userList, loading } = props;
const { name } = record || { name: '' }
const [selectRoad, setSelectRoad] = useState();
useEffect(() => {
if (userList && userList instanceof Array && userList.length) {
setSelectRoad(userList[0].id)
// onChange(userList[0]);
}
}, [userList])
const columns = [
{
title: '巡更人员',
@ -230,7 +237,7 @@ const PatrolNameList = (props) => {
loading={loading}
rowKey="name"
rowClassName={(record) => {
return record.patrolName === name ? styles['split-row-select-active'] : '';
return record.id == selectRoad ? 'list-row-actived' : '';
}}
toolBarRender={() => [
<Input placeholder='输入养护人员名称' onChange={doUserNameSearch} ></Input>
@ -242,7 +249,7 @@ const PatrolNameList = (props) => {
return {
onClick: () => {
if (record) {
console.log('record:', record)
setSelectRoad(record.id);
onChange(record);
}
},

25
web/client/src/sections/fillion/components/operationalTable.js

@ -723,7 +723,7 @@ const OperaTionalTable = (props) => {
>
新增
</Button>
<Button
{/* <Button
type="primary"
style={{ width: "100px", marginLeft: 20 }}
onClick={() => {
@ -731,7 +731,7 @@ const OperaTionalTable = (props) => {
}}
>
导入
</Button>
</Button> */}
</div>
@ -1356,7 +1356,7 @@ const OperaTionalTable = (props) => {
>
新增
</Button>
<Button
{/* <Button
type="primary"
style={{ width: "100px", marginLeft: 20 }}
onClick={() => {
@ -1364,7 +1364,7 @@ const OperaTionalTable = (props) => {
}}
>
导入
</Button>
</Button> */}
</div>
@ -1826,7 +1826,7 @@ const OperaTionalTable = (props) => {
>
新增
</Button>
<Button
{/* <Button
type="primary"
style={{ width: "100px", marginLeft: 20 }}
onClick={() => {
@ -1834,7 +1834,7 @@ const OperaTionalTable = (props) => {
}}
>
导入
</Button>
</Button> */}
</div>
@ -1848,6 +1848,9 @@ const OperaTionalTable = (props) => {
<div className='protable-transpor'>
<ProTable
actionRef={ref}
form={{
submitter: rewkeys === 'keyun' ? false : true,
}}
toolbar={{
multipleLine: true,
@ -1887,8 +1890,8 @@ const OperaTionalTable = (props) => {
}, {
key: 'tab4',
label: <span onClick={() => {
setDifferentiate('business')
setRewkeys('yehu')
setDifferentiate('business')
setRewkeys('yehu')
}}>业户{activeKey === 'tab4'}</span>,
},
@ -1900,7 +1903,9 @@ const OperaTionalTable = (props) => {
ref={c => { finishedProductTable = c; }}
style={{ width: "100% ", overflow: "auto", height: '760px' }}
rowKey='id'
rowSelection={{
// alwaysShowAlert
// tableAlertRender={true}
rowSelection={ rewkeys=='keyun'?false:{
selectedRowKeys: rowSelected,
onChange: (selectedRowKeys) => {
setRowSelected(selectedRowKeys);
@ -1966,7 +1971,7 @@ const OperaTionalTable = (props) => {
defaultCollapsed: false,
optionRender: (searchConfig, formProps, dom) => [
...dom.reverse(),
['tab2', 'tab3', 'tab4'].includes(activeKey) ? <Popconfirm title="确认导出?" onConfirm={() => { props.exports(rowSelected,differentiate,genre) }}>
['tab2', 'tab3', 'tab4'].includes(activeKey) ? <Popconfirm title="确认导出?" onConfirm={() => { props.exports(rowSelected, differentiate, genre) }}>
<Button
>
导出

15
web/client/src/sections/fillion/components/patrolTable.js

@ -122,7 +122,7 @@ const DetailList = (props) => {
}
},
{
title: '缺陷名称',
title: '具体内容',
key: 'content',
dataIndex: 'content',
align: 'center'
@ -194,7 +194,15 @@ const DetailList = (props) => {
const PatrolNameList = (props) => {
const [users, setUsers] = useState([]);
const { onChange, record, userList, loading } = props;
const { name } = record || { name: '' }
const [selectRoad, setSelectRoad] = useState();
useEffect(() => {
if (userList && userList instanceof Array && userList.length) {
setSelectRoad(userList[0].id)
// onChange(userList[0]);
}
}, [userList])
const columns = [
{
title: '巡更人员',
@ -232,7 +240,7 @@ const PatrolNameList = (props) => {
loading={loading}
rowKey="name"
rowClassName={(record) => {
return record.patrolName === name ? styles['split-row-select-active'] : '';
return record.id == selectRoad ? 'list-row-actived' : '';
}}
toolBarRender={() => [
<Input placeholder='输入巡更人员名称' onChange={doUserNameSearch} ></Input>
@ -245,6 +253,7 @@ const PatrolNameList = (props) => {
onClick: () => {
if (record) {
// console.log('record:', record)
setSelectRoad(record.id);
onChange(record);
}
},

3
web/client/src/sections/fillion/components/protable.less

@ -10,8 +10,9 @@
}
.list-row-actived {
background-color: #7cafc6;
background-color: #e2f6ff;
font-weight: 600;
color: #1E80FF
}

10
web/client/src/sections/fillion/components/publicTable.js

@ -434,7 +434,7 @@ const PublicTable = (props) => {
>
新增
</Button>
<Button
{/* <Button
type="primary"
style={{ width: "100px", marginLeft: 20 }}
onClick={() => {
@ -442,7 +442,7 @@ const PublicTable = (props) => {
}}
>
导入
</Button>
</Button> */}
</div>
@ -1129,7 +1129,7 @@ const PublicTable = (props) => {
>
新增
</Button>
<Button
{/* <Button
type="primary"
style={{ width: "100px", marginLeft: 20 }}
onClick={() => {
@ -1137,7 +1137,7 @@ const PublicTable = (props) => {
}}
>
导入
</Button>
</Button> */}
</div>
@ -1231,7 +1231,7 @@ const PublicTable = (props) => {
defaultCollapsed: false,
optionRender: (searchConfig, formProps, dom) => [
...dom.reverse(),
<Popconfirm title="确认导出?" onConfirm={() => { props.exports(rowSelected, counts) }}>
<Popconfirm title="确认导出?" onConfirm={() => { props.exports(rowSelected,rewkeys ) }}>
<Button
>
导出

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

@ -1208,7 +1208,7 @@ const TransporTationTable = (props) => {
>
新增
</Button>
<Button
{/* <Button
type="primary"
style={{ width: "100px", marginLeft: 20 }}
onClick={() => {
@ -1216,7 +1216,7 @@ const TransporTationTable = (props) => {
}}
>
导入
</Button>
</Button> */}
</div>
);
},
@ -2363,7 +2363,7 @@ const TransporTationTable = (props) => {
>
新增
</Button>
<Button
{/* <Button
type="primary"
style={{ width: "100px", marginLeft: 20 }}
onClick={() => {
@ -2371,7 +2371,7 @@ const TransporTationTable = (props) => {
}}
>
导入
</Button>
</Button> */}
</div>
@ -3519,7 +3519,7 @@ const TransporTationTable = (props) => {
>
新增
</Button>
<Button
{/* <Button
type="primary"
style={{ width: "100px", marginLeft: 20 }}
onClick={() => {
@ -3527,7 +3527,7 @@ const TransporTationTable = (props) => {
}}
>
导入
</Button>
</Button> */}
</div>
@ -3706,13 +3706,13 @@ const TransporTationTable = (props) => {
>
新增
</Button>
<Button
{/* <Button
type="primary"
style={{ width: "100px", marginLeft: 20 }}
>
导入
</Button>
</Button> */}
</div>

22
web/client/src/sections/fillion/containers/public.js

@ -9,17 +9,21 @@ const Public = (props) => {
const [data, setData] = useState()
useEffect(() => {
// dispatch(getDepMessage())
setData(props)
}, []);
//批量导出
const exports = (ids,counts) => {
console.log(counts);
let idas=ids.toString()
window.open(
'/_api/'+`data/export/?ids=${idas||''}&exp=${'overspeed'}&token=${user.token}`)
}
//批量导出
const exports = (ids, rewkeys) => {
let idas = ids.toString()
if (rewkeys === 'xianlu') {
window.open(
'/_api/' + `data/export/?ids=${idas || ''}&exp=${'busLine'}&token=${user.token}`)
}
if (rewkeys === 'cheliang') {
window.open(
'/_api/' + `data/export/?ids=${idas || ''}&exp=${'busCar'}&token=${user.token}`)
}
}
return (
<> <PublicTable data={data} exports={exports} />
</>

17
web/client/src/sections/quanju/containers/footer/leadership/left/left-top.js

@ -11,15 +11,30 @@ const Lefttop = (props) => {
const [mass, setMass] = useState()
const [speed, setspeed] = useState()
const [traffic, setTraffic] = useState()
const [nums, setNums] = useState()
useEffect(() => {
const shuju = dispatch(getGodshuju()).then((res) => {
// console.log(res);
setMass(res.payload.data.index)
// setMass(70)
setspeed(res.payload.data.speed)
if (localStorage.getItem("pinjun") && localStorage.getItem("num")) {
if (localStorage.getItem("pinjun") == res.payload.data.speed) {
setNums(localStorage.getItem("num"))
} else {
localStorage.setItem("pinjun", res.payload.data.speed)
localStorage.setItem("num", (res.payload.data.speed + ((Math.random() * (6) - 3))).toFixed(2))
setNums(localStorage.getItem("num"))
}
} else {
localStorage.setItem("pinjun", res.payload.data.speed)
localStorage.setItem("num", (res.payload.data.speed + ((Math.random() * (6) - 3))).toFixed(2))
setNums(localStorage.getItem("num"))
}
})
}, [])
// console.log(mass);
// console.log(nums);
return (
<>
<Module style={style} title={"道路拥堵指数"} >
@ -47,7 +62,7 @@ const Lefttop = (props) => {
fontSize: "14px", fontFamily: "PingFangSC-Regular, PingFang SC", color: "rgba(216,240,255,0.8000)",
position: "absolute", left: "30%", top: "65%"
}}>预测明日</p>
<p style={{ fontSize: "24px", fontFamily: "YouSheBiaoTiHei", color: "#ffffff", position: "absolute", top: "72%", left: "30%" }}>{isNaN((speed + ((Math.random() * (6) - 3))).toFixed(2)) ? "" : (speed + ((Math.random() * (6) - 3))).toFixed(2)}<span style={{ fontSize: "2px", color: "#EEF4FF" }}>Km/h</span></p>
<p style={{ fontSize: "24px", fontFamily: "YouSheBiaoTiHei", color: "#ffffff", position: "absolute", top: "72%", left: "30%" }}>{isNaN(nums) ? "" : (nums)}<span style={{ fontSize: "2px", color: "#EEF4FF" }}>Km/h</span></p>
</div>
</div>

Loading…
Cancel
Save