From db9cf77c0e6143555a11dec241ffe2ea4ee5dc91 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E2=80=98lijianhao=E2=80=99?=
Av(zum1?@DC&*?GUzodiyu|fN5 ztFT=;_0GUI5gX?CRxH6Myuc(OZ+VQ^1|(aE~`^Pc;(1`o~H< za+D2zg>8bX=h#lyG&h1iRB#sVZU$So_q3*v-XAop<5|t}s}usN-zLa>2_%*V*93M1sTbU&qmAO@(Cx zT0T9^!P>LnIP9DlvBF%~mO-0Eveo$&Us2a96FgjdE0{6pxfZ^RYf__C>4mqC?(d%q z-Zcwm+~&C!c5lM8SomezQ;fQa`*pfgU8TFj8{zY2rgH`~APcX=aqh478KOw;>FeTC z=M-oF7FBXTsy>fGSYzm%0}a5UQgENd)+j+woRgpdT<{q_aD*X=j~ER77w|S|ol*^3 Q+yDRo07*qoM6N<$f_&Xe7ytkO literal 0 HcmV?d00001 diff --git a/web/client/src/sections/quanju/containers/footer/operation/left.js b/web/client/src/sections/quanju/containers/footer/operation/left.js index 86e9b9aa..eb5681e7 100644 --- a/web/client/src/sections/quanju/containers/footer/operation/left.js +++ b/web/client/src/sections/quanju/containers/footer/operation/left.js @@ -1,4 +1,5 @@ import React, { useMemo, useState, useEffect } from 'react'; +import { SearchOutlined } from '@ant-design/icons'; import { Col, Row, Input, Tree } from 'antd' import Module from '../../public/module' @@ -144,21 +145,26 @@ const Left = () => { - + + + + Date: Mon, 25 Jul 2022 11:28:08 +0800 Subject: [PATCH 09/11] =?UTF-8?q?=E6=8E=A5=E5=8F=A3=E6=8E=A5=E5=85=A5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- weapp/src/actions/auth.js | 2 +- weapp/src/config.js | 2 +- weapp/src/packages/patrolView/index.jsx | 34 +++++++++++++++++++++--- weapp/src/packages/patrolView/index.scss | 8 ++++-- weapp/src/pages/auth/login/login.jsx | 4 +-- weapp/src/pages/user/index.jsx | 2 +- weapp/src/services/api.js | 7 +++-- 7 files changed, 46 insertions(+), 13 deletions(-) diff --git a/weapp/src/actions/auth.js b/weapp/src/actions/auth.js index 5b33a8f2..30fdf382 100644 --- a/weapp/src/actions/auth.js +++ b/weapp/src/actions/auth.js @@ -37,7 +37,7 @@ export const login = (url, data) => { export const logout = (url, data) => { - return request.post(url, data).then(res => { + return request.put(url, data).then(res => { if (res.statusCode == 200 || res.statusCode == 204) { Taro.clearStorage(); return res.data; diff --git a/weapp/src/config.js b/weapp/src/config.js index a50b38d3..71b3443d 100644 --- a/weapp/src/config.js +++ b/weapp/src/config.js @@ -8,7 +8,7 @@ const baseConfig = { }; const development = { - baseUrl: 'https://smartwater.anxinyun.cn/api', + baseUrl: 'https://3024-117-90-36-177.jp.ngrok.io', webUrl: 'https://smartwater.anxinyun.cn', pcode: 'fce4afe2-5b6a-408a-ab18-a2afa7fa027c', imgUrl: 'http://test.resources.anxinyun.cn/', diff --git a/weapp/src/packages/patrolView/index.jsx b/weapp/src/packages/patrolView/index.jsx index ed52ad54..db072309 100644 --- a/weapp/src/packages/patrolView/index.jsx +++ b/weapp/src/packages/patrolView/index.jsx @@ -1,9 +1,11 @@ -import React, { useState } from 'react' +import React, { useState, useEffect } from 'react' import Taro, { useDidShow } from '@tarojs/taro' import { View, Picker, Input, Image } from '@tarojs/components' import moment from 'moment' import './index.scss' import NoData from '@/components/no-data/noData' +import request from '@/services/request' +import { getReportList } from '@/services/api'; import chevronDown from '../../static/img/patrolView/chevron-down.png' import searchIcon from '../../static/img/patrolView/search.png' import cardImg from '../../static/img/patrolView/card-img.png' @@ -22,6 +24,8 @@ function Index() { const [num, setNum] = useState(Math.random()) const [systemInfo, setSystemInfo] = useState('') + const userInfo = Taro.getStorageSync('userInfo') || {}; + const data = [ { place: { @@ -34,6 +38,28 @@ function Index() { } ] + function dealError(error) { + Taro.showToast({ + title: error, + icon: 'none', + duration: 1500 + }); + throw new Error(error); + } + useEffect(() => { + request.get(getReportList(), {}, { hideErrorToast: true, hideLoading: true }).then(res => { + if (res.statusCode == 200) { + console.log(res); + setListData(res.data) + return res.data; + } else { + dealError(res.data.message || '请求出错'); + } + }, err => { + dealError(err.message || '请求出错'); + }); + }, []) + useDidShow(() => { let refresh = Taro.getStorageSync('refresh'); // 返回列表需要刷新 if (refresh) { @@ -102,15 +128,15 @@ function Index() { - + { - data && data.length > 0 ? data && data.map((e, index) => { + listData && listData.length > 0 ? listData && listData.map((e, index) => { return ( handleDetail(index)}> - {e.place.name} + {e.road} 填报人: {e.user.name} diff --git a/weapp/src/packages/patrolView/index.scss b/weapp/src/packages/patrolView/index.scss index fc705a70..7de6c587 100644 --- a/weapp/src/packages/patrolView/index.scss +++ b/weapp/src/packages/patrolView/index.scss @@ -2,6 +2,10 @@ page { background-color: #f6f6f6; .type-box { + position: fixed; + top: 0px; + width: 100%; + z-index: 100; background-color: #fff; height: 80px; display: flex; @@ -20,8 +24,8 @@ page { margin: 0 10px; } } + .line { - width: 1px; height: 30px; background-color: #f6f6f6; @@ -88,7 +92,7 @@ page { .cardBox { width: 690rpx; - margin: 50rpx auto; + margin: 40rpx auto; .card-item { position: relative; diff --git a/weapp/src/pages/auth/login/login.jsx b/weapp/src/pages/auth/login/login.jsx index 70779dc8..5f45438f 100644 --- a/weapp/src/pages/auth/login/login.jsx +++ b/weapp/src/pages/auth/login/login.jsx @@ -18,7 +18,7 @@ const LoginPage = (props) => { const [password, setPassword] = useState(''); const doLogin = () => { - login(getLoginUrl(), { username, password, pcode }).then(res => { + login(getLoginUrl(), { phone: username, password }).then(res => { Taro.reLaunch({ url: '/pages/home/index' }); @@ -50,7 +50,7 @@ const LoginPage = (props) => { 登录 - + diff --git a/weapp/src/pages/user/index.jsx b/weapp/src/pages/user/index.jsx index 299a8eec..b1a7009d 100644 --- a/weapp/src/pages/user/index.jsx +++ b/weapp/src/pages/user/index.jsx @@ -36,7 +36,7 @@ const Index = ({ ...props }) => { - {userInfo.displayName} + {userInfo.name} {userInfo.phone} diff --git a/weapp/src/services/api.js b/weapp/src/services/api.js index 08fe03f8..bc0f6aeb 100644 --- a/weapp/src/services/api.js +++ b/weapp/src/services/api.js @@ -1,13 +1,16 @@ export const getLoginUrl = () => { - return `/login`; + return `/wxLogin`; }; - export const getLogoutUrl = () => { return `/logout`; }; +export const getReportList = () => { + return `/report/list`; +}; + //行业查询 export const getIndustryUrl = () => { return `/elec/business/industry` From 2ed26ba452af2ce55631c353d1fec701b03a59d5 Mon Sep 17 00:00:00 2001 From: liujiangyong Date: Mon, 25 Jul 2022 13:28:57 +0800 Subject: [PATCH 10/11] =?UTF-8?q?=E7=BB=86=E8=8A=82=E4=BC=98=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- weapp/src/packages/patrol/index.jsx | 2 +- weapp/src/packages/patrol/index.scss | 10 +++++----- weapp/src/packages/patrolView/index.jsx | 14 +------------- weapp/src/pages/home/index.jsx | 8 +++++--- 4 files changed, 12 insertions(+), 22 deletions(-) diff --git a/weapp/src/packages/patrol/index.jsx b/weapp/src/packages/patrol/index.jsx index fa27ad47..36390b54 100644 --- a/weapp/src/packages/patrol/index.jsx +++ b/weapp/src/packages/patrol/index.jsx @@ -81,7 +81,7 @@ const Index = () => { }, [images]) return ( - + 上报类型 diff --git a/weapp/src/packages/patrol/index.scss b/weapp/src/packages/patrol/index.scss index b7338b0f..83057e4b 100644 --- a/weapp/src/packages/patrol/index.scss +++ b/weapp/src/packages/patrol/index.scss @@ -1,13 +1,12 @@ -.patrol { - height: 100vh; +page { + height: 100%; width: 100vw; background-color: #f6f6f6; - padding-top: 20px; .report-type { height: 96px; background-color: #fff; - margin-bottom: 20px; + margin: 20px auto; display: flex; justify-content: space-between; align-items: center; @@ -53,6 +52,7 @@ .horizontal-line { height: 30px; width: 100%; + border-radius: 5px; display: flex; justify-content: left; align-items: center; @@ -111,6 +111,6 @@ .sub-btn { width: 70%; - margin-top: 100px; + margin: 80px auto; } } \ No newline at end of file diff --git a/weapp/src/packages/patrolView/index.jsx b/weapp/src/packages/patrolView/index.jsx index db072309..04792eea 100644 --- a/weapp/src/packages/patrolView/index.jsx +++ b/weapp/src/packages/patrolView/index.jsx @@ -26,18 +26,6 @@ function Index() { const userInfo = Taro.getStorageSync('userInfo') || {}; - const data = [ - { - place: { - name: '飞尚' - }, - user: { - name: '用户1' - }, - time: '2022-7-1' - } - ] - function dealError(error) { Taro.showToast({ title: error, @@ -47,7 +35,7 @@ function Index() { throw new Error(error); } useEffect(() => { - request.get(getReportList(), {}, { hideErrorToast: true, hideLoading: true }).then(res => { + request.get(getReportList(),{}, { hideErrorToast: true, hideLoading: true }).then(res => { if (res.statusCode == 200) { console.log(res); setListData(res.data) diff --git a/weapp/src/pages/home/index.jsx b/weapp/src/pages/home/index.jsx index 95fa024b..ca1d68ca 100644 --- a/weapp/src/pages/home/index.jsx +++ b/weapp/src/pages/home/index.jsx @@ -4,8 +4,9 @@ import { View } from '@tarojs/components'; import { useIndustry } from '@/actions/business'; import './index.scss'; - const Index = () => { + const userInfo = Taro.getStorageSync('userInfo') || {}; + const isSuperAdmin = userInfo && userInfo.username === 'SuperAdmin' ? true : false function toPatrol() { Taro.navigateTo({ @@ -22,8 +23,9 @@ const Index = () => { 巡 查 养 护 - {/* 填报 */} - 查看 + + {isSuperAdmin ? '查看' : '填报'} + ); From e0f91077a5ac4a83c49bc3eaca58fc9028b155b1 Mon Sep 17 00:00:00 2001 From: dengyinhuan Date: Mon, 25 Jul 2022 13:38:03 +0800 Subject: [PATCH 11/11] =?UTF-8?q?=E6=8E=A5=E5=85=A5=E5=A4=A7=E5=B1=8F?= =?UTF-8?q?=E7=AE=A1=E7=90=86=E7=9A=84=E6=95=B0=E6=8D=AE=EF=BC=8C=E8=BF=98?= =?UTF-8?q?=E6=9C=89=E5=BB=BA=E8=AE=BE=E5=A4=A7=E5=B1=8F=E9=83=A8=E5=88=86?= =?UTF-8?q?=E6=95=B0=E6=8D=AE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/sections/quanju/actions/example.js | 38 +++++++++ .../quanju/containers/footer/build/index.js | 43 ++++++++-- .../quanju/containers/footer/guanli/index.js | 82 ++++++++++++++----- web/client/src/utils/webapi.js | 15 +++- 4 files changed, 150 insertions(+), 28 deletions(-) diff --git a/web/client/src/sections/quanju/actions/example.js b/web/client/src/sections/quanju/actions/example.js index b9b2ffbd..5818df8d 100644 --- a/web/client/src/sections/quanju/actions/example.js +++ b/web/client/src/sections/quanju/actions/example.js @@ -13,3 +13,41 @@ export function getMembers(orgId) { reducer: { name: 'members' } }); } + + +//获取大屏道路统计信息 +export function getdaolutongji() { + return dispatch => basicAction({ + type: 'get', + dispatch: dispatch, + actionType: 'GET_DAOLUTONGJI', + url: ApiTable.getBgroadstatistics, + msg: { error: '获取道路统计信息失败' }, + // reducer: { name: 'members' } + }); +} + +//获取治超监测点处理数据信息 +export function getjiandmanage() { + return dispatch => basicAction({ + type: 'get', + dispatch: dispatch, + actionType: 'GET_JIANDMANAGE', + url: ApiTable.getzhichaomanager, + msg: { error: '获取治超监测点处理数据信息' }, + // reducer: { name: 'members' } + }); +} + + +//获取治超详情列 +export function getjiandetail() { + return dispatch => basicAction({ + type: 'get', + dispatch: dispatch, + actionType: 'GET_JIANDETAIL', + url: ApiTable.getzhichaodetail, + msg: { error: '获取治超监测点处理数据信息' }, + // reducer: { name: 'members' } + }); +} \ No newline at end of file diff --git a/web/client/src/sections/quanju/containers/footer/build/index.js b/web/client/src/sections/quanju/containers/footer/build/index.js index 834b1b31..86884a9b 100644 --- a/web/client/src/sections/quanju/containers/footer/build/index.js +++ b/web/client/src/sections/quanju/containers/footer/build/index.js @@ -1,4 +1,5 @@ -import React from 'react' +import React, { useEffect, useState } from 'react' +import { connect } from 'react-redux'; // import LeftTop from './Lefttop' // import LeftCenter from './Leftcenter' import LeftBottom from './Leftbottom' @@ -10,7 +11,19 @@ import Module from '../../public/module' import RightBottom from './Rightbottom' import AutoRollComponent from './AutoRollComponent' import './style.less' -const Build = () => { +import {getdaolutongji} from '../../../actions/example' +const Build = (props) => { + const { dispatch } = props + const [buildingnumber,setbuildingnumber] = useState(0) + const requestbuildingnumber = async ()=>{ + const res = await dispatch(getdaolutongji()); + setbuildingnumber(res.payload.data) + // console.log(res.payload.data,'哈哈哈') + + } + useEffect(()=>{ + requestbuildingnumber() + },[]) const datas = new Array(15) datas.fill({ name:"东乡镇", @@ -39,7 +52,7 @@ const Build = () => { 在建公路数量 - 6200 + {buildingnumber.buildingRoad || 0} @@ -48,7 +61,7 @@ const Build = () => { 已建公路数量 - 6200 + {buildingnumber.buildedRoad || 0}