Prechádzať zdrojové kódy

Merge branch 'test' of http://192.168.2.236:10080/zhouna/icssDService into test

Luolei 6 rokov pred
rodič
commit
3e00fb08af

+ 27 - 0
src/html/disclaimer.html

@@ -0,0 +1,27 @@
+<!DOCTYPE html>
+<html>
+<head>
+    <meta charset="UTF-8">
+    <meta name="viewport" content="width=device-width, initial-scale=1.0">
+    <meta http-equiv="X-UA-Compatible" content="ie=edge">
+    <title><%= htmlWebpackPlugin.options.title %></title>
+    <style>
+        h1 {
+            text-align: center;
+        }
+        .content {
+            width: 60%;
+            margin: 0 auto;
+        }
+    </style>
+</head>
+<body>
+    <div class="container">
+        <h1></h1>
+        <div class="content">
+            
+        </div>
+    </div>
+</body>
+</html>
+

+ 139 - 0
src/html/drugInfo.html

@@ -0,0 +1,139 @@
+<!DOCTYPE html>
+<html>
+<head>
+    <meta charset="utf-8">
+    <title>诊断指南</title>
+    <style>
+        *{
+            margin: 0;
+            padding: 0;
+        }
+        ul,li{
+            list-style: none;
+        }
+        table{
+            border-collapse: collapse;
+            border-spacing: 0;
+        }
+        body{
+            font-size: 12px;
+            overflow-y: scroll;
+            font-family: '微软雅黑', '宋体';
+            background: #dde2ea;
+            height: 100%;
+            color: #33475f;
+        }
+        h1{
+            margin-bottom: 50px;
+        }
+        h2{
+            font-size: 18px;
+            position: absolute;
+            top: -12px;
+            background: #fff;
+            padding-right: 6px;
+        }
+        .content{
+            position: relative;
+            height: 550px;
+        }
+        .infos{
+
+            height: 100%;
+            overflow-y: auto;
+            overflow-x: hidden;
+        }
+        .infos>div{
+            margin-left: 210px;
+        }
+        .title{
+            position: relative;
+            height:24px;
+            margin: 34px 0 10px;
+        }
+        .line{
+            border-bottom: 1px dashed #ccc;
+        }
+        .container{
+            width: 76%;
+            overflow: hidden;
+            background: #fff;
+            margin: 0 auto;
+            padding: 30px 24px;
+        }
+        .anchors{
+            width: 160px;
+            position: absolute;
+            right: 15px;
+            top: 0;
+            margin-right: 14px;
+            overflow: auto;
+        }
+        .anchors ul{
+            padding: 15px 18px;
+            border-radius: 4px;
+            border: 1px solid #eee;
+            background-color: #eee;
+        }
+        .anchors li{
+            position: relative;
+            height: 20px;
+        }
+        .anchors .anchor-line{
+            height: 15px;
+            width: 0;
+            border: 1px solid #ccc;
+            background-color: #ccc;
+            margin-left: 4px;
+        }
+        .anchors .anchor-line:last-child{
+            display: none;
+        }
+        .anchors i{
+            display: inline-block;
+            width: 8px;
+            height: 8px;
+            border-radius: 5px;
+            border: 1px solid #ccc;
+            margin-top: 5px;
+            background-color: #eee;
+            margin-right: 10px;
+        }
+        .anchors a{
+            position: absolute;
+            top: 0;
+            left: 0;
+            width: calc(100% - 20px);
+            padding-left: 20px;
+            text-decoration: none;
+            font-size: 13px;
+            font-weight: 400;
+            color: #000;
+            word-wrap: break-word;
+        }
+        .anchors .active a{
+            color: #0089be!important;
+            font-weight: 700!important;
+        }
+        .anchors .active i{
+            background: #0089be;
+        }
+        a:visited{
+            color:#33475f
+        }
+    </style>
+</head>
+<body>
+<div class="container">
+    <h1></h1>
+    <div class="content">
+        <div class="infos"></div>
+        <div class="anchors">
+            <ul></ul>
+        </div>
+    </div>
+</div>
+<!-- <script src="./js/jquery-1.9.1.min.js"></script>
+<script src="./js/information.js"></script> -->
+</body>
+</html>

