Browse Source

模块数据维护

zhangxc 5 years ago
parent
commit
6edf5bedea

+ 0 - 0
src/css/moduleManager.less


+ 1 - 0
src/html/index.html

@@ -33,6 +33,7 @@
                   <li>统计分析</li>
               </ul>
           </div>
+          
       </div>
   </div>
 </body>

+ 33 - 0
src/html/itemManager.html

@@ -0,0 +1,33 @@
+<!DOCTYPE html>
+<html lang="en">
+
+<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>条目数据维护维护</title>
+    
+</head>
+
+<body>
+    <div class="container">
+        条目维护维护
+        <table>
+            <thead>
+                <th class="moduleName">序号</th>
+                <th class="moduleScore">模块类别</th>
+                <th class="moduleScore">质控条目名称</th>
+                <th class="moduleScore">提示信息</th>
+                <th class="moduleScore">分值</th>
+                <th class="moduleScore">单项否决等级</th>
+                <th class="moduleScore">启用</th>
+                <th class="moduleScore">操作</th>
+            </thead>
+            <tbody>
+
+            </tbody>
+        </table>
+    </div>
+</body>
+
+</html>

+ 3 - 0
src/html/moduleManager.html

@@ -6,6 +6,7 @@
     <meta name="viewport" content="width=device-width, initial-scale=1.0">
     <meta http-equiv="X-UA-Compatible" content="ie=edge">
     <title>模块维护</title>
+    
 </head>
 
 <body>
@@ -21,6 +22,8 @@
             </tbody>
         </table>
         <div class="saveModule">保存</div>
+        <div id="dialog" title="基本的对话框">
+        </div>
     </div>
 </body>
 

+ 8 - 0
src/js/api.js

@@ -0,0 +1,8 @@
+
+const api = {
+    getQcCases:'/qc/cases/getQcCases',
+    getQcCasesEntryAll:'/qc/casesEntryHospital/getQcCasesEntryAll'
+}
+module.exports = {
+    api
+};

+ 19 - 0
src/js/itemManager.js

@@ -0,0 +1,19 @@
+const $ = require('jquery');
+require("../css/moduleManager.less");
+const {api} = require('./api.js')
+const {post} = require('./utils.js')
+const param = {
+    hospitalId: "",
+    casesName: "",
+    name: "", //条目名
+    isReject: 0, //1-单项否决 0-非
+    isUsed: 1 //0-未启用 1-启用
+}
+post(api.getQcCasesEntryAll,param).then(res =>{
+    console.log('ress', res)
+    if(res.data.code == '0'){
+        const data = res.data.data
+    }else{}
+}).catch((e) =>{
+
+})

+ 48 - 62
src/js/moduleManager.js

@@ -1,63 +1,50 @@
 const $ = require('jquery');
-// require('./../resource/layui/layui.all.js')
-// require('./../resource/layui/css/layui.css')
+require("../css/moduleManager.less");
+require('./../resource/layui/layui.js');
+require('./../resource/layui/css/layui.css');
 // const  layui = require('layui-src');
-// console.log('layui', layui)
-// layui.use('table', function(){
-//     var table = layui.table;
-  
-//     //第一个实例
-//     table.render({
-//       elem: '#demo'
-//       ,height: 312
-//       ,url: '/demo/table/user/' //数据接口
-//       ,page: true //开启分页
-//       ,cols: [[ //表头
-//         {field: 'id', title: 'ID', width:80, sort: true, fixed: 'left'}
-//         ,{field: 'username', title: '用户名', width:80}
-//         ,{field: 'sex', title: '性别', width:80, sort: true}
-//         ,{field: 'city', title: '城市', width:80} 
-//         ,{field: 'sign', title: '签名', width: 177}
-//         ,{field: 'experience', title: '积分', width: 80, sort: true}
-//         ,{field: 'score', title: '评分', width: 80, sort: true}
-//         ,{field: 'classify', title: '职业', width: 80}
-//         ,{field: 'wealth', title: '财富', width: 135, sort: true}
-//       ]]
-//     });
-    
-//   });
+const {api} = require('./api.js')
+const {post} = require('./utils.js')
+post(api.getQcCases).then(res =>{
+    console.log('ress', res)
+    if(res.data.code == '0'){
+        const data = res.data.data
+        renderTab(data)
+    }else{}
+}).catch((e) =>{
 
-const data = [
-    {
-        name: '入院记录',
-        score: 10
-    },
-    {
-        name: '入院记录',
-        score: 10
-    },
-    {
-        name: '入院记录',
-        score: 10
-    },{
-        name: '入院记录',
-        score: 10
-    }
-    ,{
-        name: '入院记录',
-        score: 10
-    }
-    ,{
-        name: '入院记录',
-        score: 10
-    },
-    {
-        name: '入院记录',
-        score: 10
-    }
-]
+})
+// const data = [
+//     {
+//         name: '入院记录',
+//         score: 10
+//     },
+//     {
+//         name: '入院记录',
+//         score: 10
+//     },
+//     {
+//         name: '入院记录',
+//         score: 10
+//     },{
+//         name: '入院记录',
+//         score: 10
+//     }
+//     ,{
+//         name: '入院记录',
+//         score: 10
+//     }
+//     ,{
+//         name: '入院记录',
+//         score: 10
+//     },
+//     {
+//         name: '入院记录',
+//         score: 10
+//     }
+// ]
 
