kn-cli 1.0.131 → 1.0.134
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.
- package/build/shellUtil.sh +2 -2
- package/build/start.sh +3 -2
- package/build/vite.config.js +1 -1
- package/package.json +2 -1
- package/src/create.js +2 -0
- package/templates/template_admin_antd5/.vscode/settings.json +28 -0
- package/templates/template_admin_antd5/build.sh +8 -0
- package/templates/template_admin_antd5/cli.config.js +35 -0
- package/templates/template_admin_antd5/dev.sh +33 -0
- package/templates/template_admin_antd5/frontend_build.sh +48 -0
- package/templates/template_admin_antd5/init/prepare-commit-msg +5 -0
- package/templates/template_admin_antd5/init.sh +24 -0
- package/templates/template_admin_antd5/jsconfig.json +17 -0
- package/templates/template_admin_antd5/package.json +27 -0
- package/templates/template_admin_antd5/public/404.html +26 -0
- package/templates/template_admin_antd5/public/favicon.png +0 -0
- package/templates/template_admin_antd5/public/index.html +48 -0
- package/templates/template_admin_antd5/public/src/_antd.less +37 -0
- package/templates/template_admin_antd5/public/src/_mixin.module.less +79 -0
- package/templates/template_admin_antd5/public/src/_reset.module.less +134 -0
- package/templates/template_admin_antd5/public/src/_variable.module.less +85 -0
- package/templates/template_admin_antd5/public/src/assets/iconfont/iconfont.eot +0 -0
- package/templates/template_admin_antd5/public/src/assets/iconfont/iconfont.module.less +109 -0
- package/templates/template_admin_antd5/public/src/assets/iconfont/iconfont.svg +75 -0
- package/templates/template_admin_antd5/public/src/assets/iconfont/iconfont.ttf +0 -0
- package/templates/template_admin_antd5/public/src/assets/iconfont/iconfont.woff +0 -0
- package/templates/template_admin_antd5/public/src/assets/iconfont/iconfont.woff2 +0 -0
- package/templates/template_admin_antd5/public/src/assets/images/arrow.png +0 -0
- package/templates/template_admin_antd5/public/src/assets/images/avatar.png +0 -0
- package/templates/template_admin_antd5/public/src/assets/images/icon-notice.png +0 -0
- package/templates/template_admin_antd5/public/src/assets/images/icon-user.png +0 -0
- package/templates/template_admin_antd5/public/src/assets/images/loadFail.png +0 -0
- package/templates/template_admin_antd5/public/src/assets/images/loading.svg +40 -0
- package/templates/template_admin_antd5/public/src/assets/images/login/bg.png +0 -0
- package/templates/template_admin_antd5/public/src/assets/images/login/logo.png +0 -0
- package/templates/template_admin_antd5/public/src/assets/images/login/slogan.png +0 -0
- package/templates/template_admin_antd5/public/src/assets/images/nav/icon-dep-active.png +0 -0
- package/templates/template_admin_antd5/public/src/assets/images/nav/icon-dep.png +0 -0
- package/templates/template_admin_antd5/public/src/assets/images/nav/icon-log-active.png +0 -0
- package/templates/template_admin_antd5/public/src/assets/images/nav/icon-log.png +0 -0
- package/templates/template_admin_antd5/public/src/assets/images/nav/icon-loginlog-active.png +0 -0
- package/templates/template_admin_antd5/public/src/assets/images/nav/icon-loginlog.png +0 -0
- package/templates/template_admin_antd5/public/src/assets/images/nav/icon-role-active.png +0 -0
- package/templates/template_admin_antd5/public/src/assets/images/nav/icon-role.png +0 -0
- package/templates/template_admin_antd5/public/src/assets/images/nav/icon-user-active.png +0 -0
- package/templates/template_admin_antd5/public/src/assets/images/nav/icon-user.png +0 -0
- package/templates/template_admin_antd5/public/src/assets/images/nav/nav-toggle.png +0 -0
- package/templates/template_admin_antd5/public/src/assets/images/nav/slogan.png +0 -0
- package/templates/template_admin_antd5/public/src/assets/images/noData.png +0 -0
- package/templates/template_admin_antd5/public/src/assets/images/noSelect.png +0 -0
- package/templates/template_admin_antd5/public/src/assets/images/permission/403.png +0 -0
- package/templates/template_admin_antd5/public/src/assets/images/permission/404.png +0 -0
- package/templates/template_admin_antd5/public/src/assets/images/permission/503.png +0 -0
- package/templates/template_admin_antd5/public/src/assets/images/play.png +0 -0
- package/templates/template_admin_antd5/public/src/components/_table/column.jsx +47 -0
- package/templates/template_admin_antd5/public/src/components/_table/column.module.less +12 -0
- package/templates/template_admin_antd5/public/src/components/_table/index.jsx +71 -0
- package/templates/template_admin_antd5/public/src/components/_table/index.module.less +15 -0
- package/templates/template_admin_antd5/public/src/components/antd/antProvider.jsx +21 -0
- package/templates/template_admin_antd5/public/src/components/antd/index.jsx +146 -0
- package/templates/template_admin_antd5/public/src/components/antd/select/index.jsx +296 -0
- package/templates/template_admin_antd5/public/src/components/antd/select/index.module.less +21 -0
- package/templates/template_admin_antd5/public/src/components/antd/theme.js +173 -0
- package/templates/template_admin_antd5/public/src/components/antd/tooltip/detail/index.jsx +70 -0
- package/templates/template_admin_antd5/public/src/components/antd/tooltip/detail/index.module.less +12 -0
- package/templates/template_admin_antd5/public/src/components/antd/tooltip/index.jsx +69 -0
- package/templates/template_admin_antd5/public/src/components/antd/tooltip/index.module.less +28 -0
- package/templates/template_admin_antd5/public/src/components/auth/index.jsx +123 -0
- package/templates/template_admin_antd5/public/src/components/auth/index.module.less +7 -0
- package/templates/template_admin_antd5/public/src/components/auth/navCheck.jsx +27 -0
- package/templates/template_admin_antd5/public/src/components/badge/index.jsx +47 -0
- package/templates/template_admin_antd5/public/src/components/badge/index.module.less +44 -0
- package/templates/template_admin_antd5/public/src/components/button/index.jsx +17 -0
- package/templates/template_admin_antd5/public/src/components/debug/index.jsx +28 -0
- package/templates/template_admin_antd5/public/src/components/debug/index.module.less +10 -0
- package/templates/template_admin_antd5/public/src/components/empty/index.jsx +28 -0
- package/templates/template_admin_antd5/public/src/components/empty/index.module.less +20 -0
- package/templates/template_admin_antd5/public/src/components/error/index.jsx +39 -0
- package/templates/template_admin_antd5/public/src/components/icon/index.jsx +128 -0
- package/templates/template_admin_antd5/public/src/components/icon/playVideo/index.jsx +21 -0
- package/templates/template_admin_antd5/public/src/components/icon/playVideo/index.module.less +16 -0
- package/templates/template_admin_antd5/public/src/components/iconFont/index.jsx +20 -0
- package/templates/template_admin_antd5/public/src/components/iconFont/index.module.less +5 -0
- package/templates/template_admin_antd5/public/src/components/image/index.jsx +73 -0
- package/templates/template_admin_antd5/public/src/components/image/index.module.less +117 -0
- package/templates/template_admin_antd5/public/src/components/image/preview.jsx +85 -0
- package/templates/template_admin_antd5/public/src/components/layout/basic/index.jsx +49 -0
- package/templates/template_admin_antd5/public/src/components/layout/basic/index.module.less +76 -0
- package/templates/template_admin_antd5/public/src/components/layout/index.jsx +39 -0
- package/templates/template_admin_antd5/public/src/components/layout/index.module.less +63 -0
- package/templates/template_admin_antd5/public/src/components/layout/provider/index.jsx +32 -0
- package/templates/template_admin_antd5/public/src/components/leftMenu/index.jsx +106 -0
- package/templates/template_admin_antd5/public/src/components/leftMenu/index.module.less +42 -0
- package/templates/template_admin_antd5/public/src/components/link/index.jsx +39 -0
- package/templates/template_admin_antd5/public/src/components/link/index.module.less +11 -0
- package/templates/template_admin_antd5/public/src/components/menuIcon/index.jsx +33 -0
- package/templates/template_admin_antd5/public/src/components/menuIcon/index.module.less +49 -0
- package/templates/template_admin_antd5/public/src/components/page/pageLoading/index.jsx +51 -0
- package/templates/template_admin_antd5/public/src/components/page/pageLoading/index.module.less +29 -0
- package/templates/template_admin_antd5/public/src/components/popup/index.jsx +60 -0
- package/templates/template_admin_antd5/public/src/components/popup/index.module.less +18 -0
- package/templates/template_admin_antd5/public/src/components/react/index.jsx +13 -0
- package/templates/template_admin_antd5/public/src/components/resizeBox/index.jsx +144 -0
- package/templates/template_admin_antd5/public/src/components/resizeBox/index.module.css +90 -0
- package/templates/template_admin_antd5/public/src/components/select/defaultServicesSelect/index.jsx +182 -0
- package/templates/template_admin_antd5/public/src/components/select/dictSelect/index.jsx +84 -0
- package/templates/template_admin_antd5/public/src/components/select/index.jsx +7 -0
- package/templates/template_admin_antd5/public/src/components/select/useSelectList.jsx +217 -0
- package/templates/template_admin_antd5/public/src/components/table/aliTable/index.jsx +250 -0
- package/templates/template_admin_antd5/public/src/components/table/aliTable/index.module.less +105 -0
- package/templates/template_admin_antd5/public/src/components/table/column.jsx +128 -0
- package/templates/template_admin_antd5/public/src/components/table/column.module.less +50 -0
- package/templates/template_admin_antd5/public/src/components/table/imageTable/index.jsx +302 -0
- package/templates/template_admin_antd5/public/src/components/table/imageTable/index.module.less +196 -0
- package/templates/template_admin_antd5/public/src/components/table/imageTable/radio.jsx +15 -0
- package/templates/template_admin_antd5/public/src/components/table/imageTable/radio.module.less +18 -0
- package/templates/template_admin_antd5/public/src/components/table/index.jsx +475 -0
- package/templates/template_admin_antd5/public/src/components/table/index.module.less +133 -0
- package/templates/template_admin_antd5/public/src/components/text/index.jsx +98 -0
- package/templates/template_admin_antd5/public/src/components/text/index.module.less +13 -0
- package/templates/template_admin_antd5/public/src/components/toast/index.jsx +79 -0
- package/templates/template_admin_antd5/public/src/components/toast/index.module.less +43 -0
- package/templates/template_admin_antd5/public/src/components/topMenu/index.jsx +102 -0
- package/templates/template_admin_antd5/public/src/components/topMenu/index.module.less +89 -0
- package/templates/template_admin_antd5/public/src/components/topMenu/topBar/index.jsx +81 -0
- package/templates/template_admin_antd5/public/src/components/topMenu/topBar/index.module.less +97 -0
- package/templates/template_admin_antd5/public/src/components/video/index.jsx +96 -0
- package/templates/template_admin_antd5/public/src/components/video/index.module.less +132 -0
- package/templates/template_admin_antd5/public/src/components/video/preview.jsx +38 -0
- package/templates/template_admin_antd5/public/src/config.js +31 -0
- package/templates/template_admin_antd5/public/src/declarations.d.ts +1 -0
- package/templates/template_admin_antd5/public/src/dictionary/dictionary.js +289 -0
- package/templates/template_admin_antd5/public/src/dictionary/index.jsx +64 -0
- package/templates/template_admin_antd5/public/src/enum.js +41 -0
- package/templates/template_admin_antd5/public/src/hooks/index.jsx +29 -0
- package/templates/template_admin_antd5/public/src/hooks/useDebounceFn.jsx +33 -0
- package/templates/template_admin_antd5/public/src/hooks/useDelay.jsx +34 -0
- package/templates/template_admin_antd5/public/src/hooks/useEsc.jsx +98 -0
- package/templates/template_admin_antd5/public/src/hooks/useImageLoader.jsx +26 -0
- package/templates/template_admin_antd5/public/src/hooks/useInToView.jsx +58 -0
- package/templates/template_admin_antd5/public/src/hooks/useLoading.jsx +46 -0
- package/templates/template_admin_antd5/public/src/hooks/usePreload.jsx +67 -0
- package/templates/template_admin_antd5/public/src/hooks/useRouteMenu.jsx +263 -0
- package/templates/template_admin_antd5/public/src/hooks/useScrollTop.jsx +44 -0
- package/templates/template_admin_antd5/public/src/hooks/useSearch.jsx +163 -0
- package/templates/template_admin_antd5/public/src/hooks/useTableRowSelect.jsx +310 -0
- package/templates/template_admin_antd5/public/src/hooks/useThrottole.jsx +68 -0
- package/templates/template_admin_antd5/public/src/hooks/useTimer.jsx +42 -0
- package/templates/template_admin_antd5/public/src/hooks/useUpdate.jsx +16 -0
- package/templates/template_admin_antd5/public/src/hooks/useWatchServices.jsx +124 -0
- package/templates/template_admin_antd5/public/src/index.jsx +89 -0
- package/templates/template_admin_antd5/public/src/menuConfig/auth.jsx +92 -0
- package/templates/template_admin_antd5/public/src/menuConfig/dashboard.jsx +25 -0
- package/templates/template_admin_antd5/public/src/menuConfig/dna.jsx +76 -0
- package/templates/template_admin_antd5/public/src/menuConfig/index.jsx +17 -0
- package/templates/template_admin_antd5/public/src/mock/auth.js +33 -0
- package/templates/template_admin_antd5/public/src/mock/demo.js +122 -0
- package/templates/template_admin_antd5/public/src/mock/index.js +65 -0
- package/templates/template_admin_antd5/public/src/mock/utils.js +33 -0
- package/templates/template_admin_antd5/public/src/pages/antdComponents/index.jsx +142 -0
- package/templates/template_admin_antd5/public/src/pages/auth/user/create/index.jsx +47 -0
- package/templates/template_admin_antd5/public/src/pages/auth/user/create/index.module.less +6 -0
- package/templates/template_admin_antd5/public/src/pages/auth/user/dialog/index.jsx +96 -0
- package/templates/template_admin_antd5/public/src/pages/auth/user/index.jsx +214 -0
- package/templates/template_admin_antd5/public/src/pages/components/layout/index.jsx +75 -0
- package/templates/template_admin_antd5/public/src/pages/components/layout/index.module.less +78 -0
- package/templates/template_admin_antd5/public/src/pages/components/layout/titleBar/index.jsx +28 -0
- package/templates/template_admin_antd5/public/src/pages/components/layout/titleBar/index.module.less +44 -0
- package/templates/template_admin_antd5/public/src/pages/components/select/user.jsx +18 -0
- package/templates/template_admin_antd5/public/src/pages/demo/page1.jsx +21 -0
- package/templates/template_admin_antd5/public/src/pages/demo/page2.jsx +21 -0
- package/templates/template_admin_antd5/public/src/pages/demo/page3.jsx +21 -0
- package/templates/template_admin_antd5/public/src/pages/error/403.jsx +15 -0
- package/templates/template_admin_antd5/public/src/pages/error/404.jsx +15 -0
- package/templates/template_admin_antd5/public/src/pages/error/503.jsx +15 -0
- package/templates/template_admin_antd5/public/src/pages/error/permission.jsx +40 -0
- package/templates/template_admin_antd5/public/src/pages/error/permission.module.less +16 -0
- package/templates/template_admin_antd5/public/src/pages/home.jsx +90 -0
- package/templates/template_admin_antd5/public/src/pages/home.module.less +6 -0
- package/templates/template_admin_antd5/public/src/pages/login/index.jsx +113 -0
- package/templates/template_admin_antd5/public/src/pages/login/index.module.less +153 -0
- package/templates/template_admin_antd5/public/src/pages/pageTemplate.jsx +28 -0
- package/templates/template_admin_antd5/public/src/provider/app.jsx +201 -0
- package/templates/template_admin_antd5/public/src/provider/loading.jsx +47 -0
- package/templates/template_admin_antd5/public/src/provider/menu.jsx +161 -0
- package/templates/template_admin_antd5/public/src/provider/menu.module.less +35 -0
- package/templates/template_admin_antd5/public/src/route.jsx +127 -0
- package/templates/template_admin_antd5/public/src/services/demo.js +85 -0
- package/templates/template_admin_antd5/public/src/services/excel.js +43 -0
- package/templates/template_admin_antd5/public/src/services/http/index.js +155 -0
- package/templates/template_admin_antd5/public/src/services/index.js +126 -0
- package/templates/template_admin_antd5/public/src/services/interceptor/index.js +67 -0
- package/templates/template_admin_antd5/public/src/services/login.js +37 -0
- package/templates/template_admin_antd5/public/src/services/socket/index.jsx +99 -0
- package/templates/template_admin_antd5/public/src/services/token/index.js +41 -0
- package/templates/template_admin_antd5/public/src/type.js +67 -0
- package/templates/template_admin_antd5/public/src/utils/event.js +58 -0
- package/templates/template_admin_antd5/public/src/utils/format.js +135 -0
- package/templates/template_admin_antd5/public/src/utils/index.js +727 -0
- package/templates/template_admin_antd5/public/src/utils/menu.js +33 -0
- package/templates/template_admin_antd5/public/src/utils/rule.js +277 -0
- package/templates/template_admin_antd5/public/src/utils/storage.js +30 -0
- package/templates/template_admin_antd5/public/static/about.html +1 -0
- package/templates/template_admin_antd5/public/static/kssoLogin.html +22 -0
- package/templates/template_admin_antd5/readme.md +84 -0
- package/templates/template_admin_antd5/renamejstojsx.js +45 -0
- package/templates/template_admin_antd5/renameless.js +53 -0
- package/templates/template_admin_antd5/report.sh +25 -0
- package/templates/template_admin_antd5/shellUtil.sh +110 -0
- package/templates/template_admin_antd5/versionPublish.sh +16 -0
- package/templates/template_admin_antd5/webpack.api.js +105 -0
|
@@ -0,0 +1,302 @@
|
|
|
1
|
+
import React,{useCallback} from 'react';
|
|
2
|
+
// @ts-ignore
|
|
3
|
+
import { Pagination,Checkbox,Tooltip, Spin,Tag } from "@/components/antd";
|
|
4
|
+
import ShowPreviewImage from '@/components/image/preview';
|
|
5
|
+
import ShowPreviewVideo from '@/components/video/preview';
|
|
6
|
+
import Empty from '@/components/empty';
|
|
7
|
+
// @ts-ignore
|
|
8
|
+
import styles from './index.module.less';
|
|
9
|
+
import { emMaterialTypeZeus } from '@/dictionary';
|
|
10
|
+
import { jumpUrl } from '@/utils';
|
|
11
|
+
import Radio from './radio';
|
|
12
|
+
import { PlayVideo } from '@/components/icon';
|
|
13
|
+
import {getMaterialTags} from '@/pages/bullet/material/material/column'
|
|
14
|
+
import ShowViewImageList from '@/pages/components/dialog/viewImageList';
|
|
15
|
+
import CheckboxBlock from '@/pages/components/checkboxBlock';
|
|
16
|
+
|
|
17
|
+
import {updatePageSizeToLocal,calPageSize,PAGE_SIZE_LIST} from '../';
|
|
18
|
+
|
|
19
|
+
const MaterialType={
|
|
20
|
+
Video:'video',
|
|
21
|
+
ImageText:'imageText',
|
|
22
|
+
Image:'image',
|
|
23
|
+
Douyin:'douyin',
|
|
24
|
+
Design:'design',
|
|
25
|
+
DouyinImageText:'douyinImageText',
|
|
26
|
+
StarDeliveryVideo:'starDeliveryVideo',
|
|
27
|
+
RemoteVideo:'remoteVideo',
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
const InfoType={
|
|
31
|
+
Cover:'cover',// 封面
|
|
32
|
+
Url:'url',// 素材真实url
|
|
33
|
+
Type:'type',// 素材类型
|
|
34
|
+
Name:'name',//素材名称
|
|
35
|
+
Tags:'tags',//媒体标签
|
|
36
|
+
}
|
|
37
|
+
/**
|
|
38
|
+
* 图片视频等素材的大图展示列表
|
|
39
|
+
* @param {object} [props]
|
|
40
|
+
* @param {string} [props.rowKey='id'] - 主键key名称
|
|
41
|
+
* @param {boolean} [props.loading] - 是否加载中
|
|
42
|
+
* @param {Array} [props.dataSource] - 数据数组
|
|
43
|
+
* @param {object} [props.pagination] - 分页器,参考配置项或 pagination 文档,设为 false 时不展示和进行分页
|
|
44
|
+
* @param {object} [props.page] - 表格数据,包括数据数组、分页参数、loading等
|
|
45
|
+
* @param {import('@/hooks/useTableRowSelect').UseTableRowSelect} [props.rowSelecter] - 选中管理器
|
|
46
|
+
* @param {(item:object,type:string)=>string} [props.onGetItemInfo] - 获取对象信息的监听方法
|
|
47
|
+
* @param {boolean|string[]} [props.hideInfo] - 是否隐藏信息
|
|
48
|
+
* @param {JSX.Element} [props.footer] - 表格底部额外的东西
|
|
49
|
+
* @param {boolean} [props.isRadio=false] - 是否是单选框
|
|
50
|
+
* @param {number} [props.columnCount=4] - 每行容纳的素材个数
|
|
51
|
+
* @param {string} [props.materialType] - 当前列表内的素材类型,来源:MaterialType
|
|
52
|
+
* @param {(item:object,type:string)=>JSX.Element} [props.renderItemInfo] - 渲染对象信息的方法
|
|
53
|
+
* @param {(record:object)=>boolean} [props.getCheckboxDisabled] - 每一个选项的配置
|
|
54
|
+
* @param {(item:object,e:any)=>void} [props.onView] - 点击图片的回调事件
|
|
55
|
+
* @param {(item:object)=>JSX.Element} [props.renderFlag] - 渲染角标
|
|
56
|
+
* @returns {JSX.Element}
|
|
57
|
+
*/
|
|
58
|
+
const ImageTable = (props) => {
|
|
59
|
+
const {
|
|
60
|
+
rowKey='id',
|
|
61
|
+
loading,
|
|
62
|
+
dataSource,
|
|
63
|
+
pagination,
|
|
64
|
+
page,
|
|
65
|
+
rowSelecter,
|
|
66
|
+
onGetItemInfo,
|
|
67
|
+
hideInfo=[InfoType.Tags],
|
|
68
|
+
footer=null,
|
|
69
|
+
isRadio=false,
|
|
70
|
+
columnCount=4,
|
|
71
|
+
materialType,
|
|
72
|
+
renderItemInfo,
|
|
73
|
+
getCheckboxDisabled,
|
|
74
|
+
onView:_onView,
|
|
75
|
+
renderFlag,
|
|
76
|
+
...others
|
|
77
|
+
} = props;
|
|
78
|
+
|
|
79
|
+
|
|
80
|
+
const paginationFn = useCallback(() => {
|
|
81
|
+
// pagination=false时不分页
|
|
82
|
+
if (typeof pagination === 'boolean') {
|
|
83
|
+
return pagination;
|
|
84
|
+
}
|
|
85
|
+
if( page?.pagination?.pageSize){
|
|
86
|
+
updatePageSizeToLocal( page?.pagination?.pageSize )
|
|
87
|
+
let sizeList = pagination?.pageSizeOptions||PAGE_SIZE_LIST;
|
|
88
|
+
page.pagination.pageSize= calPageSize(page.pagination.pageSize,sizeList);
|
|
89
|
+
|
|
90
|
+
}
|
|
91
|
+
return {
|
|
92
|
+
pageSizeOptions: PAGE_SIZE_LIST,
|
|
93
|
+
current: page?.pagination?.current,
|
|
94
|
+
pageSize: page?.pagination?.pageSize,
|
|
95
|
+
total: page?.pagination?.total,
|
|
96
|
+
showTotal: (total) => `总计${total}条`,
|
|
97
|
+
...pagination,
|
|
98
|
+
};
|
|
99
|
+
}, [pagination, page]);
|
|
100
|
+
|
|
101
|
+
|
|
102
|
+
const onView=(type,src,item,e)=>{
|
|
103
|
+
e.stopPropagation();
|
|
104
|
+
if(_onView){
|
|
105
|
+
_onView(item,e);
|
|
106
|
+
return;
|
|
107
|
+
}
|
|
108
|
+
if(type==MaterialType.Video){
|
|
109
|
+
ShowPreviewVideo({src})
|
|
110
|
+
}else if(type==MaterialType.Image){
|
|
111
|
+
ShowPreviewImage({data:{src}})
|
|
112
|
+
}else if( type == MaterialType.DouyinImageText || type == MaterialType.RemoteVideo || type==MaterialType.Douyin){
|
|
113
|
+
jumpUrl(src,{newWindow:true})
|
|
114
|
+
}
|
|
115
|
+
}
|
|
116
|
+
const onChecked=(item,e)=>{
|
|
117
|
+
rowSelecter.onSelect(item,e.target.checked)
|
|
118
|
+
}
|
|
119
|
+
const onCheckedAll=()=>{
|
|
120
|
+
let keys=[];
|
|
121
|
+
let _list=[];
|
|
122
|
+
list.forEach(item=>{
|
|
123
|
+
if(getCheckboxDisabled && getCheckboxDisabled(item)){
|
|
124
|
+
return;
|
|
125
|
+
}
|
|
126
|
+
_list.push(item)
|
|
127
|
+
keys.push(item[rowKey]);
|
|
128
|
+
});
|
|
129
|
+
rowSelecter.onSelectAll(keys,_list,_list)
|
|
130
|
+
}
|
|
131
|
+
const onCheckedAllChange=(e)=>{
|
|
132
|
+
if(e.target.checked){
|
|
133
|
+
onCheckedAll();
|
|
134
|
+
}else{
|
|
135
|
+
rowSelecter.clear();
|
|
136
|
+
}
|
|
137
|
+
}
|
|
138
|
+
|
|
139
|
+
const getCheckedState=()=>{
|
|
140
|
+
let all=false;
|
|
141
|
+
let half=false;
|
|
142
|
+
if(rowSelecter.checked.length<=0){
|
|
143
|
+
return {all,half};
|
|
144
|
+
}
|
|
145
|
+
if(list?.length<=0){
|
|
146
|
+
return {all,half}
|
|
147
|
+
}
|
|
148
|
+
|
|
149
|
+
let keys =list.map(item=>item[rowKey])||[];
|
|
150
|
+
keys.sort();
|
|
151
|
+
let _keys = [...rowSelecter.checked].sort();
|
|
152
|
+
if(keys.length == _keys.length){
|
|
153
|
+
if( JSON.stringify(keys) == JSON.stringify(_keys) ){
|
|
154
|
+
all=true;
|
|
155
|
+
}
|
|
156
|
+
}
|
|
157
|
+
|
|
158
|
+
if(!all){
|
|
159
|
+
half=keys.some(_current=>{
|
|
160
|
+
if(_keys.includes(_current)){
|
|
161
|
+
return true;
|
|
162
|
+
}
|
|
163
|
+
return false;
|
|
164
|
+
});
|
|
165
|
+
}
|
|
166
|
+
return {all,half};
|
|
167
|
+
|
|
168
|
+
}
|
|
169
|
+
|
|
170
|
+
const getItemInfo=(item,type)=>{
|
|
171
|
+
if(onGetItemInfo){
|
|
172
|
+
return onGetItemInfo(item,type);
|
|
173
|
+
}
|
|
174
|
+
switch(type){
|
|
175
|
+
case InfoType.Cover:return item.cover||item.url;
|
|
176
|
+
case InfoType.Url:return item.url;
|
|
177
|
+
case InfoType.Name:return item.name;
|
|
178
|
+
case InfoType.Type:{
|
|
179
|
+
if(materialType){
|
|
180
|
+
return materialType;
|
|
181
|
+
}
|
|
182
|
+
let type = emMaterialTypeZeus.getName(item.type);
|
|
183
|
+
if('video'==type){
|
|
184
|
+
return MaterialType.Video;
|
|
185
|
+
}else{
|
|
186
|
+
return MaterialType.Image;
|
|
187
|
+
}
|
|
188
|
+
}
|
|
189
|
+
case InfoType.Tags:{
|
|
190
|
+
let tags = getMaterialTags(item,false);
|
|
191
|
+
return tags?.map(tag=>tag.name)||[];
|
|
192
|
+
}
|
|
193
|
+
}
|
|
194
|
+
return '';
|
|
195
|
+
}
|
|
196
|
+
|
|
197
|
+
// const renderFlag=(item)=>{
|
|
198
|
+
// let flagType = getItemInfo(item,InfoType.Type)
|
|
199
|
+
// const flagName={
|
|
200
|
+
// [MaterialType.Video]:'视频',
|
|
201
|
+
// [MaterialType.ImageText]:'图文',
|
|
202
|
+
// [MaterialType.Image]:'图片',
|
|
203
|
+
// [MaterialType.Douyin]:'抖音号',
|
|
204
|
+
// [MaterialType.Design]:'设计组',
|
|
205
|
+
// [MaterialType.DouyinImageText]:'抖音图文',
|
|
206
|
+
|
|
207
|
+
// }
|
|
208
|
+
// if(!flagType)return '';
|
|
209
|
+
// return <div className={styles.flag} data-type={flagType}>{flagName[flagType]}</div>
|
|
210
|
+
// }
|
|
211
|
+
|
|
212
|
+
const getList=()=>{
|
|
213
|
+
if(dataSource)return dataSource;
|
|
214
|
+
if(page.mode == 'scrollLoad'){
|
|
215
|
+
return page.scrollData || [];
|
|
216
|
+
}else{
|
|
217
|
+
return page?.data?.[page?.pagination?.current - 1] ||[];
|
|
218
|
+
}
|
|
219
|
+
}
|
|
220
|
+
|
|
221
|
+
const showInfo=(type)=>{
|
|
222
|
+
if(hideInfo===true)return false;
|
|
223
|
+
if(hideInfo===false)return true;
|
|
224
|
+
if(Array.isArray(hideInfo)){
|
|
225
|
+
return !hideInfo.includes(type)
|
|
226
|
+
};
|
|
227
|
+
return true;
|
|
228
|
+
}
|
|
229
|
+
let list = getList();
|
|
230
|
+
|
|
231
|
+
if(list?.length<=0){
|
|
232
|
+
return <section className={styles.empty}><Empty /></section>
|
|
233
|
+
}
|
|
234
|
+
|
|
235
|
+
const checkedState=getCheckedState();
|
|
236
|
+
return (
|
|
237
|
+
<section className={styles.wrap}>
|
|
238
|
+
{
|
|
239
|
+
!isRadio&&
|
|
240
|
+
<div className={styles.checkedAllBar}>
|
|
241
|
+
<Checkbox
|
|
242
|
+
indeterminate={checkedState.half}
|
|
243
|
+
onChange={onCheckedAllChange}
|
|
244
|
+
checked={checkedState.all}
|
|
245
|
+
>
|
|
246
|
+
全选
|
|
247
|
+
</Checkbox>
|
|
248
|
+
</div>
|
|
249
|
+
}
|
|
250
|
+
<div className={styles.imageList} data-flex={true} data-hide-info={hideInfo===true?true:false} data-column-count={columnCount}>
|
|
251
|
+
{
|
|
252
|
+
list.map((item,idx)=>{
|
|
253
|
+
const url = getItemInfo(item,InfoType.Url);
|
|
254
|
+
const cover = getItemInfo(item,InfoType.Cover);
|
|
255
|
+
const name = getItemInfo(item,InfoType.Name);
|
|
256
|
+
const type = getItemInfo(item,InfoType.Type);
|
|
257
|
+
const tags = getItemInfo(item,InfoType.Tags)
|
|
258
|
+
|
|
259
|
+
return (
|
|
260
|
+
<div className={styles.imageGrid} key={idx}>
|
|
261
|
+
{
|
|
262
|
+
isRadio?
|
|
263
|
+
(<div className={styles.checkBox}><Radio disabled={getCheckboxDisabled?getCheckboxDisabled(item):false} checked={rowSelecter?.checked?.includes(item[rowKey])} onChange={onChecked.bind(this,item)} /></div>)
|
|
264
|
+
:(<div className={styles.checkBox}><CheckboxBlock disabled={getCheckboxDisabled?getCheckboxDisabled(item):false} onChange={onChecked.bind(this,item)} checked={rowSelecter?.checked?.includes(item[rowKey])} /></div>)
|
|
265
|
+
}
|
|
266
|
+
|
|
267
|
+
<div className={styles.imageView} onClick={onView.bind(this,type,url,item)}>
|
|
268
|
+
<img src={cover} />
|
|
269
|
+
{[MaterialType.RemoteVideo,MaterialType.Video,MaterialType.Douyin].includes(type)&&<PlayVideo className={styles.playIcon} size={30} onClick={onView.bind(this,type,url)}/>}
|
|
270
|
+
</div>
|
|
271
|
+
{renderItemInfo?renderItemInfo(item,type):(
|
|
272
|
+
<div className={styles.infoWrap} data-hide={hideInfo===true?true:false}>
|
|
273
|
+
<div className={styles.imageInfo} >
|
|
274
|
+
<span className={styles.text}><Tooltip title={name}>{name}</Tooltip></span>
|
|
275
|
+
</div>
|
|
276
|
+
{
|
|
277
|
+
showInfo(InfoType.Tags)&&
|
|
278
|
+
<div className={styles.tags}>
|
|
279
|
+
<Tooltip title={tags?tags.join(';'):'无'}><span className={styles.tagTitle}>媒体标签({tags?.length||0})</span></Tooltip>
|
|
280
|
+
</div>
|
|
281
|
+
}
|
|
282
|
+
</div>
|
|
283
|
+
|
|
284
|
+
)}
|
|
285
|
+
{renderFlag&&renderFlag(item)}
|
|
286
|
+
</div>
|
|
287
|
+
)
|
|
288
|
+
})
|
|
289
|
+
}
|
|
290
|
+
</div>
|
|
291
|
+
<div className={styles.pagination}>
|
|
292
|
+
{page.mode == 'pagination'&&pagination!==false&&<Pagination {...paginationFn()}/>}
|
|
293
|
+
</div>
|
|
294
|
+
{footer?<div className={styles.footer}>{footer}</div>:''}
|
|
295
|
+
<div className={styles.loading} data-show={ loading || page?.loading?.state }><Spin /></div>
|
|
296
|
+
</section>
|
|
297
|
+
);
|
|
298
|
+
};
|
|
299
|
+
ImageTable.InfoType=InfoType;
|
|
300
|
+
ImageTable.MaterialType=MaterialType;
|
|
301
|
+
|
|
302
|
+
export default ImageTable;
|
package/templates/template_admin_antd5/public/src/components/table/imageTable/index.module.less
ADDED
|
@@ -0,0 +1,196 @@
|
|
|
1
|
+
@import '~@/_mixin.module.less';
|
|
2
|
+
@import '~@/_variable.module.less';
|
|
3
|
+
.empty{
|
|
4
|
+
width: 100%;
|
|
5
|
+
height: 200px;
|
|
6
|
+
position: relative;
|
|
7
|
+
align-items: center;
|
|
8
|
+
justify-content: center;
|
|
9
|
+
}
|
|
10
|
+
.checkedAllBar{
|
|
11
|
+
background-color: #F5F8FF;
|
|
12
|
+
border-radius: 4px;
|
|
13
|
+
padding: 8px 12px;
|
|
14
|
+
}
|
|
15
|
+
.wrap{
|
|
16
|
+
position: relative;
|
|
17
|
+
width: 100%;
|
|
18
|
+
height: 100%;
|
|
19
|
+
display: flex;
|
|
20
|
+
flex-direction: column;
|
|
21
|
+
row-gap: 16px;
|
|
22
|
+
overflow: hidden;
|
|
23
|
+
.imageList{
|
|
24
|
+
position: relative;
|
|
25
|
+
flex:1;
|
|
26
|
+
width: 100%;
|
|
27
|
+
display: grid;
|
|
28
|
+
grid-template-columns: repeat(4,1fr);
|
|
29
|
+
grid-template-rows:217px;
|
|
30
|
+
|
|
31
|
+
&[data-flex='true']{
|
|
32
|
+
display: flex;
|
|
33
|
+
flex-wrap: wrap;
|
|
34
|
+
align-content:flex-start;
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
grid-gap: 12px;
|
|
38
|
+
overflow: auto;
|
|
39
|
+
.scrollBar;
|
|
40
|
+
|
|
41
|
+
&[ data-column-count='5']{
|
|
42
|
+
grid-template-columns: repeat(5,1fr);
|
|
43
|
+
}
|
|
44
|
+
&[ data-column-count='6']{
|
|
45
|
+
grid-template-columns: repeat(6,1fr);
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
&[data-hide-info='true']{
|
|
49
|
+
grid-template-rows:159px;
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
.imageGrid{
|
|
53
|
+
|
|
54
|
+
flex-shrink: 0;
|
|
55
|
+
flex-grow: 0;
|
|
56
|
+
position: relative;
|
|
57
|
+
width: 159px;
|
|
58
|
+
height: 217px;
|
|
59
|
+
border:1px solid #DEE0E3;
|
|
60
|
+
border-radius: 5px;
|
|
61
|
+
overflow: hidden;
|
|
62
|
+
display: flex;
|
|
63
|
+
flex-direction: column;
|
|
64
|
+
|
|
65
|
+
|
|
66
|
+
.checkBox{
|
|
67
|
+
position: absolute;
|
|
68
|
+
left:4px;
|
|
69
|
+
top:4px;
|
|
70
|
+
width: 100%;
|
|
71
|
+
}
|
|
72
|
+
.imageView{
|
|
73
|
+
padding:12px;
|
|
74
|
+
flex:1;
|
|
75
|
+
width: 100%;
|
|
76
|
+
display: flex;
|
|
77
|
+
align-items: center;
|
|
78
|
+
justify-content: center;
|
|
79
|
+
background-color: #F3F3F3;
|
|
80
|
+
cursor: pointer;
|
|
81
|
+
overflow: hidden;
|
|
82
|
+
img{
|
|
83
|
+
max-width: 100%;
|
|
84
|
+
max-height: 100%;
|
|
85
|
+
}
|
|
86
|
+
}
|
|
87
|
+
.infoWrap{
|
|
88
|
+
padding:6px 12px;
|
|
89
|
+
width: 100%;
|
|
90
|
+
&[data-hide='true']{
|
|
91
|
+
display: none;
|
|
92
|
+
}
|
|
93
|
+
.tags{
|
|
94
|
+
display: flex;
|
|
95
|
+
flex-wrap:wrap;
|
|
96
|
+
row-gap: 4px;
|
|
97
|
+
height: 24px;
|
|
98
|
+
overflow: hidden;
|
|
99
|
+
.tagTitle{
|
|
100
|
+
color: var(--color-primary);
|
|
101
|
+
font-size: 14px;
|
|
102
|
+
}
|
|
103
|
+
}
|
|
104
|
+
}
|
|
105
|
+
.imageInfo{
|
|
106
|
+
width: 100%;
|
|
107
|
+
height: 58px;
|
|
108
|
+
display: flex;
|
|
109
|
+
align-items: center;
|
|
110
|
+
justify-content: center;
|
|
111
|
+
font-weight: 400;
|
|
112
|
+
font-size: 12px;
|
|
113
|
+
color: #373C43;
|
|
114
|
+
|
|
115
|
+
.text,
|
|
116
|
+
.text span{
|
|
117
|
+
width: 100%;
|
|
118
|
+
max-width: 100%;
|
|
119
|
+
display: -webkit-box;
|
|
120
|
+
-webkit-box-orient: vertical;
|
|
121
|
+
-webkit-line-clamp: 2;
|
|
122
|
+
overflow: hidden;
|
|
123
|
+
text-overflow: ellipsis;
|
|
124
|
+
white-space: normal;
|
|
125
|
+
word-break: break-all;
|
|
126
|
+
}
|
|
127
|
+
|
|
128
|
+
|
|
129
|
+
}
|
|
130
|
+
}
|
|
131
|
+
&[data-hide-info='true']{
|
|
132
|
+
.imageGrid{
|
|
133
|
+
height: 159px;
|
|
134
|
+
}
|
|
135
|
+
}
|
|
136
|
+
}
|
|
137
|
+
.pagination{
|
|
138
|
+
width: 100%;
|
|
139
|
+
display: flex;
|
|
140
|
+
justify-content: flex-end;
|
|
141
|
+
}
|
|
142
|
+
|
|
143
|
+
}
|
|
144
|
+
|
|
145
|
+
.loading{
|
|
146
|
+
position: absolute;
|
|
147
|
+
display: none;
|
|
148
|
+
left:0;
|
|
149
|
+
top:0;
|
|
150
|
+
width: 100%;
|
|
151
|
+
height: 100%;
|
|
152
|
+
background-color: rgba(255,255,255,.8);
|
|
153
|
+
z-index: 3;
|
|
154
|
+
&[data-show='true']{
|
|
155
|
+
display: flex;
|
|
156
|
+
justify-content: center;
|
|
157
|
+
align-items: center;
|
|
158
|
+
}
|
|
159
|
+
}
|
|
160
|
+
.footer{
|
|
161
|
+
width: 100%;
|
|
162
|
+
position: relative;
|
|
163
|
+
}
|
|
164
|
+
.flag{
|
|
165
|
+
position: absolute;
|
|
166
|
+
right:4px;
|
|
167
|
+
top:4px;
|
|
168
|
+
display: flex;
|
|
169
|
+
align-items: center;
|
|
170
|
+
justify-content: center;
|
|
171
|
+
padding:0 5px;
|
|
172
|
+
border-radius: 2px 2px 2px 2px;
|
|
173
|
+
color:white;
|
|
174
|
+
font-size: 12px;
|
|
175
|
+
// width: 32px;
|
|
176
|
+
// height: 16px;
|
|
177
|
+
&[data-type='video']{
|
|
178
|
+
background: #F39322;
|
|
179
|
+
}
|
|
180
|
+
&[data-type='imageText']{
|
|
181
|
+
background: #D580FF;
|
|
182
|
+
}
|
|
183
|
+
&[data-type='image']{
|
|
184
|
+
background: #1CC9E5;
|
|
185
|
+
}
|
|
186
|
+
&[data-type='douyin']{
|
|
187
|
+
background: #5B609E;
|
|
188
|
+
}
|
|
189
|
+
&[data-type='design']{
|
|
190
|
+
background: #7755FF;
|
|
191
|
+
}
|
|
192
|
+
}
|
|
193
|
+
|
|
194
|
+
.playIcon{
|
|
195
|
+
position: absolute;
|
|
196
|
+
}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
|
|
2
|
+
import React from 'react';
|
|
3
|
+
import styles from './radio.module.less';
|
|
4
|
+
|
|
5
|
+
const Radio=props=>{
|
|
6
|
+
const {checked,onChange:_onChange} = props;
|
|
7
|
+
const onChange=()=>{
|
|
8
|
+
if(_onChange){
|
|
9
|
+
_onChange({target:{checked:!checked}})
|
|
10
|
+
}
|
|
11
|
+
}
|
|
12
|
+
return <div className={styles.wrap} data-checked={checked} onClick={onChange}/>
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
export default Radio;
|
package/templates/template_admin_antd5/public/src/components/table/imageTable/radio.module.less
ADDED
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
|
|
2
|
+
|
|
3
|
+
.wrap{
|
|
4
|
+
cursor: pointer;
|
|
5
|
+
position: relative;
|
|
6
|
+
display: inline-flex;
|
|
7
|
+
justify-content: center;
|
|
8
|
+
align-items: center;
|
|
9
|
+
width: 20px;
|
|
10
|
+
height: 20px;
|
|
11
|
+
background: #FFFFFF;
|
|
12
|
+
border-radius:20px;
|
|
13
|
+
border: 1px solid #BBBFC4;
|
|
14
|
+
&[data-checked='true']{
|
|
15
|
+
background-image: url('~@/assets/images/checked.png');
|
|
16
|
+
background-size:100% 100%;
|
|
17
|
+
}
|
|
18
|
+
}
|