Luolei před 6 roky
rodič
revize
145044b6b9
8 změnil soubory, kde provedl 64 přidání a 25 odebrání
  1. 2 1
      package.json
  2. 26 2
      src/css/index.less
  3. 2 0
      src/css/popup.less
  4. 6 1
      src/index.js
  5. 9 10
      src/js/indexDom.js
  6. 1 1
      src/js/popup.js
  7. 3 5
      src/js/promise.js
  8. 15 5
      webpack.config.js

+ 2 - 1
package.json

@@ -4,6 +4,7 @@
   "description": "",
   "main": "index.js",
   "dependencies": {
+    "@babel/polyfill": "^7.4.4",
     "imports-loader": "^0.8.0",
     "jquery": "^1.12.4",
     "webpack": "^4.30.0",
@@ -26,7 +27,7 @@
     "test": "echo \"Error: no test specified\" && exit 1",
     "build": "webpack",
     "watch": "webpack --watch",
-    "dev": "webpack-dev-server --open --mode development",
+    "dev": "webpack-dev-server --open",
     "server": "node server.js"
   },
   "repository": {

+ 26 - 2
src/css/index.less

@@ -94,6 +94,9 @@
         line-height: 18px;
         border: 1px solid @grayColor;
       }
+      .medicineWaringDisMsg {
+        color: @grayColor;
+      }
     }
     p {
       line-height: 24px;
@@ -178,6 +181,20 @@
   .conditionHintTips{
     .mayIllness {
       padding-bottom: 5px;
+      span {
+        position: relative;
+        border-bottom: 1px solid @grayColor;
+        .infoMsg {
+          position: relative;
+          border-bottom: 0;
+          float: right;
+        }
+      }
+      span:hover {
+        .infoMsg {
+          display: inline-block;
+        }
+      }
       a {
         border-bottom: 1px solid @grayColor;
       }
@@ -221,7 +238,9 @@
   padding-bottom: 5px;
   margin-bottom: 5px;
 }
-
+.conditionHintZhiliaoNull {
+  display: none;
+}
 .conditionHintAssistLis,.conditionHintInspectLis {
   padding: 5px 0;
   .slideDown {
@@ -239,10 +258,15 @@
   overflow: hidden;
   position: relative;
 }
+.medicinePartLimitHeightSpec {
+  height: 75px;
+  overflow: hidden;
+  position: relative;
+}
 .slideDown {
   background-color: #fff;
   position: absolute;
-  top: 0px;
+  bottom: 0px;
   right: 0px;
   color: @colorBlue;
   height: 25px;

+ 2 - 0
src/css/popup.less

@@ -51,6 +51,7 @@
     .radioChecks {
       float: left;
       margin: 0 10px;
+      cursor: pointer;
       i {
         height: 28px;
         width: 28px;
@@ -120,6 +121,7 @@
       position: relative;
       padding-left: 98px;
       padding-right: 20px;
+      cursor: pointer;
       i {
         height: 28px;
         width: 28px;

+ 6 - 1
src/index.js

@@ -57,13 +57,18 @@ post(config.pushInner,msg).then((res)=>{
       bqtsFun(result.medicalIndications)
     }
     if(result.treat){
+      var num = 0;
       if(result.treat.commonTreatment && result.treat.commonTreatment.content){
+        ++num
         ybzlFun(result.treat.commonTreatment.content)//一般治疗
-        $(".conditionHintZhiliaoNull").css("display","none")
       }
       if(result.treat.treatment && result.treat.treatment.length>0){
+        ++num
         cyywFun(result.treat.treatment)//常用药物
       }
+      if(num == 0){
+        $(".conditionHintZhiliaoNull").css("display","block")
+      }
     }
     if(result.dis){
       var proB = result.dis['可能诊断'] || []//可能

Rozdílová data souboru nebyla zobrazena, protože soubor je příliš velký
+ 9 - 10
src/js/indexDom.js


+ 1 - 1
src/js/popup.js

@@ -21,7 +21,7 @@ $(".conditionHintTips").on('click',".sureScore",function(e){
     tmpVal && $(this).parents(".mayResultSelect").find(".makesureResult").html(tmpVal)
   }
   if($(this).attr("data-type") == 3){
-    var tempVal = $(this).parents(".mayResultSelect").find(".radioChecks[data-select='select']").html()
+    var tempVal = $(this).parents(".mayResultSelect").find(".radioChecks[data-select='select'] span").html()
     tempVal && $(this).parents(".mayResultSelect").find(".makesureResult").html(tempVal)
   }
   $(this).parents(".popupModal").css('display',"none")

+ 3 - 5
src/js/promise.js

@@ -1,14 +1,12 @@
 const qs = require('qs');
-
+import '@babel/polyfill'
 const config = {
-  pushInner:'/api/icss/push/pushInner',
-  calculate:'/api/icss/calc/calculate',
+  pushInner:'http://192.168.2.236:5050/api/icss/push/pushInner',
+  calculate:'http://192.168.2.236:5050/api/icss/calc/calculate',
 }
 const imageUrlPrefix = 'http://192.168.2.241:82';
 const getUrlArgObject = (parm) => {  
   var query = window.location.search;
-  // console.log(window.location)
-  // var query = '?'+url.split('?')[1];
   var args = qs.parse(query.substr(1));
   return args[parm];//返回对象  
 } 

+ 15 - 5
webpack.config.js

@@ -13,7 +13,7 @@ module.exports = {
     drugInfo: path.resolve(__dirname, 'src/js', 'drugInfo.js'),
     disclaimer: path.resolve(__dirname, 'src/js', 'disclaimer.js'),
     scale: path.resolve(__dirname, 'src/js', 'scale.js'),
-    vendor:'lodash' // 多个页面所需的公共库文件,防止重复打包带入
+    vendor:'lodash', // 多个页面所需的公共库文件,防止重复打包带入
   },
   output: {
     publicPath: '/', //这里要放的是静态资源CDN的地址
@@ -82,7 +82,7 @@ module.exports = {
       title: 'disclaimer',
       template: path.resolve(__dirname, 'src/html', 'disclaimer.html'),
       filename: 'disclaimer.html',
-      chunks: ['disclaimer', 'vendor','common'],
+      chunks: ['vendor','common','disclaimer'],
       inject: true,
       hash: true, //防止缓存
       minify: {
@@ -95,7 +95,7 @@ module.exports = {
       title: 'scale',
       template: path.resolve(__dirname, 'src/html', 'scale.html'),
       filename: 'scale.html',
-      chunks: ['scale', 'vendor','common'],
+      chunks: ['vendor','common','scale'],
       inject: true,
       hash: true, //防止缓存
       minify: {
@@ -135,6 +135,16 @@ module.exports = {
         test: /\.js$/,
         use: "imports-loader?$=jquery"
       },
+      {
+        test: /\.m?js$/,
+        exclude: /(node_modules|bower_components)/,
+        use: {
+          loader: 'babel-loader',
+          options: {
+            presets: ['@babel/preset-env']
+          }
+        }
+      },
       {
         test: /\.css$/,
         use: [{
@@ -158,14 +168,14 @@ module.exports = {
           loader: 'file-loader',
           options: {
             outputPath: 'images/', // 图片输出的路径和存储路径保持一致
-            limit: 100,
+            limit: 10000,
             name: '[name].[ext]'
           }
         }
       },
     ]
   },
-  devtool: 'cheap-module-eval-source-map', //开发环境cheap-module-eval-source-map   //生产环境cheap-module-source-map
+  // devtool: 'cheap-module-eval-source-map', //开发环境cheap-module-eval-source-map   //生产环境cheap-module-source-map
   devServer: {
     contentBase: path.join(__dirname, "dist"), //静态文件根目录
     proxy: {