-function renderTab(){
+function renderTab(data){
     let  str = ``
     for(let i = 0; i < data.length; i++){
     
@@ -75,11 +62,10 @@ function renderTab(){
     </tr>
     `
     $('table tbody').html(str)
-    bindInput()
-    getTotalSum()
+    bindInput(data)
+    getTotalSum(data)
 }
-renderTab()
-function getTotalSum(){
+function getTotalSum(data){
     let sum = 0
     for(let i = 0; i < data.length; i++){
         if(data[i].score){
@@ -89,13 +75,13 @@ function getTotalSum(){
     $('.totalSum').html(sum)
 }
 
-function bindInput(){
+function bindInput(data){
     $('input').on('input', function(e){
         const val = $(this).val()
         const index = $(this).attr('data-index')
         $(this).attr('value', val)
         data[index].score = val 
-        getTotalSum()
+        getTotalSum(data)
     })
 }
 

File diff suppressed because it is too large
+ 1 - 0
src/js/utils.js


File diff suppressed because it is too large
+ 1 - 1
src/resource/layui/layui.js


+ 21 - 3
webpack.config.js

@@ -6,11 +6,12 @@ const MiniCssExtractPlugin = require('mini-css-extract-plugin');
 const CopyWebpackPlugin = require('copy-webpack-plugin');
 const UglifyJsPlugin = require('uglifyjs-webpack-plugin');
 const webpack = require('webpack');
-const proxyHost = "http://192.168.2.236:5050";
+const proxyHost = "http://192.168.2.236:5858";
 module.exports = {
   entry: {
     index: path.resolve(__dirname, 'src/js', 'index.js'),
     moduleManager: path.resolve(__dirname, 'src/js', 'moduleManager.js'),
+    itemManager: path.resolve(__dirname, 'src/js', 'itemManager.js'),
     vendor: 'lodash'// 多个页面所需的公共库文件,防止重复打包带入
   },
   output: {
@@ -53,7 +54,7 @@ module.exports = {
       title: 'itemManager.html',
       template: path.resolve(__dirname, 'src/html', 'itemManager.html'),
       filename: 'itemManager.html',
-      chunks: ['index', 'vendor', 'common'],
+      chunks: ['itemManager', 'vendor', 'common'],
       hash: true, //防止缓存
       inject: true,
       minify: {
@@ -192,6 +193,23 @@ module.exports = {
           }
         }
       },
+      {
+        test: /\.css$/,
+        use: [{
+            loader: MiniCssExtractPlugin.loader
+          },
+          {
+            loader: 'css-loader',
+            options: {
+              modules: true,
+              getLocalIdent: (context, localIdentName, localName, options) =>{
+                  return localName
+              }
+          }
+          
+          }
+        ]
+      },
       {
         test: /\.less$/,
         use: [
@@ -229,7 +247,7 @@ module.exports = {
   devServer: {
     contentBase: "./dist", //静态文件根目录
     proxy: {
-      '/api': proxyHost
+      '/': proxyHost
     },
     hot: true,
     // openPage:'index.html'