+ 142 - 0
src/html/information.html

@@ -0,0 +1,142 @@
+<!DOCTYPE html>
+<html>
+<head>
+    <meta charset="utf-8">
+    <title>诊断指南</title>
+    <style>
+        *{
+            margin: 0;
+            padding: 0;
+        }
+        ul,li{
+            list-style: none;
+        }
+        table{
+            border-collapse: collapse;
+            border-spacing: 0;
+        }
+        body{
+            font-size: 14px;
+            overflow-y: scroll;
+            font-family: '微软雅黑', '宋体';
+            background: #dde2ea;
+            height: 100%;
+            color: #505050;
+            line-height: 28px;
+        }
+        h1{
+            margin: 0 77px 0px 210px;
+            font-size: 32px;
+        }
+        h2{
+            font-size: 22px;
+            position: absolute;
+            top: -12px;
+            background: #fff;
+            padding-right: 6px;
+        }
+        .content{
+            position: relative;
+            height: 550px;
+        }
+        .infos{
+            height: 100%;
+            overflow-y: auto;
+            overflow-x: hidden;
+            padding: 0 60px 0 0;
+        }
+        .infos>div{
+            margin-left: 210px;
+        }
+        .title{
+            position: relative;
+            height:24px;
+            margin: 30px 0 13px;
+        }
+        .line{
+            border-bottom: 1px dashed #ccc;
+        }
+        .container{
+            width: 76%;
+            overflow: hidden;
+            background: #fff;
+            margin: 0 auto;
+            padding: 30px 0 30px 24px;
+        }
+        .anchors{
+            width: 160px;
+            position: absolute;
+            left: 15px;
+            top: 0;
+            margin-right: 14px;
+            overflow: auto;
+        }
+        .anchors ul{
+            padding: 15px 18px;
+            border-radius: 4px;
+            border: 1px solid #eee;
+            background-color: #eee;
+        }
+        .anchors li{
+            position: relative;
+            /* height: 20px; */
+            line-height: 19px;
+        }
+        .anchors .anchor-line{
+            height: 15px;
+            width: 0;
+            border: 1px solid #ccc;
+            background-color: #ccc;
+            margin-left: 4px;
+        }
+        .anchors .anchor-line:last-child{
+            display: none;
+        }
+        .anchors i{
+            display: inline-block;
+            width: 8px;
+            height: 8px;
+            border-radius: 5px;
+            border: 1px solid #ccc;
+            margin-top: 5px;
+            background-color: #eee;
+            margin-right: 10px;
+        }
+        .anchors a{
+            position: absolute;
+            top: 0;
+            left: 0;
+            width: calc(100% - 20px);
+            padding-left: 20px;
+            text-decoration: none;
+            font-size: 13px;
+            font-weight: 400;
+            color: #000;
+            word-wrap: break-word;
+        }
+        .anchors .active a{
+            color: #267FD7!important;
+            font-weight: 700!important;
+        }
+        .anchors .active i{
+            background: #267FD7;
+        }
+        a:visited{
+            color:#000
+        }
+    </style>
+</head>
+<body>
+<div class="container">
+    <h1></h1>
+    <div class="content">
+        <div class="infos"></div>
+        <div class="anchors">
+            <ul></ul>
+        </div>
+    </div>
+</div>
+<!-- <script src="./js/jquery-1.9.1.min.js"></script>
+<script src="./js/information.js"></script> -->
+</body>
+</html>

+ 24 - 0
src/js/disclaimer.js

