data.js 875 B

1234567891011121314151617181920212223242526272829303132333435363738394041424344
  1. import Mock from 'mockjs';
  2. import { doCustomTimes } from '@/libs/util';
  3. import orgData from './data/org-data';
  4. import { treeData } from './data/tree-select';
  5. const Random = Mock.Random;
  6. export const getTableData = (req) => {
  7. let tableData = [];
  8. doCustomTimes(5, () => {
  9. tableData.push(
  10. Mock.mock({
  11. name: '@name',
  12. email: '@email',
  13. createTime: '@date',
  14. }),
  15. );
  16. });
  17. return tableData;
  18. };
  19. export const getDragList = (req) => {
  20. let dragList = [];
  21. doCustomTimes(5, () => {
  22. dragList.push(
  23. Mock.mock({
  24. name: Random.csentence(10, 13),
  25. id: Random.increment(10),
  26. }),
  27. );
  28. });
  29. return dragList;
  30. };
  31. export const uploadImage = (req) => {
  32. return Promise.resolve();
  33. };
  34. export const getOrgData = (req) => {
  35. return orgData;
  36. };
  37. export const getTreeSelectData = (req) => {
  38. return treeData;
  39. };