outaozhen 5 rokov pred
rodič
commit
4c88f2b04b

+ 9 - 12
src/pages/workbench/Dashboard/components/ReminderList/index.jsx

@@ -1,12 +1,11 @@
 import React, { useState, useEffect } from 'react'
-import { Modal } from 'antd'
 import consts from '@/consts'
 import { connect } from 'dva'
 import ProTable from '@ant-design/pro-table'
 import { queryReminderList } from '@/services/dashboard'
 
 const ReminderList = props => {
-  const { visible, onCancel, loading, dataId = '' } = props
+  const { visible, dataId = '' } = props
   const [state, setState] = useState({
     loading: false,
     client: []
@@ -64,16 +63,14 @@ const ReminderList = props => {
   ]
   return (
     <div>
-      <Modal visible={visible} confirmLoading={loading} onCancel={onCancel} width={800}>
-        <ProTable
-          rowKey={record => record.rank}
-          columns={columns}
-          // dataSource={}
-          search={false}
-          toolBarRender={false}
-          pagination={false}
-        />
-      </Modal>
+      <ProTable
+        rowKey={record => record.rank}
+        columns={columns}
+        // dataSource={}
+        search={false}
+        toolBarRender={false}
+        pagination={false}
+      />
     </div>
   )
 }

+ 8 - 15
src/pages/workbench/Dashboard/index.jsx

@@ -4,6 +4,7 @@ import { Row, Col, Divider, Select } from 'antd'
 import { AddressBook, City, Finance, Comment } from '@icon-park/react'
 import { DualAxes } from '@ant-design/charts'
 import consts from '@/consts'
+import { useModal } from '@/components/Modal'
 import { queryDashboard } from '@/services/dashboard'
 import ReminderList from './components/ReminderList'
 
@@ -21,23 +22,15 @@ const Dashboard = () => {
     char: [],
     thread: []
   })
-  const [reminderList, setReminderList] = useState({
-    type: '',
-    visible: false,
-    loading: false
-  })
+  const { toggleModal, setReminderList } = useModal()
   // 展示服务弹窗详情
-  const showModal = id => {
+  const handleReminderList = id => {
     setReminderList({
-      children: (
-        <ReminderList
-          dataId={id}
-          loading={reminderList.loading}
-          visible={reminderList.visible}
-          onCancel={() => setReminderList({ ...reminderList, visible: false })}
-        />
-      )
+      width: '60vw',
+      modalRender: node => <ReminderList dataId={id} node={node} />,
+      onCancel: () => toggleModal()
     })
+    toggleModal()
   }
   const initData = async payload => {
     const {
@@ -83,7 +76,7 @@ const Dashboard = () => {
       render: (name, record) => (
         // console.log(record)
         <span
-          onClick={() => showModal(record.day7)}
+          onClick={() => handleReminderList(record.day7)}
           className="text-primary cursor-pointer hover:text-[#967bbd]">
           {name}
         </span>