@@ -0,0 +1,24 @@
+(function(){
+    getDisclaimer();
+    console.log(11111111111)
+    function getDisclaimer() {
+        var url ='http://192.168.2.236:5050/api/icss/disclaimerInformation/getDisclaimerInformations';
+        $.ajax({
+            type: 'post',
+            url: url,
+            data: '',
+            headers: {
+                // 'Accept': 'application/json, text/plain, */*',
+                'Content-Type':'application/json; charset=utf-8'
+            },
+            success: function(res) {
+                console.log('res', res)
+                $("h1").html(res.data[2].title);
+                $(".content").html(res.data[2].description);
+            },
+            error: function(error) {
+                console.log('err')
+            }
+        })
+    }
+})()

+ 119 - 0
src/js/drugInfo.js

@@ -0,0 +1,119 @@
+// import { imageUrlPrefix } from '@utils/config.js';
+(function(){
+    getInfomation();
+    function getInfomation(){
+        // var infoUrl ="http://" + window.location.host+'/icss-web/kl/introduce/get_by_itemidAndType';
+        // var infoUrl ="http://" + window.location.host+'/api/icss/introduceInfo/getByQuestionId';
+        var infoUrl ='http://192.168.2.236:5050/api/icss/introduceInfo/getByQuestionId'
+        var imageUrlPrefix = 'http://192.168.2.241:82'
+        var urlParam = parseUrlParams();
+        console.log(urlParam)
+        var param = {
+            // "type": urlParam.type,
+            // "questionId": urlParam.questionId,
+            "type": 8,
+            "questionId": 145,
+            "position": 5
+        };
+        $.ajax({
+            type: 'POST',
+            url: infoUrl,
+            data: JSON.stringify(param),
+            headers: {
+                // 'Accept': 'application/json, text/plain, */*',
+                'Content-Type':'application/json; charset=utf-8'
+            },
+            success: function(res) {
+                   console.log(res) 
+                   var str='',anchors='',item='';
+                if(!res.data){
+                    $("h1").html("暂时没有数据");
+                    return;
+                }
+                var list  = res.data.introduceDetailList;
+                $("h1").html(res.data.tagName);
+                //list.map((item,i) =>{
+                for(var i=0;i<list.length;i++) {
+                    item = list[i];
+                    item.content = item.content.replace(/{imageUrlPrefix}/g, imageUrlPrefix)
+                    anchors = '<li><i></i><a href="#anchor' + i +
+                        '">' + item.title + '</a></li><li class="anchor-line"></li>';
+                    str = '<div class="title"><h2 id="anchor' + i +
+                        '">' + item.title +
+                        '</h2><div class="line"></div></div>' +
+                        '<div>' + item.content + '<div>';
+                    $(".infos").append(str);
+                    $(".anchors ul").append(anchors);
+                    //});
+                }
+                addLinkClickEvent();
+                adjustHeight();
+
+            }
+        })
+
+        // $.post(infoUrl,param,function(res){
+        //     console.log('resssss', res)
+        //     if(res.ret == 0){
+        //         var str='',anchors='',item='';
+        //         if(!res.data){
+        //             $("h1").html("暂时没有数据");
+        //             return;
+        //         }
+        //         var list  = res.data.introduceDetailList;
+        //         $("h1").html(res.data.shortName);
+        //         //list.map((item,i) =>{
+        //         for(var i=0;i<list.length;i++) {
+        //             item = list[i];
+        //             anchors = '<li><i></i><a href="#anchor' + i +
+        //                 '">' + item.title + '</a></li><li class="anchor-line"></li>';
+        //             str = '<div class="title"><h2 id="anchor' + i +
+        //                 '">' + item.title +
+        //                 '</h2><div class="line"></div></div>' +
+        //                 '<div>' + item.description + '<div>';
+        //             $(".infos").append(str);
+        //             $(".anchors ul").append(anchors);
+        //             //});
+        //         }
+        //         addLinkClickEvent();
+        //         adjustHeight();
+        //     }else{
+        //         $(".container").html(res.msg);
+        //     }
+        // }
+        // );
+
+    }
+
+    function parseUrlParams(){
+        var url = window.location.search;
+        // var params = url.substring(1).split("&");
+        // var tmp = '',obj = {},it={};
+        // //params.map((it) =>{
+        // for(var i=0;i<params.length;i++) {
+        //     it = params[i];
+        //     tmp = it.split("=");
+        //     if (tmp[0] && tmp[1]) {
+        //         obj[tmp[0]] = tmp[1];
+        //     }
+        // }
+        // //});
+        // return obj;
+        obj={};url.replace(/([^?&=]+)=([^&]+)/g,(_,k,v)=>q[k]=v);
+        return obj;
+    }
+
+    function addLinkClickEvent(){
+        $("li:first").addClass("active");
+        $("li>a").on("click",function(){
+            $(".active").removeClass('active');
+            $(this).parent().addClass("active");
+        });
+    }
+
+    function adjustHeight(){
+        var ht = window.innerHeight;
+        $(".content").height(ht-145+"px");
+    }
+
+})();

