Browse Source

全局表格样式

master
liujiangyong 2 years ago
parent
commit
5948e26f26
  1. 7
      web/client/src/sections/issueHandle/containers/patrolRecord.js
  2. 9
      web/client/src/sections/organization/components/resource.js
  3. 5
      web/client/src/sections/organization/containers/user.js
  4. 5
      web/client/src/sections/patrolManage/containers/checkItems.js
  5. 5
      web/client/src/sections/patrolManage/containers/patrolPlan.js
  6. 11
      web/client/src/sections/patrolManage/containers/patrolRecord.js
  7. 5
      web/client/src/sections/patrolManage/containers/patrolReport.js
  8. 5
      web/client/src/sections/patrolManage/containers/patrolTemplate.js

7
web/client/src/sections/issueHandle/containers/patrolRecord.js

@ -206,7 +206,7 @@ const PatrolRecord = (props) => {
] ]
return ( return (
<div id='patrol-record'> <div id='patrol-record' className='global-main'>
<div style={{ marginBottom: 20 }}> <div style={{ marginBottom: 20 }}>
<Input style={{ width: 240, marginRight: 20 }} <Input style={{ width: 240, marginRight: 20 }}
value={name} onChange={e => { setName(e.target.value) }} value={name} onChange={e => { setName(e.target.value) }}
@ -229,6 +229,11 @@ const PatrolRecord = (props) => {
showSizeChanger: true, showSizeChanger: true,
pageSizeOptions: [10, 20, 50], pageSizeOptions: [10, 20, 50],
}} }}
rowClassName={(record, index) => {
let className = 'global-light-row';
if (index % 2 === 1) className = 'global-dark-row';
return className;
}}
/> />
</div> </div>
) )

9
web/client/src/sections/organization/components/resource.js

@ -10,7 +10,7 @@ const Resource = props => {
const [roleCheck, setRoleCheck] = useState({});//一级权限码 const [roleCheck, setRoleCheck] = useState({});//一级权限码
const [parentRoleCheck, setParentRoleCheck] = useState({}); //二级权限码 const [parentRoleCheck, setParentRoleCheck] = useState({}); //二级权限码
const roleDatas=roleData.slice(0) const roleDatas = roleData.slice(0)
useEffect(() => { useEffect(() => {
const check = {} const check = {}
const parentCheck = {} const parentCheck = {}
@ -54,6 +54,11 @@ const Resource = props => {
bordered bordered
pagination={false} pagination={false}
dataSource={roleDatas} dataSource={roleDatas}
rowClassName={(record, index) => {
let className = 'global-light-row';
if (index % 2 === 1) className = 'global-dark-row';
return className;
}}
columns={[{ columns={[{
title: '功能', title: '功能',
key: 'name', key: 'name',
@ -61,7 +66,7 @@ const Resource = props => {
render: (text, record) => { render: (text, record) => {
const parentCode = record.code const parentCode = record.code
return <Checkbox return <Checkbox
indeterminate={indeterminate[parentCode]} indeterminate={indeterminate[parentCode]}
onChange={(e) => { onChange={(e) => {
const currentParCheck = JSON.parse(JSON.stringify(parentRoleCheck)); const currentParCheck = JSON.parse(JSON.stringify(parentRoleCheck));

5
web/client/src/sections/organization/containers/user.js

@ -302,6 +302,11 @@ const UserManage = (props) => {
options={false} options={false}
search={false} search={false}
rowKey="id" rowKey="id"
rowClassName={(record, index) => {
let className = 'global-light-row';
if (index % 2 === 1) className = 'global-dark-row';
return className;
}}
/> />
</div> </div>
{ {

5
web/client/src/sections/patrolManage/containers/checkItems.js

@ -146,6 +146,11 @@ function CheckItems(props) {
disabled: record && record.patrolTemplates && record.patrolTemplates.length, disabled: record && record.patrolTemplates && record.patrolTemplates.length,
}), }),
}} }}
rowClassName={(record, index) => {
let className = 'global-light-row';
if (index % 2 === 1) className = 'global-dark-row';
return className;
}}
/> />
{ {
visible ? visible ?

5
web/client/src/sections/patrolManage/containers/patrolPlan.js

@ -153,6 +153,11 @@ function PatrolPlan(props) {
return { ...res }; return { ...res };
}} }}
onReset={() => { }} onReset={() => { }}
rowClassName={(record, index) => {
let className = 'global-light-row';
if (index % 2 === 1) className = 'global-dark-row';
return className;
}}
/> />
{ {
visible ? visible ?

11
web/client/src/sections/patrolManage/containers/patrolRecord.js

@ -126,7 +126,7 @@ const PatrolRecord = (props) => {
] ]
return ( return (
<div id='patrol-record'> <div id='patrol-record' className='global-main'>
<div style={{ display: 'flex', justifyContent: 'space-between', padding: '0 10px' }}> <div style={{ display: 'flex', justifyContent: 'space-between', padding: '0 10px' }}>
<Form <Form
style={{ display: 'flex', }} style={{ display: 'flex', }}
@ -182,10 +182,15 @@ const PatrolRecord = (props) => {
return <span style={{ fontSize: 15 }}>{`${Math.ceil(total / query?.limit)}页,${total}`}</span> return <span style={{ fontSize: 15 }}>{`${Math.ceil(total / query?.limit)}页,${total}`}</span>
}, },
onChange: (page, pageSize) => { onChange: (page, pageSize) => {
setQuery({ limit: pageSize, page: page - 1 }); setQuery({ limit: pageSize, page: page - 1 });
record({ limit: pageSize, page: page - 1, ...search, companyId: search?.companyId }) record({ limit: pageSize, page: page - 1, ...search, companyId: search?.companyId })
} }
}} }}
rowClassName={(record, index) => {
let className = 'global-light-row';
if (index % 2 === 1) className = 'global-dark-row';
return className;
}}
/> />
<Modal <Modal
title='巡检记录详情' title='巡检记录详情'
@ -270,7 +275,7 @@ const PatrolRecord = (props) => {
) )
} }
function mapStateToProps (state) { function mapStateToProps(state) {
const { auth, global } = state; const { auth, global } = state;
return { return {
user: auth.user, user: auth.user,

5
web/client/src/sections/patrolManage/containers/patrolReport.js

@ -104,6 +104,11 @@ function patrolReport(props) {
}; };
}} }}
onReset={() => { setDate([moment().subtract(1, 'days'), moment()]) }} onReset={() => { setDate([moment().subtract(1, 'days'), moment()]) }}
rowClassName={(record, index) => {
let className = 'global-light-row';
if (index % 2 === 1) className = 'global-dark-row';
return className;
}}
/> />
</> </>
) )

5
web/client/src/sections/patrolManage/containers/patrolTemplate.js

@ -104,6 +104,11 @@ function PatrolTemplate(props) {
return { ...res }; return { ...res };
}} }}
onReset={() => { }} onReset={() => { }}
rowClassName={(record, index) => {
let className = 'global-light-row';
if (index % 2 === 1) className = 'global-dark-row';
return className;
}}
/> />
{ {
visible ? visible ?

Loading…
Cancel
Save