/*
 * @Author: your name
 * @Date: 2021-09-07 10:37:59
 * @LastEditTime: 2021-09-13 19:13:28
 * @LastEditors: Please set LastEditors
 * @Description: In User Settings Edit
 * @FilePath: /MedicalWisdomCheckSys/mock/accreditationDetail.ts
 */


// eslint-disable-next-line import/no-extraneous-dependencies
import { Request, Response } from 'express';
import moment from 'moment';




function getList(req: Request, res: Response, u: string) {
  const dataSource = [
    {
      title: 'parent 0',
      id: '0-0',
      code:'1.1.1',
      isLeaf: false,
      levelNum:1,
      children: [
        { 
            title: 'leaf 0-0',
            id: '0-0-0',
            code:'1.1.1',
            isLeaf: false,
            levelNum:2,
            children:[
                { title: 'leaf 0-1-1-1', id: '0-0-1-1',code:'1.1.1', isLeaf: true,levelNum:3, },
            ]
        },
        { title: 'leaf 0-1', id: '0-0-1',code:'1.1.1', isLeaf: true,levelNum:2, },
      ],
    },
    {
      title: 'parent 1',
      id: '0-1',
      code:'1.1.1',
      isLeaf: false,
      levelNum:1,
      children: [
        {title: 'leaf 1-0', id: '0-1-0',code:'1.1.1', isLeaf: true,levelNum:2,},
        {title: 'leaf 1-1', id: '0-1-1',code:'1.1.1', isLeaf: true,levelNum:2, },
      ],
    },
    {
        title: 'parent 2',
        id: '0-2',
        code:'1.1.1',
        isLeaf: true,
        levelNum:1,
    },
  ];
  const result = {
    data:{
        list:dataSource,
        totalCount:dataSource.length,
        current:1
    },
    success: true,
    status:200,
  };
  setTimeout(()=>{
    return res.json(result); 
  },2000);
  
}

const getRuleDetailList = (req: Request, res: Response, u: string)=>{
  const result = {
    data:{
      leafDetails:[
          {
            evaluation:'A',
            detail:[
                {
                  title:'aaaaaaaaaaaaaaaa'
                },
                {
                  title:'bbbbbbbbbbbbbbb'
                }
            ]
          }
      ]
    },
    success: true,
    status:200,
  };
  setTimeout(()=>{
    return res.json(result); 
  },2000);
}



export default {
  'GET /api/pfm/reviewRules/getAllTree': getList,
  'GET /api/pfm/reviewRules/getDetails': getRuleDetailList,
};
