fix custom filter value example broken

This commit is contained in:
AllenFang 2018-05-20 13:50:03 +08:00
parent 216bc10142
commit 4f6809de84
2 changed files with 10 additions and 2 deletions

View File

@ -3,9 +3,9 @@ import React from 'react';
import BootstrapTable from 'react-bootstrap-table-next';
import filterFactory, { textFilter } from 'react-bootstrap-table2-filter';
import Code from 'components/common/code-block';
import { jobsGenerator } from 'utils/common';
import { jobsGenerator1 } from 'utils/common';
const jobs = jobsGenerator(5);
const jobs = jobsGenerator1(5);
const owners = ['Allen', 'Bob', 'Cat'];
const types = ['Cloud Service', 'Message Service', 'Add Service', 'Edit Service', 'Money'];

View File

@ -41,6 +41,14 @@ export const jobsGenerator = (quantity = 5) =>
type: jobType[Math.floor((Math.random() * 4) + 1)]
}));
export const jobsGenerator1 = (quantity = 5) =>
Array.from({ length: quantity }, (value, index) => ({
id: index,
name: `Job name ${index}`,
owner: Math.floor((Math.random() * 2) + 1),
type: Math.floor((Math.random() * 4) + 1)
}));
export const todosGenerator = (quantity = 5) =>
Array.from({ length: quantity }, (value, index) => ({
id: index,