+ 125 - 0
src/js/information.js

@@ -0,0 +1,125 @@
+// import { imageUrlPrefix } from '@utils/config.js';
+(function(){
+    getInfomation();
+    function getInfomation(){
+        // var infoUrl ="http://" + window.location.host+'/icss-web/kl/introduce/get_by_itemidAndType';
+        // var infoUrl ="http://" + window.location.host+'/api/icss/introduceInfo/getByQuestionId';
+        var infoUrl ='http://192.168.2.236:5050/api/icss/introduceInfo/getByQuestionId'
+        var imageUrlPrefix = 'http://192.168.2.241:82'
+        var urlParam = parseUrlParams();
+        console.log(urlParam)
+        var param = {
+            // "type": urlParam.type,
+            // "questionId": urlParam.questionId,
+            "type": 7,
+            "questionId": 21773,
+            "position":2
+        };
+        $.ajax({
+            type: 'POST',
+            url: infoUrl,
+            data: JSON.stringify(param),
+            headers: {
+                // 'Accept': 'application/json, text/plain, */*',
+                'Content-Type':'application/json; charset=utf-8'
+            },
+            success: function(res) {
+                   console.log(res) 
+                   var str='',anchors='',item='';
+                if(!res.data){
+                    $("h1").html("暂时没有数据");
+                    $(".anchors").css("display", "none");
+                    return;
+                }
+                var list  = res.data.introduceDetailList;
+                $("h1").html(res.data.tagName);
+                $("h1").css({"color": "#267FD7","borderBottom":"4px solid  #E9E9E9","padding":"0px 60px 50px 0px"});
+                //list.map((item,i) =>{
+                for(var i=0;i<list.length;i++) {
+                    item = list[i];
+                    item.content = item.content.replace(/{imageUrlPrefix}/g, imageUrlPrefix)
+                    anchors = '<li><i></i><a href="#anchor' + i +
+                        '">' + item.title + '</a></li><li class="anchor-line"></li>';
+                    str = '<div class="title"><h2 id="anchor' + i +
+                        '">' + item.title +
+                        '</h2></div>' +
+                        '<div>' + item.content + '<div>';
+                    if(i != list.length-1) {
+                        str +=  '<div class="line"></div>'
+                    }
+                    $(".infos").append(str);
+                    $(".anchors ul").append(anchors);
+                    //});
+                }
+                addLinkClickEvent();
+                adjustHeight();
+
+            }
+        })
+
+        // $.post(infoUrl,param,function(res){
+        //     console.log('resssss', res)
+        //     if(res.ret == 0){
+        //         var str='',anchors='',item='';
+        //         if(!res.data){
+        //             $("h1").html("暂时没有数据");
+        //             return;
+        //         }
+        //         var list  = res.data.introduceDetailList;
+        //         $("h1").html(res.data.shortName);
+        //         //list.map((item,i) =>{
+        //         for(var i=0;i<list.length;i++) {
+        //             item = list[i];
+        //             anchors = '<li><i></i><a href="#anchor' + i +
+        //                 '">' + item.title + '</a></li><li class="anchor-line"></li>';
+        //             str = '<div class="title"><h2 id="anchor' + i +
+        //                 '">' + item.title +
+        //                 '</h2><div class="line"></div></div>' +
+        //                 '<div>' + item.description + '<div>';
+        //             $(".infos").append(str);
+        //             $(".anchors ul").append(anchors);
+        //             //});
+        //         }
+        //         addLinkClickEvent();
+        //         adjustHeight();
+        //     }else{
+        //         $(".container").html(res.msg);
+        //     }
+        // }
+        // );
+
+    }
+
+    function parseUrlParams(){
+        var url = window.location.search;
+        var params = url.substring(1).split("&");
+        var tmp = '',obj = {},it={};
+        //params.map((it) =>{
+        for(var i=0;i<params.length;i++) {
+            it = params[i];
+            tmp = it.split("=");
+            if (tmp[0] && tmp[1]) {
+                obj[tmp[0]] = tmp[1];
+            }
+        }
+        //});
+        return obj;
+        // var obj={};
+        // url.replace(/([^?&=]+)=([^&]+)/g,(_,k,v)=>q[k]=v);
+        // return obj;
+    }
+
+    function addLinkClickEvent(){
+        $("li:first").addClass("active");
+        $("li>a").on("click",function(){
+            $(".active").removeClass('active');
+            $(this).parent().addClass("active");
+        });
+    }
+
+    function adjustHeight(){
+        var ht = window.innerHeight;
+        $(".content").height(ht-145+"px");
+    }
+
+})();

