zy-react-library 1.1.1 → 1.1.3

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 (75) hide show
  1. package/README.md +5 -1
  2. package/components/Cascader/Area/index.js +1 -20
  3. package/components/Cascader/Basic/index.js +1 -64
  4. package/components/Cascader/Dictionary/index.js +1 -42
  5. package/components/Cascader/Industry/index.js +1 -20
  6. package/components/Editor/index.js +1 -102
  7. package/components/FormBuilder/FormBuilder.js +1 -87
  8. package/components/FormBuilder/FormItemsRenderer.js +1 -591
  9. package/components/FormBuilder/index.js +1 -3
  10. package/components/HeaderBack/index.js +1 -37
  11. package/components/HiddenInfo/gwj/index.js +1 -518
  12. package/components/Icon/AddIcon/index.js +1 -9
  13. package/components/Icon/BackIcon/index.js +1 -9
  14. package/components/Icon/DeleteIcon/index.js +1 -9
  15. package/components/Icon/DownloadIcon/index.js +1 -9
  16. package/components/Icon/EditIcon/index.js +1 -9
  17. package/components/Icon/ExportIcon/index.js +1 -9
  18. package/components/Icon/ImportIcon/index.js +1 -9
  19. package/components/Icon/LocationIcon/index.js +1 -9
  20. package/components/Icon/PrintIcon/index.js +1 -9
  21. package/components/Icon/ResetIcon/index.js +1 -9
  22. package/components/Icon/SearchIcon/index.js +1 -9
  23. package/components/Icon/VideoIcon/index.js +1 -9
  24. package/components/Icon/ViewIcon/index.js +1 -9
  25. package/components/ImportFile/index.js +1 -91
  26. package/components/LeftTree/Area/index.js +1 -15
  27. package/components/LeftTree/Basic/index.js +1 -171
  28. package/components/LeftTree/Department/Gwj/index.js +1 -32
  29. package/components/LeftTree/Dictionary/index.js +1 -42
  30. package/components/Map/MapSelector.js +1 -254
  31. package/components/Map/index.js +1 -77
  32. package/components/Page/index.js +1 -50
  33. package/components/Pdf/index.js +1 -134
  34. package/components/PreviewImg/index.js +1 -32
  35. package/components/PreviewPdf/index.js +1 -86
  36. package/components/Search/index.js +1 -141
  37. package/components/Select/Basic/index.js +1 -76
  38. package/components/Select/Dictionary/index.js +1 -42
  39. package/components/Select/Personnel/Gwj/index.js +1 -49
  40. package/components/SelectCreate/index.js +1 -55
  41. package/components/SelectTree/Area/index.js +1 -26
  42. package/components/SelectTree/Basic/index.js +1 -102
  43. package/components/SelectTree/Department/Gwj/index.js +1 -46
  44. package/components/SelectTree/Dictionary/index.js +1 -42
  45. package/components/SelectTree/HiddenLevel/Gwj/index.js +1 -72
  46. package/components/SelectTree/HiddenPart/Gwj/index.js +1 -39
  47. package/components/SelectTree/Industry/index.js +1 -27
  48. package/components/Signature/index.js +1 -94
  49. package/components/Table/index.js +1 -73
  50. package/components/Table/index.less +7 -1
  51. package/components/TooltipPreviewImg/index.js +1 -27
  52. package/components/Upload/index.js +1 -275
  53. package/components/Video/AliPlayer.js +1 -160
  54. package/components/Video/index.js +1 -90
  55. package/css/common.less +4 -0
  56. package/enum/dictionary/index.js +1 -7
  57. package/enum/formItemRender/index.js +1 -37
  58. package/enum/hidden/gwj/index.js +1 -31
  59. package/enum/uploadFile/gwj/index.js +1 -176
  60. package/hooks/useDeleteFile/index.js +1 -101
  61. package/hooks/useDictionary/index.js +1 -66
  62. package/hooks/useDownloadBlob/index.js +1 -79
  63. package/hooks/useDownloadFile/index.js +1 -81
  64. package/hooks/useGetFile/index.js +1 -74
  65. package/hooks/useGetUrlQuery/index.js +1 -16
  66. package/hooks/useGetUserInfo/index.js +1 -49
  67. package/hooks/useIdle/index.js +1 -67
  68. package/hooks/useImportFile/index.js +1 -59
  69. package/hooks/useIsExistenceDuplicateSelection/index.js +1 -20
  70. package/hooks/useTable/index.js +1 -113
  71. package/hooks/useUploadFile/index.js +1 -149
  72. package/hooks/useUrlQueryCriteria/index.js +1 -77
  73. package/package.json +18 -1
  74. package/regular/index.js +1 -61
  75. package/utils/index.js +1 -587
