Browse Source

接口联调

liudan 1 week ago
parent
commit
76109d77c9

+ 16 - 14
src/assets/scss/style.scss

@@ -31,7 +31,7 @@ body {
 }
 .page-body {
   margin: 0;
-  padding: 0.8rem 1rem;
+  padding: 0.6rem;
 
   font-family: PingFang SC;
   display: flex;
@@ -45,18 +45,15 @@ body {
 
   .header {
     position: relative;
-    margin-bottom: 0.6rem;
     .logo {
       width: 10.2rem;
     }
     .room-name {
       position: absolute;
-      top: -1rem;
+      top: -.5rem;
       left: 50%;
       transform: translate(-50%, 0);
-      background: #21469b;
       border-radius: 0 0 0.5rem 0.5rem;
-      border: 0.14rem solid #cce774;
       box-sizing: border-box;
       display: inline-block;
       padding: 0.8rem 2rem;
@@ -86,7 +83,7 @@ body {
   }
   .section {
     background: #f8f8f8;
-    padding: 0.8rem;
+    padding: 0.6rem;
     border-radius: 0.5rem;
     box-sizing: border-box;
     &.section-inner {
@@ -127,7 +124,7 @@ body {
   }
   .table {
     flex: 1;
-    margin-top: 0.8rem;
+    margin-top: 0.5rem;
     overflow: hidden;
     &.section {
       padding-top: 0.3rem;
@@ -138,13 +135,13 @@ body {
       background: #21469b;
       border-radius: 0.5rem;
       border: 0.14rem solid #21469b;
-      padding: 0 1rem;
+      padding: 0 0.8rem;
       font-size: 1.4rem;
       white-space: nowrap;
       overflow: hidden;
       text-overflow: ellipsis;
-      height: 4rem;
-      line-height: 3.8rem;
+      height: 3.8rem;
+      line-height: 3.5rem;
       text-align: center;
       color: #fff;
       margin-top: 0.5rem;
@@ -154,6 +151,15 @@ body {
       border-color: #f0f0f0;
       color: #333;
       font-size: 1.5rem;
+      &.docname{
+        background: #21469b;
+        border-radius: 0.5rem;
+        border: 0.14rem solid #21469b;
+        color: #fff;
+      }
+      &.patname{
+        color: red;
+      }
       &.patOpeName {
         color: #f39a06;
         padding: 0 0.4rem;
@@ -189,8 +195,6 @@ body {
   }
   .header {
     .room-name {
-      background-color: rgba(111, 186, 44, 0.3);
-      border: none;
       color: #333;
     }
     .heaer-btn {
@@ -223,8 +227,6 @@ body {
   }
   .header {
     .room-name {
-      background: #21469b;
-      border-color: #21469b;
       color: #fff;
     }
     .heaer-btn {

+ 17 - 13
src/pages/bigScreen/Index.jsx

@@ -26,7 +26,7 @@ class BigScreen extends React.Component {
   }
   componentDidMount() {
     this.initDate();
-    document.querySelector('html').style.fontSize = '20px';
+    document.querySelector('html').style.fontSize = '16px';
     this.initScroll();
   }
   componentDidUpdate(prev) {
@@ -90,6 +90,7 @@ class BigScreen extends React.Component {
   render() {
     const { dateStr } = this.state;
     const { userData } = this.props;
+    const hasRe = this.state.patList?.filter(v => v.callMsg?.reWaitPat && v.callMsg?.reWaitPat.length > 0).length > 0;
     return (
       <div className='page-body big'>
         <div className='header'>
@@ -108,38 +109,41 @@ class BigScreen extends React.Component {
           </span>
         </div>
         <div className='table section' id="patWrap">
-          <Grid columns={5} gap={8}>
-            <Grid.Item span={1}>
-              <div className='table-header'>{ userData.locDesc === '验光配镜分诊区' ? '验光室':'诊室' }</div>
-            </Grid.Item >
+          <Grid columns={hasRe ? 5 : 4} gap={8}>
             <Grid.Item span={1}>
+              {/* <div className='table-header'>{userData.locDesc === '验光配镜分诊区' ? '验光室' : '诊室'}</div> */}
               <div className='table-header'>{ userData.locDesc === '验光配镜分诊区' ? '验光师':'医生' }</div>
             </Grid.Item >
             <Grid.Item span={1}>
-              <div className='table-header'>当前就诊</div>
+              <div className='table-header'>正在就诊</div>
             </Grid.Item >
              <Grid.Item span={2}>
               <div className='table-header'>准备就诊</div>
             </Grid.Item >
+             {hasRe &&  <Grid.Item span={1}>
+              <div className='table-header'>看报告</div>
+            </Grid.Item > }
           </Grid>
           {this.state.patList.map((item,index) => {
             return (<Grid columns={5} gap={8} key={index}>
               <Grid.Item span={1}>
-                <div className='table-content'>{item.roomDesc}</div>
-              </Grid.Item >
-              <Grid.Item span={1}>
-                <div className='table-content'>{item.docName || '-'}</div>
+                <div className='table-content docname'>{item.roomDesc}-{item.docName || '-'}</div>
               </Grid.Item >
               <Grid.Item span={1}>
-                <div className='table-content'>
-                  {item?.callMsg?.callPat?.map(v => v.patName).join((','))}
+                <div className='table-content patname'>
+                  {item?.callMsg?.callPat?.map(v => v.patName + ' ' + v.patCallNo).join((','))}
                 </div>
               </Grid.Item >
               <Grid.Item span={2}>
                 <div className='table-content'>
-                  {item?.callMsg?.waitPat?.map(v => v.patName).join((','))}
+                  {item?.callMsg?.waitPat?.map(v => v.patName + ' ' + v.patCallNo).join((','))}
                 </div>
               </Grid.Item >
+              { hasRe && <Grid.Item span={1}>
+                <div className='table-content'>
+                  {item?.callMsg?.reWaitPat?.map(v => v.patName + ' ' + v.patCallNo).join((','))}
+                </div>
+              </Grid.Item >}
             </Grid>);
           })}
         </div>

+ 97 - 30
src/pages/doctorScreen/Index.jsx

@@ -3,6 +3,7 @@ import logo from '@assets/images/logo.png';
 import userImage from '@assets/images/userImage.png';
 import { Grid } from 'antd-mobile';
 import QRCode from 'qrcode';
+import { preload } from 'react-dom';
 
 /**
  * @刘丹: 医生诊室叫号
@@ -11,17 +12,68 @@ class DoctorScreen extends React.Component {
   constructor() {
     super();
     this.state = {
-
+      pageSize: 5,
+      patList: [],
     };
   }
   componentDidMount() {
-    this.getQrcSrc('https://www.kimi.com/');
+    //this.getQrcSrc('https://www.kimi.com/');
+    this.initScroll();
   }
   componentDidUpdate(prev) {
     if (prev?.userData?.userQrCode != this.props.userData?.userQrCode) {
       this.getQrcSrc(this.props.userData?.userQrCode);
     }
+    if (prev.patList != this.props.patList) {
+      this.setPatList();
+    }
   }
+  // 初始化滚动
+  initScroll = () => {
+    const parentDom = document.getElementById('patWrapDoc');
+    const childDom = document.getElementById('nextDom');
+    const style = window.getComputedStyle(parentDom);
+    const parentH = parentDom.offsetHeight - parseInt(style.paddingTop) - parseInt(style.paddingBottom);
+    const childH = childDom.children[0].offsetHeight;
+    const pageSize = Math.floor(parentH / childH) - 1;
+    this.setState({
+      pageSize,
+    });
+  };
+  // 滚动设置就诊数据
+  setPatList = () => {
+    if (this.state.timer) {
+      clearTimeout(this.state.timer);
+    }
+    this.setState({
+      current: 0,
+      totalPage: Math.ceil(this.props.patList?.length / this.state.pageSize),
+    }, () => {
+      if (this.props.patList?.length <= this.state.pageSize) {
+        this.setState({
+          patList: this.props.patList,
+        });
+      } else {
+        const fn = () => {
+          let current = this.state.current + 1;
+          if (current > this.state.totalPage) {
+            current = 1;
+          }
+          const { pageSize } = this.state;
+          this.setState({
+            current,
+            patList: this.props.patList?.slice((current - 1) * pageSize, current * pageSize),
+          });
+          // 10s切换
+          const timer = setTimeout(fn, 6000);
+          this.setState({
+            timer,
+          });
+        };
+        fn();
+      }
+    });
+  };
   // 链接转二维码链接
   getQrcSrc = (src) => {
     if (!src) {
@@ -32,7 +84,7 @@ class DoctorScreen extends React.Component {
     });
   };
   render() {
-    const { userData = {}, patList = [] } = this.props;
+    const { userData = {}, reWaitPat = [] } = this.props;
     return (
       <div className='page-body big-scrren'>
         <div className='header'>
@@ -100,36 +152,51 @@ class DoctorScreen extends React.Component {
             </Grid.Item>
           </Grid>
         </div>
-         <div className='table section'>
-          <Grid  columns={12} gap={8}>
-            <Grid.Item span={4}>
-              <div className='table-header'>姓名</div>
-            </Grid.Item>
-            <Grid.Item span={4}>
-              <div className='table-header'>就诊号</div>
-            </Grid.Item>
-             <Grid.Item span={4}>
-              <div className='table-header'>状态</div>
+        <div style={{flex: 1, overflow: 'hidden'}} id="patWrapDoc">
+          <Grid columns={reWaitPat?.length > 0 ? 3 : 2} gap={8}>
+            <Grid.Item span={2}>
+              <div className='table section' id="nextDom">
+                <Grid  columns={1} gap={8}>
+                  <Grid.Item span={1}>
+                    <div className='table-header'>候诊</div>
+                  </Grid.Item>
+                </Grid>
+                {this.state.patList?.map((item,index) => {
+                  return (<Grid  columns={2} gap={8} key={index}>
+                    <Grid.Item span={1}>
+                      <div className='table-content'>{item.patName || '***'} { item.patCallNo }</div>
+                    </Grid.Item>
+                    <Grid.Item span={1}>
+                      <div className={item.status == 'waiting' ? 'table-content waiting'  :'table-content sussess'}>
+                        {item.status == 'waiting'
+                          ? '候诊'
+                          : '正在就诊'
+                        }
+                      </div>
+                    </Grid.Item>
+                  </Grid>);
+                })}
+              </div>
             </Grid.Item>
+            {reWaitPat?.length > 0 && <Grid.Item span={1}>
+              <div className='table section'>
+                <Grid columns={1} gap={8}>
+                  <Grid.Item span={1}>
+                    <div className='table-header'>看报告</div>
+                  </Grid.Item>
+                </Grid>
+                {reWaitPat.map((item, index) => {
+                  return (<Grid columns={1} gap={8} key={index}>
+                    <Grid.Item span={1}>
+                      <div className='table-content'>{item.patName || '***'} {item.patCallNo}</div>
+                    </Grid.Item>
+                  </Grid>);
+                })}
+              </div>
+            </Grid.Item>}
           </Grid>
-          {patList.map((item,index) => {
-            return (<Grid  columns={12} gap={8} key={index}>
-              <Grid.Item span={4}>
-                <div className='table-content'>{item.patName || '***'}</div>
-              </Grid.Item>
-              <Grid.Item span={4}>
-                <div className='table-content'>{item.patCallNo || '***'}</div>
-              </Grid.Item>
-              <Grid.Item span={4}>
-                {item.status == 'waiting'
-                  ? <div className='table-content waiting'>准备就诊</div>
-                  : <div className='table-content sussess'>就诊中</div>
-                }
-              </Grid.Item>
-            </Grid>);
-          })}
         </div>
-        <div className='footer'>请依据队列显示信息,依次排队就诊</div>
+        <div className='footer'>请按显示信息排队就诊,看报告请到报道机或护士站报到!</div>
       </div>
     );
   }

+ 4 - 1
src/pages/home/Index.jsx

@@ -22,6 +22,7 @@ class Home extends React.Component {
       patList: [], // 就诊等待数据
       waitPat: [],
       patListArea: [], //区域等待就诊患者数据
+      reWaitPat: [], // 复诊的患者
       roomObj: {},
       delayPat: [], //候诊数据
       showType: 'doctor', // doctor医生诊室 area诊区叫号 operate手术室
@@ -129,6 +130,7 @@ class Home extends React.Component {
           },
           patList,
           waitPat: data.callMsg.waitPat,
+          reWaitPat: data.callMsg.reWaitPat,
           patListArea: newArray,
           roomObj,
           delayPat: data.delayPat,
@@ -201,6 +203,7 @@ class Home extends React.Component {
           ? <DoctorScreen
               userData={this.state.userData}
               patList={this.state.patList}
+              reWaitPat={this.state.reWaitPat}
               hosLogo={this.state.hosLogo}
             />
           : this.state.showType == 'operate'
@@ -218,7 +221,7 @@ class Home extends React.Component {
         }
       </div>
       <span
-        style={{ position: 'fixed', right: 0, bottom: 0, padding: '1rem' }}
+        style={{ position: 'fixed', right: 0, bottom: 0, padding: '0.4rem' }}
       >
         <AntOutline
           style={{color: this.state.colorName == 'dark-bg' ? '#fff' : '#0D2764', marginLeft: '10px'}}

+ 1 - 1
src/pages/operateScreen/Index.jsx

@@ -18,7 +18,7 @@ class OperateScreen extends React.Component {
   }
   componentDidMount() {
     this.initDate();
-    document.querySelector('html').style.fontSize = '20px';
+    document.querySelector('html').style.fontSize = '16px';
     this.initScroll();
   }
   componentDidUpdate(prev) {