diff --git a/api/app/lib/controllers/report/index.js b/api/app/lib/controllers/report/index.js index bbaf89c6..c7aa1d18 100644 --- a/api/app/lib/controllers/report/index.js +++ b/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; diff --git a/scripts/0.0.1/data/4_file_type_data.sql b/scripts/0.0.1/data/4_file_type_data.sql new file mode 100644 index 00000000..b22bbe92 --- /dev/null +++ b/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; diff --git a/weapp/src/packages/patrol/index.jsx b/weapp/src/packages/patrol/index.jsx index f491864d..abe505fc 100644 --- a/weapp/src/packages/patrol/index.jsx +++ b/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 = { diff --git a/web/client/src/sections/fillion/components/bridgeTable.js b/web/client/src/sections/fillion/components/bridgeTable.js index 770a0e84..1e22bc37 100644 --- a/web/client/src/sections/fillion/components/bridgeTable.js +++ b/web/client/src/sections/fillion/components/bridgeTable.js @@ -1534,13 +1534,13 @@ const BrideTable = (props) => { > 新增 - + */} @@ -1717,13 +1717,13 @@ const BrideTable = (props) => { > 新增 - + */} diff --git a/web/client/src/sections/fillion/components/highwaysTable.js b/web/client/src/sections/fillion/components/highwaysTable.js index ccb7dd53..cc47a244 100644 --- a/web/client/src/sections/fillion/components/highwaysTable.js +++ b/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' diff --git a/web/client/src/sections/fillion/components/inforTable.js b/web/client/src/sections/fillion/components/inforTable.js index fd616f41..88738971 100644 --- a/web/client/src/sections/fillion/components/inforTable.js +++ b/web/client/src/sections/fillion/components/inforTable.js @@ -381,13 +381,13 @@ const InForTable = (props) => { > 新增 - + */} diff --git a/web/client/src/sections/fillion/components/maintenanceTable.js b/web/client/src/sections/fillion/components/maintenanceTable.js index f70d234f..fd71bb1a 100644 --- a/web/client/src/sections/fillion/components/maintenanceTable.js +++ b/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={() => [ @@ -242,7 +249,7 @@ const PatrolNameList = (props) => { return { onClick: () => { if (record) { - console.log('record:', record) + setSelectRoad(record.id); onChange(record); } }, diff --git a/web/client/src/sections/fillion/components/operationalTable.js b/web/client/src/sections/fillion/components/operationalTable.js index d61da928..79d5fff3 100644 --- a/web/client/src/sections/fillion/components/operationalTable.js +++ b/web/client/src/sections/fillion/components/operationalTable.js @@ -723,7 +723,7 @@ const OperaTionalTable = (props) => { > 新增 - + */} @@ -1356,7 +1356,7 @@ const OperaTionalTable = (props) => { > 新增 - + */} @@ -1826,7 +1826,7 @@ const OperaTionalTable = (props) => { > 新增 - + */} @@ -1848,6 +1848,9 @@ const OperaTionalTable = (props) => {
{ }, { key: 'tab4', label: { - setDifferentiate('business') - setRewkeys('yehu') + setDifferentiate('business') + setRewkeys('yehu') }}>业户{activeKey === 'tab4'}, }, @@ -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) ? { props.exports(rowSelected,differentiate,genre) }}> + ['tab2', 'tab3', 'tab4'].includes(activeKey) ? { props.exports(rowSelected, differentiate, genre) }}> - + */}
@@ -1129,7 +1129,7 @@ const PublicTable = (props) => { > 新增 - + */} @@ -1231,7 +1231,7 @@ const PublicTable = (props) => { defaultCollapsed: false, optionRender: (searchConfig, formProps, dom) => [ ...dom.reverse(), - { props.exports(rowSelected, counts) }}> + { props.exports(rowSelected,rewkeys ) }}> - + */} ); }, @@ -2363,7 +2363,7 @@ const TransporTationTable = (props) => { > 新增 - + */} @@ -3519,7 +3519,7 @@ const TransporTationTable = (props) => { > 新增 - + */} @@ -3706,13 +3706,13 @@ const TransporTationTable = (props) => { > 新增 - + */} diff --git a/web/client/src/sections/fillion/containers/public.js b/web/client/src/sections/fillion/containers/public.js index 6d0fcbcd..dde431dc 100644 --- a/web/client/src/sections/fillion/containers/public.js +++ b/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 ( <> diff --git a/web/client/src/sections/quanju/containers/footer/leadership/left/left-top.js b/web/client/src/sections/quanju/containers/footer/leadership/left/left-top.js index 9184450f..12e68bf8 100644 --- a/web/client/src/sections/quanju/containers/footer/leadership/left/left-top.js +++ b/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 ( <> @@ -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%" }}>预测明日

-

{isNaN((speed + ((Math.random() * (6) - 3))).toFixed(2)) ? "" : (speed + ((Math.random() * (6) - 3))).toFixed(2)}Km/h

+

{isNaN(nums) ? "" : (nums)}Km/h