wangyue 2 years ago
parent
commit
76ad089b4e
  1. 2
      scripts/0.0.1/data/1_update_user_dep_data.sql
  2. 32
      web/client/src/sections/fillion/components/infor/videoUpload.js
  3. 6
      web/client/src/sections/fillion/components/maintenanceTable.js
  4. 4
      web/client/src/sections/fillion/components/patrolTable.js
  5. 16
      web/client/src/sections/fillion/components/promotionalTable.js

2
scripts/0.0.1/data/1_update_user_dep_data.sql

@ -5,4 +5,4 @@ INSERT INTO "department" VALUES (1, '默认部门', NULL, false);
-- ---------------------------- -- ----------------------------
-- Records of user -- Records of user
-- ---------------------------- -- ----------------------------
INSERT INTO "user" VALUES (1, '管理员', 'SuperAdmin', 'e10adc3949ba59abbe56e057f20f883e', 1, 'f', NULL, 'SuperAdmin', NULL, TRUE); INSERT INTO "user" VALUES (1, '管理员', 'SuperAdmin', 'e10adc3949ba59abbe56e057f20f883e', 1, 'f', 'sp', 'SuperAdmin', NULL, TRUE);

32
web/client/src/sections/fillion/components/infor/videoUpload.js

@ -1,6 +1,6 @@
import React, { useState, useEffect } from 'react'; import React, { useState } from 'react';
import { connect } from 'react-redux'; import { connect } from 'react-redux';
import { Modal, Form, Button, Input, Card, List } from 'antd'; import { Modal, Form, Button, Input, Switch } from 'antd';
import Uploads from "../../../../components/Upload/index" import Uploads from "../../../../components/Upload/index"
import { putAddPropagata } from '../../actions/infor'; import { putAddPropagata } from '../../actions/infor';
import { putEditPropagata } from '../../actions/infor'; import { putEditPropagata } from '../../actions/infor';
@ -8,11 +8,9 @@ import { getPropagata } from '../../actions/infor';
const VideoUpload = (props) => { const VideoUpload = (props) => {
// const [counts, setCounts] = useState()//shuju
const { dispatch, record, counts, setCounts } = props const { dispatch, record, counts, setCounts } = props
const [success, setSuccess] = useState() //状态
const [form] = Form.useForm(); const [form] = Form.useForm();
//弹窗 //弹窗
@ -34,7 +32,8 @@ const VideoUpload = (props) => {
return item.storageUrl return item.storageUrl
}) })
const videoname = values.videoname const videoname = values.videoname
const data = { name: videoname, video: videoAddress } const enable = values.show
const data = { name: videoname, video: videoAddress, enable: enable }
dispatch(putAddPropagata(data)).then(() => { dispatch(putAddPropagata(data)).then(() => {
dispatch(getPropagata()).then((res) => { dispatch(getPropagata()).then((res) => {
setCounts(res.payload.data) setCounts(res.payload.data)
@ -48,9 +47,6 @@ const VideoUpload = (props) => {
const handleOkEdit = (record) => { const handleOkEdit = (record) => {
form.validateFields().then((values) => { form.validateFields().then((values) => {
const videoAddress = values.video.map((item) => {
return item.storageUrl
})
const videoname = values.username const videoname = values.username
const id = record.id const id = record.id
const video = record.video const video = record.video
@ -68,8 +64,6 @@ const VideoUpload = (props) => {
setIsModalVisible(false); setIsModalVisible(false);
}; };
const handleCancel = () => { const handleCancel = () => {
setIsModalVisible(false); setIsModalVisible(false);
}; };
@ -82,8 +76,6 @@ const VideoUpload = (props) => {
console.log('Failed:', errorInfo); console.log('Failed:', errorInfo);
}; };
return ( return (
<div > <div >
{ {
@ -99,7 +91,7 @@ const VideoUpload = (props) => {
span: 16, span: 16,
}} }}
initialValues={{ initialValues={{
remember: true, show: true
}} }}
onFinish={onFinish} onFinish={onFinish}
onFinishFailed={onFinishFailed} onFinishFailed={onFinishFailed}
@ -123,6 +115,12 @@ const VideoUpload = (props) => {
<Form.Item <Form.Item
label="选择视频" label="选择视频"
name="video" name="video"
rules={[
{
required: true,
message: '必须上传视频!',
},
]}
> >
<Uploads <Uploads
maxFilesNum={10} maxFilesNum={10}
@ -130,6 +128,12 @@ const VideoUpload = (props) => {
maxFileSize={200} maxFileSize={200}
/> />
</Form.Item> </Form.Item>
<Form.Item
label="是否开启展示"
name="show"
>
<Switch checkedChildren="展示" unCheckedChildren="关闭" defaultChecked={true} />
</Form.Item>
</Form> </Form>
</Modal> </Modal>
</div> </div>
@ -180,8 +184,6 @@ const VideoUpload = (props) => {
fileTypes={['mp4']} fileTypes={['mp4']}
maxFileSize={200} maxFileSize={200}
/> />
</Form.Item> </Form.Item>
</Form> </Form>
</Modal> </Modal>

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

@ -18,7 +18,7 @@ const DetailForm = (props) => {
{ key: '所在路段', name: 'road' }, { key: '所在路段', name: 'road' },
{ key: '具体位置', name: 'address' }, { key: '具体位置', name: 'address' },
{ key: '巡查内容', name: 'content' }, { key: '巡查内容', name: 'content' },
{ key: '病害照片', name: 'scenePic' }, // { key: '病害照片', name: 'scenePic' },
{ key: '养护前', name: 'conserveBeforePic' }, { key: '养护前', name: 'conserveBeforePic' },
{ key: '养护中', name: 'conserveUnderwayPic' }, { key: '养护中', name: 'conserveUnderwayPic' },
{ key: '养护后', name: 'conserveAfterPic' }, { key: '养护后', name: 'conserveAfterPic' },
@ -56,7 +56,7 @@ const DetailForm = (props) => {
visible={visible} visible={visible}
footer={null} footer={null}
onCancel={handleClose} onCancel={handleClose}
title={'巡更详细'} title={'养护管理详情'}
> >
<Spin spinning={loading}> <Spin spinning={loading}>
{renderContent(data)} {renderContent(data)}
@ -269,7 +269,7 @@ const MaintenanceTable = (props) => {
useEffect(() => { useEffect(() => {
if (record) { if (record) {
let query = { userId: record.id, reportType: 'conserve' } let query = { userId: record.id, reportType: 'conserve' }
if ((dateRange && dateRange instanceof Array)) { if ((dateRange && dateRange instanceof Array && dateRange[0] != '')) {
query.startTime = moment(dateRange[0]).startOf('day').format('YYYY-MM-DD HH:mm:ss') query.startTime = moment(dateRange[0]).startOf('day').format('YYYY-MM-DD HH:mm:ss')
query.endTime = moment(dateRange[1]).endOf('day').format('YYYY-MM-DD HH:mm:ss') query.endTime = moment(dateRange[1]).endOf('day').format('YYYY-MM-DD HH:mm:ss')
} }

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

@ -57,7 +57,7 @@ const DetailForm = (props) => {
visible={visible} visible={visible}
footer={null} footer={null}
onCancel={handleClose} onCancel={handleClose}
title={'巡更详细'} title={'巡更管理详情'}
> >
<Spin spinning={loading}> <Spin spinning={loading}>
{renderContent(data)} {renderContent(data)}
@ -273,7 +273,7 @@ const PatrolTable = (props) => {
const queryData = () => { const queryData = () => {
let query = { userId: record.id, reportType: 'patrol' } let query = { userId: record.id, reportType: 'patrol' }
if ((dateRange && dateRange instanceof Array)) { if ((dateRange && dateRange instanceof Array && dateRange[0] != '')) {
query.startTime = moment(dateRange[0]).startOf('day').format('YYYY-MM-DD HH:mm:ss') query.startTime = moment(dateRange[0]).startOf('day').format('YYYY-MM-DD HH:mm:ss')
query.endTime = moment(dateRange[1]).endOf('day').format('YYYY-MM-DD HH:mm:ss') query.endTime = moment(dateRange[1]).endOf('day').format('YYYY-MM-DD HH:mm:ss')
} }

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

@ -30,7 +30,8 @@ const promotionalTable = (props) => {
const columns = const columns =
[{ [
{
title: '序号', title: '序号',
search: false, search: false,
dataIndex: 'containers', dataIndex: 'containers',
@ -60,8 +61,8 @@ const promotionalTable = (props) => {
fixed: 'right', fixed: 'right',
render: (dom, record) => { render: (dom, record) => {
return <div > return <div >
<Switch checkedChildren="展示" unCheckedChildren="关闭" onClick={() => onClickEnable(record)} defaultChecked={true ? record.enable == true : false} />
<Switch checkedChildren="展示" unCheckedChildren="关闭" onClick={() => onClickEnable(record)} defaultChecked={true ? record.enable == true : false} /></div> </div>
} }
}, },
{ {
@ -69,7 +70,7 @@ const promotionalTable = (props) => {
dataIndex: 'creatTime', dataIndex: 'creatTime',
valueType: 'dateTimeRange', valueType: 'dateTimeRange',
hideInSearch: true, hideInSearch: true,
width: 160, width: 120,
fixed: 'right', fixed: 'right',
render: (dom, record) => { render: (dom, record) => {
return <div style={{ position: 'relative', marginTop: '-30px' }}> return <div style={{ position: 'relative', marginTop: '-30px' }}>
@ -119,7 +120,6 @@ const promotionalTable = (props) => {
useEffect(() => { useEffect(() => {
const vedio = dispatch(getPropagata()).then((res) => { const vedio = dispatch(getPropagata()).then((res) => {
setCounts(res.payload.data) setCounts(res.payload.data)
console.log(res.payload.data)
}) })
}, []) }, [])
@ -133,12 +133,6 @@ const promotionalTable = (props) => {
options={false} options={false}
style={{ width: "100% ", overflow: "auto", height: '760px' }} style={{ width: "100% ", overflow: "auto", height: '760px' }}
rowKey='id' rowKey='id'
rowSelection={{
selectedRowKeys: rowSelected,
onChange: (selectedRowKeys) => {
setRowSelected(selectedRowKeys);
},
}}
form={{ form={{
submitter: false, submitter: false,
}} }}

Loading…
Cancel
Save