From 879ecc8cb329b225fb5940f2d40679a7c278e4e5 Mon Sep 17 00:00:00 2001 From: zhaobing Date: Thu, 13 Jul 2023 19:48:46 +0800 Subject: [PATCH] =?UTF-8?q?feat:=E5=B0=8F=E7=A8=8B=E5=BA=8F=E6=9D=83?= =?UTF-8?q?=E9=99=90=E7=9A=84=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- api/app/lib/controllers/data/index.js | 7 +- api/app/lib/controllers/overview/building.js | 7 +- api/app/lib/controllers/report/index.js | 2 +- scripts/1.2.3/schema/6.update_resource.sql | 1 + .../fillion/components/buildingTable.js | 6 +- .../fillion/components/patrolTable.js | 2 + .../src/sections/fillion/containers/assess.js | 2 +- .../organization/containers/authority.js | 2 +- .../sections/organization/containers/user.js | 2 +- .../quanju/containers/footer/build/index.js | 76 ++++++++++--------- 10 files changed, 57 insertions(+), 50 deletions(-) create mode 100644 scripts/1.2.3/schema/6.update_resource.sql diff --git a/api/app/lib/controllers/data/index.js b/api/app/lib/controllers/data/index.js index eb524973..3ddb0d82 100644 --- a/api/app/lib/controllers/data/index.js +++ b/api/app/lib/controllers/data/index.js @@ -4,13 +4,12 @@ const xlsxDownload = require('../../../../utils/xlsxDownload.js'); const moment = require('moment'); const request = require('superagent'); -async function dataExport (ctx) { +async function dataExport(ctx) { try { const models = ctx.fs.dc.models; const { userId } = ctx.fs.api const { exp, ids, roadLevel, municipalType, patrolType } = ctx.query; - if (!exp) { throw '参数错误'; } @@ -97,7 +96,7 @@ async function dataExport (ctx) { } if (patrolType) { if (patrolType == 'road') { - + } else if (patrolType == 'anomaly') { } else { @@ -133,7 +132,7 @@ async function dataExport (ctx) { } } -async function godTrans (ctx) { +async function godTrans(ctx) { try { const models = ctx.fs.dc.models; const { userId } = ctx.fs.api diff --git a/api/app/lib/controllers/overview/building.js b/api/app/lib/controllers/overview/building.js index a68e32ae..28e00a34 100644 --- a/api/app/lib/controllers/overview/building.js +++ b/api/app/lib/controllers/overview/building.js @@ -27,7 +27,7 @@ const areaCode = { "360121572000": "良种繁殖场", } -async function roadState (ctx) { +async function roadState(ctx) { try { const models = ctx.fs.dc.models; const { userId } = ctx.fs.api; @@ -36,7 +36,6 @@ async function roadState (ctx) { const projectRoadRes = await models.Project.findAll({ type: 'road', }) - const bridgeRes = await models.Bridge.findAll({}) let constructionYear = [] @@ -46,6 +45,8 @@ async function roadState (ctx) { constructionYear.reverse() const roadState = { + //总数 + projectAll: projectRoadRes.length, // 在建数量 buildingRoad: 0, // 已建数量 @@ -191,7 +192,7 @@ async function roadState (ctx) { } } - if (p.buildUnit) { + if (p.buildUnit && p.done) { let townName = p.buildUnit.replace('人民政府', '').replace('南昌县', '').replace('管委会', '') if (roadState.townProject[townName]) { roadState.townProject[townName] += 1 diff --git a/api/app/lib/controllers/report/index.js b/api/app/lib/controllers/report/index.js index 1f8e8c43..2ca58067 100644 --- a/api/app/lib/controllers/report/index.js +++ b/api/app/lib/controllers/report/index.js @@ -43,7 +43,7 @@ async function reportList (ctx) { where: { }, - attributes: ['id', 'road', 'time', 'projectType', 'roadSectionStart', 'performerId', 'roadSectionEnd', 'reportType', 'content', 'longitude', 'latitude', 'projectName', 'handleState'], + attributes: ['id', 'road', 'time', 'projectType', 'roadSectionStart', 'performerId', 'roadSectionEnd', 'reportType', 'content', 'longitude', 'latitude', 'projectName', 'handleState', 'codeRoad'], include: [{ model: models.User, attributes: ['name'] diff --git a/scripts/1.2.3/schema/6.update_resource.sql b/scripts/1.2.3/schema/6.update_resource.sql new file mode 100644 index 00000000..510af464 --- /dev/null +++ b/scripts/1.2.3/schema/6.update_resource.sql @@ -0,0 +1 @@ +UPDATE resource SET code = 'WXTODOANDONE', name = '小程序待办处理' WHERE code LIKE 'WXTODOLIST' ESCAPE '#' \ No newline at end of file diff --git a/web/client/src/sections/fillion/components/buildingTable.js b/web/client/src/sections/fillion/components/buildingTable.js index b4ca4b51..a1a0b26e 100644 --- a/web/client/src/sections/fillion/components/buildingTable.js +++ b/web/client/src/sections/fillion/components/buildingTable.js @@ -26,7 +26,7 @@ const BuildingTable = (props) => { const [grade, setGrade] = useState('project') const [departmentInfo, setDepartment] = useState('') const [editAble, setEditAble] = useState(user?.username !== 'SuperAdmin' && user?.userResources?.find(i => i.resourceId === 'BUILDINGPROJECT')?.isshow === "true" ? true : '') - console.log('user111', user) + //console.log('user111', user) const ref = useRef() const [activeKey, setActiveKey] = useState('tab1'); //打开弹窗 @@ -328,10 +328,10 @@ const BuildingTable = (props) => { optionRender: (searchConfig, formProps, dom) => [ ...dom.reverse(), { props.exports(rowSelected, grade, differentiate) }} - disabled={user?.username !== 'SuperAdmin' && user?.userResources?.filter(i => i.resourceId === 'ROADMANAGE')[0].isshow === "true" ? true : ''} + disabled={user?.username !== 'SuperAdmin' && user?.userResources?.find(i => i.resourceId === 'BUILDINGPROJECT').isshow === "true" ? true : ''} > diff --git a/web/client/src/sections/fillion/components/patrolTable.js b/web/client/src/sections/fillion/components/patrolTable.js index 88f63f6e..f8a9132e 100644 --- a/web/client/src/sections/fillion/components/patrolTable.js +++ b/web/client/src/sections/fillion/components/patrolTable.js @@ -46,7 +46,9 @@ const DetailForm = (props) => { { key: '所在路段', name: 'road', skip: isRoad }, { key: '具体位置', name: 'address' }, { key: '巡查内容', name: 'content' }, + { key: '路线代码', name: 'codeRoad' }, { key: '现场照片', name: 'scenePic' }, + ]; const renderContent = (data) => { diff --git a/web/client/src/sections/fillion/containers/assess.js b/web/client/src/sections/fillion/containers/assess.js index 1ce77a1a..17ef6f24 100644 --- a/web/client/src/sections/fillion/containers/assess.js +++ b/web/client/src/sections/fillion/containers/assess.js @@ -27,7 +27,7 @@ export const unitList = [ '黄马乡', ] function Assess(props) { - const { dispatch, assess } = props; + const { dispatch, assess, user } = props; const [assessModalVisible, setAssessModalVisible] = useState(false); const [editData, setEditData] = useState(null); const [query, setQuery] = useState({ page: 1, pageSize: 10 }) diff --git a/web/client/src/sections/organization/containers/authority.js b/web/client/src/sections/organization/containers/authority.js index a5ec4e51..46900017 100644 --- a/web/client/src/sections/organization/containers/authority.js +++ b/web/client/src/sections/organization/containers/authority.js @@ -14,7 +14,7 @@ const Authority = (props) => { const r1 = ['USERMANAGE', 'AUTHORIMANAGE', 'OVERLOADMANAGE', 'ROADMANAGE', 'BRIDGEMANAGE', 'MAINTENANCEMANAGE', 'TRANSPORTATIONMANAGE', 'CONSERVATIONMANAGE', 'PATROLMANAGE', 'PUBLICTRANSPORTMANAGE', 'FILEMANAGE', 'PUBLICITYVIDEO', 'FEEDBACKMANAGE', 'REPORTMANAGE', 'ASSESSMANAGE', 'VIDEOCENTER', 'BUILDINGPROJECT', 'WXPATROLREPORT', 'WXMAINTENANCEREPORT', 'WXFEEDBACKMANAGE', 'WXBUILDINGROAD', - 'WXTODOLIST', 'WXDONELIST' + 'WXTODOANDONE' ] const [depUserCopy, setDepUserCopy] = useState([])//用于存放除了自己的管理的数组,即自己不能调整自己是否为管理员 const [depSelectedKeys, setDepSelectedKeys] = useState([]) diff --git a/web/client/src/sections/organization/containers/user.js b/web/client/src/sections/organization/containers/user.js index e2c93dd0..2d0bef0f 100644 --- a/web/client/src/sections/organization/containers/user.js +++ b/web/client/src/sections/organization/containers/user.js @@ -320,7 +320,7 @@ const UserManage = (props) => { key="primary" style={{ marginLeft: 10 }} onClick={() => openDepModal('create')} - disabled={editAble} + disabled={user?.username !== 'SuperAdmin'} > 新建部门 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 8f3f1326..3573ab62 100644 --- a/web/client/src/sections/quanju/containers/footer/build/index.js +++ b/web/client/src/sections/quanju/containers/footer/build/index.js @@ -46,7 +46,7 @@ const Build = (props) => { // console.log(alltype,'打他啊') setdata(alltype.filter(item => item.name === '县' || item.name === "乡" || item.name === '村')) setbuildingnumber(res.payload.data) - // console.log(res.payload.data,'哈哈哈') + console.log(res.payload.data, '哈哈哈') } @@ -81,11 +81,11 @@ const Build = (props) => { return resValue } let datas = Object.keys(buildingnumber?.townRoad || {}).map((item) => ({ name: item, number: buildingnumber.townRoad[item].roadCount, gongli: Number(keepThreeNum(buildingnumber.townRoad[item].mileage)) })) - - let list = datas.sort((a, b) => { + + let list = datas.sort((a, b) => { return b.number - a.number }) - list=list.filter(item=>item.name!=="其他") + list = list.filter(item => item.name !== "其他") // console.log(list,'红红火') //道路等级数据 @@ -95,7 +95,11 @@ const Build = (props) => { onlineproject = onlineproject.sort((a, b) => { return b.total - a.total }) + //console.log('onlineproject', onlineproject) let sunonlineproject = onlineproject?.reduce((x, y) => x + y.total, 0) + let projectAll = buildingnumber?.projectAll + //console.log('projectAll', projectAll) + //let projectAll= let safetyData = alldengji?.filter(item => item.name === '一级公路' || item.name === '二级公路' || item.name === '三级公路' || item.name === '四级公路' || item.name === '等外公路') let sundata = data?.reduce((x, y) => x + y.value, 0) let sunsafetyData = safetyData?.reduce((x, y) => x + y.value, 0) @@ -104,9 +108,9 @@ const Build = (props) => { requestbuildingnumber(); requestxuanchuanlan() }, []) - useEffect(()=>{ + useEffect(() => { lunbo.current.goTo(lunboindex) - },[lunboindex]) + }, [lunboindex]) const rendercontent = () => { return (
{list.map(({ name, number, gongli }, index) =>
@@ -160,7 +164,7 @@ const Build = (props) => {
*/}
-
{sunonlineproject || 0}
+
{projectAll || 0}
{/* */} {/* */} @@ -222,7 +226,7 @@ const Build = (props) => { height: " 33%" }} customize={true}>
- + {/* */} {/* { @@ -248,36 +252,36 @@ const Build = (props) => { } */} { - xuandata&&xuandata!==null&&xuandata.length!==0?xuandata.filter(i=>i.enable).map((item,index1)=>{ - - if(item.video&&item.video!==null&&item.video.length!==0){ - return item.video.map((i,index)=>{ - // console.log(i,'视频') - console.log(index1,'index1') - if(index1===lunboindex){ - // lunbo.current.goTo(lunboindex) - console.log("自动播放",index1) - return - }else{ - // console.log("不自动播放",index1) - return + // return + + }) + : } - }) - } - // return - - }) - : - } {/* */}

全面建设好农村公路,切实发挥先行官作用