ww664853070 2 years ago
parent
commit
b69098df18
  1. 5
      api/app/lib/controllers/data/index.js
  2. 7
      api/app/lib/controllers/overview/building.js
  3. 2
      api/app/lib/controllers/report/index.js
  4. 1
      scripts/1.2.3/schema/6.update_resource.sql
  5. 5
      weapp/src/packages/patrol/index.jsx
  6. 14
      web/client/src/sections/fillion/components/bridgeTable.js
  7. 22
      web/client/src/sections/fillion/components/buildingTable.js
  8. 19
      web/client/src/sections/fillion/components/feedback/nominateModal.js
  9. 2
      web/client/src/sections/fillion/components/maintenanceTable.js
  10. 6
      web/client/src/sections/fillion/components/patrolTable.js
  11. 7
      web/client/src/sections/fillion/components/project/project.js
  12. 2
      web/client/src/sections/fillion/containers/assess.js
  13. 2
      web/client/src/sections/fillion/nav-item.js
  14. 2
      web/client/src/sections/organization/containers/authority.js
  15. 2
      web/client/src/sections/organization/containers/user.js
  16. 38
      web/client/src/sections/quanju/containers/footer/build/index.js
  17. 28
      web/client/src/sections/quanju/containers/footer/conserve/left/left-center.js

5
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 '参数错误';
}
@ -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

7
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

2
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']

1
scripts/1.2.3/schema/6.update_resource.sql

@ -0,0 +1 @@
UPDATE resource SET code = 'WXTODOANDONE', name = '小程序待办处理' WHERE code LIKE 'WXTODOLIST' ESCAPE '#'

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

