|
@ -27,12 +27,14 @@ function PatrolTemplate (props) { |
|
|
title: '模板描述', |
|
|
title: '模板描述', |
|
|
dataIndex: 'describe', |
|
|
dataIndex: 'describe', |
|
|
key: 'describe', |
|
|
key: 'describe', |
|
|
ellipsis: true |
|
|
ellipsis: true, |
|
|
|
|
|
search: false, |
|
|
}, { |
|
|
}, { |
|
|
title: '操作人', |
|
|
title: '操作人', |
|
|
dataIndex: 'user.name', |
|
|
dataIndex: 'user.name', |
|
|
key: 'user.name', |
|
|
key: 'user.name', |
|
|
ellipsis: true, |
|
|
ellipsis: true, |
|
|
|
|
|
search: false, |
|
|
render: (t, r, i) => { |
|
|
render: (t, r, i) => { |
|
|
return r.user ? r.user.name : '-' |
|
|
return r.user ? r.user.name : '-' |
|
|
} |
|
|
} |
|
@ -41,6 +43,7 @@ function PatrolTemplate (props) { |
|
|
dataIndex: 'checkItems', |
|
|
dataIndex: 'checkItems', |
|
|
key: 'checkItems', |
|
|
key: 'checkItems', |
|
|
ellipsis: true, |
|
|
ellipsis: true, |
|
|
|
|
|
search: false, |
|
|
render: (_, r) => { |
|
|
render: (_, r) => { |
|
|
return r?.checkItems ? r?.checkItems.map(c => <Tag>{c.name}</Tag>) : '-' |
|
|
return r?.checkItems ? r?.checkItems.map(c => <Tag>{c.name}</Tag>) : '-' |
|
|
} |
|
|
} |
|
@ -81,14 +84,10 @@ function PatrolTemplate (props) { |
|
|
dataSource={dataSource || []} |
|
|
dataSource={dataSource || []} |
|
|
rowKey='id' |
|
|
rowKey='id' |
|
|
pagination={{ pageSize: 10 }} |
|
|
pagination={{ pageSize: 10 }} |
|
|
search={false} |
|
|
search={{ |
|
|
request={async (params = {}) => { |
|
|
defaultCollapsed: false, |
|
|
const res = await dispatch(getPatrolTemplate(params)); |
|
|
optionRender: (searchConfig, formProps, dom) => [ |
|
|
setDataSource(res?.payload.data?.rows); |
|
|
...dom.reverse(), |
|
|
return { ...res }; |
|
|
|
|
|
}} |
|
|
|
|
|
onReset={() => { }} |
|
|
|
|
|
toolBarRender={() => [ |
|
|
|
|
|
<Button |
|
|
<Button |
|
|
type="primary" |
|
|
type="primary" |
|
|
key="primary" |
|
|
key="primary" |
|
@ -96,8 +95,15 @@ function PatrolTemplate (props) { |
|
|
setType('create') |
|
|
setType('create') |
|
|
setVisible(true) |
|
|
setVisible(true) |
|
|
}} |
|
|
}} |
|
|
>新增巡检模板</Button> |
|
|
>新增巡检模板</Button>, |
|
|
]} |
|
|
], |
|
|
|
|
|
}} |
|
|
|
|
|
request={async (params = {}) => { |
|
|
|
|
|
const res = await dispatch(getPatrolTemplate(params)); |
|
|
|
|
|
setDataSource(res?.payload.data?.rows); |
|
|
|
|
|
return { ...res }; |
|
|
|
|
|
}} |
|
|
|
|
|
onReset={() => { }} |
|
|
/> |
|
|
/> |
|
|
{ |
|
|
{ |
|
|
visible ? |
|
|
visible ? |
|
|