浏览代码

bug修改

luolei 5 年之前
父节点
当前提交
571f5b01f8
共有 5 个文件被更改,包括 44 次插入17 次删除
  1. 11 1
      src/css/index.less
  2. 5 0
      src/css/login.less
  3. 1 1
      src/css/reset.less
  4. 15 7
      src/js/console.js
  5. 12 8
      src/js/index.js

+ 11 - 1
src/css/index.less

@@ -150,20 +150,30 @@
     height: 40px;
     line-height: 40px;
     border-radius: 3px;
-    margin-bottom: 15px;
+    margin-bottom: 30px;
     padding: 0 10px;
     box-sizing: border-box;
   }
+  p {position: relative;}
   p span {
     width: 90px;
     display: inline-block;
     text-align: right;
   }
+  .oldWaring {
+    color: #FF4D4F;
+    display: inline-block;
+    position: absolute;
+    left: 105px;
+    bottom: 6px;
+  }
   .waring {
     text-align: left;
     i {
       margin-left: 15px;
       color: #FF4D4F;
+      position: relative;
+      top: -22px;
     }
   }
 }

+ 5 - 0
src/css/login.less

@@ -95,6 +95,11 @@ body {
     width: 300px;
     height: 40px;
     line-height: 38px;
+    border-radius: 4px;
+    input {
+      display: inline-block;
+      width: 80%;
+    }
   }
 }
 

+ 1 - 1
src/css/reset.less

@@ -210,7 +210,7 @@ textarea {
     }
   }
   .content {
-    padding: 25px 15px;
+    padding: 25px 15px 0 15px;
     font-size: 14px;
     text-align: center;
   }

+ 15 - 7
src/js/console.js

@@ -50,7 +50,12 @@ function initConsole(result){
         '本月不合格病历-机器':require("../images/icon7.png"),
         '本月质控数-机器':require("../images/icon10.png"),
         '本月甲级病历-机器':require("../images/icon8.png"),
-        '本月乙级病历-机器':require("../images/icon9.png")
+        '本月乙级病历-机器':require("../images/icon9.png"),
+        '本年病历数':require("../images/icon6.png"),
+        '本年不合格病历-机器':require("../images/icon7.png"),
+        '本年质控数-机器':require("../images/icon10.png"),
+        '本年甲级病历-机器':require("../images/icon8.png"),
+        '本年乙级病历-机器':require("../images/icon9.png"),
     }
     let dom = ''
     for(let i in result){
@@ -121,6 +126,7 @@ function getBarData(type){
 //柱状图住院费用
 function barChartPay(dataX,dataY){
     var myCharts = echarts.init(document.getElementById('barChartPay'));
+    var lengthNum = dataX.length;
     $(window).resize(function(){
         myCharts.resize()
     });
@@ -148,7 +154,8 @@ function barChartPay(dataX,dataY){
                 axisLabel: {//x轴刻度
                     textStyle: {
                         color: '#333'
-                    }
+                    },
+                    rotate:lengthNum>8?30:0
                 },
                 axisLine: {//x轴
                     lineStyle:{
@@ -193,7 +200,7 @@ function barChartPay(dataX,dataY){
             {
                 name: '平均住院费用',
                 type: 'bar',
-                barWidth: '6%',
+                barWidth: lengthNum<5?'8%':'23%',
                 data: dataY
             }
         ]
@@ -203,6 +210,7 @@ function barChartPay(dataX,dataY){
 //柱状图住院日期
 function barChart(dataX,dataY){
     var myChart = echarts.init(document.getElementById('barChart'));
+    var lengthNum = dataX.length;
     $(window).resize(function(){
         myChart.resize()
     });
@@ -230,7 +238,8 @@ function barChart(dataX,dataY){
                 axisLabel: {//x轴刻度
                     textStyle: {
                         color: '#333'
-                    }
+                    },
+                    rotate:lengthNum>8?30:0
                 },
                 axisLine: {//x轴
                     lineStyle:{
@@ -275,7 +284,7 @@ function barChart(dataX,dataY){
             {
                 name: '平均住院日',
                 type: 'bar',
-                barWidth: '6%',
+                barWidth:  lengthNum<5?'8%':'23%',
                 data: dataY
             }
         ]
@@ -285,7 +294,6 @@ function barChart(dataX,dataY){
 }
 //空心饼图
 function emptyCircle(data){
-    if(!data||data.length == 0)return
     var myChart = echarts.init(document.getElementById('emptyCircle'));
     $(window).resize(function(){
         myChart.resize()
@@ -302,7 +310,7 @@ function emptyCircle(data){
         backgroundColor: bgColor,
         color: color,
         title: [{
-            text: '{val|' + total + '}\n{name|' + title + '}',
+            text: data.length>0?'{val|' + total + '}\n{name|' + title + '}':'',
             top: 'center',
             left: 'center',
             textStyle: {

+ 12 - 8
src/js/index.js

@@ -12,6 +12,9 @@ $(function(){
   $(".main").css({
     height:$(window).height()-70+'px'
   })
+  $("body").on('focus',".modalAction input",function(){
+    $(this).attr("type","password")
+  })
 });
 
 function initMenu(data,userInfo){
@@ -20,6 +23,7 @@ function initMenu(data,userInfo){
   //用户数据填充
   $("#userName").text(userInfo.linkman);
   //菜单收起展开
+  $(".menu .page").eq(0).addClass("active")
   $(".list-1").on("click",function(){
     $(".list-1 .slide-up").removeClass('slide-up');
     $(this).toggleClass('slide-up');
@@ -53,19 +57,19 @@ function sureChangeWord(){
     let newword = $(".newword").val().trim()
     let sureword = $(".sureword").val().trim()
     if(!oldword){
-      $(".modalAction .waring").css('display','block').find("i").html('请输入原密码')
+      $(".modalAction .waring i").html('请输入原密码')
       return
     }else if(!newword){
-      $(".modalAction .waring").css('display','block').find("i").html('请输入新密码')
+      $(".modalAction .waring i").html('请输入新密码')
       return
     }else if(!sureword){
-      $(".modalAction .waring").css('display','block').find("i").html('请确认新密码')
+      $(".modalAction .waring i").html('请确认新密码')
       return
-    }
-    if(newword != sureword){
-      $(".modalAction .waring").css('display','block').find("i").html('两次密码不一致')
+    }else if(newword != sureword){
+      $(".modalAction .waring i").html('两次密码不一致')
       return
     }
+    $(".modalAction .waring i").html('')
     changeWord(oldword,newword)
   })
 }
@@ -78,7 +82,7 @@ function changeWord(oldword,newword){
     if(data.code==='0'){
       window.location.href = './login.html'
     }else{
-      $(".modalAction .waring").css('display','block').find("i").html(data.msg)
+      $(".oldWaring").html(data.msg)
       return
     }
   });
@@ -98,7 +102,7 @@ $(".container").on('click','#changeWord',function(){
     sureText:'保存',
     message:`
     <div class="modalAction">
-      <p><span>原密码:</span><input type="text" placeholder="请输入原密码" class="oldword" autocomplete="off"></p>
+      <p><span>原密码:</span><input type="text" placeholder="请输入原密码" class="oldword" autocomplete="off"><i class="oldWaring"></i></p>
       <p><span>新密码:</span><input type="text" placeholder="请输入新密码" class="newword" autocomplete="off"></p>
       <p><span>确认新密码:</span><input type="text" placeholder="请输入新密码" class="sureword" autocomplete="off"></p>
       <p class="waring"><span></span><i></i></p>