From c1e23e70a3ab643eae0014127e2d0e834f0cca90 Mon Sep 17 00:00:00 2001 From: LUCAS Date: Sat, 30 Jul 2022 14:38:16 +0800 Subject: [PATCH] =?UTF-8?q?=E6=A0=B7=E5=BC=8F=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../fillion/components/maintenanceTable.js | 15 +++++++++++---- .../sections/fillion/components/patrolTable.js | 15 ++++++++++++--- .../src/sections/fillion/components/protable.less | 3 ++- 3 files changed, 25 insertions(+), 8 deletions(-) diff --git a/web/client/src/sections/fillion/components/maintenanceTable.js b/web/client/src/sections/fillion/components/maintenanceTable.js index f70d234f..fd71bb1a 100644 --- a/web/client/src/sections/fillion/components/maintenanceTable.js +++ b/web/client/src/sections/fillion/components/maintenanceTable.js @@ -119,7 +119,7 @@ const DetailList = (props) => { } }, { - title: '缺陷名称', + title: '具体内容', key: 'content', dataIndex: 'content', align: 'center' @@ -191,7 +191,14 @@ const DetailList = (props) => { const PatrolNameList = (props) => { const [users, setUsers] = useState([]); const { onChange, record, userList, loading } = props; - const { name } = record || { name: '' } + const [selectRoad, setSelectRoad] = useState(); + + useEffect(() => { + if (userList && userList instanceof Array && userList.length) { + setSelectRoad(userList[0].id) + // onChange(userList[0]); + } + }, [userList]) const columns = [ { title: '巡更人员', @@ -230,7 +237,7 @@ const PatrolNameList = (props) => { loading={loading} rowKey="name" rowClassName={(record) => { - return record.patrolName === name ? styles['split-row-select-active'] : ''; + return record.id == selectRoad ? 'list-row-actived' : ''; }} toolBarRender={() => [ @@ -242,7 +249,7 @@ const PatrolNameList = (props) => { return { onClick: () => { if (record) { - console.log('record:', record) + setSelectRoad(record.id); onChange(record); } }, diff --git a/web/client/src/sections/fillion/components/patrolTable.js b/web/client/src/sections/fillion/components/patrolTable.js index be471922..2b1e796d 100644 --- a/web/client/src/sections/fillion/components/patrolTable.js +++ b/web/client/src/sections/fillion/components/patrolTable.js @@ -122,7 +122,7 @@ const DetailList = (props) => { } }, { - title: '缺陷名称', + title: '具体内容', key: 'content', dataIndex: 'content', align: 'center' @@ -194,7 +194,15 @@ const DetailList = (props) => { const PatrolNameList = (props) => { const [users, setUsers] = useState([]); const { onChange, record, userList, loading } = props; - const { name } = record || { name: '' } + const [selectRoad, setSelectRoad] = useState(); + + useEffect(() => { + if (userList && userList instanceof Array && userList.length) { + setSelectRoad(userList[0].id) + // onChange(userList[0]); + } + }, [userList]) + const columns = [ { title: '巡更人员', @@ -232,7 +240,7 @@ const PatrolNameList = (props) => { loading={loading} rowKey="name" rowClassName={(record) => { - return record.patrolName === name ? styles['split-row-select-active'] : ''; + return record.id == selectRoad ? 'list-row-actived' : ''; }} toolBarRender={() => [ @@ -245,6 +253,7 @@ const PatrolNameList = (props) => { onClick: () => { if (record) { // console.log('record:', record) + setSelectRoad(record.id); onChange(record); } }, diff --git a/web/client/src/sections/fillion/components/protable.less b/web/client/src/sections/fillion/components/protable.less index 6d66a5df..d8476511 100644 --- a/web/client/src/sections/fillion/components/protable.less +++ b/web/client/src/sections/fillion/components/protable.less @@ -10,8 +10,9 @@ } .list-row-actived { - background-color: #7cafc6; + background-color: #e2f6ff; font-weight: 600; + color: #1E80FF }