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. 21
      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. 16
      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'; 'use strict';
const { QueryTypes } = require('sequelize'); const { QueryTypes } = require('sequelize');
async function reportList(ctx) { async function reportList (ctx) {
try { try {
const models = ctx.fs.dc.models; const models = ctx.fs.dc.models;
const { limit, page, startTime, endTime, keyword, userId, reportType, isTop } = ctx.query const { limit, page, startTime, endTime, keyword, userId, reportType, isTop } = ctx.query
@ -14,6 +14,7 @@ async function reportList(ctx) {
model: models.User, model: models.User,
attributes: ['name'] attributes: ['name']
}], }],
order: [['time', 'DESC']],
} }
if (limit) { if (limit) {
findOption.limit = limit findOption.limit = limit
@ -60,7 +61,7 @@ async function reportList(ctx) {
} }
} }
async function reportPosition(ctx) { async function reportPosition (ctx) {
try { try {
const models = ctx.fs.dc.models; const models = ctx.fs.dc.models;
const { startTime, endTime, userId, reportType } = ctx.query const { startTime, endTime, userId, reportType } = ctx.query
@ -110,7 +111,7 @@ async function reportPosition(ctx) {
} }
} }
async function reportDetail(ctx) { async function reportDetail (ctx) {
try { try {
const models = ctx.fs.dc.models; const models = ctx.fs.dc.models;
const { reportId } = ctx.params const { reportId } = ctx.params
@ -132,7 +133,7 @@ async function reportDetail(ctx) {
} }
} }
async function createReport(ctx) { async function createReport (ctx) {
try { try {
const { userId } = ctx.fs.api const { userId } = ctx.fs.api
const models = ctx.fs.dc.models; const models = ctx.fs.dc.models;
@ -154,7 +155,7 @@ async function createReport(ctx) {
} }
} }
async function deleteReport(ctx) { async function deleteReport (ctx) {
try { try {
const models = ctx.fs.dc.models; const models = ctx.fs.dc.models;
const { reportId } = ctx.params; 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' }) Taro.showToast({ title: '工程类型错误', icon: 'none' })
return return
} }
if (content.length > 50) {
Taro.showToast({ title: '内容字数不能超过50', icon: 'none' })
return
}
const reportProjectType = prjType[prjTypeSelector.indexOf(projectType)].value const reportProjectType = prjType[prjTypeSelector.indexOf(projectType)].value
let data = { let data = {

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

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

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

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

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

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

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

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

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

@ -723,7 +723,7 @@ const OperaTionalTable = (props) => {
> >
新增 新增
</Button> </Button>
<Button {/* <Button
type="primary" type="primary"
style={{ width: "100px", marginLeft: 20 }} style={{ width: "100px", marginLeft: 20 }}
onClick={() => { onClick={() => {
@ -731,7 +731,7 @@ const OperaTionalTable = (props) => {
}} }}
> >
导入 导入
</Button> </Button> */}
</div> </div>
@ -1356,7 +1356,7 @@ const OperaTionalTable = (props) => {
> >
新增 新增
</Button> </Button>
<Button {/* <Button
type="primary" type="primary"
style={{ width: "100px", marginLeft: 20 }} style={{ width: "100px", marginLeft: 20 }}
onClick={() => { onClick={() => {
@ -1364,7 +1364,7 @@ const OperaTionalTable = (props) => {
}} }}
> >
导入 导入
</Button> </Button> */}
</div> </div>
@ -1826,7 +1826,7 @@ const OperaTionalTable = (props) => {
> >
新增 新增
</Button> </Button>
<Button {/* <Button
type="primary" type="primary"
style={{ width: "100px", marginLeft: 20 }} style={{ width: "100px", marginLeft: 20 }}
onClick={() => { onClick={() => {
@ -1834,7 +1834,7 @@ const OperaTionalTable = (props) => {
}} }}
> >
导入 导入
</Button> </Button> */}
</div> </div>
@ -1848,6 +1848,9 @@ const OperaTionalTable = (props) => {
<div className='protable-transpor'> <div className='protable-transpor'>
<ProTable <ProTable
actionRef={ref} actionRef={ref}
form={{
submitter: rewkeys === 'keyun' ? false : true,
}}
toolbar={{ toolbar={{
multipleLine: true, multipleLine: true,
@ -1900,7 +1903,9 @@ const OperaTionalTable = (props) => {
ref={c => { finishedProductTable = c; }} ref={c => { finishedProductTable = c; }}
style={{ width: "100% ", overflow: "auto", height: '760px' }} style={{ width: "100% ", overflow: "auto", height: '760px' }}
rowKey='id' rowKey='id'
rowSelection={{ // alwaysShowAlert
// tableAlertRender={true}
rowSelection={ rewkeys=='keyun'?false:{
selectedRowKeys: rowSelected, selectedRowKeys: rowSelected,
onChange: (selectedRowKeys) => { onChange: (selectedRowKeys) => {
setRowSelected(selectedRowKeys); setRowSelected(selectedRowKeys);
@ -1966,7 +1971,7 @@ const OperaTionalTable = (props) => {
defaultCollapsed: false, defaultCollapsed: false,
optionRender: (searchConfig, formProps, dom) => [ optionRender: (searchConfig, formProps, dom) => [
...dom.reverse(), ...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 <Button
> >
导出 导出

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

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

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

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

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

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

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

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

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

@ -13,13 +13,17 @@ const Public = (props) => {
setData(props) setData(props)
}, []); }, []);
//批量导出 //批量导出
const exports = (ids,counts) => { const exports = (ids, rewkeys) => {
console.log(counts); let idas = ids.toString()
let idas=ids.toString() if (rewkeys === 'xianlu') {
window.open( window.open(
'/_api/'+`data/export/?ids=${idas||''}&exp=${'overspeed'}&token=${user.token}`) '/_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 ( return (
<> <PublicTable data={data} exports={exports} /> <> <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 [mass, setMass] = useState()
const [speed, setspeed] = useState() const [speed, setspeed] = useState()
const [traffic, setTraffic] = useState() const [traffic, setTraffic] = useState()
const [nums, setNums] = useState()
useEffect(() => { useEffect(() => {
const shuju = dispatch(getGodshuju()).then((res) => { const shuju = dispatch(getGodshuju()).then((res) => {
// console.log(res); // console.log(res);
setMass(res.payload.data.index) setMass(res.payload.data.index)
// setMass(70) // setMass(70)
setspeed(res.payload.data.speed) 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(mass);
// console.log(nums);
return ( return (
<> <>
<Module style={style} title={"道路拥堵指数"} > <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)", fontSize: "14px", fontFamily: "PingFangSC-Regular, PingFang SC", color: "rgba(216,240,255,0.8000)",
position: "absolute", left: "30%", top: "65%" position: "absolute", left: "30%", top: "65%"
}}>预测明日</p> }}>预测明日</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>
</div> </div>

Loading…
Cancel
Save