@ -158,16 +158,19 @@ const Index = () => {
Taro.showLoading({ title: '加载中' })
let key = 'ODQBZ-3FZAU-6VIVL-2XXNM-F7CP7-WVFCY' // key
Taro.getLocation({
type: 'wgs84',
// type: 'wgs84',
type: 'gcj02',
isHighAccuracy: true,
highAccuracyExpireTime: 1000 * 6,
success: function (res) {
console.log(res);
setLongitude(res.longitude)
setLatitude(res.latitude)
Taro.request({
url: `https://apis.map.qq.com/ws/geocoder/v1/?location=${res.latitude},${res.longitude}&key=${key}`,
success: function (res) {
// res
console.log('地址信息:', res);
let addresscity = ''
addresscity =
res.data.result.address_component.province

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

@ -1767,13 +1767,13 @@ const BrideTable = (props) => {
activeKey,
onChange: (key) => setActiveKey(key),
items: [
{
key: 'tab1',
label: <span onClick={() => {
setWhichofits('qiaoliang')
setDifferentiate('bridge')
}}>桥梁{activeKey === 'tab1'}</span>,
},
// {
// key: 'tab1',
// label: <span onClick={() => {
// setWhichofits('qiaoliang')
// setDifferentiate('bridge')
// }}>桥梁{activeKey === 'tab1'}</span>,
// },
// {
// key: 'tab2',
// label: <span onClick={() => {

22
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');
//打开弹窗
@ -280,15 +280,15 @@ const BuildingTable = (props) => {
activeKey,
onChange: (key) => setActiveKey(key),
items: [
{
key: 'tab1',
label: <span onClick={() => {
setWhichofits('在建项目')
setDifferentiate('project')
setGrade('在建项目')
// {
// key: 'tab1',
// label: <span onClick={() => {
// setWhichofits('在建项目')
// setDifferentiate('project')
// setGrade('在建项目')
}}>在建项目{activeKey === 'tab1'}</span>,
},
// }}>在建项目{activeKey === 'tab1'}</span>,
// },
],
},
}}
@ -328,10 +328,10 @@ const BuildingTable = (props) => {
optionRender: (searchConfig, formProps, dom) => [
...dom.reverse(),
<Popconfirm title="确认导出?" onConfirm={() => { 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 : ''}
>
<Button
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 : ''}
>
导出
</Button>

19
web/client/src/sections/fillion/components/feedback/nominateModal.js

@ -65,7 +65,7 @@ const NominateModal = (props) => {
visible={visible}
onVisibleChange={onVisibleChange}
onFinish={handleFinish}
destroyOnClose={true}
destroyOnClose
initialValues={{ departmentId: null, name: null }}
>
<ProForm.Group>
@ -113,10 +113,23 @@ const NominateModal = (props) => {
request={async () => {
if (depId) {
const res = await dispatch(getDepUser(depId));
const processedUsers = res?.payload.data.map((user) => ({
const copy = res?.payload.data.filter((user) => {
if (user.isAdmin) {
return {
label: user.name, // 使用用户的名字作为选项的显示文本
value: user.id, // 使用用户的id作为选项的值
}));
}
}
}
)
let processedUsers = copy.map((item) => {
return {
label: item.name, // 使用用户的名字作为选项的显示文本
value: item.id, // 使用用户的id作为选项的值
}
})
console.log('processedUsers', copy)
console.log('processedUsers', processedUsers)
return Promise.resolve(processedUsers)
}

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

@ -435,7 +435,7 @@ const PatrolNameList = (props) => {
return (
<div className='spilce' style={{ height: '600px', width: '100%', overflow: 'auto' }} >
<Search
placeholder="请输入上报人"
placeholder="请输入上报人"
value={searchValue}
onChange={(e) => handleSearch(e.target.value)}
/>

6
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) => {
@ -251,10 +253,10 @@ const DetailList = (props) => {
<Button
onClick={() => { checkDetail(record); handleOpen(); }}
style={{ marginRight: 10 }}>查看</Button>,
isAnomaly && record.handleState != '已处理' && record.performerId === null ?
isAnomaly && record.handleState != '已处理' && record.performerId === null && user?.username === 'SuperAdmin' ?
<Button disabled={user?.username !== 'SuperAdmin' && user?.userResources?.filter(i => i.resourceId === 'FEEDBACKMANAGE' || 'FEEDBACKMANAGE')[0].isshow === "true" ? true : ''}
onClick={() => { setVis(true); setRecordId(record.id) }}>指派</Button> : null,
isAnomaly && record.handleState != '已处理' && record.performerId === null ?
isAnomaly && record.handleState != '已处理' && record.performerId === null && user?.username === 'SuperAdmin' ?
< Popover
content={
[

7
web/client/src/sections/fillion/components/project/project.js

@ -21,6 +21,7 @@ const ProjectModal = (props) => {
const { visible, onVisibleChange, typecard, rewkeys, recortd, dispatch, setRecortd, setDelet, getData } = props
//console.log('typecard', newlysay)
const [newlys, setNewlys] = useState() //必填数据
const [newlysay, setNewlysay] = useState() //处理hou
const [records, setRecords] = useState()//处理
const [recordsay, setRecordsay] = useState()//必填数据
@ -202,10 +203,10 @@ const ProjectModal = (props) => {
/>
})}
<ProFormDatePicker width="md" name='startTime' label='开工时间' key={10}></ProFormDatePicker>
<ProFormTextArea width="md" name='remark' label='备注' key={11}></ProFormTextArea>
</ProForm.Group>}
</ProForm.Group>}
<ProFormDatePicker width="md" name='startTime' label='开工时间' ></ProFormDatePicker>
<ProFormTextArea width="md" name='remark' label='备注' ></ProFormTextArea>
</DrawerForm>
{/* : ''
} */}

2
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 })

2
web/client/src/sections/fillion/nav-item.js

@ -68,7 +68,7 @@ export function getNavItem(user, dispatch) {
<Menu.Item key="fillionpatrolroad">
<Link to="/fillion/patrol_road">建设上报</Link>
</Menu.Item> : ''}
{user?.username == 'SuperAdmin' || user?.userResources?.filter(i => i.resourceId === 'BUILDINGPROJECT') ?
{user?.username == 'SuperAdmin' || user?.userResources?.some(i => i.resourceId === 'BUILDINGPROJECT') ?
<Menu.Item key="fillionbuilding">
<Link to="/fillion/processsing">在建项目</Link>
</Menu.Item> : ''}

2
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([])

2
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'}
>
新建部门</Button>

38
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, '哈哈哈')
}
@ -85,7 +85,7 @@ const Build = (props) => {
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 (<div className='build-left-center-content'>
{list.map(({ name, number, gongli }, index) => <div className='build-left-center-item' key={index}>
@ -160,7 +164,7 @@ const Build = (props) => {
</div> */}
<img src='/assets/images/quanju/yuanhuan.webp' className='build-left-top-center' />
<div className='build-left-top-item'>
<div>{sunonlineproject || 0}</div>
<div>{projectAll || 0}</div>
<div>
{/* <i>&#9658;</i> */}
{/* <span /> */}
@ -248,26 +252,26 @@ const Build = (props) => {
} */}
{
xuandata&&xuandata!==null&&xuandata.length!==0?xuandata.filter(i=>i.enable).map((item,index1)=>{
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)=>{
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){
console.log(index1, 'index1')
if (index1 === lunboindex) {
// lunbo.current.goTo(lunboindex)
console.log("自动播放",index1)
return <video src={`${localStorage.getItem("qndmn")}/${i}`} autoPlay={true} ref={lunbovideo} onEnded={()=>{
if(index1<xuandata.filter(i=>i.enable).length-1){
console.log("自动播放", index1)
return <video src={`${localStorage.getItem("qndmn")}/${i}`} autoPlay={true} ref={lunbovideo} onEnded={() => {
if (index1 < xuandata.filter(i => i.enable).length - 1) {
// console.log(index1,xuandata,'触发了')
setlunboindex(lunboindex+1)
}else{
setlunboindex(lunboindex + 1)
} else {
// console.log(index1,xuandata,'触发了')
setlunboindex(0)
}
}}></video>
}else{
} else {
// console.log("不自动播放",index1)
return <video src={`${localStorage.getItem("qndmn")}/${i}`} autoPlay={false} ></video>
}
@ -276,7 +280,7 @@ const Build = (props) => {
// return <video src={`${localStorage.getItem("qndmn")}/${item.video!==null&&item.video.length!==0?item.video[0]:""}`} autoPlay="autoplay" loop></video>
})
:<video src='#'></video>
: <video src='#'></video>
}
{/* <video src={xuandata&&xuandata!==null&&xuandata.length!==0?`${localStorage.getItem("qndmn")}/${xuandata[0].video!==null&&xuandata[0].video?xuandata[0].video[0]:""}`:"#"} autoPlay="autoplay" loop></video> */}
</Carousel>

28
web/client/src/sections/quanju/containers/footer/conserve/left/left-center.js

@ -27,27 +27,41 @@ const LeftCenter = (props) => {
dispatch(getNearestAssessData({ monthRange: 6 })).then(res => {
if (res.success) {
let nextChartSeries = []
let nextXAxis = new Set()
let nextXAxis = []
let data = res.payload.data
data.reverse()
for (let d of data) {
let corUnitSeries = nextChartSeries.find(item => item.name == d.unit)
let month = moment(d.month).format('YYYY-MM')
nextXAxis.add(month)
let curMonthIndex = nextXAxis.findIndex(item => item == month)
if (curMonthIndex < 0) {
nextXAxis.push(month)
curMonthIndex = nextXAxis.length - 1
}
if (corUnitSeries) {
corUnitSeries.data.push(d.totalPoints)
corUnitSeries.data[curMonthIndex] = d.totalPoints
} else {
nextChartSeries.push({
let nextnextChartSerie = {
type: 'line',
smooth: true,
data: [d.totalPoints],
data: [],
name: d.unit,
})
}
nextnextChartSerie.data[curMonthIndex] = d.totalPoints
nextChartSeries.push(nextnextChartSerie)
}
}
for (let s of nextChartSeries) {
for (let i = 0; i < nextXAxis.length; i++) {
if (!s.data[i] && s.data[i] != 0) {
s.data[i] = undefined
}
}
}
setChartData({
series: nextChartSeries,
xAxis: [...nextXAxis]
xAxis: nextXAxis
})
}
})

Loading…
Cancel
Save