kn-cli 1.0.93 → 1.0.95

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (36) hide show
  1. package/package.json +1 -1
  2. package/templates/template_admin/public/src/assets/images/avatars/1.png +0 -0
  3. package/templates/template_admin/public/src/assets/images/avatars/2.png +0 -0
  4. package/templates/template_admin/public/src/assets/images/avatars/3.png +0 -0
  5. package/templates/template_admin/public/src/components/layout/basic/index.less +3 -3
  6. package/templates/template_admin/public/src/components/menu/topMenu/index.jsx +28 -15
  7. package/templates/template_admin/public/src/components/table/index.jsx +62 -0
  8. package/templates/template_admin/public/src/dictionary/index.js +45 -3
  9. package/templates/template_admin/public/src/mock/demo.js +184 -0
  10. package/templates/template_admin/public/src/mock/index.js +5 -2
  11. package/templates/template_admin/public/src/pages/demo/detail/index.jsx +27 -0
  12. package/templates/template_admin/public/src/pages/demo/edit/index.jsx +109 -0
  13. package/templates/template_admin/public/src/pages/demo/index.less +9 -0
  14. package/templates/template_admin/public/src/pages/demo/page1.jsx +161 -0
  15. package/templates/template_admin/public/src/pages/login/index.jsx +5 -4
  16. package/templates/template_admin/public/src/pages/superAdminLogin/index.jsx +9 -2
  17. package/templates/template_admin/public/src/provider/app.jsx +20 -10
  18. package/templates/template_admin/public/src/provider/menu.jsx +58 -173
  19. package/templates/template_admin/public/src/route.jsx +19 -25
  20. package/templates/template_admin/public/src/services/demo.js +54 -0
  21. package/templates/template_admin/public/src/services/index.js +9 -0
  22. package/templates/template_admin/public/src/utils/format.js +51 -0
  23. package/templates/template_admin/public/src/utils/rule.js +274 -0
  24. package/templates/template_admin/readme.md +4 -0
  25. package/templates/template_admin/public/src/mock/auth.js +0 -91
  26. package/templates/template_admin/public/src/mock/user.js +0 -70
  27. package/templates/template_admin/public/src/pages/material/index.jsx +0 -84
  28. package/templates/template_admin/public/src/pages/order/index.jsx +0 -12
  29. package/templates/template_admin/public/src/pages/permission/index.jsx +0 -12
  30. package/templates/template_admin/public/src/pages/suggest/index.jsx +0 -12
  31. package/templates/template_admin/public/src/pages/user/index.jsx +0 -18
  32. package/templates/template_admin/public/src/pages/userData/index.jsx +0 -12
  33. package/templates/template_admin/public/src/pages/video/index.jsx +0 -65
  34. package/templates/template_admin/public/src/services/auth.js +0 -28
  35. package/templates/template_admin/public/src/services/user.js +0 -26
  36. package/templates/template_admin/public/src/services/video.js +0 -33
@@ -1,12 +0,0 @@
1
- import React, { useEffect, useState, useRef } from 'react';
2
- import Link from '@/components/Link';
3
-
4
- const Page = () => {
5
- return (
6
- <div>
7
- userData
8
- </div>
9
- )
10
- }
11
-
12
- export default Page;
@@ -1,65 +0,0 @@
1
- import React, { useEffect, useState, useRef } from 'react';
2
- import {usePagination} from '@/hooks';
3
- import {GET_LIST} from '@/services/video';
4
- import {Table,Pagination} from 'antd';
5
-
6
- const Page = () => {
7
- const request = usePagination({
8
- service:GET_LIST,
9
- pagination:{pageSize:10}
10
- })
11
-
12
- useEffect(()=>{
13
- request.update();
14
- },[])
15
-
16
- const columns=[{
17
- dataIndex:'id',
18
- title:'id',
19
- render:(_,record,idx)=>{
20
- return record.id;
21
- }
22
- },{
23
- dataIndex:'value',
24
- title:'数据值',
25
- render:(_,record,idx)=>{
26
- return record.value||'-'
27
- }
28
- }];
29
-
30
- useEffect(()=>{
31
- console.log(request)
32
- },[request])
33
-
34
- const getDataSource=()=>{
35
- if(request?.data?.length>0){
36
- let req=request?.data[request.pagination.current-1]||[];
37
- return req;
38
- }
39
- return [];
40
- }
41
-
42
- const onPageChange=(current,pageSize)=>{
43
- debugger;
44
- request.update({pagination:{current,pageSize}})
45
- }
46
- return (
47
- <section className='wrap-space'>
48
- <Table
49
- rowKey={'id'}
50
- loading={!request?.data?.length>0}
51
- columns={columns}
52
- dataSource={getDataSource()}
53
- pagination={false}
54
- />
55
- <Pagination
56
- current={request?.pagination?.current}
57
- pageSize={request?.pagination?.pageSize}
58
- onChange={onPageChange}
59
- total={request?.pagination?.total}
60
- />
61
- </section>
62
- )
63
- }
64
-
65
- export default Page;
@@ -1,28 +0,0 @@
1
- import {GET_DEFAULT,API_ROOT,POST_DEFAULT} from './index.js';
2
-
3
-
4
-
5
- export function GET_MENU(){
6
- return GET_DEFAULT(`${API_ROOT}/api/menu/nav`);
7
- }
8
-
9
-
10
-
11
- export function KSSO_LOGIN(params={
12
- code:'',
13
- redirectUri:'',
14
- }){
15
- return POST_DEFAULT(`${API_ROOT}/api/ksso/auth`,params)
16
-
17
- }
18
-
19
- export function LOGIN(params={
20
- username:'',
21
- password:'',
22
- }){
23
- return POST_DEFAULT(`${API_ROOT}/api/login`,params)
24
-
25
- }
26
- export function LOGOUT(){
27
- return POST_DEFAULT(`${API_ROOT}/api/logout`)
28
- }
@@ -1,26 +0,0 @@
1
- import {GET_DEFAULT,POST_DEFAULT,API_ROOT} from './index.js';
2
-
3
-
4
-
5
- export function GET_USER(){
6
- return GET_DEFAULT(`${API_ROOT}/user`);
7
- }
8
-
9
- export function SET_USER(params={
10
- name:'',
11
- age:''
12
- }){
13
- return POST_DEFAULT(`${API_ROOT}/user`,params)
14
- }
15
-
16
-
17
- export function GET_USER_LIST(params={
18
- current:1,
19
- pageSize:20
20
- }){
21
- return GET_DEFAULT(`${API_ROOT}/userList`,params)
22
- }
23
-
24
- export function GET_USER_TYPE(){
25
- return GET_DEFAULT(`${API_ROOT}/userType`)
26
- }
@@ -1,33 +0,0 @@
1
-
2
-
3
- export function GET_LIST(params={
4
- current:1,
5
- pageSize:10,
6
- keywords:''
7
- }){
8
- const {current,pageSize,keywords='-'}=params;
9
- let list=[];
10
- for(let i=0;i<200;i++){
11
- list.push({
12
- id:i,
13
- value:`item-${i}-${keywords}`,
14
- })
15
- }
16
- let total=200;
17
- let startIdx = (current-1)*pageSize;
18
- let data = list.splice(startIdx,pageSize);
19
- let req= {
20
- code:0,
21
- data,
22
- page:{
23
- current,
24
- pageSize,
25
- total
26
- }
27
- };
28
- return new Promise(resolve=>{
29
- setTimeout(()=>{
30
- resolve(req)
31
- },500)
32
- })
33
- }