Browse Source

修改 温度颜色的显示

zhaojijng 2 years ago
parent
commit
e55337aa5d

+ 6 - 0
src/pages/Environment/index.less

@@ -14,8 +14,14 @@
   .right {
     display: flex;
     float: right;
+    .tdbIndicator {
+      .text {
+        text-indent: -12px;
+      }
+    }
     .indicatorBox {
       .text {
+        height: 20px;
         padding-bottom: 7px;
         color: #4d5262;
         font-size: 11px;

+ 21 - 11
src/pages/Environment/index.tsx

@@ -28,7 +28,7 @@ export type navigatorItem = {
   unit?: string;
   num?: number;
   color: string;
-  colorStr: string;
+  colorStr: any;
   opacity?: number;
   indicator?: number[];
   [key: string]: any;
@@ -49,9 +49,9 @@ const Environment: React.FC = () => {
       src: envir_temperature,
       unit: '℃',
       color: '#E5574F',
-      colorStr: '229,87,79,',
-      opacity: 0.2, //透明度基数
-      indicator: [18, 21, 24, 27, 30],
+      colorStr: ['#5E8BCF', '#C9E5FF', '#F3F3F3', '#FFB6A7', '#EE6D66'],
+      opacity: 1, //透明度基数
+      indicator: [0, 18, 22, 26, 30],
       fixed: 1,
     },
     {
@@ -293,13 +293,21 @@ const Environment: React.FC = () => {
         <div className={styles.right}>
           {(selNav.indicator || []).map((item, index) => {
             return (
-              <div className={styles.indicatorBox} key={index + 'indicator'}>
-                <div className={styles.text}>{item}</div>
+              <div
+                className={cx(styles.indicatorBox, { [styles.tdbIndicator]: selNav.id == 'Tdb' })}
+                key={index + 'indicator'}
+              >
+                <div className={styles.text}>{item == 0 ? '' : item}</div>
                 <div
                   className={styles.color}
                   style={{
                     backgroundColor:
-                      'rgba(' + selNav.colorStr + (selNav.opacity as number) * (index + 1) + ')',
+                      selNav.id == 'Tdb'
+                        ? selNav.colorStr[index]
+                        : 'rgba(' +
+                          selNav.colorStr +
+                          (selNav.opacity as number) * (index + 1) +
+                          ')',
                   }}
                 ></div>
               </div>
@@ -336,10 +344,12 @@ const Environment: React.FC = () => {
                   style={{
                     background: item.roomFuncType
                       ? item.avgValues || item.avgValues == 0
-                        ? 'rgba(' +
-                          selNav.colorStr +
-                          (selNav.opacity as number) * getColorOpacity(item.avgValues) +
-                          ')'
+                        ? selNav.id == 'Tdb'
+                          ? selNav.colorStr[getColorOpacity(item.avgValues) - 1]
+                          : 'rgba(' +
+                            selNav.colorStr +
+                            (selNav.opacity as number) * getColorOpacity(item.avgValues) +
+                            ')'
                         : ''
                       : '',
                   }}

+ 9 - 2
src/pages/Equipment/components/topNavRight/index.tsx

@@ -154,14 +154,21 @@ const TopNavRight: React.FC<topNavRightProps> = ({
         <div className={styles.right}>
           {selNavObj.id !== 'curtain' && <div className={styles.title}>运行中的设备</div>}
           {selNavObj.id !== 'curtain' && <div className={styles.onlyNum}>{selNavObj.num}</div>}
-          <div className={styles.closeButton} onClick={allCloseClick}>
+          <div
+            className={styles.closeButton}
+            onClick={allCloseClick}
+            style={{ display: selNavObj.id == 'curtain' ? 'none' : '' }}
+          >
             {/* <Button type="primary"  size={'large'}  icon={<Icon type="closeall"  style={{color:'red',fontSize:20}} />} style={{'background':'rgba(196, 196, 196, 0.2)',border:'none'}} >
               全部关闭
             </Button> */}
             <Icon className="" type="closeall" style={{ fontSize: 20 }} />
             <span className={styles.text}>全部关闭</span>
           </div>
-          <div className={styles.moreWrap}>
+          <div
+            className={styles.moreWrap}
+            style={{ display: selNavObj.id == 'curtain' ? 'none' : '' }}
+          >
             {/* ...下拉菜单 */}
             <Dropdown
               trigger="click"

+ 4 - 2
src/sagacare_components/topNavigator/index.less

@@ -58,9 +58,9 @@
     white-space: nowrap;
     .firstLine {
       display: flex;
+      align-items: center;
       height: 28px;
-      font-weight: 500;
-      line-height: 28px;
+      font-weight: 600;
       sup {
         top: 0;
         line-height: 1;
@@ -73,12 +73,14 @@
       .level {
         color: #4d5262;
         font-size: 14px;
+        font-family: PingFang SC;
       }
     }
     .value {
       margin-right: 2px;
       // color: #e5574f;
       font-size: 28px;
+      font-family: Montserrat;
     }
     .unit {
       // color: #e5574f;

+ 2 - 6
src/services/sagacare_service/equipment.js

@@ -11,12 +11,8 @@ function getProjectId() {
 function commonParams() {
     var userObj = UserStorage.getInstance();
      const user = userObj.getUser();
-     var pubname='';
-     if(getProjectId()=='Pj3301100002'){
-        pubname='sgadmin'
-     }else{
-        pubname='sagacareAndtenantslink'
-     }
+     var pubname='sgadmin';
+    
     return `openid=${user.id}&pubname=${pubname}&projectId=${getProjectId()}&userId=${user.id}&userName=${user.name}`;
 }