+ 42 - 0
webpack.config.js

@@ -10,6 +10,9 @@ module.exports = {
     index: path.resolve(__dirname, 'src', 'index.js'),
     page: path.resolve(__dirname, 'src', 'page.js'),
     scoreSheet: path.resolve(__dirname, 'src', 'scoreSheet.js'),
+    information: path.resolve(__dirname, 'src/js', 'information.js'),
+    drugInfo: path.resolve(__dirname, 'src/js', 'drugInfo.js'),
+    disclaimer: path.resolve(__dirname, 'src/js', 'disclaimer.js'),
     vendor:'lodash' // 多个页面所需的公共库文件,防止重复打包带入
   },
   output: {
@@ -62,6 +65,45 @@ module.exports = {
         collapseWhitespace: true //删除空白符与换行符
       }
     }),
+    new HtmlWebpackPlugin({
+      title: 'information',
+      template: path.resolve(__dirname, 'src/html', 'information.html'),
+      filename: 'information.html',
+      chunks: ['information', 'vendor','common'],
+      inject: true,
+      hash: true, //防止缓存
+      minify: {
+        removeAttributeQuotes: true, //压缩 去掉引号
+        removeComments: true, //移除HTML中的注释
+        collapseWhitespace: true //删除空白符与换行符
+      }
+    }),
+    new HtmlWebpackPlugin({
+      title: 'drugInfo',
+      template: path.resolve(__dirname, 'src/html', 'drugInfo.html'),
+      filename: 'drugInfo.html',
+      chunks: ['drugInfo', 'vendor','common'],
+      inject: true,
+      hash: true, //防止缓存
+      minify: {
+        removeAttributeQuotes: true, //压缩 去掉引号
+        removeComments: true, //移除HTML中的注释
+        collapseWhitespace: true //删除空白符与换行符
+      }
+    }),
+    new HtmlWebpackPlugin({
+      title: 'disclaimer',
+      template: path.resolve(__dirname, 'src/html', 'disclaimer.html'),
+      filename: 'disclaimer.html',
+      chunks: ['disclaimer', 'vendor','common'],
+      inject: true,
+      hash: true, //防止缓存
+      minify: {
+        removeAttributeQuotes: true, //压缩 去掉引号
+        removeComments: true, //移除HTML中的注释
+        collapseWhitespace: true //删除空白符与换行符
+      }
+    }),
     new MiniCssExtractPlugin({
       // Options similar to the same options in webpackOptions.output
       // both options are optional