@@ -1,27 +1 @@
1
- import { Tag, Tooltip } from "antd";
2
- import PreviewImg from "../PreviewImg";
3
-
4
- /**
5
- * 在表格组件中图片查看组件
6
- */
7
- const TooltipPreviewImg = (props) => {
8
- const { files = [], fileUrlKey = "filePath" } = props;
9
-
10
- const renderContent = () => {
11
- return (
12
- files.length > 0
13
- ? <PreviewImg files={files} fileUrlKey={fileUrlKey} />
14
- : <span>暂无图片</span>
15
- );
16
- };
17
-
18
- return (
19
- <Tooltip placement="top" title={renderContent()}>
20
- <Tag>预览</Tag>
21
- </Tooltip>
22
- );
23
- };
24
-
25
- TooltipPreviewImg.displayName = "TooltipPreviewImg";
26
-
27
- export default TooltipPreviewImg;
1
+ import{Tooltip as e,Tag as i}from"antd";import r from"../PreviewImg/index.js";import{jsx as t}from"react/jsx-runtime";const l=l=>{const{files:n=[],fileUrlKey:o="filePath"}=l;return t(e,{placement:"top",title:n.length>0?t(r,{files:n,fileUrlKey:o}):t("span",{children:"暂无图片"}),children:t(i,{children:"预览"})})};l.displayName="TooltipPreviewImg";export{l as default};
@@ -1,275 +1 @@
1
- import { PlusOutlined, UploadOutlined, VideoCameraAddOutlined } from "@ant-design/icons";
2
- import { Upload as AntUpload, Button, message, Modal } from "antd";
3
- import { useState } from "react";
4
-
5
- /**
6
- * 文件上传组件
7
- */
8
- const Upload = (props) => {
9
- const {
10
- value = [],
11
- onChange,
12
- onPreview,
13
- onRemove,
14
- onGetRemoveFile,
15
- beforeUpload,
16
- maxCount: externalMaxCount,
17
- listType: externalListType,
18
- accept: externalAccept,
19
- ratio = "",
20
- showTip = true,
21
- multiple = true,
22
- size: externalSize,
23
- tipContent,
24
- uploadButtonText: externalUploadButtonText,
25
- fileType: externalFileType,
26
- ...restProps
27
- } = props;
28
-
29
- const [previewVisible, setPreviewVisible] = useState(false);
30
- const [previewImage, setPreviewImage] = useState("");
31
-
32
- // 预设的文件格式
33
- const imageAccept = ".jpg,.jpeg,.png";
34
- const documentAccept = ".pdf,.doc,.docx";
35
- const videoAccept = ".mp4";
36
-
37
- // 根据accept自动判断文件类型
38
- const getAutoFileType = () => {
39
- if (externalAccept) {
40
- if (externalAccept === "*")
41
- return "document";
42
- const acceptList = externalAccept.split(",");
43
- if (acceptList.some(format => videoAccept.split(",").includes(format)))
44
- return "video";
45
- if (acceptList.some(format => documentAccept.split(",").includes(format)))
46
- return "document";
47
- if (acceptList.some(format => imageAccept.split(",").includes(format)))
48
- return "image";
49
- return "document";
50
- }
51
- return "image";
52
- };
53
- const fileType = externalFileType || getAutoFileType();
54
-
55
- // 文件类型判断
56
- const isImageType = fileType === "image";
57
- const isVideoType = fileType === "video";
58
- const isDocumentType = fileType === "document";
59
-
60
- // 获取listType
61
- const getListType = () => {
62
- if (externalListType)
63
- return externalListType;
64
- if (externalAccept === "*")
65
- return "text";
66
- if (fileType === "image")
67
- return "picture-card";
68
- return "text";
69
- };
70
- const listType = getListType();
71
-
72
- // 获取文件格式
73
- const getAccept = () => {
74
- if (externalAccept)
75
- return externalAccept === "*" ? "" : externalAccept;
76
- if (isImageType)
77
- return imageAccept;
78
- if (isVideoType)
79
- return videoAccept;
80
- if (isDocumentType)
81
- return documentAccept;
82
- return imageAccept;
83
- };
84
- const accept = getAccept();
85
-
86
- // 获取默认上传数量
87
- const getMaxCount = () => {
88
- if (externalMaxCount)
89
- return externalMaxCount;
90
- if (isVideoType)
91
- return 1;
92
- if (isImageType)
93
- return 4;
94
- if (isDocumentType)
95
- return 4;
96
- return 1;
97
- };
98
- const maxCount = getMaxCount();
99
-
100
- // 获取默认文件大小
101
- const getSize = () => {
102
- if (externalSize)
103
- return externalSize;
104
- if (isVideoType)
105
- return 100;
106
- return 0;
107
- };
108
- const size = getSize();
109
-
110
- // 上传按钮文字
111
- const uploadButtonText = externalUploadButtonText || (isVideoType ? "上传视频" : "上传附件");
112
-
113
- // 文件格式提示
114
- const acceptTip = accept.replace(/\./g, "").split(",").join("、");
115
-
116
- // 生成提示信息
117
- const getTipText = () => {
118
- if (tipContent)
119
- return tipContent;
120
-
121
- const tips = [
122
- `最多上传${maxCount}个文件`,
123
- accept
124
- ? `并且只能上传${acceptTip}格式的文件`
125
- : "可以上传任意格式的文件",
126
- size ? `文件大小不能超过${size}M` : "",
127
- ratio ? `只能上传${ratio}分辨率的图片` : "",
128
- ].filter(Boolean);
129
-
130
- return `${tips.join(",")}。`;
131
- };
132
-
133
- const handleBeforeUpload = (file, fileList) => {
134
- if (beforeUpload)
135
- return beforeUpload(file, fileList);
136
- return false;
137
- };
138
-
139
- // 文件状态改变
140
- const handleChange = ({ file, fileList }) => {
141
- const acceptList = accept ? accept.split(",") : [];
142
- const ratioArr = ratio ? ratio.split("*") : [];
143
- const suffix = file.name.substring(
144
- file.name.lastIndexOf("."),
145
- file.name.length,
146
- );
147
- const maxSize = size * 1024 * 1024;
148
-
149
- // 验证文件格式
150
- if (acceptList.length > 0 && !acceptList.includes(suffix)) {
151
- message.warning(`只能上传${acceptTip}格式的文件`);
152
- return;
153
- }
154
-
155
- // 验证文件大小
156
- if (maxSize && file.size > maxSize) {
157
- message.warning(`文件大小不能超过${size}M`);
158
- return;
159
- }
160
-
161
- // 验证图片分辨率
162
- if (ratioArr.length === 2 && file.type?.startsWith("image/")) {
163
- const validateImageResolution = (imageUrl) => {
164
- const img = new Image();
165
- img.onload = () => {
166
- if (img.width !== +ratioArr[0] || img.height !== +ratioArr[1]) {
167
- message.warning(`只能上传${ratio}分辨率的图片`);
168
- const filtered = fileList.filter(item => item.uid !== file.uid);
169
- onChange?.(filtered);
170
- return;
171
- }
172
- onChange?.(fileList);
173
- };
174
- img.src = imageUrl;
175
- };
176
-
177
- // 如果有现成的URL则直接使用,否则使用FileReader读取本地文件
178
- if (file.url) {
179
- validateImageResolution(file.url);
180
- }
181
- else {
182
- const reader = new FileReader();
183
- reader.onload = (e) => {
184
- validateImageResolution(e.target.result);
185
- };
186
- reader.readAsDataURL(file);
187
- }
188
- }
189
- else {
190
- onChange?.(fileList);
191
- }
192
- };
193
-
194
- // 删除文件
195
- const handleRemove = (file) => {
196
- if (!file.originFileObj)
197
- onGetRemoveFile?.(file);
198
- return onRemove?.(file);
199
- };
200
-
201
- // 预览文件
202
- const handlePreview = (file) => {
203
- if (isImageType) {
204
- setPreviewImage(file.url || file.thumbUrl);
205
- setPreviewVisible(true);
206
- }
207
- onPreview?.(file);
208
- };
209
-
210
- // 关闭预览
211
- const handleCancel = () => {
212
- setPreviewVisible(false);
213
- };
214
-
215
- // 上传按钮
216
- const uploadButton
217
- = isImageType
218
- ? (
219
- <div>
220
- <PlusOutlined style={{ fontSize: 32 }} />
221
- </div>
222
- )
223
- : (
224
- <Button
225
- type="primary"
226
- icon={isVideoType ? <VideoCameraAddOutlined /> : <UploadOutlined />}
227
- >
228
- {uploadButtonText}
229
- </Button>
230
- );
231
-
232
- return (
233
- <>
234
- <AntUpload
235
- fileList={value}
236
- multiple={multiple}
237
- maxCount={maxCount}
238
- listType={listType}
239
- accept={accept}
240
- onChange={handleChange}
241
- onPreview={handlePreview}
242
- onRemove={handleRemove}
243
- beforeUpload={handleBeforeUpload}
244
- {...restProps}
245
- >
246
- {value.length >= maxCount ? null : uploadButton}
247
- </AntUpload>
248
- {
249
- showTip
250
- ? (getTipText()) && (
251
- <div style={{ marginTop: 10, color: "#ff4d4f" }}>
252
- {getTipText()}
253
- </div>
254
- )
255
- : null
256
- }
257
- <Modal
258
- open={previewVisible}
259
- title="查看图片"
260
- footer={null}
261
- onCancel={handleCancel}
262
- >
263
- <img
264
- alt="preview"
265
- style={{ width: "100%", objectFit: "scale-down" }}
266
- src={previewImage}
267
- />
268
- </Modal>
269
- </>
270
- );
271
- };
272
-
273
- Upload.displayName = "Upload";
274
-
275
- export default Upload;
1
+ import{PlusOutlined as e,VideoCameraAddOutlined as t,UploadOutlined as i}from"@ant-design/icons";import{Upload as n,Modal as o,Button as l,message as r}from"antd";import{useState as s}from"react";import{jsxs as a,Fragment as d,jsx as c}from"react/jsx-runtime";const p=p=>{const{value:m=[],onChange:u,onPreview:f,onRemove:g,onGetRemoveFile:h,beforeUpload:v,maxCount:w,listType:y,accept:x,ratio:$="",showTip:j=!0,multiple:b=!0,size:C,tipContent:T,uploadButtonText:U,fileType:R,...F}=p,[z,L]=s(!1),[B,I]=s(""),M=".jpg,.jpeg,.png",O=".pdf,.doc,.docx",P=".mp4",A=R||(()=>{if(x){if("*"===x)return"document";const e=x.split(",");return e.some(e=>P.split(",").includes(e))?"video":e.some(e=>O.split(",").includes(e))?"document":e.some(e=>M.split(",").includes(e))?"image":"document"}return"image"})(),D="image"===A,G="video"===A,N="document"===A,S=y||("*"===x?"text":"image"===A?"picture-card":"text"),W=x?"*"===x?"":x:D?M:G?P:N?O:M,k=w||(G?1:D||N?4:1),q=C||(G?100:0),E=U||(G?"上传视频":"上传附件"),H=W.replace(/\./g,"").split(",").join("、"),J=()=>T||`${[`最多上传${k}个文件`,W?`并且只能上传${H}格式的文件`:"可以上传任意格式的文件",q?`文件大小不能超过${q}M`:"",$?`只能上传${$}分辨率的图片`:""].filter(Boolean).join(",")}。`,K=D?c("div",{children:c(e,{style:{fontSize:32}})}):c(l,{type:"primary",icon:c(G?t:i,{}),children:E});return a(d,{children:[c(n,{fileList:m,multiple:b,maxCount:k,listType:S,accept:W,onChange:({file:e,fileList:t})=>{const i=W?W.split(","):[],n=$?$.split("*"):[],o=e.name.substring(e.name.lastIndexOf("."),e.name.length),l=1024*q*1024;if(i.length>0&&!i.includes(o))r.warning(`只能上传${H}格式的文件`);else if(l&&e.size>l)r.warning(`文件大小不能超过${q}M`);else if(2===n.length&&e.type?.startsWith("image/")){const i=i=>{const o=new Image;o.onload=()=>{if(o.width!==+n[0]||o.height!==+n[1]){r.warning(`只能上传${$}分辨率的图片`);const i=t.filter(t=>t.uid!==e.uid);return void u?.(i)}u?.(t)},o.src=i};if(e.url)i(e.url);else{const t=new FileReader;t.onload=e=>{i(e.target.result)},t.readAsDataURL(e)}}else u?.(t)},onPreview:e=>{D&&(I(e.url||e.thumbUrl),L(!0)),f?.(e)},onRemove:e=>(e.originFileObj||h?.(e),g?.(e)),beforeUpload:(e,t)=>!!v&&v(e,t),...F,children:m.length>=k?null:K}),j?J()&&c("div",{style:{marginTop:10,color:"#ff4d4f"},children:J()}):null,c(o,{open:z,title:"查看图片",footer:null,onCancel:()=>{L(!1)},children:c("img",{alt:"preview",style:{width:"100%",objectFit:"scale-down"},src:B})})]})};p.displayName="Upload";export{p as default};
@@ -1,160 +1 @@
1
- import { useDocumentVisibility } from "ahooks";
2
- import { uniqueId } from "lodash-es";
3
- import { forwardRef, useEffect, useImperativeHandle, useRef } from "react";
4
- import { dynamicLoadCss, dynamicLoadJs } from "../../utils";
5
-
6
- /**
7
- * 视频播放组件
8
- */
9
- const AliPlayer = forwardRef(({
10
- source = "",
11
- vid = "",
12
- playAuth = "",
13
- cover = "",
14
- width = "100%",
15
- height = "600px",
16
- autoplay = true,
17
- showProgress = true,
18
- isLive = false,
19
- playTime = 0,
20
- onEnded,
21
- onTimeupdate,
22
- }, ref) => {
23
- const playerRef = useRef(null);
24
- const containerRef = useRef(null);
25
- const visibility = useDocumentVisibility();
26
- const className = useRef(uniqueId("_")).current;
27
-
28
- useImperativeHandle(ref, () => ({
29
- play: () => {
30
- playerRef.current && playerRef.current.play();
31
- },
32
- pause: () => {
33
- playerRef.current && playerRef.current.pause();
34
- },
35
- }));
36
-
37
- const onDisposeAliPlayer = () => {
38
- if (!playerRef.current)
39
- return;
40
- playerRef.current.dispose();
41
- playerRef.current = null;
42
- };
43
-
44
- const onCreateAliPlayer = async () => {
45
- if (!containerRef.current)
46
- return;
47
- if (!window.Aliplayer) {
48
- await dynamicLoadJs("https://g.alicdn.com/apsara-media-box/imp-web-player/2.16.3/aliplayer-min.js");
49
- await dynamicLoadCss("https://g.alicdn.com/apsara-media-box/imp-web-player/2.16.3/skins/default/aliplayer-min.css");
50
- }
51
-
52
- onDisposeAliPlayer();
53
-
54
- const skinLayout = [
55
- { name: "bigPlayButton", align: "blabs", x: 30, y: 80 },
56
- { name: "H5Loading", align: "cc" },
57
- { name: "errorDisplay", align: "tlabs", x: 0, y: 0 },
58
- { name: "infoDisplay" },
59
- { name: "tooltip", align: "blabs", x: 0, y: 56 },
60
- { name: "thumbnail" },
61
- {
62
- name: "controlBar",
63
- align: "blabs",
64
- x: 0,
65
- y: 0,
66
- children: [
67
- { name: "playButton", align: "tl", x: 15, y: 12 },
68
- { name: "timeDisplay", align: "tl", x: 10, y: 7 },
69
- { name: "fullScreenButton", align: "tr", x: 10, y: 12 },
70
- { name: "setting", align: "tr", x: 15, y: 12 },
71
- { name: "volume", align: "tr", x: 5, y: 10 },
72
- ],
73
- },
74
- ];
75
-
76
- if (showProgress) {
77
- skinLayout[skinLayout.length - 1].children.unshift({
78
- name: "progress",
79
- align: "blabs",
80
- x: 0,
81
- y: 44,
82
- });
83
- }
84
-
85
- playerRef.current = new window.Aliplayer(
86
- {
87
- id: className,
88
- ...(source
89
- ? { source }
90
- : {
91
- vid,
92
- playauth: playAuth,
93
- qualitySort: "asc",
94
- format: "m3u8",
95
- encryptType: 1,
96
- mediaType: "video",
97
- isLive: true,
98
- rePlay: false,
99
- playsinline: true,
100
- controlBarVisibility: "hover",
101
- }),
102
- cover,
103
- width,
104
- height,
105
- autoplay,
106
- isLive,
107
- useH5Prism: true,
108
- skinLayout,
109
- },
110
- (player) => {
111
- if (autoplay) {
112
- player.play();
113
- }
114
-
115
- player.on("ended", () => {
116
- onEnded && onEnded();
117
- });
118
-
119
- player.on("timeupdate", () => {
120
- onTimeupdate && onTimeupdate(player.getCurrentTime());
121
- });
122
-
123
- if (playTime > 0) {
124
- player.seek(playTime);
125
- }
126
- },
127
- );
128
- };
129
-
130
- useEffect(() => {
131
- if (source || (vid && playAuth)) {
132
- onCreateAliPlayer();
133
- }
134
-
135
- return () => {
136
- onDisposeAliPlayer();
137
- };
138
- }, [source, vid, playAuth]);
139
-
140
- useEffect(() => {
141
- if (visibility === "hidden") {
142
- playerRef.current && playerRef.current.pause();
143
- }
144
- else {
145
- playerRef.current && playerRef.current.play();
146
- }
147
- }, [visibility]);
148
-
149
- return (
150
- <div
151
- ref={containerRef}
152
- id={className}
153
- style={{ width, height }}
154
- />
155
- );
156
- });
157
-
158
- AliPlayer.displayName = "AliPlayer";
159
-
160
- export default AliPlayer;
1
+ import{useDocumentVisibility as a}from"ahooks";import{uniqueId as e}from"lodash-es";import{forwardRef as i,useRef as r,useImperativeHandle as n,useEffect as t}from"react";import{dynamicLoadJs as l,dynamicLoadCss as s}from"../../utils/index.js";import{jsx as o}from"react/jsx-runtime";const p=i(({source:i="",vid:p="",playAuth:m="",cover:u="",width:c="100%",height:y="600px",autoplay:d=!0,showProgress:g=!0,isLive:h=!1,playTime:b=0,onEnded:w,onTimeupdate:x},f)=>{const v=r(null),k=r(null),D=a(),B=r(e("_")).current;n(f,()=>({play:()=>{v.current&&v.current.play()},pause:()=>{v.current&&v.current.pause()}}));const L=()=>{v.current&&(v.current.dispose(),v.current=null)};return t(()=>((i||p&&m)&&(async()=>{if(!k.current)return;window.Aliplayer||(window?.base?.loadDynamicResource?(await window.base.loadDynamicResource({url:"https://g.alicdn.com/apsara-media-box/imp-web-player/2.16.3/aliplayer-min.js",type:"script"}),await window.base.loadDynamicResource({url:"https://g.alicdn.com/apsara-media-box/imp-web-player/2.16.3/skins/default/aliplayer-min.css",type:"link"})):(await l("https://g.alicdn.com/apsara-media-box/imp-web-player/2.16.3/aliplayer-min.js"),await s("https://g.alicdn.com/apsara-media-box/imp-web-player/2.16.3/skins/default/aliplayer-min.css"))),L();const a=[{name:"bigPlayButton",align:"blabs",x:30,y:80},{name:"H5Loading",align:"cc"},{name:"errorDisplay",align:"tlabs",x:0,y:0},{name:"infoDisplay"},{name:"tooltip",align:"blabs",x:0,y:56},{name:"thumbnail"},{name:"controlBar",align:"blabs",x:0,y:0,children:[{name:"playButton",align:"tl",x:15,y:12},{name:"timeDisplay",align:"tl",x:10,y:7},{name:"fullScreenButton",align:"tr",x:10,y:12},{name:"setting",align:"tr",x:15,y:12},{name:"volume",align:"tr",x:5,y:10}]}];g&&a[a.length-1].children.unshift({name:"progress",align:"blabs",x:0,y:44}),v.current=new window.Aliplayer({id:B,...i?{source:i}:{vid:p,playauth:m,qualitySort:"asc",format:"m3u8",encryptType:1,mediaType:"video",isLive:!0,rePlay:!1,playsinline:!0,controlBarVisibility:"hover"},cover:u,width:c,height:y,autoplay:d,isLive:h,useH5Prism:!0,skinLayout:a},a=>{d&&a.play(),a.on("ended",()=>{w&&w()}),a.on("timeupdate",()=>{x&&x(a.getCurrentTime())}),b>0&&a.seek(b)})})(),()=>{L()}),[i,p,m]),t(()=>{"hidden"===D?v.current&&v.current.pause():v.current&&v.current.play()},[D]),o("div",{ref:k,id:B,style:{width:c,height:y}})});p.displayName="AliPlayer";export{p as default};
@@ -1,90 +1 @@
1
- import { Button, Modal } from "antd";
2
- import { useEffect, useRef, useState } from "react";
3
- import { getFileUrl } from "../../utils";
4
- import AliPlayer from "./AliPlayer";
5
-
6
- /**
7
- * 视频播放组件
8
- */
9
- const Video = ({
10
- source = "",
11
- vid = "",
12
- playAuth = "",
13
- cover = "",
14
- autoplay = true,
15
- showProgress = true,
16
- playTime = 0,
17
- inline = false,
18
- isLive = false,
19
- width = "100%",
20
- height = "600px",
21
- title = "视频",
22
- visible: externalVisible = false,
23
- onCancel,
24
- }) => {
25
- const [internalVisible, setInternalVisible] = useState(false);
26
- const playerRef = useRef(null);
27
-
28
- const visible = onCancel ? externalVisible : internalVisible;
29
- const setVisible = onCancel || setInternalVisible;
30
-
31
- const getSource = () => {
32
- if (!source)
33
- return;
34
- if (source.includes("http") || source.includes("https"))
35
- return source;
36
- else return getFileUrl() + source;
37
- };
38
-
39
- useEffect(() => {
40
- if (!inline) {
41
- if (visible) {
42
- playerRef.current && playerRef.current.play();
43
- }
44
- else {
45
- playerRef.current && playerRef.current.pause();
46
- }
47
- }
48
- }, [visible, inline]);
49
-
50
- const playerElement = (
51
- <AliPlayer
52
- ref={playerRef}
53
- source={getSource()}
54
- vid={vid}
55
- playAuth={playAuth}
56
- cover={cover}
57
- autoplay={autoplay}
58
- showProgress={showProgress}
59
- playTime={playTime}
60
- isLive={isLive}
61
- width={width}
62
- height={height}
63
- />
64
- );
65
-
66
- if (!inline) {
67
- return (
68
- <Modal
69
- open={visible}
70
- width={800}
71
- title={title}
72
- footer={[
73
- <Button key="cancel" onClick={() => setVisible(false)}>
74
- 取消
75
- </Button>,
76
- ]}
77
- maskClosable={false}
78
- onCancel={() => setVisible(false)}
79
- >
80
- {playerElement}
81
- </Modal>
82
- );
83
- }
84
-
85
- return playerElement;
86
- };
87
-
88
- Video.displayName = "Video";
89
-
90
- export default Video;
1
+ import{Modal as e,Button as r}from"antd";import{useState as t,useRef as i,useEffect as o}from"react";import{getFileUrl as l}from"../../utils/index.js";import n from"./AliPlayer.js";import{jsx as s}from"react/jsx-runtime";const a=({source:a="",vid:c="",playAuth:p="",cover:u="",autoplay:h=!0,showProgress:m=!0,playTime:d=0,inline:f=!1,isLive:y=!1,width:v="100%",height:w="600px",title:g="视频",visible:x=!1,onCancel:C})=>{const[j,A]=t(!1),P=i(null),b=C?x:j,k=C||A;o(()=>{f||(b?P.current&&P.current.play():P.current&&P.current.pause())},[b,f]);const L=s(n,{ref:P,source:(()=>{if(a)return a.includes("http")||a.includes("https")?a:l()+a})(),vid:c,playAuth:p,cover:u,autoplay:h,showProgress:m,playTime:d,isLive:y,width:v,height:w});return f?L:s(e,{open:b,width:800,title:g,footer:[s(r,{onClick:()=>k(!1),children:"取消"},"cancel")],maskClosable:!1,onCancel:()=>k(!1),children:L})};a.displayName="Video";export{a as default};
package/css/common.less CHANGED
@@ -20,6 +20,10 @@
20
20
  height: 10px;
