|
@@ -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)
|
|
|
})
|
|
|
}
|
|
|
|