21
21
  background-color: rgb(241, 241, 242);
22
22
  }
23
+
24
+ + .table-layout .@{ant-prefix}-pro-table-list-toolbar-container {
25
+ padding-top: 26px !important;
26
+ }
23
27
  }
24
28
 
25
29
  .table-layout {
@@ -1,7 +1 @@
1
- /**
2
- * 数据字典 appKey 枚举
3
- */
4
- export const DICTIONARY_APP_KEY_ENUM = {
5
- DEFAULT: "0bb989ecada5470c87635018ece9f327",
6
- GWJ: "0bb989ecada5470c87635018ece9f327",
7
- }
1
+ const c={DEFAULT:"0bb989ecada5470c87635018ece9f327",GWJ:"0bb989ecada5470c87635018ece9f327"};export{c as DICTIONARY_APP_KEY_ENUM};
@@ -1,37 +1 @@
1
- /**
2
- * 表单项类型枚举
3
- */
4
- export const FORM_ITEM_RENDER_ENUM = {
5
- /** 映射为 antd Input */
6
- INPUT: "input",
7
- /** 映射为 antd Input.TextArea */
8
- TEXTAREA: "textarea",
9
- /** 映射为 antd InputNumber */
10
- INPUT_NUMBER: "inputNumber",
11
- /** 映射为 antd InputNumber */
12
- NUMBER: "number",
13
- /** 映射为 antd Select */
14
- SELECT: "select",
15
- /** 映射为 antd Radio.Group */
16
- RADIO: "radio",
17
- /** 映射为 antd Checkbox.Group */
18
- CHECKBOX: "checkbox",
19
- /** 映射为 antd DatePicker,日期格式为YYYY-MM-DD */
20
- DATE: "date",
21
- /** 映射为 antd DatePicker.MonthPicker,日期格式为YYYY-MM */
22
- DATE_MONTH: "dateMonth",
23
- /** 映射为 antd DatePicker.YearPicker,日期格式为YYYY */
24
- DATE_YEAR: "dateYear",
25
- /** 映射为 antd DatePicker.WeekPicker,日期格式为YYYY-wo */
26
- DATE_WEEK: "dateWeek",
27
- /** 映射为 antd DatePicker.RangePicker,日期格式为YYYY-MM-DD */
28
- DATE_RANGE: "dateRange",
29
- /** 映射为 antd DatePicker,日期格式为YYYY-MM-DD HH:mm:ss */
30
- DATETIME: "datetime",
31
- /** 映射为 antd DatePicker.RangePicker,日期格式为YYYY-MM-DD HH:mm:ss */
32
- DATETIME_RANGE: "datetimeRange",
33
- /** 映射为 antd Divider */
34
- DIVIDER: "divider",
35
- /** 映射为 antd FormList */
36
- FORM_LIST: "formList",
37
- };
1
+ const e={INPUT:"input",TEXTAREA:"textarea",INPUT_NUMBER:"inputNumber",NUMBER:"number",SELECT:"select",RADIO:"radio",CHECKBOX:"checkbox",DATE:"date",DATE_MONTH:"dateMonth",DATE_YEAR:"dateYear",DATE_WEEK:"dateWeek",DATE_RANGE:"dateRange",DATETIME:"datetime",DATETIME_RANGE:"datetimeRange",DIVIDER:"divider",FORM_LIST:"formList"};export{e as FORM_ITEM_RENDER_ENUM};
@@ -1,31 +1 @@
1
- // 隐患来源
2
- export const HIDDEN_SOURCE_ENUM = [
3
- { bianma: "1", name: "隐患快报" },
4
- { bianma: "2", name: "清单排查" },
5
- { bianma: "4", name: "安全环保检查(监管端)" },
6
- { bianma: "5", name: "安全环保检查(企业端)" },
7
- { bianma: "6", name: "消防检查" },
8
- ];
9
-
10
- // 隐患状态
11
- export const HIDDEN_STATE_ENUM = [
12
- { bianma: "100", name: "待确认" },
13
- { bianma: "200", name: "待整改" },
14
- { bianma: "201", name: "确认打回" },
15
- { bianma: "202", name: "特殊处置" },
16
- { bianma: "300", name: "待验收" },
17
- { bianma: "301", name: "已验收" },
18
- { bianma: "302", name: "验收打回" },
19
- { bianma: "400", name: "归档" },
20
- { bianma: "99", name: "关闭" },
21
- { bianma: "98", name: "安全环保检查/清单排查暂存" },
22
- { bianma: "102", name: "安全环保检查,隐患带指派" },
23
- { bianma: "97", name: "已过期" },
24
- { bianma: "101", name: "忽略隐患" },
25
- ];
26
-
27
- // 隐患整改类型
28
- export const HIDDEN_RECTIFICATION_TYPE_ENUM = [
29
- { bianma: 1, name: "立即整改" },
30
- { bianma: 2, name: "限期整改" },
31
- ];
1
+ const a=[{bianma:"1",name:"隐患快报"},{bianma:"2",name:"清单排查"},{bianma:"4",name:"安全环保检查(监管端)"},{bianma:"5",name:"安全环保检查(企业端)"},{bianma:"6",name:"消防检查"}],n=[{bianma:"100",name:"待确认"},{bianma:"200",name:"待整改"},{bianma:"201",name:"确认打回"},{bianma:"202",name:"特殊处置"},{bianma:"300",name:"已整改"},{bianma:"301",name:"已验收"},{bianma:"302",name:"验收打回"},{bianma:"400",name:"归档"},{bianma:"99",name:"关闭"},{bianma:"98",name:"安全环保检查/清单排查暂存"},{bianma:"102",name:"安全环保检查,隐患带指派"},{bianma:"97",name:"已过期"},{bianma:"101",name:"忽略隐患"}],m=[{bianma:1,name:"立即整改"},{bianma:2,name:"限期整改"}];export{m as HIDDEN_RECTIFICATION_TYPE_ENUM,a as HIDDEN_SOURCE_ENUM,n as HIDDEN_STATE_ENUM};